RotM August 2019 - Gex 3: Deep Cover Gecko
#1


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



What is RotM?

ROM of the Month (RotM) is a 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 August 2019, the bot has chosen the game "Gex 3: Deep Cover Gecko". 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=gex_...over_gecko

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/K5iybLAQQJiM-LkCmVC6vg?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

Gex 3 uses raw deflate for compressing files. 

If you are using python, then you can use the standard zlib library to uncompress the data.

Code:
import zlib

def decompress_raw_deflate(compressed_bytes):
   return zlib.decompress(compressed_bytes, wbits=-15)

def compress_raw_deflate(bytes):
   return zlib.compress(bytes, level=9)[2:] # Remove zlib header.

2.) Font Sheet

The main font used by the game uses a 128x64 I4 texture.

[Image: NMPBPlH.png]

3.) Objects

There are 963 objects in the game. They are defined in the ROM range 0x818C0 to 0x854F0, where each one is associated with an 8 character string ID.

// 0x10 bytes in size
struct ObjectInfo {
   /* 0x00 */ char[8] name_id;
   /* 0x08 */ u32 rom_offset_to_compressed_data_start;
   /* 0x0C */ u32 rom_offset_to_compressed_data_end;
}


4.) Levels

There are 30 levels in the game.

Level Names

At ROM offset 0x8013C and RAM address 0x8007F53C is an array of level information structures. Offsets 0x1C & 0x20 define the ROM region

// 0x54 bytes in size
struct LevelInfo {
   /* 0x00 */ char* internal_name;
   /* 0x04 */ s16 level_title_text_id;
   /* 0x06 */ s16 channel_title_1_text_id;
   /* 0x08 */ s16 channel_title_2_text_id;
   /* 0x0C */ s16 tv_channel_img_id; // Used in hub areas. 0x06 = Snow, 0x05 = Mystery, etc.
   /* 0x0E */ s16 mission_1_text_id;
   /* 0x10 */ s16 mission_2_text_id;
   /* 0x12 */ s16 mission_3_text_id;
   /* 0x14 */ s32 unk_14;
   /* 0x18 */ s32 unk_18;
   /* 0x1C */ u32 rom_offset_to_compressed_level_data_start;
   /* 0x20 */ u32 rom_offset_to_compressed_level_data_end;
   /* 0x24 */ u32 unk24_rom_offset_to_asm;
   /* 0x28 */ u32 unk28_rom_offset_to_asm;
   /* 0x2C */ s32* unk2C_ptr;
   /* 0x30 */ s32* unk30_ptr;
   /* 0x34 */ s32 unk_34;
   /* 0x38 */ u32 unk38_rom_offset;
   /* 0x3C */ u32 rom_offset_to_channel_ci4_texture;
   /* 0x40 */ u32 rom_offset_to_N64WaveTables;
   /* 0x44 */ u32 rom_offset_to_N64PtrTablesV2;
   /* 0x48 */ u32 unk48_rom_offset;
   /* 0x4C */ u32 unk4C_rom_offset_to_compressed_data;
   /* 0x50 */ u32 unk50_rom_offset_to_compressed_data;
}


I made a simple javascript level geometry viewer that will let you view the level geometry data. You can also download the levels as 3D models as either glTF or extended OBJ.

You can download it from the github here: https://github.com/hack64-net/rotm/tree/...gex3viewer

[Image: PrvSpCb.png]
hessamghani liked this post
Reply
#3
Big Grin 
(08-31-2019, 06:50 PM)David Wrote: Summary

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



1.) Compression Format

Gex 3 uses raw deflate for compressing files. 

If you are using python, then you can use the standard zlib library to uncompress the data.

Code:
import zlib

def decompress_raw_deflate(compressed_bytes):
   return zlib.decompress(compressed_bytes, wbits=-15)

def compress_raw_deflate(bytes):
   return zlib.compress(bytes, level=9)[2:] # Remove zlib header.

2.) Font Sheet

The main font used by the game uses a 128x64 I4 texture.

[Image: NMPBPlH.png]

3.) Objects

There are 963 objects in the game. They are defined in the ROM range 0x818C0 to 0x854F0, where each one is associated with an 8 character string ID.

// 0x10 bytes in size
struct ObjectInfo {
   /* 0x00 */ char[8] name_id;
   /* 0x08 */ u32 rom_offset_to_compressed_data_start;
   /* 0x0C */ u32 rom_offset_to_compressed_data_end;
}


4.) Levels

There are 30 levels in the game.

Level Names

At ROM offset 0x8013C and RAM address 0x8007F53C is an array of level information structures. Offsets 0x1C & 0x20 define the ROM region

// 0x54 bytes in size
struct LevelInfo {
   /* 0x00 */ char* internal_name;
   /* 0x04 */ s16 level_title_text_id;
   /* 0x06 */ s16 channel_title_1_text_id;
   /* 0x08 */ s16 channel_title_2_text_id;
   /* 0x0C */ s16 tv_channel_img_id; // Used in hub areas. 0x06 = Snow, 0x05 = Mystery, etc.
   /* 0x0E */ s16 mission_1_text_id;
   /* 0x10 */ s16 mission_2_text_id;
   /* 0x12 */ s16 mission_3_text_id;
   /* 0x14 */ s32 unk_14;
   /* 0x18 */ s32 unk_18;
   /* 0x1C */ u32 rom_offset_to_compressed_level_data_start;
   /* 0x20 */ u32 rom_offset_to_compressed_level_data_end;
   /* 0x24 */ u32 unk24_rom_offset_to_asm;
   /* 0x28 */ u32 unk28_rom_offset_to_asm;
   /* 0x2C */ s32* unk2C_ptr;
   /* 0x30 */ s32* unk30_ptr;
   /* 0x34 */ s32 unk_34;
   /* 0x38 */ u32 unk38_rom_offset;
   /* 0x3C */ u32 rom_offset_to_channel_ci4_texture;
   /* 0x40 */ u32 rom_offset_to_N64WaveTables;
   /* 0x44 */ u32 rom_offset_to_N64PtrTablesV2;
   /* 0x48 */ u32 unk48_rom_offset;
   /* 0x4C */ u32 unk4C_rom_offset_to_compressed_data;
   /* 0x50 */ u32 unk50_rom_offset_to_compressed_data;
}


I made a simple javascript level geometry viewer that will let you view the level geometry data. You can also download the levels as 3D models as either glTF or extended OBJ.

You can download it from the github here: https://github.com/hack64-net/rotm/tree/...gex3viewer

[Image: PrvSpCb.png]

wooow so amazing im use this an tank you so much for this  . [Image: biggrin.png]

but you work on for rip 3d objects in game jut like coins remote bugs or characters (boss gex ...). i hope more update for this (gex3viewer).
Reply




Users browsing this thread: 1 Guest(s)