Register - Login
Views: 99797132
Main - Memberlist - Active users - Calendar - Wiki - IRC Chat - Online users
Ranks - Rules/FAQ - Stats - Latest Posts - Color Chart - Smilies
05-03-22 05:49:54 AM
Jul - SM64 Hacking (Archive) - Main Level Scripts and Geo Layout Hacking (First screens + Level menu) New poll - New thread - New reply
Next newer thread | Next older thread
messiaen
Catgirl
Level: 68


Posts: 141/1085
EXP: 2596323
For next: 132477

Since: 11-20-07


Since last post: 8.1 years
Last activity: 7.2 years

Posted on 06-21-08 09:05:07 PM (last edited by messiaen at 06-21-08 06:09 PM) Link | Quote
Before you start reading this thread, I encourage you to take a quick look at SM64MainLevelScripts.txt, as this is the relevante file if you want to understand it. The main SM64 Hacking Doc included in TT64 is also a must, and the "level_commands.txt" file from Cellar Dweller's Hacking Notes contains some additional information.

Level scripts in SM64 are responsible for a lot of things, not just initializing the levels but also the menus and intro screen. The fact that almost all of the major commands are already documented makes SM64 a very interesting game to hack, because you don't need direct contact with the code itself to make some interesting things.

The first relevant Level Script is found at 269EA0-26A3A0 and loaded to RAM Segment 0x14. Let's take a look at the first code:

269EA4/0004: 16 10 00 00 80 16 F0 00 00 21 F4 C0 00 26 9E A0 --Loads ASM code into RAM at 8016F000
269EB4/0014: 17 0C 00 13 00 21 9E 00 00 21 F4 C0 --Loads Behavior Scripts into segment 0x13
269EC0/0020: 17 0C 00 07 00 AE D7 14 00 AF A0 54 --Loads MIO0 data in current level segment, 0x07 (18 0C 00 07 00 26 A3 A0 00 26 F4 20 in compressed ROM)
269ECC/002C: 1D 04 00 00
269ED0/0030: 1F 08 01 00 14 00 02 D0 --Points to Geometry Layout script for menus. (In levels, used to point to the main level Geometry Layout)
269ED8/0038: 20 04 00 00 --Usually means end of area in a normal level script.

This is the first intro screen code. The part that interest us are the Banks loaded with command 0x17 (Load uncompressed data). A ROM Bank is block of data loaded into a RAM segment identified by an ID number (the fourth byte of the 0x17 command). While the Bank ID is an arbitrary number, there is a consistent pattern used in the game. Bank 0x0E holds level scripts, Bank 0x09 Level textures, Bank 0x0A Background textures, Bank 0x07 Polygons/Animation/Collision, Banks 0x05, 0x06 and 0x08 usually contains the objects used in each level.

