![]() |
Super Mario 64 Source
A Super Mario 64 decompilation, brought to you by a bunch of clever folks.
|
#include <ultra64.h>
#include "sm64.h"
#include "seq_ids.h"
#include "audio/external.h"
#include "level_update.h"
#include "game.h"
#include "main.h"
#include "engine/math_util.h"
#include "engine/graph_node.h"
#include "area.h"
#include "save_file.h"
#include "sound_init.h"
#include "mario.h"
#include "camera.h"
#include "object_list_processor.h"
#include "ingame_menu.h"
#include "obj_behaviors.h"
#include "display.h"
#include "debug_course.h"
Macros | |
#define | PLAY_MODE_NORMAL 0 |
#define | PLAY_MODE_PAUSED 2 |
#define | PLAY_MODE_CHANGE_AREA 3 |
#define | PLAY_MODE_CHANGE_LEVEL 4 |
#define | PLAY_MODE_FRAME_ADVANCE 5 |
#define | WARP_TYPE_NOT_WARPING 0 |
#define | WARP_TYPE_CHANGE_LEVEL 1 |
#define | WARP_TYPE_CHANGE_AREA 2 |
#define | WARP_TYPE_SAME_AREA 3 |
#define | WARP_NODE_F0 0xF0 |
#define | WARP_NODE_DEATH 0xF1 |
#define | WARP_NODE_F2 0xF2 |
#define | WARP_NODE_WARP_FLOOR 0xF3 |
#define | WARP_NODE_CREDITS_START 0xF8 |
#define | WARP_NODE_CREDITS_NEXT 0xF9 |
#define | WARP_NODE_CREDITS_END 0xFA |
#define | WARP_NODE_CREDITS_MIN 0xF8 |
#define | PAINTING_WARP_INDEX_START 0x00 |
#define | PAINTING_WARP_INDEX_FA 0x2A |
#define | PAINTING_WARP_INDEX_END 0x2D |
Functions | |
void | basic_update (s16 *arg) |
u16 | level_control_timer (s32 timerOp) |
u32 | pressed_paused (void) |
void | set_play_mode (s16 playMode) |
void | func_8024975C (s32 arg) |
void | func_80249788 (u32 arg, u32 color) |
void | nop_802497FC (void) |
void | func_8024980C (u32 arg) |
void | func_8024992C (struct SpawnInfo *spawnInfo, u32 arg1) |
void | set_mario_initial_cap_powerup (struct MarioState *m) |
void | set_mario_initial_action (struct MarioState *m, u32 spawnType, u32 actionArg) |
void | init_mario_after_warp (void) |
void | func_8024A02C (void) |
void | func_8024A094 (void) |
void | func_8024A0E0 (void) |
void | check_instant_warp (void) |
s16 | func_8024A48C (s16 arg) |
void | initiate_warp (s16 destLevel, s16 destArea, s16 destWarpNode, s32 arg3) |
Set the current warp type and destination level/area/node. More... | |
struct WarpNode * | get_painting_warp_node (void) |
Check if mario is above and close to a painting warp floor, and return the corresponding warp node. More... | |
void | initiate_painting_warp (void) |
Check is mario has entered a painting, and if so, initiate a warp. More... | |
s16 | level_trigger_warp (struct MarioState *m, s32 warpOp) |
If there is not already a delayed warp, schedule one. More... | |
void | initiate_delayed_warp (void) |
If a delayed warp is ready, initiate it. More... | |
void | update_hud_values (void) |
void | basic_update (UNUSED s16 *arg) |
Update objects, hud, and camera. More... | |
s32 | play_mode_normal (void) |
s32 | play_mode_paused (void) |
s32 | play_mode_frame_advance (void) |
Debug mode that lets you frame advance by pressing D-pad down. More... | |
void | level_set_transition (s16 length, void(*updateFunction)(s16 *)) |
Set the transition, which is a period of time after the warp is initiated but before it actually occurs. More... | |
s32 | play_mode_change_area (void) |
Play the transition and then return to normal play mode. More... | |
s32 | play_mode_change_level (void) |
Play the transition and then return to normal play mode. More... | |
static s32 | play_mode_unused (void) |
Unused play mode. More... | |
s32 | update_level (void) |
s32 | init_level (void) |
s32 | lvl_init_or_update (s16 initOrUpdate, UNUSED s32 arg1) |
Initialize the current level if initOrUpdate is 0, or update the level if it is 1. More... | |
s32 | lvl_init_from_save_file (UNUSED s16 arg0, s32 levelNum) |
s32 | lvl_set_current_level (UNUSED s16 arg0, s32 levelNum) |
s32 | lvl_play_the_end_screen_sound (UNUSED s16 arg0, UNUSED s32 arg1) |
Play the "thank you so much for to playing my game" sound. More... | |
Variables | |
const char * | credits01 [] = { "1GAME DIRECTOR", "SHIGERU MIYAMOTO" } |
const char * | credits02 [] = { "2ASSISTANT DIRECTORS", "YOSHIAKI KOIZUMI", "TAKASHI TEZUKA" } |
const char * | credits03 [] = { "2SYSTEM PROGRAMMERS", "YASUNARI NISHIDA", "YOSHINORI TANIMOTO" } |
const char * | credits04 [] = { "3PROGRAMMERS", "HAJIME YAJIMA", "DAIKI IWAMOTO", "TOSHIO IWAWAKI" } |
const char * | credits05 [] |
const char * | credits06 [] = { "2COURSE DIRECTORS", "YOICHI YAMADA", "YASUHISA YAMAMURA" } |
const char * | credits07 [] = { "2COURSE DESIGNERS", "KENTA USUI", "NAOKI MORI" } |
const char * | credits08 [] |
const char * | credits09 [] = { "1SOUND COMPOSER", "KOJI KONDO" } |
const char * | credits10 [] |
const char * | credits11 [] = { "23-D ANIMATORS", "YOSHIAKI KOIZUMI", "SATORU TAKIZAWA" } |
const char * | credits12 [] = { "1ADDITIONAL GRAPHICS", "MASANAO ARIMOTO" } |
const char * | credits13 [] = { "3TECHNICAL SUPPORT", "TAKAO SAWANO", "HIROHITO YOSHIMOTO", "HIROTO YADA" } |
const char * | credits14 [] = { "1TECHNICAL SUPPORT", "SGI N64 PROJECT STAFF" } |
const char * | credits15 [] = { "2PROGRESS MANAGEMENT", "KIMIYOSHI FUKUI", "KEIZO KATO" } |
const char * | credits16 [] |
const char * | credits17 [] = { "4MARIO VOICE", "PEACH VOICE", "CHARLES MARTINET", "LESLIE SWAN" } |
const char * | credits18 [] |
const char * | credits19 [] = { "1PRODUCER", "SHIGERU MIYAMOTO" } |
const char * | credits20 [] = { "1EXECUTIVE PRODUCER", "HIROSHI YAMAUCHI" } |
struct CreditsEntry | sCreditsSequence [] |
struct MarioState | gMarioStates [1] |
struct MarioState * | gMarioState = &gMarioStates[0] |
u8 | unused1 [4] = { 0 } |
s8 | D_8032C9E0 = 0 |
s16 | sCurrPlayMode |
u16 | D_80339ECA |
s16 | sTransitionTimer |
void(* | sTransitionUpdate )(s16 *) |
u8 | unused3 [4] |
struct WarpDest | sWarpDest |
s16 | D_80339EE0 |
s16 | sDelayedWarpOp |
s16 | sDelayedWarpTimer |
s16 | sSourceWarpNodeId |
s32 | sDelayedWarpArg |
u8 | unused4 [2] |
s8 | sTimerRunning |
struct HudDisplay | gHudDisplay |
s8 | gShouldNotPlayCastleMusic |
#define PAINTING_WARP_INDEX_END 0x2D |
#define PAINTING_WARP_INDEX_FA 0x2A |
#define PAINTING_WARP_INDEX_START 0x00 |
#define PLAY_MODE_CHANGE_AREA 3 |
#define PLAY_MODE_CHANGE_LEVEL 4 |
#define PLAY_MODE_FRAME_ADVANCE 5 |
#define PLAY_MODE_NORMAL 0 |
#define PLAY_MODE_PAUSED 2 |
#define WARP_NODE_CREDITS_END 0xFA |
#define WARP_NODE_CREDITS_MIN 0xF8 |
#define WARP_NODE_CREDITS_NEXT 0xF9 |
#define WARP_NODE_CREDITS_START 0xF8 |
#define WARP_NODE_DEATH 0xF1 |
#define WARP_NODE_F0 0xF0 |
#define WARP_NODE_F2 0xF2 |
#define WARP_NODE_WARP_FLOOR 0xF3 |
#define WARP_TYPE_CHANGE_AREA 2 |
#define WARP_TYPE_CHANGE_LEVEL 1 |
#define WARP_TYPE_NOT_WARPING 0 |
#define WARP_TYPE_SAME_AREA 3 |
Update objects, hud, and camera.
This update function excludes things like endless staircase, warps, pausing, etc. This is used when entering a painting, presumably to allow painting and camera updating while avoiding triggering the warp twice.
Check if mario is above and close to a painting warp floor, and return the corresponding warp node.
Check is mario has entered a painting, and if so, initiate a warp.
Set the current warp type and destination level/area/node.
Set the transition, which is a period of time after the warp is initiated but before it actually occurs.
If updateFunction is not NULL, it will be called each frame during the transition.
s16 level_trigger_warp | ( | struct MarioState * | m, |
s32 | warpOp | ||
) |
If there is not already a delayed warp, schedule one.
The source node is based on the warp operation and sometimes mario's used object. Return the time left until the delayed warp is initiated.
Initialize the current level if initOrUpdate is 0, or update the level if it is 1.
Play the "thank you so much for to playing my game" sound.
Play the transition and then return to normal play mode.
This maybe was supposed to be sTransitionTimer == -1? sTransitionUpdate
If sTransitionTimer is -1, this will miss.
Play the transition and then return to normal play mode.
If sTransitionTimer is -1, this will miss.
Debug mode that lets you frame advance by pressing D-pad down.
Unfortunately it uses the pause camera, making it basically unusable in most levels.
Unused play mode.
Doesn't call transition update and doesn't reset transition at the end.
void set_mario_initial_action | ( | struct MarioState * | m, |
u32 | spawnType, | ||
u32 | actionArg | ||
) |
void set_mario_initial_cap_powerup | ( | struct MarioState * | m | ) |
const char* credits13[] = { "3TECHNICAL SUPPORT", "TAKAO SAWANO", "HIROHITO YOSHIMOTO", "HIROTO YADA" } |
s8 D_8032C9E0 = 0 |
u16 D_80339ECA |
s16 D_80339EE0 |
struct HudDisplay gHudDisplay |
struct MarioState* gMarioState = &gMarioStates[0] |
struct MarioState gMarioStates[1] |
s8 gShouldNotPlayCastleMusic |
struct CreditsEntry sCreditsSequence[] |
s16 sCurrPlayMode |
s32 sDelayedWarpArg |
s16 sDelayedWarpOp |
s16 sDelayedWarpTimer |
s16 sSourceWarpNodeId |
s8 sTimerRunning |
s16 sTransitionTimer |
u8 unused1[4] = { 0 } |
u8 unused3[4] |
u8 unused4[2] |