mirror of
https://github.com/zeldaret/mm.git
synced 2026-09-04 02:09:46 -04:00
[n64-jp-1.1] libu64/rcp_utils (#1877)
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user