I'm planning to translate in french, the first bunnyboy's tutorial.
I have to say that this doc is really interesting and very clear.
However, I think there may be a mistake within the Multiple Sprites part. First of all, he defines sprites data this way :
Then, he gives a sample that create a loop to copy that data into memory :
I think that the value #$20 is wrong with the sprite data given. Indeed, 4 sprites data have been set, so there are 4*4 bytes of data.
So I think he should write CPX #$10 instead of CPX #$20.
Am I right?
I have to say that this doc is really interesting and very clear.
However, I think there may be a mistake within the Multiple Sprites part. First of all, he defines sprites data this way :
Code:
sprites:
;vert tile attr horiz
.db $80, $32, $00, $80 ;sprite 0
.db $80, $33, $00, $88 ;sprite 1
.db $88, $34, $00, $80 ;sprite 2
.db $88, $35, $00, $88 ;sprite 3
;vert tile attr horiz
.db $80, $32, $00, $80 ;sprite 0
.db $80, $33, $00, $88 ;sprite 1
.db $88, $34, $00, $80 ;sprite 2
.db $88, $35, $00, $88 ;sprite 3
Then, he gives a sample that create a loop to copy that data into memory :
Code:
LoadSprites:
LDX #$00 ; start at 0
LoadSpritesLoop:
LDA sprites, x ; load data from address (sprites + x)
STA $0200, x ; store into RAM address ($0200 + x)
INX ; X = X + 1
CPX #$20 ; Compare X to hex $20, decimal 32
BNE LoadSpritesLoop ; Branch to LoadSpritesLoop if compare was Not Equal to zero
; if compare was equal to 32, keep going down
LDX #$00 ; start at 0
LoadSpritesLoop:
LDA sprites, x ; load data from address (sprites + x)
STA $0200, x ; store into RAM address ($0200 + x)
INX ; X = X + 1
CPX #$20 ; Compare X to hex $20, decimal 32
BNE LoadSpritesLoop ; Branch to LoadSpritesLoop if compare was Not Equal to zero
; if compare was equal to 32, keep going down
I think that the value #$20 is wrong with the sprite data given. Indeed, 4 sprites data have been set, so there are 4*4 bytes of data.
So I think he should write CPX #$10 instead of CPX #$20.
Am I right?