mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-04 23:14:37 +00:00
Merge remote-tracking branch 'upstream/main' into if-oot-debug
This commit is contained in:
commit
1aa50b9308
4 changed files with 28 additions and 6 deletions
18
Makefile
18
Makefile
|
@ -51,15 +51,11 @@ endif
|
||||||
# Version-specific settings
|
# Version-specific settings
|
||||||
ifeq ($(VERSION),gc-eu-mq)
|
ifeq ($(VERSION),gc-eu-mq)
|
||||||
DEBUG := 0
|
DEBUG := 0
|
||||||
CFLAGS += -DNON_MATCHING -DNDEBUG -DOOT_DEBUG=0
|
CFLAGS += -DNON_MATCHING
|
||||||
CPPFLAGS += -DNON_MATCHING -DNDEBUG -DOOT_DEBUG=0
|
CPPFLAGS += -DNON_MATCHING
|
||||||
OPTFLAGS := -O2 -g3
|
|
||||||
COMPARE := 0
|
COMPARE := 0
|
||||||
else ifeq ($(VERSION),gc-eu-mq-dbg)
|
else ifeq ($(VERSION),gc-eu-mq-dbg)
|
||||||
DEBUG := 1
|
DEBUG := 1
|
||||||
CFLAGS += -DOOT_DEBUG=1
|
|
||||||
CPPFLAGS += -DOOT_DEBUG=1
|
|
||||||
OPTFLAGS := -O2
|
|
||||||
else
|
else
|
||||||
$(error Unsupported version $(VERSION))
|
$(error Unsupported version $(VERSION))
|
||||||
endif
|
endif
|
||||||
|
@ -72,6 +68,16 @@ VENV := .venv
|
||||||
MAKE = make
|
MAKE = make
|
||||||
CPPFLAGS += -fno-dollars-in-identifiers -P
|
CPPFLAGS += -fno-dollars-in-identifiers -P
|
||||||
|
|
||||||
|
ifeq ($(DEBUG),1)
|
||||||
|
CFLAGS += -DOOT_DEBUG=1
|
||||||
|
CPPFLAGS += -DOOT_DEBUG=1
|
||||||
|
OPTFLAGS := -O2
|
||||||
|
else
|
||||||
|
CFLAGS += -DNDEBUG -DOOT_DEBUG=0
|
||||||
|
CPPFLAGS += -DNDEBUG -DOOT_DEBUG=0
|
||||||
|
OPTFLAGS := -O2 -g3
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(OS),Windows_NT)
|
ifeq ($(OS),Windows_NT)
|
||||||
DETECTED_OS=windows
|
DETECTED_OS=windows
|
||||||
else
|
else
|
||||||
|
|
|
@ -36,10 +36,14 @@ void Locale_ResetRegion(void);
|
||||||
u32 func_80001F48(void);
|
u32 func_80001F48(void);
|
||||||
u32 func_80001F8C(void);
|
u32 func_80001F8C(void);
|
||||||
u32 Locale_IsRegionNative(void);
|
u32 Locale_IsRegionNative(void);
|
||||||
|
#if OOT_DEBUG
|
||||||
void isPrintfInit(void);
|
void isPrintfInit(void);
|
||||||
|
#endif
|
||||||
void rmonPrintf(const char* fmt, ...);
|
void rmonPrintf(const char* fmt, ...);
|
||||||
|
#if OOT_DEBUG
|
||||||
void* is_proutSyncPrintf(void* arg, const char* str, size_t count);
|
void* is_proutSyncPrintf(void* arg, const char* str, size_t count);
|
||||||
NORETURN void func_80002384(const char* exp, const char* file, u32 line);
|
NORETURN void func_80002384(const char* exp, const char* file, u32 line);
|
||||||
|
#endif
|
||||||
OSPiHandle* osDriveRomInit(void);
|
OSPiHandle* osDriveRomInit(void);
|
||||||
void Mio0_Decompress(Yaz0Header* hdr, u8* dst);
|
void Mio0_Decompress(Yaz0Header* hdr, u8* dst);
|
||||||
void StackCheck_Init(StackEntry* entry, void* stackBottom, void* stackTop, u32 initValue, s32 minSpace,
|
void StackCheck_Init(StackEntry* entry, void* stackBottom, void* stackTop, u32 initValue, s32 minSpace,
|
||||||
|
|
|
@ -21,7 +21,9 @@ void bootproc(void) {
|
||||||
|
|
||||||
gCartHandle = osCartRomInit();
|
gCartHandle = osCartRomInit();
|
||||||
osDriveRomInit();
|
osDriveRomInit();
|
||||||
|
#if OOT_DEBUG
|
||||||
isPrintfInit();
|
isPrintfInit();
|
||||||
|
#endif
|
||||||
Locale_Init();
|
Locale_Init();
|
||||||
|
|
||||||
StackCheck_Init(&sIdleThreadInfo, sIdleThreadStack, STACK_TOP(sIdleThreadStack), 0, 256, "idle");
|
StackCheck_Init(&sIdleThreadInfo, sIdleThreadStack, STACK_TOP(sIdleThreadStack), 0, 256, "idle");
|
||||||
|
|
|
@ -5,18 +5,22 @@ OSPiHandle* sISVHandle; // official name : is_Handle
|
||||||
#define gISVDbgPrnAdrs ((ISVDbg*)0xB3FF0000)
|
#define gISVDbgPrnAdrs ((ISVDbg*)0xB3FF0000)
|
||||||
#define ASCII_TO_U32(a, b, c, d) ((u32)((a << 24) | (b << 16) | (c << 8) | (d << 0)))
|
#define ASCII_TO_U32(a, b, c, d) ((u32)((a << 24) | (b << 16) | (c << 8) | (d << 0)))
|
||||||
|
|
||||||
|
#if OOT_DEBUG
|
||||||
void isPrintfInit(void) {
|
void isPrintfInit(void) {
|
||||||
sISVHandle = osCartRomInit();
|
sISVHandle = osCartRomInit();
|
||||||
osEPiWriteIo(sISVHandle, (u32)&gISVDbgPrnAdrs->put, 0);
|
osEPiWriteIo(sISVHandle, (u32)&gISVDbgPrnAdrs->put, 0);
|
||||||
osEPiWriteIo(sISVHandle, (u32)&gISVDbgPrnAdrs->get, 0);
|
osEPiWriteIo(sISVHandle, (u32)&gISVDbgPrnAdrs->get, 0);
|
||||||
osEPiWriteIo(sISVHandle, (u32)&gISVDbgPrnAdrs->magic, ASCII_TO_U32('I', 'S', '6', '4'));
|
osEPiWriteIo(sISVHandle, (u32)&gISVDbgPrnAdrs->magic, ASCII_TO_U32('I', 'S', '6', '4'));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void osSyncPrintfUnused(const char* fmt, ...) {
|
void osSyncPrintfUnused(const char* fmt, ...) {
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, fmt);
|
va_start(args, fmt);
|
||||||
|
|
||||||
|
#if OOT_DEBUG
|
||||||
_Printf(is_proutSyncPrintf, NULL, fmt, args);
|
_Printf(is_proutSyncPrintf, NULL, fmt, args);
|
||||||
|
#endif
|
||||||
|
|
||||||
va_end(args);
|
va_end(args);
|
||||||
}
|
}
|
||||||
|
@ -25,7 +29,9 @@ void osSyncPrintf(const char* fmt, ...) {
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, fmt);
|
va_start(args, fmt);
|
||||||
|
|
||||||
|
#if OOT_DEBUG
|
||||||
_Printf(is_proutSyncPrintf, NULL, fmt, args);
|
_Printf(is_proutSyncPrintf, NULL, fmt, args);
|
||||||
|
#endif
|
||||||
|
|
||||||
va_end(args);
|
va_end(args);
|
||||||
}
|
}
|
||||||
|
@ -35,11 +41,14 @@ void rmonPrintf(const char* fmt, ...) {
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, fmt);
|
va_start(args, fmt);
|
||||||
|
|
||||||
|
#if OOT_DEBUG
|
||||||
_Printf(is_proutSyncPrintf, NULL, fmt, args);
|
_Printf(is_proutSyncPrintf, NULL, fmt, args);
|
||||||
|
#endif
|
||||||
|
|
||||||
va_end(args);
|
va_end(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if OOT_DEBUG
|
||||||
void* is_proutSyncPrintf(void* arg, const char* str, size_t count) {
|
void* is_proutSyncPrintf(void* arg, const char* str, size_t count) {
|
||||||
u32 data;
|
u32 data;
|
||||||
s32 pos;
|
s32 pos;
|
||||||
|
@ -92,3 +101,4 @@ NORETURN void func_80002384(const char* exp, const char* file, u32 line) {
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue