1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-05-10 02:54:24 +00:00

Add macros for line number differences (#2365)

* initial work, think I got all of them

* cleanup line_numbers.h

* fix gc-eu-mq-dbg

* fix matching problems

* remove old lines

* format

* missed some stuff

* comment fixes

* other

* review changes
This commit is contained in:
fig02 2024-12-15 11:07:21 -05:00 committed by GitHub
parent 2eb0b91516
commit ff78b1263b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 111 additions and 144 deletions

63
include/line_numbers.h Normal file
View file

@ -0,0 +1,63 @@
#ifndef LINE_NUMBERS_H
#define LINE_NUMBERS_H
// The macros in this file serve to reduce clutter from version differences that are only due to line numbers being different.
// The "LN" macros defined here are not meant to be used directly. See the wrapper macros below.
#if OOT_VERSION == NTSC_1_0
#define LN(ntsc_1_0, ntsc_1_1, pal_1_0, ntsc_1_2, pal_1_1, gc_jp, gc_jp_mq, gc_us, gc_us_mq, gc_eu_mq_dbg, gc_eu, gc_eu_mq, gc_jp_ce) (ntsc_1_0)
#elif OOT_VERSION == NTSC_1_1
#define LN(ntsc_1_0, ntsc_1_1, pal_1_0, ntsc_1_2, pal_1_1, gc_jp, gc_jp_mq, gc_us, gc_us_mq, gc_eu_mq_dbg, gc_eu, gc_eu_mq, gc_jp_ce) (ntsc_1_1)
#elif OOT_VERSION == PAL_1_0
#define LN(ntsc_1_0, ntsc_1_1, pal_1_0, ntsc_1_2, pal_1_1, gc_jp, gc_jp_mq, gc_us, gc_us_mq, gc_eu_mq_dbg, gc_eu, gc_eu_mq, gc_jp_ce) (pal_1_0)
#elif OOT_VERSION == NTSC_1_2
#define LN(ntsc_1_0, ntsc_1_1, pal_1_0, ntsc_1_2, pal_1_1, gc_jp, gc_jp_mq, gc_us, gc_us_mq, gc_eu_mq_dbg, gc_eu, gc_eu_mq, gc_jp_ce) (ntsc_1_2)
#elif OOT_VERSION == PAL_1_1
#define LN(ntsc_1_0, ntsc_1_1, pal_1_0, ntsc_1_2, pal_1_1, gc_jp, gc_jp_mq, gc_us, gc_us_mq, gc_eu_mq_dbg, gc_eu, gc_eu_mq, gc_jp_ce) (pal_1_1)
#elif OOT_VERSION == GC_JP
#define LN(ntsc_1_0, ntsc_1_1, pal_1_0, ntsc_1_2, pal_1_1, gc_jp, gc_jp_mq, gc_us, gc_us_mq, gc_eu_mq_dbg, gc_eu, gc_eu_mq, gc_jp_ce) (gc_jp)
#elif OOT_VERSION == GC_JP_MQ
#define LN(ntsc_1_0, ntsc_1_1, pal_1_0, ntsc_1_2, pal_1_1, gc_jp, gc_jp_mq, gc_us, gc_us_mq, gc_eu_mq_dbg, gc_eu, gc_eu_mq, gc_jp_ce) (gc_jp_mq)
#elif OOT_VERSION == GC_US
#define LN(ntsc_1_0, ntsc_1_1, pal_1_0, ntsc_1_2, pal_1_1, gc_jp, gc_jp_mq, gc_us, gc_us_mq, gc_eu_mq_dbg, gc_eu, gc_eu_mq, gc_jp_ce) (gc_us)
#elif OOT_VERSION == GC_US_MQ
#define LN(ntsc_1_0, ntsc_1_1, pal_1_0, ntsc_1_2, pal_1_1, gc_jp, gc_jp_mq, gc_us, gc_us_mq, gc_eu_mq_dbg, gc_eu, gc_eu_mq, gc_jp_ce) (gc_us_mq)
#elif OOT_VERSION == GC_EU_MQ_DBG
#define LN(ntsc_1_0, ntsc_1_1, pal_1_0, ntsc_1_2, pal_1_1, gc_jp, gc_jp_mq, gc_us, gc_us_mq, gc_eu_mq_dbg, gc_eu, gc_eu_mq, gc_jp_ce) (gc_eu_mq_dbg)
#elif OOT_VERSION == GC_EU
#define LN(ntsc_1_0, ntsc_1_1, pal_1_0, ntsc_1_2, pal_1_1, gc_jp, gc_jp_mq, gc_us, gc_us_mq, gc_eu_mq_dbg, gc_eu, gc_eu_mq, gc_jp_ce) (gc_eu)
#elif OOT_VERSION == GC_EU_MQ
#define LN(ntsc_1_0, ntsc_1_1, pal_1_0, ntsc_1_2, pal_1_1, gc_jp, gc_jp_mq, gc_us, gc_us_mq, gc_eu_mq_dbg, gc_eu, gc_eu_mq, gc_jp_ce) (gc_eu_mq)
#elif OOT_VERSION == GC_JP_CE
#define LN(ntsc_1_0, ntsc_1_1, pal_1_0, ntsc_1_2, pal_1_1, gc_jp, gc_jp_mq, gc_us, gc_us_mq, gc_eu_mq_dbg, gc_eu, gc_eu_mq, gc_jp_ce) (gc_jp_ce)
#endif
/**
* These wrappers exist to remove duplication of line numbers being passed to LN.
* The wrappers have ambiguous names purposefully so they are short and don't add clutter.
*
* The groupings of different line numbers are difficult to name, as the exact grouping
* depends on which versions happen to have changes in a given file.
*/
// NTSC 1.0 and all the other versions
#define LN1(ntsc_1_0, other) \
LN(ntsc_1_0, other, other, other, other, other, other, other, other, other, other, other, other)
// NTSC 1.0, NTSC 1.1, and all the other versions
#define LN2(ntsc_1_0, ntsc_1_1, other) \
LN(ntsc_1_0, ntsc_1_1, other, other, other, other, other, other, other, other, other, other, other)
// NTSC 1.0, Gamecube, and all the other versions
#define LN3(ntsc_1_0, other, gc) \
LN(ntsc_1_0, other, other, other, other, gc, gc, gc, gc, gc, gc, gc, gc)
// NTSC 1.0, NTSC 1.1, Gamecube, and all the other versions
#define LN4(ntsc_1_0, ntsc_1_1, other, gc) \
LN(ntsc_1_0, ntsc_1_1, other, other, other, gc, gc, gc, gc, gc, gc, gc, gc)
// NTSC 1.0, NTSC 1.1, NTSC 1.2/PAL 1.0, Gamecube US/JP, Gamecube EU, and Gamecube CE
#define LN5(ntsc_1_0, ntsc_1_1, other, pal_1_1, gc_ntsc, gc_eu, gc_jp_ce) \
LN(ntsc_1_0, ntsc_1_1, other, other, pal_1_1, gc_ntsc, gc_ntsc, gc_ntsc, gc_ntsc, gc_eu, gc_eu, gc_eu, gc_jp_ce)
#endif

View file

@ -2,6 +2,7 @@
#include "region.h" #include "region.h"
#include "terminal.h" #include "terminal.h"
#include "versions.h" #include "versions.h"
#include "line_numbers.h"
s32 gCurrentRegion = 0; s32 gCurrentRegion = 0;
@ -39,15 +40,7 @@ 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 OOT_VERSION < NTSC_1_1 LogUtils_HungupThread("../z_locale.c", LN4(86, 92, 101, 118));
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);
#else
LogUtils_HungupThread("../z_locale.c", 118);
#endif
PRINTF(VT_RST); PRINTF(VT_RST);
break; break;
} }

