I have no idea on how to combine two Patches, so I'll show you both, so you can help me..
1.Patch: Walljump-Patch
Code!freeram1 = $0660 ; Requires 4 empty RAM address
!freeram2 = $0661 ; Change these if you have another patch
!freeram3 = $0662 ; that uses these RAM addresses
!freeram4 = $0663 ; such as the YoshiFlutterJump patch
macro RATS_start(id)
db "STAR"
dw RATS_Endcode<id>-RATS_Startcode<id>
dw RATS_Endcode<id>-RATS_Startcode<id>^#$FFFF
RATS_Startcode<id>:
endmacro
macro RATS_end(id)
RATS_Endcode<id>:
endmacro
lorom ;\ ROM is LoRom
header ;/ and has a header.
ORG $8DC4 ;\ Hijack NMI routine
JSL StatusCode ;| and jump to our code
NOP ;/ also NOP one time.
ORG $139080 ;| POINT TO FREE SPACE!!!
%RATS_start(0)
StatusCode:
LDA #$02 ;\ Restore previous
STA $420B ;/ hijacked NMI routine.
PHX ;> Save whatever's in X for later
LDA $77 ; |
AND #$04 ; Check if mario is on ground
BNE dontstoreleft
LDA $77 ; |
AND #$02 ; Check if mario blocked from the left
BEQ dontstoreleft
LDA #$01 ; tell the game you can jump off the left wall
STA !freeram1
dontstoreleft:
LDA $15 ;\ check if left is pressed
AND #$02 ;/
BNE rightcheck
LDA $16 ;\ check if either B or A is pressed
AND #$80 ; |
BEQ rightcheck ;/ if neither, return
LDA $18 ;\ check if it's B that's pressed
AND #$80 ; |if A, not B,
BNE rightcheck ;/ return
JSL Jumpright
BRA reset
rightcheck:
LDA $77 ;\
AND #$04 ;/ Check if mario is on ground
BNE dontstoreright
LDA $77 ;\
AND #$01 ;/ Check if mario blocked from the right
BEQ dontstoreright
LDA #$01 ; tell the game you can jump off the right wall
STA !freeram2
dontstoreright:
LDA $15 ; this will basically just skip everything if you didn't
AND #$01 ; get blocked
BNE reset
LDA $16 ;\ check if either B or A is pressed
AND #$80 ; |
BEQ reset ;/ if neither, return
LDA $18 ;\ check if it's B that's pressed
AND #$80 ; |if A, not B,
BNE reset ;/ return
JSL Jumpleft
reset:
LDA !freeram1 ;\ used to remove a bug that I found
BEQ right ;| where you could jump in mid air
LDA $15 ;| if you timed it correctly
AND #$01 ;|
BEQ right ;|
STZ !freeram1 ;|
right: ;|
LDA !freeram2 ;|
BEQ reset1 ;|
LDA $15 ;|
AND #$02 ;|
BEQ reset1 ;|
STZ !freeram2 ;/
reset1:
LDA $77 ; |
AND #$04 ; Check if mario is on ground
BEQ return ; reset all the flags
STZ !freeram1
STZ !freeram2
STZ !freeram3
STZ !freeram4
return:
PLX
RTL
Jumpleft:
;LDA !freeram3 ;\ put a semicolon before these two lines if you
;BNE end1 ;/ want mario to be able to jump off the same wall twice
LDA !freeram1
BEQ end1
LDA #$B0 ;\ Make mario jump
STA $7D ;/
LDA #$0D ;\change pose for split second
STA $13E0 ;/
LDA #$30 ;\ Make him move left
STA $7B ;/
LDA #$01 ;\ Play sound effect
STA $1DFA ;/
LDA #$01 ;\ tell the game that you just jumped off the left wall
STA !freeram3 ;| and are ready for the right
STZ !freeram4 ;/
STZ !freeram2
STZ !freeram1
end1:
RTL
Jumpright:
;LDA !freeram4 ;\ put a semicolon before these two lines if you
;BNE end ;/ want mario to be able to jump off the same wall twice
LDA !freeram2
BEQ end
LDA #$B0 ;\ Make mario jump
STA $7D ;/
LDA #$0D ;\change pose for split second
STA $13E0 ;/
LDA #$CF ;\ Make him move right
STA $7B ;/
LDA #$01 ;\ Play sound effect
STA $1DFA ;/
LDA #$01 ;\ tell the game that you just jumped off the right wall
STA !freeram4 ;| and are ready for the left
STZ !freeram3 ;/
STZ !freeram1
STZ !freeram2
end:
RTL
%RATS_end(0)
2.Patch: Super-Jump, by pressing A:
Codemacro RATS_start(id)
db "STAR"
dw RATS_Endcode<id>-RATS_Startcode<id>
dw RATS_Endcode<id>-RATS_Startcode<id>^#$FFFF
RATS_Startcode<id>:
endmacro
macro RATS_end(id)
RATS_Endcode<id>:
endmacro
lorom ;\ ROM is LoRom
header ;/ and has a header.
org $8DC4 ;\ Hijack NMI routine
JSL StatusCode ;| and jump to our code
NOP ;/ also NOP one time.
org $15B6E0 ;| POINT TO FREE SPACE!!!
%RATS_start(0)
StatusCode:
LDA #$02 ;\ Restore previous
STA $420B ;/ hijacked NMI routine.
LDA $77 ;\Check if your already in the air
AND #$04 ;/ neccessary since if you stop moving while spin jumping in the air, you will fly.
BEQ return
LDA $140D ; check if spin jumping
STZ $140D
BEQ return:
LDA $7B ;\Comment these two lines out if you
BNE return: ;/Want it to work while moving
LDA #$90 ;\Cause Mario to fly up
STA $7D ;/
return:
RTL
%RATS_end(0)
btw.: Freespace is set..
--------------------
Your layout has been removed.
Follow Us On