Hier der Code mit allen Änderungen (finde das immer gut, den Stand auch wieder zu posten für andere)
Code
petscii_init
lda #<screen_002 ; address low
sta $03 ; store in ZP
lda #>screen_002 ; address high
sta $04 ; store in ZP
lda #<screen_002+1002 ; address low
sta $05 ; store in ZP
lda #>screen_002+1002 ; address high
sta $06 ; store in ZP
ldy #0
lda ($03),y ; load bg color
sta $d020 ; store bg color
iny
lda ($03),y ; load border color
sta $d021 ; store border color
inc $03 ; increment 2 times to get to the char ram
inc $03
ldx #4 ; loop counter
ldy #0 ; value index for loop
petsciiloop
lda ($03),y ; load value in address to read from
sr sta $0400,y ; store value in screen ram
lda ($05),y ; load value in address to read from
cr sta $d800,y ; store value in screen ram
iny ; we want to cycle all 256 values
bne petsciiloop ; not 0 again yet? repeat
inc $04 ; increment address high in ZP
inc $06
inc sr+2 ; increment address high of screen ram
inc cr+2 ; increment address high of color ram
dex ; decrement loop counter
bne petsciiloop ; end of loop reached?
rts ; done
Alles anzeigen