LoROM ;//[2017 PHOSPHOTiDYL] ;//[depth of liquid took eight hours] ;=====================================================================================; ;-------------------------------------------------------------------------------------; ORG $809CC8 ;//[end of the hud gfx update routine (this is updated every frame??)] JSR HackMe ;//STX $0330 ;-------------------------------------------------------------------------------------; ORG $80FF00 ;//[Free Space ($005A bytes)] HackMe: STX $0330 ;//vanilla JSR LiquidCheck ;//jsr table anyone?? EndMe: RTS LiquidCheck: LDA $0998 : CMP #$0008 : BNE EndMe ;//gamestate check LDA $196E : CMP #$0006 : BNE EndMe ;//check for water LDA $09A2 : BIT #$0020 : BNE EndMe ;//hydrasuit check LDA $195E : SEC : SBC $0AFA : ADC #$0020 : BMI FrameCheck ;//check if in water (adc #$0020 for submersion) RTS ;//perfectly placed so damage occurs in water, not out FrameCheck: LDA $09DA : ASL $09DA : CMP #$0001 : BCS EndMe ;//frame check (# of asl is speed of constant damage) DepthOfLiquid: DEC $09C2 : LDA $195E : SEC : SBC $0AFA : CMP #$FFA0 : BPL EndMe ;//eight hours later... DEC $09C2 : CMP #$FF40 : BPL EndMe ;//decaying rate DEC $09C2 : CMP #$FEE0 : BPL EndMe ;//you get the idea DEC $09C2 : RTS ;//finish ;=====================================================================================;