Page 1 of 2

Real 6502 with 1 MB virtual mode.

Posted: Sun Jun 15, 2014 1:43 pm
by grzeg
Hi all.
This expansion was developed by me for the Commodore C64.. The expansion is full compatible to software c64 . With this expansion you will get a 16 virtual c64 for your task .
Features:
1.This expansion divides the 1 MB of memory to sixteen blocks of 64 kB .
2.VIC (Video RAM) and CPU operated in this same time in one , or two 64 kB BANK RAM
3.Refreshes of RAM without additional cycles.
4. 0.5 kB RAM in I/O ($D600 - $D7FF) for program MMU
5. The block switcher in I/O $d500 :
b7..b4 - BANK for VIC acces
b3...b0 - BANK for CPU acces
6.each "virtual task" has a zero page and stack, and 64kB RAM.
I/O , and ROM ist one for all task.
http://obrazki.elektroda.pl/4533333100_1389612160.jpg
http://obrazki.elektroda.pl/5885549400_1389612161.jpg
http://obrazki.elektroda.pl/8445626600_1389612163.jpg
And in work :
https://www.youtube.com/watch?v=NKrjpoJ ... e=youtu.be

Re: Real 6502 with 1 MB virtual mode.

Posted: Sun Jun 15, 2014 5:49 pm
by BigDumbDinosaur
This seems suspiciously like the scheme developed by Paul Bosaki and described in the August 1989 issue of Transactor magazine.

Re: Real 6502 with 1 MB virtual mode.

Posted: Sun Jun 15, 2014 8:00 pm
by Dr Jefyll
Welcome, grzeg, and congratulations on your project. :)

BigDumbDinosaur, it took me less than a minute to notice some clear differences between Bosaki's project and this one. The differences may be a variation in implementation -- or they may indicate a substantially different design. In either case I'll be glad to learn more, and make our new member feel at home here.

-- Jeff
Edit: add image

Re: Real 6502 with 1 MB virtual mode.

Posted: Sun Jun 15, 2014 8:23 pm
by BigEd
Hi Grzeg, welcome! Nice project - would like to know more!
Cheers
Ed

Re: Real 6502 with 1 MB virtual mode.

Posted: Sun Jun 15, 2014 8:50 pm
by grzeg
I did not know Bosak also solutions. I see some similarities, but many differences.
For me, switching is the entire RAM addresses $ 0000 - FFFF, not just above $ 0400.
Therefore, each bank can initiate a full system.To allows, for example to run programs not written for this system in multitasking, and or different versions of the KERNEL.
VIC and the CPU can independently use different RAM banks.
In addition, I use the RAM is not limited to 1 bit 256 kB
(7 bit refreshing)
I attach a diagram without refreshing logic:

http://gsmhome.elektroda.eu/schematfree.pdf

Re: Real 6502 with 1 MB virtual mode.

Posted: Tue Jun 17, 2014 9:09 am
by Dr Jefyll
Hi grzeg,

I am not a Commodore 64 expert, and some of your description I didn't understand. But the schematic answered most of my questions, and I decided to post an excerpt here:
1MB C64.gif
On the right I see you have a SIMM memory module, with most of the connections attaching via jumper wires from where the original DRAM chips used to be. But, with 16 times as much memory, the SIMM has two extra (multiplexed) address inputs.

Looking upstream, I expected to see four non-multiplexed address lines (which multiplex as 2 bits of Row address and 2 bits of Column address). Okay, but that 'LS153 mux has eight inputs, not four! -- and all eight lines come from the '273 output port. Time to look more closely. When AEC from the VIC chip is high, the upper 4 bits of the '273 output port will select which of 16 memory banks will be active. When AEC is low, the lower 4 bits of the port will select which bank will be active. Either way, the output port always remains in control.
grzeg wrote:
0.5 kB RAM in I/O ($D600 - $D7FF) for program MMU
I guess this is where you store the subroutine that alters the output port and selects a new DRAM bank. (A 32K by 8 static RAM chip is visible elsewhere in the schematic, attached so only 512 bytes are used.) If you tried to store that subroutine in the DRAM instead, you'd "pull the rug out from under your own feet" when the bank change took effect! Very interesting -- thanks for sharing this.

-- Jeff

Re: Real 6502 with 1 MB virtual mode.

Posted: Tue Jun 17, 2014 3:56 pm
by grzeg
Hi Dr Jefyll , exactly :D
Example code ( ;this code must be $d600 - $D7FF) for task switch.
NMI must OFF or in $d600 $d7ff

