diff options
| author | mzxrules <mzxrules@gmail.com> | 2025-02-26 17:18:30 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-26 17:18:30 -0500 |
| commit | cf1a39c26fca0f7827fef79d08b114fde1c43cce (patch) | |
| tree | ccbebda2637107cf2c2742639f0f808ec4374c47 /include | |
| parent | 2b30c61a2698862e3debd50c2be193df23f9e8b5 (diff) | |
Reduce dependencies on global.h (10) (#2490)
* reduce z64.h size
* fix z_cheap_proc.inc.c
* ,bss
* remove temp delcaration
Diffstat (limited to 'include')
| -rw-r--r-- | include/db_camera.h | 88 | ||||
| -rw-r--r-- | include/functions.h | 16 | ||||
| -rw-r--r-- | include/irqmgr.h | 2 | ||||
| -rw-r--r-- | include/line_numbers.h | 2 | ||||
| -rw-r--r-- | include/listalloc.h | 16 | ||||
| -rw-r--r-- | include/map.h | 2 | ||||
| -rw-r--r-- | include/prerender.h | 6 | ||||
| -rw-r--r-- | include/speed_meter.h | 16 | ||||
| -rw-r--r-- | include/sys_debug_controller.h | 13 | ||||
| -rw-r--r-- | include/sys_freeze.h | 8 | ||||
| -rw-r--r-- | include/ultra64/pi.h | 1 | ||||
| -rw-r--r-- | include/variables.h | 27 | ||||
| -rw-r--r-- | include/z64.h | 39 | ||||
| -rw-r--r-- | include/z64actor.h | 34 | ||||
| -rw-r--r-- | include/z64camera.h | 77 | ||||
| -rw-r--r-- | include/z64sram.h | 4 | ||||
| -rw-r--r-- | include/z64vis.h | 3 | ||||
| -rw-r--r-- | include/z_en_a_obj.h | 41 | ||||
| -rw-r--r-- | include/z_game_dlftbls.h | 3 | ||||
| -rw-r--r-- | include/z_locale.h | 12 |
20 files changed, 209 insertions, 201 deletions
diff --git a/include/db_camera.h b/include/db_camera.h new file mode 100644 index 000000000..81d8515d0 --- /dev/null +++ b/include/db_camera.h @@ -0,0 +1,88 @@ +#ifndef DB_CAMERA_H +#define DB_CAMERA_H + +#include "ultra64.h" +#include "z64cutscene.h" +#include "z64math.h" + +struct Camera; + +typedef struct DebugCamSub { + /* 0x0000 */ s16 mode; + /* 0x0002 */ s16 nFrames; + /* 0x0004 */ s16 nPoints; + /* 0x0006 */ s16 unkIdx; + /* 0x0008 */ s16 unk_08; + /* 0x000A */ s16 unk_0A; + /* 0x000C */ s32 unk_0C; // bool: indicates position vs lookAt? + /* 0x0010 */ char unk_10[0x14]; + /* 0x0024 */ CutsceneCameraPoint position[129]; + /* 0x0834 */ CutsceneCameraPoint lookAt[129]; + /* 0x1044 */ s16 demoCtrlMenu; + /* 0x1046 */ s16 demoCtrlActionIdx; // e (?), s (save), l (load), c (clear) + /* 0x1048 */ s16 demoCtrlToggleSwitch; + /* 0x104A */ Vec3s unk_104A; +} DebugCamSub; // size = 0x1050 + +typedef struct DebugCam { + /* 0x00 */ s32 unk_00; + /* 0x04 */ Vec3f at; + /* 0x10 */ Vec3f eye; + /* 0x1C */ Vec3f unk_1C; + /* 0x28 */ char unk_28[0xC]; + /* 0x34 */ s32 unk_34; + /* 0x38 */ s32 unk_38; + /* 0x3C */ s32 unk_3C; // bool + /* 0x40 */ s32 unk_40; + /* 0x44 */ s32 unk_44; + /* 0x48 */ f32 fov; + /* 0x4C */ s16 roll; + /* 0x4E */ char unk_4E[0x2]; + /* 0x50 */ f32 rollDegrees; + /* 0x54 */ Vec3f unk_54; + /* 0x60 */ Vec3f unk_60; + /* 0x6C */ Vec3f unk_6C; + /* 0x78 */ s16 unk_78; + /* 0x7A */ s16 unk_7A; + /* 0x7C */ DebugCamSub sub; +} DebugCam; // size = 0x10CC + +typedef struct DebugCamCut { + /* 0x00 */ char letter; + /* 0x01 */ u8 unk_01; + /* 0x02 */ s16 mode; + /* 0x04 */ CutsceneCameraPoint* position; + /* 0x08 */ CutsceneCameraPoint* lookAt; + /* 0x0C */ s16 nFrames; + /* 0x0E */ s16 nPoints; +} DebugCamCut; // size = 0x10 + +typedef struct DebugCamAnim { + /* 0x00 */ f32 curFrame; + /* 0x04 */ f32 unk_04; // frame count? + /* 0x08 */ s16 keyframe; + /* 0x0A */ s16 unk_0A; + /* 0x0C */ s16 unk_0C; + /* 0x10 */ Vec3f positionPos; // confusing name + /* 0x1C */ Vec3f lookAtPos; + /* 0x28 */ f32 roll; + /* 0x2C */ f32 fov; +} DebugCamAnim; // size = 0x30 + +typedef enum DebugCamTextColor { + /* 0 */ DEBUG_CAM_TEXT_YELLOW, + /* 1 */ DEBUG_CAM_TEXT_PEACH, + /* 2 */ DEBUG_CAM_TEXT_BROWN, + /* 3 */ DEBUG_CAM_TEXT_ORANGE, + /* 4 */ DEBUG_CAM_TEXT_GOLD, + /* 5 */ DEBUG_CAM_TEXT_WHITE, + /* 6 */ DEBUG_CAM_TEXT_BLUE, + /* 7 */ DEBUG_CAM_TEXT_GREEN +} DebugCamTextColor; + +void DebugCamera_Init(DebugCam* debugCam, struct Camera* cameraPtr); +void DebugCamera_Enable(DebugCam* debugCam, struct Camera* cam); +void DebugCamera_Update(DebugCam* debugCam, struct Camera* cam); +void DebugCamera_Reset(struct Camera* cam, DebugCam* debugCam); + +#endif diff --git a/include/functions.h b/include/functions.h index e5d15c10e..63255443d 100644 --- a/include/functions.h +++ b/include/functions.h @@ -14,8 +14,6 @@ void Yaz0_Decompress(uintptr_t romStart, u8* dst, size_t size); #else void gzip_decompress(uintptr_t romStart, u8* dst, size_t size); #endif -void Locale_Init(void); -void Locale_ResetRegion(void); #if DEBUG_FEATURES void isPrintfInit(void); #endif @@ -77,11 +75,6 @@ s32 TransitionFade_IsDone(void* thisx); void TransitionFade_SetColor(void* thisx, u32 color); void TransitionFade_SetType(void* thisx, s32 type); -void DebugCamera_Init(DebugCam* debugCam, Camera* cameraPtr); -void DebugCamera_Enable(DebugCam* debugCam, Camera* cam); -void DebugCamera_Update(DebugCam* debugCam, Camera* cam); -void DebugCamera_Reset(Camera* cam, DebugCam* debugCam); - void PreRender_SetValuesSave(PreRender* this, u32 width, u32 height, void* fbuf, void* zbuf, void* cvg); void PreRender_Init(PreRender* this); void PreRender_SetValues(PreRender* this, u32 width, u32 height, void* fbuf, void* zbuf); @@ -98,19 +91,10 @@ void PreRender_CopyImageRegion(PreRender* this, Gfx** gfxP); void PreRender_ApplyFilters(PreRender* this); void Graph_ThreadEntry(void*); -ListAlloc* ListAlloc_Init(ListAlloc* this); -void* ListAlloc_Alloc(ListAlloc* this, u32 size); -void ListAlloc_Free(ListAlloc* this, void* data); -void ListAlloc_FreeAll(ListAlloc* this); - void SysCfb_Init(s32 n64dd); void* SysCfb_GetFbPtr(s32 idx); void* SysCfb_GetFbEnd(void); -NORETURN void func_800D31A0(void); -void func_800D31F0(void); -void func_800D3210(void); - void RcpUtils_PrintRegisterStatus(void); void RcpUtils_Reset(void); diff --git a/include/irqmgr.h b/include/irqmgr.h index b931977ab..b841fb141 100644 --- a/include/irqmgr.h +++ b/include/irqmgr.h @@ -46,4 +46,6 @@ void IrqMgr_RemoveClient(IrqMgr* irqMgr, IrqMgrClient* client); extern vu32 gIrqMgrResetStatus; extern volatile OSTime gIrqMgrRetraceTime; +extern IrqMgr gIrqMgr; + #endif diff --git a/include/line_numbers.h b/include/line_numbers.h index bc11d555d..adc2d654d 100644 --- a/include/line_numbers.h +++ b/include/line_numbers.h @@ -1,6 +1,8 @@ #ifndef LINE_NUMBERS_H #define LINE_NUMBERS_H +#include "versions.h" + // The macros in this file serve to reduce clutter from version differences that are only due to line numbers being different. // The "LN" macros defined here are not meant to be used directly. See the wrapper macros below. diff --git a/include/listalloc.h b/include/listalloc.h new file mode 100644 index 000000000..76321a3e8 --- /dev/null +++ b/include/listalloc.h @@ -0,0 +1,16 @@ +#ifndef LISTALLOC_H +#define LISTALLOC_H + +#include "ultra64/ultratypes.h" + +typedef struct ListAlloc { + /* 0x00 */ struct ListAlloc* prev; + /* 0x04 */ struct ListAlloc* next; +} ListAlloc; // size = 0x8 + +ListAlloc* ListAlloc_Init(ListAlloc* this); +void* ListAlloc_Alloc(ListAlloc* this, u32 size); +void ListAlloc_Free(ListAlloc* this, void* data); +void ListAlloc_FreeAll(ListAlloc* this); + +#endif diff --git a/include/map.h b/include/map.h index 23d3eb3c8..88c5d9279 100644 --- a/include/map.h +++ b/include/map.h @@ -67,6 +67,8 @@ typedef struct MapData { #define MAP_48x85_TEX_HEIGHT 85 #define MAP_48x85_TEX_SIZE ((MAP_48x85_TEX_WIDTH * MAP_48x85_TEX_HEIGHT) / 2) // 48x85 CI4 texture +extern MapData gMapDataTable; + void Map_SavePlayerInitialInfo(struct PlayState* play); void Map_SetFloorPalettesData(struct PlayState* play, s16 floor); void Map_InitData(struct PlayState* play, s16 room); diff --git a/include/prerender.h b/include/prerender.h index ca1682634..4231234a8 100644 --- a/include/prerender.h +++ b/include/prerender.h @@ -2,11 +2,7 @@ #define PRERENDER_H #include "ultra64/ultratypes.h" - -typedef struct ListAlloc { - /* 0x00 */ struct ListAlloc* prev; - /* 0x04 */ struct ListAlloc* next; -} ListAlloc; // size = 0x8 +#include "listalloc.h" typedef struct PreRender { /* 0x00 */ s32 width; diff --git a/include/speed_meter.h b/include/speed_meter.h index 393c89de8..f8779902f 100644 --- a/include/speed_meter.h +++ b/include/speed_meter.h @@ -1,7 +1,7 @@ #ifndef SPEEDMETER_H #define SPEEDMETER_H -#include "ultra64/ultratypes.h" +#include "ultra64.h" struct GraphicsContext; struct GameState; @@ -12,6 +12,20 @@ typedef struct SpeedMeter { /* 0x1C */ s32 y; } SpeedMeter; // size = 0x20 +extern volatile OSTime gAudioThreadUpdateTimeTotalPerGfxTask; +extern volatile OSTime gGfxTaskSentToNextReadyMinusAudioThreadUpdateTime; +extern volatile OSTime gRSPAudioTimeTotal; +extern volatile OSTime gRSPGfxTimeTotal; +extern volatile OSTime gRDPTimeTotal; +extern volatile OSTime gGraphUpdatePeriod; +extern volatile OSTime gAudioThreadUpdateTimeStart; +extern volatile OSTime gAudioThreadUpdateTimeAcc; +extern volatile OSTime gRSPAudioTimeAcc; +extern volatile OSTime gRSPGfxTimeAcc; +extern volatile OSTime gRSPOtherTimeAcc; +extern volatile OSTime D_8016A578; +extern volatile OSTime gRDPTimeAcc; + void SpeedMeter_Init(SpeedMeter* this); void SpeedMeter_Destroy(SpeedMeter* this); void SpeedMeter_DrawTimeEntries(SpeedMeter* this, struct GraphicsContext* gfxCtx); diff --git a/include/sys_debug_controller.h b/include/sys_debug_controller.h new file mode 100644 index 000000000..0345d85aa --- /dev/null +++ b/include/sys_debug_controller.h @@ -0,0 +1,13 @@ +#ifndef SYS_DEBUG_CONTROLLER_H +#define SYS_DEBUG_CONTROLLER_H + +#include "ultra64/ultratypes.h" + +#if DEBUG_FEATURES +extern u32 gIsCtrlr2Valid; + +void func_800D31F0(void); +void func_800D3210(void); +#endif + +#endif diff --git a/include/sys_freeze.h b/include/sys_freeze.h new file mode 100644 index 000000000..0e033cacd --- /dev/null +++ b/include/sys_freeze.h @@ -0,0 +1,8 @@ +#ifndef SYS_FREEZE_H +#define SYS_FREEZE_H + +#include "attributes.h" + +NORETURN void func_800D31A0(void); + +#endif diff --git a/include/ultra64/pi.h b/include/ultra64/pi.h index af18c407e..42a90d760 100644 --- a/include/ultra64/pi.h +++ b/include/ultra64/pi.h @@ -1,6 +1,7 @@ #ifndef ULTRA64_PI_H #define ULTRA64_PI_H +#include "stddef.h" #include "message.h" typedef struct __OSBlockInfo { diff --git a/include/variables.h b/include/variables.h index ea5d188a6..612b3051b 100644 --- a/include/variables.h +++ b/include/variables.h @@ -5,6 +5,8 @@ #include "libc64/os_malloc.h" #include "segment_symbols.h" +struct MapData; + extern void* osRomBase; extern s32 osTvType; extern u32 osRomType; @@ -32,7 +34,6 @@ extern u32 gViConfigFeatures; extern f32 gViConfigXScale; extern f32 gViConfigYScale; extern OSPiHandle* gCartHandle; -extern s32 gCurrentRegion; extern u32 __osPiAccessQueueEnabled; extern OSViMode osViModePalLan1; extern s32 osViClock; @@ -65,19 +66,14 @@ extern OSTime __osCurrentTime; extern u32 __osBaseCounter; extern u32 __osViIntrCount; extern u32 __osTimerCounter; -extern MapData gMapDataTable; extern s16 gSpoilingItems[3]; extern s16 gSpoilingItemReverts[3]; -extern u16 gSramSlotOffsets[]; // 4 16-colors palettes extern u64 gMojiFontTLUTs[4][4]; // original name: "moji_tlut" extern u64 gMojiFontTex[]; // original name: "font_ff" extern u8 gBossMarkState; -#if DEBUG_FEATURES -extern u32 gIsCtrlr2Valid; -#endif extern s16* gWaveSamples[9]; extern f32 gBendPitchOneOctaveFrequencies[256]; extern f32 gBendPitchTwoSemitonesFrequencies[256]; @@ -142,28 +138,11 @@ extern u8 gSequenceFontTable[]; extern u8 gSequenceTable[]; extern AudioTable gSampleBankTable; -extern MapData* gMapData; +extern struct MapData* gMapData; extern f32 gBossMarkScale; extern u32 D_8016139C; extern PauseMapMarksData* gLoadedPauseMarkDataTable; -extern Scheduler gScheduler; -extern PadMgr gPadMgr; -extern IrqMgr gIrqMgr; -extern volatile OSTime gAudioThreadUpdateTimeTotalPerGfxTask; -extern volatile OSTime gGfxTaskSentToNextReadyMinusAudioThreadUpdateTime; -extern volatile OSTime gRSPAudioTimeTotal; -extern volatile OSTime gRSPGfxTimeTotal; -extern volatile OSTime gRDPTimeTotal; -extern volatile OSTime gGraphUpdatePeriod; -extern volatile OSTime gAudioThreadUpdateTimeStart; -extern volatile OSTime gAudioThreadUpdateTimeAcc; -extern volatile OSTime gRSPAudioTimeAcc; -extern volatile OSTime gRSPGfxTimeAcc; -extern volatile OSTime gRSPOtherTimeAcc; -extern volatile OSTime D_8016A578; -extern volatile OSTime gRDPTimeAcc; - extern SfxBankEntry D_8016BAD0[9]; extern SfxBankEntry D_8016BC80[12]; extern SfxBankEntry D_8016BEC0[22]; diff --git a/include/z64.h b/include/z64.h index 64bb5984c..a0ba2873d 100644 --- a/include/z64.h +++ b/include/z64.h @@ -4,8 +4,6 @@ #include "ultra64.h" #include "ultra64/gs2dex.h" #include "attributes.h" -#include "audiomgr.h" -#include "controller.h" #include "versions.h" #include "z64player.h" #include "z64audio.h" @@ -14,49 +12,14 @@ #include "z64effect.h" #include "z64animation.h" #include "z64animation_legacy.h" -#include "letterbox.h" -#include "z64math.h" -#include "z64map_mark.h" -#include "one_point_cutscene.h" #include "z64play.h" #include "z64skin.h" #include "z64skin_matrix.h" -#include "z64vis.h" -#include "zelda_arena.h" #include "alignment.h" #include "audiothread_cmd.h" #include "sfx.h" #include "color.h" -#include "libu64/gfxprint.h" -#include "z_lib.h" -#include "regs.h" -#include "irqmgr.h" -#include "padmgr.h" -#include "sched.h" -#include "rumble.h" -#include "map.h" -#include "mempak.h" -#include "tha.h" -#include "thga.h" -#include "speed_meter.h" -#include "gfx.h" -#include "gfx_setupdl.h" -#include "gfxalloc.h" -#include "prerender.h" -#include "rand.h" -#include "sys_math.h" -#include "sys_math3d.h" -#include "libc64/math64.h" -#include "sys_matrix.h" -#include "main.h" -#include "segmented_address.h" -#include "stackcheck.h" -#include "kaleido_manager.h" -#include "libc64/aprintf.h" -#include "libc64/malloc.h" -#include "libc64/sleep.h" -#include "libc64/sprintf.h" -#include "libu64/debug.h" +#include "sys_matrix.h" // in room assets, gIdentityMtx // TODO: include all files listed above into the right place, and then delete this file. diff --git a/include/z64actor.h b/include/z64actor.h index 8986c801c..2709356b9 100644 --- a/include/z64actor.h +++ b/include/z64actor.h @@ -291,40 +291,6 @@ typedef struct BodyBreak { #define BODYBREAK_STATUS_READY -1 #define BODYBREAK_STATUS_FINISHED 0 -// Only A_OBJ_SIGNPOST_OBLONG and A_OBJ_SIGNPOST_ARROW are used in room files. -typedef enum AObjType { - /* 0x00 */ A_OBJ_BLOCK_SMALL, - /* 0x01 */ A_OBJ_BLOCK_LARGE, - /* 0x02 */ A_OBJ_BLOCK_HUGE, - /* 0x03 */ A_OBJ_BLOCK_SMALL_ROT, - /* 0x04 */ A_OBJ_BLOCK_LARGE_ROT, - /* 0x05 */ A_OBJ_CUBE_SMALL, - /* 0x06 */ A_OBJ_UNKNOWN_6, - /* 0x07 */ A_OBJ_GRASS_CLUMP, - /* 0x08 */ A_OBJ_TREE_STUMP, - /* 0x09 */ A_OBJ_SIGNPOST_OBLONG, - /* 0x0A */ A_OBJ_SIGNPOST_ARROW, - /* 0x0B */ A_OBJ_BOULDER_FRAGMENT, - /* 0x0C */ A_OBJ_MAX -} AObjType; - -struct EnAObj; - -typedef void (*EnAObjActionFunc)(struct EnAObj*, struct PlayState*); - -typedef struct EnAObj { - /* 0x000 */ DynaPolyActor dyna; - /* 0x164 */ EnAObjActionFunc actionFunc; - /* 0x168 */ s32 rotateWaitTimer; - /* 0x16C */ s16 textId; - /* 0x16E */ s16 rotateState; - /* 0x170 */ s16 rotateForTimer; - /* 0x172 */ s16 rotSpeedY; - /* 0x174 */ s16 rotSpeedX; - /* 0x178 */ f32 focusYoffset; - /* 0x17C */ ColliderCylinder collider; -} EnAObj; // size = 0x1C8 - typedef enum DoorLockType { DOORLOCK_NORMAL, DOORLOCK_BOSS, diff --git a/include/z64camera.h b/include/z64camera.h index f36cb8e07..2fcbffdf5 100644 --- a/include/z64camera.h +++ b/include/z64camera.h @@ -1621,83 +1621,6 @@ typedef struct Camera { /* 0x16A */ s16 unk_16A; } Camera; // size = 0x16C -/** - * Debug Camera -*/ - -typedef struct DebugCamSub { - /* 0x0000 */ s16 mode; - /* 0x0002 */ s16 nFrames; - /* 0x0004 */ s16 nPoints; - /* 0x0006 */ s16 unkIdx; - /* 0x0008 */ s16 unk_08; - /* 0x000A */ s16 unk_0A; - /* 0x000C */ s32 unk_0C; // bool: indicates position vs lookAt? - /* 0x0010 */ char unk_10[0x14]; - /* 0x0024 */ CutsceneCameraPoint position[129]; - /* 0x0834 */ CutsceneCameraPoint lookAt[129]; - /* 0x1044 */ s16 demoCtrlMenu; - /* 0x1046 */ s16 demoCtrlActionIdx; // e (?), s (save), l (load), c (clear) - /* 0x1048 */ s16 demoCtrlToggleSwitch; - /* 0x104A */ Vec3s unk_104A; -} DebugCamSub; // size = 0x1050 - -typedef struct DebugCam { - /* 0x00 */ s32 unk_00; - /* 0x04 */ Vec3f at; - /* 0x10 */ Vec3f eye; - /* 0x1C */ Vec3f unk_1C; - /* 0x28 */ char unk_28[0xC]; - /* 0x34 */ s32 unk_34; - /* 0x38 */ s32 unk_38; - /* 0x3C */ s32 unk_3C; // bool - /* 0x40 */ s32 unk_40; - /* 0x44 */ s32 unk_44; - /* 0x48 */ f32 fov; - /* 0x4C */ s16 roll; - /* 0x4E */ char unk_4E[0x2]; - /* 0x50 */ f32 rollDegrees; - /* 0x54 */ Vec3f unk_54; - /* 0x60 */ Vec3f unk_60; - /* 0x6C */ Vec3f unk_6C; - /* 0x78 */ s16 unk_78; - /* 0x7A */ s16 unk_7A; - /* 0x7C */ DebugCamSub sub; -} DebugCam; // size = 0x10CC - -typedef struct DebugCamCut { - /* 0x00 */ char letter; - /* 0x01 */ u8 unk_01; - /* 0x02 */ s16 mode; - /* 0x04 */ CutsceneCameraPoint* position; - /* 0x08 */ CutsceneCameraPoint* lookAt; - /* 0x0C */ s16 nFrames; - /* 0x0E */ s16 nPoints; -} DebugCamCut; // size = 0x10 - -typedef struct DebugCamAnim { - /* 0x00 */ f32 curFrame; - /* 0x04 */ f32 unk_04; // frame count? - /* 0x08 */ s16 keyframe; - /* 0x0A */ s16 unk_0A; - /* 0x0C */ s16 unk_0C; - /* 0x10 */ Vec3f positionPos; // confusing name - /* 0x1C */ Vec3f lookAtPos; - /* 0x28 */ f32 roll; - /* 0x2C */ f32 fov; -} DebugCamAnim; // size = 0x30 - -typedef enum DebugCamTextColor { - /* 0 */ DEBUG_CAM_TEXT_YELLOW, - /* 1 */ DEBUG_CAM_TEXT_PEACH, - /* 2 */ DEBUG_CAM_TEXT_BROWN, - /* 3 */ DEBUG_CAM_TEXT_ORANGE, - /* 4 */ DEBUG_CAM_TEXT_GOLD, - /* 5 */ DEBUG_CAM_TEXT_WHITE, - /* 6 */ DEBUG_CAM_TEXT_BLUE, - /* 7 */ DEBUG_CAM_TEXT_GREEN -} DebugCamTextColor; - extern s32 gDebugCamEnabled; void Camera_Init(Camera* camera, struct View* view, struct CollisionContext* colCtx, struct PlayState* play); diff --git a/include/z64sram.h b/include/z64sram.h index 90617d1e6..f1d05b777 100644 --- a/include/z64sram.h +++ b/include/z64sram.h @@ -20,6 +20,8 @@ typedef enum SramHeaderField { /* 0x03 */ SRAM_HEADER_MAGIC // must be the value in `sSramDefaultHeader` for save to be considered valid } SramHeaderField; +extern u16 gSramSlotOffsets[]; + void Sram_InitNewSave(void); void Sram_InitDebugSave(void); void Sram_OpenSave(SramContext* sramCtx); @@ -31,6 +33,6 @@ void Sram_CopySave(struct FileSelectState* fileSelect, SramContext* sramCtx); void Sram_WriteSramHeader(SramContext* sramCtx); void Sram_InitSram(struct GameState* gameState, SramContext* sramCtx); void Sram_Alloc(struct GameState* gameState, SramContext* sramCtx); -void Sram_Init(struct GameState* play, SramContext* sramCtx); +void Sram_Init(struct GameState* gameState, SramContext* sramCtx); #endif diff --git a/include/z64vis.h b/include/z64vis.h index fcd24d1b7..86e286c32 100644 --- a/include/z64vis.h +++ b/include/z64vis.h @@ -28,7 +28,6 @@ typedef struct Vis { } Vis; // size = 0x10 - /* Cvg: Coverage */ #define FB_FILTER_TO_CVG_TYPE(filter) (filter) @@ -50,7 +49,6 @@ void VisCvg_Destroy(VisCvg* this); void VisCvg_Draw(VisCvg* this, Gfx** gfxP); - /* Mono: Desaturation */ // Only one type @@ -66,7 +64,6 @@ void VisMono_Destroy(VisMono* this); void VisMono_Draw(VisMono* this, Gfx** gfxP); - /* ZBuf: Z-Buffer */ #define FB_FILTER_TO_ZBUF_TYPE(filter) ((filter) - FB_FILTER_ZBUF_IA) diff --git a/include/z_en_a_obj.h b/include/z_en_a_obj.h new file mode 100644 index 000000000..bd65f88f1 --- /dev/null +++ b/include/z_en_a_obj.h @@ -0,0 +1,41 @@ +#ifndef Z_EN_A_OBJ_H +#define Z_EN_A_OBJ_H + +#include "ultra64.h" +#include "z64actor.h" + +// Only A_OBJ_SIGNPOST_OBLONG and A_OBJ_SIGNPOST_ARROW are used in room files. +typedef enum AObjType { + /* 0x00 */ A_OBJ_BLOCK_SMALL, + /* 0x01 */ A_OBJ_BLOCK_LARGE, + /* 0x02 */ A_OBJ_BLOCK_HUGE, + /* 0x03 */ A_OBJ_BLOCK_SMALL_ROT, + /* 0x04 */ A_OBJ_BLOCK_LARGE_ROT, + /* 0x05 */ A_OBJ_CUBE_SMALL, + /* 0x06 */ A_OBJ_UNKNOWN_6, + /* 0x07 */ A_OBJ_GRASS_CLUMP, + /* 0x08 */ A_OBJ_TREE_STUMP, + /* 0x09 */ A_OBJ_SIGNPOST_OBLONG, + /* 0x0A */ A_OBJ_SIGNPOST_ARROW, + /* 0x0B */ A_OBJ_BOULDER_FRAGMENT, + /* 0x0C */ A_OBJ_MAX +} AObjType; + +struct EnAObj; + +typedef void (*EnAObjActionFunc)(struct EnAObj*, struct PlayState*); + +typedef struct EnAObj { + /* 0x000 */ DynaPolyActor dyna; + /* 0x164 */ EnAObjActionFunc actionFunc; + /* 0x168 */ s32 rotateWaitTimer; + /* 0x16C */ s16 textId; + /* 0x16E */ s16 rotateState; + /* 0x170 */ s16 rotateForTimer; + /* 0x172 */ s16 rotSpeedY; + /* 0x174 */ s16 rotSpeedX; + /* 0x178 */ f32 focusYoffset; + /* 0x17C */ ColliderCylinder collider; +} EnAObj; // size = 0x1C8 + +#endif diff --git a/include/z_game_dlftbls.h b/include/z_game_dlftbls.h index 691cda27c..b5b8c62c8 100644 --- a/include/z_game_dlftbls.h +++ b/include/z_game_dlftbls.h @@ -3,7 +3,6 @@ #include "ultra64.h" #include "romfile.h" -#include "unk.h" typedef struct GameStateOverlay { /* 0x00 */ void* loadedRamAddr; @@ -15,7 +14,7 @@ typedef struct GameStateOverlay { /* 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; + /* 0x28 */ s32 unk_28; /* 0x2C */ u32 instanceSize; } GameStateOverlay; // size = 0x30 diff --git a/include/z_locale.h b/include/z_locale.h new file mode 100644 index 000000000..7afcb33db --- /dev/null +++ b/include/z_locale.h @@ -0,0 +1,12 @@ +#ifndef Z_LOCALE_H +#define Z_LOCALE_H + +#include "ultra64/ultratypes.h" +#include "region.h" + +extern s32 gCurrentRegion; + +void Locale_Init(void); +void Locale_ResetRegion(void); + +#endif |