View file

@ -22,6 +22,7 @@
#include "fault.h" #include "fault.h"
#include "stack.h" #include "stack.h"
#include "terminal.h" #include "terminal.h"
#include "line_numbers.h"
#if PLATFORM_N64 #if PLATFORM_N64
#include "n64dd.h" #include "n64dd.h"
#endif #endif
@ -296,14 +297,9 @@ 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, line1, line2, line3) \ #define DMA_ERROR(req, filename, errorName, errorDesc, file, line) DmaMgr_Error(req, filename, errorName, errorDesc)
DmaMgr_Error(req, filename, errorName, errorDesc)
#elif OOT_VERSION < NTSC_1_1
#define DMA_ERROR(req, filename, errorName, errorDesc, file, line1, line2, line3) Fault_AddHungupAndCrash(file, line1)
#elif OOT_VERSION < GC_JP
#define DMA_ERROR(req, filename, errorName, errorDesc, file, line1, line2, line3) Fault_AddHungupAndCrash(file, line2)
#else #else
#define DMA_ERROR(req, filename, errorName, errorDesc, file, line1, line2, line3) Fault_AddHungupAndCrash(file, line3) #define DMA_ERROR(req, filename, errorName, errorDesc, file, line) Fault_AddHungupAndCrash(file, line)
#endif #endif
#if PLATFORM_GC #if PLATFORM_GC
@ -409,7 +405,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", 575, 578, 726); "../z_std_dma.c", LN3(575, 578, 726));
} }
DmaMgr_DmaRomToRam(iter->romStart + (vrom - iter->file.vromStart), ram, size); DmaMgr_DmaRomToRam(iter->romStart + (vrom - iter->file.vromStart), ram, size);
@ -430,7 +426,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", 595, 598, 746); "../z_std_dma.c", LN3(595, 598, 746));
} }
if (size != iter->file.vromEnd - iter->file.vromStart) { if (size != iter->file.vromEnd - iter->file.vromStart) {
@ -439,7 +435,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", 601, 604, 752); "../z_std_dma.c", LN3(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
@ -472,8 +468,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", 621, T("該当するデータが存在しません", "Corresponding data does not exist"), "../z_std_dma.c",
624, 771); LN3(621, 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 +539,7 @@ s32 DmaMgr_RequestAsync(DmaRequest* req, void* ram, uintptr_t vrom, size_t size,
(size == 0) || (size & 1)) { (size == 0) || (size & 1)) {
//! @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",
UNK_LINE, UNK_LINE, UNK_LINE); UNK_LINE);
} }
#endif #endif
@ -645,13 +641,7 @@ 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 OOT_VERSION < NTSC_1_1 Fault_AddHungupAndCrash("../z_std_dma.c", LN3(837, 840, 1055));
Fault_AddHungupAndCrash("../z_std_dma.c", 837);
#elif OOT_VERSION < GC_JP
Fault_AddHungupAndCrash("../z_std_dma.c", 840);
#else
Fault_AddHungupAndCrash("../z_std_dma.c", 1055);
#endif
} }
// Start the DMA manager // Start the DMA manager

