Banner
Views: 240,585,670
Time: 2013-06-19 03:01:00 PM
21 users online: AlexanderXCIII, o CK Crash, o Devann, Dipalon, DJ Galax, Everest, Gamma V, gibbl, Gwaur, kirbymaster1, Ludus, Lui37, MarioBros980, MarioFan22, Nintandopartnes, Ragey, o ShadowPhoenix, Skilllux, Teyla, yayayoub, yoshicookiezeus - Guests: 35 - Bots: 23Users: 23,083 (1,325 active)
Latest: Mastergamerlive
Tip: You can edit the properties of the original sprites using Tweaker.
Special Exit when Mario Dies
Forum Index - SMW Hacking - General SMW Hacking Help - ASM & Related Topics - Special Exit when Mario Dies
Pages: « 1 »
Okay so I'm trying to make it so that when Mario dies, the special exit for the level is activated. So far I have ripped off some other peoples work and come up with this:
Code
!freeSpace = $218000

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
header

org $
	JSL DeathRoutine

org !freeSpace
%RATS_start(0)

DeathRoutine:
LDA $02 	;1 = normal exit, 2 = secret exit 
TAX 
LDA $0DD5 				
BEQ Skip 		
BPL Return 
Skip: 
TXA 
STA $13CE 		;activate midway point flag
STA $0DD5 		;activate exit point
INC $1DE9 		;	
LDA #$0B 		;fade
STA $0100 		;to OW (without blur effect)
return: 
RTL
%RATS_end(0)

(If you see any problems in this let me know because this is my first Xkas patch so I just ripped off smallhacker's pallet patch and changed it but I don't know if anythings wrong or not)

So my question is, what byte do I hijack to insert the JSL Deathroutine?.
The death routine is located at $F606 in bank 00. Access it through a JSL, and restore this in your code:

LDA #$90
STA $7D ; hacked code.
I'm sorry, How do I restore

LDA #$90
STA $7D ; hacked code.

in my code? I don't really understand what that means... thanks though.
You just need to add that in your code, preferably at the beginning so that nothing goes nothing (in case you modify A).
That's the code you overwrote by JSL DeathRoutine, which means that it doesn't exist anymore and that you have to put it somewhere else to have it executed. I haven't taken a closer look at your code, but putting it after the "Return:" label should probably work.

EDIT: Oh yeah, putting it at the beginning sounds better.
Last edited on 2009-08-20 10:11:07 AM by WhiteYoshiEgg.
alright cool, Thanks.

P.S. Iceguy, your totally the guy I ripped off for this code :)

P.P.S Okay so the hack works, Almost... I can't get it to activate the secret exit, just the normal exit. I tried changing LDA $02 to LDA $01 but without any success. While I could fix this by making the real exits secret exits, I would like to know why this is happening.
Last edited on 2009-08-20 10:30:10 AM by HuFlungDu.
Originally posted by The ram map, perhaps your greatest friend
$7E:0DD5 1 byte Misc. FF = activate secret event on level exit
Pages: « 1 »
Forum Index - SMW Hacking - General SMW Hacking Help - ASM & Related Topics - Special Exit when Mario Dies

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

Copyright © 2005 - 2013 - SMW Central
Legal Information - Link To Us


Total queries: 28

Menu