Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- !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.
- !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
- org $00D715
- autoclean JML DisableDash
- org $00D068
- autoclean JML DisableCapeSpin
- org $00D08C
- autoclean JML DisableThrowFireball
- org $00CFCD
- autoclean JSL DisableLookUp
- org $00D600
- autoclean JML DisableDucking
- freecode
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- 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
- JML $00D003 ;>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.
- ;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 ..TossFireball ;/
- JML $00D090
- ;^Change from $00D090 to $00D0AD to disable throwing fireballs while spinjumping.
- ..TossFireball
- JML $00D0AA
- .DisableFireball
- JML $00D0AD ;>Return
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- 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
- BEQ .NoDuck
- JML $00D606
- .NoDuck
- .DisableDucking
- JML $00D60B
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement