1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-15 04:14:34 +00:00

Decouple Debug Features From gc-eu-mq-dbg (#2296)

* rename OOT_DEBUG to DEBUG_FEATURES

* makefile changes

* add DEBUG_ASSETS

* fix DEBUG_FEATURES usages

* format

* fix errors

* review

* fix problem and review2

* review

* add DEBUG_FEATURES to DEBUG_ASSETS check

* review

* whoops

* format
This commit is contained in:
fig02 2024-11-17 17:02:07 -05:00 committed by GitHub
parent cf4dc98cc9
commit 17edb82c0d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
168 changed files with 652 additions and 606 deletions

View file

@ -7,14 +7,16 @@
Arena sZeldaArena;
#if OOT_DEBUG
#if DEBUG_FEATURES
s32 gZeldaArenaLogSeverity = LOG_SEVERITY_ERROR;
void ZeldaArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action) {
if (ptr == NULL) {
if (gZeldaArenaLogSeverity >= LOG_SEVERITY_ERROR) {
PRINTF(T("%s: %u バイトの%sに失敗しました\n", "%s: %u bytes %s failed\n"), name, size, action);
#if PLATFORM_GC
__osDisplayArena(&sZeldaArena);
#endif
}
} else if (gZeldaArenaLogSeverity >= LOG_SEVERITY_VERBOSE) {
PRINTF(T("%s: %u バイトの%sに成功しました\n", "%s: %u bytes %s succeeded\n"), name, size, action);
@ -34,7 +36,7 @@ void* ZeldaArena_Malloc(u32 size) {
return ptr;
}
#if OOT_DEBUG
#if DEBUG_FEATURES
void* ZeldaArena_MallocDebug(u32 size, const char* file, int line) {
void* ptr = __osMallocDebug(&sZeldaArena, size, file, line);
@ -50,7 +52,7 @@ void* ZeldaArena_MallocR(u32 size) {
return ptr;
}
#if OOT_DEBUG
#if DEBUG_FEATURES
void* ZeldaArena_MallocRDebug(u32 size, const char* file, int line) {
void* ptr = __osMallocRDebug(&sZeldaArena, size, file, line);
@ -65,7 +67,7 @@ void* ZeldaArena_Realloc(void* ptr, u32 newSize) {
return ptr;
}
#if OOT_DEBUG
#if DEBUG_FEATURES
void* ZeldaArena_ReallocDebug(void* ptr, u32 newSize, const char* file, int line) {
ptr = __osReallocDebug(&sZeldaArena, ptr, newSize, file, line);
ZELDA_ARENA_CHECK_POINTER(ptr, newSize, "zelda_realloc_DEBUG", T("再確保", "Re-securing"));
@ -77,7 +79,7 @@ void ZeldaArena_Free(void* ptr) {
__osFree(&sZeldaArena, ptr);
}
#if OOT_DEBUG
#if DEBUG_FEATURES
void ZeldaArena_FreeDebug(void* ptr, const char* file, int line) {
__osFreeDebug(&sZeldaArena, ptr, file, line);
}
@ -96,7 +98,7 @@ void* ZeldaArena_Calloc(u32 num, u32 size) {
return ret;
}
#if OOT_DEBUG
#if PLATFORM_GC && DEBUG_FEATURES
void ZeldaArena_Display(void) {
PRINTF(T("ゼルダヒープ表示\n", "Zelda heap display\n"));
__osDisplayArena(&sZeldaArena);
@ -112,14 +114,14 @@ void ZeldaArena_Check(void) {
}
void ZeldaArena_Init(void* start, u32 size) {
#if OOT_DEBUG
#if DEBUG_FEATURES
gZeldaArenaLogSeverity = LOG_SEVERITY_NOLOG;
#endif
__osMallocInit(&sZeldaArena, start, size);
}
void ZeldaArena_Cleanup(void) {
#if OOT_DEBUG
#if DEBUG_FEATURES
gZeldaArenaLogSeverity = LOG_SEVERITY_NOLOG;
#endif
__osMallocCleanup(&sZeldaArena);