1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-06-08 09:31:52 +00:00

T() macro 5 (#2089)

* T() in __osMalloc.c

* T() in code_80097A00.c

* T() in debug_malloc.c

* T() in code/load.c

* T() in sys_math3d.c

* T() in z_collision_btltbls.c, z_fbdemo_fade.c, z_fcurve_data_skelanime.c, z_view.c

* T() in z_collision_check.c

* remaining T() in __osMalloc.c

* __osMalloc consistency

* format
This commit is contained in:
Dragorn421 2024-08-27 14:32:33 +02:00 committed by GitHub
parent d2aca2239f
commit fd14ddcbf1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 104 additions and 91 deletions

View file

@ -126,7 +126,9 @@ ArenaNode* ArenaImpl_GetNextBlock(ArenaNode* node) {
ArenaNode* next = node->next; ArenaNode* next = node->next;
if (next != NULL && (next == NULL || (next->magic != NODE_MAGIC))) { if (next != NULL && (next == NULL || (next->magic != NODE_MAGIC))) {
osSyncPrintf(VT_COL(RED, WHITE) "緊急事態!メモリリーク発見! (block=%08x)\n" VT_RST, next); osSyncPrintf(VT_COL(RED, WHITE) T("緊急事態!メモリリーク発見! (block=%08x)\n",
"Emergency! Memory leak detected! (block=%08x)\n") VT_RST,
next);
next = NULL; next = NULL;
node->next = NULL; node->next = NULL;
} }
@ -137,7 +139,9 @@ ArenaNode* ArenaImpl_GetPrevBlock(ArenaNode* node) {
ArenaNode* prev = node->prev; ArenaNode* prev = node->prev;
if (prev != NULL && (prev == NULL || (prev->magic != NODE_MAGIC))) { if (prev != NULL && (prev == NULL || (prev->magic != NODE_MAGIC))) {
osSyncPrintf(VT_COL(RED, WHITE) "緊急事態!メモリリーク発見! (block=%08x)\n" VT_RST, prev); osSyncPrintf(VT_COL(RED, WHITE) T("緊急事態!メモリリーク発見! (block=%08x)\n",
"Emergency! Memory leak detected! (block=%08x)\n") VT_RST,
prev);
prev = NULL; prev = NULL;
node->prev = NULL; node->prev = NULL;
} }
@ -243,9 +247,10 @@ void __osMalloc_FreeBlockTest(Arena* arena, ArenaNode* node) {
while (iter < end) { while (iter < end) {
if (*iter != BLOCK_UNINIT_MAGIC_32 && *iter != BLOCK_FREE_MAGIC_32) { if (*iter != BLOCK_UNINIT_MAGIC_32 && *iter != BLOCK_FREE_MAGIC_32) {
osSyncPrintf( osSyncPrintf(VT_COL(RED, WHITE)
VT_COL(RED, WHITE) "緊急事態!メモリリーク検出! (block=%08x s=%08x e=%08x p=%08x)\n" VT_RST, node, T("緊急事態!メモリリーク検出! (block=%08x s=%08x e=%08x p=%08x)\n",
start, end, iter); "Emergency! Memory leak detected! (block=%08x s=%08x e=%08x p=%08x)\n") VT_RST,
node, start, end, iter);
__osDisplayArena(arena); __osDisplayArena(arena);
return; return;
} }
@ -475,19 +480,20 @@ void __osFree_NoLock(Arena* arena, void* ptr) {
node = (ArenaNode*)((u32)ptr - sizeof(ArenaNode)); node = (ArenaNode*)((u32)ptr - sizeof(ArenaNode));
if (node == NULL || node->magic != NODE_MAGIC) { if (node == NULL || node->magic != NODE_MAGIC) {
// "__osFree: Unauthorized release (%08x)" PRINTF(VT_COL(RED, WHITE) T("__osFree:不正解放(%08x)\n", "__osFree: Unauthorized release (%08x)\n") VT_RST,
PRINTF(VT_COL(RED, WHITE) "__osFree:不正解放(%08x)\n" VT_RST, ptr); ptr);
return; return;
} }
if (node->isFree) { if (node->isFree) {
PRINTF(VT_COL(RED, WHITE) "__osFree:二重解放(%08x)\n" VT_RST, ptr); // "__osFree: Double release (%08x)" PRINTF(VT_COL(RED, WHITE) T("__osFree:二重解放(%08x)\n", "__osFree: Double release (%08x)\n") VT_RST, ptr);
return; return;
} }
#if OOT_DEBUG #if OOT_DEBUG
if (arena != node->arena && arena != NULL) { if (arena != node->arena && arena != NULL) {
// "__osFree:Tried to release in a different way than when it was secured (%08x:%08x)" PRINTF(VT_COL(RED, WHITE)
PRINTF(VT_COL(RED, WHITE) "__osFree:確保時と違う方法で解放しようとした (%08x:%08x)\n" VT_RST, arena, T("__osFree:確保時と違う方法で解放しようとした (%08x:%08x)\n",
node->arena); "__osFree:Tried to release in a different way than when it was secured (%08x:%08x)\n") VT_RST,
arena, node->arena);
return; return;
} }
#endif #endif
@ -540,19 +546,22 @@ void __osFree_NoLockDebug(Arena* arena, void* ptr, const char* file, int line) {
node = (ArenaNode*)((u32)ptr - sizeof(ArenaNode)); node = (ArenaNode*)((u32)ptr - sizeof(ArenaNode));
if (node == NULL || node->magic != NODE_MAGIC) { if (node == NULL || node->magic != NODE_MAGIC) {
// "__osFree: Unauthorized release (%08x)" PRINTF(VT_COL(RED, WHITE)
PRINTF(VT_COL(RED, WHITE) "__osFree:不正解放(%08x) [%s:%d ]\n" VT_RST, ptr, file, line); T("__osFree:不正解放(%08x) [%s:%d ]\n", "__osFree: Unauthorized release (%08x) [%s:%d ]\n") VT_RST,
ptr, file, line);
return; return;
} }
if (node->isFree) { if (node->isFree) {
// "__osFree: Double release (%08x)" PRINTF(VT_COL(RED, WHITE) T("__osFree:二重解放(%08x) [%s:%d ]\n", "__osFree: Double release (%08x) [%s:%d ]\n")
PRINTF(VT_COL(RED, WHITE) "__osFree:二重解放(%08x) [%s:%d ]\n" VT_RST, ptr, file, line); VT_RST,
ptr, file, line);
return; return;
} }
if (arena != node->arena && arena != NULL) { if (arena != node->arena && arena != NULL) {
// "__osFree:Tried to release in a different way than when it was secured (%08x:%08x)" PRINTF(VT_COL(RED, WHITE)
PRINTF(VT_COL(RED, WHITE) "__osFree:確保時と違う方法で解放しようとした (%08x:%08x)\n" VT_RST, arena, T("__osFree:確保時と違う方法で解放しようとした (%08x:%08x)\n",
node->arena); "__osFree:Tried to release in a different way than when it was secured (%08x:%08x)\n") VT_RST,
arena, node->arena);
return; return;
} }
@ -619,14 +628,14 @@ void* __osRealloc(Arena* arena, void* ptr, u32 newSize) {
} else { } else {
node = (ArenaNode*)((u32)ptr - sizeof(ArenaNode)); node = (ArenaNode*)((u32)ptr - sizeof(ArenaNode));
if (newSize == node->size) { if (newSize == node->size) {
// "Does nothing because the memory block size does not change" osSyncPrintf(T("メモリブロックサイズが変わらないためなにもしません\n",
osSyncPrintf("メモリブロックサイズが変わらないためなにもしません\n"); "Does nothing because the memory block size does not change\n"));
} else if (node->size < newSize) { } else if (node->size < newSize) {
next = NODE_GET_NEXT(node); next = NODE_GET_NEXT(node);
sizeDiff = newSize - node->size; sizeDiff = newSize - node->size;
if ((u32)next == ((u32)node + node->size + sizeof(ArenaNode)) && next->isFree && next->size >= sizeDiff) { if ((u32)next == ((u32)node + node->size + sizeof(ArenaNode)) && next->isFree && next->size >= sizeDiff) {
// "Merge because there is a free block after the current memory block" osSyncPrintf(T("現メモリブロックの後ろにフリーブロックがあるので結合します\n",
osSyncPrintf("現メモリブロックの後ろにフリーブロックがあるので結合します\n"); "Merge because there is a free block after the current memory block\n"));
next->size -= sizeDiff; next->size -= sizeDiff;
overNext = NODE_GET_NEXT(next); overNext = NODE_GET_NEXT(next);
newNext = (ArenaNode*)((u32)next + sizeDiff); newNext = (ArenaNode*)((u32)next + sizeDiff);
@ -637,8 +646,8 @@ void* __osRealloc(Arena* arena, void* ptr, u32 newSize) {
node->size = newSize; node->size = newSize;
memmove(node->next, next, sizeof(ArenaNode)); memmove(node->next, next, sizeof(ArenaNode));
} else { } else {
// "Allocate a new memory block and move the contents" osSyncPrintf(T("新たにメモリブロックを確保して内容を移動します\n",
osSyncPrintf("新たにメモリブロックを確保して内容を移動します\n"); "Allocate a new memory block and move the contents\n"));
newAlloc = __osMalloc_NoLock(arena, newSize); newAlloc = __osMalloc_NoLock(arena, newSize);
if (newAlloc != NULL) { if (newAlloc != NULL) {
bcopy(ptr, newAlloc, node->size); bcopy(ptr, newAlloc, node->size);
@ -651,8 +660,8 @@ void* __osRealloc(Arena* arena, void* ptr, u32 newSize) {
if (next2 != NULL && next2->isFree) { if (next2 != NULL && next2->isFree) {
blockSize = ALIGN16(newSize) + sizeof(ArenaNode); blockSize = ALIGN16(newSize) + sizeof(ArenaNode);
// "Increased free block behind current memory block" osSyncPrintf(T("現メモリブロックの後ろのフリーブロックを大きくしました\n",
osSyncPrintf("現メモリブロックの後ろのフリーブロックを大きくしました\n"); "Increased free block behind current memory block\n"));
newNext2 = (ArenaNode*)((u32)node + blockSize); newNext2 = (ArenaNode*)((u32)node + blockSize);
localCopy = *next2; localCopy = *next2;
*newNext2 = localCopy; *newNext2 = localCopy;
@ -666,8 +675,8 @@ void* __osRealloc(Arena* arena, void* ptr, u32 newSize) {
} else if (newSize + sizeof(ArenaNode) < node->size) { } else if (newSize + sizeof(ArenaNode) < node->size) {
blockSize = ALIGN16(newSize) + sizeof(ArenaNode); blockSize = ALIGN16(newSize) + sizeof(ArenaNode);
// "Generated because there is no free block after the current memory block" osSyncPrintf(T("現メモリブロックの後ろにフリーブロックがないので生成します\n",
osSyncPrintf("現メモリブロックの後ろにフリーブロックがないので生成します\n"); "Generated because there is no free block after the current memory block\n"));
newNext2 = (ArenaNode*)((u32)node + blockSize); newNext2 = (ArenaNode*)((u32)node + blockSize);
newNext2->next = NODE_GET_NEXT(node); newNext2->next = NODE_GET_NEXT(node);
newNext2->prev = node; newNext2->prev = node;
@ -681,8 +690,8 @@ void* __osRealloc(Arena* arena, void* ptr, u32 newSize) {
overNext2->prev = newNext2; overNext2->prev = newNext2;
} }
} else { } else {
// "There is no room to generate free blocks" osSyncPrintf(
osSyncPrintf("フリーブロック生成するだけの空きがありません\n"); T("フリーブロック生成するだけの空きがありません\n", "There is no room to generate free blocks\n"));
ptr = NULL; ptr = NULL;
} }
} }
@ -735,7 +744,7 @@ void __osDisplayArena(Arena* arena) {
ArenaNode* next; ArenaNode* next;
if (!__osMallocIsInitialized(arena)) { if (!__osMallocIsInitialized(arena)) {
osSyncPrintf("アリーナは初期化されていません\n"); // "Arena is not initialized" osSyncPrintf(T("アリーナは初期化されていません\n", "Arena is not initialized\n"));
return; return;
} }

View file

@ -285,8 +285,7 @@ u8 Inventory_DeleteEquipment(PlayState* play, s16 equipment) {
s32 pad; s32 pad;
u16 equipValue = gSaveContext.save.info.equips.equipment & gEquipMasks[equipment]; u16 equipValue = gSaveContext.save.info.equips.equipment & gEquipMasks[equipment];
// "Erasing equipment item = %d zzz=%d" PRINTF(T("装備アイテム抹消 = %d zzz=%d\n", "Erasing equipment item = %d zzz=%d\n"), equipment, equipValue);
PRINTF("装備アイテム抹消 = %d zzz=%d\n", equipment, equipValue);
if (equipValue) { if (equipValue) {
equipValue >>= gEquipShifts[equipment]; equipValue >>= gEquipShifts[equipment];

View file

@ -12,14 +12,12 @@ s32 gDebugArenaLogSeverity = LOG_SEVERITY_ERROR;
void DebugArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action) { void DebugArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action) {
if (ptr == NULL) { if (ptr == NULL) {
if (gDebugArenaLogSeverity >= LOG_SEVERITY_ERROR) { if (gDebugArenaLogSeverity >= LOG_SEVERITY_ERROR) {
// "%s: %u bytes %s failed\n" PRINTF(T("%s: %u バイトの%sに失敗しました\n", "%s: %u bytes %s failed\n"), name, size, action);
PRINTF("%s: %u バイトの%sに失敗しました\n", name, size, action);
__osDisplayArena(&sDebugArena); __osDisplayArena(&sDebugArena);
return; return;
} }
} else if (gDebugArenaLogSeverity >= LOG_SEVERITY_VERBOSE) { } else if (gDebugArenaLogSeverity >= LOG_SEVERITY_VERBOSE) {
// "%s: %u bytes %s succeeded\n" PRINTF(T("%s: %u バイトの%sに成功しました\n", "%s: %u bytes %s succeeded\n"), name, size, action);
PRINTF("%s: %u バイトの%sに成功しました\n", name, size, action);
} }
} }

View file

@ -8,16 +8,17 @@ size_t Overlay_Load(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, voi
s32 size = vromEnd - vromStart; s32 size = vromEnd - vromStart;
if (gOverlayLogSeverity >= 3) { if (gOverlayLogSeverity >= 3) {
// "Start loading dynamic link function" PRINTF(
PRINTF("\nダイナミックリンクファンクションのロードを開始します\n"); T("\nダイナミックリンクファンクションのロードを開始します\n", "\nStart loading dynamic link function\n"));
} }
size = vromEnd - vromStart; size = vromEnd - vromStart;
end = (uintptr_t)allocatedRamAddr + size; end = (uintptr_t)allocatedRamAddr + size;
if (gOverlayLogSeverity >= 3) { if (gOverlayLogSeverity >= 3) {
// "DMA transfer of TEXT, DATA, RODATA + rel (%08x-%08x)" PRINTF(T("TEXT,DATA,RODATA+relを転送します(%08x-%08x)\n",
PRINTF("TEXT,DATA,RODATA+relを転送します(%08x-%08x)\n", allocatedRamAddr, end); "DMA transfer of TEXT, DATA, RODATA + rel (%08x-%08x)\n"),
allocatedRamAddr, end);
} }
// DMA the overlay, wait until transfer completes // DMA the overlay, wait until transfer completes
@ -34,7 +35,7 @@ size_t Overlay_Load(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, voi
} }
if (gOverlayLogSeverity >= 3) { if (gOverlayLogSeverity >= 3) {
PRINTF("リロケーションします\n"); // "Relocate" PRINTF(T("リロケーションします\n", "Relocate\n"));
} }
// Relocate pointers in overlay code and data // Relocate pointers in overlay code and data
@ -43,8 +44,8 @@ size_t Overlay_Load(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, voi
// Clear bss if present, bss is located immediately following the relocations // Clear bss if present, bss is located immediately following the relocations
if (ovlRelocs->bssSize != 0) { if (ovlRelocs->bssSize != 0) {
if (gOverlayLogSeverity >= 3) { if (gOverlayLogSeverity >= 3) {
// "Clear BSS area (% 08x-% 08x)" PRINTF(T("BSS領域をクリアします(%08x-%08x)\n", "Clear BSS area (%08x-%08x)\n"), end,
PRINTF("BSS領域をクリアします(%08x-%08x)\n", end, end + ovlRelocs->bssSize); end + ovlRelocs->bssSize);
} }
bzero((void*)end, ovlRelocs->bssSize); bzero((void*)end, ovlRelocs->bssSize);
} }
@ -52,8 +53,8 @@ size_t Overlay_Load(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, voi
size = (uintptr_t)(ovlRelocs->relocations + ovlRelocs->nRelocations) - (uintptr_t)ovlRelocs; size = (uintptr_t)(ovlRelocs->relocations + ovlRelocs->nRelocations) - (uintptr_t)ovlRelocs;
if (gOverlayLogSeverity >= 3) { if (gOverlayLogSeverity >= 3) {
// "Clear REL area (%08x-%08x)" PRINTF(T("REL領域をクリアします(%08x-%08x)\n", "Clear REL area (%08x-%08x)\n"), ovlRelocs,
PRINTF("REL領域をクリアします(%08x-%08x)\n", ovlRelocs, (uintptr_t)ovlRelocs + size); (uintptr_t)ovlRelocs + size);
} }
// Clear relocations, this space remains allocated and goes unused // Clear relocations, this space remains allocated and goes unused
@ -65,8 +66,8 @@ size_t Overlay_Load(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, voi
osInvalICache(allocatedRamAddr, size); osInvalICache(allocatedRamAddr, size);
if (gOverlayLogSeverity >= 3) { if (gOverlayLogSeverity >= 3) {
// "Finish loading dynamic link function" PRINTF(
PRINTF("ダイナミックリンクファンクションのロードを終了します\n\n"); T("ダイナミックリンクファンクションのロードを終了します\n\n", "Finish loading dynamic link function\n\n"));
} }
return size; return size;

