![]() |
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 "memory.h"#include "load.h"#include "data.h"#include "seqplayer.h"#include "external.h"#include "playback.h"#include "synthesis.h"#include "game/mario.h"#include "game/level_update.h"#include "game/area.h"#include "game/room.h"#include "game/camera.h"#include "seq_ids.h"Data Structures | |
| struct | Sound |
| struct | ChannelVolumeScaleFade |
| struct | SoundCharacteristics |
| struct | SequenceQueueItem |
| struct | MusicDynamic |
Macros | |
| #define | MAX_BG_MUSIC_QUEUE_SIZE 6 |
| #define | SOUND_BANK_COUNT 10 |
| #define | SEQUENCE_NONE 0xFF |
| #define | stubbed_printf |
| #define | UKIKI 0 |
| #define | TUXIE 1 |
| #define | BOWS1 2 |
| #define | KOOPA 3 |
| #define | KBOMB 4 |
| #define | BOO 5 |
| #define | BOMB 6 |
| #define | BOWS2 7 |
| #define | GRUNT 8 |
| #define | WIGLR 9 |
| #define | YOSHI 10 |
| #define | _ 0xFF |
| #define | DIFF TUXIE |
| #define | MARIO_X_GE 0 |
| #define | MARIO_Y_GE 1 |
| #define | MARIO_Z_GE 2 |
| #define | MARIO_X_LT 3 |
| #define | MARIO_Y_LT 4 |
| #define | MARIO_Z_LT 5 |
| #define | MARIO_IS_IN_AREA 6 |
| #define | MARIO_IS_IN_ROOM 7 |
| #define | DYN1(cond1, val1, res) 1 << (15 - cond1) | res, val1 |
| #define | DYN2(cond1, val1, cond2, val2, res) 1 << (15 - cond1) | 1 << (15 - cond2) | res, val1, val2 |
| #define | DYN3(cond1, val1, cond2, val2, cond3, val3, res) 1 << (15 - cond1) | 1 << (15 - cond2) | 1 << (15 - cond3) | res, val1, val2, val3 |
| #define | _ D_80331EA8 |
| #define | VAL_DIFF 60000 |
| #define | AUDIO_MAX_DISTANCE US_FLOAT(22000.0) |
| #define | NUM_DIFF 0x40 |
| #define | VAL 40.0f |
| #define | ARG2_VAL1 0.9f |
| #define | ARG2_VAL2 0.8f |
Typedefs | |
| typedef s32 | FadeT |
| #define _ 0xFF |
| #define _ D_80331EA8 |
| #define ARG2_VAL1 0.9f |
| #define ARG2_VAL2 0.8f |
| #define AUDIO_MAX_DISTANCE US_FLOAT(22000.0) |
| #define BOMB 6 |
| #define BOO 5 |
| #define BOWS1 2 |
| #define BOWS2 7 |
| #define DIFF TUXIE |
| #define DYN1 | ( | cond1, | |
| val1, | |||
| res | |||
| ) | 1 << (15 - cond1) | res, val1 |
| #define DYN2 | ( | cond1, | |
| val1, | |||
| cond2, | |||
| val2, | |||
| res | |||
| ) | 1 << (15 - cond1) | 1 << (15 - cond2) | res, val1, val2 |
| #define DYN3 | ( | cond1, | |
| val1, | |||
| cond2, | |||
| val2, | |||
| cond3, | |||
| val3, | |||
| res | |||
| ) | 1 << (15 - cond1) | 1 << (15 - cond2) | 1 << (15 - cond3) | res, val1, val2, val3 |
| #define GRUNT 8 |
| #define KBOMB 4 |
| #define KOOPA 3 |
| #define MARIO_IS_IN_AREA 6 |
| #define MARIO_IS_IN_ROOM 7 |
| #define MARIO_X_GE 0 |
| #define MARIO_X_LT 3 |
| #define MARIO_Y_GE 1 |
| #define MARIO_Y_LT 4 |
| #define MARIO_Z_GE 2 |
| #define MARIO_Z_LT 5 |
| #define MAX_BG_MUSIC_QUEUE_SIZE 6 |
| #define NUM_DIFF 0x40 |
| #define SEQUENCE_NONE 0xFF |
| #define SOUND_BANK_COUNT 10 |
| #define stubbed_printf |
| #define TUXIE 1 |
| #define UKIKI 0 |
| #define VAL 40.0f |
| #define VAL_DIFF 60000 |
| #define WIGLR 9 |
| #define YOSHI 10 |
Given an x and z coordinates, return the pan.
This is a value between 0 and 1 that represents the audio direction.
Pan: 0.0 - fully left 0.5 - center pan 1.0 - fully right
Plays the puzzle jingle.
Plays the dadada dadada dadada jingle that usually plays when you solve a "puzzle", like chests, talking to yoshi, releasing chain chomp, opening the pyramid top, etc.
Fade out a sequence player.
| STATIC_ASSERT | ( | ARRAY_COUNT(sLevelDynamics) | = =LEVEL_COUNT, |
| "change this array if you are adding levels" | |||
| ) |
| STATIC_ASSERT | ( | ARRAY_COUNT(gAreaEchoLevel) | = =LEVEL_COUNT, |
| "change this array if you are adding levels" | |||
| ) |
| STATIC_ASSERT | ( | ARRAY_COUNT(D_80332028) | = =LEVEL_COUNT, |
| "change this array if you are adding levels" | |||
| ) |
| s16 D_80331EA8[] = { 0, 0 } |
| u16 D_80332028[] |
| u8 D_803320A4[SOUND_BANK_COUNT] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } |
| u8 D_803320B0[SOUND_BANK_COUNT] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } |
| u8 D_803320BC[SOUND_BANK_COUNT] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } |
| u8 D_803320C8[SOUND_BANK_COUNT] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } |
| u8 D_80332108 = 0 |
| u16 D_80332110 = 0 |
| u8 D_8033211C = 0 |
| u8 D_80332120 = 0 |
| u8 D_80332124 = 0 |
| struct ChannelVolumeScaleFade D_80360928[SEQUENCE_PLAYERS][CHANNELS_MAX] |
| u8 D_80360C28[SOUND_BANK_COUNT] |
| u8 D_80360C38[SOUND_BANK_COUNT][1] |
| u8 D_80363808[SOUND_BANK_COUNT] |
| u8 D_80363812 |
| u8 gAreaEchoLevel[][3] |
| s32 gAudioErrorFlags = 0 |
| u16* gCurrAiBuffer |
| f32 gDefaultSoundArgs[3] = { 0.0f, 0.0f, 0.0f } |
| u8 gPlayer0CurSeqId = SEQUENCE_NONE |
| u8 gSoundBankDisabled[16] = { 0 } |
| struct SoundCharacteristics gSoundBanks[SOUND_BANK_COUNT][40] |
| f32 gUnusedSoundArgs[3] = { 1.0f, 1.0f, 1.0f } |
| u8 sBackgroundMusicDefaultVolume[35] |
| u8 sBackgroundMusicForDynamics = SEQUENCE_NONE |
| struct SequenceQueueItem sBackgroundMusicQueue[MAX_BG_MUSIC_QUEUE_SIZE] |
| u8 sBackgroundMusicQueueSize = 0 |
|
static |
| u8 sCurrentMusicDynamic = 0xff |
| u8 sDialogSpeaker[170] |
| s32 sDialogSpeakerVoice[15] |
| s16 sDynBbh[] |
| s16 sDynDdd[] |
| s16 sDynHmc[] |
| s16 sDynJrb[] |
| s16 sDynUnk38[] |
| s16 sDynWdw[] |
| s32 sGameLoopTicked = 0 |
| s16* sLevelDynamics[] |
| u8 sMusicDynamicDelay = 0 |
| struct MusicDynamic sMusicDynamics[8] |
| u8 sNumProcessedSoundRequests = 0 |
| u8 sNumSoundsPerBank[SOUND_BANK_COUNT] |
| u8 sSoundRequestCount = 0 |
| u8 sUnused80332114 = 0 |
| u16 sUnused80332118 = 0 |
| u8 sUnused8033323C = 0 |
1.8.13