1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-02-17 20:41:28 +00:00

T() macro 7 (#2102)

* T() macro in most of the rest of code (except z_message, z_actor, ucode_disas, gfxprint, game, fault, db_camera)

* remaining T() macro in boot

* format

* review
This commit is contained in:
Dragorn421 2024-08-28 20:01:41 +02:00 committed by GitHub
parent 7592bf1e42
commit 16ec9b1e13
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 49 additions and 38 deletions

View file

@ -84,19 +84,24 @@ void LogUtils_CheckBoundary(const char* name, s32 value, s32 unk, const char* fi
u32 mask = (unk - 1); u32 mask = (unk - 1);
if (value & mask) { if (value & mask) {
PRINTF(VT_COL(RED, WHITE) "%s %d:%s(%08x) は バウンダリ(%d)違反です\n" VT_RST, file, line, name, value, unk); PRINTF(VT_COL(RED, WHITE) T("%s %d:%s(%08x) は バウンダリ(%d)違反です\n",
"%s %d:%s(%08x) is a boundary (%d) violation\n") VT_RST,
file, line, name, value, unk);
} }
} }
void LogUtils_CheckNullPointer(const char* exp, void* ptr, const char* file, int line) { void LogUtils_CheckNullPointer(const char* exp, void* ptr, const char* file, int line) {
if (ptr == NULL) { if (ptr == NULL) {
PRINTF(VT_COL(RED, WHITE) "%s %d:%s は はヌルポインタです\n" VT_RST, file, line, exp); PRINTF(VT_COL(RED, WHITE) T("%s %d:%s は はヌルポインタです\n", "%s %d:%s is a null pointer\n") VT_RST, file,
line, exp);
} }
} }
void LogUtils_CheckValidPointer(const char* exp, void* ptr, const char* file, int line) { void LogUtils_CheckValidPointer(const char* exp, void* ptr, const char* file, int line) {
if (ptr == NULL || (u32)ptr < 0x80000000 || (0x80000000 + osMemSize) <= (u32)ptr) { if (ptr == NULL || (u32)ptr < 0x80000000 || (0x80000000 + osMemSize) <= (u32)ptr) {
PRINTF(VT_COL(RED, WHITE) "%s %d:ポインタ %s(%08x) が異常です\n" VT_RST, file, line, exp, ptr); PRINTF(VT_COL(RED, WHITE) T("%s %d:ポインタ %s(%08x) が異常です\n", "%s %d: Pointer %s(%08x) is invalid\n")
VT_RST,
file, line, exp, ptr);
} }
} }

View file

@ -20,7 +20,9 @@ void StackCheck_Init(StackEntry* entry, void* stackBottom, void* stackTop, u32 i
iter = sStackInfoListStart; iter = sStackInfoListStart;
while (iter) { while (iter) {
if (iter == entry) { if (iter == entry) {
PRINTF(VT_COL(RED, WHITE) "stackcheck_init: %08x は既にリスト中にある\n" VT_RST, entry); PRINTF(VT_COL(RED, WHITE) T("stackcheck_init: %08x は既にリスト中にある\n",
"stackcheck_init: %08x is already in the list\n") VT_RST,
entry);
return; return;
} }
iter = iter->next; iter = iter->next;
@ -68,7 +70,9 @@ void StackCheck_Cleanup(StackEntry* entry) {
} }
} }
if (inconsistency) { if (inconsistency) {
PRINTF(VT_COL(RED, WHITE) "stackcheck_cleanup: %08x リスト不整合です\n" VT_RST, entry); PRINTF(VT_COL(RED, WHITE) T("stackcheck_cleanup: %08x リスト不整合です\n",
"stackcheck_cleanup: %08x list inconsistent\n") VT_RST,
entry);
} }
} }

View file

@ -42,10 +42,11 @@ void DynaPolyActor_UpdateCarriedActorPos(CollisionContext* colCtx, s32 bgId, Act
PRINTF(VT_FGCOL(RED)); PRINTF(VT_FGCOL(RED));
//! @bug file and line are not passed to PRINTF //! @bug file and line are not passed to PRINTF
// "Position is not valid" PRINTF(T("BGCheckCollection_typicalActorPos():位置が妥当ではありません。\n"
PRINTF( "pos (%f,%f,%f) file:%s line:%d\n",
"BGCheckCollection_typicalActorPos():位置が妥当ではありません。\npos (%f,%f,%f) file:%s line:%d\n", "BGCheckCollection_typicalActorPos(): Position is not valid. \n"
pos.x, pos.y, pos.z); "pos (%f,%f,%f) file:%s line:%d\n"),
pos.x, pos.y, pos.z);
PRINTF(VT_RST); PRINTF(VT_RST);
} }
#endif #endif

View file

