Points of Required Attention™
Please chime in on a proposed restructuring of the ROM hacking sections.
Views: 88,480,023
Main | FAQ | Uploader | IRC chat | Radio | Memberlist | Active users | Latest posts | Calendar | Stats | Online users | Search 04-25-24 03:34 AM
Guest: Register | Login

0 users currently in ROM Hacking | 2 guests

Main - ROM Hacking - Help with SML2 New thread | New reply


Raccoon Sam
Posted on 04-13-08 05:32 PM (rev. 11 of 04-14-08 06:43 PM) Link | Quote | ID: 81840


Cobrat
Level: 56

Posts: 464/672
EXP: 1379883
Next: 18293

Since: 02-19-07
From: Hi

Last post: 3466 days
Last view: 2697 days
So alright, I'm trying to figure out how the overworld paths work. The thing is, it has driven me to the very edge of my sanity.
So far I've understood it starts at 0x61600 and ends at either 0x61A39 or 0x61A3F.
Here's the first event after the FFs in the array;
A1 5A AE 5A B8 5A FF FF
That's 8 bytes, and represents the very spot here.
Now the structure works like this; Right - Left - Up - Down. Two bytes per direction.
i.e
A1 5A -> Pushing right will run event A1 5A
AE 5A -> Pushing left will run event AE 5A
B8 5A -> Pushing up will run event B8 5A
FF FF -> Pushing left will do nothing

Makes sense, I guess. Changing the values will result crazy changes though, as I do not know where the events are defined, are the events 2 bytes or does the other byte have a meaning (It's usually 5A or 5B or anything with 5 first).
That's not all, though. After the whole bunch, at 0x61A40, there's another array. No idea how long it is, how it works, how many bytes are there and what they mean. All I know is that they're related to paths too, as altering them will screw the paths up again.


So uh, anyone feel like looking into this alone/with me? I really want to nail this down but I'm all out of ideas.


EDIT: Alright, I think I got something. The first array definitely ends at 0x61A3F, but here's the big scoop.
0x61A40 starts a command list. 02 02 02 02 02 02 04 04 04 02 02 00 00. The commands are all bitwise.
First nibble sets your 'state', and the second nibble your direction. 00 means stop movement.
States:
0 = Walk
1 = Half-walk
2 = Tiny
3 = Tiny (also)
4 = Invisible
5 = Invisible (also)
6 = Invisible (yet again)
7 = Invisible (yup)
8 = Climb
9 = Walk
A = Walk (choppy)
B = Tiny
C = Invisible
D = Invisible
E = Invisible
F = Invisible half-walk

Directions:
0 = Stationary
1 = Right
2 = Left
3 = Right
4 = Up
5 = Up-right
6 = Up-left
7 = Up-right
8 = Down
9 = Down-right
A = Down-left
B = Down-right
C = Up
D = Up-right
E = Up-left
F = Up-right

So 02 02 02 02 02 02 04 04 04 02 02 00 Would mean;
Walk Left 6 tiles, Walk up 3 tiles, Walk left 2 tiles, Stop. Familiar route? That's right. It's this. Green means walk left, yellow means walk up, red means stop.

EDIT 2: I managed to edit the paths a little now, but I've still got to figure out what the other possible digits mean on the Directions and the States. Please see the obligatory YouTube video to see what can be done.

EDIT 3: Alright, new informations. The 2-byte events are pointers. Let's go back to the first array;
A1 5A AE 5A B8 5A FF FF:
A1 5A -> Read directions from 0x61AA1
AE 5A -> Read directions from 0x61AAE
B8 5A -> Read directions from 0x61AB8
FF FF -> Don't read anything

Not sure what the 5 does yet. My best guess is it's submap related.

____________________


Main - ROM Hacking - Help with SML2 New thread | New reply

Acmlmboard 2.1+4δ (2023-01-15)
© 2005-2023 Acmlm, blackhole89, Xkeeper et al.

Page rendered in 0.018 seconds. (347KB of memory used)
MySQL - queries: 37, rows: 57/58, time: 0.015 seconds.