Code: Select all

D700
	php ; go here if you want to use "jsr "
IrqNmiBrk:
	pha ; or here if use IRQ,NMI, BRK code
	txa
	pha
	tya
	pha
	tsx
	stx $03 , for example a store stack pointer in zero page $03
....
	sei ; switch to another BANK -0x , or xx with VIC (Video RAM)
	lda #$0x
	sta d500
	ldx $03 ; stack pointer for task X from another $03 in all BANKs
	txs
	pla
	tay
	pla
	tax
	pla
	rti
And copy one page :

Code: Select all

	sei
	ldy #00
	ldx #kd ;d destination
loop: 	lda #kx ;x - BANK source
	sta D500 ; BANK source
	lda source,y
	stx D500 ; BANK d
	sta dest ,y
	iny
	bne loop
	lda #kk ; k current BANK
	sta d500
	plp
	rts

Re: Real 6502 with 1 MB virtual mode.

Posted: Tue Jun 17, 2014 7:25 pm
by richardc64
This is much simpler than Bosaki's design, which provides different amounts of "common memory" similar to that of the C-128. However, the 1/2K would be inaccessible if the C64 was in a configuration with I/O banked out.

I see that the SIMM has A10 grounded, which means half of it is unused, and you'd have to use a 2MB SIMM to get 1MB. But aren't SIMMs of any size getting hard to find?

Nice work, grzeg. Can you explain the refreshing a little more? Thanks.

Re: Real 6502 with 1 MB virtual mode.

Posted: Tue Jun 17, 2014 9:41 pm
by grzeg
richardc64
Standard sizes SIMM 30-pin : 256 KB, 1 MB, 4 MB, 16 MB,.
A9 is N/C on 256kB.
A10 is N/C on 256kB and 1MB.
A11 is N/C on 256kB, 1MB and 4MB sticks
A10 & A11 is grounded for 4 MB SIMM - without grounded to not work properly.
First of all I wanted to build a system for parallel operation.
Small VMWare for the C64 ;)
So I'm 16 * 64kB RAM, 16 * Stack and 16 *the zero page.

Refreshing uses "Hidden Refreh"
I will try to soon make available all software and source
I just need to update your website;)

Re: Real 6502 with 1 MB virtual mode.

Posted: Tue Jun 17, 2014 10:02 pm
by grzeg
richardc64 wrote:
However, the 1/2K would be inaccessible if the C64 was in a configuration with I/O banked out.
A total of few programs use the mode in which no I / O
C128 was not even fully compatible and retained c64 mode ;)

Re: Real 6502 with 1 MB virtual mode.

Posted: Thu Jul 03, 2014 5:33 pm
by grzeg

Re: Real 6502 with 1 MB virtual mode.

Posted: Wed Jul 23, 2014 11:52 am
by grzeg

Code: Select all

; on X goto / on X gosub
; in Acc = xx    - x bank  0x only CPU , x0 only VIC , xx CPU VIC
     goto


Re: Real 6502 with 1 MB virtual mode.

Posted: Wed Jul 23, 2014 12:18 pm
by grzeg
How to switch BANK without i/O ?
This code can be anywhere in the RAM
grzeg wrote:

Code: Select all

; on X goto / on X gosub
; in Acc = xx    - swich to bank  X 0x only CPU , x0 only VIC , xx CPU+VIC to BANK X
                  
                  lda #$55    ; BANK5
                  jsr goto

     goto
                  sei
                  ldx $01           ;safe conf i/o ROM / RAM for bank 0       this code execute in BANK 0
                  stx tmp01
                  ldx #$34         ; only RAM 
                  stx $01 
                  sta D500         ; swich BANK
;-----------------------------------------------
                                                                                             and this code ececute BANK x
                  jmp (main)    ; or jsr  
endtask       
                  lda #$37
                  sta $01
                  lda #00
                 sta D500 
;----------------------------------------------
                 lda tmp01           ;and this again in BANK 0
                 sta $01
                 cli
                 rts
;------------------------------------------------
main ............
       ....
       jmp endtask   ;or RTS


Re: Real 6502 with 1 MB virtual mode.

Posted: Sun Aug 17, 2014 10:24 pm
by grzeg

Re: Real 6502 with 1 MB virtual mode.

Posted: Mon Aug 18, 2014 12:47 am
by BigEd
Wow! So, how does the Apple II code for keyboard and screen interact with the C64 hardware?