| Special Exit when Mario Dies |
|
Forum Index - SMW Hacking - General SMW Hacking Help - ASM & Related Topics - Special Exit when Mario Dies |
|
Pages: 1  |
|
|
|
| Posted on 2009-08-20 09:35:58 AM |
Link | Quote |
|
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?.
|
|
| Posted on 2009-08-20 09:39:03 AM |
Link | Quote |
|
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.
|
|
| Posted on 2009-08-20 09:54:55 AM |
Link | Quote |
|
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.
|
|
| Posted on 2009-08-20 10:04:50 AM |
Link | Quote |
|
|
You just need to add that in your code, preferably at the beginning so that nothing goes nothing (in case you modify A).
|
|
| Posted on 2009-08-20 10:06:07 AM |
Link | Quote |
|
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. |
|
| Posted on 2009-08-20 10:09:47 AM |
Link | Quote |
|
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. |
|
| Posted on 2009-08-20 03:37:49 PM |
Link | Quote |
|
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 |