thanks for all of your suggests, I'm learning a lot of things in this forum, but the ASM for Nes always give me new challenges. I will try to explain my problem. In my Arkanoid clone I copied all the tiles on RAM to check the collision detection, everything works great, the collision works, the VRAM is updated correctly so I can see the change on the background... Until the tile 255!
Code: Select all
LDA #$00
STA BALL_POS_X_ON_TILE
STA BALL_POS_Y_ON_TILE
LDA BALL_POS_X
LSR A
LSR A
LSR A ; Divide by 8
STA BALL_POS_X_ON_TILE
LDA BALL_POS_Y
LSR A
LSR A
LSR A ; Divide by 8
STA BALL_POS_Y_ON_TILE
...
LDX #$00
ComputeXYOnTile:
LDA BALL_POS_X_ON_TILE
CLC
ADC #$20
STA BALL_POS_X_ON_TILE
INX
CPX BALL_POS_Y_ON_TILE
BNE ComputeXYOnTile
....
PerformBallColWithBrickLeft:
LDX BALL_POS_X_ON_TILE
LDA $0400, x ( $400 is where the ram map begin )
CMP #$2D
BEQ PerformBallCollisionWithBrick
...
Thanks a lot, this is the last big "problem" to solve to finish my first demo!