From f344fe648bd71b0b61bbb5f4cf41edcaf12a981d Mon Sep 17 00:00:00 2001 From: hatal175 Date: Mon, 24 Jan 2022 01:04:50 +0200 Subject: [PATCH] Document RCP functions (#1087) * Document RCP functions * Rename functions according to convention * Rename file and functions to RcpUtils --- include/functions.h | 4 ++-- spec | 2 +- src/code/main.c | 2 +- src/code/{code_800FBCE0.c => rcp_utils.c} | 8 ++++---- src/code/sched.c | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) rename src/code/{code_800FBCE0.c => rcp_utils.c} (92%) diff --git a/include/functions.h b/include/functions.h index 18e75bd7c7..561443a29e 100644 --- a/include/functions.h +++ b/include/functions.h @@ -2123,8 +2123,8 @@ 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 func_800FBCE0(); -void func_800FBFD8(void); +void RcpUtils_PrintRegisterStatus(); +void RcpUtils_Reset(void); void* Overlay_AllocateAndLoad(u32 vRomStart, u32 vRomEnd, void* vRamStart, void* vRamEnd); void MtxConv_F2L(Mtx* m1, MtxF* m2); void MtxConv_L2F(MtxF* m1, Mtx* m2); diff --git a/spec b/spec index 0e21e1c440..6d144a5bd6 100644 --- a/spec +++ b/spec @@ -425,7 +425,7 @@ beginseg include "build/src/code/audio_init_params.o" include "build/src/code/logseverity.o" include "build/src/code/gfxprint.o" - include "build/src/code/code_800FBCE0.o" + include "build/src/code/rcp_utils.o" include "build/src/code/loadfragment2.o" include "build/src/code/mtxuty-cvt.o" include "build/src/code/relocation.o" diff --git a/src/code/main.c b/src/code/main.c index fce3972d14..c15449cb68 100644 --- a/src/code/main.c +++ b/src/code/main.c @@ -111,6 +111,6 @@ void Main(void* arg) { osSyncPrintf("mainproc 後始末\n"); // "Cleanup" osDestroyThread(&sGraphThread); - func_800FBFD8(); + RcpUtils_Reset(); osSyncPrintf("mainproc 実行終了\n"); // "End of execution" } diff --git a/src/code/code_800FBCE0.c b/src/code/rcp_utils.c similarity index 92% rename from src/code/code_800FBCE0.c rename to src/code/rcp_utils.c index 65156eda09..ad2bf2b992 100644 --- a/src/code/code_800FBCE0.c +++ b/src/code/rcp_utils.c @@ -7,7 +7,7 @@ if (x & DPC_STATUS_##name) \ osSyncPrintf(#name " ") -void func_800FBCE0() { +void RcpUtils_PrintRegisterStatus() { u32 spStatus = __osSpGetStatus(); u32 dpStatus = osDpGetStatus(); @@ -44,9 +44,9 @@ void func_800FBCE0() { osSyncPrintf("\n"); } -void func_800FBFD8() { - func_800FBCE0(); +void RcpUtils_Reset() { + RcpUtils_PrintRegisterStatus(); osDpSetStatus(DPC_SET_FREEZE | DPC_SET_FLUSH); __osSpSetStatus(SP_SET_HALT | SP_SET_SIG2 | SP_CLR_INTR_BREAK); - func_800FBCE0(); + RcpUtils_PrintRegisterStatus(); } diff --git a/src/code/sched.c b/src/code/sched.c index f3a14893e3..bc14c9a7a1 100644 --- a/src/code/sched.c +++ b/src/code/sched.c @@ -78,7 +78,7 @@ void Sched_HandleReset(SchedContext* sc) { OS_CYCLES_TO_USEC(now - sRSPAudioStartTime), "../sched.c", 421); } else if (OS_CYCLES_TO_USEC(now - sRSPGFXStartTime) > 1000000 || OS_CYCLES_TO_USEC(now - sRDPStartTime) > 1000000) { - func_800FBFD8(); + RcpUtils_Reset(); if (sc->curRSPTask != NULL) { LOG_TIME("(((u64)(now - graph_rsp_start_time)*(1000000LL/15625LL))/((62500000LL*3/4)/15625LL))", OS_CYCLES_TO_USEC(now - sRSPGFXStartTime), "../sched.c", 427);