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 Rom Hacking: hukka | 2 guests
Acmlm's Board - I2 Archive - Rom Hacking - SMB2 simple ASM hack and documentation | |
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
User Post
Ice Ranger

Leever
Level: 23

Posts: 99/183
EXP: 60462
For next: 7261

Since: 03-16-04

Since last post: 82 days
Last activity: 3 days
Posted on 03-23-05 12:56 AM Link | Quote
While taking a break from graphics editing to begin searching for data for SMB2 for my hack, I decided to go ahead and try some of what I found out. Following in Rockman's footsteps. I bring you an ASM hack that brings invinicibility after grabbing so many... cherries. What's the difference? You don't have to grab the starman after getting the cherries.

Thanks to some notes from Dahrk Daiz, Rockman, and a ton of tracing. I was able to do my own ASM hack (yes, the first that actually came out how I intended).

Instead of a starman appearing after grabbing 5 cherries, you are automatically given the invincibiltiy from collecting the fifth cherry.

Here's the updated patch with the unnecessary lines mentioned below removed.

Here's the documentation:

CHERRY GRABBING ROUTINE found by Dahrk Daiz

@0x00101D

$900D: A5 00 LDA $00 = #$50
$900F: C9 4E CMP #$4E <------------------Compare if current tile you are over is the cherry tile
$9011: D0 3F BNE $9052
$9013: EE 2A 06 INC $062A = #$00 <---------------If it is, then increase the cherry count
$9016: AD 2A 06 LDA $062A = #$00
$9019: E9 05 SBC #$05 <-----------Number of cherries required for starman
$901B: D0 06 BNE $9023
$901D: 8D 2A 06 STA $062A = #$00
$9020: 20 00 9D JSR $9D00 <----------------- Jump to the SubRoutine (JSR) below
$9023: A9 04 LDA #$04
$9025: 8D 02 06 STA $0602 = #$00
$9028: A9 40 LDA #$40
$902A: 4C 7C 93 JMP $937C

STAR MAN ROUTINE (RIPPED AND PUT HERE)
ORIGINALLY BEGINNING AT $B819 ENDING AT $B828

@0x001D10

$9D00: A9 3F LDA #$3F
$9D02: 8D E0 04 STA $04E0 = #$00 <-------------Starman is activated
$9D05: A9 10 LDA #$10
$9D07: 8D 00 06 STA $0600 = #$00 <-------------music is changed
$9D0A: A9 00 LDA #$00 <--------------|
$9D0C: 99 51 00 STA $0051,Y @ $0150 = #$00 |---------- Is unneeded!
$9D0F: 60 RTS <-------------|


Actually, the RTS can be placed imediately after the STA $0600 = #$00 to behave as the game normally would freeing up 5 bytes. Thanks to Dan for making me check this out.


(edited by Chill Penguin on 03-22-05 08:03 PM)
(edited by Chill Penguin on 03-22-05 08:15 PM)
(edited by Chill Penguin on 03-22-05 08:20 PM)
(edited by Chill Penguin on 03-22-05 08:22 PM)
(edited by Chill Penguin on 03-22-05 08:48 PM)
(edited by Chill Penguin on 03-22-05 08:50 PM)
(edited by Chill Penguin on 03-22-05 10:42 PM)
(edited by Chill Penguin on 03-22-05 10:59 PM)
dan

Snap Dragon
Level: 43

Posts: 484/782
EXP: 534516
For next: 30530

Since: 03-15-04

Since last post: 20 hours
Last activity: 14 hours
Posted on 03-23-05 02:05 AM Link | Quote
Nice hack! It definitely beats the existing system already in SMB2.

I was gonna ask why you copied the code until I noticed the fact that the two pieces of code were in different banks. One thing I noticed though, was this section:

$9D0A: A9 00 LDA #$00
$9D0C: 99 51 00 STA $0051,Y @ $0150 = #$00

It looks to me as if Y is never set in your code. So, your code could in theory overwrite anything between $51 and $150 with $00. It probably works fine, but you could try setting Y to whatever it should be at that point in the original routine. If it's random in the original routine it's probably alright to leave it.
Luigi-San

Melon Bug
Level: 42

Posts: 247/736
EXP: 485962
For next: 35400

Since: 03-20-04
From: Mushroom Kingdom

Since last post: 17 hours
Last activity: 10 hours
Posted on 03-23-05 02:25 AM Link | Quote
Nice Hack, it'll really come in handy


(edited by Luigi-San on 03-22-05 05:25 PM)
iamhiro1112

