Originally posted by MarioFanGamer659I am a double poster.
Anyway, I'd know, how to make custom layer 3 interactions.
no need to double post. what kind of interaction do you want exactly? generally when people do layer 3 interaction they are just comparing its x or y position with the x or y position of the player. In other words, just a giant horizontal or vertical line that does something when passed. That will look something like this:
Code
REP #$20 ; make A 16-bit
LDA !Layer3Pos ; = $22 or $24 depending on what you want
CLC
ADC !Offset ; = some constant 16-bit value
CMP !PlayerPos_Level ; = $7E or $80
BCS + ; or BCC
;
;some kind of interaction
;
+
SEP #$20 ; make A 8-bit
Note this will still work with layer 3 scrolling since !Layer3Pos will be updated by any scrolling routine.
------
Now for my own question: I'm trying to use the bounce unrestrictor patch to make a sprite generate blocks wherever it goes. The routine I have is
Code
LDA !RAM_SprFlags,x ; if the sprite is in the air
AND #$02 ; generate the tile adjacent
LSR ; to the normal one (dont use #$xxFF)
CLC
ADC !VAL_Map16High ; = #$03
STA $0661
LDA !VAL_Map16Low ; = #$AC <- want tile 03AC
STA $0660
LDA #$FF ; bounce unrestrictor says to store #$FF here
STA $9C ; and the values of 066x will be used instead
JSR $00BEB0
There are two problems. The first is that the map16 tiles are being generated at the players position, not the sprites position. The second is that I am not getting the map16 tile I want (its generating one of the unused tiles)
Any idea how to fix this?