This patch disables Item Box dropping if the player is gliding with a cape. Here is the fixed code incase someone else is interested:
Now it is optimized.
Now it is optimized.
Code
header lorom org $00C56C autoclean JML MyCode NOP #2 freecode MyCode: LDA $16 AND #$20 ;Check if Player is pressing Select BEQ NotPressingSelect LDA $1407 ;Is a cape, then check if player is gliding BEQ NotGliding CMP #$04 BCS NotGliding NotPressingSelect: JML $00C58F NotGliding: JML $00C572
Originally posted by Old post
I am trying to make a patch that disables Item Box dropping if the player is gliding with a cape.
So I checked SMWDISC and found some stuff related:
Alright, then I tried making a patch that checks if Select is being pressed, then if the player is using cape powerup, then if the player is gliding:
Well, absolutely nothing happens. It is still possible to drop items from ItemBox even if player is Gliding.
Am I missing some check? Or are my hijacks completely wrong? Any help is appreciated.
Thank you.
So I checked SMWDISC and found some stuff related:
Code
;CODE_00C56C: A5 16 LDA $16 ;CODE_00C56E: 29 20 AND.B #$20 ;Check if Player is pressing SELECT ;CODE_00C570: F0 1D BEQ CODE_00C58F ;CODE_00C572: A5 15 LDA RAM_ControllerA (7E0015) ;CODE_00C574: 29 08 AND.B #$08 ;CODE_00C576: 80 0D BRA CODE_00C585 ; Change to BEQ to reach debug routine below ;CODE_00C578: (Debug: Cycle through powerups Routine, skip)... ;CODE_00C585: 8B PHB ;CODE_00C586: A9 02 LDA.B #$02 ;CODE_00C588: 48 PHA ;CODE_00C589: AB PLB ;CODE_00C58A: 22 08 80 02 JSL.L CODE_028008 ; ItemBoxRoutine ;CODE_00C58E: AB PLB ;CODE_00C58F: 9C 02 14 STZ.W $1402 ;Return00C592: 60 RTS ; Return
Alright, then I tried making a patch that checks if Select is being pressed, then if the player is using cape powerup, then if the player is gliding:
Code
header lorom org $00C56C autoclean JML MyCode freecode MyCode: LDA $16 AND #$20 ;Check if Player is pressing Select BEQ NotPressingSelect LDA #$19 ;Is pressing select, then proceed to check powerup. CMP #$02 ;Check if Player is using Cape powerup BNE NotACape ;If not a cape, then proceed to run default item box code LDA $13E0 ;Is a cape, then check if glidding animation is running CMP #$2A ;Glidding frame #01 BEQ Return CMP #$2B ;Glidding frame #02 BEQ Return CMP #$2C ;Glidding frame #03 BEQ Return CMP #$2D ;Glidding frame #04 BEQ Return CMP #$2E ;Glidding frame #05 BEQ Return CMP #$2F ;Glidding frame #06 BEQ Return NotACape: JML $00C572 NotPressingSelect: JML $00C58F Return: RTL
Well, absolutely nothing happens. It is still possible to drop items from ItemBox even if player is Gliding.
Am I missing some check? Or are my hijacks completely wrong? Any help is appreciated.
Thank you.