|
Time: Now - Date: Today - Weather: What can be seen outside. - Mood: How it feels. Answer to the universe: 42
|
Originally posted by messiaen
There is another MASSIVE list of Behavior pointers at 0xEC7E0. There are lot of repeated pointers, so most likely each one in the list is used by a specific object. However, I'm not sure if the behaviors which produce boss stars might be in there, because Koopa the Quick star is produced by behavior 0x3E64, and this isn't in the checksum area but inside his ASM as a ADD Immediate instruction.
Again, I'm mostly using Yoshiman's Spawn any object code to check on this behavior and Nemu's debugging features, so if anyone feels like working on this massive list go ahead and post the results.
Edit: Starting at 0xEC7E0 there are two behavior pointers lists:
0xEC7E0 - 0xED350: Format is [behavior - 4 bytes] [mode - 2 bytes] [parameter? - 2 bytes]
0xED35C - 0xED5E0: Format a bit different for the last 4 bytes. There are even warp behaviors in this one.
I already know about this list since a long time, check in the first post of this thread:
At 0xEC7E0 is the list of 512 model ID/param/behavior pointer combos used by the 0x42 commands, and at 0xED358 is for the 0x43 commands. The 0x43 combo list acts as a patch list to the 0x42 combos. The 0x43 list contains 81 items, and each one of these contain a value that determines which item of the 0x42 list is patched. 0x43 commands can only access the first 256 combos of the patched list.
Toad's Tool 64 already reads and use this list, so don't spend time listing what's in there, you won't find any behaviors that are not found in TT64 or in the SM64behaviors doc. TT64 not only has text labels individual model IDs and behavior pointers, but also the model ID/param/behavior combos themselves found in these lists, as well as custom combinations made by 0x24 commands.
Edit:
Here's a short long explanation on how the 0xEC7E0 list is used by the game.
The 0x42 commands use 9-bits (one byte + 1 bit) to point to one of the item of the list. Each item in the list contains a model ID, a behavior pointer and the behavior parameters. This result in commands that are shorter than 0x24 commands. They did that only to save space. The problem is that it limits you to a list of preset combinations.
To complicate things, the 0x43 command uses the first 256 items of the same list (needing only one byte to refer to the item), but with some "patches" that are defined by a list found at 0xED358, a byte in each item in the latter list defines which item is patched.
It's a really messy scheme that complicates editing and that's why flatworld only uses 0x24 commands. TT64 would be much easier to use if the game only used 0x24 commands to place objects in levels. I actually thought about converting all the original level scripts so that they use only 0x24 commands, but my tests with Castle Grounds made the game crash randomly while playing, I'm not sure why, maybe I made a mistake somewhere.
There are some subtleties in the usage of the combos lists by the game that I never completely confirmed and verified. For example: 0x42 and 0x43 commands also contain their own two behavior parameter bytes, and as far as I know these get overridden by the ones found in the 0xEC7E0 (and 0xED358) list, but only if the two param bytes of the 0x42 or 0x43 commands are equal to 0x00. But I may be wrong to some extent. For example they could be overridden separately when either one is 0x00. Again, things like this made TT64 a complex beast.
Oh and another thing I just remembered: the combo number used in the 0x42 and 0x43 commands is offset by 32. That means that the first item in the 0xEC7E0 list would be referred by using combo number 32 (or 31), and that using numbers below 32 have some other (yet unknown) usage.
____________________
|
  |
|
|