16 usuários online: AbeLinkn, ageVerrly,  Alex, CalHal, Domokun007, E-man38, Fingolfin, h.carrell, mathie, MercuryPenny, nanec, OffByWon, RichardDS90, Squiggs, TheJank, vampirelich - Visitantes: 78 - Bots: 176
Usuários: 55.611 (2.436 ativos)
Último usuário: EEEEEEE

ExLevel support for Explosion Sensitive Blocks


Explosion Sensitive Blocks is a nice patch that allows the bob-omb explosions to destroy user-specified map16 blocks.

This patch has been created way before Extended Level Modes were introduced in LM 3.00, so naturally it doesn't quite work as intended when using them. Usually an explosion will not hit blocks placed in extended screens. I have a single instance of a block that will spawn the "breaking" particles, but it does not disappear.

corrosive's comment on the patch page mentions using other map16 pointers (found at $0BF6) that are used for ExLevels. Digging through the code I believe this to be the relevant part:

;ADC $0BF6|!base2,X    
ADC.l $00BA60|!base3,X       
STA $05                   
;LDA $0C56|!base2,X    
LDA.l $00BA9C|!base3,X       
ADC $01                   
STA $06       

The two lines that are commented (that would replace the respective following lines) were my first humble attempt for a quick fix but it didn't really do anything. It looks like it loads the pointers from the ROM, but sadly I've too little experience to really understand how to interpret this part, or why my equivalent lines loading from the RAM that LM uses for the map16 pointers fails. Something about being saved in 24-bit perhaps?

Anyway I was wondering if anybody could help add support for ExLevels for this patch?

(The whole patch code can be found here and the part I extracted starts on line 270, belonging to the Map16Blk subroutine starting at line 246.)