Repository navigation
Expand file tree
/
Copy pathcharset.asm
More file actions
50 lines (42 loc) · 3.03 KB
/
Copy pathcharset.asm
File metadata and controls
50 lines (42 loc) · 3.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
*=$1000
;http://dustlayer.com/vic-ii/2013/4/23/vic-ii-for-beginners-part-2-to-have-or-to-not-have-character
Character_Set
sei ; disable interrupts while we copy
ldx #$08 ; we loop 8 times (8x255 = 2Kb)
lda #$33 ; make the CPU see the Character Generator ROM...
sta $01 ; ...at $D000 by storing %00110011 into location $01
lda #$d0 ; load high byte of $D000
sta $fc ; store it in a free location we use as vector
LDA #$30 ;
STA $fe ;
LDA #0 ;
STA $fd
ldy #$00 ; init counter with 0
sty $fb ; store it as low byte in the $FB/$FC vector
loop lda ($fb),y ; read byte from vector stored in $fb/$fc
sta ($fd),y ; write to the RAM under ROM at same position
iny ; do this 255 times...
bne loop ; ..for low byte $00 to $FF
inc $fc ; when we passed $FF increase high byte...
inc $fe
dex ; ... and decrease X by one before restart
bne loop ; We repeat this until X becomes Zero
lda #$37 ; switch in I/O mapped registers again...
sta $01 ; ... with %00110111 so CPU can see them
cli ; turn off interrupt disable flag
LDA #28
STA $d018 ;
; ***********************************************************************************
;
ldy #0
@loop tya
sta $400,y
sta $500,y
sta $600,y
sta $700,y
dey
bne @loop
lda #0 ; Redefine one character
sta $3000
sta $3001
rts