; Wall Jumping Patch 2.0 ; By: HuFlungDu ; Copyright: None. Use whatever you want in this patch to whatever means you ; wish. Claim it as your own if you want. No credit necessary ; commented on this till my fingers bled, hopefully it makes sense ; jump off any solid object if you run into the ogject while in the air and push B ; will only let you jump off a wall if you havn't jumped off of it last ; but I explain how to change this farther down ; this is an updated version, I had an epiphany at 4 o'clock in the morning and re-wrote this ; What has changed: ; 1) most important, fixed an ugly bug involving the lack of a wall ; 2) gives you the option of allowing mario to slide down walls when he hits them, making him ; fall slower. ; 3) uses a different sound effect and spawns the spin jumping on a spikey sprite ; 4) uses one more RAM address ; 5) some extremely minor things that are totally unnoticable to anybody but me, just know that ; I lowered the time taken by the code by 3 cycles (less than a milisecond) !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 !freeram5 = $0664 macro RATS_start(id) db "STAR" dw RATS_Endcode-RATS_Startcode dw RATS_Endcode-RATS_Startcode^#$FFFF RATS_Startcode: endmacro macro RATS_end(id) RATS_Endcode: 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 $138000 ;| 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 JSR Physix LDA $13E0 CMP #$3C BNE notreturn BRL return notreturn: 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 LDA #$05 STA !freeram5 dontstoreleft: LDA $15 ;\ check if left is pressed AND #$02 ;/ BNE rightcheck JSR Slide ;comment this out if you dont want mario to slide down walls 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 JSR 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 LDA #$05 STA !freeram5 dontstoreright: LDA $15 ; this will basically just skip everything if you didn't AND #$01 ; get blocked BNE reset JSR Slide ;comment this out if you dont want mario to slide down walls 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 JSR 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: LDA !freeram5 BEQ NotDEC DEC !freeram5 BRA DECD NotDEC: STZ !freeram1 STZ !freeram2 DECD: 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 #$02 ;\Play sound effect (spin jumping off enemy) STA $1DF9 ;/ JSL $01AB99 ;spawn Spin Jumping off spiked enemy sprite 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: RTS 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 #$02 ;\Play sound effect (spin jumping off enemy) STA $1DF9 ;/ JSL $01AB99 ; spawn Spin Jumping off spiked enemy sprite 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: RTS Slide: LDA !freeram1 BNE slide LDA !freeram2 BEQ endslide slide: LDA #$80 CMP $7D BCC endslide LDA $7D CMP #$20 BCC slidefound LDA #$20 STA $7D slidefound: LDA #$0D STA $13E0 LDA !freeram1 BNE leftface LDA #$00 STA $76 RTS leftface: LDA #$01 STA $76 endslide: RTS Physix: lda $0100 CMP #$14 BNE returnP LDA $0DB3 CMP #$01 BNE returnP LDA #$FC ;\ Fireball Speed STA $1745 ;/ #1 LDA #$FC ;\ Fireball Speed STA $1746 ;/ #2 LDA #$FF STA $0DAC LDA $15 ;\ CMP #$80 ; check to see if A or B has been pressed. if not end BNE returnP ;/ LDA $77 ;\ AND #$04 ; check to see if not touching the ground, if, end BNE returnP ;/ LDA $7D ;\ SEC ; move luigi up a bit SBC #$01 ; STA $7D ;/ returnP: RTS %RATS_end(0)