(Link to AcmlmWiki) Offline: thank ||bass
Register | Login
Views: 13,040,846
Main | Memberlist | Active users | Calendar | Chat | Online users
Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album
05-17-24 10:22 AM
0 users currently in SMW Hacking.
Acmlm's Board - I3 Archive - SMW Hacking - Confused... New poll | |
Add to favorites | Next newer thread | Next older thread
User Post
Kiwisauce

Red Goomba








Since: 09-23-06

Last post: 6300 days
Last view: 6299 days
Posted on 10-27-06 11:04 AM Link | Quote
I am stumped on a seemingly simple ASM project. I'm trying to make a save block that will call the save game function when hit from below. Here's the code:

JSL $009BC9
RTS

It seems like it should be simple, but it doesn't work (otherwise I wouldn't be posting this). Could the problem be some fundamental property of ASM that I don't know about? (e.g. is it possible to call this subroutine from a block?) Any help would be greatly appreciated.
ghettoyouth

Panser








Since: 11-19-05
From: Germany

Last post: 6411 days
Last view: 6411 days
Posted on 10-27-06 12:51 PM Link | Quote
try JML

Originally posted by Kiwisauce
(e.g. is it possible to call this subroutine from a block?) Any help would be greatly appreciated.


yes, but it will be only executed as long as mario touches the block


(edited by ghettoyouth on 10-27-06 11:51 AM)
(edited by ghettoyouth on 10-27-06 11:53 AM)
Smallhacker

Super Koopa
I AM A Group Of Officially Frustrated Younglings, G.O.O.F.Y. MEMBER








Since: 11-17-05
From: Söderhamn, Sweden

Last post: 6299 days
Last view: 6297 days
Skype
Posted on 10-27-06 01:30 PM Link | Quote
1) Make sure that the address is in SNES format. (Also, if you're writing the hex code yourself, the address should be written in reverse byte order. The address ABCDEF would be written as EFCDAB)
2) Make sure that 9BC9 is a long subroutine.
Kailieann



 





Since: 11-18-05

Last post: 6297 days
Last view: 6297 days
Posted on 10-27-06 07:37 PM Link | Quote
Originally posted by ghettoyouth
try JML

... and have the game not be able to return to the block code?
What possible purpose would that serve?
Kiwisauce

Red Goomba








Since: 09-23-06

Last post: 6300 days
Last view: 6299 days
Posted on 10-30-06 12:23 AM Link | Quote
Originally posted by Smallhacker
1) Make sure that the address is in SNES format. (Also, if you're writing the hex code yourself, the address should be written in reverse byte order. The address ABCDEF would be written as EFCDAB)
2) Make sure that 9BC9 is a long subroutine.


I'm writing the code in ASM just how I posted it and then compiling it. I checked SMW Central several times; it is the correct address in SNES format. And shouldn't the long subroutine $009BC9 be the same as the zero bank subroutine $9BC9?

Originally posted by ghettoyouth
yes, but it will be only executed as long as mario touches the block


What? That doesn't really make sense... Shouldn't the entire subroutine be executed when it's called?
spel werdz rite









Since: 11-19-05

Last post: 6298 days
Last view: 6297 days
Posted on 10-30-06 12:37 AM Link | Quote
Not if you do it with a custom block.
Wait, be more specific on what it is you're trying to do.
Smallhacker

Super Koopa
I AM A Group Of Officially Frustrated Younglings, G.O.O.F.Y. MEMBER








Since: 11-17-05
From: Söderhamn, Sweden

Last post: 6299 days
Last view: 6297 days
Skype
Posted on 10-30-06 08:53 AM Link | Quote
A long subroutine (a subroutine that ends with RTL) must be called with JSL.
A short subroutine (a subroutine that ends with RTS) must be called with JSR within the same bank as the subroutine.

If the subroutine is short and you need to call it from a block, you must add a long subroutine to the same bank as the short subroutine. The long subroutine would JSR the short one and then RTL.
Add to favorites | Next newer thread | Next older thread
Acmlm's Board - I3 Archive - SMW Hacking - Confused... |


ABII

Acmlmboard 1.92.999, 9/17/2006
©2000-2006 Acmlm, Emuz, Blades, Xkeeper

Page rendered in 0.013 seconds; used 377.90 kB (max 464.76 kB)