View file

@ -3,6 +3,7 @@
#include "libc64/os_malloc.h" #include "libc64/os_malloc.h"
#include "terminal.h" #include "terminal.h"
#include "versions.h" #include "versions.h"
#include "line_numbers.h"
#if PLATFORM_N64 #if PLATFORM_N64
#include "n64dd.h" #include "n64dd.h"
#endif #endif
@ -390,15 +391,7 @@ 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 OOT_VERSION < NTSC_1_1 HUNGUP_AND_CRASH("../game.c", LN4(895, 898, 985, 999));
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);
#else
HUNGUP_AND_CRASH("../game.c", 999);
#endif
} }
} }
@ -439,15 +432,7 @@ void GameState_Realloc(GameState* gameState, size_t size) {
SystemArena_Display(); SystemArena_Display();
#endif #endif
#if OOT_VERSION < NTSC_1_1 HUNGUP_AND_CRASH("../game.c", LN4(940, 943, 1030, 1044));
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);
#else
HUNGUP_AND_CRASH("../game.c", 1044);
#endif
} }
} }

View file

@ -3,6 +3,7 @@
#include "terminal.h" #include "terminal.h"
#include "ucode_disas.h" #include "ucode_disas.h"
#include "versions.h" #include "versions.h"
#include "line_numbers.h"
#define GFXPOOL_HEAD_MAGIC 0x1234 #define GFXPOOL_HEAD_MAGIC 0x1234
#define GFXPOOL_TAIL_MAGIC 0x5678 #define GFXPOOL_TAIL_MAGIC 0x5678
@ -379,30 +380,15 @@ 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 OOT_VERSION < NTSC_1_1 Fault_AddHungupAndCrash("../graph.c", LN4(937, 940, 951, 1070));
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);
#else
Fault_AddHungupAndCrash("../graph.c", 1070);
#endif
} }
if (pool->tailMagic != GFXPOOL_TAIL_MAGIC) { if (pool->tailMagic != GFXPOOL_TAIL_MAGIC) {
problem = true; problem = true;
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 OOT_VERSION < NTSC_1_1 Fault_AddHungupAndCrash("../graph.c", LN4(943, 946, 957, 1076));
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);
#else
Fault_AddHungupAndCrash("../graph.c", 1076);
#endif
} }
} }
@ -494,14 +480,8 @@ 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 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);
#else #else
Fault_AddHungupAndCrash("../graph.c", 1200); Fault_AddHungupAndCrash("../graph.c", LN4(1067, 1070, 1081, 1200));
#endif #endif
} }

View file

