RotM June 2019 - Mission: Impossible
#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


Messages In This Thread
RotM June 2019 - Mission: Impossible - by David - 06-04-2019, 03:26 AM
RE: RotM June 2019 - Mission: Impossible - by David - 06-30-2019, 08:08 PM



Users browsing this thread: 1 Guest(s)