Banner
Views: 993,757,725
Time:
21 users online: Bluremii, CONLUSH666, edgar,  Fernap, Green Jerry,  Hemorragia, Hwailaluta, KekShadow_08, Kusrry, L4good, le4che, LucasRCD, Luxari0n, MAOC_Barreto, mariosr, MarsAmpere, Maw, nobletofu, Nowieso,  Segment1Zone2, Spade_Magnes - Guests: 81 - Bots: 136 Users: 54,491 (2,077 active)
Latest: Lyphoon
Tip: When determining a time limit, remember that players won't be as familiar with the level as you are. If you normally complete the level with around 100s left on the timer, others might run out of time on their first try.
Not logged in.
2 Patches, same status bar routine...
Forum Index - SMW Hacking - SMW Hacking Help - ASM & Related Topics - 2 Patches, same status bar routine...
Pages: « 1 » Link - Thread Closed
I have two Patches with the same status bar routine hijack (don't know if that's right so..), and now I don't know how to change one to another place than $8DC4. Well I know HOW, but I don't know where to.

--------------------
Your layout has been removed.
Why not just combine the two codes?
Yeah, what Maxx said is the the best way to get them both to work. You can do this by pasting one of the patches' routine in the other patch and access it through a JSR/JSL.
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:

Code
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 $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.
This should do it, even though the code looks messy.
Alright, now!
Thanks to you, everything worked fine now, but I have another question:
When I press A, the Super Jump starts, but the "Spin-Jump" Sound still palys..
Do you know, how I can disable it?
Can I delete it with a simple Hex-Edit?

--------------------
Your layout has been removed.
Originally posted by leod
Alright, now!
Thanks to you, everything worked fine now, but I have another question:
When I press A, the Super Jump starts, but the "Spin-Jump" Sound still palys..
Do you know, how I can disable it?
Can I delete it with a simple Hex-Edit?

Sure. Just change this:
0584A---$00: D64A=====1 byt----Misc.---Spin Jump Sound, uses bank 1DFC.

To 00.
Well, NOW it plays the Coin Sound.
I think that fits better to the Super Jump than the Spin Jump Sound, but it should make no Sound...


Edit: Sorry, I used 01.
Edit 2: Thread can be closed.

--------------------
Your layout has been removed.
Pages: « 1 » Link - Thread Closed
Forum Index - SMW Hacking - SMW Hacking Help - ASM & Related Topics - 2 Patches, same status bar routine...

The purpose of this site is not to distribute copyrighted material, but to honor one of our favourite games.

Copyright © 2005 - 2022 - SMW Central
Legal Information - Privacy Policy - Link To Us


Menu

Follow Us On

  • YouTube
  • Twitch
  • Twitter

Affiliates

  • Super Mario Bros. X Community
  • ROMhacking.net
  • Mario Fan Games Galaxy
  • sm64romhacks