1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-12-27 07:07:09 +00:00
oot/include/z64game.h
Dragorn421 ccae1f7387
Split z64.h: move various things, state, sram, gfx, jpeg, prerender, speedmeter (#1487)
* Split z64.h more

* fix speedmeter.h (expect this kind of issue resolution to pop up eventually)

* fix z64object.h

* fix z64state.h

* fix (probably only partially) z64play.h

* fix fix speedmeter.h :)

* revert making a play header (sadge), add/split transition & transition_instances

* move stuff to cutscene, interface

* Move `TransitionCircle%` enums to `z64transition_instances.h`

* z64state.h -> z64game.h with a "this is not final" comment

* forward declare GraphicsContext in z64game.h instead of including the header file for it

* don't comment on where the forward declarations are from

reasoning:
1) it's easy to go out of sync (like this comment, it was outdated anyway)
2) any IDE can easily find the struct anyway
2023-08-15 12:21:19 -04:00

51 lines
1.4 KiB
C

#ifndef Z64GAME_H
#define Z64GAME_H
// This file is named "game" after game.c for now, this may change later with the system name
#include "ultra64/ultratypes.h"
#include "padmgr.h"
#include "tha.h"
struct GraphicsContext;
typedef struct GameAllocEntry {
/* 0x00 */ struct GameAllocEntry* next;
/* 0x04 */ struct GameAllocEntry* prev;
/* 0x08 */ u32 size;
/* 0x0C */ u32 unk_0C;
} GameAllocEntry; // size = 0x10
typedef struct {
/* 0x00 */ GameAllocEntry base;
/* 0x10 */ GameAllocEntry* head;
} GameAlloc; // size = 0x14
// Used in Graph_GetNextGameState in graph.c
#define DEFINE_GAMESTATE_INTERNAL(typeName, enumName) enumName,
#define DEFINE_GAMESTATE(typeName, enumName, name) DEFINE_GAMESTATE_INTERNAL(typeName, enumName)
typedef enum {
#include "tables/gamestate_table.h"
GAMESTATE_ID_MAX
} GameStateId;
#undef DEFINE_GAMESTATE
#undef DEFINE_GAMESTATE_INTERNAL
struct GameState;
typedef void (*GameStateFunc)(struct GameState* gameState);
typedef struct GameState {
/* 0x00 */ struct GraphicsContext* gfxCtx;
/* 0x04 */ GameStateFunc main;
/* 0x08 */ GameStateFunc destroy; // "cleanup"
/* 0x0C */ GameStateFunc init;
/* 0x10 */ u32 size;
/* 0x14 */ Input input[MAXCONTROLLERS];
/* 0x74 */ TwoHeadArena tha;
/* 0x84 */ GameAlloc alloc;
/* 0x98 */ u32 running;
/* 0x9C */ u32 frames;
/* 0xA0 */ u32 inPreNMIState;
} GameState; // size = 0xA4
#endif