mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-14 11:00:41 +00:00
Replace most osSyncPrintf calls with PRINTF macro (#1598)
* Replace most osSyncPrintf calls with PRINTF macro * DEBUG -> OOT_DEBUG
This commit is contained in:
parent
6eb3bf401c
commit
324db1d578
297 changed files with 2642 additions and 2679 deletions
|
@ -109,8 +109,8 @@ s32 DmaMgr_DmaRomToRam(uintptr_t rom, void* ram, size_t size) {
|
|||
ioMsg.size = buffSize;
|
||||
|
||||
if (gDmaMgrVerbose == 10) {
|
||||
osSyncPrintf("%10lld ノーマルDMA %08x %08x %08x (%d)\n", OS_CYCLES_TO_USEC(osGetTime()), ioMsg.dramAddr,
|
||||
ioMsg.devAddr, ioMsg.size, MQ_GET_COUNT(&gPiMgrCmdQueue));
|
||||
PRINTF("%10lld ノーマルDMA %08x %08x %08x (%d)\n", OS_CYCLES_TO_USEC(osGetTime()), ioMsg.dramAddr,
|
||||
ioMsg.devAddr, ioMsg.size, MQ_GET_COUNT(&gPiMgrCmdQueue));
|
||||
}
|
||||
|
||||
ret = osEPiStartDma(gCartHandle, &ioMsg, OS_READ);
|
||||
|
@ -119,14 +119,12 @@ s32 DmaMgr_DmaRomToRam(uintptr_t rom, void* ram, size_t size) {
|
|||
}
|
||||
|
||||
if (gDmaMgrVerbose == 10) {
|
||||
osSyncPrintf("%10lld ノーマルDMA START (%d)\n", OS_CYCLES_TO_USEC(osGetTime()),
|
||||
MQ_GET_COUNT(&gPiMgrCmdQueue));
|
||||
PRINTF("%10lld ノーマルDMA START (%d)\n", OS_CYCLES_TO_USEC(osGetTime()), MQ_GET_COUNT(&gPiMgrCmdQueue));
|
||||
}
|
||||
|
||||
osRecvMesg(&queue, NULL, OS_MESG_BLOCK);
|
||||
if (gDmaMgrVerbose == 10) {
|
||||
osSyncPrintf("%10lld ノーマルDMA END (%d)\n", OS_CYCLES_TO_USEC(osGetTime()),
|
||||
MQ_GET_COUNT(&gPiMgrCmdQueue));
|
||||
PRINTF("%10lld ノーマルDMA END (%d)\n", OS_CYCLES_TO_USEC(osGetTime()), MQ_GET_COUNT(&gPiMgrCmdQueue));
|
||||
}
|
||||
|
||||
size -= buffSize;
|
||||
|
@ -143,8 +141,8 @@ s32 DmaMgr_DmaRomToRam(uintptr_t rom, void* ram, size_t size) {
|
|||
ioMsg.size = size;
|
||||
|
||||
if (gDmaMgrVerbose == 10) {
|
||||
osSyncPrintf("%10lld ノーマルDMA %08x %08x %08x (%d)\n", OS_CYCLES_TO_USEC(osGetTime()), ioMsg.dramAddr,
|
||||
ioMsg.devAddr, ioMsg.size, MQ_GET_COUNT(&gPiMgrCmdQueue));
|
||||
PRINTF("%10lld ノーマルDMA %08x %08x %08x (%d)\n", OS_CYCLES_TO_USEC(osGetTime()), ioMsg.dramAddr,
|
||||
ioMsg.devAddr, ioMsg.size, MQ_GET_COUNT(&gPiMgrCmdQueue));
|
||||
}
|
||||
|
||||
ret = osEPiStartDma(gCartHandle, &ioMsg, OS_READ);
|
||||
|
@ -154,7 +152,7 @@ s32 DmaMgr_DmaRomToRam(uintptr_t rom, void* ram, size_t size) {
|
|||
|
||||
osRecvMesg(&queue, NULL, OS_MESG_BLOCK);
|
||||
if (gDmaMgrVerbose == 10) {
|
||||
osSyncPrintf("%10lld ノーマルDMA END (%d)\n", OS_CYCLES_TO_USEC(osGetTime()), MQ_GET_COUNT(&gPiMgrCmdQueue));
|
||||
PRINTF("%10lld ノーマルDMA END (%d)\n", OS_CYCLES_TO_USEC(osGetTime()), MQ_GET_COUNT(&gPiMgrCmdQueue));
|
||||
}
|
||||
|
||||
end:
|
||||
|
@ -182,13 +180,13 @@ s32 DmaMgr_AudioDmaHandler(OSPiHandle* pihandle, OSIoMesg* mb, s32 direction) {
|
|||
ASSERT(mb != NULL, "mb != NULL", "../z_std_dma.c", 532);
|
||||
|
||||
if (gDmaMgrVerbose == 10) {
|
||||
osSyncPrintf("%10lld サウンドDMA %08x %08x %08x (%d)\n", OS_CYCLES_TO_USEC(osGetTime()), mb->dramAddr,
|
||||
mb->devAddr, mb->size, MQ_GET_COUNT(&gPiMgrCmdQueue));
|
||||
PRINTF("%10lld サウンドDMA %08x %08x %08x (%d)\n", OS_CYCLES_TO_USEC(osGetTime()), mb->dramAddr, mb->devAddr,
|
||||
mb->size, MQ_GET_COUNT(&gPiMgrCmdQueue));
|
||||
}
|
||||
|
||||
ret = osEPiStartDma(pihandle, mb, direction);
|
||||
if (ret != 0) {
|
||||
osSyncPrintf("OOPS!!\n");
|
||||
PRINTF("OOPS!!\n");
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
@ -238,20 +236,20 @@ NORETURN void DmaMgr_Error(DmaRequest* req, const char* file, const char* errorN
|
|||
char buff1[80];
|
||||
char buff2[80];
|
||||
|
||||
osSyncPrintf("%c", BEL);
|
||||
osSyncPrintf(VT_FGCOL(RED));
|
||||
PRINTF("%c", BEL);
|
||||
PRINTF(VT_FGCOL(RED));
|
||||
// "DMA Fatal Error"
|
||||
osSyncPrintf("DMA致命的エラー(%s)\nROM:%X RAM:%X SIZE:%X %s\n",
|
||||
errorDesc != NULL ? errorDesc : (errorName != NULL ? errorName : "???"), vrom, ram, size,
|
||||
file != NULL ? file : "???");
|
||||
PRINTF("DMA致命的エラー(%s)\nROM:%X RAM:%X SIZE:%X %s\n",
|
||||
errorDesc != NULL ? errorDesc : (errorName != NULL ? errorName : "???"), vrom, ram, size,
|
||||
file != NULL ? file : "???");
|
||||
|
||||
if (req->filename != NULL) { // Source file name that issued the DMA request
|
||||
osSyncPrintf("DMA ERROR: %s %d", req->filename, req->line);
|
||||
PRINTF("DMA ERROR: %s %d", req->filename, req->line);
|
||||
} else if (sDmaMgrCurFileName != NULL) {
|
||||
osSyncPrintf("DMA ERROR: %s %d", sDmaMgrCurFileName, sDmaMgrCurFileLine);
|
||||
PRINTF("DMA ERROR: %s %d", sDmaMgrCurFileName, sDmaMgrCurFileLine);
|
||||
}
|
||||
|
||||
osSyncPrintf(VT_RST);
|
||||
PRINTF(VT_RST);
|
||||
|
||||
if (req->filename != NULL) {
|
||||
sprintf(buff1, "DMA ERROR: %s %d", req->filename, req->line);
|
||||
|
@ -320,7 +318,7 @@ void DmaMgr_ProcessRequest(DmaRequest* req) {
|
|||
// The string is defined in .rodata but not used, suggesting a debug print is here but was optimized out in
|
||||
// some way. The last arg of this print looks like it may be filename, but filename above this block does not
|
||||
// match.
|
||||
osSyncPrintf("DMA ROM:%08X RAM:%08X SIZE:%08X %s\n");
|
||||
PRINTF("DMA ROM:%08X RAM:%08X SIZE:%08X %s\n");
|
||||
}
|
||||
|
||||
// Get the filename (for debugging)
|
||||
|
@ -350,7 +348,7 @@ void DmaMgr_ProcessRequest(DmaRequest* req) {
|
|||
found = true;
|
||||
|
||||
if (0) {
|
||||
osSyncPrintf("No Press ROM:%08X RAM:%08X SIZE:%08X\n", vrom, ram, size);
|
||||
PRINTF("No Press ROM:%08X RAM:%08X SIZE:%08X\n", vrom, ram, size);
|
||||
}
|
||||
} else {
|
||||
// File is compressed. Files that are stored compressed must be loaded into RAM all at once.
|
||||
|
@ -382,7 +380,7 @@ void DmaMgr_ProcessRequest(DmaRequest* req) {
|
|||
found = true;
|
||||
|
||||
if (0) {
|
||||
osSyncPrintf(" Press ROM:%X RAM:%X SIZE:%X\n", vrom, ram, size);
|
||||
PRINTF(" Press ROM:%X RAM:%X SIZE:%X\n", vrom, ram, size);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -404,7 +402,7 @@ void DmaMgr_ProcessRequest(DmaRequest* req) {
|
|||
DmaMgr_DmaRomToRam(vrom, ram, size);
|
||||
|
||||
if (0) {
|
||||
osSyncPrintf("No Press ROM:%08X RAM:%08X SIZE:%08X (非公式)\n", vrom, ram, size);
|
||||
PRINTF("No Press ROM:%08X RAM:%08X SIZE:%08X (非公式)\n", vrom, ram, size);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -415,7 +413,7 @@ void DmaMgr_ThreadEntry(void* arg) {
|
|||
DmaRequest* req;
|
||||
|
||||
// "DMA manager thread execution start"
|
||||
osSyncPrintf("DMAマネージャスレッド実行開始\n");
|
||||
PRINTF("DMAマネージャスレッド実行開始\n");
|
||||
|
||||
while (true) {
|
||||
// Wait for DMA Requests to arrive from other threads
|
||||
|
@ -426,7 +424,7 @@ void DmaMgr_ThreadEntry(void* arg) {
|
|||
}
|
||||
|
||||
if (0) {
|
||||
osSyncPrintf("DMA登録受付 dmap=%08x\n", req);
|
||||
PRINTF("DMA登録受付 dmap=%08x\n", req);
|
||||
}
|
||||
|
||||
// Process the DMA request
|
||||
|
@ -436,13 +434,13 @@ void DmaMgr_ThreadEntry(void* arg) {
|
|||
if (req->notifyQueue != NULL) {
|
||||
osSendMesg(req->notifyQueue, req->notifyMsg, OS_MESG_NOBLOCK);
|
||||
if (0) {
|
||||
osSyncPrintf("osSendMesg: dmap=%08x, mq=%08x, m=%08x \n", req, req->notifyQueue, req->notifyMsg);
|
||||
PRINTF("osSendMesg: dmap=%08x, mq=%08x, m=%08x \n", req, req->notifyQueue, req->notifyMsg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// "DMA manager thread execution end"
|
||||
osSyncPrintf("DMAマネージャスレッド実行終了\n");
|
||||
PRINTF("DMAマネージャスレッド実行終了\n");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -477,13 +475,13 @@ s32 DmaMgr_RequestAsync(DmaRequest* req, void* ram, uintptr_t vrom, size_t size,
|
|||
|
||||
if (1 && (sDmaMgrQueueFullLogged == 0) && MQ_IS_FULL(&sDmaMgrMsgQueue)) {
|
||||
sDmaMgrQueueFullLogged++;
|
||||
osSyncPrintf("%c", BEL);
|
||||
osSyncPrintf(VT_FGCOL(RED));
|
||||
PRINTF("%c", BEL);
|
||||
PRINTF(VT_FGCOL(RED));
|
||||
// "dmaEntryMsgQ is full. Reconsider your queue size."
|
||||
osSyncPrintf("dmaEntryMsgQが一杯です。キューサイズの再検討をおすすめします。");
|
||||
PRINTF("dmaEntryMsgQが一杯です。キューサイズの再検討をおすすめします。");
|
||||
LOG_NUM("(sizeof(dmaEntryMsgBufs) / sizeof(dmaEntryMsgBufs[0]))", ARRAY_COUNT(sDmaMgrMsgBuf), "../z_std_dma.c",
|
||||
952);
|
||||
osSyncPrintf(VT_RST);
|
||||
PRINTF(VT_RST);
|
||||
}
|
||||
|
||||
osSendMesg(&sDmaMgrMsgQueue, (OSMesg)req, OS_MESG_BLOCK);
|
||||
|
@ -523,7 +521,7 @@ void DmaMgr_Init(void) {
|
|||
// DMA the dma data table to RAM
|
||||
DmaMgr_DmaRomToRam((uintptr_t)_dmadataSegmentRomStart, _dmadataSegmentStart,
|
||||
(u32)(_dmadataSegmentRomEnd - _dmadataSegmentRomStart));
|
||||
osSyncPrintf("dma_rom_ad[]\n");
|
||||
PRINTF("dma_rom_ad[]\n");
|
||||
|
||||
sDmaMgrIsRomCompressed = false;
|
||||
name = sDmaMgrFileNames;
|
||||
|
@ -536,10 +534,9 @@ void DmaMgr_Init(void) {
|
|||
sDmaMgrIsRomCompressed = true;
|
||||
}
|
||||
|
||||
osSyncPrintf(
|
||||
"%3d %08x %08x %08x %08x %08x %c %s\n", idx, iter->vromStart, iter->vromEnd, iter->romStart, iter->romEnd,
|
||||
(iter->romEnd != 0) ? iter->romEnd - iter->romStart : iter->vromEnd - iter->vromStart,
|
||||
(((iter->romEnd != 0) ? iter->romEnd - iter->romStart : 0) > 0x10000) ? '*' : ' ', name ? *name : "");
|
||||
PRINTF("%3d %08x %08x %08x %08x %08x %c %s\n", idx, iter->vromStart, iter->vromEnd, iter->romStart,
|
||||
iter->romEnd, (iter->romEnd != 0) ? iter->romEnd - iter->romStart : iter->vromEnd - iter->vromStart,
|
||||
(((iter->romEnd != 0) ? iter->romEnd - iter->romStart : 0) > 0x10000) ? '*' : ' ', name ? *name : "");
|
||||
|
||||
idx++;
|
||||
iter++;
|
||||
|
@ -551,8 +548,8 @@ void DmaMgr_Init(void) {
|
|||
|
||||
// Ensure that the boot segment always follows after the makerom segment.
|
||||
if ((uintptr_t)_bootSegmentRomStart != gDmaDataTable[0].vromEnd) {
|
||||
osSyncPrintf("_bootSegmentRomStart(%08x) != dma_rom_ad[0].rom_b(%08x)\n", _bootSegmentRomStart,
|
||||
gDmaDataTable[0].vromEnd);
|
||||
PRINTF("_bootSegmentRomStart(%08x) != dma_rom_ad[0].rom_b(%08x)\n", _bootSegmentRomStart,
|
||||
gDmaDataTable[0].vromEnd);
|
||||
//! @bug The main code file where fault.c resides is not yet loaded
|
||||
Fault_AddHungupAndCrash("../z_std_dma.c", 1055);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue