You are on page 1of 15

1

Super Mario 64
Decomp Mega Document
2

Table of Contents
File Structure...........................................................................................................................................3
Working with Github to save Progress....................................................................................................4
Actors Folder...............................................................................................................................................5
How Objects Work.......................................................................................................................................6
3

File Structure
├── actors: object behaviors, geo layout, and display lists
├── asm: handwritten assembly code, rom header
│ └── non_matchings: asm for non-matching sections
├── assets: animation and demo data
│ ├── anims: animation data
│ └── demos: demo data
├── bin: C files for ordering display lists and textures
├── build: output directory
├── data: behavior scripts, misc. data
├── doxygen: documentation infrastructure
├── enhancements: example source modifications
├── include: header files
├── levels: level scripts, geo layout, and display lists
├── lib: SDK library code
├── rsp: audio and Fast3D RSP assembly code
├── sound: sequences, sound samples, and sound banks
├── src: C source code for game
│ ├── audio: audio code
│ ├── buffers: stacks, heaps, and task buffers
│ ├── engine: script processing engines and utils
│ ├── game: behaviors and rest of game source
│ ├── goddard: Mario intro screen
│ └── menu: title screen and file, act, and debug level selection menus
├── text: dialog, level names, act names
├── textures: skybox and generic texture data
└── tools: build tools
4

Working with Github to save Progress


Use Github Desktop

Fork branches when creating new hacks

D:/Sm64 is where the folders are being saved

/mnt/d in ubuntu to get to d drive

Make after each change

Make -j4 for 4 core make (makes it go faster)


5

Actors Folder

This folder contains model data, animations, and object bank data.

Each actor has their own file at the top that contains model and animation data.

At the bottom, groups represent Content Banks as shown below.


6

How Objects Work


Data
The behavior_data.c file holds most of the bevavior script data for
objects.
File Structure
Top of Page -> Include statements (Import)
Next -> define BC
After -> Common Functions
Examples:
CALL_NATIVE
SET_MODEL
DROP_TO_FLOOR
DEACTIVATE (despawn object)
HIDE
SET_HOME
SET_INTERACT_TYPE
7

Finally -> Behavior Script Declarations

The CALL_NATIVE function calls functions in the game -> behaviors ->
<corresponding file>. The BEGIN_LOOP – END LOOP runs object.
8

Src -> Game


9

Goomba as an Example

(In Data-> behavior.data.c)

Goomba Behavior Script is declared in the behavior mega file. It then makes calls to the goomba’s file.

(In Game -> Behaviors -> goomba.inc.c)

The update plays the goomba’s ai.


10
11
12
13
14

Generic Behavior Functions


Held in

Src -> game -> Obj_behaviors.c

Obj_behaviors2.c

Object List Processor


Game -> object_list_processor.c

Runs game each frame

UpdateObjects()

Declares a lot of common variables like gCurrentObject.

Commonly denoted as o and means the current object being considered.

Game_init
Src -> game

Contains controller info plus input…

Adding Objects to a level


Levels -> <Level Name> -> script.c

Add object in OBJECT() function

#include behavior_data.h
15

#include actors/<Object Bank>

#include model_ids.h

Data -> behavior_data.c

Holds corresponding behavior data

Player Input

Thread5_game_loop in game_init.c

You might also like