Armos
Level: 35

Posts: 249/487
EXP: 259927
For next: 20009

Since: 03-27-04
From: sd

Since last post: 18 days
Last activity: 7 days
Posted on 03-23-05 03:01 AM Link | Quote
Ya, definately a nice hack. Are you gonnna include a shell that reflects off walls? I heard someone else made a hack where the shells would do that. I never seen the hack tho and think it would be pretty cool.
Ice Ranger

Leever
Level: 23

Posts: 100/183
EXP: 60462
For next: 7261

Since: 03-16-04

Since last post: 82 days
Last activity: 3 days
Posted on 03-23-05 04:53 AM Link | Quote
Originally posted by iamhiro1112
Ya, definately a nice hack. Are you gonnna include a shell that reflects off walls? I heard someone else made a hack where the shells would do that. I never seen the hack tho and think it would be pretty cool.


Heh, Acmlm is the one with the reflecting shells.

Originally posted by dan
I was gonna ask why you copied the code until I noticed the fact that the two pieces of code were in different banks. One thing I noticed though, was this section:

$9D0A: A9 00 LDA #$00
$9D0C: 99 51 00 STA $0051,Y @ $0150 = #$00

It looks to me as if Y is never set in your code. So, your code could in theory overwrite anything between $51 and $150 with $00. It probably works fine, but you could try setting Y to whatever it should be at that point in the original routine. If it's random in the original routine it's probably alright to leave it.


Different banks? That helps explains so much why trying to just put a JSR to the invinibility routine didn't work and froze the game. As for the $0051 ~ $0150, I'll take a closer look at it, might be able to drop it completely even.

