mirror of
https://github.com/HackerN64/HackerOoT.git
synced 2026-01-21 10:37:37 -08:00
Merge remote-tracking branch 'decomp/main' into decomp_merge
This commit is contained in:
16
include/buffers.h
Normal file
16
include/buffers.h
Normal file
@@ -0,0 +1,16 @@
|
||||
#ifndef BUFFERS_H
|
||||
#define BUFFERS_H
|
||||
|
||||
#include "gfx.h"
|
||||
#include "macros.h"
|
||||
#include "ultra64.h"
|
||||
#include "config.h"
|
||||
|
||||
extern u16 gZBuffer[SCREEN_HEIGHT][SCREEN_WIDTH]; // 0x25800 bytes
|
||||
extern u64 gGfxSPTaskOutputBuffer[0x3000]; // 0x18000 bytes
|
||||
extern u64 gGfxSPTaskYieldBuffer[OS_YIELD_DATA_SIZE / sizeof(u64)]; // 0xC00 bytes
|
||||
extern u64 gGfxSPTaskStack[SP_DRAM_STACK_SIZE64]; // 0x400 bytes
|
||||
extern GfxPool gGfxPools[2]; // 0x24820 bytes
|
||||
extern u8 gAudioHeap[AUDIO_HEAP_SIZE]; // 0x38000 bytes
|
||||
|
||||
#endif
|
||||
38
include/debug_arena.h
Normal file
38
include/debug_arena.h
Normal file
@@ -0,0 +1,38 @@
|
||||
#ifndef DEBUG_ARENA_H
|
||||
#define DEBUG_ARENA_H
|
||||
|
||||
#include "ultra64/ultratypes.h"
|
||||
|
||||
void* DebugArena_Malloc(u32 size);
|
||||
void* DebugArena_MallocR(u32 size);
|
||||
void* DebugArena_Realloc(void* ptr, u32 newSize);
|
||||
void DebugArena_Free(void* ptr);
|
||||
void* DebugArena_Calloc(u32 num, u32 size);
|
||||
void DebugArena_GetSizes(u32* outMaxFree, u32* outFree, u32* outAlloc);
|
||||
void DebugArena_Check(void);
|
||||
void DebugArena_Init(void* start, u32 size);
|
||||
void DebugArena_Cleanup(void);
|
||||
s32 DebugArena_IsInitialized(void);
|
||||
|
||||
#if IS_DEBUG_HEAP_ENABLED
|
||||
|
||||
#define DEBUG_ARENA_MALLOC(size, ...) DebugArena_MallocDebug(size, __FILE__, __LINE__)
|
||||
#define DEBUG_ARENA_MALLOC_R(size, ...) DebugArena_MallocRDebug(size, __FILE__, __LINE__)
|
||||
#define DEBUG_ARENA_FREE(size, ...) DebugArena_FreeDebug(size, __FILE__, __LINE__)
|
||||
|
||||
void DebugArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action);
|
||||
void* DebugArena_MallocDebug(u32 size, const char* file, int line);
|
||||
void* DebugArena_MallocRDebug(u32 size, const char* file, int line);
|
||||
void* DebugArena_ReallocDebug(void* ptr, u32 newSize, const char* file, int line);
|
||||
void DebugArena_FreeDebug(void* ptr, const char* file, int line);
|
||||
void DebugArena_Display(void);
|
||||
|
||||
#else
|
||||
|
||||
#define DEBUG_ARENA_MALLOC(size, ...) DebugArena_Malloc(size)
|
||||
#define DEBUG_ARENA_MALLOC_R(size, ...) DebugArena_MallocR(size)
|
||||
#define DEBUG_ARENA_FREE(size, ...) DebugArena_Free(size)
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "ultra64.h"
|
||||
#include "attributes.h"
|
||||
#include "padmgr.h"
|
||||
#include "libu64/pad.h"
|
||||
|
||||
#if !PLATFORM_N64
|
||||
// These are the same as the 3-bit ansi color codes
|
||||
|
||||
@@ -30,40 +30,9 @@ void ActorOverlayTable_LogPrint(void);
|
||||
void ActorOverlayTable_Init(void);
|
||||
void ActorOverlayTable_Cleanup(void);
|
||||
void SaveContext_Init(void);
|
||||
s32 func_800635D0(s32);
|
||||
void Regs_Init(void);
|
||||
void DebugCamera_ScreenText(u8 x, u8 y, const char* text); // ENABLE_NO_CLIP
|
||||
void DebugCamera_ScreenTextColored(u8 x, u8 y, u8 colorIndex, const char* text); // ENABLE_CAMERA_DEBUGGER
|
||||
#if DEBUG_FEATURES
|
||||
void Regs_UpdateEditor(Input* input); // ENABLE_REG_EDITOR
|
||||
#endif
|
||||
void Debug_DrawText(GraphicsContext* gfxCtx); // ENABLE_CAMERA_DEBUGGER || ENABLE_REG_EDITOR
|
||||
|
||||
void* MemCpy(void* dest, const void* src, s32 len);
|
||||
|
||||
u16 QuestHint_GetSariaTextId(PlayState* play);
|
||||
u16 QuestHint_GetNaviTextId(PlayState* play);
|
||||
u16 MaskReaction_GetTextId(PlayState* play, u32 maskReactionSet);
|
||||
void CutsceneFlags_UnsetAll(PlayState* play);
|
||||
void CutsceneFlags_Set(PlayState* play, s16 flag);
|
||||
void CutsceneFlags_Unset(PlayState* play, s16 flag);
|
||||
s32 CutsceneFlags_Get(PlayState* play, s16 flag);
|
||||
|
||||
s32 Kanji_OffsetFromShiftJIS(s32 character);
|
||||
#if PLATFORM_IQUE
|
||||
void Font_LoadCharCHN(Font* font, u16 character, u16 codePointIndex);
|
||||
#endif
|
||||
void Font_LoadCharWide(Font* font, u16 character, u16 codePointIndex);
|
||||
void Font_LoadChar(Font* font, u8 character, u16 codePointIndex);
|
||||
void Font_LoadMessageBoxIcon(Font* font, u16 icon);
|
||||
void Font_LoadOrderedFont(Font* font);
|
||||
|
||||
void Health_InitMeter(PlayState* play);
|
||||
void Health_UpdateMeter(PlayState* play);
|
||||
void Health_DrawMeter(PlayState* play);
|
||||
void Health_UpdateBeatingHeart(PlayState* play);
|
||||
u32 Health_IsCritical(void);
|
||||
|
||||
void MapMark_Init(PlayState* play);
|
||||
void MapMark_ClearPointers(PlayState* play);
|
||||
void MapMark_Draw(PlayState* play);
|
||||
@@ -72,55 +41,11 @@ void PreNmiBuff_SetReset(PreNmiBuff* this);
|
||||
u32 PreNmiBuff_IsResetting(PreNmiBuff* this);
|
||||
void Sched_FlushTaskQueue(void);
|
||||
|
||||
Path* Path_GetByIndex(PlayState* play, s16 index, s16 max);
|
||||
f32 Path_OrientAndGetDistSq(Actor* actor, Path* path, s16 waypoint, s16* yaw);
|
||||
void Path_CopyLastPoint(Path* path, Vec3f* dest);
|
||||
|
||||
void PreNMI_Init(GameState* thisx);
|
||||
|
||||
void func_80095AA0(PlayState* play, Room* room, Input* input, s32 arg3);
|
||||
void Room_DrawBackground2D(Gfx** gfxP, void* tex, void* tlut, u16 width, u16 height, u8 fmt, u8 siz, u16 tlutMode,
|
||||
u16 tlutCount, f32 offsetX, f32 offsetY);
|
||||
void Room_Init(PlayState* play, Room* room);
|
||||
u32 Room_SetupFirstRoom(PlayState* play, RoomContext* roomCtx);
|
||||
s32 Room_RequestNewRoom(PlayState* play, RoomContext* roomCtx, s32 roomNum);
|
||||
s32 Room_ProcessRoomRequest(PlayState* play, RoomContext* roomCtx);
|
||||
void Room_Draw(PlayState* play, Room* room, u32 flags);
|
||||
void Room_FinishRoomChange(PlayState* play, RoomContext* roomCtx);
|
||||
void Sample_Destroy(GameState* thisx);
|
||||
void Sample_Init(GameState* thisx);
|
||||
|
||||
void Skin_UpdateVertices(MtxF* mtx, SkinVertex* skinVertices, SkinLimbModif* modifEntry, Vtx* vtxBuf, Vec3f* pos);
|
||||
void Skin_DrawAnimatedLimb(GraphicsContext* gfxCtx, Skin* skin, s32 limbIndex, s32 arg3, s32 drawFlags);
|
||||
void Skin_DrawLimb(GraphicsContext* gfxCtx, Skin* skin, s32 limbIndex, Gfx* dlistOverride, s32 drawFlags);
|
||||
void func_800A6330(Actor* actor, PlayState* play, Skin* skin, SkinPostDraw postDraw, s32 setTranslation);
|
||||
void func_800A6360(Actor* actor, PlayState* play, Skin* skin, SkinPostDraw postDraw,
|
||||
SkinOverrideLimbDraw overrideLimbDraw, s32 setTranslation);
|
||||
void func_800A6394(Actor* actor, PlayState* play, Skin* skin, SkinPostDraw postDraw,
|
||||
SkinOverrideLimbDraw overrideLimbDraw, s32 setTranslation, s32 arg6);
|
||||
void func_800A63CC(Actor* actor, PlayState* play, Skin* skin, SkinPostDraw postDraw,
|
||||
SkinOverrideLimbDraw overrideLimbDraw, s32 setTranslation, s32 arg6, s32 drawFlags);
|
||||
void Skin_GetLimbPos(Skin* skin, s32 limbIndex, Vec3f* offset, Vec3f* dst);
|
||||
void Skin_Init(PlayState* play, Skin* skin, SkeletonHeader* skeletonHeader, AnimationHeader* animationHeader);
|
||||
void Skin_Free(PlayState* play, Skin* skin);
|
||||
s32 Skin_ApplyAnimTransformations(Skin* skin, MtxF* limbMatrices, Actor* actor, s32 setTranslation);
|
||||
|
||||
void Sram_InitNewSave(void);
|
||||
void Sram_InitDebugSave(void);
|
||||
void Sram_OpenSave(SramContext* sramCtx);
|
||||
void Sram_WriteSave(SramContext* sramCtx);
|
||||
void Sram_VerifyAndLoadAllSaves(FileSelectState* fileSelect, SramContext* sramCtx);
|
||||
void Sram_InitSave(FileSelectState* fileSelect, SramContext* sramCtx);
|
||||
void Sram_EraseSave(FileSelectState* fileSelect, SramContext* sramCtx);
|
||||
void Sram_CopySave(FileSelectState* fileSelect, SramContext* sramCtx);
|
||||
void Sram_WriteSramHeader(SramContext* sramCtx);
|
||||
void Sram_InitSram(GameState* gameState, SramContext* sramCtx);
|
||||
void Sram_Alloc(GameState* gameState, SramContext* sramCtx);
|
||||
void Sram_Init(PlayState* play, SramContext* sramCtx);
|
||||
void SsSram_Init(s32 addr, u8 handleType, u8 handleDomain, u8 handleLatency, u8 handlePageSize, u8 handleRelDuration,
|
||||
u8 handlePulse, u32 handleSpeed);
|
||||
void SsSram_Dma(void* dramAddr, size_t size, s32 direction);
|
||||
void SsSram_ReadWrite(s32 addr, void* dramAddr, size_t size, s32 direction);
|
||||
void ViMode_LogPrint(OSViMode* osViMode);
|
||||
void ViMode_Configure(ViMode* viMode, s32 type, s32 tvType, s32 loRes, s32 antialiasOff, s32 modeN, s32 fb16Bit,
|
||||
s32 width, s32 height, s32 leftAdjust, s32 rightAdjust, s32 upperAdjust, s32 lowerAdjust);
|
||||
@@ -175,9 +100,6 @@ void DebugCamera_Enable(DebugCam* debugCam, Camera* cam);
|
||||
void DebugCamera_Update(DebugCam* debugCam, Camera* cam);
|
||||
void DebugCamera_Reset(Camera* cam, DebugCam* debugCam);
|
||||
|
||||
void func_800BB0A0(f32 u, Vec3f* pos, f32* roll, f32* viewAngle, f32* point0, f32* point1, f32* point2, f32* point3);
|
||||
s32 func_800BB2B4(Vec3f* pos, f32* roll, f32* fov, CutsceneCameraPoint* point, s16* keyFrame, f32* curFrame);
|
||||
|
||||
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);
|
||||
@@ -194,26 +116,6 @@ void func_800C213C(PreRender* this, Gfx** gfxP);
|
||||
void PreRender_RestoreFramebuffer(PreRender* this, Gfx** gfxP);
|
||||
void PreRender_CopyImageRegion(PreRender* this, Gfx** gfxP);
|
||||
void PreRender_ApplyFilters(PreRender* this);
|
||||
void GameState_SetFBFilter(Gfx** gfxP);
|
||||
|
||||
void GameState_Draw(GameState* gameState, GraphicsContext* gfxCtx);
|
||||
void GameState_SetFrameBuffer(GraphicsContext* gfxCtx);
|
||||
void GameState_ReqPadData(GameState* gameState);
|
||||
void GameState_Update(GameState* gameState);
|
||||
void GameState_InitArena(GameState* gameState, size_t size);
|
||||
void GameState_Realloc(GameState* gameState, size_t size);
|
||||
void GameState_Init(GameState* gameState, GameStateFunc init, GraphicsContext* gfxCtx);
|
||||
void GameState_Destroy(GameState* gameState);
|
||||
GameStateFunc GameState_GetInit(GameState* gameState);
|
||||
u32 GameState_IsRunning(GameState* gameState);
|
||||
#if DEBUG_FEATURES
|
||||
void* GameState_Alloc(GameState* gameState, size_t size, const char* file, int line);
|
||||
void* GameAlloc_MallocDebug(GameAlloc* this, u32 size, const char* file, int line);
|
||||
#endif
|
||||
void* GameAlloc_Malloc(GameAlloc* this, u32 size);
|
||||
void GameAlloc_Free(GameAlloc* this, void* data);
|
||||
void GameAlloc_Cleanup(GameAlloc* this);
|
||||
void GameAlloc_Init(GameAlloc* this);
|
||||
void Graph_InitTHGA(GraphicsContext* gfxCtx);
|
||||
GameStateOverlay* Graph_GetNextGameState(GameState* gameState);
|
||||
void Graph_Init(GraphicsContext* gfxCtx);
|
||||
@@ -230,40 +132,13 @@ void SysCfb_Init(s32 n64dd);
|
||||
void* SysCfb_GetFbPtr(s32 idx);
|
||||
void* SysCfb_GetFbEnd(void);
|
||||
|
||||
u64* SysUcode_GetUCodeBoot(void);
|
||||
size_t SysUcode_GetUCodeBootSize(void);
|
||||
u64* SysUcode_GetUCode(void);
|
||||
u64* SysUcode_GetUCodeData(void);
|
||||
#if ENABLE_F3DEX3
|
||||
void SysUcode_LoadNewUcodeIfChanged();
|
||||
#endif
|
||||
NORETURN void func_800D31A0(void);
|
||||
void func_800D31F0(void);
|
||||
void func_800D3210(void);
|
||||
void* DebugArena_Malloc(u32 size);
|
||||
void* DebugArena_MallocR(u32 size);
|
||||
void* DebugArena_Realloc(void* ptr, u32 newSize);
|
||||
void DebugArena_Free(void* ptr);
|
||||
void* DebugArena_Calloc(u32 num, u32 size);
|
||||
void DebugArena_GetSizes(u32* outMaxFree, u32* outFree, u32* outAlloc);
|
||||
void DebugArena_Check(void);
|
||||
void DebugArena_Init(void* start, u32 size);
|
||||
void DebugArena_Cleanup(void);
|
||||
s32 DebugArena_IsInitialized(void);
|
||||
#if IS_DEBUG_HEAP_ENABLED
|
||||
void DebugArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action);
|
||||
void* DebugArena_MallocDebug(u32 size, const char* file, int line);
|
||||
void* DebugArena_MallocRDebug(u32 size, const char* file, int line);
|
||||
void* DebugArena_ReallocDebug(void* ptr, u32 newSize, const char* file, int line);
|
||||
void DebugArena_FreeDebug(void* ptr, const char* file, int line);
|
||||
void DebugArena_Display(void);
|
||||
#endif
|
||||
|
||||
void RcpUtils_PrintRegisterStatus(void);
|
||||
void RcpUtils_Reset(void);
|
||||
void* Overlay_AllocateAndLoad(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, void* vramEnd);
|
||||
void MtxConv_F2L(Mtx* m1, MtxF* m2);
|
||||
void MtxConv_L2F(MtxF* m1, Mtx* m2);
|
||||
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);
|
||||
// ? func_800FC800(?);
|
||||
|
||||
31
include/gamealloc.h
Normal file
31
include/gamealloc.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#ifndef GAMEALLOC_H
|
||||
#define GAMEALLOC_H
|
||||
|
||||
#include "ultra64/ultratypes.h"
|
||||
|
||||
typedef struct GameAllocEntry {
|
||||
/* 0x00 */ struct GameAllocEntry* next;
|
||||
/* 0x04 */ struct GameAllocEntry* prev;
|
||||
/* 0x08 */ u32 size;
|
||||
/* 0x0C */ u32 unk_0C;
|
||||
} GameAllocEntry; // size = 0x10
|
||||
|
||||
typedef struct GameAlloc {
|
||||
/* 0x00 */ GameAllocEntry base;
|
||||
/* 0x10 */ GameAllocEntry* head;
|
||||
} GameAlloc; // size = 0x14
|
||||
|
||||
#if DEBUG_FEATURES
|
||||
|
||||
#define GAME_ALLOC_MALLOC(alloc, size, ...) GameAlloc_MallocDebug(alloc, size, __FILE__, __LINE__)
|
||||
void* GameAlloc_MallocDebug(GameAlloc* this, u32 size, const char* file, int line);
|
||||
#else
|
||||
#define GAME_ALLOC_MALLOC(alloc, size, ...) GameAlloc_Malloc(alloc, size)
|
||||
#endif
|
||||
|
||||
void* GameAlloc_Malloc(GameAlloc* this, u32 size);
|
||||
void GameAlloc_Free(GameAlloc* this, void* data);
|
||||
void GameAlloc_Cleanup(GameAlloc* this);
|
||||
void GameAlloc_Init(GameAlloc* this);
|
||||
|
||||
#endif
|
||||
@@ -58,6 +58,8 @@ typedef struct GraphicsContext {
|
||||
#endif
|
||||
} GraphicsContext; // size = 0x300
|
||||
|
||||
extern Gfx gEmptyDL[];
|
||||
|
||||
Gfx* Gfx_SetFog(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 near, s32 far);
|
||||
Gfx* Gfx_SetFogWithSync(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 near, s32 far);
|
||||
Gfx* Gfx_SetFog2(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 near, s32 far);
|
||||
|
||||
8
include/kanread.h
Normal file
8
include/kanread.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#ifndef KANREAD_H
|
||||
#define KANREAD_H
|
||||
|
||||
#include "ultra64/ultratypes.h"
|
||||
|
||||
s32 Kanji_OffsetFromShiftJIS(s32 sjis);
|
||||
|
||||
#endif
|
||||
@@ -16,11 +16,19 @@ void SystemArena_Cleanup(void);
|
||||
s32 SystemArena_IsInitialized(void);
|
||||
|
||||
#if DEBUG_FEATURES
|
||||
#define SYSTEM_ARENA_MALLOC(size, ...) SystemArena_MallocDebug(size, __FILE__, __LINE__)
|
||||
#define SYSTEM_ARENA_MALLOC_R(size, ...) SystemArena_MallocRDebug(size, __FILE__, __LINE__)
|
||||
#define SYSTEM_ARENA_FREE(size, ...) SystemArena_FreeDebug(size, __FILE__, __LINE__)
|
||||
|
||||
void* SystemArena_MallocDebug(u32 size, const char* file, int line);
|
||||
void* SystemArena_MallocRDebug(u32 size, const char* file, int line);
|
||||
void* SystemArena_ReallocDebug(void* ptr, u32 newSize, const char* file, int line);
|
||||
void SystemArena_FreeDebug(void* ptr, const char* file, int line);
|
||||
void SystemArena_Display(void);
|
||||
#else
|
||||
#define SYSTEM_ARENA_MALLOC(size, ...) SystemArena_Malloc(size)
|
||||
#define SYSTEM_ARENA_MALLOC_R(size, ...) SystemArena_MallocR(size)
|
||||
#define SYSTEM_ARENA_FREE(size, ...) SystemArena_Free(size)
|
||||
#endif
|
||||
|
||||
extern Arena gSystemArena;
|
||||
|
||||
@@ -3,12 +3,33 @@
|
||||
|
||||
#include "ultra64.h"
|
||||
|
||||
#if DEBUG_FEATURES
|
||||
#define LOG(exp, value, format, ...) \
|
||||
do { \
|
||||
LogUtils_LogThreadId(__FILE__, __LINE__); \
|
||||
osSyncPrintf(exp " = " format "\n", value); \
|
||||
} while (0)
|
||||
#else
|
||||
#define LOG(exp, value, format, ...) (void)(value)
|
||||
#endif
|
||||
|
||||
#define LOG_STRING(string, ...) LOG(#string, string, "%s", __VA_ARGS__)
|
||||
#define LOG_ADDRESS(exp, value, ...) LOG(exp, value, "%08x", __VA_ARGS__)
|
||||
#define LOG_TIME(exp, value, ...) LOG(exp, value, "%lld", __VA_ARGS__)
|
||||
#define LOG_NUM(exp, value, ...) LOG(exp, value, "%d", __VA_ARGS__)
|
||||
#define LOG_HEX(exp, value, ...) LOG(exp, value, "%x", __VA_ARGS__)
|
||||
#define LOG_HEX32(exp, value, ...) LOG(exp, value, "%08x", __VA_ARGS__)
|
||||
#define LOG_FLOAT(exp, value, ...) LOG(exp, value, "%f", __VA_ARGS__)
|
||||
|
||||
#if PLATFORM_N64 || DEBUG_FEATURES
|
||||
f32 LogUtils_CheckFloatRange(const char* exp, int line, const char* valueName, f32 value, const char* minName, f32 min,
|
||||
const char* maxName, f32 max);
|
||||
#endif
|
||||
|
||||
#if DEBUG_FEATURES
|
||||
#define LOG_UTILS_CHECK_NULL_POINTER(exp, ptr, ...) LogUtils_CheckNullPointer(exp, ptr, __FILE__, __LINE__)
|
||||
#define LOG_UTILS_CHECK_VALID_POINTER(exp, ptr, ...) LogUtils_CheckValidPointer(exp, ptr, __FILE__, __LINE__)
|
||||
|
||||
s32 LogUtils_CheckIntRange(const char* exp, int line, const char* valueName, s32 value, const char* minName, s32 min,
|
||||
const char* maxName, s32 max);
|
||||
void LogUtils_LogHexDump(void* ptr, s32 size0);
|
||||
@@ -17,6 +38,11 @@ void LogUtils_CheckBoundary(const char* name, s32 value, s32 unk, const char* fi
|
||||
void LogUtils_CheckNullPointer(const char* exp, void* ptr, const char* file, int line);
|
||||
void LogUtils_CheckValidPointer(const char* exp, void* ptr, const char* file, int line);
|
||||
void LogUtils_LogThreadId(const char* name, int line);
|
||||
#else
|
||||
|
||||
#define LOG_UTILS_CHECK_NULL_POINTER(exp, ptr, ...) (void)0
|
||||
#define LOG_UTILS_CHECK_VALID_POINTER(exp, ptr, ...) (void)0
|
||||
|
||||
#endif
|
||||
|
||||
void LogUtils_HungupThread(const char* name, int line);
|
||||
|
||||
9
include/libu64/mtxuty-cvt.h
Normal file
9
include/libu64/mtxuty-cvt.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#ifndef LIBU64_MTXUTY_CVT_H
|
||||
#define LIBU64_MTXUTY_CVT_H
|
||||
|
||||
#include "ultra64.h"
|
||||
|
||||
void MtxConv_F2L(Mtx* m1, MtxF* m2);
|
||||
void MtxConv_L2F(MtxF* m1, Mtx* m2);
|
||||
|
||||
#endif
|
||||
@@ -4,6 +4,9 @@
|
||||
#include "terminal.h"
|
||||
#include "versions.h"
|
||||
|
||||
#define SCREEN_WIDTH 320
|
||||
#define SCREEN_HEIGHT 240
|
||||
|
||||
#ifndef AVOID_UB
|
||||
#define BAD_RETURN(type) type
|
||||
#else
|
||||
@@ -87,24 +90,6 @@
|
||||
#define PRINTF_RST() (void)0
|
||||
#endif
|
||||
|
||||
#if DEBUG_FEATURES
|
||||
#define LOG(exp, value, format, ...) \
|
||||
do { \
|
||||
LogUtils_LogThreadId(__FILE__, __LINE__); \
|
||||
osSyncPrintf(exp " = " format "\n", value); \
|
||||
} while (0)
|
||||
#else
|
||||
#define LOG(exp, value, format, ...) (void)(value)
|
||||
#endif
|
||||
|
||||
#define LOG_STRING(string, ...) LOG(#string, string, "%s", __VA_ARGS__)
|
||||
#define LOG_ADDRESS(exp, value, ...) LOG(exp, value, "%08x", __VA_ARGS__)
|
||||
#define LOG_TIME(exp, value, ...) LOG(exp, value, "%lld", __VA_ARGS__)
|
||||
#define LOG_NUM(exp, value, ...) LOG(exp, value, "%d", __VA_ARGS__)
|
||||
#define LOG_HEX(exp, value, ...) LOG(exp, value, "%x", __VA_ARGS__)
|
||||
#define LOG_HEX32(exp, value, ...) LOG(exp, value, "%08x", __VA_ARGS__)
|
||||
#define LOG_FLOAT(exp, value, ...) LOG(exp, value, "%f", __VA_ARGS__)
|
||||
|
||||
#define SET_NEXT_GAMESTATE(curState, newInit, newStruct) \
|
||||
if (1) { \
|
||||
GameState* state = curState; \
|
||||
@@ -114,36 +99,12 @@
|
||||
} (void)0
|
||||
|
||||
#if DEBUG_FEATURES
|
||||
|
||||
#define DMA_REQUEST_SYNC(ram, vrom, size, ...) DmaMgr_RequestSyncDebug(ram, vrom, size, __FILE__, __LINE__)
|
||||
#define DMA_REQUEST_ASYNC(req, ram, vrom, size, unk5, queue, msg, ...) DmaMgr_RequestAsyncDebug(req, ram, vrom, size, unk5, queue, msg, __FILE__, __LINE__)
|
||||
#define GAME_STATE_ALLOC(gameState, size, ...) GameState_Alloc(gameState, size, __FILE__, __LINE__)
|
||||
#define DEBUG_ARENA_MALLOC(size, ...) DebugArena_MallocDebug(size, __FILE__, __LINE__)
|
||||
#define DEBUG_ARENA_MALLOC_R(size, ...) DebugArena_MallocRDebug(size, __FILE__, __LINE__)
|
||||
#define DEBUG_ARENA_FREE(size, ...) DebugArena_FreeDebug(size, __FILE__, __LINE__)
|
||||
#define SYSTEM_ARENA_MALLOC(size, ...) SystemArena_MallocDebug(size, __FILE__, __LINE__)
|
||||
#define SYSTEM_ARENA_MALLOC_R(size, ...) SystemArena_MallocRDebug(size, __FILE__, __LINE__)
|
||||
#define SYSTEM_ARENA_FREE(size, ...) SystemArena_FreeDebug(size, __FILE__, __LINE__)
|
||||
#define LOG_UTILS_CHECK_NULL_POINTER(exp, ptr, ...) LogUtils_CheckNullPointer(exp, ptr, __FILE__, __LINE__)
|
||||
#define LOG_UTILS_CHECK_VALID_POINTER(exp, ptr, ...) LogUtils_CheckValidPointer(exp, ptr, __FILE__, __LINE__)
|
||||
#define GAME_ALLOC_MALLOC(alloc, size, ...) GameAlloc_MallocDebug(alloc, size, __FILE__, __LINE__)
|
||||
|
||||
#else
|
||||
|
||||
#define DMA_REQUEST_SYNC(ram, vrom, size, ...) DmaMgr_RequestSync(ram, vrom, size)
|
||||
#define DMA_REQUEST_ASYNC(req, ram, vrom, size, unk5, queue, msg, ...) DmaMgr_RequestAsync(req, ram, vrom, size, unk5, queue, msg)
|
||||
#define GAME_STATE_ALLOC(gameState, size, ...) THA_AllocTailAlign16(&(gameState)->tha, size)
|
||||
#define DEBUG_ARENA_MALLOC(size, ...) DebugArena_Malloc(size)
|
||||
#define DEBUG_ARENA_MALLOC_R(size, ...) DebugArena_MallocR(size)
|
||||
#define DEBUG_ARENA_FREE(size, ...) DebugArena_Free(size)
|
||||
#define SYSTEM_ARENA_MALLOC(size, ...) SystemArena_Malloc(size)
|
||||
#define SYSTEM_ARENA_MALLOC_R(size, ...) SystemArena_MallocR(size)
|
||||
#define SYSTEM_ARENA_FREE(size, ...) SystemArena_Free(size)
|
||||
#define LOG_UTILS_CHECK_NULL_POINTER(exp, ptr, ...) (void)0
|
||||
#define LOG_UTILS_CHECK_VALID_POINTER(exp, ptr, ...) (void)0
|
||||
#define GAME_ALLOC_MALLOC(alloc, size, ...) GameAlloc_Malloc(alloc, size)
|
||||
|
||||
#endif /* DEBUG_FEATURES */
|
||||
#endif
|
||||
|
||||
#if PLATFORM_N64 || DEBUG_FEATURES
|
||||
#define HUNGUP_AND_CRASH(...) Fault_AddHungupAndCrash(__FILE__, __LINE__)
|
||||
|
||||
@@ -39,4 +39,6 @@ void Rainbow_Update(Rainbow* this);
|
||||
|
||||
void osSyncPrintf(const char* fmt, ...);
|
||||
|
||||
extern Rainbow gRainbow;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define REGS_H
|
||||
|
||||
#include "config.h"
|
||||
#include "ultra64.h"
|
||||
#include "versions.h"
|
||||
|
||||
#define REG_GROUPS 29 // number of REG groups, i.e. REG, SREG, OREG, etc.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#ifndef SEGMENT_SYMBOLS_H
|
||||
#define SEGMENT_SYMBOLS_H
|
||||
|
||||
#include "ultra64/ultratypes.h"
|
||||
#include "versions.h"
|
||||
#include "z64.h"
|
||||
#include "config.h"
|
||||
|
||||
#define DECLARE_SEGMENT(name) \
|
||||
|
||||
11
include/sys_ucode.h
Normal file
11
include/sys_ucode.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#ifndef SYS_UCODE_H
|
||||
#define SYS_UCODE_H
|
||||
|
||||
#include "ultra64.h"
|
||||
|
||||
u64* SysUcode_GetUCodeBoot(void);
|
||||
size_t SysUcode_GetUCodeBootSize(void);
|
||||
u64* SysUcode_GetUCode(void);
|
||||
u64* SysUcode_GetUCodeData(void);
|
||||
|
||||
#endif
|
||||
@@ -539,6 +539,8 @@
|
||||
#define VI_PAL_CLOCK 49656530 /* Hz = 49.656530 MHz */
|
||||
#define VI_MPAL_CLOCK 48628316 /* Hz = 48.628316 MHz */
|
||||
|
||||
// Custom PAL60 VI mode
|
||||
#define VI_CUSTOM_PAL60_LAN1 56
|
||||
|
||||
/**
|
||||
* Audio Interface (AI) Registers
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
extern Debug gDebug;
|
||||
#endif
|
||||
|
||||
extern Mtx D_01000000;
|
||||
|
||||
extern void* osRomBase;
|
||||
extern s32 osTvType;
|
||||
extern u32 osRomType;
|
||||
@@ -78,18 +76,14 @@ extern u32 __osBaseCounter;
|
||||
extern u32 __osViIntrCount;
|
||||
extern u32 __osTimerCounter;
|
||||
extern EffectSsOverlay gEffectSsOverlayTable[EFFECT_SS_TYPE_MAX];
|
||||
extern Gfx D_80116280[];
|
||||
extern ActorOverlay gActorOverlayTable[ACTOR_ID_MAX]; // original name: "actor_dlftbls" 801162A0
|
||||
extern s32 gMaxActorId; // original name: "MaxProfile"
|
||||
extern s32 gDebugCamEnabled; // ENABLE_CAMERA_DEBUGGER
|
||||
extern GameStateOverlay gGameStateOverlayTable[GAMESTATE_ID_MAX];
|
||||
extern s32 gZeldaArenaLogSeverity;
|
||||
extern MapData gMapDataTable;
|
||||
extern s16 gSpoilingItems[3];
|
||||
extern s16 gSpoilingItemReverts[3];
|
||||
|
||||
extern Gfx gEmptyDL[];
|
||||
|
||||
extern u16 gSramSlotOffsets[];
|
||||
// 4 16-colors palettes
|
||||
extern u64 gMojiFontTLUTs[4][4]; // original name: "moji_tlut"
|
||||
@@ -164,26 +158,6 @@ extern u8 gSequenceFontTable[];
|
||||
extern u8 gSequenceTable[];
|
||||
extern AudioTable gSampleBankTable;
|
||||
|
||||
extern u8 gUseCutsceneCam;
|
||||
extern u16 D_8015FCCC;
|
||||
extern char D_8015FCD0[20];
|
||||
extern u8 D_8015FCE4;
|
||||
extern u16 gCamAtSplinePointsAppliedFrame;
|
||||
extern u16 gCamEyePointAppliedFrame;
|
||||
extern u16 gCamAtPointAppliedFrame;
|
||||
|
||||
extern LightningStrike gLightningStrike;
|
||||
// TODO: These variables are here for BSS ordering but ideally they should not
|
||||
// be extern. This could be fixed by putting more stuff (e.g. struct definitions)
|
||||
// between gLightningStrike and gCustomLensFlareOn.
|
||||
extern s16 sLightningFlashAlpha;
|
||||
extern s16 sSunDepthTestX;
|
||||
extern s16 sSunDepthTestY;
|
||||
extern u8 gCustomLensFlareOn;
|
||||
extern Vec3f gCustomLensFlarePos;
|
||||
extern s16 gLensFlareScale;
|
||||
extern f32 gLensFlareColorIntensity;
|
||||
extern s16 gLensFlareGlareStrength;
|
||||
extern MapData* gMapData;
|
||||
extern f32 gBossMarkScale;
|
||||
extern u32 D_8016139C;
|
||||
@@ -227,14 +201,6 @@ extern u8 __osContLastCmd;
|
||||
extern u8 __osMaxControllers;
|
||||
extern __OSInode __osPfsInodeCache;
|
||||
extern OSPifRam __osPfsPifRam;
|
||||
extern u16 gZBuffer[SCREEN_HEIGHT][SCREEN_WIDTH]; // 0x25800 bytes
|
||||
extern u64 gGfxSPTaskOutputBuffer[0x3000]; // 0x18000 bytes
|
||||
extern u64 gGfxSPTaskYieldBuffer[OS_YIELD_DATA_SIZE / sizeof(u64)]; // 0xC00 bytes
|
||||
extern u64 gGfxSPTaskStack[SP_DRAM_STACK_SIZE64]; // 0x400 bytes
|
||||
extern GfxPool gGfxPools[2]; // 0x24820 bytes
|
||||
extern u8 gAudioHeap[AUDIO_HEAP_SIZE]; // 0x38000 bytes
|
||||
|
||||
extern Rainbow gRainbow;
|
||||
|
||||
extern u8 gRDPTimingsExist; // This variable being 1 indicates that the game is running on console or an extremely accurate emulator that can be affected by RDP lag.
|
||||
|
||||
|
||||
@@ -8,56 +8,28 @@
|
||||
#include "audiomgr.h"
|
||||
#include "controller.h"
|
||||
#include "versions.h"
|
||||
#include "z64save.h"
|
||||
#include "z64light.h"
|
||||
#include "z64bgcheck.h"
|
||||
#include "z64actor.h"
|
||||
#include "z64player.h"
|
||||
#include "z64audio.h"
|
||||
#include "z64object.h"
|
||||
#include "z64ocarina.h"
|
||||
#include "z64camera.h"
|
||||
#include "z64environment.h"
|
||||
#include "z64cutscene.h"
|
||||
#include "z64collision_check.h"
|
||||
#include "z64curve.h"
|
||||
#include "z64scene.h"
|
||||
#include "z64effect.h"
|
||||
#include "z64game_over.h"
|
||||
#include "z64inventory.h"
|
||||
#include "z64item.h"
|
||||
#include "z64animation.h"
|
||||
#include "z64animation_legacy.h"
|
||||
#include "z64dma.h"
|
||||
#include "letterbox.h"
|
||||
#include "z64math.h"
|
||||
#include "z64map_mark.h"
|
||||
#include "z64message.h"
|
||||
#include "z64olib.h"
|
||||
#include "one_point_cutscene.h"
|
||||
#include "z64pause.h"
|
||||
#include "z64play.h"
|
||||
#include "z64skin.h"
|
||||
#include "z64skin_matrix.h"
|
||||
#include "z64game.h"
|
||||
#include "z64transition.h"
|
||||
#include "z64transition_instances.h"
|
||||
#include "z64interface.h"
|
||||
#include "z64sfx_source.h"
|
||||
#include "z64skybox.h"
|
||||
#include "z64sram.h"
|
||||
#include "z64view.h"
|
||||
#include "z64vis.h"
|
||||
#include "zelda_arena.h"
|
||||
#include "alignment.h"
|
||||
#include "audiothread_cmd.h"
|
||||
#include "seqcmd.h"
|
||||
#include "sequence.h"
|
||||
#include "sfx.h"
|
||||
#include "color.h"
|
||||
#include "libu64/gfxprint.h"
|
||||
#include "z_lib.h"
|
||||
#include "ichain.h"
|
||||
#include "regs.h"
|
||||
#include "irqmgr.h"
|
||||
#include "padmgr.h"
|
||||
@@ -70,10 +42,8 @@
|
||||
#include "gfx.h"
|
||||
#include "gfx_setupdl.h"
|
||||
#include "gfxalloc.h"
|
||||
#include "jpeg.h"
|
||||
#include "prerender.h"
|
||||
#include "rand.h"
|
||||
#include "libc64/qrand.h"
|
||||
#include "sys_math.h"
|
||||
#include "sys_math3d.h"
|
||||
#include "widescreen.h"
|
||||
@@ -103,53 +73,6 @@
|
||||
#include "libc64/sprintf.h"
|
||||
#include "libu64/debug.h"
|
||||
|
||||
#define SCREEN_WIDTH 320
|
||||
#define SCREEN_HEIGHT 240
|
||||
|
||||
#define THREAD_PRI_IDLE_INIT 10
|
||||
#define THREAD_PRI_MAIN_INIT 10
|
||||
#define THREAD_PRI_DMAMGR_LOW 10 // Used when decompressing files
|
||||
#define THREAD_PRI_GRAPH 11
|
||||
#define THREAD_PRI_AUDIOMGR 12
|
||||
#define THREAD_PRI_N64DD 13
|
||||
#define THREAD_PRI_DDMSG 13
|
||||
#define THREAD_PRI_PADMGR 14
|
||||
#define THREAD_PRI_MAIN 15
|
||||
#define THREAD_PRI_SCHED 15
|
||||
#define THREAD_PRI_DMAMGR 16
|
||||
#define THREAD_PRI_IRQMGR 17
|
||||
#define THREAD_PRI_FAULT_CLIENT (OS_PRIORITY_APPMAX - 1)
|
||||
#define THREAD_PRI_FAULT OS_PRIORITY_APPMAX
|
||||
|
||||
#define THREAD_ID_IDLE 1
|
||||
#define THREAD_ID_FAULT 2
|
||||
#define THREAD_ID_MAIN 3
|
||||
#define THREAD_ID_GRAPH 4
|
||||
#define THREAD_ID_SCHED 5
|
||||
#define THREAD_ID_PADMGR 7
|
||||
|
||||
#if ENABLE_PROFILER
|
||||
#define THREAD_ID_PIMGR 8
|
||||
#define THREAD_ID_VIMGR 9
|
||||
#else
|
||||
// Not sure why these are zero in vanilla.
|
||||
#define THREAD_ID_PIMGR 0
|
||||
#define THREAD_ID_VIMGR 0
|
||||
#endif
|
||||
|
||||
#define THREAD_ID_N64DD 8
|
||||
#define THREAD_ID_DDMSG 9
|
||||
#define THREAD_ID_AUDIOMGR 10
|
||||
#define THREAD_ID_DMAMGR 18
|
||||
#define THREAD_ID_IRQMGR 19
|
||||
|
||||
#define VI_CUSTOM_PAL60_LAN1 56 // Custom PAL60 VI mode
|
||||
|
||||
typedef enum LensMode {
|
||||
/* 0 */ LENS_MODE_SHOW_ACTORS, // lens actors are invisible by default, and shown by using lens (for example, invisible enemies)
|
||||
/* 1 */ LENS_MODE_HIDE_ACTORS // lens actors are visible by default, and hidden by using lens (for example, fake walls)
|
||||
} LensMode;
|
||||
|
||||
typedef struct SetupState {
|
||||
/* 0x00 */ GameState state;
|
||||
} SetupState; // size = 0xA4
|
||||
@@ -219,13 +142,6 @@ typedef struct SampleState {
|
||||
/* 0x00A8 */ View view;
|
||||
} SampleState; // size = 0x1D0
|
||||
|
||||
typedef struct QuestHintCmd {
|
||||
/* 0x00 */ u8 byte0;
|
||||
/* 0x01 */ u8 byte1;
|
||||
/* 0x02 */ u8 byte2;
|
||||
/* 0x03 */ u8 byte3;
|
||||
} QuestHintCmd; // size = 0x4
|
||||
|
||||
typedef enum PauseBgPreRenderState {
|
||||
/* 0 */ PAUSE_BG_PRERENDER_OFF, // Inactive, do nothing.
|
||||
/* 1 */ PAUSE_BG_PRERENDER_SETUP, // The current frame is only drawn for the purpose of serving as the pause background.
|
||||
|
||||
@@ -739,6 +739,8 @@ typedef struct NpcInteractInfo {
|
||||
#define TRANSITION_ACTOR_PARAMS_INDEX_SHIFT 10
|
||||
#define GET_TRANSITION_ACTOR_INDEX(actor) PARAMS_GET_NOMASK((u16)(actor)->params, 10)
|
||||
|
||||
extern Gfx D_80116280[];
|
||||
|
||||
void ActorShape_Init(ActorShape* shape, f32 yOffset, ActorShadowFunc shadowDraw, f32 shadowScale);
|
||||
void ActorShadow_DrawCircle(Actor* actor, struct Lights* lights, struct PlayState* play);
|
||||
void ActorShadow_DrawWhiteCircle(Actor* actor, struct Lights* lights, struct PlayState* play);
|
||||
@@ -857,7 +859,7 @@ void Actor_DisableLens(struct PlayState* play);
|
||||
void Actor_InitContext(struct PlayState* play, ActorContext* actorCtx, struct ActorEntry* playerEntry);
|
||||
void Actor_UpdateAll(struct PlayState* play, ActorContext* actorCtx);
|
||||
s32 Actor_CullingVolumeTest(struct PlayState* play, Actor* actor, Vec3f* projPos, f32 projW);
|
||||
void func_800315AC(struct PlayState* play, ActorContext* actorCtx);
|
||||
void Actor_DrawAll(struct PlayState* play, ActorContext* actorCtx);
|
||||
void Actor_KillAllWithMissingObject(struct PlayState* play, ActorContext* actorCtx);
|
||||
void func_80031B14(struct PlayState* play, ActorContext* actorCtx);
|
||||
void func_80031C3C(ActorContext* actorCtx, struct PlayState* play);
|
||||
|
||||
@@ -68,6 +68,13 @@ typedef void (*AudioCustomUpdateFunction)(void);
|
||||
|
||||
#define AUDIO_RELOCATED_ADDRESS_START K0BASE
|
||||
|
||||
typedef enum SoundSetting {
|
||||
/* 0 */ SOUND_SETTING_STEREO,
|
||||
/* 1 */ SOUND_SETTING_MONO,
|
||||
/* 2 */ SOUND_SETTING_HEADSET,
|
||||
/* 3 */ SOUND_SETTING_SURROUND
|
||||
} SoundSetting;
|
||||
|
||||
typedef enum SoundMode {
|
||||
/* 0 */ SOUNDMODE_STEREO,
|
||||
/* 1 */ SOUNDMODE_HEADSET,
|
||||
@@ -1197,7 +1204,7 @@ void func_800F64E0(u8 arg0);
|
||||
void Audio_ToggleMalonSinging(u8 malonSingingDisabled);
|
||||
void Audio_SetEnvReverb(s8 reverb);
|
||||
void Audio_SetCodeReverb(s8 reverb);
|
||||
void func_800F6700(s8 audioSetting);
|
||||
void Audio_SetSoundMode(s8 soundSetting);
|
||||
void Audio_SetBaseFilter(u8);
|
||||
void Audio_SetExtraFilter(u8);
|
||||
void Audio_SetCutsceneFlag(s8 flag);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user