View file

@ -127,9 +127,9 @@ void Math3D_LineClosestToPoint(InfiniteLine* line, Vec3f* pos, Vec3f* closestPoi
dirVectorLengthSq = Math3D_Vec3fMagnitudeSq(&line->dir); dirVectorLengthSq = Math3D_Vec3fMagnitudeSq(&line->dir);
if (IS_ZERO(dirVectorLengthSq)) { if (IS_ZERO(dirVectorLengthSq)) {
PRINTF(VT_COL(YELLOW, BLACK)); PRINTF(VT_COL(YELLOW, BLACK));
// "Math3D_lineVsPosSuisenCross(): No straight line length" PRINTF(T("Math3D_lineVsPosSuisenCross():直線の長さがありません\n",
PRINTF("Math3D_lineVsPosSuisenCross():直線の長さがありません\n"); "Math3D_lineVsPosSuisenCross(): No straight line length\n"));
PRINTF("cross = pos を返します。\n"); // "Returns cross = pos." PRINTF(T("cross = pos を返します。\n", "Returns cross = pos.\n"));
PRINTF(VT_RST); PRINTF(VT_RST);
Math_Vec3f_Copy(closestPoint, pos); Math_Vec3f_Copy(closestPoint, pos);
//! @bug Missing early return //! @bug Missing early return
@ -930,8 +930,9 @@ f32 Math3D_Plane(Plane* plane, Vec3f* pointOnPlane) {
f32 Math3D_UDistPlaneToPos(f32 nx, f32 ny, f32 nz, f32 originDist, Vec3f* p) { f32 Math3D_UDistPlaneToPos(f32 nx, f32 ny, f32 nz, f32 originDist, Vec3f* p) {
if (OOT_DEBUG && IS_ZERO(sqrtf(SQ(nx) + SQ(ny) + SQ(nz)))) { if (OOT_DEBUG && IS_ZERO(sqrtf(SQ(nx) + SQ(ny) + SQ(nz)))) {
PRINTF(VT_COL(YELLOW, BLACK)); PRINTF(VT_COL(YELLOW, BLACK));
// "Math3DLengthPlaneAndPos(): Normal size is near zero %f %f %f" PRINTF(T("Math3DLengthPlaneAndPos():法線size がゼロ近いです%f %f %f\n",
PRINTF("Math3DLengthPlaneAndPos():法線size がゼロ近いです%f %f %f\n", nx, ny, nz); "Math3DLengthPlaneAndPos(): Normal size is near zero %f %f %f\n"),
nx, ny, nz);
PRINTF(VT_RST); PRINTF(VT_RST);
return 0.0f; return 0.0f;
} }
@ -948,8 +949,9 @@ f32 Math3D_DistPlaneToPos(f32 nx, f32 ny, f32 nz, f32 originDist, Vec3f* p) {
normMagnitude = sqrtf(SQ(nx) + SQ(ny) + SQ(nz)); normMagnitude = sqrtf(SQ(nx) + SQ(ny) + SQ(nz));
if (IS_ZERO(normMagnitude)) { if (IS_ZERO(normMagnitude)) {
PRINTF(VT_COL(YELLOW, BLACK)); PRINTF(VT_COL(YELLOW, BLACK));
// "Math3DSignedLengthPlaneAndPos(): Normal size is close to zero %f %f %f" PRINTF(T("Math3DSignedLengthPlaneAndPos():法線size がゼロ近いです%f %f %f\n",
PRINTF("Math3DSignedLengthPlaneAndPos():法線size がゼロ近いです%f %f %f\n", nx, ny, nz); "Math3DSignedLengthPlaneAndPos(): Normal size is close to zero %f %f %f\n"),
nx, ny, nz);
PRINTF(VT_RST); PRINTF(VT_RST);
return 0.0f; return 0.0f;
} }

View file

@ -811,7 +811,7 @@ static DamageTable sDamageTablePresets[] = {
// Gets the pointer to one of the 23 preset damage tables. Returns NULL if index is out of range. // Gets the pointer to one of the 23 preset damage tables. Returns NULL if index is out of range.
DamageTable* DamageTable_Get(s32 index) { DamageTable* DamageTable_Get(s32 index) {
if (!(0 <= index && index < ARRAY_COUNT(sDamageTablePresets))) { if (!(0 <= index && index < ARRAY_COUNT(sDamageTablePresets))) {
PRINTF("CollisionBtlTbl_get():インデックスオーバー\n"); // "Index over" PRINTF(T("CollisionBtlTbl_get():インデックスオーバー\n", "CollisionBtlTbl_get(): Index over\n"));
return NULL; return NULL;
} }
return &sDamageTablePresets[index]; return &sDamageTablePresets[index];

View file

@ -352,7 +352,7 @@ s32 Collider_SetJntSphToActor(PlayState* play, ColliderJntSph* dest, ColliderJnt
if (dest->elements == NULL) { if (dest->elements == NULL) {
dest->count = 0; dest->count = 0;
PRINTF(VT_FGCOL(RED)); PRINTF(VT_FGCOL(RED));
PRINTF("ClObjJntSph_set():zelda_malloc()出来ません。\n"); // "Can not." PRINTF(T("ClObjJntSph_set():zelda_malloc()出来ません。\n", "ClObjJntSph_set():zelda_malloc() Can not.\n"));
PRINTF(VT_RST); PRINTF(VT_RST);
return false; return false;
} }
@ -380,7 +380,7 @@ s32 Collider_SetJntSphAllocType1(PlayState* play, ColliderJntSph* dest, Actor* a
if (dest->elements == NULL) { if (dest->elements == NULL) {
dest->count = 0; dest->count = 0;
PRINTF(VT_FGCOL(RED)); PRINTF(VT_FGCOL(RED));
PRINTF("ClObjJntSph_set3():zelda_malloc_出来ません。\n"); // "Can not." PRINTF(T("ClObjJntSph_set3():zelda_malloc_出来ません。\n", "ClObjJntSph_set3():zelda_malloc_ Can not.\n"));
PRINTF(VT_RST); PRINTF(VT_RST);
return false; return false;
} }
@ -408,7 +408,7 @@ s32 Collider_SetJntSphAlloc(PlayState* play, ColliderJntSph* dest, Actor* actor,
if (dest->elements == NULL) { if (dest->elements == NULL) {
dest->count = 0; dest->count = 0;
PRINTF(VT_FGCOL(RED)); PRINTF(VT_FGCOL(RED));
PRINTF("ClObjJntSph_set5():zelda_malloc出来ません\n"); // "Can not." PRINTF(T("ClObjJntSph_set5():zelda_malloc出来ません\n", "ClObjJntSph_set5():zelda_malloc Can not\n"));
PRINTF(VT_RST); PRINTF(VT_RST);
return false; return false;
} }
@ -714,7 +714,7 @@ s32 Collider_SetTrisAllocType1(PlayState* play, ColliderTris* dest, Actor* actor
if (dest->elements == NULL) { if (dest->elements == NULL) {
dest->count = 0; dest->count = 0;
PRINTF(VT_FGCOL(RED)); PRINTF(VT_FGCOL(RED));
PRINTF("ClObjTris_set3():zelda_malloc()出来ません\n"); // "Can not." PRINTF(T("ClObjTris_set3():zelda_malloc()出来ません\n", "ClObjTris_set3():zelda_malloc() Can not\n"));
PRINTF(VT_RST); PRINTF(VT_RST);
return false; return false;
} }
@ -740,7 +740,7 @@ s32 Collider_SetTrisAlloc(PlayState* play, ColliderTris* dest, Actor* actor, Col
if (dest->elements == NULL) { if (dest->elements == NULL) {
PRINTF(VT_FGCOL(RED)); PRINTF(VT_FGCOL(RED));
PRINTF("ClObjTris_set5():zelda_malloc出来ません\n"); // "Can not." PRINTF(T("ClObjTris_set5():zelda_malloc出来ません\n", "ClObjTris_set5():zelda_malloc Can not\n"));
PRINTF(VT_RST); PRINTF(VT_RST);
dest->count = 0; dest->count = 0;
return false; return false;
@ -1170,8 +1170,8 @@ s32 CollisionCheck_SetAT(PlayState* play, CollisionCheckContext* colChkCtx, Coll
return -1; return -1;
} }
if (colChkCtx->colATCount >= COLLISION_CHECK_AT_MAX) { if (colChkCtx->colATCount >= COLLISION_CHECK_AT_MAX) {
// "Index exceeded and cannot add more" PRINTF(T("CollisionCheck_setAT():インデックスがオーバーして追加不能\n",
PRINTF("CollisionCheck_setAT():インデックスがオーバーして追加不能\n"); "CollisionCheck_setAT(): Index exceeded and cannot add more\n"));
return -1; return -1;
} }
if (colChkCtx->sacFlags & SAC_ENABLE) { if (colChkCtx->sacFlags & SAC_ENABLE) {
@ -1198,15 +1198,16 @@ s32 CollisionCheck_SetAT_SAC(PlayState* play, CollisionCheckContext* colChkCtx,
} }
if (colChkCtx->sacFlags & SAC_ENABLE) { if (colChkCtx->sacFlags & SAC_ENABLE) {
if (!(index < colChkCtx->colATCount)) { if (!(index < colChkCtx->colATCount)) {
// "You are trying to register a location that is larger than the total number of data." PRINTF(T("CollisionCheck_setAT_SAC():全データ数より大きいところに登録しようとしている。\n",
PRINTF("CollisionCheck_setAT_SAC():全データ数より大きいところに登録しようとしている。\n"); "CollisionCheck_setAT_SAC(): You are trying to register a location that is larger than the total "
"number of data.\n"));
return -1; return -1;
} }
colChkCtx->colAT[index] = collider; colChkCtx->colAT[index] = collider;
} else { } else {
if (!(colChkCtx->colATCount < COLLISION_CHECK_AT_MAX)) { if (!(colChkCtx->colATCount < COLLISION_CHECK_AT_MAX)) {
// "Index exceeded and cannot add more" PRINTF(T("CollisionCheck_setAT():インデックスがオーバーして追加不能\n",
PRINTF("CollisionCheck_setAT():インデックスがオーバーして追加不能\n"); "CollisionCheck_setAT(): Index exceeded and cannot add more\n"));
return -1; return -1;
} }
index = colChkCtx->colATCount; index = colChkCtx->colATCount;
@ -1238,8 +1239,8 @@ s32 CollisionCheck_SetAC(PlayState* play, CollisionCheckContext* colChkCtx, Coll
return -1; return -1;
} }
if (colChkCtx->colACCount >= COLLISION_CHECK_AC_MAX) { if (colChkCtx->colACCount >= COLLISION_CHECK_AC_MAX) {
// "Index exceeded and cannot add more" PRINTF(T("CollisionCheck_setAC():インデックスがオーバして追加不能\n",
PRINTF("CollisionCheck_setAC():インデックスがオーバして追加不能\n"); "CollisionCheck_setAC(): Index exceeded and cannot add more\n"));
return -1; return -1;
} }
if (colChkCtx->sacFlags & SAC_ENABLE) { if (colChkCtx->sacFlags & SAC_ENABLE) {
@ -1266,15 +1267,16 @@ s32 CollisionCheck_SetAC_SAC(PlayState* play, CollisionCheckContext* colChkCtx,
} }
if (colChkCtx->sacFlags & SAC_ENABLE) { if (colChkCtx->sacFlags & SAC_ENABLE) {
if (!(index < colChkCtx->colACCount)) { if (!(index < colChkCtx->colACCount)) {
// "You are trying to register a location that is larger than the total number of data." PRINTF(T("CollisionCheck_setAC_SAC():全データ数より大きいところに登録しようとしている。\n",
PRINTF("CollisionCheck_setAC_SAC():全データ数より大きいところに登録しようとしている。\n"); "CollisionCheck_setAC_SAC(): You are trying to register a location that is larger than the total "
"number of data.\n"));
return -1; return -1;
} }
colChkCtx->colAC[index] = collider; colChkCtx->colAC[index] = collider;
} else { } else {
if (!(colChkCtx->colACCount < COLLISION_CHECK_AC_MAX)) { if (!(colChkCtx->colACCount < COLLISION_CHECK_AC_MAX)) {
// "Index exceeded and cannot add more" PRINTF(T("CollisionCheck_setAC():インデックスがオーバして追加不能\n",
PRINTF("CollisionCheck_setAC():インデックスがオーバして追加不能\n"); "CollisionCheck_setAC(): Index exceeded and cannot add more\n"));
return -1; return -1;
} }
index = colChkCtx->colACCount; index = colChkCtx->colACCount;
@ -1308,8 +1310,8 @@ s32 CollisionCheck_SetOC(PlayState* play, CollisionCheckContext* colChkCtx, Coll
return -1; return -1;
} }
if (colChkCtx->colOCCount >= COLLISION_CHECK_OC_MAX) { if (colChkCtx->colOCCount >= COLLISION_CHECK_OC_MAX) {
// "Index exceeded and cannot add more" PRINTF(T("CollisionCheck_setOC():インデックスがオーバして追加不能\n",
PRINTF("CollisionCheck_setOC():インデックスがオーバして追加不能\n"); "CollisionCheck_setOC(): Index exceeded and cannot add more\n"));
return -1; return -1;
} }
if (colChkCtx->sacFlags & SAC_ENABLE) { if (colChkCtx->sacFlags & SAC_ENABLE) {
@ -1336,16 +1338,17 @@ s32 CollisionCheck_SetOC_SAC(PlayState* play, CollisionCheckContext* colChkCtx,
} }
if (colChkCtx->sacFlags & SAC_ENABLE) { if (colChkCtx->sacFlags & SAC_ENABLE) {
if (!(index < colChkCtx->colOCCount)) { if (!(index < colChkCtx->colOCCount)) {
// "You are trying to register a location that is larger than the total number of data." PRINTF(T("CollisionCheck_setOC_SAC():全データ数より大きいところに登録しようとしている。\n",
PRINTF("CollisionCheck_setOC_SAC():全データ数より大きいところに登録しようとしている。\n"); "CollisionCheck_setOC_SAC(): You are trying to register a location that is larger than the total "
"number of data.\n"));
return -1; return -1;
} }
//! @bug Should be colOC //! @bug Should be colOC
colChkCtx->colAT[index] = collider; colChkCtx->colAT[index] = collider;
} else { } else {
if (!(colChkCtx->colOCCount < COLLISION_CHECK_OC_MAX)) { if (!(colChkCtx->colOCCount < COLLISION_CHECK_OC_MAX)) {
// "Index exceeded and cannot add more" PRINTF(T("CollisionCheck_setOC():インデックスがオーバして追加不能\n",
PRINTF("CollisionCheck_setOC():インデックスがオーバして追加不能\n"); "CollisionCheck_setOC(): Index exceeded and cannot add more\n"));
return -1; return -1;
} }
index = colChkCtx->colOCCount; index = colChkCtx->colOCCount;
@ -1366,8 +1369,8 @@ s32 CollisionCheck_SetOCLine(PlayState* play, CollisionCheckContext* colChkCtx,
} }
Collider_ResetLineOC(play, collider); Collider_ResetLineOC(play, collider);
if (!(colChkCtx->colLineCount < COLLISION_CHECK_OC_LINE_MAX)) { if (!(colChkCtx->colLineCount < COLLISION_CHECK_OC_LINE_MAX)) {
// "Index exceeded and cannot add more" PRINTF(T("CollisionCheck_setOCLine():インデックスがオーバして追加不能\n",
PRINTF("CollisionCheck_setOCLine():インデックスがオーバして追加不能\n"); "CollisionCheck_setOCLine(): Index exceeded and cannot add more\n"));
return -1; return -1;
} }
index = colChkCtx->colLineCount; index = colChkCtx->colLineCount;
@ -2975,8 +2978,8 @@ void CollisionCheck_OC(PlayState* play, CollisionCheckContext* colChkCtx) {
} }
vsFunc = sOCVsFuncs[(*leftColP)->shape][(*rightColP)->shape]; vsFunc = sOCVsFuncs[(*leftColP)->shape][(*rightColP)->shape];
if (vsFunc == NULL) { if (vsFunc == NULL) {
// "Not compatible" PRINTF(T("CollisionCheck_OC():未対応 %d, %d\n", "CollisionCheck_OC(): Not compatible %d, %d\n"),
PRINTF("CollisionCheck_OC():未対応 %d, %d\n", (*leftColP)->shape, (*rightColP)->shape); (*leftColP)->shape, (*rightColP)->shape);
continue; continue;
} }
vsFunc(play, colChkCtx, *leftColP, *rightColP); vsFunc(play, colChkCtx, *leftColP, *rightColP);
@ -3237,8 +3240,9 @@ s32 CollisionCheck_LineOC(PlayState* play, CollisionCheckContext* colChkCtx, Vec
} }
lineCheck = sOCLineCheckFuncs[(*col)->shape]; lineCheck = sOCLineCheckFuncs[(*col)->shape];
if (lineCheck == NULL) { if (lineCheck == NULL) {
// "type %d not supported" PRINTF(T("CollisionCheck_generalLineOcCheck():未対応 %dタイプ\n",
PRINTF("CollisionCheck_generalLineOcCheck():未対応 %dタイプ\n", (*col)->shape); "CollisionCheck_generalLineOcCheck(): type %d not supported\n"),
(*col)->shape);
} else { } else {
result = lineCheck(play, colChkCtx, (*col), a, b); result = lineCheck(play, colChkCtx, (*col), a, b);
if (result) { if (result) {

View file

@ -68,8 +68,8 @@ void TransitionFade_Update(void* thisx, s32 updateRate) {
this->isDone = true; this->isDone = true;
} }
if ((u32)gSaveContext.transFadeDuration == 0) { if ((u32)gSaveContext.transFadeDuration == 0) {
// "Divide by 0! Zero is included in ZCommonGet fade_speed" PRINTF(VT_COL(RED, WHITE) T("0除算! ZCommonGet fade_speed に0がはいってる",
PRINTF(VT_COL(RED, WHITE) "0除算! ZCommonGet fade_speed に0がはいってる" VT_RST); "Divide by 0! Zero is included in ZCommonGet fade_speed") VT_RST);
} }
alpha = (255.0f * this->timer) / ((void)0, gSaveContext.transFadeDuration); alpha = (255.0f * this->timer) / ((void)0, gSaveContext.transFadeDuration);

