Register | Login
Views: 19364387
Main | Memberlist | Active users | ACS | Commons | Calendar | Online users
Ranks | FAQ | Color Chart | Photo album | IRC Chat
11-02-05 12:59 PM
1 user currently in Super Mario World hacking: labmaster | 3 guests
Acmlm's Board - I2 Archive - Super Mario World hacking - Good place to insert subroutine?
  
User name:
Password:
Reply:
 

UserPost
BMF98567
Posts: 1025/1261
I originally hooked the routine that clears the sprite RAM for my HDMA hack (until I discovered it would glitch up when the game slowed down). The routine's located in RAM at $7F8000, so look for 22 00 80 7F. There are a lot of these JSLs in the ROM, though, and I can't recall which one I hooked...
HabsoluteFate
Posts: 159/179
Address 00/A314 is always called...or you would have to think it is (I know its always called when mario is within a level and although i havent checked i would assume it is called even during the overworld). Its the code that loads the current palette depending on which mario/luigi is currently on screen. From what i have seen in my tests there is never a jump in the middle of it so your safe moving the code..
I'd recommend perhaps moving the chunk of code that is currently there to the same bank as your new code. Have A314 first call your new code, within your new code have it call the chunk of code you already moved, return from that, return RTL from your code and your done...
Sukasa
Posts: 1520/1981
Because I was being funny, besides, you'd have the code running more than once a frame, if more than one block wre triggered. Just ignore that post.

[ontopic]Well, another non-joking idea is to set a breakpoint on mario's XY location code, and then trace the code after that until you get to an RTS/RTL. that should put you in the main level loop.
Glyph Phoenix
Posts: 419/745
"Kinda joking"? How the hell do you say something that is only "kinda joking"?
Sukasa
Posts: 1518/1981
To be honest, I was kinda joking with that last one.
Glyph Phoenix
Posts: 418/745
o_0

That'd be incredibly stupid. What if you were in water or on top of a background tile or in front of a ledge? It would be nearly impossible to eliminate all such occurances. And then the slowdown. And then the slowdown!

But this did give me a nifty idea for a level. What if, in a water level or something, Block 25 was a waterfall that pushed you down? And then you had to navigate under ledges and things like you do the salt shaker of Level Ate of Earthworm Jim 2, else you couldn't jump because of the watefall pressure. But even then screwing with Block 25 is an inelegant and problematic way to do that, and making waterfall tiles would be a better solution.
Sukasa
Posts: 1517/1981
I have another idea- If you're always going to be touching block 25, then why not just add the code in as a custom block, set for tile 0x25?
DisruptiveIdiot
Posts: 122/147
Originally posted by Smallhacker
Sukasa: Yeah, I know, but it's hard to be sure if it's always excecuted, or if it happened to be a part of the routine of the block Mario's standing on or such. I'll give it a try anyway.


You could always make a test level with only two blocks in it and trace the code while standing on both blocks so you can use the differences in the traced code to figure out what is block code and what is the actual "playing a level" loop.
Smallhacker
Posts: 1919/2273
Sukasa: Yeah, I know, but it's hard to be sure if it's always excecuted, or if it happened to be a part of the routine of the block Mario's standing on or such. I'll give it a try anyway.
Sukasa
Posts: 1508/1981
My best advice SH would be to fire up geiger's debugger, and "step into" the code while playing any level. Locate the address of the code it gives you, and then overwrite it (and possibly the next command after that) with the JSL, and re-write the code that you overwrote in the beginning of your subroutine.
Juggling Joker
Posts: 963/1033
The loops that's executed every frame of gameplay.
XPeter
Posts: 662/963
What's the "playing a level" loop?
Smallhacker
Posts: 1918/2273
I know where to place the code, but what I need is a good place to put the JSL/JSR which jumps to the new code.
Keikonium
Posts: 2133/-2459
My guess would be at the end of the rom where all the free space (FF) is. You can jump to any part of a rom that isn't the expanded part (rats tags?) right?
Smallhacker
Posts: 1916/2273
I've got this piece of code which I would like to be a part of the "playing a level" loop. Therefore, does anyone know about a good spot to place the JSR/JSL?
Acmlm's Board - I2 Archive - Super Mario World hacking - Good place to insert subroutine?


ABII


AcmlmBoard vl.ol (11-01-05)
© 2000-2005 Acmlm, Emuz, et al



Page rendered in 0.002 seconds.