*OK, here is how the code should read (I've put the patch at the top)*
$9D00: A9 3F     LDA #$3F
$9D02: 8D E0 04 STA $04E0 = #$00 <-------------Starman is activated
$9D05: A9 10 LDA #$10
$9D07: 8D 00 06 STA $0600 = #$00 <-------------music is changed
$9D0A: 60 RTS


Making the starman unneeded allows for more graphics and room for ASM where the original was (even though there is a lot of room for ASM hacks anyway). Plus, without the starman, there is less chance of a slowdown or sprite not appearing because of the starman graphic.

*Really, who really says "starman" anymore? I just say it because SMB3 is when they quit calling it that.*


(edited by Chill Penguin on 03-22-05 08:11 PM)
(edited by Chill Penguin on 03-22-05 08:22 PM)
MathOnNapkins

Math n' Hacks
Level: 67

Posts: 1637/2189
EXP: 2495887
For next: 96985

Since: 03-18-04
From: Base Tourian

Since last post: 1 hour
Last activity: 32 min.
Posted on 03-23-05 05:07 AM Link | Quote
Acm-who? apparently nobody visits the overclocked page anymore

Nice patch but I really can't tell exactly what it does (edit: I know what the patch DOES, just not how it accomplishes it in asm specifically.), so you might as well not call it documentation unless you say what all the pertinent addresses are. For example, I'm assuming that you have done something to enable an invincibility timer and / or flag. And since it has already been activated, presumably it won't reactivate when it gets to wherever it usually handles that.

I still say starman b/c it kicks ass. it really doesn't look anything like a man though.


(edited by MathOnNapkins on 03-22-05 08:14 PM)
BMF98567
BLACK HAS BUILT A SILLY DICE-MAZE!
GO!

Current list of BURNING FURY >8( recipients:
- Yiffy Kitten (x2)
- Xkeeper
Level: 53

Posts: 710/1261
EXP: 1094149
For next: 62970

Since: 03-15-04
From: Blobaria
Special Move: Rising Meatloaf Backhand Combo

Since last post: 21 hours
Last activity: 1 hour
Posted on 03-23-05 12:20 PM Link | Quote
It's called Starman in SSBM, so it's still an official term. Somehow I don't think Mushrooms are ever going to be called "Magic Mushrooms" again, though.
dan

Snap Dragon
Level: 43

Posts: 486/782
EXP: 534516
For next: 30530

Since: 03-15-04

Since last post: 20 hours
Last activity: 14 hours
Posted on 03-23-05 02:58 PM Link | Quote
Originally posted by Chill Penguin
Different banks? That helps explains so much why trying to just put a JSR to the invinibility routine didn't work and froze the game.


Yeah. SMB2 utilises mapper 4 (MMC3 to be precise), and all banks in that mapper are 8k in size (not the 16k that some mappers allow you to use, like mapper 2).

$8000 - $9FFF
$A000 - $BFFF
$C000 - $DFFF
$E000 - $FFFF

I think that's the various bank positions or whatever for MMC3. Firebug's document tells you what size banks are in the various mappers (even if it does leave out some important information).
Ice Ranger

Leever
Level: 23

Posts: 104/183
EXP: 60462
For next: 7261

Since: 03-16-04

Since last post: 82 days
Last activity: 3 days
Posted on 03-25-05 01:13 AM Link | Quote
My question is what else should I try to accomplish in SMB2? Here's the list of what I wanted to try when I first wanted to start ASM hacking SMB2.

I've been looking at several documents at Zophar's to figure out how to use PPU view in FCEUXD to my advantage. Tell me what's feasible, any specific documents to take a closer look at, or even if the ideas are any good.

Note that Idea 1 is what I wanted to base the hack on anyway; finding cherries to complete a level.

The ideas are just to help me figure out ASM more (as how hacking SMB2 came about). I don't think I'll actually use the patch for invincibilty in my hack, but I think it's a start to going in the right direction.

(1) Use cherries for something else (find a way to keep them from regenerating) hawk mouth opening is one idea.

(2)Give sprites different color options besides the original default colors.

(3) Eliminate the star completely (to free up more room for ASM mainly) if not, then just the star graphics, you automatically have the star power instead of having to grab the star. <----Heh, I did that , though it may take awhile to use the extra space for something else.

(4) The hawk mouth opens after grabbing a certain number of cherries (I'd like to know how to do this, but involves getting around a lot)

(5) Be able to choose a different character after dying (like SMAS)

(6) Allow subspace to open in vertical areas (like SMAdvance) <--- Not happening, unless someone finds out a lot about it. Very complex doesn't work the same even if you go through the door.
iamhiro1112

Armos
Level: 35

Posts: 259/487
EXP: 259927
For next: 20009

Since: 03-27-04
From: sd

Since last post: 18 days
Last activity: 7 days
Posted on 03-25-05 01:26 AM Link | Quote
Well, I was hoping for reflecting Turtle Shells. Also, why not have a multi use Pow Block. Probably like the one in SMAdvance. There is a gamegenie code that lets you use the Pow Infinitely so I imagine it would be possible.
HyperLamer
<||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people

Sesshomaru
Tamaranian

Level: 118

Posts: 3896/8210
EXP: 18171887
For next: 211027

Since: 03-15-04
From: Canada, w00t!
LOL FAD

Since last post: 2 hours
Last activity: 2 hours
Posted on 03-26-05 10:47 AM Link | Quote
5. I HATE not being able to switch characters.
Ice Ranger

Leever
Level: 23

Posts: 107/183
EXP: 60462
For next: 7261

Since: 03-16-04

Since last post: 82 days
Last activity: 3 days
Posted on 03-27-05 03:00 AM Link | Quote
No. 5 is one I definitely one of the routines I want to find.

I think that #6 might actually be possible. I found that the RAM address $04B7 contains the time that subspace is active (60 in hexidecimal). Here's the problem (something I wasn't able to figure out using rockman's tutorials as well). I can't find where the intial 60 is loaded into memory. I was able to find the routine where the timer is lowered though snapping the debugger when $04B7 is written to. Seems like it is written to when visiting different areas in a level.
$9718: 60        RTS

$9719: A9 04 LDA #$04
$971B: 9D 89 04 STA $0489,X @ $0491 = #$04
$971E: A9 02 LDA #$02
$9720: 95 6F STA $6F,X @ $0077 = #$02
$9722: AC B7 04 LDY $04B7 = #$5F <---- I let it DEC by one when I took this.
$9725: F0 1A BEQ $9741
$9727: A5 10 LDA $10 = #$88
$9729: 29 03 AND #$03
$972B: D0 14 BNE $9741
$972D: A4 50 LDY $50 = #$00
$972F: C0 07 CPY #$07
$9731: F0 0E BEQ $9741
$9733: CE B7 04 DEC $04B7 = #$5F <--- this is where it is DEC.
$9736: D0 09 BNE $9741
$9738: 8D 28 06 STA $0628 = #$02

$973B: 20 DA F6 JSR $F6DA


Figuring this out may help me find how to allow a timer for the veritcal areas as well (or there is any difference there).


(edited by Chill Penguin on 03-26-05 05:01 PM)
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
Acmlm's Board - I2 Archive - Rom Hacking - SMB2 simple ASM hack and documentation | |


ABII


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



Page rendered in 0.017 seconds.