@ -31,6 +31,7 @@
#include "global.h" #include "global.h"
#include "fault.h" #include "fault.h"
#include "terminal.h" #include "terminal.h"
#include "line_numbers.h"
#define PADMGR_LOG(controllerNum, msg) \ #define PADMGR_LOG(controllerNum, msg) \
if (DEBUG_FEATURES) { \ if (DEBUG_FEATURES) { \
@ -326,13 +327,7 @@ 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 OOT_VERSION < NTSC_1_1 Fault_AddHungupAndCrash("../padmgr.c", LN3(379, 382, 397));
Fault_AddHungupAndCrash("../padmgr.c", 379);
#elif OOT_VERSION < GC_JP
Fault_AddHungupAndCrash("../padmgr.c", 382);
#else
Fault_AddHungupAndCrash("../padmgr.c", 397);
#endif
break; break;
} }

View file

@ -1,4 +1,5 @@
#include "global.h" #include "global.h"
#include "line_numbers.h"
#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \ #pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
"pal-1.1:128" "pal-1.1:128"
@ -33,15 +34,7 @@ void SysCfb_Init(s32 n64dd) {
PRINTF("RAM4M mode\n"); PRINTF("RAM4M mode\n");
sSysCfbEnd = 0x80400000; sSysCfbEnd = 0x80400000;
} else { } else {
#if OOT_VERSION < NTSC_1_1 LogUtils_HungupThread("../sys_cfb.c", LN4(305, 308, 322, 354));
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);
#else
LogUtils_HungupThread("../sys_cfb.c", 354);
#endif
} }
screenSize = SCREEN_WIDTH * SCREEN_HEIGHT; screenSize = SCREEN_WIDTH * SCREEN_HEIGHT;

View file

@ -1,5 +1,6 @@
#include "global.h" #include "global.h"
#include "terminal.h" #include "terminal.h"
#include "line_numbers.h"
#pragma increment_block_number "ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128" #pragma increment_block_number "ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128"
@ -1610,13 +1611,11 @@ void BgCheck_Allocate(CollisionContext* colCtx, PlayState* play, CollisionHeader
colCtx->subdivAmount.x * sizeof(StaticLookup) * colCtx->subdivAmount.y * colCtx->subdivAmount.x * sizeof(StaticLookup) * colCtx->subdivAmount.y *
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", LN1(4173, 4176));
LogUtils_HungupThread("../z_bgcheck.c", 4173);
#else
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;
colCtx->minBounds.z = colCtx->colHeader->minBounds.z; colCtx->minBounds.z = colCtx->colHeader->minBounds.z;
@ -1633,17 +1632,14 @@ void BgCheck_Allocate(CollisionContext* colCtx, PlayState* play, CollisionHeader
colCtx->colHeader->numPolygons * sizeof(u8) + colCtx->dyna.polyNodesMax * sizeof(SSNode) + colCtx->colHeader->numPolygons * sizeof(u8) + colCtx->dyna.polyNodesMax * sizeof(SSNode) +
colCtx->dyna.polyListMax * sizeof(CollisionPoly) + colCtx->dyna.vtxListMax * sizeof(Vec3s) + colCtx->dyna.polyListMax * sizeof(CollisionPoly) + colCtx->dyna.vtxListMax * sizeof(Vec3s) +
sizeof(CollisionContext); sizeof(CollisionContext);
if (customNodeListMax > 0) { if (customNodeListMax > 0) {
// tblMax is set without checking if customNodeListMax will result in a memory overflow // tblMax is set without checking if customNodeListMax will result in a memory overflow
// this is a non-issue as long as sceneSubdivisionList.nodeListMax is -1 // this is a non-issue as long as sceneSubdivisionList.nodeListMax is -1
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", LN1(4227, 4230));
LogUtils_HungupThread("../z_bgcheck.c", 4227);
#else
LogUtils_HungupThread("../z_bgcheck.c", 4230);
#endif
} }
tblMax = (colCtx->memSize - memSize) / sizeof(SSNode); tblMax = (colCtx->memSize - memSize) / sizeof(SSNode);
} }

View file

@ -4,6 +4,7 @@
#include "quake.h" #include "quake.h"
#include "terminal.h" #include "terminal.h"
#include "versions.h" #include "versions.h"
#include "line_numbers.h"
#if PLATFORM_N64 #if PLATFORM_N64
#include "n64dd.h" #include "n64dd.h"
#endif #endif
@ -176,21 +177,7 @@ void Play_SetupTransition(PlayState* this, s32 transitionType) {
break; break;
default: default:
#if OOT_VERSION < NTSC_1_1 HUNGUP_AND_CRASH("../z_play.c", LN5(2263, 2266, 2269, 2272, 2287, 2290, 2293));
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);
#elif OOT_VERSION < GC_JP
HUNGUP_AND_CRASH("../z_play.c", 2272);
#elif OOT_VERSION < GC_EU_MQ_DBG
HUNGUP_AND_CRASH("../z_play.c", 2287);
#elif OOT_VERSION < GC_JP_CE
HUNGUP_AND_CRASH("../z_play.c", 2290);
#else
HUNGUP_AND_CRASH("../z_play.c", 2293);
#endif
break; break;
} }
} }

