Cleanup ice_rod.asm

This commit is contained in:
scawful
2024-10-01 00:53:06 -04:00
parent b5ac9a2b52
commit a8d10d583a

View File

@@ -1,10 +1,8 @@
;=========================================================== ;===========================================================
; Ice Rod freezes water ; Ice Rod freezes water
; Written by Conn ; Written by Conn
;
;=========================================================== ;===========================================================
IceRodTileRam = $03EF IceRodTileRam = $03EF
; Ancilla_CheckTileCollision_Targeted_continue ; Ancilla_CheckTileCollision_Targeted_continue
@@ -19,29 +17,29 @@ LinkItem_IceRod:
; check if you're on overworld ; check if you're on overworld
LDA $008C : BNE $01 LDA $008C : BNE $01
RTL RTL
; disable other flying object icing water (boomerang, sword beam) ; disable other flying object icing water (boomerang, sword beam)
LDA $03A3 : CMP #$06 : BEQ $01 LDA $03A3 : CMP #$06 : BEQ $01
RTL RTL
; check if ice shot #1 only is used (disable 2nd shot to ice) ; check if ice shot #1 only is used (disable 2nd shot to ice)
CPX #$04 : BEQ $01 CPX #$04 : BEQ $01
RTL RTL
; check if ice shot is on water tiles ; check if ice shot is on water tiles
LDA $03E8 : CMP #$08 : BEQ .on_water_tiles LDA $03E8 : CMP #$08 : BEQ .on_water_tiles
; check if ice shot is on native unused, edited blocks
LDA $03E8 : CMP #$03 : BEQ $01
RTL
.on_water_tiles
; check if ice shot is on native unused, edited blocks
LDA $03E8 : CMP #$03 : BEQ $01
RTL
.on_water_tiles
; double check if really ice shot is used ; double check if really ice shot is used
LDA $0303 : CMP #$06 : BEQ $01 LDA $0303 : CMP #$06 : BEQ $01
RTL RTL
LDA $0304 : CMP #$06 : BEQ $01 LDA $0304 : CMP #$06 : BEQ $01
RTL RTL
TXA TXA
STA $7ED004 ; store native x value into ram to regain after code STA $7ED004 ; store native x value into ram to regain after code
@@ -76,6 +74,7 @@ LinkItem_IceRod:
ADC $02 ADC $02
STA $2116 ; store vram address for upper tile part (8x16) to $2116 STA $2116 ; store vram address for upper tile part (8x16) to $2116
STA $7ED007 STA $7ED007
; Palette set here ; Palette set here
LDA #$1D83 ; load new ice tiles LDA #$1D83 ; load new ice tiles
STA $7ED000 STA $7ED000
@@ -114,11 +113,10 @@ VramDmaTransfer:
RTS RTS
} }
; bug fix to not swim through tiles but jump onto them ; bug fix to not swim through tiles but jump onto them
org $07DC9E org $07DC9E
JSL $0EFC80 JSL $0EFC80
nop NOP
org $0EFC80 org $0EFC80
LDA $0A LDA $0A
@@ -145,7 +143,7 @@ org $0E95DC ; get a 0e written here (first byte) to enable gliding on new tiles
ASL $5757 ASL $5757
org $0F85B8 ; get new tile values (83 1d) written 4 times here org $0F85B8 ; get new tile values (83 1d) written 4 times here
STA $1D,s STA $1D, S
STA $1D,s STA $1D, S
STA $1D,s STA $1D, S
STA $1D,s STA $1D, S