summaryrefslogtreecommitdiff
path: root/src/code
diff options
context:
space:
mode:
authorDragorn421 <Dragorn421@users.noreply.github.com>2024-08-22 22:33:50 +0200
committerGitHub <noreply@github.com>2024-08-22 22:33:50 +0200
commit98ba7ad2ab05be017722c9dc46b0929e5c911f55 (patch)
tree3e44b249ed7aecc2817236d1c460303695ace4b4 /src/code
parentbdfa56e72d45c2f7e37d4b92afe17c584939f59b (diff)
Add T macro for translated debug strings (#2064)
* Add T macro for translated debug strings * Hyral -> Hyrule * put some more care into z_std_dma
Diffstat (limited to 'src/code')
-rw-r--r--src/code/__osMalloc.c32
-rw-r--r--src/code/audio_thread_manager.c7
-rw-r--r--src/code/game.c54
-rw-r--r--src/code/graph.c34
-rw-r--r--src/code/main.c20
-rw-r--r--src/code/padmgr.c52
-rw-r--r--src/code/sys_cfb.c17
-rw-r--r--src/code/system_malloc.c8
-rw-r--r--src/code/title_setup.c2
-rw-r--r--src/code/z_DLF.c4
-rw-r--r--src/code/z_construct.c18
-rw-r--r--src/code/z_kaleido_manager.c5
12 files changed, 124 insertions, 129 deletions
diff --git a/src/code/__osMalloc.c b/src/code/__osMalloc.c
index bcd0132db..c70b5ce77 100644
--- a/src/code/__osMalloc.c
+++ b/src/code/__osMalloc.c
@@ -745,9 +745,9 @@ void __osDisplayArena(Arena* arena) {
freeSize = 0;
allocatedSize = 0;
- osSyncPrintf("アリーナの内容 (0x%08x)\n", arena); // "Arena contents (0x%08x)"
- // "Memory node range status size [time s ms us ns: TID: src: line]"
- osSyncPrintf("メモリブロック範囲 status サイズ [時刻 s ms us ns: TID:src:行]\n");
+ osSyncPrintf(T("アリーナの内容 (0x%08x)\n", "Arena contents (0x%08x)\n"), arena);
+ osSyncPrintf(T("メモリブロック範囲 status サイズ [時刻 s ms us ns: TID:src:行]\n",
+ "Memory node range status size [time s ms us ns: TID:src:line]\n"));
iter = arena->head;
while (iter != NULL) {
@@ -755,8 +755,7 @@ void __osDisplayArena(Arena* arena) {
next = iter->next;
osSyncPrintf("%08x-%08x%c %s %08x", iter, ((u32)iter + sizeof(ArenaNode) + iter->size),
(next == NULL) ? '$' : (iter != next->prev ? '!' : ' '),
- iter->isFree ? "空き" : "確保", //? "Free" : "Secure"
- iter->size);
+ iter->isFree ? T("空き", "Free") : T("確保", "Secure"), iter->size);
if (!iter->isFree) {
osSyncPrintf(" [%016llu:%2d:%s:%d]", OS_CYCLES_TO_NSEC(iter->time), iter->threadId,
@@ -780,12 +779,10 @@ void __osDisplayArena(Arena* arena) {
iter = next;
}
- // "Total reserved node size 0x%08x bytes"
- osSyncPrintf("確保ブロックサイズの合計 0x%08x バイト\n", allocatedSize);
- // "Total free node size 0x%08x bytes"
- osSyncPrintf("空きブロックサイズの合計 0x%08x バイト\n", freeSize);
- // "Maximum free node size 0x%08x bytes"
- osSyncPrintf("最大空きブロックサイズ 0x%08x バイト\n", maxFree);
+ osSyncPrintf(T("確保ブロックサイズの合計 0x%08x バイト\n", "Total reserved node size 0x%08x bytes\n"),
+ allocatedSize);
+ osSyncPrintf(T("空きブロックサイズの合計 0x%08x バイト\n", "Total free node size 0x%08x bytes\n"), freeSize);
+ osSyncPrintf(T("最大空きブロックサイズ 0x%08x バイト\n", "Maximum free node size 0x%08x bytes\n"), maxFree);
ArenaImpl_Unlock(arena);
}
@@ -846,16 +843,17 @@ u32 __osCheckArena(Arena* arena) {
u32 error = 0;
ArenaImpl_Lock(arena);
- // "Checking the contents of the arena. . . (%08x)"
- osSyncPrintf("アリーナの内容をチェックしています... (%08x)\n", arena);
+ osSyncPrintf(
+ T("アリーナの内容をチェックしています... (%08x)\n", "Checking the contents of the arena... (%08x)\n"),
+ arena);
iter = arena->head;
while (iter != NULL) {
if (iter && iter->magic == NODE_MAGIC) {
- // "Oops!! (%08x %08x)"
#if OOT_DEBUG
- osSyncPrintf(VT_COL(RED, WHITE) "おおっと!! (%08x %08x)\n" VT_RST, iter, iter->magic);
+ osSyncPrintf(VT_COL(RED, WHITE) T("おおっと!! (%08x %08x)\n", "Oops!! (%08x %08x)\n") VT_RST, iter,
+ iter->magic);
#else
- osSyncPrintf("おおっと!! (%08x %08x)\n", iter, iter->magic);
+ osSyncPrintf(T("おおっと!! (%08x %08x)\n", "Oops!! (%08x %08x)\n"), iter, iter->magic);
#endif
error = 1;
break;
@@ -863,7 +861,7 @@ u32 __osCheckArena(Arena* arena) {
iter = NODE_GET_NEXT(iter);
}
if (error == 0) {
- osSyncPrintf("アリーナはまだ、いけそうです\n"); // "The arena is still going well"
+ osSyncPrintf(T("アリーナはまだ、いけそうです\n", "The arena is still going well\n"));
}
ArenaImpl_Unlock(arena);
diff --git a/src/code/audio_thread_manager.c b/src/code/audio_thread_manager.c
index 32c5826a5..a2e03cb72 100644
--- a/src/code/audio_thread_manager.c
+++ b/src/code/audio_thread_manager.c
@@ -81,8 +81,8 @@ void AudioMgr_HandleRetrace(AudioMgr* audioMgr) {
* @see Audio_PreNMI
*/
void AudioMgr_HandlePreNMI(AudioMgr* audioMgr) {
- // "Audio manager received OS_SC_PRE_NMI_MSG"
- PRINTF("オーディオマネージャが OS_SC_PRE_NMI_MSG を受け取りました\n");
+ PRINTF(
+ T("オーディオマネージャが OS_SC_PRE_NMI_MSG を受け取りました\n", "Audio manager received OS_SC_PRE_NMI_MSG\n"));
Audio_PreNMI();
}
@@ -91,8 +91,7 @@ void AudioMgr_ThreadEntry(void* arg) {
IrqMgrClient irqClient;
s16* msg = NULL;
- // "Start running audio manager thread"
- PRINTF("オーディオマネージャスレッド実行開始\n");
+ PRINTF(T("オーディオマネージャスレッド実行開始\n", "Start running audio manager thread\n"));
// Initialize audio driver
Audio_Init();
diff --git a/src/code/game.c b/src/code/game.c
index 7a247dafe..e10d650fb 100644
--- a/src/code/game.c
+++ b/src/code/game.c
@@ -187,8 +187,9 @@ void GameState_Draw(GameState* gameState, GraphicsContext* gfxCtx) {
s32 pad;
DebugArena_Display();
SystemArena_Display();
- // "%08x bytes left until the death of Hyrule (game_alloc)"
- PRINTF("ハイラル滅亡まであと %08x バイト(game_alloc)\n", THA_GetRemaining(&gameState->tha));
+ PRINTF(T("ハイラル滅亡まであと %08x バイト(game_alloc)\n",
+ "%08x bytes left until Hyrule is destroyed (game_alloc)\n"),
+ THA_GetRemaining(&gameState->tha));
#endif
R_ENABLE_ARENA_DBG = 0;
}
@@ -341,15 +342,15 @@ void GameState_Update(GameState* gameState) {
void GameState_InitArena(GameState* gameState, size_t size) {
void* arena;
- PRINTF("ハイラル確保 サイズ=%u バイト\n", size); // "Hyrule reserved size = %u bytes"
+ PRINTF(T("ハイラル確保 サイズ=%u バイト\n", "Hyrule reserved size = %u bytes\n"), size);
arena = GAME_ALLOC_MALLOC(&gameState->alloc, size, "../game.c", 992);
if (arena != NULL) {
THA_Init(&gameState->tha, arena, size);
- PRINTF("ハイラル確保成功\n"); // "Successful Hyral"
+ PRINTF(T("ハイラル確保成功\n", "Hyrule successfully secured\n"));
} else {
THA_Init(&gameState->tha, NULL, 0);
- PRINTF("ハイラル確保失敗\n"); // "Failure to secure Hyrule"
+ PRINTF(T("ハイラル確保失敗\n", "Failure to secure Hyrule\n"));
HUNGUP_AND_CRASH("../game.c", 999);
}
}
@@ -364,28 +365,28 @@ void GameState_Realloc(GameState* gameState, size_t size) {
THA_Destroy(&gameState->tha);
GameAlloc_Free(alloc, thaStart);
- PRINTF("ハイラル一時解放!!\n"); // "Hyrule temporarily released!!"
+ PRINTF(T("ハイラル一時解放!!\n", "Hyrule temporarily released!!\n"));
SystemArena_GetSizes(&systemMaxFree, &systemFree, &systemAlloc);
if ((systemMaxFree - 0x10) < size) {
PRINTF("%c", BEL);
PRINTF(VT_FGCOL(RED));
- // "Not enough memory. Change the hyral size to the largest possible value"
- PRINTF("メモリが足りません。ハイラルサイズを可能な最大値に変更します\n");
+ PRINTF(T("メモリが足りません。ハイラルサイズを可能な最大値に変更します\n",
+ "Not enough memory. Change Hyrule size to maximum possible value\n"));
PRINTF("(hyral=%08x max=%08x free=%08x alloc=%08x)\n", size, systemMaxFree, systemFree, systemAlloc);
PRINTF(VT_RST);
size = systemMaxFree - 0x10;
}
- PRINTF("ハイラル再確保 サイズ=%u バイト\n", size); // "Hyral reallocate size = %u bytes"
+ PRINTF(T("ハイラル再確保 サイズ=%u バイト\n", "Hyrule reallocate size = %u bytes\n"), size);
gameArena = GAME_ALLOC_MALLOC(alloc, size, "../game.c", 1033);
if (gameArena != NULL) {
THA_Init(&gameState->tha, gameArena, size);
- PRINTF("ハイラル再確保成功\n"); // "Successful reacquisition of Hyrule"
+ PRINTF(T("ハイラル再確保成功\n", "Successful reacquisition of Hyrule\n"));
} else {
THA_Init(&gameState->tha, NULL, 0);
- PRINTF("ハイラル再確保失敗\n"); // "Failure to secure Hyral"
+ PRINTF(T("ハイラル再確保失敗\n", "Failure to secure Hyrule\n"));
#if OOT_DEBUG
SystemArena_Display();
@@ -398,7 +399,7 @@ void GameState_Init(GameState* gameState, GameStateFunc init, GraphicsContext* g
OSTime startTime;
OSTime endTime;
- PRINTF("game コンストラクタ開始\n"); // "game constructor start"
+ PRINTF(T("game コンストラクタ開始\n", "game constructor start\n"));
gameState->gfxCtx = gfxCtx;
gameState->frames = 0;
gameState->main = NULL;
@@ -413,23 +414,22 @@ void GameState_Init(GameState* gameState, GameStateFunc init, GraphicsContext* g
{
s32 requiredScopeTemp;
endTime = osGetTime();
- // "game_set_next_game_null processing time %d us"
- PRINTF("game_set_next_game_null 処理時間 %d us\n", OS_CYCLES_TO_USEC(endTime - startTime));
+ PRINTF(T("game_set_next_game_null 処理時間 %d us\n", "game_set_next_game_null processing time %d us\n"),
+ OS_CYCLES_TO_USEC(endTime - startTime));
startTime = endTime;
GameAlloc_Init(&gameState->alloc);
}
endTime = osGetTime();
- // "gamealloc_init processing time %d us"
- PRINTF("gamealloc_init 処理時間 %d us\n", OS_CYCLES_TO_USEC(endTime - startTime));
+ PRINTF(T("gamealloc_init 処理時間 %d us\n", "gamealloc_init processing time %d us\n"),
+ OS_CYCLES_TO_USEC(endTime - startTime));
startTime = endTime;
GameState_InitArena(gameState, 0x100000);
R_UPDATE_RATE = 3;
init(gameState);
endTime = osGetTime();
- // "init processing time %d us"
- PRINTF("init 処理時間 %d us\n", OS_CYCLES_TO_USEC(endTime - startTime));
+ PRINTF(T("init 処理時間 %d us\n", "init processing time %d us\n"), OS_CYCLES_TO_USEC(endTime - startTime));
startTime = endTime;
LOG_UTILS_CHECK_NULL_POINTER("this->cleanup", gameState->destroy, "../game.c", 1088);
@@ -443,18 +443,18 @@ void GameState_Init(GameState* gameState, GameStateFunc init, GraphicsContext* g
Rumble_Init();
osSendMesg(&gameState->gfxCtx->queue, NULL, OS_MESG_BLOCK);
endTime = osGetTime();
- // "Other initialization processing time %d us"
- PRINTF("その他初期化 処理時間 %d us\n", OS_CYCLES_TO_USEC(endTime - startTime));
+ PRINTF(T("その他初期化 処理時間 %d us\n", "Other initialization processing time %d us\n"),
+ OS_CYCLES_TO_USEC(endTime - startTime));
#if OOT_DEBUG
Fault_AddClient(&sGameFaultClient, GameState_FaultPrint, NULL, NULL);
#endif
- PRINTF("game コンストラクタ終了\n"); // "game constructor end"
+ PRINTF(T("game コンストラクタ終了\n", "game constructor end\n"));
}
void GameState_Destroy(GameState* gameState) {
- PRINTF("game デストラクタ開始\n"); // "game destructor start"
+ PRINTF(T("game デストラクタ開始\n", "game destructor start\n"));
AudioMgr_StopAllSfx();
Audio_Update();
osRecvMesg(&gameState->gfxCtx->queue, NULL, OS_MESG_BLOCK);
@@ -478,7 +478,7 @@ void GameState_Destroy(GameState* gameState) {
Fault_RemoveClient(&sGameFaultClient);
#endif
- PRINTF("game デストラクタ終了\n"); // "game destructor end"
+ PRINTF(T("game デストラクタ終了\n", "game destructor end\n"));
}
GameStateFunc GameState_GetInit(GameState* gameState) {
@@ -501,14 +501,14 @@ void* GameState_Alloc(GameState* gameState, size_t size, const char* file, int l
PRINTF("ハイラルは滅亡している\n");
ret = NULL;
} else if ((u32)THA_GetRemaining(&gameState->tha) < size) {
- // "Hyral on the verge of extinction does not have %d bytes left (%d bytes until extinction)"
- PRINTF("滅亡寸前のハイラルには %d バイトの余力もない(滅亡まであと %d バイト)\n", size,
- THA_GetRemaining(&gameState->tha));
+ PRINTF(T("滅亡寸前のハイラルには %d バイトの余力もない(滅亡まであと %d バイト)\n",
+ "Hyrule on the verge of extinction does not have %d bytes left (%d bytes until extinction)\n"),
+ size, THA_GetRemaining(&gameState->tha));
ret = NULL;
} else {
ret = THA_AllocTailAlign16(&gameState->tha, size);
if (THA_IsCrash(&gameState->tha)) {
- PRINTF("ハイラルは滅亡してしまった\n"); // "Hyrule has been destroyed"
+ PRINTF(T("ハイラルは滅亡してしまった\n", "Hyrule has been destroyed\n"));
ret = NULL;
}
}
diff --git a/src/code/graph.c b/src/code/graph.c
index 8ebad9d4e..1fffacac5 100644
--- a/src/code/graph.c
+++ b/src/code/graph.c
@@ -184,7 +184,7 @@ void Graph_TaskSet00(GraphicsContext* gfxCtx) {
if (msg == (OSMesg)666) {
#if OOT_DEBUG
PRINTF(VT_FGCOL(RED));
- PRINTF("RCPが帰ってきませんでした。"); // "RCP did not return."
+ PRINTF(T("RCPが帰ってきませんでした。", "RCP did not return."));
PRINTF(VT_RST);
LogUtils_LogHexDump((void*)PHYS_TO_K1(SP_BASE_REG), 0x20);
@@ -364,8 +364,8 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) {
if (pool->headMagic != GFXPOOL_HEAD_MAGIC) {
//! @bug (?) : "problem = true;" may be missing
PRINTF("%c", BEL);
- // "Dynamic area head is destroyed"
- PRINTF(VT_COL(RED, WHITE) "ダイナミック領域先頭が破壊されています\n" VT_RST);
+ PRINTF(VT_COL(RED, WHITE) T("ダイナミック領域先頭が破壊されています\n", "Dynamic area head is destroyed\n")
+ VT_RST);
#if PLATFORM_N64
Fault_AddHungupAndCrash("../graph.c", 951);
#else
@@ -375,8 +375,8 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) {
if (pool->tailMagic != GFXPOOL_TAIL_MAGIC) {
problem = true;
PRINTF("%c", BEL);
- // "Dynamic region tail is destroyed"
- PRINTF(VT_COL(RED, WHITE) "ダイナミック領域末尾が破壊されています\n" VT_RST);
+ PRINTF(VT_COL(RED, WHITE)
+ T("ダイナミック領域末尾が破壊されています\n", "Dynamic region tail is destroyed\n") VT_RST);
#if PLATFORM_N64
Fault_AddHungupAndCrash("../graph.c", 957);
#else
@@ -388,20 +388,20 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) {
if (THGA_IsCrash(&gfxCtx->polyOpa)) {
problem = true;
PRINTF("%c", BEL);
- // "Zelda 0 is dead"
- PRINTF(VT_COL(RED, WHITE) "ゼルダ0は死んでしまった(graph_alloc is empty)\n" VT_RST);
+ PRINTF(VT_COL(RED, WHITE) T("ゼルダ0は死んでしまった(graph_alloc is empty)\n",
+ "Zelda 0 is dead (graph_alloc is empty)\n") VT_RST);
}
if (THGA_IsCrash(&gfxCtx->polyXlu)) {
problem = true;
PRINTF("%c", BEL);
- // "Zelda 1 is dead"
- PRINTF(VT_COL(RED, WHITE) "ゼルダ1は死んでしまった(graph_alloc is empty)\n" VT_RST);
+ PRINTF(VT_COL(RED, WHITE) T("ゼルダ1は死んでしまった(graph_alloc is empty)\n",
+ "Zelda 1 is dead (graph_alloc is empty)\n") VT_RST);
}
if (THGA_IsCrash(&gfxCtx->overlay)) {
problem = true;
PRINTF("%c", BEL);
- // "Zelda 4 is dead"
- PRINTF(VT_COL(RED, WHITE) "ゼルダ4は死んでしまった(graph_alloc is empty)\n" VT_RST);
+ PRINTF(VT_COL(RED, WHITE) T("ゼルダ4は死んでしまった(graph_alloc is empty)\n",
+ "Zelda 4 is dead (graph_alloc is empty)\n") VT_RST);
}
if (!problem) {
@@ -438,8 +438,8 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) {
}
if (gIsCtrlr2Valid && PreNmiBuff_IsResetting(gAppNmiBufferPtr) && !gameState->inPreNMIState) {
- // "To reset mode"
- PRINTF(VT_COL(YELLOW, BLACK) "PRE-NMIによりリセットモードに移行します\n" VT_RST);
+ PRINTF(VT_COL(YELLOW, BLACK) T("PRE-NMIによりリセットモードに移行します\n",
+ "PRE-NMI causes the system to transition to reset mode\n") VT_RST);
SET_NEXT_GAMESTATE(gameState, PreNMI_Init, PreNMIState);
gameState->running = false;
}
@@ -453,7 +453,7 @@ void Graph_ThreadEntry(void* arg0) {
GameStateOverlay* nextOvl = &gGameStateOverlayTable[GAMESTATE_SETUP];
GameStateOverlay* ovl;
- PRINTF("グラフィックスレッド実行開始\n"); // "Start graphic thread execution"
+ PRINTF(T("グラフィックスレッド実行開始\n", "Start graphic thread execution\n"));
Graph_Init(&gfxCtx);
while (nextOvl != NULL) {
@@ -461,7 +461,7 @@ void Graph_ThreadEntry(void* arg0) {
Overlay_LoadGameState(ovl);
size = ovl->instanceSize;
- PRINTF("クラスサイズ=%dバイト\n", size); // "Class size = %d bytes"
+ PRINTF(T("クラスサイズ=%dバイト\n", "Class size = %d bytes\n"), size);
gameState = SYSTEM_ARENA_MALLOC(size, "../graph.c", 1196);
@@ -469,7 +469,7 @@ void Graph_ThreadEntry(void* arg0) {
#if OOT_DEBUG
char faultMsg[0x50];
- PRINTF("確保失敗\n"); // "Failure to secure"
+ PRINTF(T("確保失敗\n", "Failure to secure\n"));
sprintf(faultMsg, "CLASS SIZE= %d bytes", size);
Fault_AddHungupAndCrashImpl("GAME CLASS MALLOC FAILED", faultMsg);
@@ -492,7 +492,7 @@ void Graph_ThreadEntry(void* arg0) {
Overlay_FreeGameState(ovl);
}
Graph_Destroy(&gfxCtx);
- PRINTF("グラフィックスレッド実行終了\n"); // "End of graphic thread execution"
+ PRINTF(T("グラフィックスレッド実行終了\n", "End of graphic thread execution\n"));
}
void* Graph_Alloc(GraphicsContext* gfxCtx, size_t size) {
diff --git a/src/code/main.c b/src/code/main.c
index 6ba4e17af..1b67009cb 100644
--- a/src/code/main.c
+++ b/src/code/main.c
@@ -32,9 +32,9 @@ OSMesg sSerialMsgBuf[1];
#if OOT_DEBUG
void Main_LogSystemHeap(void) {
PRINTF(VT_FGCOL(GREEN));
- // "System heap size% 08x (% dKB) Start address% 08x"
- PRINTF("システムヒープサイズ %08x(%dKB) 開始アドレス %08x\n", gSystemHeapSize, gSystemHeapSize / 1024,
- _buffersSegmentEnd);
+ PRINTF(
+ T("システムヒープサイズ %08x(%dKB) 開始アドレス %08x\n", "System heap size %08x (%dKB) Start address %08x\n"),
+ gSystemHeapSize, gSystemHeapSize / 1024, _buffersSegmentEnd);
PRINTF(VT_RST);
}
#endif
@@ -46,7 +46,7 @@ void Main(void* arg) {
uintptr_t systemHeapStart;
uintptr_t fb;
- PRINTF("mainproc 実行開始\n"); // "Start running"
+ PRINTF(T("mainproc 実行開始\n", "mainproc Start running\n"));
gScreenWidth = SCREEN_WIDTH;
gScreenHeight = SCREEN_HEIGHT;
gAppNmiBufferPtr = (PreNmiBuff*)osAppNMIBuffer;
@@ -56,8 +56,8 @@ void Main(void* arg) {
systemHeapStart = (uintptr_t)_buffersSegmentEnd;
fb = (uintptr_t)SysCfb_GetFbPtr(0);
gSystemHeapSize = fb - systemHeapStart;
- // "System heap initalization"
- PRINTF("システムヒープ初期化 %08x-%08x %08x\n", systemHeapStart, fb, gSystemHeapSize);
+ PRINTF(T("システムヒープ初期化 %08x-%08x %08x\n", "System heap initalization %08x-%08x %08x\n"), systemHeapStart,
+ fb, gSystemHeapSize);
SystemHeap_Init((void*)systemHeapStart, gSystemHeapSize); // initializes the system heap
#if OOT_DEBUG
@@ -93,7 +93,7 @@ void Main(void* arg) {
StackCheck_Init(&sIrqMgrStackInfo, sIrqMgrStack, STACK_TOP(sIrqMgrStack), 0, 0x100, "irqmgr");
IrqMgr_Init(&gIrqMgr, STACK_TOP(sIrqMgrStack), THREAD_PRI_IRQMGR, 1);
- PRINTF("タスクスケジューラの初期化\n"); // "Initialize the task scheduler"
+ PRINTF(T("タスクスケジューラの初期化\n", "Initialize the task scheduler\n"));
StackCheck_Init(&sSchedStackInfo, sSchedStack, STACK_TOP(sSchedStack), 0, 0x100, "sched");
Sched_Init(&gScheduler, STACK_TOP(sSchedStack), THREAD_PRI_SCHED, gViConfigModeType, 1, &gIrqMgr);
@@ -120,13 +120,13 @@ void Main(void* arg) {
break;
}
if (*msg == OS_SC_PRE_NMI_MSG) {
- PRINTF("main.c: リセットされたみたいだよ\n"); // "Looks like it's been reset"
+ PRINTF(T("main.c: リセットされたみたいだよ\n", "main.c: Looks like it's been reset\n"));
PreNmiBuff_SetReset(gAppNmiBufferPtr);
}
}
- PRINTF("mainproc 後始末\n"); // "Cleanup"
+ PRINTF(T("mainproc 後始末\n", "mainproc Cleanup\n"));
osDestroyThread(&sGraphThread);
RcpUtils_Reset();
- PRINTF("mainproc 実行終了\n"); // "End of execution"
+ PRINTF(T("mainproc 実行終了\n", "mainproc End of execution\n"));
}
diff --git a/src/code/padmgr.c b/src/code/padmgr.c
index 2d2b91eb9..1109a5e82 100644
--- a/src/code/padmgr.c
+++ b/src/code/padmgr.c
@@ -31,13 +31,12 @@
#include "global.h"
#include "terminal.h"
-#define PADMGR_LOG(controllerNum, msg) \
- if (OOT_DEBUG) { \
- PRINTF(VT_FGCOL(YELLOW)); \
- /* padmgr: Controller %d: %s */ \
- PRINTF("padmgr: %dコン: %s\n", (controllerNum) + 1, (msg)); \
- PRINTF(VT_RST); \
- } \
+#define PADMGR_LOG(controllerNum, msg) \
+ if (OOT_DEBUG) { \
+ PRINTF(VT_FGCOL(YELLOW)); \
+ PRINTF(T("padmgr: %dコン: %s\n", "padmgr: Controller %d: %s\n"), (controllerNum) + 1, (msg)); \
+ PRINTF(VT_RST); \
+ } \
(void)0
#define LOG_SEVERITY_NOLOG 0
@@ -73,17 +72,18 @@ OSMesgQueue* PadMgr_AcquireSerialEventQueue(PadMgr* padMgr) {
#endif
if (gPadMgrLogSeverity >= LOG_SEVERITY_VERBOSE) {
- // "serialMsgQ Waiting for lock"
- PRINTF("%2d %d serialMsgQロック待ち %08x %08x %08x\n", osGetThreadId(NULL),
- MQ_GET_COUNT(&padMgr->serialLockQueue), padMgr, &padMgr->serialLockQueue, &serialEventQueue);
+ PRINTF(T("%2d %d serialMsgQロック待ち %08x %08x %08x\n",
+ "%2d %d serialMsgQ Waiting for lock %08x %08x %08x\n"),
+ osGetThreadId(NULL), MQ_GET_COUNT(&padMgr->serialLockQueue), padMgr, &padMgr->serialLockQueue,
+ &serialEventQueue);
}
osRecvMesg(&padMgr->serialLockQueue, (OSMesg*)&serialEventQueue, OS_MESG_BLOCK);
if (gPadMgrLogSeverity >= LOG_SEVERITY_VERBOSE) {
- // "serialMsgQ Locked"
- PRINTF("%2d %d serialMsgQをロックしました %08x\n", osGetThreadId(NULL),
- MQ_GET_COUNT(&padMgr->serialLockQueue), serialEventQueue);
+ PRINTF(T("%2d %d serialMsgQをロックしました %08x\n",
+ "%2d %d serialMsgQ Locked %08x\n"),
+ osGetThreadId(NULL), MQ_GET_COUNT(&padMgr->serialLockQueue), serialEventQueue);
}
return serialEventQueue;
@@ -98,17 +98,17 @@ OSMesgQueue* PadMgr_AcquireSerialEventQueue(PadMgr* padMgr) {
*/
void PadMgr_ReleaseSerialEventQueue(PadMgr* padMgr, OSMesgQueue* serialEventQueue) {
if (gPadMgrLogSeverity >= LOG_SEVERITY_VERBOSE) {
- // "serialMsgQ Unlock"
- PRINTF("%2d %d serialMsgQロック解除します %08x %08x %08x\n", osGetThreadId(NULL),
- MQ_GET_COUNT(&padMgr->serialLockQueue), padMgr, &padMgr->serialLockQueue, serialEventQueue);
+ PRINTF(T("%2d %d serialMsgQロック解除します %08x %08x %08x\n", "%2d %d serialMsgQ Unlock %08x %08x %08x\n"),
+ osGetThreadId(NULL), MQ_GET_COUNT(&padMgr->serialLockQueue), padMgr, &padMgr->serialLockQueue,
+ serialEventQueue);
}
osSendMesg(&padMgr->serialLockQueue, (OSMesg)serialEventQueue, OS_MESG_BLOCK);
if (gPadMgrLogSeverity >= LOG_SEVERITY_VERBOSE) {
- // "serialMsgQ Unlocked"
- PRINTF("%2d %d serialMsgQロック解除しました %08x %08x %08x\n", osGetThreadId(NULL),
- MQ_GET_COUNT(&padMgr->serialLockQueue), padMgr, &padMgr->serialLockQueue, serialEventQueue);
+ PRINTF(T("%2d %d serialMsgQロック解除しました %08x %08x %08x\n", "%2d %d serialMsgQ Unlocked %08x %08x %08x\n"),
+ osGetThreadId(NULL), MQ_GET_COUNT(&padMgr->serialLockQueue), padMgr, &padMgr->serialLockQueue,
+ serialEventQueue);
}
}
@@ -401,8 +401,8 @@ void PadMgr_HandleRetrace(PadMgr* padMgr) {
mask |= 1 << i;
} else {
LOG_HEX("this->pad_status[i].type", padMgr->padStatus[i].type, "../padmgr.c", 458);
- // "An unknown type of controller is connected"
- PRINTF("知らない種類のコントローラが接続されています\n");
+ PRINTF(T("知らない種類のコントローラが接続されています\n",
+ "An unknown type of controller is connected\n"));
}
}
}
@@ -476,13 +476,13 @@ void PadMgr_ThreadEntry(PadMgr* padMgr) {
s16* msg = NULL;
s32 exit;
- PRINTF("コントローラスレッド実行開始\n"); // "Controller thread execution start"
+ PRINTF(T("コントローラスレッド実行開始\n", "Controller thread execution start"));
exit = false;
while (!exit) {
if (gPadMgrLogSeverity >= LOG_SEVERITY_VERBOSE && MQ_IS_EMPTY(&padMgr->interruptQueue)) {
- // "Waiting for controller thread event"
- PRINTF("コントローラスレッドイベント待ち %lld\n", OS_CYCLES_TO_USEC(osGetTime()));
+ PRINTF(T("コントローラスレッドイベント待ち %lld\n", "Waiting for controller thread event %lld\n"),
+ OS_CYCLES_TO_USEC(osGetTime()));
}
osRecvMesg(&padMgr->interruptQueue, (OSMesg*)&msg, OS_MESG_BLOCK);
@@ -511,11 +511,11 @@ void PadMgr_ThreadEntry(PadMgr* padMgr) {
IrqMgr_RemoveClient(padMgr->irqMgr, &padMgr->irqClient);
- PRINTF("コントローラスレッド実行終了\n"); // "Controller thread execution end"
+ PRINTF(T("コントローラスレッド実行終了\n", "Controller thread execution end\n"));
}
void PadMgr_Init(PadMgr* padMgr, OSMesgQueue* serialEventQueue, IrqMgr* irqMgr, OSId id, OSPri priority, void* stack) {
- PRINTF("パッドマネージャ作成 padmgr_Create()\n"); // "Pad Manager creation"
+ PRINTF(T("パッドマネージャ作成 padmgr_Create()\n", "Pad Manager creation padmgr_Create()\n"));
bzero(padMgr, sizeof(PadMgr));
padMgr->irqMgr = irqMgr;
diff --git a/src/code/sys_cfb.c b/src/code/sys_cfb.c
index 041c72659..28019c3e7 100644
--- a/src/code/sys_cfb.c
+++ b/src/code/sys_cfb.c
@@ -8,19 +8,18 @@ void SysCfb_Init(s32 n64dd) {
uintptr_t tmpFbEnd;
if (osMemSize >= 0x800000) {
- // "8MB or more memory is installed"
- PRINTF("8Mバイト以上のメモリが搭載されています\n");
+ PRINTF(T("8Mバイト以上のメモリが搭載されています\n", "8MB or more memory is installed\n"));
tmpFbEnd = 0x8044BE80;
if (n64dd == 1) {
- PRINTF("RAM 8M mode (N64DD対応)\n"); // "RAM 8M mode (N64DD compatible)"
+ PRINTF(T("RAM 8M mode (N64DD対応)\n", "RAM 8M mode (N64DD compatible)\n"));
#if OOT_DEBUG
sSysCfbEnd = 0x805FB000;
#else
sSysCfbEnd = 0x80600000;
#endif
} else {
- // "The margin for this version is %dK bytes"
- PRINTF("このバージョンのマージンは %dK バイトです\n", (0x4BC00 / 1024));
+ PRINTF(T("このバージョンのマージンは %dK バイトです\n", "The margin for this version is %dK bytes\n"),
+ (0x4BC00 / 1024));
#if OOT_DEBUG
sSysCfbEnd = tmpFbEnd;
#else
@@ -39,12 +38,12 @@ void SysCfb_Init(s32 n64dd) {
if (1) {}
- // "The final address used by the system is %08x"
- PRINTF("システムが使用する最終アドレスは %08x です\n", sSysCfbEnd);
+ PRINTF(T("システムが使用する最終アドレスは %08x です\n", "The final address used by the system is %08x\n"),
+ sSysCfbEnd);
sSysCfbFbPtr[0] = sSysCfbEnd - (screenSize * 4);
sSysCfbFbPtr[1] = sSysCfbEnd - (screenSize * 2);
- // "Frame buffer addresses are %08x and %08x"
- PRINTF("フレームバッファのアドレスは %08x と %08x です\n", sSysCfbFbPtr[0], sSysCfbFbPtr[1]);
+ PRINTF(T("フレームバッファのアドレスは %08x と %08x です\n", "Frame buffer addresses are %08x and %08x\n"),
+ sSysCfbFbPtr[0], sSysCfbFbPtr[1]);
}
void SysCfb_Reset(void) {
diff --git a/src/code/system_malloc.c b/src/code/system_malloc.c
index efee95dbd..f389aa0b0 100644
--- a/src/code/system_malloc.c
+++ b/src/code/system_malloc.c
@@ -12,14 +12,12 @@ s32 gSystemArenaLogSeverity = LOG_SEVERITY_NOLOG;
void SystemArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action) {
if (ptr == NULL) {
if (gSystemArenaLogSeverity >= LOG_SEVERITY_ERROR) {
- // "%s: %u bytes %s failed\n"
- PRINTF("%s: %u バイトの%sに失敗しました\n", name, size, action);
+ PRINTF(T("%s: %u バイトの%sに失敗しました\n", "%s: %u bytes %s failed\n"), name, size, action);
__osDisplayArena(&gSystemArena);
return;
}
} else if (gSystemArenaLogSeverity >= LOG_SEVERITY_VERBOSE) {
- // "%s: %u bytes %s succeeded\n"
- PRINTF("%s: %u バイトの%sに成功しました\n", name, size, action);
+ PRINTF(T("%s: %u バイトの%sに成功しました\n", "%s: %u bytes %s succeeded\n"), name, size, action);
}
}
@@ -99,7 +97,7 @@ void* SystemArena_Calloc(u32 num, u32 size) {
#if OOT_DEBUG
void SystemArena_Display(void) {
- PRINTF("システムヒープ表示\n"); // "System heap display"
+ PRINTF(T("システムヒープ表示\n", "System heap display\n"));
__osDisplayArena(&gSystemArena);
}
#endif
diff --git a/src/code/title_setup.c b/src/code/title_setup.c
index c344fcb4f..0f16535c5 100644
--- a/src/code/title_setup.c
+++ b/src/code/title_setup.c
@@ -1,7 +1,7 @@
#include "global.h"
void Setup_InitImpl(SetupState* this) {
- PRINTF("ゼルダ共通データ初期化\n"); // "Zelda common data initalization"
+ PRINTF(T("ゼルダ共通データ初期化\n", "Zelda common data initalization\n"));
SaveContext_Init();
this->state.running = false;
SET_NEXT_GAMESTATE(&this->state, ConsoleLogo_Init, ConsoleLogoState);
diff --git a/src/code/z_DLF.c b/src/code/z_DLF.c
index 42fbc4b47..547dc4bbb 100644
--- a/src/code/z_DLF.c
+++ b/src/code/z_DLF.c
@@ -3,7 +3,7 @@
void Overlay_LoadGameState(GameStateOverlay* overlayEntry) {
if (overlayEntry->loadedRamAddr != NULL) {
- PRINTF("既にリンクされています\n"); // "Already linked"
+ PRINTF(T("既にリンクされています\n", "Already linked\n"));
return;
}
@@ -14,7 +14,7 @@ void Overlay_LoadGameState(GameStateOverlay* overlayEntry) {
overlayEntry->vramStart, overlayEntry->vramEnd);
if (overlayEntry->loadedRamAddr == NULL) {
- PRINTF("ロードに失敗しました\n"); // "Loading failed"
+ PRINTF(T("ロードに失敗しました\n", "Loading failed\n"));
return;
}
diff --git a/src/code/z_construct.c b/src/code/z_construct.c
index a7bd1a658..8c1be3c70 100644
--- a/src/code/z_construct.c
+++ b/src/code/z_construct.c
@@ -32,8 +32,7 @@ void Interface_Init(PlayState* play) {
parameterSize = (uintptr_t)_parameter_staticSegmentRomEnd - (uintptr_t)_parameter_staticSegmentRomStart;
- // "Permanent PARAMETER Segment = %x"
- PRINTF("常駐PARAMETERセグメント=%x\n", parameterSize);
+ PRINTF(T("常駐PARAMETERセグメント=%x\n", "Permanent PARAMETER Segment = %x\n"), parameterSize);
interfaceCtx->parameterSegment = GAME_STATE_ALLOC(&play->state, parameterSize, "../z_construct.c", 159);
@@ -45,7 +44,7 @@ void Interface_Init(PlayState* play) {
interfaceCtx->doActionSegment = GAME_STATE_ALLOC(&play->state, 3 * DO_ACTION_TEX_SIZE, "../z_construct.c", 166);
- PRINTF("DOアクション テクスチャ初期=%x\n", 3 * DO_ACTION_TEX_SIZE); // "DO Action Texture Initialization"
+ PRINTF(T("DOアクション テクスチャ初期=%x\n", "DO Action Texture Initialization = %x\n"), 3 * DO_ACTION_TEX_SIZE);
PRINTF("parameter->do_actionSegment=%x\n", interfaceCtx->doActionSegment);
ASSERT(interfaceCtx->doActionSegment != NULL, "parameter->do_actionSegment != NULL", "../z_construct.c", 169);
@@ -91,8 +90,8 @@ void Interface_Init(PlayState* play) {
interfaceCtx->iconItemSegment = GAME_STATE_ALLOC(&play->state, ICON_ITEM_SEGMENT_SIZE, "../z_construct.c", 190);
- // "Icon Item Texture Initialization = %x"
- PRINTF("アイコンアイテム テクスチャ初期=%x\n", ICON_ITEM_SEGMENT_SIZE);
+ PRINTF(T("アイコンアイテム テクスチャ初期=%x\n", "Icon Item Texture Initialization = %x\n"),
+ ICON_ITEM_SEGMENT_SIZE);
PRINTF("parameter->icon_itemSegment=%x\n", interfaceCtx->iconItemSegment);
ASSERT(interfaceCtx->iconItemSegment != NULL, "parameter->icon_itemSegment != NULL", "../z_construct.c", 193);
@@ -165,11 +164,12 @@ void Interface_Init(PlayState* play) {
if ((gSaveContext.timerState >= TIMER_STATE_UP_INIT) && (gSaveContext.timerState <= TIMER_STATE_UP_FREEZE)) {
gSaveContext.timerState = TIMER_STATE_OFF;
- // "Timer Stop!!!!!!!!!!!!!!!!!!!!!!"
- PRINTF("タイマー停止!!!!!!!!!!!!!!!!!!!!! = %d\n", gSaveContext.timerState);
+ PRINTF(T("タイマー停止!!!!!!!!!!!!!!!!!!!!! = %d\n",
+ "Timer Stop!!!!!!!!!!!!!!!!!!!!! = %d\n"),
+ gSaveContext.timerState);
}
- PRINTF("PARAMETER領域=%x\n", parameterSize + 0x5300); // "Parameter Area = %x"
+ PRINTF(T("PARAMETER領域=%x\n", "Parameter Area = %x\n"), parameterSize + 0x5300);
Health_InitMeter(play);
Map_Init(play);
@@ -215,7 +215,7 @@ void Message_Init(PlayState* play) {
PRINTF("message->fukidashiSegment=%x\n", msgCtx->textboxSegment);
- PRINTF("吹き出しgame_alloc=%x\n", TEXTBOX_SEGMENT_SIZE); // "Textbox game_alloc=%x"
+ PRINTF(T("吹き出しgame_alloc=%x\n", "Textbox game_alloc=%x\n"), TEXTBOX_SEGMENT_SIZE);
ASSERT(msgCtx->textboxSegment != NULL, "message->fukidashiSegment != NULL", "../z_construct.c", 352);
Font_LoadOrderedFont(&play->msgCtx.font);
diff --git a/src/code/z_kaleido_manager.c b/src/code/z_kaleido_manager.c
index 954cbcf3f..761d1fb9e 100644
--- a/src/code/z_kaleido_manager.c
+++ b/src/code/z_kaleido_manager.c
@@ -51,7 +51,8 @@ void KaleidoManager_Init(PlayState* play) {
}
PRINTF(VT_FGCOL(GREEN));
- PRINTF("KaleidoArea の最大サイズは %d バイトを確保します\n", largestSize);
+ PRINTF(T("KaleidoArea の最大サイズは %d バイトを確保します\n", "The maximum size of KaleidoArea is %d bytes\n"),
+ largestSize);
PRINTF(VT_RST);
sKaleidoAreaPtr = GAME_STATE_ALLOC(&play->state, largestSize, "../z_kaleido_manager.c", 150);
@@ -91,7 +92,7 @@ void* KaleidoManager_GetRamAddr(void* vram) {
//! @bug Probably missing iter++ here
}
- PRINTF("異常\n"); // "Abnormal"
+ PRINTF(T("異常\n", "Abnormal\n"));
return NULL;
}