If you want to try a simple hack, go to the Bank 0x07 for this first menu and nope (replace with 0's) all the vertex data from AED714 to AF55A5. You have erased the "Super Mario 64" polygons from the intro screen.

The next command of interest is the Geometry Layout pointer:
1F 08 01 00 14 00 02 D0 = Offset 0x2D0 of Bank 0x14 = 0x2D0 + 269EA0 = 26A170 - This is the Geo Layout JUST for the first screen.

There are still some undocumented Geo Layout commands, but here are the main ones for this menu:

0800 0000 00A0 0078 00A0 0078 <-- Initializes the display Width/Height ?
1800 0000 8016 F670
1800 0000 8016 F984

The 0x18 command is used to load things directly from the RAM, not polygon data like the 0x15 one, but instead it points to ASM. Sometimes it is used to load water/lava polygons and if I'm not mistaken even regular ones in the Castle Grounds. The third and fourth byte sometimes provides arguments, which probably will be interpreted by the ASM loaded. Sometimes it seems to be the Drawing Layer, but other times it seems very different.

I can't do much for this screen so lets move on with the level script. Here are other Geo Layout pointers:

1F 08 01 00 14 00 03 5C -> Second Screen (press start) Geo Layout

In this second screen Geo Layout, there are two 0x18 commands

18 00 00 00 80 16 FE 70 - ??
18 00 00 02 80 27 64 B0 - Places Mario Face on screen

If you want to get rid of Mario's face, get rid of that second 0x18 command. Here is a way to nope 0x18 commands: if you just fill with 0's, the game will crash, so instead you just replace it with the first one. You can also try changing that 0x18 with the following:

1F 08 01 00 14 00 03 B8 -> Game Over Geo Layout

18 00 00 00 80 16 FF FC - Place Game Over GFX at BG

Another interesting thing in main level script is the list of 0x00 "Load script commands". This is very important if you want to extend the level script you are working with. Also, you may want to try changing it (or the conditionals above) so that the first level loaded is not the Castle Grounds but something else. It turns out that the first camera animation / letter is not loaded in the Castle Grounds level script, but somewhere else before the "New game" starts.

So, there are just some ideas. Maybe in the future we can change the very beginning of these level scrips to load something else .
Ratchetfan19
Member
Level: 18


Posts: 37/50
EXP: 25684
For next: 4213

Since: 11-20-07


Since last post: 9.0 years
Last activity: 8.7 years

Posted on 06-22-08 09:48:32 PM Link | Quote
Originally posted by messiaen
If you want to try a simple hack, go to the Bank 0x07 for this first menu and nope (replace with 0's) all the vertex data from AED714 to AF55A5. You have erased the "Super Mario 64" polygons from the intro screen.


Wow, you can do that? Is this the actual polygon data for the SM64 logo? If it is then maybe we can reverse-engineer it. VL-Tone seems to know a lot about the model format since he converted them for use in the Shockwave player on his website and in Toad's Tool 64. Is there an object that calls this model, or is it just ASM? Maybe looking into this data can allow us to understand more of the model format used in SM64.
messiaen
Catgirl
Level: 68


Posts: 142/1085
EXP: 2596323
For next: 132477

Since: 11-20-07


Since last post: 8.1 years
Last activity: 7.2 years

Posted on 06-22-08 10:11:17 PM (last edited by messiaen at 06-23-08 09:10 PM) Link | Quote
The basics of the model format understood and documented by VL-Tone, otherwise TT64 wouldn't exist. This isn't the polygon data but the vertex list. The polygon data is called by the "Geometry Layout", but in this case the command that loads doesn't point directly to the polygon data but to ASM which loads the polygon data.

However, finding the "entry-point" which loads the vertex data is not hard. I just looked for an 0xE7 command which initializes the RSP and I found it at AF8AB4.

The "Mario 64" is composed of 3 layers, each one called by a 0x06 Jump command.
Instead of erasing all the vertex data, you can also just nope each one of these jumps commands to get rid of the "Super Mario 64" text. Here is it without one of the layers:


This is, by the way, the procedure I used to make the "Flat" Lethal Lava Land (psss, has anybody tried it?)

Another combination of layers:


With some modifications you may even load another model instead of the "Super Mario 64" title screen. My first try:



The mushroom wouldn't fit on screen (too tall), so I changed a bit the Y values of its vertices, that why it is a bit messed up.

---
A video of the first screens without "Super Mario 64" and the "Mario Face". And a cool experimental level, of course .
Vinnyboiler
Catgirl
Level: 66


Posts: 36/1045
EXP: 2445449
For next: 16402

Since: 12-27-07

From: London, England

Since last post: 6 days
Last activity: 2 days

Posted on 07-07-08 08:40:21 PM Link | Quote
Is it possible to have the super mario 64 logo show up in peaches letter at the start of the game?
battleben

Level: 9


Posts: 4/11
EXP: 2594
For next: 568

Since: 06-27-08


Since last post: 12.5 years
Last activity: 12.1 years

Posted on 07-08-08 06:55:51 AM Link | Quote
yeh but that would need adding the super mario 64 logo model to castle grounds
but you can replace peachs head take a look at this

http://uk.youtube.com/watch?v=yuDIeLL_470

beggining of vid shows marios model(with my color code on) replaced peachs model
Next newer thread | Next older thread
Jul - SM64 Hacking (Archive) - Main Level Scripts and Geo Layout Hacking (First screens + Level menu) New poll - New thread - New reply


Rusted Logic

Acmlmboard - commit 47be4dc [2021-08-23]
©2000-2022 Acmlm, Xkeeper, Kaito Sinclaire, et al.

31 database queries, 1 query cache hits.
Query execution time: 0.078642 seconds
Script execution time: 0.010229 seconds
Total render time: 0.088871 seconds