View file

@ -2,6 +2,7 @@
#include "fault.h" #include "fault.h"
#include "terminal.h" #include "terminal.h"
#include "versions.h" #include "versions.h"
#include "line_numbers.h"
#if PLATFORM_N64 #if PLATFORM_N64
#include "n64dd.h" #include "n64dd.h"
#endif #endif
@ -456,14 +457,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 OOT_VERSION < NTSC_1_1
Fault_AddHungupAndCrash("../z_room.c", 724); #if PLATFORM_GC
#elif OOT_VERSION < PAL_1_0
Fault_AddHungupAndCrash("../z_room.c", 727);
#elif OOT_VERSION < GC_JP
Fault_AddHungupAndCrash("../z_room.c", 721);
#else
LogUtils_HungupThread("../z_room.c", 726); LogUtils_HungupThread("../z_room.c", 726);
#else
Fault_AddHungupAndCrash("../z_room.c", LN2(724, 727, 721));
#endif #endif
return NULL; return NULL;
@ -547,14 +545,10 @@ 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 OOT_VERSION < NTSC_1_1 #if PLATFORM_GC
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);
#else
LogUtils_HungupThread("../z_room.c", 841); LogUtils_HungupThread("../z_room.c", 841);
#else
Fault_AddHungupAndCrash("../z_room.c", LN2(849, 852, 836));
#endif #endif
} }
} }

View file

@ -5,6 +5,7 @@
#include "n64dd.h" #include "n64dd.h"
#include "stack.h" #include "stack.h"
#include "versions.h" #include "versions.h"
#include "line_numbers.h"
#pragma increment_block_number "ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128 pal-1.0:128 pal-1.1:128" #pragma increment_block_number "ntsc-1.0:128 ntsc-1.1:128 ntsc-1.2:128 pal-1.0:128 pal-1.1:128"
@ -112,14 +113,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_1 Fault_AddHungupAndCrash("../z_n64dd.c", LN2(503, 551, 573));
Fault_AddHungupAndCrash("../z_n64dd.c", 503);
#elif OOT_VERSION < PAL_1_0
Fault_AddHungupAndCrash("../z_n64dd.c", 551);
#else
Fault_AddHungupAndCrash("../z_n64dd.c", 573);
#endif
} }
D_80121213 = 1; D_80121213 = 1;
} }

View file

@ -6,6 +6,7 @@
#include "z_en_horse_game_check.h" #include "z_en_horse_game_check.h"
#include "overlays/actors/ovl_En_Horse/z_en_horse.h" #include "overlays/actors/ovl_En_Horse/z_en_horse.h"
#include "line_numbers.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
@ -90,12 +91,9 @@ 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", LN1(382, 385));
LogUtils_HungupThread("../z_en_horse_game_check.c", 382);
#else
LogUtils_HungupThread("../z_en_horse_game_check.c", 385);
#endif
} }
this->startTimer = 0; this->startTimer = 0;
this->finishTimer = 0; this->finishTimer = 0;
this->result = INGORACE_NO_RESULT; this->result = INGORACE_NO_RESULT;

View file

@ -6,6 +6,7 @@
#include "z_eff_ss_kakera.h" #include "z_eff_ss_kakera.h"
#include "versions.h" #include "versions.h"
#include "line_numbers.h"
#define rReg0 regs[0] #define rReg0 regs[0]
#define rGravity regs[1] #define rGravity regs[1]
@ -55,11 +56,7 @@ u32 EffectSsKakera_Init(PlayState* play, u32 index, EffectSs* this, void* initPa
} else { } else {
PRINTF("shape_modelがNULL\n"); PRINTF("shape_modelがNULL\n");
#if OOT_VERSION < NTSC_1_1 LogUtils_HungupThread("../z_eff_kakera.c", LN1(175, 178));
LogUtils_HungupThread("../z_eff_kakera.c", 175);
#else
LogUtils_HungupThread("../z_eff_kakera.c", 178);
#endif
} }
this->draw = EffectSsKakera_Draw; this->draw = EffectSsKakera_Draw;