From 791d9018c09925138b9f830f7ae8142119905c05 Mon Sep 17 00:00:00 2001 From: louist103 <35883445+louist103@users.noreply.github.com> Date: Mon, 21 Mar 2022 15:49:11 -0400 Subject: [PATCH] first pass (#1185) --- include/functions.h | 41 ++++++++++++++------------------- src/code/graph.c | 2 +- src/code/rcp_utils.c | 2 +- src/code/sys_cfb.c | 2 +- src/code/z_kaleido_manager.c | 2 +- src/code/z_kaleido_scope_call.c | 2 +- src/code/z_malloc.c | 8 +++---- 7 files changed, 26 insertions(+), 33 deletions(-) diff --git a/include/functions.h b/include/functions.h index d251dd7fd2..e68647bf65 100644 --- a/include/functions.h +++ b/include/functions.h @@ -85,20 +85,20 @@ void osViExtendVStart(u32 arg0); s32 osRecvMesg(OSMesgQueue* mq, OSMesg* msg, s32 flag); void __osInitialize_common(void); void __osInitialize_autodetect(void); -void __osExceptionPreamble(); +void __osExceptionPreamble(void); // ? __osException(?); void __osEnqueueAndYield(OSThread**); void __osEnqueueThread(OSThread**, OSThread*); OSThread* __osPopThread(OSThread**); // ? __osNop(?); -void __osDispatchThread(); +void __osDispatchThread(void); void __osCleanupThread(void); void __osDequeueThread(OSThread** queue, OSThread* thread); void osDestroyThread(OSThread* thread); void bzero(void* __s, u32 __n); void osCreateThread(OSThread* thread, OSId id, void (*entry)(void*), void* arg, void* sp, OSPri pri); void __osSetSR(u32); -u32 __osGetSR(); +u32 __osGetSR(void); void osWritebackDCache(void* vaddr, s32 nbytes); void* osViGetNextFramebuffer(void); void osCreatePiManager(OSPri pri, OSMesgQueue* cmdQ, OSMesg* cmdBuf, s32 cmdMsgCnt); @@ -146,11 +146,11 @@ s32 osEPiReadIo(OSPiHandle* handle, u32 devAddr, u32* data); void osViSetSpecialFeatures(u32 func); OSPiHandle* osCartRomInit(void); void __osSetFpcCsr(u32); -u32 __osGetFpcCsr(); +u32 __osGetFpcCsr(void); s32 osEPiWriteIo(OSPiHandle* handle, u32 devAddr, u32 data); void osMapTLBRdb(void); void osYieldThread(void); -u32 __osGetCause(); +u32 __osGetCause(void); s32 __osEPiRawWriteIo(OSPiHandle* handle, u32 devAddr, u32 data); void _Litob(_Pft* args, u8 type); ldiv_t ldiv(s32 num, s32 denom); @@ -981,12 +981,12 @@ void* ZeldaArena_ReallocDebug(void* ptr, u32 newSize, const char* file, s32 line void ZeldaArena_Free(void* ptr); void ZeldaArena_FreeDebug(void* ptr, const char* file, s32 line); void* ZeldaArena_Calloc(u32 num, u32 size); -void ZeldaArena_Display(); +void ZeldaArena_Display(void); void ZeldaArena_GetSizes(u32* outMaxFree, u32* outFree, u32* outAlloc); -void ZeldaArena_Check(); +void ZeldaArena_Check(void); void ZeldaArena_Init(void* start, u32 size); -void ZeldaArena_Cleanup(); -u8 ZeldaArena_IsInitalized(); +void ZeldaArena_Cleanup(void); +u8 ZeldaArena_IsInitalized(void); void MapMark_Init(GlobalContext* globalCtx); void MapMark_ClearPointers(GlobalContext* globalCtx); void MapMark_Draw(GlobalContext* globalCtx); @@ -1488,9 +1488,9 @@ s32 Mempak_GetFileSize(s32 controllerNb, char idx); void KaleidoManager_LoadOvl(KaleidoMgrOverlay* ovl); void KaleidoManager_ClearOvl(KaleidoMgrOverlay* ovl); void KaleidoManager_Init(GlobalContext* globalCtx); -void KaleidoManager_Destroy(); +void KaleidoManager_Destroy(void); void* KaleidoManager_GetRamAddr(void* vram); -void KaleidoScopeCall_LoadPlayer(); +void KaleidoScopeCall_LoadPlayer(void); void KaleidoScopeCall_Init(GlobalContext* globalCtx); void KaleidoScopeCall_Destroy(GlobalContext* globalCtx); void KaleidoScopeCall_Update(GlobalContext* globalCtx); @@ -1611,7 +1611,7 @@ 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_FaultClient(); +void Graph_FaultClient(void); void Graph_DisassembleUCode(Gfx* workBuf); void Graph_UCodeFaultClient(Gfx* workBuf); void Graph_InitTHGA(GraphicsContext* gfxCtx); @@ -1677,7 +1677,7 @@ void SpeedMeter_DrawAllocEntry(SpeedMeterAllocEntry* this, GraphicsContext* gfxC void SpeedMeter_DrawAllocEntries(SpeedMeter* meter, GraphicsContext* gfxCtx, GameState* state); void SysCfb_Init(s32 n64dd); u32 SysCfb_GetFbPtr(s32 idx); -u32 SysCfb_GetFbEnd(); +u32 SysCfb_GetFbEnd(void); f32 Math_FactorialF(f32 n); f32 Math_Factorial(s32 n); f32 Math_PowF(f32 base, s32 exp); @@ -1808,15 +1808,8 @@ void DebugArena_Check(void); void DebugArena_Init(void* start, u32 size); void DebugArena_Cleanup(void); u8 DebugArena_IsInitalized(void); -// ? UCodeDisas_TranslateAddr(?); -// ? UCodeDisas_ParseCombineColor(?); -// ? UCodeDisas_ParseCombineAlpha(?); void UCodeDisas_Init(UCodeDisas*); void UCodeDisas_Destroy(UCodeDisas*); -// ? UCodeDisas_SetCurUCodeImpl(?); -// ? UCodeDisas_ParseGeometryMode(?); -// ? UCodeDisas_ParseRenderMode(?); -// ? UCodeDisas_PrintVertices(?); // void UCodeDisas_Disassemble(UCodeDisas*, Gfx*); void UCodeDisas_RegisterUCode(UCodeDisas*, s32, UCodeInfo*); void UCodeDisas_SetCurUCode(UCodeDisas*, void*); @@ -2010,12 +2003,12 @@ void func_800F6964(u16); void func_800F6AB0(u16); // ? Audio_DisableAllSeq(?); // ? func_800F6BB8(?); -void Audio_PreNMI(); +void Audio_PreNMI(void); // ? func_800F6C34(?); void Audio_SetNatureAmbienceChannelIO(u8 channelIdxRange, u8 port, u8 val); void Audio_PlayNatureAmbienceSequence(u8 natureAmbienceId); -void Audio_Init(); -void Audio_InitSound(); +void Audio_Init(void); +void Audio_InitSound(void); void func_800F7170(void); void func_800F71BC(s32 arg0); void Audio_SetSoundBanksMute(u16 muteMask); @@ -2060,7 +2053,7 @@ void GfxPrint_Destroy(GfxPrint* this); void GfxPrint_Open(GfxPrint* this, Gfx* dList); Gfx* GfxPrint_Close(GfxPrint* this); s32 GfxPrint_Printf(GfxPrint* this, const char* fmt, ...); -void RcpUtils_PrintRegisterStatus(); +void RcpUtils_PrintRegisterStatus(void); void RcpUtils_Reset(void); void* Overlay_AllocateAndLoad(u32 vRomStart, u32 vRomEnd, void* vRamStart, void* vRamEnd); void MtxConv_F2L(Mtx* m1, MtxF* m2); diff --git a/src/code/graph.c b/src/code/graph.c index 97a7d37920..c178fa9e81 100644 --- a/src/code/graph.c +++ b/src/code/graph.c @@ -24,7 +24,7 @@ UCodeInfo D_8012D248[3] = { }; // clang-format on -void Graph_FaultClient() { +void Graph_FaultClient(void) { void* nextFb = osViGetNextFramebuffer(); void* newFb = ((u32)SysCfb_GetFbPtr(0) != (u32)nextFb) ? SysCfb_GetFbPtr(0) : SysCfb_GetFbPtr(1); diff --git a/src/code/rcp_utils.c b/src/code/rcp_utils.c index ad2bf2b992..d9fc9cd858 100644 --- a/src/code/rcp_utils.c +++ b/src/code/rcp_utils.c @@ -7,7 +7,7 @@ if (x & DPC_STATUS_##name) \ osSyncPrintf(#name " ") -void RcpUtils_PrintRegisterStatus() { +void RcpUtils_PrintRegisterStatus(void) { u32 spStatus = __osSpGetStatus(); u32 dpStatus = osDpGetStatus(); diff --git a/src/code/sys_cfb.c b/src/code/sys_cfb.c index 3c65b7aec3..1d4b5495f7 100644 --- a/src/code/sys_cfb.c +++ b/src/code/sys_cfb.c @@ -49,6 +49,6 @@ u32 SysCfb_GetFbPtr(s32 idx) { return 0; } -u32 SysCfb_GetFbEnd() { +u32 SysCfb_GetFbEnd(void) { return sSysCfbEnd; } diff --git a/src/code/z_kaleido_manager.c b/src/code/z_kaleido_manager.c index dc1ba816d9..acc0ccb364 100644 --- a/src/code/z_kaleido_manager.c +++ b/src/code/z_kaleido_manager.c @@ -67,7 +67,7 @@ void KaleidoManager_Init(GlobalContext* globalCtx) { gKaleidoMgrCurOvl = 0; } -void KaleidoManager_Destroy() { +void KaleidoManager_Destroy(void) { if (gKaleidoMgrCurOvl != NULL) { KaleidoManager_ClearOvl(gKaleidoMgrCurOvl); gKaleidoMgrCurOvl = NULL; diff --git a/src/code/z_kaleido_scope_call.c b/src/code/z_kaleido_scope_call.c index 2a3def4653..13f7ab2054 100644 --- a/src/code/z_kaleido_scope_call.c +++ b/src/code/z_kaleido_scope_call.c @@ -10,7 +10,7 @@ PauseMapMarksData* gLoadedPauseMarkDataTable; extern void KaleidoScope_Update(GlobalContext* globalCtx); extern void KaleidoScope_Draw(GlobalContext* globalCtx); -void KaleidoScopeCall_LoadPlayer() { +void KaleidoScopeCall_LoadPlayer(void) { KaleidoMgrOverlay* playerActorOvl = &gKaleidoMgrOverlayTable[KALEIDO_OVL_PLAYER_ACTOR]; if (gKaleidoMgrCurOvl != playerActorOvl) { diff --git a/src/code/z_malloc.c b/src/code/z_malloc.c index 1094627220..e51d381cb6 100644 --- a/src/code/z_malloc.c +++ b/src/code/z_malloc.c @@ -81,7 +81,7 @@ void* ZeldaArena_Calloc(u32 num, u32 size) { return ret; } -void ZeldaArena_Display() { +void ZeldaArena_Display(void) { osSyncPrintf("ゼルダヒープ表示\n"); // "Zelda heap display" __osDisplayArena(&sZeldaArena); } @@ -90,7 +90,7 @@ void ZeldaArena_GetSizes(u32* outMaxFree, u32* outFree, u32* outAlloc) { ArenaImpl_GetSizes(&sZeldaArena, outMaxFree, outFree, outAlloc); } -void ZeldaArena_Check() { +void ZeldaArena_Check(void) { __osCheckArena(&sZeldaArena); } @@ -99,11 +99,11 @@ void ZeldaArena_Init(void* start, u32 size) { __osMallocInit(&sZeldaArena, start, size); } -void ZeldaArena_Cleanup() { +void ZeldaArena_Cleanup(void) { gZeldaArenaLogSeverity = LOG_SEVERITY_NOLOG; __osMallocCleanup(&sZeldaArena); } -u8 ZeldaArena_IsInitalized() { +u8 ZeldaArena_IsInitalized(void) { return __osMallocIsInitalized(&sZeldaArena); }