I am currently testing out some stuff in assembly with C64Studio and Vice and I noticed something with odd sprites.
My code starts at $1000 and my sprites at $2000 but when I try to lower the first sprite's address, I only get random stuff.
I tried to put the sprite at $1FC0 with #$7F as the pointer and $1080 with #$42.
But when I go up (like $2040/#$81 and $3000/#$C0), it works perfectly.
Here is the code I used:
* = $1000
PRA = $dc00 ; CIA#1 (Port Register A)
DDRA = $dc02 ; CIA#1 (Data Direction Register A)
PRB = $dc01 ; CIA#1 (Port Register B)
DDRB = $dc03 ; CIA#1 (Data Direction Register B)
keyboard_setup
lda #%11111111
sta DDRA
lda #%00000000
sta DDRB
lda #%011111111
sta PRA
screen_init
jsr screen_clear
lda #$FE ; light purple
sta $D020 ;Frame
lda #$F6 ; purple
sta $D021 ;Center
sprite_setup
lda #$80 ;-> $2000
sta $07F8 ;1(8) -> 8(F)
lda #%00000001
sta $D015
lda #$95
sta $D000
sta $D001
main
lda PRB
and #%00010000
bne main
rts
screen_clear
lda #$20
sta $0400,x
sta $0500,x
sta $0600,x
sta $06e8,x
lda #$00
sta $d800,x
sta $d900,x
sta $da00,x
sta $dae8,x
inx
bne screen_clear
rts
* = $2000
!byte $c0,$00,$03,$81,$00,$01,$01,$3e
!byte $00,$01,$3e,$00,$01,$22,$00,$01
!byte $36,$00,$01,$3e,$00,$01,$71,$c0
!byte $03,$f7,$c0,$03,$f6,$c0,$03,$b4
!byte $40,$03,$b6,$c0,$01,$36,$c0,$00
!byte $3b,$80,$00,$21,$00,$00,$22,$00
!byte $00,$22,$00,$00,$22,$00,$00,$22
!byte $00,$80,$00,$01,$c0,$00,$03,$01
And these are the kind of sprites I get: (L:$2000/#$80 R:$1FC0/#$7F)
Is there some kind of limitation to where the sprites can be in memory or am I missing something else ?