Alot of debugging later and I have character maps showing properly-ish:
The picture above shows the result of a simple program that puts char map at 7168, with screen at 4096 (which is were it was with a 24K expansion). It then draws the first 44 characters on top of the screen, and fills them with %10101010 and %01010101 bit patterns. The top line has colors changed from 1 to 22 (above 16 it overflows), so character 9-16 is multicolor.
Most of the screen is space (char $20) which I didn't fill with anything, so its just showing some noise. The "R" is the first letter of the word "READY.", and since I put the cursor there, its reversed and thus showing the upper part of the char map. Since internal memory ends at 8191, the upper half of the char map (the total char map is 2048 bytes), wraps up into character ROM. Thus, it shows the memory area 32768 and upwards. So a reversed "R" in this case will show a normal "R" instead, which it does.
The PC still shows the grabbed output of the VIC chip, so we can see that the VGA and VIC chip output corresponds quite ok (some glitches remain, but not so many!).
Here is also the source of the simple program I used above:
Code: Select all
*=8192
main
;modify screen position
sei
lda $9002
and #127
ora #0
sta $9002
lda #%11001111 ;1000 screen, 1C00 charmem
sta $9005
ldy #3
ldx #255
lp0
lda #32
sta $1000,x
sta $1100,x
lda #6
sta $9400,x
sta $9500,x
dex
bne lp0
ldx #22
lp1
dex
txa
sta $1000,x
sta $1016,x
sta $9400,x
lda #6
sta $9416,x
;sta $9416,x
;sta $942c,x
txa
bne lp1
ldy #176
lp2
dey
dey
lda #%10101010
sta $1C00,y
lda #%01010101
sta $1C01,y
tya
bne lp2
rts
I also tried to run a game at this point (CarRace), but it didn't show correctly. I then tried to run a simple demo at $a000 instead (and manually starting it with SYS40960), but it crashed as well. Then I found that there was some strange thing with the BLK5 definition, and I had to stop..
Hopefully it can run some games soon. Raster effects are not in there yet, but both screen map and character map works. Double buffering should also work since it grabs all bytes in the lower 8K memory segment and store them. Upper/lower case graphics also works.
Code: Select all
;Super Vixen screen map locations:
;Screen location Color $9005 $9002 Values
;Decimal Hex Map Bit7-4 Bit7 $9005 $9002
;0 $0000 $9400 1000 0 128 0
;512 $0200 $9600 1000 1 128 128
;1024 $0400 $9400 1001 1 144 0
;1536 $0600 $9600 1001 0 144 128
;2048 $0800 $9400 1010 1 160 0
;2560 $0A00 $9600 1010 0 160 128
;3072 $0C00 $9400 1011 1 176 0
;3584 $0E00 $9600 1011 0 176 128
;4096 $1000 $9400 1100 0 192 0
;4608 $1200 $9600 1100 1 192 128
;5120 $1400 $9400 1101 1 208 0
;5632 $1600 $9600 1101 0 208 128
;6144 $1800 $9400 1110 1 224 0
;6656 $1A00 $9600 1110 0 224 128
;7168 $1C00 $9400 1111 1 240 0
;7680 $1E00 $9600 1111 0 240 128
So basically the VGA shows everything the VIC will, but it can also put the screen map to the RAM1-RAM3 location as it has the memory inside. Hopefully this is compatible with the VFLI mod (but still untested). Character map can be put to the same area, but for obvious reasons they should not overlap.