[CustomTag] Cleanup CrumbleFloorTag

This commit is contained in:
scawful
2024-10-07 14:49:28 -04:00
parent 0099a81adc
commit f3060e3c9a

View File

@@ -1,12 +1,14 @@
org $01CC04 ; holes_1 tag routine org $01CC04 ; holes_1 tag routine
JSL NewTagRoutine JSL CrumbleFloorTag_Main
RTS RTS
pullpc pullpc
NewTagRoutine:
; check under link feet what tile he is standing on ; check under link feet what tile he is standing on
; save somewhere in ram last tile we were on so it doesn't turn it back off ; save in ram last tile we were on so it doesn't turn back off
; kill room tag ; kill room tag
CrumbleFloorTag_Main:
{
LDA.b $20 : CLC : ADC #$10 : AND.b #$F0 LDA.b $20 : CLC : ADC #$10 : AND.b #$F0
STA.w $0224 ; y STA.w $0224 ; y
@@ -23,7 +25,8 @@ JMP .sameTile
REP #$30 REP #$30
LDA.w $022A : AND.w #$01F0 : LSR #$02 : STA.b $00 LDA.w $022A : AND.w #$01F0 : LSR #$02 : STA.b $00
LDA.w $0228 : AND.w #$01F0 : ASL #$04 : CLC : ADC.b $00 : STA.b $06 LDA.w $0228 : AND.w #$01F0 : ASL #$04
CLC : ADC.b $00 : STA.b $06
TAX TAX
LDA.l $7E2000, X : CMP.w #$0CCC : BNE + LDA.l $7E2000, X : CMP.w #$0CCC : BNE +
@@ -46,9 +49,11 @@ LDA.w $0225 : STA.w $0227 : STA.w $022A ; Last X
LDA.b $21 : STA.w $0229 LDA.b $21 : STA.w $0229
LDA.b $23 : STA.w $022B LDA.b $23 : STA.w $022B
RTL RTL
}
spawnFallingTile: spawnFallingTile:
{
LDX.b #$1D LDX.b #$1D
.next .next
@@ -86,9 +91,11 @@ BPL .next
.exit .exit
RTS RTS
}
update_crack_tile: update_crack_tile:
{
STZ.b $0E STZ.b $0E
REP #$30 REP #$30
@@ -100,9 +107,10 @@ LDA.b #$01
STA.b $14 STA.b $14
REP #$30 REP #$30
RTS RTS
}
update_pit_tile: update_pit_tile:
{
STZ.b $0E STZ.b $0E
REP #$30 REP #$30
@@ -114,8 +122,10 @@ LDA.b #$01
STA.b $14 STA.b $14
REP #$30 REP #$30
RTS RTS
}
replace_crack_pit: replace_crack_pit:
{
LDX.w $1000 LDX.w $1000
LDA.w #$0CCC LDA.w #$0CCC
@@ -151,8 +161,10 @@ STA.b $08
STA.b $09 STA.b $09
JMP replace_tile_continue JMP replace_tile_continue
}
replace_tile_pit: replace_tile_pit:
{
LDX.w $1000 LDX.w $1000
LDA.w #$01E9 LDA.w #$01E9
@@ -187,10 +199,11 @@ STA.b $08
STA.b $09 STA.b $09
JMP replace_tile_continue JMP replace_tile_continue
}
replace_tile_continue: replace_tile_continue:
{
LDX.w $1000 LDX.w $1000
LDA.w #$0000 LDA.w #$0000
@@ -224,10 +237,11 @@ ADC.w #$0018
STA.w $1000 STA.w $1000
RTS RTS
}
; --------------------------------------------------------- ; ---------------------------------------------------------
draw_one_corner: draw_one_corner:
{
CLC CLC
ADC.b $06 ADC.b $06
STA.b $0E STA.b $0E
@@ -256,4 +270,5 @@ ORA.b $08
XBA XBA
RTS RTS
}