Mario Kart 64
|
#include <ultra64.h>
#include <PR/os.h>
#include <PR/ucode.h>
#include <macros.h>
#include <decode.h>
#include <mk64.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 "render_objects.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 "buffers/gfx_output_buffer.h"
Macros | |
#define | D_800DC510_AS_U16 |
#define D_800DC510_AS_U16 |
void audio_init | ( | ) |
void * clear_framebuffer | ( | s32 | color | ) |
void config_gfx_pool | ( | void | ) |
void create_debug_thread | ( | void | ) |
void create_gfx_task_structure | ( | void | ) |
Initializes the Fast3D OSTask structure. Loads F3DEX or F3DLX based on the number of players
struct SPTask * create_next_audio_frame_task | ( | void | ) |
void create_thread | ( | OSThread * | thread, |
OSId | id, | ||
void(* | entry )(void *), | ||
void * | arg, | ||
void * | sp, | ||
OSPri | pri ) |
void dispatch_audio_sptask | ( | struct SPTask * | spTask | ) |
void display_and_vsync | ( | void | ) |
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.
void end_master_display_list | ( | void | ) |
End the master display list and initialize the graphics task structure for the next frame to be rendered.
void exec_display_list | ( | struct SPTask * | spTask | ) |
void func_80000BEC | ( | void | ) |
void func_800025D4 | ( | void | ) |
void func_80002600 | ( | void | ) |
void func_8000262C | ( | void | ) |
void func_80002658 | ( | void | ) |
void func_80091B78 | ( | void | ) |
void game_init_clear_framebuffer | ( | void | ) |
void game_state_handler | ( | void | ) |
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).
void handle_dp_complete | ( | void | ) |
void handle_sp_complete | ( | void | ) |
void handle_vblank | ( | void | ) |
void init_controllers | ( | void | ) |
void init_rcp | ( | void | ) |
Set default RCP (Reality Co-Processor) settings.
void init_segment_ending_sequences | ( | void | ) |
void init_segment_racing | ( | void | ) |
void interrupt_gfx_sptask | ( | void | ) |
void isPrintfInit | ( | void | ) |
void main_func | ( | void | ) |
void race_logic_loop | ( | void | ) |
void read_controllers | ( | void | ) |
void receive_new_tasks | ( | void | ) |
void rendering_init | ( | void | ) |
void set_vblank_handler | ( | s32 | index, |
struct VblankHandler * | handler, | ||
OSMesgQueue * | queue, | ||
OSMesg * | msg ) |
void setup_game_memory | ( | void | ) |
Setup main segments and framebuffers.
void setup_mesg_queues | ( | void | ) |
void start_debug_thread | ( | void | ) |
void start_gfx_sptask | ( | void | ) |
void start_sptask | ( | s32 | taskType | ) |
void thread1_idle | ( | void * | arg | ) |
Initialize hardware, start main thread, then idle.
void thread3_video | ( | UNUSED void * | arg0 | ) |
void thread4_audio | ( | UNUSED void * | arg | ) |
Sound processing thread. Runs at 50 or 60 FPS according to osTvType.
void thread5_game_loop | ( | UNUSED void * | arg | ) |
void update_controller | ( | s32 | index | ) |
void update_gamestate | ( | void | ) |
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 } |
UNUSED OSMesg D_8014F010 |
UNUSED OSMesg D_8014F014 |
f32 D_80150118 |
u16 D_8015011E |
s32 D_80150120 |
f32 D_8015014C |
f32 D_80150150 |
s32 D_801502A0 |
s32 D_801502A4 |
Mat4 D_801502C0 |
u16 D_80152300[4] |
u16 D_80152308 |
s32 gActiveScreenMode = SCREEN_MODE_1P |
OSThread gAudioThread |
f32 gCameraZoom[4] |
CollisionGrid gCollisionGrid[1024] |
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 = ENABLE_DEBUG_MODE |
OSThread gGameLoopThread |
OSMesg gGameMesgBuf |
s32 gGamestate = 0xFFFF |
s32 gGamestateNext = 7 |
struct VblankHandler gGameVblankHandler |
OSMesgQueue gGameVblankQueue |
OSMesg gGfxMesgBuf[1] |
struct GfxPool* gGfxPool |
struct GfxPool gGfxPools[2] |
struct SPTask* gGfxSPTask |
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] |
uintptr_t gPhysicalZBuffer |
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 |