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 - Working Pipes in SMB3: How To | |
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
User Post
beneficii

Lakitu
Level: 36

Posts: 119/567
EXP: 299656
For next: 8454

Since: 06-27-04
From: Cordova, TN, USA

Since last post: 14 hours
Last activity: 6 hours
Posted on 06-12-05 06:14 AM Link | Quote
NOTE: Remember, all numbers mentioned herein are in hexadecimal (base 16) unless otherwise mentioned!

Alright, here's something I have just been working on: doing pipes in SMB3. I believe I have discovered enough to allow manipulation of pipe positions to one's heart's content. Here is the data:

There are 18 bytes per table, and they each start at the named address. Essentially, each byte can be divided into two nibbles, the first which determines the left pipe's exit spot on the map and the second which determines the right pipe's exit spot on the map.

46AA, screen number. This is the screen number. The first nibble determines for when you enter the left pipe (in the pipe level) and the second nibble determines for when you enter the right pipe.

46C2, x position. First nibble determines for when you enter the left pipe, second nibble right pipe.

46DA, y position in Discombobulator or Workshop + 2. First nibble left pipe, second nibble right pipe.

How does the game access this data, you might ask? Well, through the enemy data. The enemy data is different for each pipe level, as it determines the y position of a sprite (the only one in that level), whose tile number is 25, bank 1, and whose y position determines which byte in the table to use (from 0 to 17). You take the current enemy data address, add 3 to it, and there's your table number.

Here's a list of the enermy data (using the starting value, so just add 3 to it to find the byte itself) and their corresponding table numbers:

C103--0C
C108--0D
C10C--0E
C111--0F
C116--10
C11B--11
C120--05
C125--04
C12A--07
C12F--08
C134--06
C139--0B
C13E--09
C144--0A
C149--02
C14D--03
C153--01
C158--12
C15C--13
C162--14
C167--15
C16B--16
C171--17
C176--19 (out of range? unused?)

Remember to add 3 to each of these. The number 0 is used for the sky tower, but note that the two nibbles are switched. Here are some of my thoughts on this:

Like with the locks' 14888, these pipes seem to have an inexplicable table starting at 46F2. It's full of different values, and if you change them for the pipe number you want, it'll mess the pipe up. Still, leave them untouched, and it seems like you can still do anything with the pipes. Perhaps this is a mystery that does not need to be solved, because you can already set the screen number, x position, and y position?

Anyway, tell me what you guys think. Tell me if you see any errors or problems with what I wrote or if you'd like anything clarified.

EDIT: C171 is used! Thanks Kamek!


(edited by beneficii on 06-13-05 05:16 PM)
Kamek77

Goomba
Level: 8

Posts: 12/29
EXP: 2151
For next: 36

Since: 04-26-05
From: Oklahoma, USA

Since last post: 2 days
Last activity: 9 hours
Posted on 06-13-05 05:54 AM Link | Quote
To add on to the table above:

C171 (table value 17) is used: it is the pipe in world 5 after 5-2.
If you look at the enemy group at C176, it is a red Koopa, a Lakitu, and a goal card--no Warp Pipe sprite in there.

There is, however, a Warp Pipe sprite at both CFE7 and CFEC. These are used for the world 5 tower. The y value is $80--well out of range of the table above. Do you know how the game handles this special case?
beneficii

Lakitu
Level: 36

Posts: 128/567
EXP: 299656
For next: 8454

Since: 06-27-04
From: Cordova, TN, USA

Since last post: 14 hours
Last activity: 6 hours
Posted on 06-13-05 07:32 AM Link | Quote
Kamek77,

These were things I missed. Thanks for getting the info on that! Here's what I recommend you do first to find it out:

Go to the start of a table and go ahead 80 bytes. See if anything meaningful appears (i.e. check to see if the exit point matches the exit point in each of the table data). See if they link up.

If they don't, then I recommend getting something like FCEUXD, running a trace on the point right where you enter the pipe that takes you to the sky. Right when you enter the pipe. Start the trace right when you have Mario jump up to it, then stop the trace after he starts moving in. Make sure the trace saves to something like a text file. Open up the text file, which will be very large BTW, press Ctrl + F (or however you access your Find function), enter the address of the y position of the pipe sprite, and search for it. If you don't find it, then trace another part of Mario entering the pipe. Basically, search for the part of the ASM that loads the sprite's y position and does something with it. Look to see if it uses the y position value to read any other addresses on the ROM.

Open up Discombobulator or Workshop and get the x and y values of the pipe you come out of on the World Map. Check around that same part of the ASM, see if anything matching those x and y and screen values (in the same pattern as the other pipe data) of the pipe gets stored. Then check where those values were loaded from. After finding them, experiment a bit with them, see if you can get a change. If there is and it makes sense, then you will have found your addresses!

That's what I would do, anyway, if I had the time right now, but I must work on another project at the moment.

EDIT:
Never mind. I figured it out. It loads from the very first item in each table, but then swtiches the two positions (i.e. the functions of the left and right nibbles in each item are switched). Well, y'all thought it was unused, but it wasn't. So there. :p


(edited by beneficii on 06-12-05 02:35 PM)
(edited by beneficii on 06-13-05 05:14 PM)
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
Acmlm's Board - I2 Archive - Rom Hacking - Working Pipes in SMB3: How To | |


ABII


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



Page rendered in 0.026 seconds.