Then I saw some of the VIC-20 demos that use the RAM in $0000-$03ff and that got me thinking. 128 x 256 is possible with putting the video-ram at $0200 or $0000 and the char-ram at $1000-$3fff - of couse BASIC is no longer an option when messing with the lower 1K. 184 x 176 is also a nice resolution possible that way.
However I always wondered if it was possible to max out all the 5K the VIC-chip can use from $0000-$03ff and $1000-$3fff (sadly the 3K block from $0400-$0fff can't be seen by the VIC even if expansion memory is present)
Anyway, I came up with a working example of a 160 * 240 resolution. This is done by using a standard 160 * 192 video and then switching the video and char ram from $1000 to $0000 at the right raster line, providing an extra 160*48 graphic and switching back once through with the extra video.
I realize this mode is probably not good for anything else than showing pictures. Calculating a pixel position is tough, since the memory layout is pretty weird.
Source code for activating the mode below. A (poor) example that fills the screen with random noise (= the recent raster line) attached as well. Load ,8,1 - start with SYS 8192 - oh yes, this is for PAL-VIC only. Actually I only tested it in VICE and would love feedback if it works on a REAL VIC.
http://www.tokra.de/vic/rasterhires.prg
http://www.tokra.de/vic/rasterhires.asm
http://www.tokra.de/vic/hiresdemo.prg
The code below was done with the VIC 20 Prog Gen. Does anyone know how to do a sta $00ec,x without having it translating to a zeropage sta $ec,x ? Any other comments/improvments on the code are welcome, I'm just starting to re-learn 6502 assembler.
Code: Select all
; Raster-Split-Hires - True 160 * 240 pixels
; only for PAL-VIC 20
; Video-Ram Top: 4096-4351 = 240 double height chars
; Char-Ram Top: 4352-8191 = 3840 Byte = 30720 pixels(standard 160*192 res)
; Char-Ram Bottom1: 0-239 = 240 Byte = 1920 pixels
; Video-Ram Bottom: 240-299 = 60 double height chars
; Char-Ram Bottom2: 304-1023 = 720 Byte = 5760 pixels
*=$2000
sei ; Set Interrupt Flag
ldy #$10
ldx #$00
txa
clear1
sta $1000,x
inx
bne clear1
inc clear1+2
dey
bne clear1
lda #$10
sta clear1+2
ldy #$04
lda #$00
clear2
sta $0300,x
sta $9700,x
inx
bne clear2
dec clear2+2
dec clear2+5
dey
bne clear2
lda #$03
sta clear2+2
lda #$97
sta clear2+5
charmap1
ldx #$10
loop1 txa
sta $0ff0,x
inx
bne loop1
charmap2 txa
sta $f0,x
inx
cpx #$0f
bne charmap2
ldx #$13
loop2 txa
byte $9d ; sta $00ec,x (since x = $13 from $00ff)
byte $ec
byte $00
inx
cpx #$40
bne loop2
show
lda #$0e
sta $9000
lda #$19
sta $9001
lda #$1f
sta $9003
ldx #$14
stx $9002
loop ldy #$cc
sty $9005
ldy #$88
lda #$79
raster cmp $9004
bne raster
sty $9005
lda #$91
raster2 cmp $9004
bne raster2
beq loop