awsm
Registered: Feb 2015 Posts: 13 |
Moving koala to different address (n00b)
I'm having a hard time understanding why this doesn't work for me:
The code below loads a koala file to $2000. All fine.
But in combination with music (starting at $1000) I get the music messed up. I figured that the pic overwrites parts of the music (>4096 bytes). Any other starting address than $2000 fails however, showing just garbage (updated $d018 too, but it didn't do the trick).
PICTURE = $2000
VIDEO = PICTURE+$1f40
COLOR = PICTURE+$2328
BACKGROUND = PICTURE+$2710
* = PICTURE
!binary "resources/mypic.kla",,2
* = $c000
init_koala
sei
lda #$00
sta $d020 ; Border Color
lda BACKGROUND
sta $d021 ; Screen Color
; Transfer Video and Color
ldx #$00
; Transfers video data
vloop lda VIDEO,x
sta $0400,x
lda VIDEO+$100,x
sta $0500,x
lda VIDEO+$200,x
sta $0600,x
lda VIDEO+$2e8,x
sta $06e8,x
; Transfers color data
lda COLOR,x
sta $d800,x
lda COLOR+$100,x
sta $d900,x
lda COLOR+$200,x
sta $da00,x
lda COLOR+$2e8,x
sta $dae8,x
inx
bne vloop
;
; Bitmap Mode On
;
lda #$3b
sta $d011
;
; MultiColor On
;
lda #$d8
sta $d016
; When bitmap adress is $2000
; Screen at $0400
; Value of $d018 is $18
lda #$18
sta $d018
jmp *
|