Hi All,
I'm having a problem loading in my player two sprite for my pong game. For some reason, it seems like my sprite is becoming corrupted after the initial load. Here is the code I'm using to load my sprites
;;Load Dave Ninja Standing Sprite
LoadSprites:
LoadNinjas:
LDA #$01
CMP #STATEPLAYING
BNE DaveStandingDone
LoadDaveStandingLoop:
LDA DaveNinjaStand, x ; load data from address (sprites + x)
STA $0204, x ; store into RAM address ($0200 + x)
INX ; X = X + 1
CPX #$40 ; Compare X to hex $28, decimal 40
BNE LoadDaveStandingLoop ; Branch to LoadSpritesLoop if compare was Not Equal to zero
; if compare was equal to 4, keep going down
DaveStandingDone:
LoadJohnStandingLoop:
LDA JohnNinjaStand, x
STA $0244, x
INX
CPX #$40
BNE LoadJohnStandingLoop
JohnStandingDone:
LoadScoreSprites:
LDA scoresprites, x ; load data from address (sprites + x)
STA $0284, x ; store into RAM address ($0200 + x)
INX ; X = X + 1
CPX #$18 ; Compare X to hex $18, decimal 24
BNE LoadScoreSprites ; Branch to LoadSpritesLoop if compare was Not Equal to zero
; if compare was equal to 4, keep going down
LoadScoreSpritesDone:
RTS
Just standard stuff. A simple loop to load the Ninja Sprites and Score Sprites. On the title screen, when the start button is pressed I shut rendering off and load the character sprites, score sprites and background. Also, my character sprites (technically metasprites I believe) are quite large. 4x4 tiles for a total of 16 tiles per character.
Any help would be appreciated guys. This is the last hoop I have to jump through before I get started on the sound engine so I'm really excited to solve this issue.
Also,
attatched is a zip file containing the code and the rom for the game. I've scanned through it in and out but cannot locate the issue.
-Mysteriousity
I'm having a problem loading in my player two sprite for my pong game. For some reason, it seems like my sprite is becoming corrupted after the initial load. Here is the code I'm using to load my sprites
Code:
;;Load Dave Ninja Standing Sprite
LoadSprites:
LoadNinjas:
LDA #$01
CMP #STATEPLAYING
BNE DaveStandingDone
LoadDaveStandingLoop:
LDA DaveNinjaStand, x ; load data from address (sprites + x)
STA $0204, x ; store into RAM address ($0200 + x)
INX ; X = X + 1
CPX #$40 ; Compare X to hex $28, decimal 40
BNE LoadDaveStandingLoop ; Branch to LoadSpritesLoop if compare was Not Equal to zero
; if compare was equal to 4, keep going down
DaveStandingDone:
LoadJohnStandingLoop:
LDA JohnNinjaStand, x
STA $0244, x
INX
CPX #$40
BNE LoadJohnStandingLoop
JohnStandingDone:
LoadScoreSprites:
LDA scoresprites, x ; load data from address (sprites + x)
STA $0284, x ; store into RAM address ($0200 + x)
INX ; X = X + 1
CPX #$18 ; Compare X to hex $18, decimal 24
BNE LoadScoreSprites ; Branch to LoadSpritesLoop if compare was Not Equal to zero
; if compare was equal to 4, keep going down
LoadScoreSpritesDone:
RTS
Just standard stuff. A simple loop to load the Ninja Sprites and Score Sprites. On the title screen, when the start button is pressed I shut rendering off and load the character sprites, score sprites and background. Also, my character sprites (technically metasprites I believe) are quite large. 4x4 tiles for a total of 16 tiles per character.
Any help would be appreciated guys. This is the last hoop I have to jump through before I get started on the sound engine so I'm really excited to solve this issue.
Also,
attatched is a zip file containing the code and the rom for the game. I've scanned through it in and out but cannot locate the issue.
-Mysteriousity