$868104 08 PHP $868105 8B PHB $868106 4B PHK $868107 AB PLB $868108 2C 8D 19 BIT $198D [$86:198D] ; Flag, - enables e/r projectiles $86810B 10 15 BPL $15 [$8122] ;JSR $8125 if there's projectiles $86810D A2 22 00 LDX #$0022 ;No projectiles so $868110 8E 91 19 STX $1991 [$86:1991];Store #$22 to current projectile? $868113 BD 97 19 LDA $1997,x[$86:19B9];Header/ID for projectiles $868116 F0 06 BEQ $06 [$811E] $868118 20 25 81 JSR $8125 [$86:8125] $868125 FC 03 1A JSR ($1A03,x)[$86:A328] $868128 AE 91 19 LDX $1991 [$86:1991] ;Current projectile $86812B DE 8F 1B DEC $1B8F,x[$86:1BB1] ;Frame delay for projectile gfx $86812E D0 23 BNE $23 [$8153] ;There's still a delay so RTS $868130 BC 47 1B LDY $1B47,x[$86:1B69] ;Instruction address $868133 B9 00 00 LDA $0000,y[$86:A28D] ;TYA $868136 10 0A BPL $0A [$8142] ;hasn't been resolved $868138 85 12 STA $12 [$00:0012] ;Standard temp ram slot $86813A C8 INY ;next instruction pointer $86813B C8 INY ;2 bytes ahead $86813C F4 32 81 PEA $8132 ;$1B DP value $86813F 6C 12 00 JMP ($0012)[$86:81AB] $868142 9D 8F 1B STA $1B8F,x[$86:1BB1] ;Frame delay $868145 B9 02 00 LDA $0002,y[$86:A28F] ;Load the next instruction to C $868148 9D 6B 1B STA $1B6B,x[$86:1B8D] ;e/r projectile graphic pointer. Points to data entry: #sprites, (2-byte X, 1-byte Y, sprite bytes 3-4, 5 total bytes per sprite) $86814B 98 TYA ;Instruction before this one $86814C 18 CLC $86814D 69 04 00 ADC #$0004 ;Hop to instruction AFTER the current. (wtf) $868150 9D 47 1B STA $1B47,x[$86:1B69] ;Store to current instruction address $868153 60 RTS $86811B AE 91 19 LDX $1991 [$86:1991] ;Current projectile $86811E CA DEX $86811F CA DEX $868120 10 EE BPL $EE [$8110] $868122 AB PLB $868123 28 PLP $868124 6B RTL A0:9758 (JSR) Interaction with Samus, depends on $0F88,X's 2 bit. If set:(projectiles: JSR $9B7F, bombs: JSR $9D23, Samus: JSR $9A5A) Not set:(projectiles: JSR $A143, bombs: JSR $A236, Samus: JSR $A07A) $A09758 08 PHP $A09759 8B PHB $A0975A F4 00 A0 PEA $A000 $A0975D AB PLB $A0975E AB PLB $A0975F C2 30 REP #$30 $A09761 AE 54 0E LDX $0E54 ;Current enemy index $A09764 BD 88 0F LDA $0F88,x ;Special properties bit for enemies $A09767 89 04 00 BIT #$0004 ;Not sure, todo $A0976A F0 0C BEQ $0C ;If bit is set, RTS $A0976C 20 7F 9B JSR $9B7F ;Check if one of Samus' projectiles is touching the enemy [ $A09B7F 8B PHB $A09B80 AE 54 0E LDX $0E54 ;Enemy index $A09B83 BD A6 0F LDA $0FA6,x ;Enemy bank + enemy index $A09B86 8D 86 17 STA $1786 ;Store as long pointer for enemy AI, when enemy is placed in room? $A09B89 EB XBA ;Now we swap the bytes like we're supposed to? $A09B8A 48 PHA ;Throw that pointer on the stack $A09B8B AB PLB $A09B8C AB PLB $A09B8D A9 03 00 LDA #$0003 ;0003 is one of the KNOWN values for 7E:F378 $A09B90 8F 78 F3 7E STA $7EF378 ;If one of Samus' projectiles is hitting the enemy, we store #$0003 here $A09B94 AD CE 0C LDA $0CCE ;Projectile counter? I'm assuming seeing if the projectile is moving? still? $A09B97 D0 02 BNE $02 ;If it is, stay in A0 and RTS $A09B99 AB PLB $A09B9A 60 RTS ] $A0976F 20 23 9D JSR $9D23 ;Setup enemy reaction to being shot [ $A09D23 8B PHB $A09D24 AE 54 0E LDX $0E54 ;Enemy index $A09D27 BD A6 0F LDA $0FA6,x ;Enemy bank + enemy index $A09D2A 8D 86 17 STA $1786 ;Store as long pointer for enemy AI, when enemy is placed in room? $A09D2D EB XBA ;Wait I thought we just threw this on the stack? $A09D2E 48 PHA ;Oh well $A09D2F AB PLB $A09D30 AB PLB $A09D31 A9 04 00 LDA #$0004 ;Not sure what 4 does $A09D34 8F 78 F3 7E STA $7EF378 ;Perhaps we're here if the projectile has already hit the enemy $A09D38 AC 54 0E LDY $0E54 ;Enemy index to Y $A09D3B B9 8E 0F LDA $0F8E,y ;Graphics/hitbox pointer + enemy index (See if the hitbox affected matches enemy) $A09D3E F0 24 BEQ $24 ;If the result is zero (pointer is a frame delay = to enemy index?) PLB RTS $A09D40 AE 54 0E LDX $0E54 $A09D43 BD 86 0F LDA $0F86,x $A09D46 89 00 04 BIT #$0400 $A09D49 D0 19 BNE $19 ;Not sure $A09D4B BD A0 0F LDA $0FA0,x ;$0FA0 - Counter, forces a different kind of processing. Used when hit by Plasma Beam (powerbombs?) $A09D4E D0 14 BNE $14 ;Not zero = get out $A09D50 AC 54 0E LDY $0E54 ;Next instruction delay is up, get index $A09D53 BE 78 0F LDX $0F78,y ;Enemy pointer+index $A09D56 BF 32 00 A0 LDA $A00032,x ; $A09D5A C9 4C 80 CMP #$804C ;Pointer to RTL $A09D5D F0 05 BEQ $05 [$9D64] $A09D5F C9 4B 80 CMP #$804B ;Pointer to RTS $A09D62 D0 02 BNE $02 [$9D66] $A09D64 AB PLB ;If it points to anything besides return, then continue to the below routine $A09D65 60 RTS ;If not, return ] [ $A09D66 AD D2 0C LDA $0CD2 [$A6:0CD2] ;Bomb counter $A09D69 F0 F9 BEQ $F9 [$9D64] ;Counter is zero (bomb blew up), go delete it $A09D6B A9 05 00 LDA #$0005 ;Various use collision detection index (Samus/Enemy is an enemy index, Enemy/Projectile is a projectile index) $A09D6E 8D A6 18 STA $18A6 [$A5:18A6] ;Set bit to say bomb is gonna blow up the enemy? $A09D71 AE 54 0E LDX $0E54 [$A5:0E54] ;Load the index $A09D74 AD A6 18 LDA $18A6 [$A5:18A6] ;Collision detection for enemy $A09D77 0A ASL A ;Multiply by 2 $A09D78 A8 TAY ;Transfer to Y $A09D79 B9 64 0B LDA $0B64,y[$A5:0B6E] ;Projectile X position in pixels $A09D7C D0 03 BNE $03 [$9D81] ;Projectile hasn't hit enemy, keep going $A09D7E 4C 7E 9E JMP $9E7E [$A0:9E7E] ;Projectile hit enemy, increment collision and get out $A09D81 B9 18 0C LDA $0C18,y[$A5:0C22] ;Projectile type array. 8000+ = live, X0YY = beam, YY = beamtype, X1XX = missile, X2XX = super missile, X7XX = dead beam, X8XX = dead missile/super $A09D84 F0 08 BEQ $08 [$9D8E] ;Projectile from samus' cannon didn't hit enemy $A09D86 29 00 0F AND #$0F00 ;It did, so see if it's a dead projectile yet $A09D89 C9 00 05 CMP #$0500 ;Plasma beam $A09D8C F0 03 BEQ $03 [$9D91] ;If it's plasma, it doesn't die $A09D8E 4C 7E 9E JMP $9E7E [$A0:9E7E] ;Not plasma, so let's go delete the projectile $A09D91 B9 7C 0C LDA $0C7C,y[$B2:0C86] ;Super missile linking + collision checking $A09D94 F0 03 BEQ $03 [$9D99] ;If equal super missile is still alive, so keep routine going $A09D96 4C 7E 9E JMP $9E7E [$A0:9E7E] ;Super missile hit the enemy, go delete it $A09D99 BD 8E 0F LDA $0F8E,x[$B2:114E] ;Hitbox pointer + enemy index $A09D9C C9 00 80 CMP #$8000 ;If it doesn't point to an address $A09D9F 30 FE BMI $FE [$9D9F] ;Branch if not a SNES address to the branch, effectively crashing the game $A09DA1 AA TAX ;Well it was never less than 8000 $A09DA2 BD 00 00 LDA $0000,x[$B2:88D6] ;Put the enemy hitbox address in X and then load A with the same thing $A09DA5 29 FF 00 AND #$00FF ;Only want the second part (borders of the hitbox rather than the position) $A09DA8 8D 0B 06 STA $060B [$B2:060B] ;7E:060B - 7E:060C First byte at enemy's graphic pointer address (used during enemy detecting collisions with projectiles or Samus). Possibly number of tilemaps in multi-tilemap enemies. $A09DAB E8 INX ;Add 2 to hitbox address $A09DAC E8 INX $A09DAD 8E 6E 18 STX $186E [$B2:186E] ;Store it to enemy graphic pointer $A09DB0 AE 6E 18 LDX $186E [$B2:186E] ;Enemy graphic pointer + this>(2 when detecting collisions between enemies and projectiles or Samus $A09DB3 AC 54 0E LDY $0E54 [$B2:0E54] ;Enemy index $A09DB6 B9 7A 0F LDA $0F7A,y[$B2:113A] ;Enemy X position $A09DB9 18 CLC $A09DBA 7D 00 00 ADC $0000,x[$B2:88D8] ;See if there's a collision with the hitbox $A09DBD 8D 7A 18 STA $187A [$B2:187A] ;X position of current enemy graphic during enemy collision detection with projectiles or Samus. Also used as a mirror of projectile damage if they do collide, then later total damage. $A09DC0 B9 7E 0F LDA $0F7E,y[$B2:113E] ;Enemy Y position $A09DC3 18 CLC $A09DC4 7D 02 00 ADC $0002,x[$B2:88DA] ;Adding 2 and storing to collision detection $A09DC7 8D 7C 18 STA $187C [$B2:187C] $A09DCA BD 06 00 LDA $0006,x[$B2:88DE] ;Collision detection + 6? $A09DCD AA TAX ;New collision detection $A09DCE BD 00 00 LDA $0000,x[$B2:96BA] ;Load it to C $A09DD1 D0 03 BNE $03 [$9DD6] ;Enemy is no longer being touched by Samus' projectile $A09DD6 8D 0D 06 STA $060D [$B2:060D] ;Still is, store collision detection to "special properties" hitbox $A09DD9 E8 INX ;Add 2 (next collision instruction) $A09DDA E8 INX $A09DDB 8E 78 18 STX $1878 [$B2:1878] ;Enemy; pointer at (graphic pointer + 8) + 2 $A09DDE AE 78 18 LDX $1878 [$B2:1878] $A09DE1 AD A6 18 LDA $18A6 [$B2:18A6] ;Enemy Collision Detection $A09DE4 0A ASL A ;Multiply by 2 $A09DE5 A8 TAY ;Store in Y $A09DE6 BD 00 00 LDA $0000,x[$B2:96BC] ;TXA $A09DE9 18 CLC $A09DEA 6D 7A 18 ADC $187A [$B2:187A] ;add the X position of the enemy hitbox $A09DED 8D 70 18 STA $1870 [$B2:1870] ;Store to enemy left collision border for collision $A09DF0 B9 64 0B LDA $0B64,y[$B2:0B6E] ;Projectile X position $A09DF3 18 CLC $A09DF4 79 B4 0B ADC $0BB4,y[$B2:0BBE] ;Add projectile X radius $A09DF7 CD 70 18 CMP $1870 [$B2:1870] ;Compare to left collision border $A09DFA 10 03 BPL $03 [$9DFF] ;If the projectile isn't hitting the left border, add X positionn of enemy hitbox $A09DFF BD 04 00 LDA $0004,x[$B2:96C0] ;Enemy graphic pointer + 4 $A09E02 18 CLC $A09E03 6D 7A 18 ADC $187A [$B2:187A] ;Add enemy hitbox X position $A09E06 8D 74 18 STA $1874 [$B2:1874] ;We've calculated right collision border $A09E09 B9 64 0B LDA $0B64,y[$B2:0B6E] ;Projectile X position $A09E0C 38 SEC $A09E0D F9 B4 0B SBC $0BB4,y[$B2:0BBE] ;Subtract X radius $A09E10 CD 74 18 CMP $1874 [$B2:1874] ;Compare to right collision border $A09E13 10 3B BPL $3B [$9E50] ;If projectile doesn't hit the left or right borders of the hitbox, crash the game. $A09E50 AD 78 18 LDA $1878 [$B2:1878] ;Unconditional branch here to load enemy graphic pointer $A09E53 18 CLC $A09E54 69 0C 00 ADC #$000C ;Add C $A09E57 8D 78 18 STA $1878 [$B2:1878] ;Store back $A09E5A CE 0D 06 DEC $060D [$B2:060D] ;Decrease special hitbox pointer $A09E5D AD 0D 06 LDA $060D [$B2:060D] ;Load it to C $A09E60 F0 05 BEQ $05 [$9E67] ;If it's zero Add 8 to it (special hitbox unaffected) $A09E67 AD 6E 18 LDA $186E [$B2:186E] ;Not zero add 8 to graphic pointer instead (normal hitbox affected) $A09E6A 18 CLC $A09E6B 69 08 00 ADC #$0008 $A09E6E 8D 6E 18 STA $186E [$B2:186E] ;Store back $A09E71 CE 0B 06 DEC $060B [$B2:060B] ;Decrement normal hitbox pointer $A09E74 AD 0B 06 LDA $060B [$B2:060B] ;Load $A09E77 F0 05 BEQ $05 [$9E7E] ;Normal hitbox also unaffected, then increment timer for collision detection $A09E79 30 03 BMI $03 [$9E7E] ;Hitbox pointer negative? Delay? $A09E7B 4C B0 9D JMP $9DB0 [$A0:9DB0] ;Hitbox pointer is still positive, loop back to see if the projectile hit it yet $A09E7E EE A6 18 INC $18A6 [$A5:18A6] ;Increment collision detection $A09E81 AD A6 18 LDA $18A6 [$A5:18A6] ;Compare to #10 $A09E84 C9 0A 00 CMP #$000A $A09E87 F0 03 BEQ $03 [$9E8C] ;Collision detection is not affected, return $A09E89 4C 71 9D JMP $9D71 [$A0:9D71] ;Collision detection is affected, loop back to see what projectile is doing. $A09E8C AB PLB $A09E8D 60 RTS ] $A09772 20 5A 9A JSR $9A5A [$A0:9A5A] ;Check to see if Samus is touching the Enemy [ $A09A5A 8B PHB $A09A5B AE 54 0E LDX $0E54 [$A0:0E54] ;Enemy index $A09A5E BD A6 0F LDA $0FA6,x[$A0:0FA6] ;Enemy bank + enemy index $A09A61 8D 86 17 STA $1786 [$A0:1786] ;Store as long pointer for enemy AI, when enemy is placed in room? $A09A64 EB XBA ;Now we swap the bytes like we're supposed to? $A09A65 48 PHA ;Throw that pointer on the stack $A09A66 AB PLB $A09A67 AB PLB ;Seems to be the M.O. for enemy projectiles $A09A68 A9 06 00 LDA #$0006 $A09A6B 8F 78 F3 7E STA $7EF378[$7E:F378] ;0006 is enemy detecting samus $A09A6F AC 54 0E LDY $0E54 [$A6:0E54] ;enemy index $A09A72 B9 8E 0F LDA $0F8E,y[$A6:0F8E] ;hitbox pointer $A09A75 F0 12 BEQ $12 [$9A89] ;Hitbox unaffected = RTS $A09A77 BD 78 0F LDA $0F78,x[$A6:0F78] ;Enemy pointer $A09A7A AA TAX ;Store in X $A09A7B BF 30 00 A0 LDA $A00030,x[$A0:E16F] ;Check if the enemy pointer says its time to go (hitbox unaffected) , nothing happening to enemy location $A09A7F C9 4C 80 CMP #$804C ;RTL $A09A82 F0 05 BEQ $05 [$9A89] $A09A84 C9 4B 80 CMP #$804B ;RTS (never happens) $A09A87 D0 02 BNE $02 [$9A8B] $A09A89 AB PLB $A09A8A 60 RTS $A09A8B AD 6E 0A LDA $0A6E [$A6:0A6E] ;Samus contact damage index $A09A8E F0 05 BEQ $05 [$9A95] ;0 damage, don't worry about the enemy collision $A09A90 9C A8 18 STZ $18A8 [$B2:18A8] ;store 0 to enemy collision detection if samus took damage $A09A93 80 05 BRA $05 [$9A9A] ;Hop ahead to the enemy indexing $A09A95 AD A8 18 LDA $18A8 [$A6:18A8] ;Load the enemy collision $A09A98 D0 EF BNE $EF [$9A89] ;Not sure how it could be negative if we only got here on the condition it was 0, RTS $A09A9A AE 54 0E LDX $0E54 [$A6:0E54] ;Enemy index $A09A9D BD 8E 0F LDA $0F8E,x[$A6:0F8E] ;Hitbox pointer $A09AA0 C9 00 80 CMP #$8000 ;Needs to be a pointer or RTS $A09AA3 30 E4 BMI $E4 [$9A89] $A09AA5 AD F6 0A LDA $0AF6 [$A6:0AF6] ;Samus X position in pixels $A09AA8 18 CLC $A09AA9 6D FE 0A ADC $0AFE [$A6:0AFE] ;Add her radius $A09AAC 8D 7E 18 STA $187E [$A6:187E] ;Right border of samus hitbox calculated $A09AAF AD F6 0A LDA $0AF6 [$A6:0AF6] ;Load her X position $A09AB2 38 SEC $A09AB3 ED FE 0A SBC $0AFE [$A6:0AFE] ;Subtract her radius $A09AB6 8D 80 18 STA $1880 [$A6:1880] ;Left border of Samus hitbox calculated $A09AB9 AD FA 0A LDA $0AFA [$A6:0AFA] ;Samus Y position in pixels $A09ABC 18 CLC $A09ABD 6D 00 0B ADC $0B00 [$A6:0B00] ;Add her Y radius $A09AC0 8D 82 18 STA $1882 [$A6:1882] ;Samus bottom hitbox border $A09AC3 AD FA 0A LDA $0AFA [$A6:0AFA] ;Y position $A09AC6 38 SEC $A09AC7 ED 00 0B SBC $0B00 [$A6:0B00] ;y radius $A09ACA 8D 84 18 STA $1884 [$A6:1884] ;top hitbox border $A09ACD BD 8E 0F LDA $0F8E,x[$A6:0F8E] ;hitbox pointer $A09AD0 AA TAX ;stick it in x $A09AD1 BD 00 00 LDA $0000,x[$A6:E983] ;TXA $A09AD4 29 FF 00 AND #$00FF ;only want the borders $A09AD7 8D 0B 06 STA $060B [$A6:060B] ;store to graphic pointer address $A09ADA E8 INX $A09ADB E8 INX ;add 2 (collision instruction) $A09ADC 8E 6E 18 STX $186E [$A6:186E] ;store to the graphic pointer for hitbox setup $A09ADF AE 6E 18 LDX $186E [$A6:186E] ;our hitbox $A09AE2 AC 54 0E LDY $0E54 [$A6:0E54] ;load the enemy $A09AE5 B9 7A 0F LDA $0F7A,y[$A6:0F7A] ;enemy x position $A09AE8 18 CLC $A09AE9 7D 00 00 ADC $0000,x[$A6:E985] ;add the hitbox in $A09AEC 8D 7A 18 STA $187A [$A6:187A] ;store to collision detection of enemy with samus $A09AEF B9 7E 0F LDA $0F7E,y[$A6:0F7E] ;enemy y pos $A09AF2 18 CLC $A09AF3 7D 02 00 ADC $0002,x[$A6:E987] ;add 2 $A09AF6 8D 7C 18 STA $187C [$A6:187C] ;store to y position of enemy during collision with samus $A09AF9 BD 06 00 LDA $0006,x[$A6:E98B] ;add 6 to hitbox $A09AFC AA TAX ;store to x $A09AFD BD 00 00 LDA $0000,x[$A6:EB2F] ;TXA $A09B00 F0 64 BEQ $64 [$9B66] ;if hitbox is not touched by samus $A09B02 8D 0D 06 STA $060D [$A6:060D] ;store our hitbox to the special hitbox properties $A09B05 E8 INX $A09B06 E8 INX ;increase hitbox by 2 $A09B07 8E 78 18 STX $1878 [$A6:1878] ;store to enemy graphic pointer (hitbox mirror?) $A09B0A AE 78 18 LDX $1878 [$A6:1878] ;load that up $A09B0D AD 7A 18 LDA $187A [$A6:187A] ;collision detection of enemy with samus $A09B10 18 CLC $A09B11 7D 00 00 ADC $0000,x[$A6:EB31] ;add them $A09B14 CD 7E 18 CMP $187E [$A6:187E] ;check if the enemy hitbox is colliding with the right border of samus $A09B17 10 36 BPL $36 [$9B4F] ;if yes, go update the hitbox delay $A09B19 AD 7A 18 LDA $187A [$A6:187A] ;collision detection $A09B1C 18 CLC $A09B1D 7D 04 00 ADC $0004,x[$A6:EB35] ;add 4 $A09B20 CD 80 18 CMP $1880 [$A6:1880] ;left border of samus' hitbox $A09B23 30 2A BMI $2A [$9B4F] ;samus isn't colliding, so update the hitbox and loop $A09B25 AD 7C 18 LDA $187C [$A6:187C] ;y pos of enemy collis $A09B28 18 CLC $A09B29 7D 02 00 ADC $0002,x[$A6:F298] ;add 2 $A09B2C CD 82 18 CMP $1882 [$A6:1882] ;store to bottom of samus' hitbox $A09B2F 10 1E BPL $1E [$9B4F] ;if collision set, update hitbox $A09B31 AD 7C 18 LDA $187C [$A6:187C] ;y pos of enemy collis $A09B34 18 CLC $A09B35 7D 06 00 ADC $0006,x[$A6:F29C] ;add 6 $A09B38 CD 84 18 CMP $1884 [$A6:1884] ;compare to top border of samus hitbox $A09B3B 30 12 BMI $12 [$9B4F] ;if the hitbox isn't tall enough, update hitbox and jump $A09B3D 22 43 9B A0 JSL $A09B43[$A0:9B43] ;hitbox is correct, jump ahead and update hitbox (same as above?) $A09B41 80 3A BRA $3A [$9B7D] ;RTS $A09B43 AE 78 18 LDX $1878 [$A6:1878] ;enemy hitbox $A09B46 BD 08 00 LDA $0008,x[$A6:F29E] ;add 8 $A09B49 8D 84 17 STA $1784 [$A6:1784] ;store to enemy AI long pointer $A09B4C DC 84 17 JML [$1784][$A6:F03F] ;use that to Jump Long (not sure where) TODO $A09B4F AD 78 18 LDA $1878 [$A6:1878] ;load hitbox $A09B52 18 CLC $A09B53 69 0C 00 ADC #$000C ;add #$000C $A09B56 8D 78 18 STA $1878 [$A6:1878] ;store to hitbox $A09B59 CE 0D 06 DEC $060D [$A6:060D] ;decrement special hitbox pointer $A09B5C AD 0D 06 LDA $060D [$A6:060D] ;load special hitbox pointer $A09B5F F0 05 BEQ $05 [$9B66] ;if 0 update regular hitbox $A09B61 30 03 BMI $03 [$9B66] ;if negative do the same $A09B63 4C 0A 9B JMP $9B0A [$A0:9B0A] ;otherwise go check if samus is touching the enemy again $A09B66 AD 6E 18 LDA $186E [$A6:186E] ;load the hitbox $A09B69 18 CLC $A09B6A 69 08 00 ADC #$0008 ;add 8 $A09B6D 8D 6E 18 STA $186E [$A6:186E] ;store back $A09B70 CE 0B 06 DEC $060B [$A6:060B] ;decrement the graphic pointer address $A09B73 AD 0B 06 LDA $060B [$A6:060B] ;load $A09B76 F0 05 BEQ $05 [$9B7D] ;check if zero, RTS $A09B78 30 03 BMI $03 [$9B7D] ;if it's somehow negative? RTS $A09B7A 4C DF 9A JMP $9ADF [$A0:9ADF] ;recalculate hitbox if the pointer address is >0 $A09B7D AB PLB $A09B7E 60 RTS ] $A09775 AB PLB $A09776 28 PLP $A09777 60 RTS