Documentation Index
Fetch the complete documentation index at: https://mintlify.com/pmret/papermario/llms.txt
Use this file to discover all available pages before exploring further.
include/common_structs.h is the single most-included header in the project. It defines the vector and color types used everywhere from collision math to rendering, along with foundational runtime structs such as SaveData, HeapNode, and CameraRig. All struct sizes given here are verified from the inline comments in the source.
Vector types
The codebase provides a complete family of two- and three-component vectors in several element widths. Use the smallest type that covers your range to match original memory layout.8-bit integer vectors
| Struct | Fields | Size | Notes |
|---|---|---|---|
Vec2b | s8 x, y | 0x02 | Signed byte XY |
Vec2bu | u8 x, y | 0x02 | Unsigned byte XY |
Vec3b | s8 x, y, z | 0x03 | Signed byte XYZ |
16-bit integer vectors
| Struct | Fields | Size | Notes |
|---|---|---|---|
Vec2s | s16 x, y | 0x04 | Signed halfword XY |
Vec2su | u16 x, y | 0x04 | Unsigned halfword XY |
Vec3s | s16 x, y, z | 0x06 | Signed halfword XYZ |
32-bit integer vectors
| Struct | Fields | Size | Notes |
|---|---|---|---|
Vec2i | s32 x, y | 0x08 | Signed word XY |
VecXZi | s32 x, z | 0x08 | Signed word XZ (no Y component) |
Vec3i | s32 x, y, z | 0x0C | Signed word XYZ |
VecXZi is used in contexts where the horizontal plane is relevant but vertical position is not.
Float vectors
| Struct | Fields | Size | Notes |
|---|---|---|---|
Vec2f | f32 x, y | 0x08 | Single-precision XY |
VecXZf | f32 x, z | 0x08 | Single-precision XZ |
Vec3f | f32 x, y, z | 0x0C | Single-precision XYZ |
Vec4f | f32 x, y, z, yaw | 0x10 | Three-component position plus yaw angle |
Color types
| Struct | Fields | Size | Notes |
|---|---|---|---|
Color_RGBA8 | u8 r, g, b, a | 0x04 | 32-bit RGBA, 8 bits per channel |
Color_RGB8 | u8 r, g, b | 0x03 | 24-bit RGB, no alpha |
Color4f | f32 r, g, b, a | 0x10 | Float RGBA, used in lighting and blend state |
Color3i | s32 r, g, b | 0x0C | Integer RGB, used in colour arithmetic |
Color4i | s32 r, g, b, a | 0x10 | Integer RGBA, used in colour arithmetic |
Matrix types
| Type | Definition | Size | Notes |
|---|---|---|---|
Matrix4f | typedef f32 Matrix4f[4][4] | 0x40 | Row-major 4×4 float matrix |
Matrix4s | struct with whole[4][4] and frac[4][4] of s16 | 0x40 | Fixed-point N64 RSP matrix format |
Matrix4s stores the integer and fractional parts of a fixed-point 4×4 matrix separately, matching the format consumed by the RSP microcode.
Other core structs
CameraRig
CameraRig
Describes the boom-arm camera parameterisation used by the in-game camera system.
HeapNode
HeapNode
A node in the game’s custom heap allocator free list.
DmaTable
DmaTable
Describes a DMA transfer: source start, source end, and destination address.
PartnerData
PartnerData
Per-partner save record stored in
PlayerData.NpcMotionBlur
NpcMotionBlur
Ring buffer storing an NPC’s world-space position over the last 20 frames, used to render motion-blur trails.
SaveData
SaveData
The full on-cartridge save record for one save slot. Total size is
0x1380 bytes.SaveGlobals and SaveMetadata
SaveGlobals and SaveMetadata
SaveGlobals holds settings shared across all save slots (sound mode, last file selected, language). SaveMetadata holds the per-slot summary shown on the file-select screen.Using struct sizes
Comments in the source follow the format// size = 0xNN. When you add a new field or modify an existing struct, verify that the total matches. The build will not catch size mismatches automatically — you need to cross-reference against the original binary layout documented in the decomp.