1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-25 01:34:18 +00:00

[ntsc-1.0/1.1] Match line numbers in debug strings (#2255)

This commit is contained in:
cadmic 2024-10-09 04:41:16 -07:00 committed by GitHub
parent 7dd8f2b6ad
commit 2048a65dd8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 86 additions and 28 deletions

View file

@ -39,7 +39,11 @@ void Locale_Init(void) {
PRINTF(VT_COL(RED, WHITE)); PRINTF(VT_COL(RED, WHITE));
PRINTF(T("z_locale_init: 日本用かアメリカ用か判別できません\n", PRINTF(T("z_locale_init: 日本用かアメリカ用か判別できません\n",
"z_locale_init: Can't tell if it's for Japan or America\n")); "z_locale_init: Can't tell if it's for Japan or America\n"));
#if PLATFORM_N64 #if OOT_VERSION < NTSC_1_1
LogUtils_HungupThread("../z_locale.c", 86);
#elif OOT_VERSION < PAL_1_0
LogUtils_HungupThread("../z_locale.c", 92);
#elif OOT_VERSION < GC_JP
LogUtils_HungupThread("../z_locale.c", 101); LogUtils_HungupThread("../z_locale.c", 101);
#else #else
LogUtils_HungupThread("../z_locale.c", 118); LogUtils_HungupThread("../z_locale.c", 118);

View file

@ -296,12 +296,14 @@ NORETURN void DmaMgr_Error(DmaRequest* req, const char* filename, const char* er
Fault_AddHungupAndCrashImpl(buff1, buff2); Fault_AddHungupAndCrashImpl(buff1, buff2);
} }
#define DMA_ERROR(req, filename, errorName, errorDesc, file, n64Line, gcLine) \ #define DMA_ERROR(req, filename, errorName, errorDesc, file, line1, line2, line3) \
DmaMgr_Error(req, filename, errorName, errorDesc) DmaMgr_Error(req, filename, errorName, errorDesc)
#elif PLATFORM_N64 #elif OOT_VERSION < NTSC_1_1
#define DMA_ERROR(req, filename, errorName, errorDesc, file, n64Line, gcLine) Fault_AddHungupAndCrash(file, n64Line) #define DMA_ERROR(req, filename, errorName, errorDesc, file, line1, line2, line3) Fault_AddHungupAndCrash(file, line1)
#elif PLATFORM_GC #elif OOT_VERSION < GC_JP
#define DMA_ERROR(req, filename, errorName, errorDesc, file, n64Line, gcLine) Fault_AddHungupAndCrash(file, gcLine) #define DMA_ERROR(req, filename, errorName, errorDesc, file, line1, line2, line3) Fault_AddHungupAndCrash(file, line2)
#else
#define DMA_ERROR(req, filename, errorName, errorDesc, file, line1, line2, line3) Fault_AddHungupAndCrash(file, line3)
#endif #endif
#if PLATFORM_GC #if PLATFORM_GC
@ -407,7 +409,7 @@ void DmaMgr_ProcessRequest(DmaRequest* req) {
DMA_ERROR(req, filename, "Segment Alignment Error", DMA_ERROR(req, filename, "Segment Alignment Error",
T("セグメント境界をまたがってDMA転送することはできません", T("セグメント境界をまたがってDMA転送することはできません",
"DMA transfers cannot cross segment boundaries"), "DMA transfers cannot cross segment boundaries"),
"../z_std_dma.c", 578, 726); "../z_std_dma.c", 575, 578, 726);
} }
DmaMgr_DmaRomToRam(iter->romStart + (vrom - iter->file.vromStart), ram, size); DmaMgr_DmaRomToRam(iter->romStart + (vrom - iter->file.vromStart), ram, size);
@ -428,7 +430,7 @@ void DmaMgr_ProcessRequest(DmaRequest* req) {
DMA_ERROR(req, filename, "Can't Transfer Segment", DMA_ERROR(req, filename, "Can't Transfer Segment",
T("圧縮されたセグメントの途中からはDMA転送することはできません", T("圧縮されたセグメントの途中からはDMA転送することはできません",
"DMA transfer cannot be performed from the middle of a compressed segment"), "DMA transfer cannot be performed from the middle of a compressed segment"),
"../z_std_dma.c", 598, 746); "../z_std_dma.c", 595, 598, 746);
} }
if (size != iter->file.vromEnd - iter->file.vromStart) { if (size != iter->file.vromEnd - iter->file.vromStart) {
@ -437,7 +439,7 @@ void DmaMgr_ProcessRequest(DmaRequest* req) {
DMA_ERROR(req, filename, "Can't Transfer Segment", DMA_ERROR(req, filename, "Can't Transfer Segment",
T("圧縮されたセグメントの一部だけをDMA転送することはできません", T("圧縮されたセグメントの一部だけをDMA転送することはできません",
"It is not possible to DMA only part of a compressed segment"), "It is not possible to DMA only part of a compressed segment"),
"../z_std_dma.c", 604, 752); "../z_std_dma.c", 601, 604, 752);
} }
// Reduce the thread priority and decompress the file, the decompression routine handles the DMA // Reduce the thread priority and decompress the file, the decompression routine handles the DMA
@ -470,8 +472,8 @@ void DmaMgr_ProcessRequest(DmaRequest* req) {
// Error, rom is compressed so DMA may only be requested within the filesystem bounds // Error, rom is compressed so DMA may only be requested within the filesystem bounds
DMA_ERROR(req, NULL, "DATA DON'T EXIST", DMA_ERROR(req, NULL, "DATA DON'T EXIST",
T("該当するデータが存在しません", "Corresponding data does not exist"), "../z_std_dma.c", 624, T("該当するデータが存在しません", "Corresponding data does not exist"), "../z_std_dma.c", 621,
771); 624, 771);
return; return;
} else { } else {
// ROM is uncompressed, allow arbitrary DMA even if the region is not marked in the filesystem // ROM is uncompressed, allow arbitrary DMA even if the region is not marked in the filesystem
@ -543,7 +545,7 @@ s32 DmaMgr_RequestAsync(DmaRequest* req, void* ram, uintptr_t vrom, size_t size,
// its line number is unknown. // its line number is unknown.
//! @bug `req` is passed to `DMA_ERROR` without rom, ram and size being set //! @bug `req` is passed to `DMA_ERROR` without rom, ram and size being set
DMA_ERROR(req, NULL, "ILLIGAL DMA-FUNCTION CALL", T("パラメータ異常です", "Parameter error"), "../z_std_dma.c", DMA_ERROR(req, NULL, "ILLIGAL DMA-FUNCTION CALL", T("パラメータ異常です", "Parameter error"), "../z_std_dma.c",
0, 0); 0, 0, 0);
} }
#endif #endif
@ -645,7 +647,9 @@ void DmaMgr_Init(void) {
PRINTF("_bootSegmentRomStart(%08x) != dma_rom_ad[0].rom_b(%08x)\n", _bootSegmentRomStart, PRINTF("_bootSegmentRomStart(%08x) != dma_rom_ad[0].rom_b(%08x)\n", _bootSegmentRomStart,
gDmaDataTable[0].file.vromEnd); gDmaDataTable[0].file.vromEnd);
//! @bug The main code file where fault.c resides is not yet loaded //! @bug The main code file where fault.c resides is not yet loaded
#if PLATFORM_N64 #if OOT_VERSION < NTSC_1_1
Fault_AddHungupAndCrash("../z_std_dma.c", 837);
#elif OOT_VERSION < GC_JP
Fault_AddHungupAndCrash("../z_std_dma.c", 840); Fault_AddHungupAndCrash("../z_std_dma.c", 840);
#else #else
Fault_AddHungupAndCrash("../z_std_dma.c", 1055); Fault_AddHungupAndCrash("../z_std_dma.c", 1055);

View file

@ -386,7 +386,11 @@ void GameState_InitArena(GameState* gameState, size_t size) {
} else { } else {
THA_Init(&gameState->tha, NULL, 0); THA_Init(&gameState->tha, NULL, 0);
PRINTF(T("ハイラル確保失敗\n", "Failure to secure Hyrule\n")); PRINTF(T("ハイラル確保失敗\n", "Failure to secure Hyrule\n"));
#if PLATFORM_N64 #if OOT_VERSION < NTSC_1_1
HUNGUP_AND_CRASH("../game.c", 895);
#elif OOT_VERSION < PAL_1_0
HUNGUP_AND_CRASH("../game.c", 898);
#elif OOT_VERSION < GC_JP
HUNGUP_AND_CRASH("../game.c", 985); HUNGUP_AND_CRASH("../game.c", 985);
#else #else
HUNGUP_AND_CRASH("../game.c", 999); HUNGUP_AND_CRASH("../game.c", 999);
@ -431,7 +435,11 @@ void GameState_Realloc(GameState* gameState, size_t size) {
SystemArena_Display(); SystemArena_Display();
#endif #endif
#if PLATFORM_N64 #if OOT_VERSION < NTSC_1_1
HUNGUP_AND_CRASH("../game.c", 940);
#elif OOT_VERSION < PAL_1_0
HUNGUP_AND_CRASH("../game.c", 943);
#elif OOT_VERSION < GC_JP
HUNGUP_AND_CRASH("../game.c", 1030); HUNGUP_AND_CRASH("../game.c", 1030);
#else #else
HUNGUP_AND_CRASH("../game.c", 1044); HUNGUP_AND_CRASH("../game.c", 1044);

View file

@ -379,7 +379,11 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) {
PRINTF("%c", BEL); PRINTF("%c", BEL);
PRINTF(VT_COL(RED, WHITE) T("ダイナミック領域先頭が破壊されています\n", "Dynamic area head is destroyed\n") PRINTF(VT_COL(RED, WHITE) T("ダイナミック領域先頭が破壊されています\n", "Dynamic area head is destroyed\n")
VT_RST); VT_RST);
#if PLATFORM_N64 #if OOT_VERSION < NTSC_1_1
Fault_AddHungupAndCrash("../graph.c", 937);
#elif OOT_VERSION < PAL_1_0
Fault_AddHungupAndCrash("../graph.c", 940);
#elif OOT_VERSION < GC_JP
Fault_AddHungupAndCrash("../graph.c", 951); Fault_AddHungupAndCrash("../graph.c", 951);
#else #else
Fault_AddHungupAndCrash("../graph.c", 1070); Fault_AddHungupAndCrash("../graph.c", 1070);
@ -390,7 +394,11 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) {
PRINTF("%c", BEL); PRINTF("%c", BEL);
PRINTF(VT_COL(RED, WHITE) PRINTF(VT_COL(RED, WHITE)
T("ダイナミック領域末尾が破壊されています\n", "Dynamic region tail is destroyed\n") VT_RST); T("ダイナミック領域末尾が破壊されています\n", "Dynamic region tail is destroyed\n") VT_RST);
#if PLATFORM_N64 #if OOT_VERSION < NTSC_1_1
Fault_AddHungupAndCrash("../graph.c", 943);
#elif OOT_VERSION < PAL_1_0
Fault_AddHungupAndCrash("../graph.c", 946);
#elif OOT_VERSION < GC_JP
Fault_AddHungupAndCrash("../graph.c", 957); Fault_AddHungupAndCrash("../graph.c", 957);
#else #else
Fault_AddHungupAndCrash("../graph.c", 1076); Fault_AddHungupAndCrash("../graph.c", 1076);
@ -486,7 +494,11 @@ void Graph_ThreadEntry(void* arg0) {
sprintf(faultMsg, "CLASS SIZE= %d bytes", size); sprintf(faultMsg, "CLASS SIZE= %d bytes", size);
Fault_AddHungupAndCrashImpl("GAME CLASS MALLOC FAILED", faultMsg); Fault_AddHungupAndCrashImpl("GAME CLASS MALLOC FAILED", faultMsg);
#elif PLATFORM_N64 #elif OOT_VERSION < NTSC_1_1
Fault_AddHungupAndCrash("../graph.c", 1067);
#elif OOT_VERSION < PAL_1_0
Fault_AddHungupAndCrash("../graph.c", 1070);
#elif OOT_VERSION < GC_JP
Fault_AddHungupAndCrash("../graph.c", 1081); Fault_AddHungupAndCrash("../graph.c", 1081);
#else #else
Fault_AddHungupAndCrash("../graph.c", 1200); Fault_AddHungupAndCrash("../graph.c", 1200);

View file

@ -326,7 +326,9 @@ void PadMgr_UpdateInputs(PadMgr* padMgr) {
default: default:
// Unknown error response // Unknown error response
LOG_HEX("padnow1->errno", pad->errno, "../padmgr.c", 396); LOG_HEX("padnow1->errno", pad->errno, "../padmgr.c", 396);
#if PLATFORM_N64 #if OOT_VERSION < NTSC_1_1
Fault_AddHungupAndCrash("../padmgr.c", 379);
#elif OOT_VERSION < GC_JP
Fault_AddHungupAndCrash("../padmgr.c", 382); Fault_AddHungupAndCrash("../padmgr.c", 382);
#else #else
Fault_AddHungupAndCrash("../padmgr.c", 397); Fault_AddHungupAndCrash("../padmgr.c", 397);

View file

@ -33,7 +33,11 @@ void SysCfb_Init(s32 n64dd) {
PRINTF("RAM4M mode\n"); PRINTF("RAM4M mode\n");
sSysCfbEnd = 0x80400000; sSysCfbEnd = 0x80400000;
} else { } else {
#if PLATFORM_N64 #if OOT_VERSION < NTSC_1_1
LogUtils_HungupThread("../sys_cfb.c", 305);
#elif OOT_VERSION < PAL_1_0
LogUtils_HungupThread("../sys_cfb.c", 308);
#elif OOT_VERSION < GC_JP
LogUtils_HungupThread("../sys_cfb.c", 322); LogUtils_HungupThread("../sys_cfb.c", 322);
#else #else
LogUtils_HungupThread("../sys_cfb.c", 354); LogUtils_HungupThread("../sys_cfb.c", 354);

View file

@ -1611,7 +1611,11 @@ void BgCheck_Allocate(CollisionContext* colCtx, PlayState* play, CollisionHeader
colCtx->subdivAmount.z, colCtx->subdivAmount.z,
ALIGNOF_MASK(StaticLookup)); ALIGNOF_MASK(StaticLookup));
if (colCtx->lookupTbl == NULL) { if (colCtx->lookupTbl == NULL) {
#if OOT_VERSION < NTSC_1_1
LogUtils_HungupThread("../z_bgcheck.c", 4173);
#else
LogUtils_HungupThread("../z_bgcheck.c", 4176); LogUtils_HungupThread("../z_bgcheck.c", 4176);
#endif
} }
colCtx->minBounds.x = colCtx->colHeader->minBounds.x; colCtx->minBounds.x = colCtx->colHeader->minBounds.x;
colCtx->minBounds.y = colCtx->colHeader->minBounds.y; colCtx->minBounds.y = colCtx->colHeader->minBounds.y;
@ -1635,7 +1639,11 @@ void BgCheck_Allocate(CollisionContext* colCtx, PlayState* play, CollisionHeader
tblMax = customNodeListMax; tblMax = customNodeListMax;
} else { } else {
if (colCtx->memSize < memSize) { if (colCtx->memSize < memSize) {
#if OOT_VERSION < NTSC_1_1
LogUtils_HungupThread("../z_bgcheck.c", 4227);
#else
LogUtils_HungupThread("../z_bgcheck.c", 4230); LogUtils_HungupThread("../z_bgcheck.c", 4230);
#endif
} }
tblMax = (colCtx->memSize - memSize) / sizeof(SSNode); tblMax = (colCtx->memSize - memSize) / sizeof(SSNode);
} }

View file

@ -176,7 +176,11 @@ void Play_SetupTransition(PlayState* this, s32 transitionType) {
break; break;
default: default:
#if OOT_VERSION < PAL_1_1 #if OOT_VERSION < NTSC_1_1
HUNGUP_AND_CRASH("../z_play.c", 2263);
#elif OOT_VERSION < PAL_1_0
HUNGUP_AND_CRASH("../z_play.c", 2266);
#elif OOT_VERSION < PAL_1_1
HUNGUP_AND_CRASH("../z_play.c", 2269); HUNGUP_AND_CRASH("../z_play.c", 2269);
#elif OOT_VERSION < GC_JP #elif OOT_VERSION < GC_JP
HUNGUP_AND_CRASH("../z_play.c", 2272); HUNGUP_AND_CRASH("../z_play.c", 2272);

View file

@ -456,7 +456,11 @@ RoomShapeImageMultiBgEntry* Room_GetImageMultiBgEntry(RoomShapeImageMulti* roomS
PRINTF(VT_COL(RED, WHITE) T("z_room.c:カメラIDに一致するデータが存在しません camid=%d\n", PRINTF(VT_COL(RED, WHITE) T("z_room.c:カメラIDに一致するデータが存在しません camid=%d\n",
"z_room.c: Data consistent with camera id does not exist camid=%d\n") VT_RST, "z_room.c: Data consistent with camera id does not exist camid=%d\n") VT_RST,
bgCamIndex); bgCamIndex);
#if PLATFORM_N64 #if OOT_VERSION < NTSC_1_1
Fault_AddHungupAndCrash("../z_room.c", 724);
#elif OOT_VERSION < PAL_1_0
Fault_AddHungupAndCrash("../z_room.c", 727);
#elif OOT_VERSION < GC_JP
Fault_AddHungupAndCrash("../z_room.c", 721); Fault_AddHungupAndCrash("../z_room.c", 721);
#else #else
LogUtils_HungupThread("../z_room.c", 726); LogUtils_HungupThread("../z_room.c", 726);
@ -543,7 +547,11 @@ void Room_DrawImage(PlayState* play, Room* room, u32 flags) {
} else if (roomShape->amountType == ROOM_SHAPE_IMAGE_AMOUNT_MULTI) { } else if (roomShape->amountType == ROOM_SHAPE_IMAGE_AMOUNT_MULTI) {
Room_DrawImageMulti(play, room, flags); Room_DrawImageMulti(play, room, flags);
} else { } else {
#if PLATFORM_N64 #if OOT_VERSION < NTSC_1_1
Fault_AddHungupAndCrash("../z_room.c", 849);
#elif OOT_VERSION < PAL_1_0
Fault_AddHungupAndCrash("../z_room.c", 852);
#elif OOT_VERSION < GC_JP
Fault_AddHungupAndCrash("../z_room.c", 836); Fault_AddHungupAndCrash("../z_room.c", 836);
#else #else
LogUtils_HungupThread("../z_room.c", 841); LogUtils_HungupThread("../z_room.c", 841);

View file

@ -112,9 +112,9 @@ void func_801C6FD8(void) {
// Adds a HungupAndCrash // Adds a HungupAndCrash
void func_801C7018(void) { void func_801C7018(void) {
if (D_80121213 != 0) { if (D_80121213 != 0) {
#if OOT_VERSION == NTSC_1_0 #if OOT_VERSION < NTSC_1_1
Fault_AddHungupAndCrash("../z_n64dd.c", 503); Fault_AddHungupAndCrash("../z_n64dd.c", 503);
#elif OOT_VERSION == NTSC_1_1 #elif OOT_VERSION < PAL_1_0
Fault_AddHungupAndCrash("../z_n64dd.c", 551); Fault_AddHungupAndCrash("../z_n64dd.c", 551);
#else #else
Fault_AddHungupAndCrash("../z_n64dd.c", 573); Fault_AddHungupAndCrash("../z_n64dd.c", 573);
@ -215,7 +215,7 @@ void func_801C7268(void) {
} else if (B_801D9DC8 != 0) { } else if (B_801D9DC8 != 0) {
B_801D9DC8 = 0; B_801D9DC8 = 0;
} }
#if OOT_VERSION == NTSC_1_0 #if OOT_VERSION < NTSC_1_1
if (B_801D9DC0 != 0) { if (B_801D9DC0 != 0) {
sp1C = (osGetTime() - B_801D9DC0) * 64 / 3000; sp1C = (osGetTime() - B_801D9DC0) * 64 / 3000;
@ -338,7 +338,7 @@ s32 func_801C7658(void) {
B_801D9D50.unk_00 = 13; B_801D9D50.unk_00 = 13;
(&func_801C8000)(&B_801D9D50); (&func_801C8000)(&B_801D9D50);
#if OOT_VERSION > NTSC_1_1 #if OOT_VERSION >= PAL_1_0
StackCheck_Init(&B_801DAF88, B_801D9F88, STACK_TOP(B_801D9F88), 0, 0x100, "ddmsg"); StackCheck_Init(&B_801DAF88, B_801D9F88, STACK_TOP(B_801D9F88), 0, 0x100, "ddmsg");
osCreateThread(&B_801D9DD8, THREAD_ID_DDMSG, &func_801C711C, &B_801D9B90, STACK_TOP(B_801D9F88), THREAD_PRI_DDMSG); osCreateThread(&B_801D9DD8, THREAD_ID_DDMSG, &func_801C711C, &B_801D9B90, STACK_TOP(B_801D9F88), THREAD_PRI_DDMSG);
osStartThread(&B_801D9DD8); osStartThread(&B_801D9DD8);
@ -519,7 +519,7 @@ void func_801C7C1C(void* dest, s32 offset, s32 size) {
bcopy((u8*)sp4C, (u8*)dest + func_801C7BEC(sp5C) - sp54 + var_s1, sp50); bcopy((u8*)sp4C, (u8*)dest + func_801C7BEC(sp5C) - sp54 + var_s1, sp50);
} }
} }
#if OOT_VERSION == NTSC_1_0 #if OOT_VERSION < NTSC_1_1
if (B_801D9DC0 != 0) { if (B_801D9DC0 != 0) {
temp_v1_2 = (osGetTime() - B_801D9DC0) * 64 / 3000; temp_v1_2 = (osGetTime() - B_801D9DC0) * 64 / 3000;
if (1000000 - temp_v1_2 > 0) { if (1000000 - temp_v1_2 > 0) {

View file

@ -90,7 +90,11 @@ s32 EnHorseGameCheck_InitIngoRace(EnHorseGameCheckBase* base, PlayState* play) {
this->ingoHorse = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, -250.0f, 1.0f, -1650.0f, 0, 0x4000, 0, 0x8003); this->ingoHorse = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, -250.0f, 1.0f, -1650.0f, 0, 0x4000, 0, 0x8003);
if (this->ingoHorse == NULL) { if (this->ingoHorse == NULL) {
#if OOT_VERSION < NTSC_1_1
LogUtils_HungupThread("../z_en_horse_game_check.c", 382);
#else
LogUtils_HungupThread("../z_en_horse_game_check.c", 385); LogUtils_HungupThread("../z_en_horse_game_check.c", 385);
#endif
} }
this->startTimer = 0; this->startTimer = 0;
this->finishTimer = 0; this->finishTimer = 0;