@ -97,8 +97,8 @@ void* DebugArena_Calloc(u32 num, u32 size) {
#if OOT_DEBUG #if OOT_DEBUG
void DebugArena_Display(void) { void DebugArena_Display(void) {
// "Zelda heap display" ("Zelda" should probably have been changed to "Debug") // Likely copypasted from ZeldaArena_Display, should say "Debug"
PRINTF("ゼルダヒープ表示\n"); PRINTF(T("ゼルダヒープ表示\n", "Zelda heap display\n"));
__osDisplayArena(&sDebugArena); __osDisplayArena(&sDebugArena);
} }
#endif #endif

View file

@ -176,8 +176,7 @@ void Sched_QueueTask(Scheduler* sc, OSScTask* task) {
463); 463);
if (type == M_AUDTASK) { if (type == M_AUDTASK) {
// "You have entered an audio task" SCHED_DEBUG_PRINTF(T("オーディオタスクをエントリしました\n", "You have entered an audio task\n"));
SCHED_DEBUG_PRINTF("オーディオタスクをエントリしました\n");
// Add to audio queue // Add to audio queue
if (sc->audioListTail != NULL) { if (sc->audioListTail != NULL) {
@ -191,8 +190,7 @@ void Sched_QueueTask(Scheduler* sc, OSScTask* task) {
sc->doAudio = true; sc->doAudio = true;
} else { } else {
// "Entered graph task" SCHED_DEBUG_PRINTF(T("グラフタスクをエントリしました\n", "Entered graph task\n"));
SCHED_DEBUG_PRINTF("グラフタスクをエントリしました\n");
// Add to graphics queue // Add to graphics queue
if (sc->gfxListTail != NULL) { if (sc->gfxListTail != NULL) {
@ -606,8 +604,7 @@ void Sched_ThreadEntry(void* arg) {
Scheduler* sc = (Scheduler*)arg; Scheduler* sc = (Scheduler*)arg;
while (true) { while (true) {
// "%08d: standby" SCHED_DEBUG_PRINTF(T("%08d:待機中\n", "%08d: standby\n"), (u32)OS_CYCLES_TO_USEC(osGetTime()));
SCHED_DEBUG_PRINTF("%08d:待機中\n", (u32)OS_CYCLES_TO_USEC(osGetTime()));
// Await interrupt messages, either from the OS, IrqMgr, or another thread // Await interrupt messages, either from the OS, IrqMgr, or another thread
osRecvMesg(&sc->interruptQueue, &msg, OS_MESG_BLOCK); osRecvMesg(&sc->interruptQueue, &msg, OS_MESG_BLOCK);

View file

@ -19,7 +19,8 @@ void EffectShieldParticle_Init(void* thisx, void* initParamsx) {
this->numElements = initParams->numElements; this->numElements = initParams->numElements;
if (this->numElements > ARRAY_COUNT(this->elements)) { if (this->numElements > ARRAY_COUNT(this->elements)) {
PRINTF(VT_FGCOL(RED)); PRINTF(VT_FGCOL(RED));
PRINTF("EffectShieldParticle_ct():パーティクル数がオーバしてます。\n"); PRINTF(T("EffectShieldParticle_ct():パーティクル数がオーバしてます。\n",
"EffectShieldParticle_ct(): Number of particles exceeded.\n"));
PRINTF(VT_RST); PRINTF(VT_RST);
return; return;
} }

View file

@ -178,22 +178,23 @@ void Jpeg_ParseMarkers(u8* ptr, JpegContext* ctx) {
case MARKER_SOF: { case MARKER_SOF: {
// Start of Frame, stores important metadata of the image. // Start of Frame, stores important metadata of the image.
// Only used for extracting the sampling factors (ctx->mode). // Only used for extracting the sampling factors (ctx->mode).
PRINTF("MARKER_SOF %d " PRINTF(T("MARKER_SOF %d "
"精度%02x " // "accuracy" "精度%02x 垂直%d 水平%d compo%02x "
"垂直%d " // "vertical" "(1:Y)%d (H0=2,V0=1(422) or 2(420))%02x (量子化テーブル)%02x "
"水平%d " // "horizontal" "(2:Cb)%d (H1=1,V1=1)%02x (量子化テーブル)%02x "
"compo%02x " "(3:Cr)%d (H2=1,V2=1)%02x (量子化テーブル)%02x\n",
"(1:Y)%d (H0=2,V0=1(422) or 2(420))%02x (量子化テーブル)%02x " "MARKER_SOF %d "
"(2:Cb)%d (H1=1,V1=1)%02x (量子化テーブル)%02x " "accuracy%02x vertical%d horizontal%d compo%02x "
"(3:Cr)%d (H2=1,V2=1)%02x (量子化テーブル)%02x\n", "(1:Y)%d (H0=2,V0=1(422) or 2(420))%02x (quantization tables)%02x "
"(2:Cb)%d (H1=1,V1=1)%02x (quantization tables)%02x "
"(3:Cr)%d (H2=1,V2=1)%02x (quantization tables)%02x\n"),
Jpeg_GetUnalignedU16(ptr), Jpeg_GetUnalignedU16(ptr),
ptr[2], // precision // precision, height, width, component count (assumed to be 3)
Jpeg_GetUnalignedU16(ptr + 3), // height ptr[2], Jpeg_GetUnalignedU16(ptr + 3), Jpeg_GetUnalignedU16(ptr + 5), ptr[7],
Jpeg_GetUnalignedU16(ptr + 5), // width //
ptr[7], // component count (assumed to be 3) ptr[8], ptr[9], ptr[10], // Y component
ptr[8], ptr[9], ptr[10], // Y component ptr[11], ptr[12], ptr[13], // Cb component
ptr[11], ptr[12], ptr[13], // Cb component ptr[14], ptr[15], ptr[16] // Cr component
ptr[14], ptr[15], ptr[16] // Cr component
); );
if (ptr[9] == 0x21) { if (ptr[9] == 0x21) {

View file

@ -77,7 +77,7 @@ void Font_LoadOrderedFont(Font* font) {
fontBufIndex = 0; fontBufIndex = 0;
for (codePointIndex = 0; font->msgBuf[codePointIndex] != MESSAGE_END; codePointIndex++) { for (codePointIndex = 0; font->msgBuf[codePointIndex] != MESSAGE_END; codePointIndex++) {
if (codePointIndex > (len * 1)) { if (codePointIndex > (len * 1)) {
PRINTF(" エラー!!! error───\n"); PRINTF(T(" エラー!!! error───\n", "ERROR!! Error!!! error───!!!!\n"));
return; return;
} }

View file

@ -72,8 +72,8 @@ void MapMark_DrawForDungeon(PlayState* play) {
interfaceCtx = &play->interfaceCtx; interfaceCtx = &play->interfaceCtx;
if ((gMapData != NULL) && (play->interfaceCtx.mapRoomNum >= gMapData->dgnMinimapCount[dungeon])) { if ((gMapData != NULL) && (play->interfaceCtx.mapRoomNum >= gMapData->dgnMinimapCount[dungeon])) {
// "Room number exceeded, yikes %d/%d MapMarkDraw processing interrupted" PRINTF(VT_COL(RED, WHITE) T("部屋番号がオーバーしてるで,ヤバイで %d/%d \nMapMarkDraw の処理を中断します\n",
PRINTF(VT_COL(RED, WHITE) "部屋番号がオーバーしてるで,ヤバイで %d/%d \nMapMarkDraw の処理を中断します\n", "Room number exceeded, yikes %d/%d \nMapMarkDraw processing interrupted\n"),
VT_RST, play->interfaceCtx.mapRoomNum, gMapData->dgnMinimapCount[dungeon]); VT_RST, play->interfaceCtx.mapRoomNum, gMapData->dgnMinimapCount[dungeon]);
return; return;
} }

View file

@ -253,7 +253,8 @@ s32 SkinMatrix_Invert(MtxF* src, MtxF* dest) {
// Therefore src is a singular matrix (0 determinant). // Therefore src is a singular matrix (0 determinant).
PRINTF(VT_COL(YELLOW, BLACK)); PRINTF(VT_COL(YELLOW, BLACK));
PRINTF("Skin_Matrix_InverseMatrix():逆行列つくれません\n"); PRINTF(T("Skin_Matrix_InverseMatrix():逆行列つくれません\n",
"Skin_Matrix_InverseMatrix(): Cannot create inverse matrix\n"));
PRINTF(VT_RST); PRINTF(VT_RST);
return 2; return 2;
} }
@ -589,7 +590,8 @@ Mtx* SkinMatrix_MtxFToNewMtx(GraphicsContext* gfxCtx, MtxF* src) {
Mtx* mtx = GRAPH_ALLOC(gfxCtx, sizeof(Mtx)); Mtx* mtx = GRAPH_ALLOC(gfxCtx, sizeof(Mtx));
if (mtx == NULL) { if (mtx == NULL) {
PRINTF("Skin_Matrix_to_Mtx_new() 確保失敗:NULLを返して終了\n"); PRINTF(T("Skin_Matrix_to_Mtx_new() 確保失敗:NULLを返して終了\n",
"Skin_Matrix_to_Mtx_new() allocation failed: Return NULL and exit\n"));
return NULL; return NULL;
} }
SkinMatrix_MtxFToMtx(src, mtx); SkinMatrix_MtxFToMtx(src, mtx);