View file

@ -212,8 +212,7 @@ void SkelCurve_DrawLimb(PlayState* play, s32 limbIndex, SkelCurve* skelCurve, Ov
gSPDisplayList(POLY_XLU_DISP++, dList); gSPDisplayList(POLY_XLU_DISP++, dList);
} }
} else { } else {
// "FcSkeletonInfo_draw_child (): Not supported" PRINTF(T("FcSkeletonInfo_draw_child():未対応\n", "FcSkeletonInfo_draw_child(): Not supported\n"));
PRINTF("FcSkeletonInfo_draw_child():未対応\n");
} }
} }

View file

@ -648,8 +648,9 @@ s32 View_ErrorCheckEyePosition(f32 eyeX, f32 eyeY, f32 eyeZ) {
if (error != 0) { if (error != 0) {
PRINTF(VT_FGCOL(RED)); PRINTF(VT_FGCOL(RED));
// "Is too large" PRINTF(T("eye が大きすぎます eye=[%8.3f %8.3f %8.3f] error=%d\n",
PRINTF("eye が大きすぎます eye=[%8.3f %8.3f %8.3f] error=%d\n", eyeX, eyeY, eyeZ, error); "eye is too large eye=[%8.3f %8.3f %8.3f] error=%d\n"),
eyeX, eyeY, eyeZ, error);
PRINTF(VT_RST); PRINTF(VT_RST);
} }