!Freeram_DisableMarioReactControls = $60 ;^[1 byte] a bit flag that when set, makes ;mario assume that no button is pressed ;reguardless. Same format as smw's button ;format: byetUDLR and axlr----. These are ;handled individually, for example, you ;can disable only left, but enable right. !Freeram_DisableMarioReactControls_SA1 = $400000 ;^[1 byte] Same as above, but used instead of ; the above. ;Note: If you wanted to disable other things ;that depends on the controls, you can edit ;those to check the freeram as well. This patch ;is meant so that other things react to controls ;while mario doesn't is made possible (not ;clearing the controls flag). ;This patch only modifies the reaction Mario does ;on inputs IN SMW's code, therefore other ASM ;stuff will not work unless you include this ;freeram to check. ;Feel free to modify this patch, as in case if ;you wanted other things to also disable controls. ;Be aware that patches that also modifies the mario ;controls (such as the lakitu cloud/p-balloon LR fix ;(also the P-balloon timer fix, which includes ;the LR bug)) may break your ROM. !dp = $0000 !addr = $0000 !sa1 = 0 !gsu = 0 if read1($00FFD6) == $15 sfxrom !dp = $6000 !addr = !dp !gsu = 1 elseif read1($00FFD5) == $23 sa1rom !dp = $3000 !addr = $6000 !sa1 = 1 endif if !sa1 == 1 !Freeram_DisableMarioReactControls = !Freeram_DisableMarioReactControls_SA1 endif org $00D618 autoclean JML DisableJump ;^Note that this will disable both jumps when standing on surface. org $00DB98 autoclean JML DisableJumpOffClimbing org $00DBD0 autoclean JML DisableLeftRightClimbing org $00DBF2 autoclean JML DisableUpDownClimbing org $00D687 autoclean JML DisableLeftRight org $00CFD8 autoclean JML DisableLeftRightWalkAnimation ;^Needed so that pressing up and left/right doesn't do that. org $00D715 autoclean JML DisableDash org $00D068 autoclean JML DisableCapeSpin org $00D08C autoclean JML DisableThrowFireball org $00CFCD autoclean JSL DisableLookUp ;>the only JSL that is reasonable. org $00D600 autoclean JML DisableDucking org $00D9AF autoclean JML DisableDownSwimCarrySpr org $00D9E1 autoclean JML DisableLeftRightSwimmingCarrySpr org $00DA13 autoclean JML DisableUpDownSwimming org $00DA33 autoclean JML DisableDuckingWater org $00DA40 autoclean JML DisableLeftRightSwimmingNoCarring org $00D9EB autoclean JML DisableABButtonSwim org $01F1E5 autoclean JML DisableYoshiTongue org $01ED79 autoclean JML DisableYoshiTurning org $01A02D autoclean JML DisableTossingSpriteUpward org $01ED9A autoclean JML DisableJumpOffYoshi org $01EB16 autoclean JML DisableYoshiDuck org $01EB02 autoclean JML DisableYoshiTongueUncrouch ;^That is when you make yoshi's tongue out ;and press up to lick at a higher Y pos. freecode ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;16 DisableJump: ;>$00D618 LDA !Freeram_DisableMarioReactControls BMI .DisableJump .Restore LDA $16 ;>Pressing B (normal jump) ORA $18 ;>Pressing A (spin junp) BMI ..Jump ;>Jump JML $00D61E ;>Not pressing junp ..Jump JML $00D630 .DisableJump JML $00D61E ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DisableJumpOffClimbing: ;>$00DB98 .JumpingOff LDA !Freeram_DisableMarioReactControls BMI ..DisableJump ..Restore BIT $16 BPL ..NoJump JML $00DB9C ..NoJump ..DisableJump ;Allow punching net tile while only jump disabled. .CheckPunching LDA !Freeram_DisableMarioReactControls AND.b #%01000000 BNE ..DisablePunch ..Restore LDA $16 BIT.b #%01000000 BEQ ..NoPunch JML $00DBAE ..NoPunch ..DisablePunch JML $00DBCA ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DisableLeftRightClimbing: ;>$00DBD0 LDA !Freeram_DisableMarioReactControls AND.b #%00000011 CMP.b #%00000011 BEQ .BothDisabled ;Feel free to add another disabler/condition here. CMP.b #%00000010 ;\Disable left BEQ .DisableLeft ;/ CMP.b #%00000001 ;\Disable right BEQ .DisableRight ;/ BRA .NoDisable ;>Disable none .DisableLeft LDA $15 AND.b #%00000001 JML $00DBD4 ;>Treat as normal only for right bit .DisableRight LDA $15 AND.b #%00000010 JML $00DBD4 ;>Treat as normal only for left bit .BothDisabled JML $00DBF2 ;>Skip as if the player didn't press left or right. .NoDisable LDA $15 ;\Restore AND.b #%00000011 ;| JML $00DBD4 ;/ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DisableUpDownClimbing: ;>$00DBF2 LDA !Freeram_DisableMarioReactControls AND.b #%00001100 CMP.b #%00001100 BEQ .BothDisabled ;Feel free to add another disabler/condition here. CMP.b #%00001000 BEQ .DisableUp CMP.b #%00000100 BEQ .DisableDown BRA .NoDisable .DisableUp LDA $15 AND.b #%00000100 ;>Treat as normal only for down bit JML $00DBF6 .DisableDown LDA $15 AND.b #%00001000 ;>Treat as normal only for up bit JML $00DBF6 .BothDisabled JML $00DC2C .NoDisable LDA $15 AND.b #%00001100 JML $00DBF6 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DisableLeftRight: ;>$00D687 ;The left and right on the D pad that ;makes mario move left or right. LDA !Freeram_DisableMarioReactControls AND.b #%00000011 ;>Focus on left and right bits only CMP.b #%00000011 ;\if both left and right set, disable entirely BEQ .BothDisabled ;/ ;Feel free to add another disabler/condition here. CMP.b #%00000010 ;\Disable left BEQ .DisableLeft ;/ CMP.b #%00000001 ;\Disable right BEQ .DisableRight ;/ BRA .NoDisable ;>Disable none .DisableLeft LDA $15 AND.b #%00000001 JML $00D68B ;>Treat as normal only for right bit .DisableRight LDA $15 AND.b #%00000010 JML $00D68B ;>Treat as normal only for left bit .BothDisabled JML $00D68D ;>Skip as if the player didn't press left or right. .NoDisable LDA $15 ;\Restore AND.b #%00000011 ;| JML $00D68B ;/ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DisableLeftRightWalkAnimation: ;>$00CFD8 LDA !Freeram_DisableMarioReactControls AND.b #%00000011 CMP.b #%00000011 BEQ .BothDisabled CMP.b #%00000010 BEQ .DisableLeft CMP.b #%00000001 BEQ .DisableRight BRA .NoDisable .DisableLeft LDA $15 AND.b #%00000001 JML $00CFDC ;>Treat as normal only for right bit .DisableRight LDA $15 AND.b #%00000010 JML $00CFDC ;>Treat as normal only for left bit .BothDisabled LDA #$00 ;>Prevent pose glitch when pressing up when both left and right disabled. JML $00CFDC ;>Skip as if the player didn't press left or right. .NoDisable LDA $15 ;\Restore AND.b #%00000011 ;| JML $00CFDC ;/ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DisableDash: ;>$00D715 LDA !Freeram_DisableMarioReactControls AND.b #%01000000 BNE .DisableDash .Restore BIT $15 BVC ..NoDash JML $00D719 ..NoDash JML $00D737 .DisableDash JML $00D737 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;If you have some code that limits the cape spin (such as MP), ;you may have to combine patches. DisableCapeSpin: ;>$00D068 ;XBA ;>Powerup was in A (just in case) LDA !Freeram_DisableMarioReactControls AND.b #%01000000 BNE .DisableSpin .Restore ;XBA ;>Needed in case if a patch enables powerups >= #$80 BIT $16 ;\Not pressing XY BVC .DisableSpin ;/ JML $00D06C ;>Cape spin .DisableSpin JML $00D0AD ;>Return ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DisableThrowFireball: ;>$00D08C ;may not be compatible wtih the fireball ammo, so you must combine the code ;here. Also, this merly disable fireball tossing by the xy button, not the ;spinjump (unless you edit the second [JML $00D090]) ;XBA ;>Powerup was in A (just in case) LDA !Freeram_DisableMarioReactControls AND.b #%01000000 BNE .DisableFireball .Restore ;XBA ;>Needed in case if a patch enables powerups >= #$80 BIT $16 ;\Pressing XY BVS ..TossFire ;/>Toss fireball if pressed JML $00D090 ;>Spinjump to toss fireball. ..TossFire JML $00D0AA .DisableFireball JML $00D090 ;>change from $00D090 to $00D0AD to disable spinjump fireballs. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DisableLookUp: ;>$00CFCD LDA !Freeram_DisableMarioReactControls AND.b #%00001000 BNE .DisableLookUp .Restore LDA $15 AND.b #%00001000 BEQ .NotPressingUp LDA #$03 ;\Look up STA $13DE|!addr ;/ .NotPressingUp .DisableLookUp RTL ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DisableDucking: ;>$00D600 LDA !Freeram_DisableMarioReactControls AND.b #%00000100 BNE .DisableDucking .Restore LDA $15 AND.b #%00000100 JML $00D604 .DisableDucking JML $00D60B ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DisableDownSwimCarrySpr: ;>$00D9AF LDA !Freeram_DisableMarioReactControls AND.b #%00000100 BNE .DisableDownSwimCarrySpr .Restore LDA $15 AND.b #%00000100 JML $00D9B3 .DisableDownSwimCarrySpr JML $00D9BD ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DisableLeftRightSwimmingCarrySpr: ;>$00D9E1 LDA !Freeram_DisableMarioReactControls AND.b #%00000011 CMP.b #%00000011 BEQ .BothDisabled CMP.b #%00000010 BEQ .DisableLeft CMP.b #%00000001 BEQ .DisableRight BRA .NoDisable .DisableLeft LDA $15 ;\Only rightwards allowed AND.b #%00000001 ;/ JML $00D9E5 .DisableRight LDA $15 AND.b #%00000010 ;\Only leftwards is allowed JML $00D9E5 ;/ .BothDisabled JML $00D9E7 .NoDisable LDA $15 AND.b #%00000011 JML $00D9E5 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DisableUpDownSwimming: ;>$00DA13 LDA !Freeram_DisableMarioReactControls AND.b #%00001100 ;>Focus on up and down input CMP.b #%00001100 BEQ .BothDisabled CMP.b #%00001000 BEQ .DisableUp CMP.b #%00000100 BEQ .DisableDown BRA .NoDisable .DisableUp LDA $15 AND.b #%00000100 ;>Only downwards is allowed JML $00DA17 .DisableDown LDA $15 AND.b #%00001000 ;>Only upwards is allowed JML $00DA17 .BothDisabled LDA #$00 ;>Treat as if both up and down aren't pressed. JML $00DA19 ;>Skips the LSR since 0/[x != 0] = 0. .NoDisable ;>restore code LDA $15 AND.b #%00001100 JML $00DA17 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DisableDuckingWater: ;>$00DA33 LDA !Freeram_DisableMarioReactControls AND.b #%00000100 BNE .DisableDuckingWater .Restore LDA $15 AND.b #%00000100 JML $00DA37 .DisableDuckingWater JML $00DA40 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DisableLeftRightSwimmingNoCarring: ;>$00DA40 LDA !Freeram_DisableMarioReactControls AND.b #%00000011 CMP.b #%00000011 BEQ .BothDisabled CMP.b #%00000010 BEQ .DisableLeft CMP.b #%00000001 BEQ .DisableRight BRA .NoDisable .DisableLeft LDA $15 AND.b #%00000001 ;\Only allow right JML $00DA44 ;/ .DisableRight LDA $15 AND.b #%00000010 ;\Only allow left JML $00DA44 ;/ .BothDisabled JML $00DA69 .NoDisable LDA $15 AND.b #%00000011 JML $00DA44 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DisableABButtonSwim: ;>$00D9EB LDA !Freeram_DisableMarioReactControls BMI .DisableABButtonSwim .Restore LDA $16 ORA $18 JML $00D9EF .DisableABButtonSwim JML $00DA0B ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DisableYoshiTongue: ;>$01F1E5 LDA !Freeram_DisableMarioReactControls AND.b #%01000000 BNE .DisableYoshiTongue .Restore BIT $16 BVC .NotPressingXY JML $01F1E9 .NotPressingXY .DisableYoshiTongue JML $01F1DE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DisableYoshiTurning: ;>$01ED79 LDA !Freeram_DisableMarioReactControls AND.b #%00000011 CMP.b #%00000011 BEQ .BothDisabled CMP.b #%00000010 BEQ .DisableLeft CMP.b #%00000001 BEQ .DisableRight BRA .NoDisable .DisableLeft LDA $15 AND.b #%00000001 ;\Only allow right JML $01ED7D ;/ .DisableRight LDA $15 AND.b #%00000010 ;\Only allow left JML $01ED7D ;/ .BothDisabled JML $01ED95 .NoDisable LDA $15 AND.b #%00000011 JML $01ED7D ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DisableTossingSpriteUpward: ;>$01A02D LDA !Freeram_DisableMarioReactControls AND.b #%00001000 BNE .DisableTossingSpriteUpward .Restore LDA $15 AND.b #%00001000 JML $01A031 .DisableTossingSpriteUpward JML $01A033 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DisableJumpOffYoshi: ;>$01ED9A LDA !Freeram_DisableMarioReactControls BMI .DisableJumpOffYoshi .Restore BIT $18 BPL .NoJumpOff JML $01ED9E .DisableJumpOffYoshi .NoJumpOff JML $01EDCB ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DisableYoshiDuck: ;>$01EB16 LDA !Freeram_DisableMarioReactControls AND.b #%00000100 BNE .DisableYoshiCrouch .Restore LDA $15 AND.b #%00000100 JML $01EB1A .DisableYoshiCrouch JML $01EB21 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DisableYoshiTongueUncrouch: ;>$01EB02 LDA !Freeram_DisableMarioReactControls AND.b #%00001000 BNE .DisableYoshiTongueUncrouch .Restore LDA $15 AND.b #%00001000 JML $01EB06 .DisableYoshiTongueUncrouch JML $01EB0A ;>Skip LDY #$06