Banner
Views: 235,700,377
Time: 2013-05-18 02:36:44 AM
9 users online: blue leader, cyphermur9t, Daizo Dee Von, Ginyu AL, HyperMario, LaughingLuigi, TomPhanto, turbofa, xImseiken3 - Guests: 21 - Bots: 29Users: 22,832 (1,277 active)
Latest: Lithuanian Dude
Tip: Verify that your hack's IPS patch is functioning correctly before submitting it.
What's wrong with my code?
Forum Index - SMW Hacking - General SMW Hacking Help - ASM & Related Topics - What's wrong with my code?
Pages: « 1 »
Okay, I'm doing a powerup that makes Mario explode like a Bob-Omb. The problem is, when I test it, everything is correct, MINUS the fact Mario DOESN't explode. How do I fix the piece of code below to make Mario explode?
(The use of RAM $1497 is intentional)
Code
LDA $1497 BNE Return2 LDA #$15 STA $1887 ; shake the ground LDA #$0D ;/ STA $9E,x ;\ Sprite = Bob-omb. LDA #$08 ;/ STA $14C8,x ;\ Set status for new sprite. JSL $07F7D2 LDA #$01 ;\ .. and flag explosion status. STA $1534,x ;/ LDA #$40 ;\ Time for explosion. STA $1540,x JSL $028086 LDA #$09 ;\ STA $1DFC ;/ Sound effect. LDA #$1B STA $167A,x LDA #$80 STA $1497 Return2: RTS
It doesn't seem like you're setting the position of the spawned explosion anywhere in that code, so it's probably ending up somewhere way offscreen. Also, I assume you have code to find an empty sprite slot and put it into the X register right before the piece of code you posted? Otherwise, you're going to have to add that as well.

Or is this whole thing a sprite that follows on top of Mario's position? In that case, disregard everything I just said.
No, it's a powerup. So... all I have to do is set the explosion position to Mario's position or am I wrong?
If the code you posted is already in a sprite and you don't need Mario to be able to explode more than once (since you're overwriting the current sprite with the explosion), then sure. Just note that this will hurt Mario when triggered unless you turn him invincible for the duration of the explosion.
Nope. It still doesn't work. When I test it, mario explodes, but some weird tiles appear near the status bar...

EDIT: Problem solved. This can be closed now. Thanks, yoshicookiezeus.
Last edited on 2012-02-10 04:30:55 PM by Fierce Deity Manuz OW Hacker.
What kind of tiles? Sprite tiles or layer 3 tiles? The latter would probably just be a misplaced store to one of the status bar addresses, but the former sounds like more like something has gone wrong with the OAM.
Don't worry, yoshicookiezeus, I discovered that the weird tiles were actually the explosion; I fixed the powerup and made two hex edits so the explosion tiles now use the unused 5-up tile.
As I said before, this can be closed. Thank you.
Pages: « 1 »
Forum Index - SMW Hacking - General SMW Hacking Help - ASM & Related Topics - What's wrong with my code?

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: 27

Menu