1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-13 02:10:57 +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

View file

@ -2,6 +2,7 @@
#include "region.h"
#include "terminal.h"
#include "versions.h"
#include "line_numbers.h"
s32 gCurrentRegion = 0;
@ -39,15 +40,7 @@ void Locale_Init(void) {
PRINTF(VT_COL(RED, WHITE));
PRINTF(T("z_locale_init: 日本用かアメリカ用か判別できません\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", 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
LogUtils_HungupThread("../z_locale.c", LN4(86, 92, 101, 118));
PRINTF(VT_RST);
break;
}

View file

@ -22,6 +22,7 @@
#include "fault.h"
#include "stack.h"
#include "terminal.h"
#include "line_numbers.h"
#if PLATFORM_N64
#include "n64dd.h"
#endif
@ -296,14 +297,9 @@ NORETURN void DmaMgr_Error(DmaRequest* req, const char* filename, const char* er
Fault_AddHungupAndCrashImpl(buff1, buff2);
}
#define DMA_ERROR(req, filename, errorName, errorDesc, file, line1, line2, line3) \
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)
#define DMA_ERROR(req, filename, errorName, errorDesc, file, line) DmaMgr_Error(req, filename, errorName, errorDesc)
#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
#if PLATFORM_GC
@ -409,7 +405,7 @@ void DmaMgr_ProcessRequest(DmaRequest* req) {
DMA_ERROR(req, filename, "Segment Alignment Error",
T("セグメント境界をまたがってDMA転送することはできません",
"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);
@ -430,7 +426,7 @@ void DmaMgr_ProcessRequest(DmaRequest* req) {
DMA_ERROR(req, filename, "Can't Transfer Segment",
T("圧縮されたセグメントの途中からはDMA転送することはできません",
"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) {
@ -439,7 +435,7 @@ void DmaMgr_ProcessRequest(DmaRequest* req) {
DMA_ERROR(req, filename, "Can't Transfer Segment",
T("圧縮されたセグメントの一部だけをDMA転送することはできません",
"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
@ -472,8 +468,8 @@ void DmaMgr_ProcessRequest(DmaRequest* req) {
// Error, rom is compressed so DMA may only be requested within the filesystem bounds
DMA_ERROR(req, NULL, "DATA DON'T EXIST",
T("該当するデータが存在しません", "Corresponding data does not exist"), "../z_std_dma.c", 621,
624, 771);
T("該当するデータが存在しません", "Corresponding data does not exist"), "../z_std_dma.c",
LN3(621, 624, 771));
return;
} else {
// 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)) {
//! @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",
UNK_LINE, UNK_LINE, UNK_LINE);
UNK_LINE);
}
#endif
@ -645,13 +641,7 @@ void DmaMgr_Init(void) {
PRINTF("_bootSegmentRomStart(%08x) != dma_rom_ad[0].rom_b(%08x)\n", _bootSegmentRomStart,
gDmaDataTable[0].file.vromEnd);
//! @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", 837);
#elif OOT_VERSION < GC_JP
Fault_AddHungupAndCrash("../z_std_dma.c", 840);
#else
Fault_AddHungupAndCrash("../z_std_dma.c", 1055);
#endif
Fault_AddHungupAndCrash("../z_std_dma.c", LN3(837, 840, 1055));
}
// Start the DMA manager