Mario Kart 64
|
#include <ultra64.h>
#include <PR/os.h>
#include <PR/ucode.h>
#include <macros.h>
#include <decode.h>
#include <types.h>
#include <config.h>
#include "profiler.h"
#include "main.h"
#include "racing/memory.h"
#include "menus.h"
#include <segments.h>
#include <common_structs.h>
#include <defines.h>
#include "buffers.h"
#include "camera.h"
#include "race_logic.h"
#include "skybox_and_splitscreen.h"
#include "hud_renderer.h"
#include "effects.h"
#include "code_80281780.h"
#include "audio/external.h"
#include "code_800029B0.h"
#include "code_80280000.h"
#include "podium_ceremony_actors.h"
#include "code_80091750.h"
#include "code_80057C60.h"
#include "player_controller.h"
#include "render_player.h"
#include "render_courses.h"
#include "actors.h"
#include "staff_ghosts.h"
#include <debug.h>
#include "crash_screen.h"
#include "data/gfx_output_buffer.h"
Macros | |
#define | STRANGE_MAIN_HEADER_H |
#define STRANGE_MAIN_HEADER_H |
void audio_init | ( | ) |
Initializes the Fast3D OSTask structure. Loads F3DEX or F3DLX based on the number of players
void create_thread | ( | OSThread * | thread, |
OSId | id, | ||
void(*)(void *) | entry, | ||
void * | arg, | ||
void * | sp, | ||
OSPri | pri ) |
Send current master display list for rendering. Tell the VI which colour framebuffer to display. Yields to the VI framerate twice, locking the game at 30 FPS. Selects the next framebuffer to be rendered and displayed.
End the master display list and initialize the graphics task structure for the next frame to be rendered.
mk64's game loop depends on a series of states. It runs a wide branching series of code based on these states. State 1) Clear framebuffer State 2) Run menus State 3) Process race related logic State 4) Ending sequence State 5) Credits
Note that the state doesn't flip-flop at random but is permanent until the state changes (ie. Exit menus and start a race).
Set default RCP (Reality Co-Processor) settings.
void set_vblank_handler | ( | s32 | index, |
struct VblankHandler * | handler, | ||
OSMesgQueue * | queue, | ||
OSMesg * | msg ) |
Setup main segments and framebuffers.
Initialize hardware, start main thread, then idle.
Sound processing thread. Runs at 50 or 60 FPS according to osTvType.
Sets courseId to NULL if
u16 creditsRenderMode = 0 |
u16 D_800DC510 = 0 |
u16 D_800DC514 = 0 |
s32 D_800DC540 = 0 |
s32 D_800DC544 = 0 |
s32 D_800DC568 = 0 |
s32 D_800DC56C[8] = {0} |
s32 D_800FD850[3] |
UNUSED OSMesg D_8014F010 |
UNUSED OSMesg D_8014F014 |
struct UnkStruct_8015F584 D_8014F110[1024] |
f32 D_80150118 |
u16 D_8015011E |
s32 D_80150120 |
f32 D_8015014C |
f32 D_80150150 |
s32 D_801502A0 |
s32 D_801502A4 |
u32 D_801502B4 |
Mat4 D_801502C0 |
u16 D_80152300[4] |
u16 D_80152308 |
s32 gActiveScreenMode = SCREEN_MODE_1P |
OSThread gAudioThread |
f32 gCameraZoom[4] |
u8 gControllerBits |
struct Controller* gControllerEight = &gControllers[7] |
struct Controller* gControllerFive = &gControllers[4] |
struct Controller* gControllerFour = &gControllers[3] |
struct Controller* gControllerOne = &gControllers[0] |
OSContPad gControllerPads[4] |
struct Controller gControllers[NUM_PLAYERS] |
struct Controller* gControllerSeven = &gControllers[6] |
struct Controller* gControllerSix = &gControllers[5] |
OSContStatus gControllerStatuses[4] |
struct Controller* gControllerThree = &gControllers[2] |
struct Controller* gControllerTwo = &gControllers[1] |
f32 gCourseTimer = 0.0f |
struct D_80150158 gD_80150158[16] |
u16 gDemoMode = DEMO_MODE_INACTIVE |
Gfx* gDisplayListHead |
OSIoMesg gDmaIoMesg |
OSMesg gDmaMesgBuf[1] |
OSMesgQueue gDmaMesgQueue |
u16 gEnableDebugMode = DEBUG_MODE |
s32 gfxPool_padding |
OSThread gGameLoopThread |
OSMesg gGameMesgBuf |
s32 gGamestate = 0xFFFF |
s32 gGamestateNext = 7 |
struct VblankHandler gGameVblankHandler |
OSMesgQueue gGameVblankQueue |
OSMesg gGfxMesgBuf[1] |
u32 gGfxSPTaskStack[256] |
u8 gGfxSPTaskYieldBuffer[4352] |
OSMesgQueue gGfxVblankQueue |
s32 gGlobalTimer = 0 |
s32 gGotoMode |
OSThread gIdleThread |
OSMesg gIntrMesgBuf[16] |
OSMesgQueue gIntrMesgQueue |
OSMesg gMainReceivedMesg |
u16 gMatrixObjectCount |
s32 gModeSelection = GRAND_PRIX |
u16 gNumActors |
u16* gPhysicalFramebuffers[3] |
OSMesg gPIMesgBuf[32] |
OSMesgQueue gPIMesgQueue |
s32 gPlayerCountSelection1 = 2 |
Player gPlayers[NUM_PLAYERS] |
f32 gScreenAspect |
s32 gScreenModeSelection = SCREEN_MODE_1P |
uintptr_t gSegmentTable[16] |
OSMesg gSIEventMesgBuf[3] |
OSMesgQueue gSIEventMesgQueue |
OSMesg gSPTaskMesgBuf[16] |
OSMesgQueue gSPTaskMesgQueue |
s32 gTickSpeed |
struct VblankHandler* gVblankHandler1 = NULL |
struct VblankHandler* gVblankHandler2 = NULL |
f32 gVBlankTimer = 0.0f |
OSThread gVideoThread |
s32 padding[2048] |
s16 sNumVBlanks = 0 |
u16 sRenderedFramebuffer = 0 |
u16 sRenderingFramebuffer = 0 |
OSMesg sSoundMesgBuf[1] |
OSMesgQueue sSoundMesgQueue |
struct VblankHandler sSoundVblankHandler |
OSMesgQueue unused_gMsgQueue |
u16 wasSoftReset |