mirror of
https://github.com/zeldaret/oot.git
synced 2025-02-26 19:04:20 +00:00
Reduce dependencies on global.h (9) (#2488)
* split game states * split all GameState headers * match fig names * deduplicate headers from bad merge * split z64actor.h into z64actor_profile.h, z_actor_dlftbls.h * fix compile error * .bss
This commit is contained in:
parent
70fde8ac3b
commit
2e4c42719b
48 changed files with 310 additions and 221 deletions
|
@ -3,8 +3,8 @@
|
||||||
|
|
||||||
#include "ultra64.h"
|
#include "ultra64.h"
|
||||||
#include "z64game.h"
|
#include "z64game.h"
|
||||||
#include "z64view.h"
|
|
||||||
#include "z64sram.h"
|
#include "z64sram.h"
|
||||||
|
#include "z64view.h"
|
||||||
|
|
||||||
typedef struct ConsoleLogoState {
|
typedef struct ConsoleLogoState {
|
||||||
/* 0x0000 */ GameState state;
|
/* 0x0000 */ GameState state;
|
||||||
|
|
|
@ -2,12 +2,12 @@
|
||||||
#define FILE_SELECT_STATE_H
|
#define FILE_SELECT_STATE_H
|
||||||
|
|
||||||
#include "ultra64.h"
|
#include "ultra64.h"
|
||||||
#include "z64game.h"
|
|
||||||
#include "z64view.h"
|
|
||||||
#include "z64sram.h"
|
|
||||||
#include "z64skybox.h"
|
|
||||||
#include "z64message.h"
|
|
||||||
#include "z64environment.h"
|
#include "z64environment.h"
|
||||||
|
#include "z64game.h"
|
||||||
|
#include "z64message.h"
|
||||||
|
#include "z64skybox.h"
|
||||||
|
#include "z64sram.h"
|
||||||
|
#include "z64view.h"
|
||||||
|
|
||||||
typedef struct FileSelectState {
|
typedef struct FileSelectState {
|
||||||
/* 0x00000 */ GameState state;
|
/* 0x00000 */ GameState state;
|
||||||
|
|
|
@ -28,12 +28,6 @@ OSPiHandle* osDriveRomInit(void);
|
||||||
void Mio0_Decompress(u8* src, u8* dst);
|
void Mio0_Decompress(u8* src, u8* dst);
|
||||||
|
|
||||||
void FlagSet_Update(PlayState* play);
|
void FlagSet_Update(PlayState* play);
|
||||||
void Overlay_LoadGameState(GameStateOverlay* overlayEntry);
|
|
||||||
void Overlay_FreeGameState(GameStateOverlay* overlayEntry);
|
|
||||||
|
|
||||||
void ActorOverlayTable_LogPrint(void);
|
|
||||||
void ActorOverlayTable_Init(void);
|
|
||||||
void ActorOverlayTable_Cleanup(void);
|
|
||||||
|
|
||||||
void SaveContext_Init(void);
|
void SaveContext_Init(void);
|
||||||
|
|
||||||
|
@ -102,12 +96,6 @@ void func_800C213C(PreRender* this, Gfx** gfxP);
|
||||||
void PreRender_RestoreFramebuffer(PreRender* this, Gfx** gfxP);
|
void PreRender_RestoreFramebuffer(PreRender* this, Gfx** gfxP);
|
||||||
void PreRender_CopyImageRegion(PreRender* this, Gfx** gfxP);
|
void PreRender_CopyImageRegion(PreRender* this, Gfx** gfxP);
|
||||||
void PreRender_ApplyFilters(PreRender* this);
|
void PreRender_ApplyFilters(PreRender* this);
|
||||||
void Graph_InitTHGA(GraphicsContext* gfxCtx);
|
|
||||||
GameStateOverlay* Graph_GetNextGameState(GameState* gameState);
|
|
||||||
void Graph_Init(GraphicsContext* gfxCtx);
|
|
||||||
void Graph_Destroy(GraphicsContext* gfxCtx);
|
|
||||||
void Graph_TaskSet00(GraphicsContext* gfxCtx);
|
|
||||||
void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState);
|
|
||||||
void Graph_ThreadEntry(void*);
|
void Graph_ThreadEntry(void*);
|
||||||
|
|
||||||
ListAlloc* ListAlloc_Init(ListAlloc* this);
|
ListAlloc* ListAlloc_Init(ListAlloc* this);
|
||||||
|
|
|
@ -33,6 +33,8 @@ typedef struct OverlayRelocationSection {
|
||||||
/* 0x14 */ u32 relocations[1]; // size is nRelocations
|
/* 0x14 */ u32 relocations[1]; // size is nRelocations
|
||||||
} OverlayRelocationSection; // size >= 0x18
|
} OverlayRelocationSection; // size >= 0x18
|
||||||
|
|
||||||
|
extern s32 gOverlayLogSeverity;
|
||||||
|
|
||||||
void* Overlay_AllocateAndLoad(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, void* vramEnd);
|
void* Overlay_AllocateAndLoad(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, void* vramEnd);
|
||||||
void Overlay_Relocate(void* allocatedRamAddr, OverlayRelocationSection* ovlRelocs, void* vramStart);
|
void Overlay_Relocate(void* allocatedRamAddr, OverlayRelocationSection* ovlRelocs, void* vramStart);
|
||||||
size_t Overlay_Load(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, void* vramEnd, void* allocatedRamAddr);
|
size_t Overlay_Load(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, void* vramEnd, void* allocatedRamAddr);
|
||||||
|
|
|
@ -89,14 +89,6 @@
|
||||||
#define PRINTF_RST() (void)0
|
#define PRINTF_RST() (void)0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define SET_NEXT_GAMESTATE(curState, newInit, newStruct) \
|
|
||||||
if (1) { \
|
|
||||||
GameState* state = curState; \
|
|
||||||
\
|
|
||||||
(state)->init = newInit; \
|
|
||||||
(state)->size = sizeof(newStruct); \
|
|
||||||
} (void)0
|
|
||||||
|
|
||||||
#if DEBUG_FEATURES
|
#if DEBUG_FEATURES
|
||||||
#define DMA_REQUEST_SYNC(ram, vrom, size, file, line) DmaMgr_RequestSyncDebug(ram, vrom, size, file, line)
|
#define DMA_REQUEST_SYNC(ram, vrom, size, file, line) DmaMgr_RequestSyncDebug(ram, vrom, size, file, line)
|
||||||
#define DMA_REQUEST_ASYNC(req, ram, vrom, size, unk5, queue, msg, file, line) DmaMgr_RequestAsyncDebug(req, ram, vrom, size, unk5, queue, msg, file, line)
|
#define DMA_REQUEST_ASYNC(req, ram, vrom, size, unk5, queue, msg, file, line) DmaMgr_RequestAsyncDebug(req, ram, vrom, size, unk5, queue, msg, file, line)
|
||||||
|
|
|
@ -65,10 +65,6 @@ extern OSTime __osCurrentTime;
|
||||||
extern u32 __osBaseCounter;
|
extern u32 __osBaseCounter;
|
||||||
extern u32 __osViIntrCount;
|
extern u32 __osViIntrCount;
|
||||||
extern u32 __osTimerCounter;
|
extern u32 __osTimerCounter;
|
||||||
extern EffectSsOverlay gEffectSsOverlayTable[EFFECT_SS_TYPE_MAX];
|
|
||||||
extern ActorOverlay gActorOverlayTable[ACTOR_ID_MAX]; // original name: "actor_dlftbls" 801162A0
|
|
||||||
extern s32 gMaxActorId; // original name: "MaxProfile"
|
|
||||||
extern s32 gZeldaArenaLogSeverity;
|
|
||||||
extern MapData gMapDataTable;
|
extern MapData gMapDataTable;
|
||||||
extern s16 gSpoilingItems[3];
|
extern s16 gSpoilingItems[3];
|
||||||
extern s16 gSpoilingItemReverts[3];
|
extern s16 gSpoilingItemReverts[3];
|
||||||
|
@ -134,7 +130,6 @@ extern u8 gSoundModeList[];
|
||||||
extern u8 gAudioSpecId;
|
extern u8 gAudioSpecId;
|
||||||
extern u8 D_80133418;
|
extern u8 D_80133418;
|
||||||
extern AudioSpec gAudioSpecs[18];
|
extern AudioSpec gAudioSpecs[18];
|
||||||
extern s32 gOverlayLogSeverity;
|
|
||||||
extern s32 gSystemArenaLogSeverity;
|
extern s32 gSystemArenaLogSeverity;
|
||||||
extern u8 __osPfsInodeCacheBank;
|
extern u8 __osPfsInodeCacheBank;
|
||||||
extern s32 __osPfsLastChannel;
|
extern s32 __osPfsLastChannel;
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
#include "color.h"
|
#include "color.h"
|
||||||
#include "romfile.h"
|
#include "romfile.h"
|
||||||
|
#include "z64actor_profile.h"
|
||||||
#include "z64animation.h"
|
#include "z64animation.h"
|
||||||
#include "z64math.h"
|
#include "z64math.h"
|
||||||
#include "z64collision_check.h"
|
#include "z64collision_check.h"
|
||||||
|
@ -23,88 +24,16 @@
|
||||||
|
|
||||||
struct Actor;
|
struct Actor;
|
||||||
struct ActorEntry;
|
struct ActorEntry;
|
||||||
|
struct ActorOverlay;
|
||||||
struct CollisionPoly;
|
struct CollisionPoly;
|
||||||
struct Lights;
|
struct Lights;
|
||||||
struct Player;
|
struct Player;
|
||||||
struct PlayState;
|
struct PlayState;
|
||||||
|
|
||||||
typedef void (*ActorFunc)(struct Actor*, struct PlayState*);
|
|
||||||
typedef void (*ActorShadowFunc)(struct Actor*, struct Lights*, struct PlayState*);
|
typedef void (*ActorShadowFunc)(struct Actor*, struct Lights*, struct PlayState*);
|
||||||
typedef u16 (*NpcGetTextIdFunc)(struct PlayState*, struct Actor*);
|
typedef u16 (*NpcGetTextIdFunc)(struct PlayState*, struct Actor*);
|
||||||
typedef s16 (*NpcUpdateTalkStateFunc)(struct PlayState*, struct Actor*);
|
typedef s16 (*NpcUpdateTalkStateFunc)(struct PlayState*, struct Actor*);
|
||||||
|
|
||||||
typedef struct ActorProfile {
|
|
||||||
/* 0x00 */ s16 id;
|
|
||||||
/* 0x02 */ u8 category; // Classifies actor and determines when it will update or draw
|
|
||||||
/* 0x04 */ u32 flags;
|
|
||||||
/* 0x08 */ s16 objectId;
|
|
||||||
/* 0x0C */ u32 instanceSize;
|
|
||||||
/* 0x10 */ ActorFunc init; // Constructor
|
|
||||||
/* 0x14 */ ActorFunc destroy; // Destructor
|
|
||||||
/* 0x18 */ ActorFunc update; // Update Function
|
|
||||||
/* 0x1C */ ActorFunc draw; // Draw function
|
|
||||||
} ActorProfile; // size = 0x20
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @see ACTOROVL_ALLOC_ABSOLUTE
|
|
||||||
*/
|
|
||||||
#if DEBUG_FEATURES
|
|
||||||
#define ACTOROVL_ABSOLUTE_SPACE_SIZE 0x27A0
|
|
||||||
#else
|
|
||||||
#define ACTOROVL_ABSOLUTE_SPACE_SIZE 0x24E0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The actor overlay should be allocated memory for when loading,
|
|
||||||
* and the memory deallocated when there is no more actor using the overlay.
|
|
||||||
*
|
|
||||||
* `ACTOROVL_ALLOC_` defines indicate how an actor overlay should be loaded.
|
|
||||||
*
|
|
||||||
* @note Bitwise or-ing `ACTOROVL_ALLOC_` types is not meaningful.
|
|
||||||
* The `ACTOROVL_ALLOC_` types are 0, 1, 2 but checked against with a bitwise and.
|
|
||||||
*
|
|
||||||
* @see ACTOROVL_ALLOC_ABSOLUTE
|
|
||||||
* @see ACTOROVL_ALLOC_PERSISTENT
|
|
||||||
* @see actor_table.h
|
|
||||||
*/
|
|
||||||
#define ACTOROVL_ALLOC_NORMAL 0
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The actor overlay should be loaded to "absolute space".
|
|
||||||
*
|
|
||||||
* Absolute space is a fixed amount of memory allocated once.
|
|
||||||
* The overlay will still need to be loaded again if at some point there is no more actor using the overlay.
|
|
||||||
*
|
|
||||||
* @note Only one such overlay may be loaded at a time.
|
|
||||||
* This is not checked: a newly loaded overlay will overwrite the previous one in absolute space,
|
|
||||||
* even if actors are still relying on the previous one. Actors using absolute-allocated overlays should be deleted
|
|
||||||
* when another absolute-allocated overlay is about to be used.
|
|
||||||
*
|
|
||||||
* @see ACTOROVL_ABSOLUTE_SPACE_SIZE
|
|
||||||
* @see ActorContext.absoluteSpace
|
|
||||||
* @see ACTOROVL_ALLOC_NORMAL
|
|
||||||
*/
|
|
||||||
#define ACTOROVL_ALLOC_ABSOLUTE (1 << 0)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The actor overlay should be loaded persistently.
|
|
||||||
* It will stay loaded until the current game state instance ends.
|
|
||||||
*
|
|
||||||
* @see ACTOROVL_ALLOC_NORMAL
|
|
||||||
*/
|
|
||||||
#define ACTOROVL_ALLOC_PERSISTENT (1 << 1)
|
|
||||||
|
|
||||||
typedef struct ActorOverlay {
|
|
||||||
/* 0x00 */ RomFile file;
|
|
||||||
/* 0x08 */ void* vramStart;
|
|
||||||
/* 0x0C */ void* vramEnd;
|
|
||||||
/* 0x10 */ void* loadedRamAddr; // original name: "allocp"
|
|
||||||
/* 0x14 */ ActorProfile* profile;
|
|
||||||
/* 0x18 */ char* name;
|
|
||||||
/* 0x1C */ u16 allocType; // See `ACTOROVL_ALLOC_` defines
|
|
||||||
/* 0x1E */ s8 numLoaded; // original name: "clients"
|
|
||||||
} ActorOverlay; // size = 0x20
|
|
||||||
|
|
||||||
typedef struct ActorShape {
|
typedef struct ActorShape {
|
||||||
/* 0x00 */ Vec3s rot; // Current actor shape rotation
|
/* 0x00 */ Vec3s rot; // Current actor shape rotation
|
||||||
/* 0x06 */ s16 face; // Used to index eyes and mouth textures. Only used by player
|
/* 0x06 */ s16 face; // Used to index eyes and mouth textures. Only used by player
|
||||||
|
@ -309,7 +238,7 @@ typedef struct Actor {
|
||||||
/* 0x12C */ ActorFunc destroy; // Destruction Routine. Called by `Actor_Destroy`
|
/* 0x12C */ ActorFunc destroy; // Destruction Routine. Called by `Actor_Destroy`
|
||||||
/* 0x130 */ ActorFunc update; // Update Routine. Called by `Actor_UpdateAll`
|
/* 0x130 */ ActorFunc update; // Update Routine. Called by `Actor_UpdateAll`
|
||||||
/* 0x134 */ ActorFunc draw; // Draw Routine. Called by `Actor_Draw`
|
/* 0x134 */ ActorFunc draw; // Draw Routine. Called by `Actor_Draw`
|
||||||
/* 0x138 */ ActorOverlay* overlayEntry; // Pointer to the overlay table entry for this actor
|
/* 0x138 */ struct ActorOverlay* overlayEntry; // Pointer to the overlay table entry for this actor
|
||||||
#if DEBUG_FEATURES
|
#if DEBUG_FEATURES
|
||||||
/* 0x13C */ char dbgPad[0x10];
|
/* 0x13C */ char dbgPad[0x10];
|
||||||
#endif
|
#endif
|
||||||
|
@ -396,35 +325,6 @@ typedef struct EnAObj {
|
||||||
/* 0x17C */ ColliderCylinder collider;
|
/* 0x17C */ ColliderCylinder collider;
|
||||||
} EnAObj; // size = 0x1C8
|
} EnAObj; // size = 0x1C8
|
||||||
|
|
||||||
typedef enum ActorCategory {
|
|
||||||
/* 0x00 */ ACTORCAT_SWITCH,
|
|
||||||
/* 0x01 */ ACTORCAT_BG,
|
|
||||||
/* 0x02 */ ACTORCAT_PLAYER,
|
|
||||||
/* 0x03 */ ACTORCAT_EXPLOSIVE,
|
|
||||||
/* 0x04 */ ACTORCAT_NPC,
|
|
||||||
/* 0x05 */ ACTORCAT_ENEMY,
|
|
||||||
/* 0x06 */ ACTORCAT_PROP,
|
|
||||||
/* 0x07 */ ACTORCAT_ITEMACTION,
|
|
||||||
/* 0x08 */ ACTORCAT_MISC,
|
|
||||||
/* 0x09 */ ACTORCAT_BOSS,
|
|
||||||
/* 0x0A */ ACTORCAT_DOOR,
|
|
||||||
/* 0x0B */ ACTORCAT_CHEST,
|
|
||||||
/* 0x0C */ ACTORCAT_MAX
|
|
||||||
} ActorCategory;
|
|
||||||
|
|
||||||
#define DEFINE_ACTOR(_0, enum, _2, _3) enum,
|
|
||||||
#define DEFINE_ACTOR_INTERNAL(_0, enum, _2, _3) enum,
|
|
||||||
#define DEFINE_ACTOR_UNSET(enum) enum,
|
|
||||||
|
|
||||||
typedef enum ActorID {
|
|
||||||
#include "tables/actor_table.h"
|
|
||||||
/* 0x0192 */ ACTOR_ID_MAX // originally "ACTOR_DLF_MAX"
|
|
||||||
} ActorID;
|
|
||||||
|
|
||||||
#undef DEFINE_ACTOR
|
|
||||||
#undef DEFINE_ACTOR_INTERNAL
|
|
||||||
#undef DEFINE_ACTOR_UNSET
|
|
||||||
|
|
||||||
typedef enum DoorLockType {
|
typedef enum DoorLockType {
|
||||||
DOORLOCK_NORMAL,
|
DOORLOCK_NORMAL,
|
||||||
DOORLOCK_BOSS,
|
DOORLOCK_BOSS,
|
||||||
|
|
52
include/z64actor_profile.h
Normal file
52
include/z64actor_profile.h
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
#ifndef Z64ACTOR_PROFILE_H
|
||||||
|
#define Z64ACTOR_PROFILE_H
|
||||||
|
|
||||||
|
#include "ultra64.h"
|
||||||
|
|
||||||
|
struct Actor;
|
||||||
|
struct PlayState;
|
||||||
|
|
||||||
|
#define DEFINE_ACTOR(_0, enum, _2, _3) enum,
|
||||||
|
#define DEFINE_ACTOR_INTERNAL(_0, enum, _2, _3) enum,
|
||||||
|
#define DEFINE_ACTOR_UNSET(enum) enum,
|
||||||
|
|
||||||
|
typedef enum ActorID {
|
||||||
|
#include "tables/actor_table.h"
|
||||||
|
/* 0x0192 */ ACTOR_ID_MAX // originally "ACTOR_DLF_MAX"
|
||||||
|
} ActorID;
|
||||||
|
|
||||||
|
#undef DEFINE_ACTOR
|
||||||
|
#undef DEFINE_ACTOR_INTERNAL
|
||||||
|
#undef DEFINE_ACTOR_UNSET
|
||||||
|
|
||||||
|
typedef enum ActorCategory {
|
||||||
|
/* 0x00 */ ACTORCAT_SWITCH,
|
||||||
|
/* 0x01 */ ACTORCAT_BG,
|
||||||
|
/* 0x02 */ ACTORCAT_PLAYER,
|
||||||
|
/* 0x03 */ ACTORCAT_EXPLOSIVE,
|
||||||
|
/* 0x04 */ ACTORCAT_NPC,
|
||||||
|
/* 0x05 */ ACTORCAT_ENEMY,
|
||||||
|
/* 0x06 */ ACTORCAT_PROP,
|
||||||
|
/* 0x07 */ ACTORCAT_ITEMACTION,
|
||||||
|
/* 0x08 */ ACTORCAT_MISC,
|
||||||
|
/* 0x09 */ ACTORCAT_BOSS,
|
||||||
|
/* 0x0A */ ACTORCAT_DOOR,
|
||||||
|
/* 0x0B */ ACTORCAT_CHEST,
|
||||||
|
/* 0x0C */ ACTORCAT_MAX
|
||||||
|
} ActorCategory;
|
||||||
|
|
||||||
|
typedef void (*ActorFunc)(struct Actor*, struct PlayState*);
|
||||||
|
|
||||||
|
typedef struct ActorProfile {
|
||||||
|
/* 0x00 */ s16 id;
|
||||||
|
/* 0x02 */ u8 category; // Classifies actor and determines when it will update or draw
|
||||||
|
/* 0x04 */ u32 flags;
|
||||||
|
/* 0x08 */ s16 objectId;
|
||||||
|
/* 0x0C */ u32 instanceSize;
|
||||||
|
/* 0x10 */ ActorFunc init; // Constructor
|
||||||
|
/* 0x14 */ ActorFunc destroy; // Destructor
|
||||||
|
/* 0x18 */ ActorFunc update; // Update Function
|
||||||
|
/* 0x1C */ ActorFunc draw; // Draw function
|
||||||
|
} ActorProfile; // size = 0x20
|
||||||
|
|
||||||
|
#endif
|
|
@ -262,6 +262,8 @@ typedef enum EffectSsType {
|
||||||
#undef DEFINE_EFFECT_SS
|
#undef DEFINE_EFFECT_SS
|
||||||
#undef DEFINE_EFFECT_SS_UNSET
|
#undef DEFINE_EFFECT_SS_UNSET
|
||||||
|
|
||||||
|
extern EffectSsOverlay gEffectSsOverlayTable[EFFECT_SS_TYPE_MAX];
|
||||||
|
|
||||||
void EffectBlure_AddVertex(EffectBlure* this, Vec3f* p1, Vec3f* p2);
|
void EffectBlure_AddVertex(EffectBlure* this, Vec3f* p1, Vec3f* p2);
|
||||||
void EffectBlure_AddSpace(EffectBlure* this);
|
void EffectBlure_AddSpace(EffectBlure* this);
|
||||||
void EffectBlure_Init1(void* thisx, void* initParamsx);
|
void EffectBlure_Init1(void* thisx, void* initParamsx);
|
||||||
|
|
|
@ -9,33 +9,6 @@
|
||||||
#include "tha.h"
|
#include "tha.h"
|
||||||
|
|
||||||
struct GraphicsContext;
|
struct GraphicsContext;
|
||||||
|
|
||||||
// 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 GameStateId {
|
|
||||||
#include "tables/gamestate_table.h"
|
|
||||||
GAMESTATE_ID_MAX
|
|
||||||
} GameStateId;
|
|
||||||
#undef DEFINE_GAMESTATE
|
|
||||||
#undef DEFINE_GAMESTATE_INTERNAL
|
|
||||||
|
|
||||||
typedef struct GameStateOverlay {
|
|
||||||
/* 0x00 */ void* loadedRamAddr;
|
|
||||||
/* 0x04 */ RomFile file; // if applicable
|
|
||||||
/* 0x0C */ void* vramStart; // if applicable
|
|
||||||
/* 0x10 */ void* vramEnd; // if applicable
|
|
||||||
/* 0x14 */ void* unk_14;
|
|
||||||
/* 0x18 */ void* init;
|
|
||||||
/* 0x1C */ void* destroy;
|
|
||||||
/* 0x20 */ void* unk_20;
|
|
||||||
/* 0x24 */ void* unk_24;
|
|
||||||
/* 0x28 */ s32 unk_28;
|
|
||||||
/* 0x2C */ u32 instanceSize;
|
|
||||||
} GameStateOverlay; // size = 0x30
|
|
||||||
|
|
||||||
extern GameStateOverlay gGameStateOverlayTable[GAMESTATE_ID_MAX];
|
|
||||||
|
|
||||||
struct GameState;
|
struct GameState;
|
||||||
|
|
||||||
typedef void (*GameStateFunc)(struct GameState* gameState);
|
typedef void (*GameStateFunc)(struct GameState* gameState);
|
||||||
|
@ -54,6 +27,14 @@ typedef struct GameState {
|
||||||
/* 0xA0 */ u32 inPreNMIState;
|
/* 0xA0 */ u32 inPreNMIState;
|
||||||
} GameState; // size = 0xA4
|
} GameState; // size = 0xA4
|
||||||
|
|
||||||
|
#define SET_NEXT_GAMESTATE(curState, newInit, newStruct) \
|
||||||
|
if (1) { \
|
||||||
|
GameState* state = curState; \
|
||||||
|
\
|
||||||
|
(state)->init = newInit; \
|
||||||
|
(state)->size = sizeof(newStruct); \
|
||||||
|
} (void)0
|
||||||
|
|
||||||
void GameState_ReqPadData(GameState* gameState);
|
void GameState_ReqPadData(GameState* gameState);
|
||||||
void GameState_Update(GameState* gameState);
|
void GameState_Update(GameState* gameState);
|
||||||
void GameState_InitArena(GameState* gameState, size_t size);
|
void GameState_InitArena(GameState* gameState, size_t size);
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
|
|
||||||
struct FileSelectState;
|
struct FileSelectState;
|
||||||
struct GameState;
|
struct GameState;
|
||||||
struct PlayState;
|
|
||||||
|
|
||||||
typedef struct SramContext {
|
typedef struct SramContext {
|
||||||
/* 0x00 */ u8* readBuff;
|
/* 0x00 */ u8* readBuff;
|
||||||
|
@ -32,6 +31,6 @@ void Sram_CopySave(struct FileSelectState* fileSelect, SramContext* sramCtx);
|
||||||
void Sram_WriteSramHeader(SramContext* sramCtx);
|
void Sram_WriteSramHeader(SramContext* sramCtx);
|
||||||
void Sram_InitSram(struct GameState* gameState, SramContext* sramCtx);
|
void Sram_InitSram(struct GameState* gameState, SramContext* sramCtx);
|
||||||
void Sram_Alloc(struct GameState* gameState, SramContext* sramCtx);
|
void Sram_Alloc(struct GameState* gameState, SramContext* sramCtx);
|
||||||
void Sram_Init(struct PlayState* play, SramContext* sramCtx);
|
void Sram_Init(struct GameState* play, SramContext* sramCtx);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
74
include/z_actor_dlftbls.h
Normal file
74
include/z_actor_dlftbls.h
Normal file
|
@ -0,0 +1,74 @@
|
||||||
|
#ifndef Z_ACTOR_DLFTBLS_H
|
||||||
|
#define Z_ACTOR_DLFTBLS_H
|
||||||
|
|
||||||
|
#include "romfile.h"
|
||||||
|
#include "z64actor_profile.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see ACTOROVL_ALLOC_ABSOLUTE
|
||||||
|
*/
|
||||||
|
#if DEBUG_FEATURES
|
||||||
|
#define ACTOROVL_ABSOLUTE_SPACE_SIZE 0x27A0
|
||||||
|
#else
|
||||||
|
#define ACTOROVL_ABSOLUTE_SPACE_SIZE 0x24E0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The actor overlay should be allocated memory for when loading,
|
||||||
|
* and the memory deallocated when there is no more actor using the overlay.
|
||||||
|
*
|
||||||
|
* `ACTOROVL_ALLOC_` defines indicate how an actor overlay should be loaded.
|
||||||
|
*
|
||||||
|
* @note Bitwise or-ing `ACTOROVL_ALLOC_` types is not meaningful.
|
||||||
|
* The `ACTOROVL_ALLOC_` types are 0, 1, 2 but checked against with a bitwise and.
|
||||||
|
*
|
||||||
|
* @see ACTOROVL_ALLOC_ABSOLUTE
|
||||||
|
* @see ACTOROVL_ALLOC_PERSISTENT
|
||||||
|
* @see actor_table.h
|
||||||
|
*/
|
||||||
|
#define ACTOROVL_ALLOC_NORMAL 0
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The actor overlay should be loaded to "absolute space".
|
||||||
|
*
|
||||||
|
* Absolute space is a fixed amount of memory allocated once.
|
||||||
|
* The overlay will still need to be loaded again if at some point there is no more actor using the overlay.
|
||||||
|
*
|
||||||
|
* @note Only one such overlay may be loaded at a time.
|
||||||
|
* This is not checked: a newly loaded overlay will overwrite the previous one in absolute space,
|
||||||
|
* even if actors are still relying on the previous one. Actors using absolute-allocated overlays should be deleted
|
||||||
|
* when another absolute-allocated overlay is about to be used.
|
||||||
|
*
|
||||||
|
* @see ACTOROVL_ABSOLUTE_SPACE_SIZE
|
||||||
|
* @see ActorContext.absoluteSpace
|
||||||
|
* @see ACTOROVL_ALLOC_NORMAL
|
||||||
|
*/
|
||||||
|
#define ACTOROVL_ALLOC_ABSOLUTE (1 << 0)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The actor overlay should be loaded persistently.
|
||||||
|
* It will stay loaded until the current game state instance ends.
|
||||||
|
*
|
||||||
|
* @see ACTOROVL_ALLOC_NORMAL
|
||||||
|
*/
|
||||||
|
#define ACTOROVL_ALLOC_PERSISTENT (1 << 1)
|
||||||
|
|
||||||
|
typedef struct ActorOverlay {
|
||||||
|
/* 0x00 */ RomFile file;
|
||||||
|
/* 0x08 */ void* vramStart;
|
||||||
|
/* 0x0C */ void* vramEnd;
|
||||||
|
/* 0x10 */ void* loadedRamAddr; // original name: "allocp"
|
||||||
|
/* 0x14 */ ActorProfile* profile;
|
||||||
|
/* 0x18 */ char* name;
|
||||||
|
/* 0x1C */ u16 allocType; // See `ACTOROVL_ALLOC_` defines
|
||||||
|
/* 0x1E */ s8 numLoaded; // original name: "clients"
|
||||||
|
} ActorOverlay; // size = 0x20
|
||||||
|
|
||||||
|
extern ActorOverlay gActorOverlayTable[ACTOR_ID_MAX]; // original name: "actor_dlftbls" 801162A0
|
||||||
|
extern s32 gMaxActorId; // original name: "MaxProfile"
|
||||||
|
|
||||||
|
void ActorOverlayTable_LogPrint(void);
|
||||||
|
void ActorOverlayTable_Init(void);
|
||||||
|
void ActorOverlayTable_Cleanup(void);
|
||||||
|
|
||||||
|
#endif
|
37
include/z_game_dlftbls.h
Normal file
37
include/z_game_dlftbls.h
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
#ifndef Z_GAME_DLFTBLS_H
|
||||||
|
#define Z_GAME_DLFTBLS_H
|
||||||
|
|
||||||
|
#include "ultra64.h"
|
||||||
|
#include "romfile.h"
|
||||||
|
#include "unk.h"
|
||||||
|
|
||||||
|
typedef struct GameStateOverlay {
|
||||||
|
/* 0x00 */ void* loadedRamAddr;
|
||||||
|
/* 0x04 */ RomFile file; // if applicable
|
||||||
|
/* 0x0C */ void* vramStart; // if applicable
|
||||||
|
/* 0x10 */ void* vramEnd; // if applicable
|
||||||
|
/* 0x14 */ void* unk_14;
|
||||||
|
/* 0x18 */ void* init; // initializes and executes the given context
|
||||||
|
/* 0x1C */ void* destroy; // deconstructs the context, and sets the next context to load
|
||||||
|
/* 0x20 */ void* unk_20;
|
||||||
|
/* 0x24 */ void* unk_24;
|
||||||
|
/* 0x28 */ UNK_TYPE4 unk_28;
|
||||||
|
/* 0x2C */ u32 instanceSize;
|
||||||
|
} GameStateOverlay; // size = 0x30
|
||||||
|
|
||||||
|
// 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 GameStateId {
|
||||||
|
#include "tables/gamestate_table.h"
|
||||||
|
GAMESTATE_ID_MAX
|
||||||
|
} GameStateId;
|
||||||
|
#undef DEFINE_GAMESTATE
|
||||||
|
#undef DEFINE_GAMESTATE_INTERNAL
|
||||||
|
|
||||||
|
extern GameStateOverlay gGameStateOverlayTable[GAMESTATE_ID_MAX];
|
||||||
|
|
||||||
|
void Overlay_LoadGameState(GameStateOverlay* overlayEntry);
|
||||||
|
void Overlay_FreeGameState(GameStateOverlay* overlayEntry);
|
||||||
|
|
||||||
|
#endif
|
|
@ -3,6 +3,8 @@
|
||||||
|
|
||||||
#include "ultra64.h"
|
#include "ultra64.h"
|
||||||
|
|
||||||
|
extern s32 gZeldaArenaLogSeverity;
|
||||||
|
|
||||||
void* ZeldaArena_Malloc(u32 size);
|
void* ZeldaArena_Malloc(u32 size);
|
||||||
void* ZeldaArena_MallocR(u32 size);
|
void* ZeldaArena_MallocR(u32 size);
|
||||||
void* ZeldaArena_Realloc(void* ptr, u32 newSize);
|
void* ZeldaArena_Realloc(void* ptr, u32 newSize);
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
|
|
||||||
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
|
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
|
||||||
"ntsc-1.2:76 pal-1.0:74 pal-1.1:74"
|
"ntsc-1.2:86 pal-1.0:84 pal-1.1:84"
|
||||||
|
|
||||||
StackEntry sDmaMgrStackInfo;
|
StackEntry sDmaMgrStackInfo;
|
||||||
OSMesgQueue sDmaMgrMsgQueue;
|
OSMesgQueue sDmaMgrMsgQueue;
|
||||||
|
|
|
@ -40,8 +40,8 @@
|
||||||
* DPad-Up may be pressed to enable sending fault pages over osSyncPrintf as well as displaying them on-screen.
|
* DPad-Up may be pressed to enable sending fault pages over osSyncPrintf as well as displaying them on-screen.
|
||||||
* DPad-Down disables sending fault pages over osSyncPrintf.
|
* DPad-Down disables sending fault pages over osSyncPrintf.
|
||||||
*/
|
*/
|
||||||
#pragma increment_block_number "gc-eu:160 gc-eu-mq:160 gc-eu-mq-dbg:160 gc-jp:160 gc-jp-ce:160 gc-jp-mq:160 gc-us:160" \
|
#pragma increment_block_number "gc-eu:160 gc-eu-mq:160 gc-eu-mq-dbg:160 gc-jp:176 gc-jp-ce:176 gc-jp-mq:176 gc-us:176" \
|
||||||
"gc-us-mq:160 ique-cn:160"
|
"gc-us-mq:176 ique-cn:176"
|
||||||
|
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "libc64/sleep.h"
|
#include "libc64/sleep.h"
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
#include "libc64/sprintf.h"
|
#include "libc64/sprintf.h"
|
||||||
#include "libu64/debug.h"
|
#include "libu64/debug.h"
|
||||||
|
|
||||||
#include "console_logo_state.h"
|
|
||||||
#include "buffers.h"
|
#include "buffers.h"
|
||||||
|
#include "console_logo_state.h"
|
||||||
#include "gfx.h"
|
#include "gfx.h"
|
||||||
#include "fault.h"
|
#include "fault.h"
|
||||||
#include "file_select_state.h"
|
#include "file_select_state.h"
|
||||||
|
@ -14,10 +14,11 @@
|
||||||
#include "regs.h"
|
#include "regs.h"
|
||||||
#include "setup_state.h"
|
#include "setup_state.h"
|
||||||
#include "sys_ucode.h"
|
#include "sys_ucode.h"
|
||||||
#include "title_setup_state.h"
|
|
||||||
#include "terminal.h"
|
#include "terminal.h"
|
||||||
|
#include "title_setup_state.h"
|
||||||
#include "ucode_disas.h"
|
#include "ucode_disas.h"
|
||||||
#include "versions.h"
|
#include "versions.h"
|
||||||
|
#include "z_game_dlftbls.h"
|
||||||
#include "z64save.h"
|
#include "z64save.h"
|
||||||
#include "z64play.h"
|
#include "z64play.h"
|
||||||
|
|
||||||
|
|
|
@ -28,8 +28,8 @@ extern struct IrqMgr gIrqMgr;
|
||||||
|
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
|
|
||||||
#pragma increment_block_number "gc-eu:144 gc-eu-mq:144 gc-jp:144 gc-jp-ce:144 gc-jp-mq:144 gc-us:144 gc-us-mq:144" \
|
#pragma increment_block_number "gc-eu:160 gc-eu-mq:160 gc-jp:160 gc-jp-ce:160 gc-jp-mq:160 gc-us:160 gc-us-mq:160" \
|
||||||
"ique-cn:144 ntsc-1.0:129 ntsc-1.1:129 ntsc-1.2:129 pal-1.0:127 pal-1.1:127"
|
"ique-cn:160 ntsc-1.0:140 ntsc-1.1:140 ntsc-1.2:140 pal-1.0:138 pal-1.1:138"
|
||||||
|
|
||||||
extern u8 _buffersSegmentEnd[];
|
extern u8 _buffersSegmentEnd[];
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
|
#include "console_logo_state.h"
|
||||||
#include "setup_state.h"
|
#include "setup_state.h"
|
||||||
|
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "console_logo_state.h"
|
|
||||||
|
|
||||||
void Setup_InitImpl(SetupState* this) {
|
void Setup_InitImpl(SetupState* this) {
|
||||||
PRINTF(T("ゼルダ共通データ初期化\n", "Zelda common data initialization\n"));
|
PRINTF(T("ゼルダ共通データ初期化\n", "Zelda common data initialization\n"));
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
|
#include "libc64/malloc.h"
|
||||||
#include "libu64/overlay.h"
|
#include "libu64/overlay.h"
|
||||||
|
|
||||||
#include "global.h"
|
|
||||||
#include "terminal.h"
|
#include "terminal.h"
|
||||||
|
#include "ultra64.h"
|
||||||
|
#include "z_game_dlftbls.h"
|
||||||
|
|
||||||
|
#include "macros.h"
|
||||||
|
|
||||||
void Overlay_LoadGameState(GameStateOverlay* overlayEntry) {
|
void Overlay_LoadGameState(GameStateOverlay* overlayEntry) {
|
||||||
if (overlayEntry->loadedRamAddr != NULL) {
|
if (overlayEntry->loadedRamAddr != NULL) {
|
||||||
|
|
|
@ -13,8 +13,10 @@
|
||||||
#include "sys_matrix.h"
|
#include "sys_matrix.h"
|
||||||
#include "terminal.h"
|
#include "terminal.h"
|
||||||
#include "versions.h"
|
#include "versions.h"
|
||||||
|
#include "z_actor_dlftbls.h"
|
||||||
#include "z_lib.h"
|
#include "z_lib.h"
|
||||||
#include "zelda_arena.h"
|
#include "zelda_arena.h"
|
||||||
|
#include "z64actor.h"
|
||||||
#include "z64effect.h"
|
#include "z64effect.h"
|
||||||
#include "z64light.h"
|
#include "z64light.h"
|
||||||
#include "z64horse.h"
|
#include "z64horse.h"
|
||||||
|
@ -32,7 +34,7 @@
|
||||||
#include "assets/objects/object_bdoor/object_bdoor.h"
|
#include "assets/objects/object_bdoor/object_bdoor.h"
|
||||||
|
|
||||||
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
|
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
|
||||||
"ntsc-1.0:0 ntsc-1.1:0 ntsc-1.2:0 pal-1.0:0 pal-1.1:0"
|
"ntsc-1.0:128 ntsc-1.1:0 ntsc-1.2:0 pal-1.0:0 pal-1.1:0"
|
||||||
|
|
||||||
CollisionPoly* sCurCeilingPoly;
|
CollisionPoly* sCurCeilingPoly;
|
||||||
s32 sCurCeilingBgId;
|
s32 sCurCeilingBgId;
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
#include "global.h"
|
|
||||||
#include "fault.h"
|
#include "fault.h"
|
||||||
|
#include "segment_symbols.h"
|
||||||
|
#include "z_actor_dlftbls.h"
|
||||||
|
|
||||||
|
#include "macros.h"
|
||||||
|
|
||||||
// Linker symbol declarations (used in the table below)
|
// Linker symbol declarations (used in the table below)
|
||||||
#define DEFINE_ACTOR(name, _1, _2, _3) DECLARE_OVERLAY_SEGMENT(name)
|
#define DEFINE_ACTOR(name, _1, _2, _3) DECLARE_OVERLAY_SEGMENT(name)
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
#include "z64player.h"
|
#include "z64player.h"
|
||||||
#include "z64skin_matrix.h"
|
#include "z64skin_matrix.h"
|
||||||
|
|
||||||
#pragma increment_block_number "ntsc-1.0:176 ntsc-1.1:176 ntsc-1.2:176"
|
#pragma increment_block_number "ntsc-1.0:184 ntsc-1.1:184 ntsc-1.2:184"
|
||||||
|
|
||||||
u16 DynaSSNodeList_GetNextNodeIdx(DynaSSNodeList* nodeList);
|
u16 DynaSSNodeList_GetNextNodeIdx(DynaSSNodeList* nodeList);
|
||||||
void BgCheck_GetStaticLookupIndicesFromPos(CollisionContext* colCtx, Vec3f* pos, Vec3i* sector);
|
void BgCheck_GetStaticLookupIndicesFromPos(CollisionContext* colCtx, Vec3f* pos, Vec3i* sector);
|
||||||
|
|
|
@ -3642,7 +3642,7 @@ s32 Camera_KeepOn3(Camera* camera) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
|
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
|
||||||
"ique-cn:128 ntsc-1.0:109 ntsc-1.1:109 ntsc-1.2:109 pal-1.0:107 pal-1.1:107"
|
"ique-cn:128 ntsc-1.0:120 ntsc-1.1:120 ntsc-1.2:120 pal-1.0:118 pal-1.1:118"
|
||||||
|
|
||||||
s32 Camera_KeepOn4(Camera* camera) {
|
s32 Camera_KeepOn4(Camera* camera) {
|
||||||
static Vec3f D_8015BD50;
|
static Vec3f D_8015BD50;
|
||||||
|
|
|
@ -144,7 +144,7 @@ u16 gCamAtSplinePointsAppliedFrame;
|
||||||
u16 gCamEyePointAppliedFrame;
|
u16 gCamEyePointAppliedFrame;
|
||||||
u16 gCamAtPointAppliedFrame;
|
u16 gCamAtPointAppliedFrame;
|
||||||
|
|
||||||
#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ique-cn:0" \
|
#pragma increment_block_number "gc-eu:0 gc-eu-mq:128 gc-jp:0 gc-jp-ce:0 gc-jp-mq:128 gc-us:0 gc-us-mq:128 ique-cn:0" \
|
||||||
"ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128 pal-1.0:128 pal-1.1:128"
|
"ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128 pal-1.0:128 pal-1.1:128"
|
||||||
|
|
||||||
// Cam ID to return to when a scripted cutscene is finished
|
// Cam ID to return to when a scripted cutscene is finished
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
#include "libu64/overlay.h"
|
#include "libu64/overlay.h"
|
||||||
#include "global.h"
|
#include "sfx.h"
|
||||||
#include "terminal.h"
|
#include "terminal.h"
|
||||||
|
#include "zelda_arena.h"
|
||||||
#include "z64frame_advance.h"
|
#include "z64frame_advance.h"
|
||||||
|
#include "z64effect.h"
|
||||||
|
#include "z64play.h"
|
||||||
|
|
||||||
EffectSsInfo sEffectSsInfo = { 0 }; // "EffectSS2Info"
|
EffectSsInfo sEffectSsInfo = { 0 }; // "EffectSS2Info"
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
#include "assets/objects/gameplay_keep/gameplay_keep.h"
|
#include "assets/objects/gameplay_keep/gameplay_keep.h"
|
||||||
|
|
||||||
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-eu-mq-dbg:0 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128" \
|
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-eu-mq-dbg:0 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128" \
|
||||||
"gc-us-mq:128 ntsc-1.2:128"
|
"gc-us-mq:128 ntsc-1.0:128 ntsc-1.2:128"
|
||||||
|
|
||||||
#define FLAGS 0
|
#define FLAGS 0
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
#include "setup_state.h"
|
#include "segment_symbols.h"
|
||||||
#include "map_select_state.h"
|
|
||||||
#include "console_logo_state.h"
|
#include "console_logo_state.h"
|
||||||
#include "z64play.h"
|
|
||||||
#include "title_setup_state.h"
|
|
||||||
#include "file_select_state.h"
|
#include "file_select_state.h"
|
||||||
|
#include "map_select_state.h"
|
||||||
#include "global.h"
|
#include "setup_state.h"
|
||||||
|
#include "title_setup_state.h"
|
||||||
|
#include "z_game_dlftbls.h"
|
||||||
|
#include "z64play.h"
|
||||||
|
|
||||||
// Linker symbol declarations (used in the table below)
|
// Linker symbol declarations (used in the table below)
|
||||||
#define DEFINE_GAMESTATE(typeName, enumName, name) DECLARE_OVERLAY_SEGMENT(name)
|
#define DEFINE_GAMESTATE(typeName, enumName, name) DECLARE_OVERLAY_SEGMENT(name)
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
|
#include "libu64/debug.h"
|
||||||
#include "libu64/overlay.h"
|
#include "libu64/overlay.h"
|
||||||
|
#include "kaleido_manager.h"
|
||||||
#include "global.h"
|
#include "segment_symbols.h"
|
||||||
#include "terminal.h"
|
#include "terminal.h"
|
||||||
|
#include "z64play.h"
|
||||||
|
|
||||||
|
#include "macros.h"
|
||||||
|
|
||||||
#define KALEIDO_OVERLAY(name, nameString) \
|
#define KALEIDO_OVERLAY(name, nameString) \
|
||||||
{ NULL, ROM_FILE(ovl_##name), _ovl_##name##SegmentStart, _ovl_##name##SegmentEnd, 0, nameString, }
|
{ NULL, ROM_FILE(ovl_##name), _ovl_##name##SegmentStart, _ovl_##name##SegmentEnd, 0, nameString, }
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#pragma increment_block_number "gc-eu:192 gc-eu-mq:192 gc-jp:192 gc-jp-ce:192 gc-jp-mq:192 gc-us:192 gc-us-mq:192" \
|
#pragma increment_block_number "gc-eu:224 gc-eu-mq:224 gc-jp:224 gc-jp-ce:224 gc-jp-mq:224 gc-us:224 gc-us-mq:224" \
|
||||||
"ique-cn:192 ntsc-1.0:224 ntsc-1.1:224 ntsc-1.2:224 pal-1.0:224 pal-1.1:224"
|
"ique-cn:224 ntsc-1.0:224 ntsc-1.1:224 ntsc-1.2:224 pal-1.0:224 pal-1.1:224"
|
||||||
|
|
||||||
#include "libu64/debug.h"
|
#include "libu64/debug.h"
|
||||||
#include "kaleido_manager.h"
|
#include "kaleido_manager.h"
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include "assets/textures/parameter_static/parameter_static.h"
|
#include "assets/textures/parameter_static/parameter_static.h"
|
||||||
|
|
||||||
#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
|
#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
|
||||||
"ntsc-1.0:192 ntsc-1.1:192 ntsc-1.2:192 pal-1.0:128 pal-1.1:128"
|
"ntsc-1.0:208 ntsc-1.1:208 ntsc-1.2:208 pal-1.0:128 pal-1.1:128"
|
||||||
|
|
||||||
#if !PLATFORM_IQUE
|
#if !PLATFORM_IQUE
|
||||||
#define MSG_BUF_DECODED (msgCtx->msgBufDecoded)
|
#define MSG_BUF_DECODED (msgCtx->msgBufDecoded)
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#include "terminal.h"
|
#include "terminal.h"
|
||||||
#include "title_setup_state.h"
|
#include "title_setup_state.h"
|
||||||
#include "versions.h"
|
#include "versions.h"
|
||||||
|
#include "z_actor_dlftbls.h"
|
||||||
#include "zelda_arena.h"
|
#include "zelda_arena.h"
|
||||||
#include "z64cutscene_flags.h"
|
#include "z64cutscene_flags.h"
|
||||||
#include "z64debug_display.h"
|
#include "z64debug_display.h"
|
||||||
|
@ -35,8 +36,8 @@
|
||||||
|
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
|
|
||||||
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
|
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ique-cn:192" \
|
||||||
"ique-cn:192 ntsc-1.0:144 ntsc-1.1:144 ntsc-1.2:144 pal-1.0:144 pal-1.1:144"
|
"ntsc-1.0:144 ntsc-1.1:144 ntsc-1.2:144 pal-1.0:144 pal-1.1:144"
|
||||||
|
|
||||||
TransitionTile gTransitionTile;
|
TransitionTile gTransitionTile;
|
||||||
s32 gTransitionTileState;
|
s32 gTransitionTileState;
|
||||||
|
@ -325,7 +326,7 @@ void Play_Init(GameState* thisx) {
|
||||||
Camera_OverwriteStateFlags(&this->mainCamera, CAM_STATE_CHECK_BG_ALT | CAM_STATE_CHECK_WATER | CAM_STATE_CHECK_BG |
|
Camera_OverwriteStateFlags(&this->mainCamera, CAM_STATE_CHECK_BG_ALT | CAM_STATE_CHECK_WATER | CAM_STATE_CHECK_BG |
|
||||||
CAM_STATE_EXTERNAL_FINISHED | CAM_STATE_CAM_FUNC_FINISH |
|
CAM_STATE_EXTERNAL_FINISHED | CAM_STATE_CAM_FUNC_FINISH |
|
||||||
CAM_STATE_LOCK_MODE | CAM_STATE_DISTORTION | CAM_STATE_PLAY_INIT);
|
CAM_STATE_LOCK_MODE | CAM_STATE_DISTORTION | CAM_STATE_PLAY_INIT);
|
||||||
Sram_Init(this, &this->sramCtx);
|
Sram_Init(&this->state, &this->sramCtx);
|
||||||
Regs_InitData(this);
|
Regs_InitData(this);
|
||||||
Message_Init(this);
|
Message_Init(this);
|
||||||
GameOver_Init(this);
|
GameOver_Init(this);
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
|
#include "gfx.h"
|
||||||
|
#include "gfx_setupdl.h"
|
||||||
#include "prenmi_state.h"
|
#include "prenmi_state.h"
|
||||||
|
#include "regs.h"
|
||||||
#include "global.h"
|
|
||||||
#include "terminal.h"
|
#include "terminal.h"
|
||||||
#include "versions.h"
|
#include "versions.h"
|
||||||
|
|
||||||
|
#include "macros.h"
|
||||||
|
#include "global.h"
|
||||||
|
|
||||||
void func_80092320(PreNMIState* this) {
|
void func_80092320(PreNMIState* this) {
|
||||||
this->state.running = false;
|
this->state.running = false;
|
||||||
this->state.init = NULL;
|
this->state.init = NULL;
|
||||||
|
|
|
@ -1,6 +1,11 @@
|
||||||
|
#include "gfx.h"
|
||||||
|
#include "gfx_setupdl.h"
|
||||||
|
#include "controller.h"
|
||||||
|
#include "regs.h"
|
||||||
#include "sample_state.h"
|
#include "sample_state.h"
|
||||||
|
#include "segment_symbols.h"
|
||||||
#include "global.h"
|
#include "z64dma.h"
|
||||||
|
#include "z64play.h"
|
||||||
|
|
||||||
void Sample_HandleStateChange(SampleState* this) {
|
void Sample_HandleStateChange(SampleState* this) {
|
||||||
if (CHECK_BTN_ALL(this->state.input[0].press.button, BTN_START)) {
|
if (CHECK_BTN_ALL(this->state.input[0].press.button, BTN_START)) {
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#include "seqcmd.h"
|
#include "seqcmd.h"
|
||||||
#include "terminal.h"
|
#include "terminal.h"
|
||||||
#include "versions.h"
|
#include "versions.h"
|
||||||
|
#include "z_actor_dlftbls.h"
|
||||||
#include "z64save.h"
|
#include "z64save.h"
|
||||||
|
|
||||||
SceneCmdHandlerFunc sSceneCmdHandlers[SCENE_CMD_ID_MAX];
|
SceneCmdHandlerFunc sSceneCmdHandlers[SCENE_CMD_ID_MAX];
|
||||||
|
|
|
@ -1,10 +1,16 @@
|
||||||
#include "file_select_state.h"
|
#include "file_select_state.h"
|
||||||
#include "global.h"
|
#include "controller.h"
|
||||||
#include "terminal.h"
|
#include "terminal.h"
|
||||||
#include "versions.h"
|
#include "versions.h"
|
||||||
|
#include "z64game.h"
|
||||||
|
#include "z64message.h"
|
||||||
#include "z64save.h"
|
#include "z64save.h"
|
||||||
|
#include "z64scene.h"
|
||||||
|
#include "z64sram.h"
|
||||||
#include "z64ss_sram.h"
|
#include "z64ss_sram.h"
|
||||||
|
|
||||||
|
#include "global.h"
|
||||||
|
|
||||||
#define SLOT_SIZE (sizeof(SaveContext) + 0x28)
|
#define SLOT_SIZE (sizeof(SaveContext) + 0x28)
|
||||||
#define CHECKSUM_SIZE (sizeof(Save) / 2)
|
#define CHECKSUM_SIZE (sizeof(Save) / 2)
|
||||||
|
|
||||||
|
@ -1060,5 +1066,5 @@ void Sram_Alloc(GameState* gameState, SramContext* sramCtx) {
|
||||||
ASSERT(sramCtx->readBuff != NULL, "sram->read_buff != NULL", "../z_sram.c", 1295);
|
ASSERT(sramCtx->readBuff != NULL, "sram->read_buff != NULL", "../z_sram.c", 1295);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Sram_Init(PlayState* play, SramContext* sramCtx) {
|
void Sram_Init(GameState* gameState, SramContext* sramCtx) {
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#include "libu64/overlay.h"
|
#include "libu64/overlay.h"
|
||||||
|
#include "ultra64.h"
|
||||||
|
#include "z64dma.h"
|
||||||
|
|
||||||
#include "global.h"
|
#include "macros.h"
|
||||||
|
|
||||||
size_t Overlay_Load(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, void* vramEnd, void* allocatedRamAddr) {
|
size_t Overlay_Load(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, void* vramEnd, void* allocatedRamAddr) {
|
||||||
s32 pad[3];
|
s32 pad[3];
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
|
#include "libc64/malloc.h"
|
||||||
#include "libu64/overlay.h"
|
#include "libu64/overlay.h"
|
||||||
|
|
||||||
#include "global.h"
|
#include "macros.h"
|
||||||
|
|
||||||
void* Overlay_AllocateAndLoad(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, void* vramEnd) {
|
void* Overlay_AllocateAndLoad(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, void* vramEnd) {
|
||||||
void* allocatedRamAddr = SYSTEM_ARENA_MALLOC_R((intptr_t)vramEnd - (intptr_t)vramStart, "../loadfragment2.c", 31);
|
void* allocatedRamAddr = SYSTEM_ARENA_MALLOC_R((intptr_t)vramEnd - (intptr_t)vramStart, "../loadfragment2.c", 31);
|
||||||
|
|
|
@ -6,9 +6,11 @@
|
||||||
*
|
*
|
||||||
* @see Overlay_Relocate
|
* @see Overlay_Relocate
|
||||||
*/
|
*/
|
||||||
|
#include "libc64/malloc.h"
|
||||||
#include "libu64/overlay.h"
|
#include "libu64/overlay.h"
|
||||||
|
#include "z64dma.h"
|
||||||
|
|
||||||
#include "global.h"
|
#include "macros.h"
|
||||||
|
|
||||||
s32 gOverlayLogSeverity = 2;
|
s32 gOverlayLogSeverity = 2;
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
#include "global.h"
|
#include "libu64/overlay.h"
|
||||||
|
|
||||||
s32 gOverlayLogSeverity = 2;
|
s32 gOverlayLogSeverity = 2;
|
||||||
|
|
|
@ -7,8 +7,10 @@
|
||||||
* @see Overlay_Relocate
|
* @see Overlay_Relocate
|
||||||
*/
|
*/
|
||||||
#include "libu64/overlay.h"
|
#include "libu64/overlay.h"
|
||||||
|
#include "attributes.h"
|
||||||
|
#include "ultra64.h"
|
||||||
|
|
||||||
#include "global.h"
|
#include "macros.h"
|
||||||
|
|
||||||
// Extract MIPS register rs from an instruction word
|
// Extract MIPS register rs from an instruction word
|
||||||
#define MIPS_REG_RS(insn) (((insn) >> 0x15) & 0x1F)
|
#define MIPS_REG_RS(insn) (((insn) >> 0x15) & 0x1F)
|
||||||
|
|
|
@ -24,6 +24,8 @@
|
||||||
|
|
||||||
#include "assets/objects/object_ddan_objects/object_ddan_objects.h"
|
#include "assets/objects/object_ddan_objects/object_ddan_objects.h"
|
||||||
|
|
||||||
|
#pragma increment_block_number "ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128 pal-1.0:128 pal-1.1:128"
|
||||||
|
|
||||||
#define FLAGS 0
|
#define FLAGS 0
|
||||||
|
|
||||||
void BgDodoago_Init(Actor* thisx, PlayState* play);
|
void BgDodoago_Init(Actor* thisx, PlayState* play);
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
#include "file_select_state.h"
|
|
||||||
#include "file_select.h"
|
#include "file_select.h"
|
||||||
|
#include "file_select_state.h"
|
||||||
|
|
||||||
#include "attributes.h"
|
#include "attributes.h"
|
||||||
|
#include "controller.h"
|
||||||
#include "gfx.h"
|
#include "gfx.h"
|
||||||
#include "gfx_setupdl.h"
|
#include "gfx_setupdl.h"
|
||||||
#include "letterbox.h"
|
#include "letterbox.h"
|
||||||
|
@ -11,6 +12,8 @@
|
||||||
#include "n64dd.h"
|
#include "n64dd.h"
|
||||||
#endif
|
#endif
|
||||||
#include "regs.h"
|
#include "regs.h"
|
||||||
|
#include "rumble.h"
|
||||||
|
#include "segment_symbols.h"
|
||||||
#include "seqcmd.h"
|
#include "seqcmd.h"
|
||||||
#include "sequence.h"
|
#include "sequence.h"
|
||||||
#include "sfx.h"
|
#include "sfx.h"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#include "file_select_state.h"
|
|
||||||
#include "file_select.h"
|
#include "file_select.h"
|
||||||
|
#include "file_select_state.h"
|
||||||
|
|
||||||
#include "controller.h"
|
#include "controller.h"
|
||||||
#include "regs.h"
|
#include "regs.h"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#include "file_select_state.h"
|
|
||||||
#include "file_select.h"
|
#include "file_select.h"
|
||||||
|
#include "file_select_state.h"
|
||||||
|
|
||||||
#include "controller.h"
|
#include "controller.h"
|
||||||
#include "gfx.h"
|
#include "gfx.h"
|
||||||
|
|
|
@ -4,11 +4,15 @@
|
||||||
* Description: Initializes the game into the title screen
|
* Description: Initializes the game into the title screen
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "gfx.h"
|
||||||
|
#include "regs.h"
|
||||||
|
#include "sys_matrix.h"
|
||||||
#include "title_setup_state.h"
|
#include "title_setup_state.h"
|
||||||
|
#include "z64game.h"
|
||||||
#include "global.h"
|
#include "z64play.h"
|
||||||
#include "z64save.h"
|
#include "z64save.h"
|
||||||
#include "z64sram.h"
|
#include "z64sram.h"
|
||||||
|
#include "z64view.h"
|
||||||
|
|
||||||
void TitleSetup_SetupTitleScreen(TitleSetupState* this) {
|
void TitleSetup_SetupTitleScreen(TitleSetupState* this) {
|
||||||
gSaveContext.gameMode = GAMEMODE_TITLE_SCREEN;
|
gSaveContext.gameMode = GAMEMODE_TITLE_SCREEN;
|
||||||
|
|
|
@ -4,21 +4,29 @@
|
||||||
* Description: Debug Scene Select Menu
|
* Description: Debug Scene Select Menu
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "map_select_state.h"
|
#include "libc64/qrand.h"
|
||||||
|
#include "libu64/gfxprint.h"
|
||||||
#include "ultra64.h"
|
#include "ultra64.h"
|
||||||
#include "alloca.h"
|
#include "alloca.h"
|
||||||
#include "console_logo_state.h"
|
#include "console_logo_state.h"
|
||||||
|
#include "controller.h"
|
||||||
|
#include "gfx.h"
|
||||||
|
#include "gfx_setupdl.h"
|
||||||
|
#include "map_select_state.h"
|
||||||
#if PLATFORM_N64
|
#if PLATFORM_N64
|
||||||
#include "n64dd.h"
|
#include "n64dd.h"
|
||||||
#endif
|
#endif
|
||||||
|
#include "regs.h"
|
||||||
|
#include "segment_symbols.h"
|
||||||
#include "seqcmd.h"
|
#include "seqcmd.h"
|
||||||
#include "sequence.h"
|
#include "sequence.h"
|
||||||
|
#include "sfx.h"
|
||||||
#include "terminal.h"
|
#include "terminal.h"
|
||||||
|
#include "z64play.h"
|
||||||
#include "z64save.h"
|
#include "z64save.h"
|
||||||
#include "z64sram.h"
|
#include "z64sram.h"
|
||||||
|
|
||||||
#include "global.h"
|
#include "macros.h"
|
||||||
|
|
||||||
void MapSelect_LoadTitle(MapSelectState* this) {
|
void MapSelect_LoadTitle(MapSelectState* this) {
|
||||||
this->state.running = false;
|
this->state.running = false;
|
||||||
|
|
|
@ -4,19 +4,28 @@
|
||||||
* Description: Displays the Nintendo Logo
|
* Description: Displays the Nintendo Logo
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "console_logo_state.h"
|
#include "libu64/gfxprint.h"
|
||||||
|
|
||||||
#include "global.h"
|
|
||||||
#include "alloca.h"
|
|
||||||
#include "title_setup_state.h"
|
|
||||||
#include "versions.h"
|
|
||||||
|
|
||||||
#if PLATFORM_N64
|
#if PLATFORM_N64
|
||||||
#include "cic6105.h"
|
#include "cic6105.h"
|
||||||
#include "n64dd.h"
|
#include "n64dd.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "alloca.h"
|
||||||
|
#include "console_logo_state.h"
|
||||||
|
#include "gfx.h"
|
||||||
|
#include "gfx_setupdl.h"
|
||||||
|
#include "regs.h"
|
||||||
|
#include "segment_symbols.h"
|
||||||
|
#include "sequence.h"
|
||||||
|
#include "sys_matrix.h"
|
||||||
|
#include "title_setup_state.h"
|
||||||
|
#include "versions.h"
|
||||||
|
#include "z64actor.h"
|
||||||
|
#include "z64environment.h"
|
||||||
#include "z64save.h"
|
#include "z64save.h"
|
||||||
|
|
||||||
|
#include "global.h"
|
||||||
|
|
||||||
#include "assets/textures/nintendo_rogo_static/nintendo_rogo_static.h"
|
#include "assets/textures/nintendo_rogo_static/nintendo_rogo_static.h"
|
||||||
|
|
||||||
#if DEBUG_FEATURES
|
#if DEBUG_FEATURES
|
||||||
|
|
Loading…
Add table
Reference in a new issue