diff options
| author | Derek Hensley <hensley.derek58@gmail.com> | 2026-08-29 15:19:33 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-08-29 15:19:33 -0700 |
| commit | 794ae593151a24ae5d4eeb8e3105918d8ffa0551 (patch) | |
| tree | bda4549947a4f9c7ace1d8e796903eefacb0d766 /src/boot | |
| parent | acffd6443fb136b9ae105785863900ecd96c5ebf (diff) | |
[n64-jp-1.1] libu64/rcp_utils (#1877)
Diffstat (limited to 'src/boot')
| -rw-r--r-- | src/boot/libu64/rcp_utils.c | 53 |
1 files changed, 47 insertions, 6 deletions
diff --git a/src/boot/libu64/rcp_utils.c b/src/boot/libu64/rcp_utils.c index f587fad21..9b875dfa9 100644 --- a/src/boot/libu64/rcp_utils.c +++ b/src/boot/libu64/rcp_utils.c @@ -1,16 +1,57 @@ #include "ultra64.h" +#include "macros.h" + +#if MM_VERSION < N64_US || DEBUG_FEATURES +#define RCP_UTILS_PRINTF osSyncPrintf +#elif IDO_PRINTF_WORKAROUND +#define RCP_UTILS_PRINTF(args) (void)0 +#else +#define RCP_UTILS_PRINTF(format, ...) (void)0 +#endif + +#define printSpStatus(x, name) \ + if (x & SP_STATUS_##name) \ + RCP_UTILS_PRINTF(#name " ") + +#define printDpStatus(x, name) \ + if (x & DPC_STATUS_##name) \ + RCP_UTILS_PRINTF(#name " ") void RcpUtils_PrintRegisterStatus(void) { u32 spStatus = __osSpGetStatus(); u32 dpStatus = osDpGetStatus(); - if (spStatus) { - // stubbed debug prints - } + RCP_UTILS_PRINTF("osSpGetStatus=%08x: ", spStatus); + printSpStatus(spStatus, HALT); + printSpStatus(spStatus, BROKE); + printSpStatus(spStatus, DMA_BUSY); + printSpStatus(spStatus, DMA_FULL); + printSpStatus(spStatus, IO_FULL); + printSpStatus(spStatus, SSTEP); + printSpStatus(spStatus, INTR_BREAK); + printSpStatus(spStatus, YIELD); + printSpStatus(spStatus, YIELDED); + printSpStatus(spStatus, TASKDONE); + printSpStatus(spStatus, SIG3); + printSpStatus(spStatus, SIG4); + printSpStatus(spStatus, SIG5); + printSpStatus(spStatus, SIG6); + printSpStatus(spStatus, SIG7); + RCP_UTILS_PRINTF("\n"); - if (dpStatus) { - // stubbed debug prints - } + RCP_UTILS_PRINTF("osDpGetStatus=%08x:", dpStatus); + printDpStatus(dpStatus, XBUS_DMEM_DMA); + printDpStatus(dpStatus, FREEZE); + printDpStatus(dpStatus, FLUSH); + printDpStatus(dpStatus, START_GCLK); + printDpStatus(dpStatus, TMEM_BUSY); + printDpStatus(dpStatus, PIPE_BUSY); + printDpStatus(dpStatus, CMD_BUSY); + printDpStatus(dpStatus, CBUF_READY); + printDpStatus(dpStatus, DMA_BUSY); + printDpStatus(dpStatus, END_VALID); + printDpStatus(dpStatus, START_VALID); + RCP_UTILS_PRINTF("\n"); } void RcpUtils_Reset(void) { |
