Thanks, now works as I wanted.
Code: Select all
lda #%00001000 ;base value for $2000 (change lower 2 bits for other NTs)
sta BOMB_PPU_TILE1_AddrHI
lda HERO_1_Y
clc
adc #7 ;"centering"
and #%11110000 ;y bomb in steps of 16pix
asl A
rol BOMB_PPU_TILE1_AddrHI
asl A
rol BOMB_PPU_TILE1_AddrHI
sta BOMB_PPU_TILE1_AddrLO
lda HERO_1_X
clc
adc #7 ;"centering"
and #%11110000 ;x bomb in steps of 16pix
lsr A
lsr A
lsr A
ora BOMB_PPU_TILE1_AddrLO
sta BOMB_PPU_TILE1_AddrLO
clc
adc #1
sta BOMB_PPU_TILE2_AddrLO
clc
adc #$1F
sta BOMB_PPU_TILE3_AddrLO
clc
adc #1
sta BOMB_PPU_TILE4_AddrLO
I would still need a method of calculating the PPU address of the tiles to the X / Y coordinate of the sprite.

I need this to determine the X / Y co-ordinates of a collision during a bomb explosion. Unfortunately, I was not able to simply copy the X / Y of the SPRITE position at the moment the bomb is placed, which is not set to the SPRITE position accuracy (the bomb is set to 16 pixels "step")
I'm trying to create a logical pattern, but of course I'm not going to take it in the code:
X 00,10,20,30,40,50,60,70,80,90,A0,B0,C0,D0,E0,F0
Y 00,10,20,30,40,50,60,70,80,90,A0,B0,C0,D0,E0 (sbc #1)
2000=X00/Y00
2002=X10/Y00
2004=X20/Y00
2006=X30/Y00
(...)
2000=X00/Y00
2040=X00/Y10 (Y sbc #1)
2080=X00/Y20 (Y sbc #1)
20C0=X00/Y30 (Y sbc #1)
2100=X00/Y40 (Y sbc #1)
(...)
2042=X10/Y10 (Y sbc #1)
(...)