Register - Login
Views: 99379692
Main - Memberlist - Active users - Calendar - Wiki - IRC Chat - Online users
Ranks - Rules/FAQ - Stats - Latest Posts - Color Chart - Smilies
04-23-22 11:01:25 PM
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: 2594038
For next: 134762

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: 25661
For next: 4236

Since: 11-20-07


Since last post: 9.0 years
Last activity: 8.6 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: 2594038
For next: 134762

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/1044
EXP: 2439776
For next: 22075

Since: 12-27-07

From: London, England

Since last post: 6 days
Last activity: 3 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: 2592
For next: 570

Since: 06-27-08


Since last post: 12.5 years
Last activity: 12.0 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.

32 database queries, 1 query cache hits.
Query execution time:  0.108030 seconds
Script execution time:  0.010056 seconds
Total render time:  0.118086 seconds


TidyHTML vomit below
line 1 column 1 - Warning: missing <!DOCTYPE> declaration
line 2 column 300 - Warning: unescaped & or unknown entity "&page"
line 119 column 11 - Warning: <form> isn't allowed in <table> elements
line 118 column 10 - Info: <table> previously mentioned
line 120 column 11 - Warning: missing <tr>
line 120 column 119 - Warning: missing </font> before </td>
line 124 column 16 - Warning: plain text isn't allowed in <tr> elements
line 120 column 11 - Info: <tr> previously mentioned
line 125 column 68 - Warning: missing </nobr> before </td>
line 141 column 68 - Warning: missing </nobr> before <tr>
line 147 column 35 - Warning: missing <tr>
line 147 column 50 - Warning: missing </font> before </td>
line 148 column 37 - Warning: unescaped & or unknown entity "&id"
line 147 column 241 - Warning: missing </font> before </table>
line 149 column 35 - Warning: missing <tr>
line 149 column 50 - Warning: missing </font> before </td>
line 149 column 91 - Warning: missing </font> before </table>
line 156 column 9 - Warning: <div> isn't allowed in <table> elements
line 152 column 17 - Info: <table> previously mentioned
line 158 column 9 - Warning: missing <tr>
line 176 column 13 - Warning: missing <tr>
line 177 column 99 - Warning: unescaped & or unknown entity "&postid"
line 187 column 1381 - Warning: discarding unexpected </b>
line 227 column 9 - Warning: <div> isn't allowed in <table> elements
line 152 column 17 - Info: <table> previously mentioned
line 229 column 9 - Warning: missing <tr>
line 247 column 13 - Warning: missing <tr>
line 248 column 99 - Warning: unescaped & or unknown entity "&postid"
line 255 column 9 - Warning: <div> isn't allowed in <table> elements
line 152 column 17 - Info: <table> previously mentioned
line 257 column 9 - Warning: missing <tr>
line 275 column 13 - Warning: missing <tr>
line 276 column 99 - Warning: unescaped & or unknown entity "&postid"
line 301 column 9 - Warning: <div> isn't allowed in <table> elements
line 152 column 17 - Info: <table> previously mentioned
line 303 column 9 - Warning: missing <tr>
line 321 column 13 - Warning: missing <tr>
line 322 column 99 - Warning: unescaped & or unknown entity "&postid"
line 327 column 9 - Warning: <div> isn't allowed in <table> elements
line 152 column 17 - Info: <table> previously mentioned
line 329 column 9 - Warning: missing <tr>
line 347 column 13 - Warning: missing <tr>
line 348 column 99 - Warning: unescaped & or unknown entity "&postid"
line 359 column 17 - Warning: missing <tr>
line 359 column 17 - Warning: discarding unexpected <table>
line 362 column 35 - Warning: missing <tr>
line 362 column 50 - Warning: missing </font> before </td>
line 362 column 91 - Warning: missing </font> before </table>
line 364 column 35 - Warning: missing <tr>
line 364 column 50 - Warning: missing </font> before </td>
line 365 column 37 - Warning: unescaped & or unknown entity "&id"
line 364 column 241 - Warning: missing </font> before </table>
line 366 column 17 - Warning: discarding unexpected </textarea>
line 366 column 28 - Warning: discarding unexpected </form>
line 366 column 35 - Warning: discarding unexpected </embed>
line 366 column 43 - Warning: discarding unexpected </noembed>
line 366 column 53 - Warning: discarding unexpected </noscript>
line 366 column 64 - Warning: discarding unexpected </noembed>
line 366 column 74 - Warning: discarding unexpected </embed>
line 366 column 82 - Warning: discarding unexpected </table>
line 366 column 90 - Warning: discarding unexpected </table>
line 368 column 9 - Warning: missing </font> before <table>
line 380 column 25 - Warning: discarding unexpected </font>
line 389 column 57 - Warning: discarding unexpected </font>
line 367 column 1 - Warning: missing </center>
line 120 column 63 - Warning: <img> lacks "alt" attribute
line 125 column 19 - Warning: <td> attribute "width" has invalid value "120px"
line 125 column 93 - Warning: <img> lacks "alt" attribute
line 141 column 19 - Warning: <td> attribute "width" has invalid value "120px"
line 141 column 98 - Warning: <img> lacks "alt" attribute
line 148 column 44 - Warning: <img> proprietary attribute value "absmiddle"
line 148 column 142 - Warning: <img> proprietary attribute value "absmiddle"
line 148 column 245 - Warning: <img> proprietary attribute value "absmiddle"
line 161 column 22 - Warning: <img> lacks "alt" attribute
line 161 column 63 - Warning: <img> lacks "alt" attribute
line 161 column 111 - Warning: <img> lacks "alt" attribute
line 161 column 161 - Warning: <img> lacks "alt" attribute
line 172 column 15 - Warning: <img> lacks "alt" attribute
line 224 column 4771 - Warning: <img> proprietary attribute value "absmiddle"
line 224 column 4771 - Warning: <img> lacks "alt" attribute
line 232 column 22 - Warning: <img> lacks "alt" attribute
line 232 column 63 - Warning: <img> lacks "alt" attribute
line 232 column 112 - Warning: <img> lacks "alt" attribute
line 232 column 162 - Warning: <img> lacks "alt" attribute
line 233 column 11 - Warning: <img> lacks "alt" attribute
line 243 column 15 - Warning: <img> lacks "alt" attribute
line 260 column 22 - Warning: <img> lacks "alt" attribute
line 260 column 63 - Warning: <img> lacks "alt" attribute
line 260 column 111 - Warning: <img> lacks "alt" attribute
line 260 column 161 - Warning: <img> lacks "alt" attribute
line 271 column 15 - Warning: <img> lacks "alt" attribute
line 284 column 846 - Warning: <img> lacks "alt" attribute
line 289 column 1082 - Warning: <img> lacks "alt" attribute
line 293 column 1289 - Warning: <img> lacks "alt" attribute
line 298 column 1691 - Warning: <img> proprietary attribute value "absmiddle"
line 298 column 1691 - Warning: <img> lacks "alt" attribute
line 306 column 22 - Warning: <img> lacks "alt" attribute
line 306 column 63 - Warning: <img> lacks "alt" attribute
line 306 column 112 - Warning: <img> lacks "alt" attribute
line 306 column 162 - Warning: <img> lacks "alt" attribute
line 307 column 11 - Warning: <img> lacks "alt" attribute
line 317 column 15 - Warning: <img> lacks "alt" attribute
line 331 column 11 - Warning: <img> lacks "alt" attribute
line 332 column 21 - Warning: <img> lacks "alt" attribute
line 332 column 62 - Warning: <img> lacks "alt" attribute
line 332 column 111 - Warning: <img> lacks "alt" attribute
line 332 column 161 - Warning: <img> lacks "alt" attribute
line 343 column 15 - Warning: <img> lacks "alt" attribute
line 365 column 44 - Warning: <img> proprietary attribute value "absmiddle"
line 365 column 142 - Warning: <img> proprietary attribute value "absmiddle"
line 365 column 245 - Warning: <img> proprietary attribute value "absmiddle"
line 374 column 25 - Warning: <img> lacks "alt" attribute
line 379 column 267 - Warning: <img> lacks "alt" attribute
line 149 column 50 - Warning: trimming empty <font>
line 359 column 17 - Warning: trimming empty <tr>
line 362 column 50 - Warning: trimming empty <font>
line 125 column 68 - Warning: <nobr> is not approved by W3C
line 141 column 68 - Warning: <nobr> is not approved by W3C
line 177 column 27 - Warning: <nobr> is not approved by W3C
line 248 column 27 - Warning: <nobr> is not approved by W3C
line 276 column 27 - Warning: <nobr> is not approved by W3C
line 322 column 27 - Warning: <nobr> is not approved by W3C
line 348 column 27 - Warning: <nobr> is not approved by W3C
Info: Document content looks like HTML5
Info: No system identifier in emitted doctype
Tidy found 116 warnings and 0 errors!


The alt attribute should be used to give a short description
of an image; longer descriptions should be given with the
longdesc attribute which takes a URL linked to the description.
These measures are needed for people using non-graphical browsers.

For further advice on how to make your pages accessible
see http://www.w3.org/WAI/GL.
You are recommended to use CSS to specify the font and
properties such as its size and color. This will reduce
the size of HTML files and make them easier to maintain
compared with using <FONT> elements.

You are recommended to use CSS to control line wrapping.
Use "white-space: nowrap" to inhibit wrapping in place
of inserting <NOBR>...</NOBR> into the markup.

About HTML Tidy: https://github.com/htacg/tidy-html5
Bug reports and comments: https://github.com/htacg/tidy-html5/issues
Official mailing list: https://lists.w3.org/Archives/Public/public-htacg/
Latest HTML specification: http://dev.w3.org/html5/spec-author-view/
Validate your HTML documents: http://validator.w3.org/nu/
Lobby your company to join the W3C: http://www.w3.org/Consortium

Do you speak a language other than English, or a different variant of
English? Consider helping us to localize HTML Tidy. For details please see
https://github.com/htacg/tidy-html5/blob/master/README/LOCALIZE.md