RotM June 2019 - Mission: Impossible
#1


This thread is dedicated to notes, files, and tools created for June 2019's RotM.



What is RotM?

ROM of the Month (RotM) is a new month-long event in the Hack64 discord server. Where a bot will randomly pick a Nintendo 64 game that has little to no hacking notes or tools, and then we will spend a month trying to figure out how it works. For June 2019, the bot has chosen the game "Mission: Impossible". We are specifically hacking the North American version of the game.

More details can be found on the main wiki article: https://hack64.net/wiki/doku.php?id=rom_of_the_month

The wiki article for the game itself can be found here: https://hack64.net/wiki/doku.php?id=mission_impossible

The discussion on the current game is done on the Hack64 discord server under the #rotm channel. 



Online Files 

For easy collaboration, we are using HackMD to update files online in real time.

n64split config / RAM map: https://hackmd.io/-WVc2PjoSkS06XMpV55bsw?edit



Feel free to post your own notes on the game in a reply to this thread.


Reply
#2
Summary

This post will be a simple summary of what was found in the discord server over this month.



1.) Compression Format

Shygoo and Mittenz discovered that the compression used by Mission: Impossible is simply just plain deflate, not zlib.

You can find a tool to extract all the data from the mission impossible rom here: 
https://github.com/hack64-net/rotm/tree/.../miextract

2.) SOOL Engine

Found by shygoo, the Scenaric Object Oriented Language (SOOL) engine is used in the game for scripting objects in the levels. Apparently the first level alone uses 40k+ commands.

You can find a list of commands here:
https://hack64.net/wiki/doku.php?id=miss...ool_engine

A disassembler/Decompiler for the SOOL engine made by shygoo can be found here: 
https://github.com/hack64-net/rotm/tree/...ible/soold

3.) Model Format

From what I have found in the compressed files, the game has 3 different types of models. I classify them as: Static Object Models, Animated Object Models, and Level Models. Each type has it's own header. For static and animated object models the entire file is segment 1, while for level models the entire file is segment 4.

Static Object Model header
  offset 0x0 = Segment address to F3DEX display list
  offset 0x4 = Segment address to vertices
  offset 0x8 = Number of textures (Only if using segment 7 for textures)
  offset 0xC = Segment address to an array of segment addresses which point to seg 7 textures.

Animated Object Model header
  offset 0x0 = Segment address to vertices
  offset 0x4 = Segment address to F3DEX display list
  offset 0x8 = Segment address to joints or some kind of animation data?

Level Model header
  offset 0x0 = Segment address to tree structure, which contain tree nodes which contain the addresses to the display lists.
  offset 0x4 = Segment address to ?
  offset 0x8 = ?

The tree structure for level models usually requires that you go a couple layers down before finding the display list segment address. 
It looks like this:
/* Inside 00B3A0A0.bin */
04000390 /* Offset 0x0 */
⤷ 04000384 /* Child */ 04000378 /* Next */ 00020001 /* ??? */
  ⤷ 040001F0 00000000 00030000
    ⤷ 040001DC 00000000 00030000
      ⤷ D0080000 D3C54672 00010C4E 040001A4
                                                                   ⤷ 04007C10 /* Display List */ 00000000 /* ??? */ 00030000 /* ??? */
  040002C8 0400036C 0001E9A7
  ⤷ 0400029C 040002BC 0001E991
    ⤷ 04000210 04000290 0001DE6C
      ⤷ 040001FC 00000000 00030000
        ⤷ D5FE0001 D66F3A29 0831DC64 040001B0
                                                                     ⤷ 04008580 /* DL */ 00000000 00030000
      04000238 04000284 0001DE6D
      ⤷ 0400021C 00000000 00030000
        ⤷ 0C45080E DE6C0FFD 0B64DE6D 04000048
                                                                     ⤷ 040042D0 /* DL */ 00000000 00030000
      ...

3.5.) Model Viewer

To help with decoding the model formats, I created a model viewer program in python. It can also be used to export the models into the extended .obj format. You will have to use a program like MeshLab to view the vertex colors. Note: This viewer can only view static object models & level models, as I haven't figured out how to properly display the animated object models.

You can find the tool here: https://github.com/hack64-net/rotm/tree/...e/miviewer

You will need to have python 3 installed on your computer, along with pyqt 4 and pypng 0.0.19.

The 5 sliders control the viewer itself. The first slider is to control the rotation along the Y-axis. The second slider controls zooming in and out of the model. The last 3 sliders move the model along the 3 axis's.

[Image: J4TpinM.png]

[Image: YHNGGr6.png]

4.) Text Rendering

[Image: PGwPJoi.png]

The game uses a single 800x8 IA4 texture for the font. 

Text Rendering Functions:

0x8006C9A0 = set_text_rgb(u8 red, u8 green, u8 blue);
0x8006C9BC = set_text_alpha(u8 alpha);
0x8006C9C8 = set_text_bg_rgba(u8 red, u8 green, u8 blue, u8 alpha); // Sets background color
0x8006C9EC = set_text_bg_margins(s16 left, s16 right, s16 top, s16 bottom);
0x8006DB84 = print_text(Gfx** gfx, int x, int y, char* text, bool renderBackground);

More functions can be found in the n64split config file: https://pastebin.com/raw/WMG7e7i2

[Image: uzV9yPc.png]

5.) Miscellaneous

Graphics microcode used: F3DEX.NoN v1.21
shygoo liked this post
Reply




Users browsing this thread: 1 Guest(s)