1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-25 01:34:18 +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

@ -49,6 +49,11 @@ N64_EMULATOR ?=
# Set to override game region in the ROM header (options: JP, US, EU). This can be used to build a fake US version # Set to override game region in the ROM header (options: JP, US, EU). This can be used to build a fake US version
# of the debug ROM for better emulator compatibility, or to build US versions of NTSC N64 ROMs. # of the debug ROM for better emulator compatibility, or to build US versions of NTSC N64 ROMs.
# REGION ?= US # REGION ?= US
# Set to enable debug features regardless of ROM version.
# Note that by enabling debug features on non-debug ROM versions, some debug ROM specific assets will not be included.
# This means the debug test scenes and some debug graphics in the elf_msg actors will not work as expected.
# This may also be used to disable debug features on debug ROMs by setting DEBUG_FEATURES to 0
# DEBUG_FEATURES ?= 1
CFLAGS ?= CFLAGS ?=
CPPFLAGS ?= CPPFLAGS ?=
@ -60,57 +65,57 @@ ifeq ($(VERSION),ntsc-1.0)
REGIONAL_CHECKSUM := 1 REGIONAL_CHECKSUM := 1
REGION ?= JP REGION ?= JP
PLATFORM := N64 PLATFORM := N64
DEBUG := 0 DEBUG_FEATURES ?= 0
else ifeq ($(VERSION),ntsc-1.1) else ifeq ($(VERSION),ntsc-1.1)
REGIONAL_CHECKSUM := 1 REGIONAL_CHECKSUM := 1
REGION ?= JP REGION ?= JP
PLATFORM := N64 PLATFORM := N64
DEBUG := 0 DEBUG_FEATURES ?= 0
else ifeq ($(VERSION),pal-1.0) else ifeq ($(VERSION),pal-1.0)
REGION ?= EU REGION ?= EU
PLATFORM := N64 PLATFORM := N64
DEBUG := 0 DEBUG_FEATURES ?= 0
else ifeq ($(VERSION),ntsc-1.2) else ifeq ($(VERSION),ntsc-1.2)
REGIONAL_CHECKSUM := 1 REGIONAL_CHECKSUM := 1
REGION ?= JP REGION ?= JP
PLATFORM := N64 PLATFORM := N64
DEBUG := 0 DEBUG_FEATURES ?= 0
else ifeq ($(VERSION),pal-1.1) else ifeq ($(VERSION),pal-1.1)
REGION ?= EU REGION ?= EU
PLATFORM := N64 PLATFORM := N64
DEBUG := 0 DEBUG_FEATURES ?= 0
else ifeq ($(VERSION),gc-jp) else ifeq ($(VERSION),gc-jp)
REGION ?= JP REGION ?= JP
PLATFORM := GC PLATFORM := GC
DEBUG := 0 DEBUG_FEATURES ?= 0
else ifeq ($(VERSION),gc-jp-mq) else ifeq ($(VERSION),gc-jp-mq)
REGION ?= JP REGION ?= JP
PLATFORM := GC PLATFORM := GC
DEBUG := 0 DEBUG_FEATURES ?= 0
else ifeq ($(VERSION),gc-us) else ifeq ($(VERSION),gc-us)
REGION ?= US REGION ?= US
PLATFORM := GC PLATFORM := GC
DEBUG := 0 DEBUG_FEATURES ?= 0
else ifeq ($(VERSION),gc-us-mq) else ifeq ($(VERSION),gc-us-mq)
REGION ?= US REGION ?= US
PLATFORM := GC PLATFORM := GC
DEBUG := 0 DEBUG_FEATURES ?= 0
else ifeq ($(VERSION),gc-eu-mq-dbg) else ifeq ($(VERSION),gc-eu-mq-dbg)
REGION ?= EU REGION ?= EU
PLATFORM := GC PLATFORM := GC
DEBUG := 1 DEBUG_FEATURES ?= 1
else ifeq ($(VERSION),gc-eu) else ifeq ($(VERSION),gc-eu)
REGION ?= EU REGION ?= EU
PLATFORM := GC PLATFORM := GC
DEBUG := 0 DEBUG_FEATURES ?= 0
else ifeq ($(VERSION),gc-eu-mq) else ifeq ($(VERSION),gc-eu-mq)
REGION ?= EU REGION ?= EU
PLATFORM := GC PLATFORM := GC
DEBUG := 0 DEBUG_FEATURES ?= 0
else ifeq ($(VERSION),gc-jp-ce) else ifeq ($(VERSION),gc-jp-ce)
REGION ?= JP REGION ?= JP
PLATFORM := GC PLATFORM := GC
DEBUG := 0 DEBUG_FEATURES ?= 0
else else
$(error Unsupported version $(VERSION)) $(error Unsupported version $(VERSION))
endif endif
@ -155,11 +160,11 @@ else
$(error Unsupported platform $(PLATFORM)) $(error Unsupported platform $(PLATFORM))
endif endif
ifeq ($(DEBUG),1) ifeq ($(DEBUG_FEATURES),1)
CPP_DEFINES += -DOOT_DEBUG=1 CPP_DEFINES += -DDEBUG_FEATURES=1
OPTFLAGS := -O2 OPTFLAGS := -O2
else else
CPP_DEFINES += -DOOT_DEBUG=0 -DNDEBUG CPP_DEFINES += -DDEBUG_FEATURES=0 -DNDEBUG
OPTFLAGS := -O2 -g3 OPTFLAGS := -O2 -g3
endif endif
@ -254,7 +259,7 @@ GBI_DEFINES := -DF3DEX_GBI_2
ifeq ($(PLATFORM),GC) ifeq ($(PLATFORM),GC)
GBI_DEFINES += -DF3DEX_GBI_PL -DGBI_DOWHILE GBI_DEFINES += -DF3DEX_GBI_PL -DGBI_DOWHILE
endif endif
ifeq ($(DEBUG),1) ifeq ($(DEBUG_FEATURES),1)
GBI_DEFINES += -DGBI_DEBUG GBI_DEFINES += -DGBI_DEBUG
endif endif
@ -459,7 +464,7 @@ endif
$(BUILD_DIR)/src/code/jpegutils.o: CC := $(CC_OLD) $(BUILD_DIR)/src/code/jpegutils.o: CC := $(CC_OLD)
$(BUILD_DIR)/src/code/jpegdecoder.o: CC := $(CC_OLD) $(BUILD_DIR)/src/code/jpegdecoder.o: CC := $(CC_OLD)
ifeq ($(DEBUG),1) ifeq ($(DEBUG_FEATURES),1)
$(BUILD_DIR)/src/libc/%.o: OPTFLAGS := -g $(BUILD_DIR)/src/libc/%.o: OPTFLAGS := -g
else else
$(BUILD_DIR)/src/libc/%.o: OPTFLAGS := -O2 $(BUILD_DIR)/src/libc/%.o: OPTFLAGS := -O2

View file

@ -1,4 +1,5 @@
.include "macro.inc" .include "macro.inc"
#include "versions.h"
/* assembler directives */ /* assembler directives */
.set noat /* allow manual use of $at */ .set noat /* allow manual use of $at */
@ -11,7 +12,7 @@
/* temporary file name, rename to something more appropriate when decompiled */ /* temporary file name, rename to something more appropriate when decompiled */
#if OOT_DEBUG #if DEBUG_ASSETS
glabel gMojiFontTLUTs glabel gMojiFontTLUTs
.incbin "incbin/gMojiFontTLUTs" .incbin "incbin/gMojiFontTLUTs"

View file

@ -19,7 +19,7 @@
"OOT_REGION=REGION_JP", "OOT_REGION=REGION_JP",
"PLATFORM_N64=1", "PLATFORM_N64=1",
"PLATFORM_GC=0", "PLATFORM_GC=0",
"OOT_DEBUG=0", "DEBUG_FEATURES=0",
"NDEBUG", "NDEBUG",
"F3DEX_GBI_2" "F3DEX_GBI_2"
], ],
@ -44,7 +44,7 @@
"OOT_REGION=REGION_JP", "OOT_REGION=REGION_JP",
"PLATFORM_N64=0", "PLATFORM_N64=0",
"PLATFORM_GC=1", "PLATFORM_GC=1",
"OOT_DEBUG=0", "DEBUG_FEATURES=0",
"NDEBUG", "NDEBUG",
"F3DEX_GBI_2", "F3DEX_GBI_2",
"F3DEX_GBI_PL", "F3DEX_GBI_PL",
@ -71,7 +71,7 @@
"OOT_REGION=REGION_JP", "OOT_REGION=REGION_JP",
"PLATFORM_N64=0", "PLATFORM_N64=0",
"PLATFORM_GC=1", "PLATFORM_GC=1",
"OOT_DEBUG=0", "DEBUG_FEATURES=0",
"NDEBUG", "NDEBUG",
"F3DEX_GBI_2", "F3DEX_GBI_2",
"F3DEX_GBI_PL", "F3DEX_GBI_PL",
@ -98,7 +98,7 @@
"OOT_REGION=REGION_US", "OOT_REGION=REGION_US",
"PLATFORM_N64=0", "PLATFORM_N64=0",
"PLATFORM_GC=1", "PLATFORM_GC=1",
"OOT_DEBUG=0", "DEBUG_FEATURES=0",
"NDEBUG", "NDEBUG",
"F3DEX_GBI_2", "F3DEX_GBI_2",
"F3DEX_GBI_PL", "F3DEX_GBI_PL",
@ -125,7 +125,7 @@
"OOT_REGION=REGION_US", "OOT_REGION=REGION_US",
"PLATFORM_N64=0", "PLATFORM_N64=0",
"PLATFORM_GC=1", "PLATFORM_GC=1",
"OOT_DEBUG=0", "DEBUG_FEATURES=0",
"NDEBUG", "NDEBUG",
"F3DEX_GBI_2", "F3DEX_GBI_2",
"F3DEX_GBI_PL", "F3DEX_GBI_PL",
@ -152,7 +152,7 @@
"OOT_REGION=REGION_EU", "OOT_REGION=REGION_EU",
"PLATFORM_N64=0", "PLATFORM_N64=0",
"PLATFORM_GC=1", "PLATFORM_GC=1",
"OOT_DEBUG=1", "DEBUG_FEATURES=1",
"F3DEX_GBI_2", "F3DEX_GBI_2",
"F3DEX_GBI_PL", "F3DEX_GBI_PL",
"GBI_DOWHILE", "GBI_DOWHILE",
@ -179,7 +179,7 @@
"OOT_REGION=REGION_EU", "OOT_REGION=REGION_EU",
"PLATFORM_N64=0", "PLATFORM_N64=0",
"PLATFORM_GC=1", "PLATFORM_GC=1",
"OOT_DEBUG=0", "DEBUG_FEATURES=0",
"NDEBUG", "NDEBUG",
"F3DEX_GBI_2", "F3DEX_GBI_2",
"F3DEX_GBI_PL", "F3DEX_GBI_PL",
@ -206,7 +206,7 @@
"OOT_REGION=REGION_EU", "OOT_REGION=REGION_EU",
"PLATFORM_N64=0", "PLATFORM_N64=0",
"PLATFORM_GC=1", "PLATFORM_GC=1",
"OOT_DEBUG=0", "DEBUG_FEATURES=0",
"NDEBUG", "NDEBUG",
"F3DEX_GBI_2", "F3DEX_GBI_2",
"F3DEX_GBI_PL", "F3DEX_GBI_PL",
@ -233,7 +233,7 @@
"OOT_REGION=REGION_JP", "OOT_REGION=REGION_JP",
"PLATFORM_N64=0", "PLATFORM_N64=0",
"PLATFORM_GC=1", "PLATFORM_GC=1",
"OOT_DEBUG=0", "DEBUG_FEATURES=0",
"NDEBUG", "NDEBUG",
"F3DEX_GBI_2", "F3DEX_GBI_2",
"F3DEX_GBI_PL", "F3DEX_GBI_PL",

View file

@ -64,7 +64,7 @@ A more complete `c_cpp_properties.json` with configurations for all supported ve
"OOT_REGION=REGION_EU", "OOT_REGION=REGION_EU",
"PLATFORM_N64=0", "PLATFORM_N64=0",
"PLATFORM_GC=1", "PLATFORM_GC=1",
"OOT_DEBUG=1", "DEBUG_FEATURES=1",
"F3DEX_GBI_2", "F3DEX_GBI_2",
"F3DEX_GBI_PL", "F3DEX_GBI_PL",
"GBI_DOWHILE", "GBI_DOWHILE",

View file

@ -15,17 +15,17 @@ void Yaz0_DecompressImpl(u8* src, u8* dst);
void Yaz0_Decompress(uintptr_t romStart, u8* dst, size_t size); void Yaz0_Decompress(uintptr_t romStart, u8* dst, size_t size);
void Locale_Init(void); void Locale_Init(void);
void Locale_ResetRegion(void); void Locale_ResetRegion(void);
#if OOT_DEBUG #if DEBUG_FEATURES
void isPrintfInit(void); void isPrintfInit(void);
#endif #endif
void rmonPrintf(const char* fmt, ...); void rmonPrintf(const char* fmt, ...);
#if OOT_DEBUG #if DEBUG_FEATURES
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, int line); NORETURN void func_80002384(const char* exp, const char* file, int line);
#endif #endif
OSPiHandle* osDriveRomInit(void); OSPiHandle* osDriveRomInit(void);
void Mio0_Decompress(u8* src, u8* dst); void Mio0_Decompress(u8* src, u8* dst);
#if OOT_DEBUG #if DEBUG_FEATURES
void LogUtils_LogHexDump(void* ptr, s32 size0); void LogUtils_LogHexDump(void* ptr, s32 size0);
void LogUtils_CheckNullPointer(const char* exp, void* ptr, const char* file, int line); void LogUtils_CheckNullPointer(const char* exp, void* ptr, const char* file, int line);
void LogUtils_CheckValidPointer(const char* exp, void* ptr, const char* file, int line); void LogUtils_CheckValidPointer(const char* exp, void* ptr, const char* file, int line);
@ -51,7 +51,7 @@ s32 func_800635D0(s32);
void Regs_Init(void); void Regs_Init(void);
void DebugCamera_ScreenText(u8 x, u8 y, const char* text); void DebugCamera_ScreenText(u8 x, u8 y, const char* text);
void DebugCamera_ScreenTextColored(u8 x, u8 y, u8 colorIndex, const char* text); void DebugCamera_ScreenTextColored(u8 x, u8 y, u8 colorIndex, const char* text);
#if OOT_DEBUG #if DEBUG_FEATURES
void Regs_UpdateEditor(Input* input); void Regs_UpdateEditor(Input* input);
#endif #endif
void Debug_DrawText(GraphicsContext* gfxCtx); void Debug_DrawText(GraphicsContext* gfxCtx);
@ -231,7 +231,7 @@ void GameState_Init(GameState* gameState, GameStateFunc init, GraphicsContext* g
void GameState_Destroy(GameState* gameState); void GameState_Destroy(GameState* gameState);
GameStateFunc GameState_GetInit(GameState* gameState); GameStateFunc GameState_GetInit(GameState* gameState);
u32 GameState_IsRunning(GameState* gameState); u32 GameState_IsRunning(GameState* gameState);
#if OOT_DEBUG #if DEBUG_FEATURES
void* GameState_Alloc(GameState* gameState, size_t size, const char* file, int line); void* GameState_Alloc(GameState* gameState, size_t size, const char* file, int line);
void* GameAlloc_MallocDebug(GameAlloc* this, u32 size, const char* file, int line); void* GameAlloc_MallocDebug(GameAlloc* this, u32 size, const char* file, int line);
#endif #endif
@ -273,7 +273,7 @@ void DebugArena_Check(void);
void DebugArena_Init(void* start, u32 size); void DebugArena_Init(void* start, u32 size);
void DebugArena_Cleanup(void); void DebugArena_Cleanup(void);
s32 DebugArena_IsInitialized(void); s32 DebugArena_IsInitialized(void);
#if OOT_DEBUG #if DEBUG_FEATURES
void DebugArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action); void DebugArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action);
void* DebugArena_MallocDebug(u32 size, const char* file, int line); void* DebugArena_MallocDebug(u32 size, const char* file, int line);
void* DebugArena_MallocRDebug(u32 size, const char* file, int line); void* DebugArena_MallocRDebug(u32 size, const char* file, int line);

View file

@ -77,7 +77,7 @@ void* Graph_Alloc2(GraphicsContext* gfxCtx, size_t size);
#define POLY_XLU_DISP __gfxCtx->polyXlu.p #define POLY_XLU_DISP __gfxCtx->polyXlu.p
#define OVERLAY_DISP __gfxCtx->overlay.p #define OVERLAY_DISP __gfxCtx->overlay.p
#if OOT_DEBUG #if DEBUG_FEATURES
void Graph_OpenDisps(Gfx** dispRefs, GraphicsContext* gfxCtx, const char* file, int line); void Graph_OpenDisps(Gfx** dispRefs, GraphicsContext* gfxCtx, const char* file, int line);
void Graph_CloseDisps(Gfx** dispRefs, GraphicsContext* gfxCtx, const char* file, int line); void Graph_CloseDisps(Gfx** dispRefs, GraphicsContext* gfxCtx, const char* file, int line);

View file

@ -15,7 +15,7 @@ void SystemArena_Init(void* start, u32 size);
void SystemArena_Cleanup(void); void SystemArena_Cleanup(void);
s32 SystemArena_IsInitialized(void); s32 SystemArena_IsInitialized(void);
#if OOT_DEBUG #if DEBUG_FEATURES
void* SystemArena_MallocDebug(u32 size, const char* file, int line); void* SystemArena_MallocDebug(u32 size, const char* file, int line);
void* SystemArena_MallocRDebug(u32 size, const char* file, int line); void* SystemArena_MallocRDebug(u32 size, const char* file, int line);
void* SystemArena_ReallocDebug(void* ptr, u32 newSize, const char* file, int line); void* SystemArena_ReallocDebug(void* ptr, u32 newSize, const char* file, int line);

View file

@ -25,7 +25,7 @@ typedef struct ArenaNode {
/* 0x04 */ u32 size; /* 0x04 */ u32 size;
/* 0x08 */ struct ArenaNode* next; /* 0x08 */ struct ArenaNode* next;
/* 0x0C */ struct ArenaNode* prev; /* 0x0C */ struct ArenaNode* prev;
#if PLATFORM_N64 || OOT_DEBUG #if PLATFORM_N64 || DEBUG_FEATURES
/* 0x10 */ const char* filename; /* 0x10 */ const char* filename;
/* 0x14 */ int line; /* 0x14 */ int line;
/* 0x18 */ OSId threadId; /* 0x18 */ OSId threadId;
@ -57,15 +57,19 @@ void* __osRealloc(Arena* arena, void* ptr, u32 newSize);
void ArenaImpl_GetSizes(Arena* arena, u32* outMaxFree, u32* outFree, u32* outAlloc); void ArenaImpl_GetSizes(Arena* arena, u32* outMaxFree, u32* outFree, u32* outAlloc);
s32 __osCheckArena(Arena* arena); s32 __osCheckArena(Arena* arena);
#if OOT_DEBUG #if PLATFORM_N64 || DEBUG_FEATURES
void* __osMallocDebug(Arena* arena, u32 size, const char* file, int line); void* __osMallocDebug(Arena* arena, u32 size, const char* file, int line);
void* __osMallocRDebug(Arena* arena, u32 size, const char* file, int line); void* __osMallocRDebug(Arena* arena, u32 size, const char* file, int line);
void __osFreeDebug(Arena* arena, void* ptr, const char* file, int line); void __osFreeDebug(Arena* arena, void* ptr, const char* file, int line);
void* __osReallocDebug(Arena* arena, void* ptr, u32 newSize, const char* file, int line); void* __osReallocDebug(Arena* arena, void* ptr, u32 newSize, const char* file, int line);
void __osDisplayArena(Arena* arena); #endif
#if PLATFORM_GC && DEBUG_FEATURES
void __osDisplayArena(Arena* arena);
extern u32 __osMalloc_FreeBlockTest_Enable; extern u32 __osMalloc_FreeBlockTest_Enable;
#else #endif
#if PLATFORM_N64
extern u32 gTotalAllocFailures; extern u32 gTotalAllocFailures;
#endif #endif

View file

@ -49,7 +49,7 @@
// ensure that these do not use the IDO workaround to avoid errors. // ensure that these do not use the IDO workaround to avoid errors.
#define IDO_PRINTF_WORKAROUND (__sgi && !__GNUC__ && !M2CTX) #define IDO_PRINTF_WORKAROUND (__sgi && !__GNUC__ && !M2CTX)
#if OOT_DEBUG #if DEBUG_FEATURES
#define PRINTF osSyncPrintf #define PRINTF osSyncPrintf
#elif IDO_PRINTF_WORKAROUND #elif IDO_PRINTF_WORKAROUND
#define PRINTF(args) (void)0 #define PRINTF(args) (void)0
@ -57,7 +57,7 @@
#define PRINTF(format, ...) (void)0 #define PRINTF(format, ...) (void)0
#endif #endif
#if OOT_DEBUG #if DEBUG_FEATURES
#define LOG(exp, value, format, file, line) \ #define LOG(exp, value, format, file, line) \
do { \ do { \
LogUtils_LogThreadId(file, line); \ LogUtils_LogThreadId(file, line); \
@ -83,7 +83,7 @@
(state)->size = sizeof(newStruct); \ (state)->size = sizeof(newStruct); \
} while (0) } while (0)
#if OOT_DEBUG #if DEBUG_FEATURES
#define DMA_REQUEST_SYNC(ram, vrom, size, file, line) DmaMgr_RequestSyncDebug(ram, vrom, size, file, line) #define DMA_REQUEST_SYNC(ram, vrom, size, file, line) DmaMgr_RequestSyncDebug(ram, vrom, size, file, line)
#define DMA_REQUEST_ASYNC(req, ram, vrom, size, unk5, queue, msg, file, line) DmaMgr_RequestAsyncDebug(req, ram, vrom, size, unk5, queue, msg, file, line) #define DMA_REQUEST_ASYNC(req, ram, vrom, size, unk5, queue, msg, file, line) DmaMgr_RequestAsyncDebug(req, ram, vrom, size, unk5, queue, msg, file, line)
@ -115,7 +115,7 @@
#endif #endif
#if PLATFORM_N64 || OOT_DEBUG #if PLATFORM_N64 || DEBUG_FEATURES
#define HUNGUP_AND_CRASH(file, line) Fault_AddHungupAndCrash(file, line) #define HUNGUP_AND_CRASH(file, line) Fault_AddHungupAndCrash(file, line)
#else #else
#define HUNGUP_AND_CRASH(file, line) LogUtils_HungupThread(file, line) #define HUNGUP_AND_CRASH(file, line) LogUtils_HungupThread(file, line)

View file

@ -85,7 +85,7 @@ DECLARE_SEGMENT(code)
DECLARE_ROM_SEGMENT(code) DECLARE_ROM_SEGMENT(code)
DECLARE_BSS_SEGMENT(code) DECLARE_BSS_SEGMENT(code)
// N64-only, not wrapped in these are not wrapped in an `#if PLATFORM_N64` // N64-only, these are not wrapped in an `#if PLATFORM_N64`
// so that the N64DD code can always be built. // so that the N64DD code can always be built.
DECLARE_SEGMENT(n64dd) DECLARE_SEGMENT(n64dd)
DECLARE_ROM_SEGMENT(n64dd) DECLARE_ROM_SEGMENT(n64dd)
@ -655,8 +655,9 @@ DECLARE_ROM_SEGMENT(spot20_room_0)
DECLARE_ROM_SEGMENT(ganon_tou_room_0) DECLARE_ROM_SEGMENT(ganon_tou_room_0)
// Room symbols for compiling test scenes, these are not wrapped in an `#if OOT_DEBUG` // Room symbols for compiling test scenes.
// so that debug ROMs (including gc-eu-mq-dbg) can be built with OOT_DEBUG=0. // These are not wrapped in an `#if DEBUG_ASSETS` so that debug ROMs
// can be built with DEBUG_ASSETS=0 (e.g. when DEBUG_FEATURES=0)
DECLARE_ROM_SEGMENT(test01_room_0) DECLARE_ROM_SEGMENT(test01_room_0)

View file

@ -123,7 +123,7 @@ typedef struct SfxParams {
u16 params; u16 params;
} SfxParams; } SfxParams;
#if OOT_DEBUG #if DEBUG_FEATURES
#define SFX_DIST_SCALING 1.0f #define SFX_DIST_SCALING 1.0f
#else #else
#define SFX_DIST_SCALING 10.0f #define SFX_DIST_SCALING 10.0f

View file

@ -43,7 +43,7 @@ void Matrix_SetTranslateScaleMtx2(Mtx* mtx, f32 scaleX, f32 scaleY, f32 scaleZ,
Mtx* Matrix_MtxFToMtx(MtxF* src, Mtx* dest); Mtx* Matrix_MtxFToMtx(MtxF* src, Mtx* dest);
#if OOT_DEBUG #if DEBUG_FEATURES
Mtx* Matrix_ToMtx(Mtx* dest, const char* file, int line); Mtx* Matrix_ToMtx(Mtx* dest, const char* file, int line);
Mtx* Matrix_Finalize(struct GraphicsContext* gfxCtx, const char* file, int line); Mtx* Matrix_Finalize(struct GraphicsContext* gfxCtx, const char* file, int line);

View file

@ -1,9 +1,11 @@
#include "versions.h"
/** /**
* Select dmadata table for version * Select dmadata table for version
*/ */
#if !OOT_DEBUG || NON_MATCHING #if OOT_VERSION == GC_EU_MQ_DBG && !NON_MATCHING
#include "dmadata_table_mqdbg.h"
#else
// For retail versions and non-matching builds, dmadata is generated from the specfile segments // For retail versions and non-matching builds, dmadata is generated from the specfile segments
#include "dmadata_table_spec.h" #include "dmadata_table_spec.h"
#else
#include "dmadata_table_mqdbg.h"
#endif #endif

View file

@ -110,7 +110,7 @@
/* 0x62 */ DEFINE_SCENE(spot18_scene, g_pn_41, SCENE_GORON_CITY, SDC_GORON_CITY, 0, 0) /* 0x62 */ DEFINE_SCENE(spot18_scene, g_pn_41, SCENE_GORON_CITY, SDC_GORON_CITY, 0, 0)
/* 0x63 */ DEFINE_SCENE(spot20_scene, g_pn_42, SCENE_LON_LON_RANCH, SDC_LON_LON_RANCH, 0, 0) /* 0x63 */ DEFINE_SCENE(spot20_scene, g_pn_42, SCENE_LON_LON_RANCH, SDC_LON_LON_RANCH, 0, 0)
/* 0x64 */ DEFINE_SCENE(ganon_tou_scene, g_pn_43, SCENE_OUTSIDE_GANONS_CASTLE, SDC_OUTSIDE_GANONS_CASTLE, 0, 0) /* 0x64 */ DEFINE_SCENE(ganon_tou_scene, g_pn_43, SCENE_OUTSIDE_GANONS_CASTLE, SDC_OUTSIDE_GANONS_CASTLE, 0, 0)
#if OOT_DEBUG #if DEBUG_ASSETS
/* 0x65 */ DEFINE_SCENE(test01_scene, none, SCENE_TEST01, SDC_CALM_WATER, 0, 0) /* 0x65 */ DEFINE_SCENE(test01_scene, none, SCENE_TEST01, SDC_CALM_WATER, 0, 0)
/* 0x66 */ DEFINE_SCENE(besitu_scene, none, SCENE_BESITU, SDC_BESITU, 0, 0) /* 0x66 */ DEFINE_SCENE(besitu_scene, none, SCENE_BESITU, SDC_BESITU, 0, 0)
/* 0x67 */ DEFINE_SCENE(depth_test_scene, none, SCENE_DEPTH_TEST, SDC_DEFAULT, 0, 0) /* 0x67 */ DEFINE_SCENE(depth_test_scene, none, SCENE_DEPTH_TEST, SDC_DEFAULT, 0, 0)

View file

@ -73,7 +73,7 @@ extern u64 gMojiFontTLUTs[4][4]; // original name: "moji_tlut"
extern u64 gMojiFontTex[]; // original name: "font_ff" extern u64 gMojiFontTex[]; // original name: "font_ff"
extern u8 gBossMarkState; extern u8 gBossMarkState;
#if OOT_DEBUG #if DEBUG_FEATURES
extern u32 gIsCtrlr2Valid; extern u32 gIsCtrlr2Valid;
#endif #endif
extern s16* gWaveSamples[9]; extern s16* gWaveSamples[9];
@ -113,7 +113,7 @@ extern u16 D_801333D0;
extern Vec3f gSfxDefaultPos; extern Vec3f gSfxDefaultPos;
extern f32 gSfxDefaultFreqAndVolScale; extern f32 gSfxDefaultFreqAndVolScale;
extern s8 gSfxDefaultReverb; extern s8 gSfxDefaultReverb;
#if OOT_DEBUG #if DEBUG_FEATURES
extern u8 D_801333F0; extern u8 D_801333F0;
extern u8 gAudioSfxSwapOff; extern u8 gAudioSfxSwapOff;
extern u8 D_801333F8; extern u8 D_801333F8;
@ -121,7 +121,7 @@ extern u8 D_801333F8;
extern u8 gSeqCmdWritePos; extern u8 gSeqCmdWritePos;
extern u8 gSeqCmdReadPos; extern u8 gSeqCmdReadPos;
extern u8 gStartSeqDisabled; extern u8 gStartSeqDisabled;
#if OOT_DEBUG #if DEBUG_FEATURES
extern u8 gAudioDebugPrintSeqCmd; extern u8 gAudioDebugPrintSeqCmd;
#endif #endif
extern u8 gSoundModeList[]; extern u8 gSoundModeList[];

View file

@ -46,4 +46,13 @@
#define FRAMERATE_CONST(value60Hz, value50Hz) (value50Hz) #define FRAMERATE_CONST(value60Hz, value50Hz) (value50Hz)
#endif #endif
// Debug Assets
// Due to asset extraction limitations, all versions will not have access to some assets present in debug ROMs
// To allow the inclusion of debug features in any version there is a separation between DEBUG_FEATURES and DEBUG_ASSETS
#if OOT_VERSION == GC_EU_MQ_DBG && DEBUG_FEATURES
#define DEBUG_ASSETS 1
#else
#define DEBUG_ASSETS 0
#endif
#endif #endif

View file

@ -41,7 +41,7 @@ typedef struct ActorProfile {
/** /**
* @see ACTOROVL_ALLOC_ABSOLUTE * @see ACTOROVL_ALLOC_ABSOLUTE
*/ */
#if OOT_DEBUG #if DEBUG_FEATURES
#define ACTOROVL_ABSOLUTE_SPACE_SIZE 0x27A0 #define ACTOROVL_ABSOLUTE_SPACE_SIZE 0x27A0
#else #else
#define ACTOROVL_ABSOLUTE_SPACE_SIZE 0x24E0 #define ACTOROVL_ABSOLUTE_SPACE_SIZE 0x24E0
@ -287,7 +287,7 @@ typedef struct Actor {
/* 0x130 */ ActorFunc update; // Update Routine. Called by `Actor_UpdateAll` /* 0x130 */ ActorFunc update; // Update Routine. Called by `Actor_UpdateAll`
/* 0x134 */ ActorFunc draw; // Draw Routine. Called by `Actor_Draw` /* 0x134 */ ActorFunc draw; // Draw Routine. Called by `Actor_Draw`
/* 0x138 */ ActorOverlay* overlayEntry; // Pointer to the overlay table entry for this actor /* 0x138 */ ActorOverlay* overlayEntry; // Pointer to the overlay table entry for this actor
#if OOT_DEBUG #if DEBUG_FEATURES
/* 0x13C */ char dbgPad[0x10]; /* 0x13C */ char dbgPad[0x10];
#endif #endif
} Actor; // size = 0x14C } Actor; // size = 0x14C

View file

@ -469,7 +469,7 @@ u16 WaterBox_GetBgCamSetting(CollisionContext* colCtx, WaterBox* waterBox);
u32 WaterBox_GetLightIndex(CollisionContext* colCtx, WaterBox* waterBox); u32 WaterBox_GetLightIndex(CollisionContext* colCtx, WaterBox* waterBox);
s32 func_80042708(CollisionPoly* polyA, CollisionPoly* polyB, Vec3f* point, Vec3f* closestPoint); s32 func_80042708(CollisionPoly* polyA, CollisionPoly* polyB, Vec3f* point, Vec3f* closestPoint);
s32 func_800427B4(CollisionPoly* polyA, CollisionPoly* polyB, Vec3f* pointA, Vec3f* pointB, Vec3f* closestPoint); s32 func_800427B4(CollisionPoly* polyA, CollisionPoly* polyB, Vec3f* pointA, Vec3f* pointB, Vec3f* closestPoint);
#if OOT_DEBUG #if DEBUG_FEATURES
void BgCheck_DrawDynaCollision(struct PlayState*, CollisionContext*); void BgCheck_DrawDynaCollision(struct PlayState*, CollisionContext*);
void BgCheck_DrawStaticCollision(struct PlayState*, CollisionContext*); void BgCheck_DrawStaticCollision(struct PlayState*, CollisionContext*);
#endif #endif

View file

@ -471,7 +471,7 @@ typedef struct CollisionCheckInfo {
DamageTable* DamageTable_Get(s32 index); DamageTable* DamageTable_Get(s32 index);
void DamageTable_Clear(DamageTable* table); void DamageTable_Clear(DamageTable* table);
#if OOT_DEBUG #if DEBUG_FEATURES
void Collider_DrawRedPoly(struct GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC); void Collider_DrawRedPoly(struct GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC);
void Collider_DrawPoly(struct GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC, u8 r, u8 g, u8 b); void Collider_DrawPoly(struct GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC, u8 r, u8 g, u8 b);
#endif #endif
@ -522,7 +522,7 @@ void CollisionCheck_DestroyContext(struct PlayState* play, CollisionCheckContext
void CollisionCheck_ClearContext(struct PlayState* play, CollisionCheckContext* colChkCtx); void CollisionCheck_ClearContext(struct PlayState* play, CollisionCheckContext* colChkCtx);
void CollisionCheck_EnableSAC(struct PlayState* play, CollisionCheckContext* colChkCtx); void CollisionCheck_EnableSAC(struct PlayState* play, CollisionCheckContext* colChkCtx);
void CollisionCheck_DisableSAC(struct PlayState* play, CollisionCheckContext* colChkCtx); void CollisionCheck_DisableSAC(struct PlayState* play, CollisionCheckContext* colChkCtx);
#if OOT_DEBUG #if DEBUG_FEATURES
void Collider_Draw(struct PlayState* play, Collider* col); void Collider_Draw(struct PlayState* play, Collider* col);
void CollisionCheck_DrawCollision(struct PlayState* play, CollisionCheckContext* colChkCtx); void CollisionCheck_DrawCollision(struct PlayState* play, CollisionCheckContext* colChkCtx);
#endif #endif

View file

@ -34,7 +34,7 @@ extern size_t gDmaMgrDmaBuffSize;
s32 DmaMgr_RequestAsync(DmaRequest* req, void* ram, uintptr_t vrom, size_t size, u32 unk5, OSMesgQueue* queue, s32 DmaMgr_RequestAsync(DmaRequest* req, void* ram, uintptr_t vrom, size_t size, u32 unk5, OSMesgQueue* queue,
OSMesg msg); OSMesg msg);
s32 DmaMgr_RequestSync(void* ram, uintptr_t vrom, size_t size); s32 DmaMgr_RequestSync(void* ram, uintptr_t vrom, size_t size);
#if OOT_DEBUG #if DEBUG_FEATURES
s32 DmaMgr_RequestAsyncDebug(DmaRequest* req, void* ram, uintptr_t vrom, size_t size, u32 unk5, OSMesgQueue* queue, s32 DmaMgr_RequestAsyncDebug(DmaRequest* req, void* ram, uintptr_t vrom, size_t size, u32 unk5, OSMesgQueue* queue,
OSMesg msg, const char* file, int line); OSMesg msg, const char* file, int line);
s32 DmaMgr_RequestSyncDebug(void* ram, uintptr_t vrom, size_t size, const char* file, int line); s32 DmaMgr_RequestSyncDebug(void* ram, uintptr_t vrom, size_t size, const char* file, int line);

View file

@ -149,7 +149,7 @@ void Play_TriggerVoidOut(PlayState* this);
void Play_TriggerRespawn(PlayState* this); void Play_TriggerRespawn(PlayState* this);
int Play_CamIsNotFixed(PlayState* this); int Play_CamIsNotFixed(PlayState* this);
#if OOT_DEBUG #if DEBUG_FEATURES
extern void* gDebugCutsceneScript; extern void* gDebugCutsceneScript;
#endif #endif

View file

@ -418,7 +418,7 @@ typedef enum SceneID {
#undef DEFINE_SCENE #undef DEFINE_SCENE
// Fake enum values for scenes that are still referenced in the entrance table // Fake enum values for scenes that are still referenced in the entrance table
#if !OOT_DEBUG #if !DEBUG_ASSETS
// Debug-only scenes // Debug-only scenes
#define SCENE_TEST01 0x65 #define SCENE_TEST01 0x65
#define SCENE_BESITU 0x66 #define SCENE_BESITU 0x66

View file

@ -60,7 +60,7 @@ typedef struct View {
#define VIEW_FORCE_PROJECTION_PERSPECTIVE (VIEW_PROJECTION_PERSPECTIVE << 4) #define VIEW_FORCE_PROJECTION_PERSPECTIVE (VIEW_PROJECTION_PERSPECTIVE << 4)
#define VIEW_FORCE_PROJECTION_ORTHO (VIEW_PROJECTION_ORTHO << 4) #define VIEW_FORCE_PROJECTION_ORTHO (VIEW_PROJECTION_ORTHO << 4)
#if OOT_DEBUG #if DEBUG_FEATURES
#define VIEW_ERROR_CHECK_EYE_POS(x, y, z) View_ErrorCheckEyePosition((x), (y), (z)) #define VIEW_ERROR_CHECK_EYE_POS(x, y, z) View_ErrorCheckEyePosition((x), (y), (z))
#else #else
#define VIEW_ERROR_CHECK_EYE_POS(x, y, z) (void)0 #define VIEW_ERROR_CHECK_EYE_POS(x, y, z) (void)0
@ -91,7 +91,7 @@ s32 View_ApplyOrthoToOverlay(View* view);
s32 View_ApplyPerspectiveToOverlay(View* view); s32 View_ApplyPerspectiveToOverlay(View* view);
s32 View_UpdateViewingMatrix(View* view); s32 View_UpdateViewingMatrix(View* view);
s32 View_ApplyTo(View* view, s32 mask, Gfx** gfxP); s32 View_ApplyTo(View* view, s32 mask, Gfx** gfxP);
#if OOT_DEBUG #if DEBUG_FEATURES
s32 View_ErrorCheckEyePosition(f32 eyeX, f32 eyeY, f32 eyeZ); s32 View_ErrorCheckEyePosition(f32 eyeX, f32 eyeY, f32 eyeZ);
#endif #endif

View file

@ -14,7 +14,7 @@ void ZeldaArena_Init(void* start, u32 size);
void ZeldaArena_Cleanup(void); void ZeldaArena_Cleanup(void);
s32 ZeldaArena_IsInitialized(void); s32 ZeldaArena_IsInitialized(void);
#if OOT_DEBUG #if DEBUG_FEATURES
void ZeldaArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action); void ZeldaArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action);
void* ZeldaArena_MallocDebug(u32 size, const char* file, int line); void* ZeldaArena_MallocDebug(u32 size, const char* file, int line);
void* ZeldaArena_MallocRDebug(u32 size, const char* file, int line); void* ZeldaArena_MallocRDebug(u32 size, const char* file, int line);

79
spec
View file

@ -26,7 +26,7 @@ beginseg
#if PLATFORM_N64 #if PLATFORM_N64
include "$(BUILD_DIR)/src/boot/cic6105.o" include "$(BUILD_DIR)/src/boot/cic6105.o"
#endif #endif
#if OOT_DEBUG #if DEBUG_FEATURES
include "$(BUILD_DIR)/src/boot/assert.o" include "$(BUILD_DIR)/src/boot/assert.o"
#endif #endif
include "$(BUILD_DIR)/src/boot/is_debug.o" include "$(BUILD_DIR)/src/boot/is_debug.o"
@ -37,7 +37,7 @@ beginseg
#if PLATFORM_N64 #if PLATFORM_N64
include "$(BUILD_DIR)/src/libc64/sleep.o" include "$(BUILD_DIR)/src/libc64/sleep.o"
#endif #endif
#if OOT_DEBUG #if DEBUG_FEATURES
include "$(BUILD_DIR)/src/libc64/sprintf.o" include "$(BUILD_DIR)/src/libc64/sprintf.o"
#endif #endif
include "$(BUILD_DIR)/src/libultra/io/piacs.o" include "$(BUILD_DIR)/src/libultra/io/piacs.o"
@ -80,12 +80,12 @@ beginseg
include "$(BUILD_DIR)/src/libultra/os/probetlb.o" include "$(BUILD_DIR)/src/libultra/os/probetlb.o"
include "$(BUILD_DIR)/src/libultra/os/getmemsize.o" include "$(BUILD_DIR)/src/libultra/os/getmemsize.o"
include "$(BUILD_DIR)/src/libultra/os/seteventmesg.o" include "$(BUILD_DIR)/src/libultra/os/seteventmesg.o"
#if OOT_DEBUG #if DEBUG_FEATURES
include "$(BUILD_DIR)/src/libultra/libc/xprintf.o" include "$(BUILD_DIR)/src/libultra/libc/xprintf.o"
#endif #endif
include "$(BUILD_DIR)/src/libultra/os/unmaptlball.o" include "$(BUILD_DIR)/src/libultra/os/unmaptlball.o"
include "$(BUILD_DIR)/src/libultra/io/epidma.o" include "$(BUILD_DIR)/src/libultra/io/epidma.o"
#if OOT_DEBUG || defined(COMPILER_GCC) #if DEBUG_FEATURES || defined(COMPILER_GCC)
include "$(BUILD_DIR)/src/libultra/libc/string.o" include "$(BUILD_DIR)/src/libultra/libc/string.o"
#endif #endif
include "$(BUILD_DIR)/src/libultra/os/invalicache.o" include "$(BUILD_DIR)/src/libultra/os/invalicache.o"
@ -130,19 +130,19 @@ beginseg
include "$(BUILD_DIR)/src/libultra/io/visetspecial.o" include "$(BUILD_DIR)/src/libultra/io/visetspecial.o"
#endif #endif
include "$(BUILD_DIR)/src/libultra/io/cartrominit.o" include "$(BUILD_DIR)/src/libultra/io/cartrominit.o"
#if OOT_PAL_N64 || OOT_DEBUG #if OOT_PAL_N64 || DEBUG_FEATURES
include "$(BUILD_DIR)/src/libultra/io/vimodefpallan1.o" include "$(BUILD_DIR)/src/libultra/io/vimodefpallan1.o"
#endif #endif
include "$(BUILD_DIR)/src/libultra/os/setfpccsr.o" include "$(BUILD_DIR)/src/libultra/os/setfpccsr.o"
include "$(BUILD_DIR)/src/libultra/os/getfpccsr.o" include "$(BUILD_DIR)/src/libultra/os/getfpccsr.o"
#if PLATFORM_N64 || OOT_DEBUG #if PLATFORM_N64 || DEBUG_FEATURES
include "$(BUILD_DIR)/src/libultra/io/epiwrite.o" include "$(BUILD_DIR)/src/libultra/io/epiwrite.o"
#endif #endif
include "$(BUILD_DIR)/src/libultra/os/maptlbrdb.o" include "$(BUILD_DIR)/src/libultra/os/maptlbrdb.o"
include "$(BUILD_DIR)/src/libultra/os/yieldthread.o" include "$(BUILD_DIR)/src/libultra/os/yieldthread.o"
include "$(BUILD_DIR)/src/libultra/os/getcause.o" include "$(BUILD_DIR)/src/libultra/os/getcause.o"
include "$(BUILD_DIR)/src/libultra/io/epirawwrite.o" include "$(BUILD_DIR)/src/libultra/io/epirawwrite.o"
#if OOT_DEBUG #if DEBUG_FEATURES
include "$(BUILD_DIR)/src/libultra/libc/xlitob.o" include "$(BUILD_DIR)/src/libultra/libc/xlitob.o"
include "$(BUILD_DIR)/src/libultra/libc/ldiv.o" include "$(BUILD_DIR)/src/libultra/libc/ldiv.o"
include "$(BUILD_DIR)/src/libultra/libc/xldtob.o" include "$(BUILD_DIR)/src/libultra/libc/xldtob.o"
@ -609,7 +609,7 @@ beginseg
include "$(BUILD_DIR)/src/code/z_lights.o" include "$(BUILD_DIR)/src/code/z_lights.o"
include "$(BUILD_DIR)/src/code/z_malloc.o" include "$(BUILD_DIR)/src/code/z_malloc.o"
include "$(BUILD_DIR)/src/code/z_map_mark.o" include "$(BUILD_DIR)/src/code/z_map_mark.o"
#if OOT_DEBUG #if DEBUG_ASSETS
include "$(BUILD_DIR)/src/code/z_moji.o" include "$(BUILD_DIR)/src/code/z_moji.o"
#endif #endif
include "$(BUILD_DIR)/src/code/z_prenmi_buff.o" include "$(BUILD_DIR)/src/code/z_prenmi_buff.o"
@ -638,7 +638,7 @@ beginseg
include "$(BUILD_DIR)/src/code/z_sram.o" include "$(BUILD_DIR)/src/code/z_sram.o"
include "$(BUILD_DIR)/src/code/z_ss_sram.o" include "$(BUILD_DIR)/src/code/z_ss_sram.o"
include "$(BUILD_DIR)/src/code/z_rumble.o" include "$(BUILD_DIR)/src/code/z_rumble.o"
#if OOT_DEBUG #if DEBUG_ASSETS
include "$(BUILD_DIR)/data/z_text.data.o" include "$(BUILD_DIR)/data/z_text.data.o"
#endif #endif
include "$(BUILD_DIR)/data/unk_8012ABC0.data.o" include "$(BUILD_DIR)/data/unk_8012ABC0.data.o"
@ -656,11 +656,11 @@ beginseg
include "$(BUILD_DIR)/src/code/z_fbdemo_circle.o" include "$(BUILD_DIR)/src/code/z_fbdemo_circle.o"
include "$(BUILD_DIR)/src/code/z_fbdemo_fade.o" include "$(BUILD_DIR)/src/code/z_fbdemo_fade.o"
include "$(BUILD_DIR)/src/code/shrink_window.o" include "$(BUILD_DIR)/src/code/shrink_window.o"
#if OOT_DEBUG #if DEBUG_FEATURES
include "$(BUILD_DIR)/src/code/db_camera.o" include "$(BUILD_DIR)/src/code/db_camera.o"
#endif #endif
include "$(BUILD_DIR)/src/code/code_800BB0A0.o" include "$(BUILD_DIR)/src/code/code_800BB0A0.o"
#if OOT_DEBUG #if DEBUG_FEATURES
include "$(BUILD_DIR)/src/code/mempak.o" include "$(BUILD_DIR)/src/code/mempak.o"
#endif #endif
include "$(BUILD_DIR)/src/code/z_kaleido_manager.o" include "$(BUILD_DIR)/src/code/z_kaleido_manager.o"
@ -684,7 +684,7 @@ beginseg
include "$(BUILD_DIR)/src/code/sys_cfb.o" include "$(BUILD_DIR)/src/code/sys_cfb.o"
include "$(BUILD_DIR)/src/code/sys_math.o" include "$(BUILD_DIR)/src/code/sys_math.o"
include "$(BUILD_DIR)/src/code/sys_math3d.o" include "$(BUILD_DIR)/src/code/sys_math3d.o"
#if OOT_DEBUG #if DEBUG_FEATURES
include "$(BUILD_DIR)/src/code/sys_math3d_draw.o" include "$(BUILD_DIR)/src/code/sys_math3d_draw.o"
#endif #endif
include "$(BUILD_DIR)/src/code/sys_math_atan.o" include "$(BUILD_DIR)/src/code/sys_math_atan.o"
@ -697,7 +697,7 @@ beginseg
include "$(BUILD_DIR)/src/code/code_n64dd_800AD410.o" include "$(BUILD_DIR)/src/code/code_n64dd_800AD410.o"
include "$(BUILD_DIR)/src/code/code_n64dd_800AD4C0.o" include "$(BUILD_DIR)/src/code/code_n64dd_800AD4C0.o"
#endif #endif
#if OOT_DEBUG #if DEBUG_FEATURES
include "$(BUILD_DIR)/src/code/debug_malloc.o" include "$(BUILD_DIR)/src/code/debug_malloc.o"
#endif #endif
#if PLATFORM_N64 #if PLATFORM_N64
@ -707,7 +707,7 @@ beginseg
include "$(BUILD_DIR)/src/code/fault_gc_drawer.o" include "$(BUILD_DIR)/src/code/fault_gc_drawer.o"
#endif #endif
include "$(BUILD_DIR)/src/code/kanread.o" include "$(BUILD_DIR)/src/code/kanread.o"
#if OOT_DEBUG #if DEBUG_FEATURES
include "$(BUILD_DIR)/src/code/ucode_disas.o" include "$(BUILD_DIR)/src/code/ucode_disas.o"
#endif #endif
#if OOT_VERSION < NTSC_1_1 || PLATFORM_GC #if OOT_VERSION < NTSC_1_1 || PLATFORM_GC
@ -729,7 +729,7 @@ beginseg
include "$(BUILD_DIR)/src/audio/lib/effects.o" include "$(BUILD_DIR)/src/audio/lib/effects.o"
include "$(BUILD_DIR)/src/audio/lib/seqplayer.o" include "$(BUILD_DIR)/src/audio/lib/seqplayer.o"
include "$(BUILD_DIR)/src/audio/general.o" include "$(BUILD_DIR)/src/audio/general.o"
#if PLATFORM_GC && !OOT_DEBUG #if PLATFORM_GC && !DEBUG_FEATURES
pad_text pad_text
#endif #endif
include "$(BUILD_DIR)/src/audio/sfx_params.o" include "$(BUILD_DIR)/src/audio/sfx_params.o"
@ -741,6 +741,11 @@ beginseg
include "$(BUILD_DIR)/src/libu64/gfxprint.o" include "$(BUILD_DIR)/src/libu64/gfxprint.o"
include "$(BUILD_DIR)/src/libu64/rcp_utils.o" include "$(BUILD_DIR)/src/libu64/rcp_utils.o"
include "$(BUILD_DIR)/src/libu64/loadfragment2_n64.o" include "$(BUILD_DIR)/src/libu64/loadfragment2_n64.o"
#if DEBUG_FEATURES
// This is here only to allow N64 versions to compile with DEBUG_FEATURES.
// There is no N64 Debug ROM to prove this is correct.
include "$(BUILD_DIR)/src/libu64/mtxuty-cvt.o"
#endif
include "$(BUILD_DIR)/src/libu64/pad.o" include "$(BUILD_DIR)/src/libu64/pad.o"
include "$(BUILD_DIR)/src/libu64/code_800FC620.o" include "$(BUILD_DIR)/src/libu64/code_800FC620.o"
include "$(BUILD_DIR)/src/libu64/padsetup.o" include "$(BUILD_DIR)/src/libu64/padsetup.o"
@ -749,7 +754,7 @@ beginseg
include "$(BUILD_DIR)/src/libu64/gfxprint.o" include "$(BUILD_DIR)/src/libu64/gfxprint.o"
include "$(BUILD_DIR)/src/libu64/rcp_utils.o" include "$(BUILD_DIR)/src/libu64/rcp_utils.o"
include "$(BUILD_DIR)/src/libu64/loadfragment2_gc.o" include "$(BUILD_DIR)/src/libu64/loadfragment2_gc.o"
#if OOT_DEBUG #if DEBUG_FEATURES
include "$(BUILD_DIR)/src/libu64/mtxuty-cvt.o" include "$(BUILD_DIR)/src/libu64/mtxuty-cvt.o"
#endif #endif
include "$(BUILD_DIR)/src/libu64/relocation_gc.o" include "$(BUILD_DIR)/src/libu64/relocation_gc.o"
@ -767,7 +772,7 @@ beginseg
#else #else
include "$(BUILD_DIR)/src/libc64/__osMalloc_gc.o" include "$(BUILD_DIR)/src/libc64/__osMalloc_gc.o"
#endif #endif
#if !OOT_DEBUG #if !DEBUG_FEATURES
include "$(BUILD_DIR)/src/libc64/sprintf.o" include "$(BUILD_DIR)/src/libc64/sprintf.o"
#endif #endif
include "$(BUILD_DIR)/src/libc64/aprintf.o" include "$(BUILD_DIR)/src/libc64/aprintf.o"
@ -776,7 +781,7 @@ beginseg
#endif #endif
include "$(BUILD_DIR)/src/code/jpegutils.o" include "$(BUILD_DIR)/src/code/jpegutils.o"
include "$(BUILD_DIR)/src/code/jpegdecoder.o" include "$(BUILD_DIR)/src/code/jpegdecoder.o"
#if OOT_DEBUG #if DEBUG_FEATURES
include "$(BUILD_DIR)/src/libultra/io/pfsfreeblocks.o" include "$(BUILD_DIR)/src/libultra/io/pfsfreeblocks.o"
#endif #endif
#if PLATFORM_N64 #if PLATFORM_N64
@ -798,7 +803,7 @@ beginseg
include "$(BUILD_DIR)/src/libultra/io/sprawdma.o" include "$(BUILD_DIR)/src/libultra/io/sprawdma.o"
include "$(BUILD_DIR)/src/libultra/io/sirawdma.o" include "$(BUILD_DIR)/src/libultra/io/sirawdma.o"
include "$(BUILD_DIR)/src/libultra/io/sptaskyield.o" include "$(BUILD_DIR)/src/libultra/io/sptaskyield.o"
#if OOT_DEBUG #if DEBUG_FEATURES
include "$(BUILD_DIR)/src/libultra/io/pfsreadwritefile.o" include "$(BUILD_DIR)/src/libultra/io/pfsreadwritefile.o"
include "$(BUILD_DIR)/src/libultra/io/pfsgetstatus.o" include "$(BUILD_DIR)/src/libultra/io/pfsgetstatus.o"
#endif #endif
@ -809,11 +814,11 @@ beginseg
include "$(BUILD_DIR)/src/libultra/mgu/mtxidentf.o" include "$(BUILD_DIR)/src/libultra/mgu/mtxidentf.o"
#endif #endif
include "$(BUILD_DIR)/src/libultra/gu/lookat.o" include "$(BUILD_DIR)/src/libultra/gu/lookat.o"
#if OOT_DEBUG #if DEBUG_FEATURES
include "$(BUILD_DIR)/src/libultra/io/pfsallocatefile.o" include "$(BUILD_DIR)/src/libultra/io/pfsallocatefile.o"
#endif #endif
include "$(BUILD_DIR)/src/libultra/os/stoptimer.o" include "$(BUILD_DIR)/src/libultra/os/stoptimer.o"
#if OOT_DEBUG #if DEBUG_FEATURES
include "$(BUILD_DIR)/src/libultra/io/contpfs.o" include "$(BUILD_DIR)/src/libultra/io/contpfs.o"
#if !PLATFORM_N64 #if !PLATFORM_N64
include "$(BUILD_DIR)/src/libultra/mgu/mtxl2f.o" include "$(BUILD_DIR)/src/libultra/mgu/mtxl2f.o"
@ -824,10 +829,10 @@ beginseg
include "$(BUILD_DIR)/src/libultra/os/afterprenmi.o" include "$(BUILD_DIR)/src/libultra/os/afterprenmi.o"
include "$(BUILD_DIR)/src/libultra/io/contquery.o" include "$(BUILD_DIR)/src/libultra/io/contquery.o"
include "$(BUILD_DIR)/src/libultra/gu/lookathil.o" include "$(BUILD_DIR)/src/libultra/gu/lookathil.o"
#if !OOT_DEBUG #if !DEBUG_FEATURES
include "$(BUILD_DIR)/src/libultra/libc/xprintf.o" include "$(BUILD_DIR)/src/libultra/libc/xprintf.o"
#endif #endif
#if !OOT_DEBUG && !defined(COMPILER_GCC) #if !DEBUG_FEATURES && !defined(COMPILER_GCC)
include "$(BUILD_DIR)/src/libultra/libc/string.o" include "$(BUILD_DIR)/src/libultra/libc/string.o"
#endif #endif
include "$(BUILD_DIR)/src/libultra/io/sp.o" include "$(BUILD_DIR)/src/libultra/io/sp.o"
@ -849,7 +854,7 @@ beginseg
#endif #endif
include "$(BUILD_DIR)/src/libultra/io/dpgetstat.o" include "$(BUILD_DIR)/src/libultra/io/dpgetstat.o"
include "$(BUILD_DIR)/src/libultra/io/dpsetstat.o" include "$(BUILD_DIR)/src/libultra/io/dpsetstat.o"
#if OOT_DEBUG #if DEBUG_FEATURES
include "$(BUILD_DIR)/src/libultra/io/pfsdeletefile.o" include "$(BUILD_DIR)/src/libultra/io/pfsdeletefile.o"
#endif #endif
include "$(BUILD_DIR)/src/libultra/gu/ortho.o" include "$(BUILD_DIR)/src/libultra/gu/ortho.o"
@ -863,13 +868,13 @@ beginseg
include "$(BUILD_DIR)/src/libultra/os/settime.o" include "$(BUILD_DIR)/src/libultra/os/settime.o"
#endif #endif
include "$(BUILD_DIR)/src/libultra/io/visetevent.o" include "$(BUILD_DIR)/src/libultra/io/visetevent.o"
#if OOT_DEBUG #if DEBUG_FEATURES
include "$(BUILD_DIR)/src/libultra/io/pfsisplug.o" include "$(BUILD_DIR)/src/libultra/io/pfsisplug.o"
#endif #endif
include "$(BUILD_DIR)/src/libultra/gu/us2dex.o" include "$(BUILD_DIR)/src/libultra/gu/us2dex.o"
include "$(BUILD_DIR)/src/libultra/io/pfsselectbank.o" include "$(BUILD_DIR)/src/libultra/io/pfsselectbank.o"
include "$(BUILD_DIR)/src/libultra/io/contsetch.o" include "$(BUILD_DIR)/src/libultra/io/contsetch.o"
#if OOT_DEBUG #if DEBUG_FEATURES
include "$(BUILD_DIR)/src/libultra/io/pfsfilestate.o" include "$(BUILD_DIR)/src/libultra/io/pfsfilestate.o"
include "$(BUILD_DIR)/src/libultra/io/pfsinitpak.o" include "$(BUILD_DIR)/src/libultra/io/pfsinitpak.o"
include "$(BUILD_DIR)/src/libultra/io/pfschecker.o" include "$(BUILD_DIR)/src/libultra/io/pfschecker.o"
@ -881,10 +886,10 @@ beginseg
include "$(BUILD_DIR)/src/libultra/mgu/translate.o" include "$(BUILD_DIR)/src/libultra/mgu/translate.o"
#endif #endif
include "$(BUILD_DIR)/src/libultra/io/contramwrite.o" include "$(BUILD_DIR)/src/libultra/io/contramwrite.o"
#if OOT_VERSION == NTSC_1_2 || (PLATFORM_GC && !OOT_DEBUG) #if OOT_VERSION == NTSC_1_2 || (PLATFORM_GC && !DEBUG_FEATURES)
include "$(BUILD_DIR)/src/libultra/io/vimodefpallan1.o" include "$(BUILD_DIR)/src/libultra/io/vimodefpallan1.o"
#endif #endif
#if !OOT_DEBUG #if !DEBUG_FEATURES
include "$(BUILD_DIR)/src/libultra/io/pfsgetstatus.o" include "$(BUILD_DIR)/src/libultra/io/pfsgetstatus.o"
include "$(BUILD_DIR)/src/libultra/io/contpfs.o" include "$(BUILD_DIR)/src/libultra/io/contpfs.o"
#endif #endif
@ -893,7 +898,7 @@ beginseg
#endif #endif
include "$(BUILD_DIR)/src/libultra/io/contramread.o" include "$(BUILD_DIR)/src/libultra/io/contramread.o"
include "$(BUILD_DIR)/src/libultra/io/crc.o" include "$(BUILD_DIR)/src/libultra/io/crc.o"
#if !OOT_DEBUG #if !DEBUG_FEATURES
include "$(BUILD_DIR)/src/libultra/io/pfsisplug.o" include "$(BUILD_DIR)/src/libultra/io/pfsisplug.o"
#endif #endif
#if !PLATFORM_N64 #if !PLATFORM_N64
@ -903,7 +908,7 @@ beginseg
include "$(BUILD_DIR)/src/libultra/libc/xlitob.o" include "$(BUILD_DIR)/src/libultra/libc/xlitob.o"
include "$(BUILD_DIR)/src/libultra/libc/ldiv.o" include "$(BUILD_DIR)/src/libultra/libc/ldiv.o"
include "$(BUILD_DIR)/src/libultra/libc/xldtob.o" include "$(BUILD_DIR)/src/libultra/libc/xldtob.o"
#elif !OOT_DEBUG #elif !DEBUG_FEATURES
include "$(BUILD_DIR)/src/libultra/libc/xldtob.o" include "$(BUILD_DIR)/src/libultra/libc/xldtob.o"
include "$(BUILD_DIR)/src/libultra/libc/ldiv.o" include "$(BUILD_DIR)/src/libultra/libc/ldiv.o"
include "$(BUILD_DIR)/src/libultra/libc/xlitob.o" include "$(BUILD_DIR)/src/libultra/libc/xlitob.o"
@ -17268,7 +17273,7 @@ beginseg
number 3 number 3
endseg endseg
#if OOT_DEBUG #if DEBUG_ASSETS
beginseg beginseg
name "syotes_scene" name "syotes_scene"
romalign 0x1000 romalign 0x1000
@ -17792,7 +17797,7 @@ beginseg
number 3 number 3
endseg endseg
#if OOT_DEBUG #if DEBUG_ASSETS
beginseg beginseg
name "testroom_scene" name "testroom_scene"
romalign 0x1000 romalign 0x1000
@ -17876,7 +17881,7 @@ beginseg
number 3 number 3
endseg endseg
#if OOT_DEBUG #if DEBUG_ASSETS
beginseg beginseg
name "sutaru_scene" name "sutaru_scene"
romalign 0x1000 romalign 0x1000
@ -18164,7 +18169,7 @@ beginseg
number 3 number 3
endseg endseg
#if OOT_DEBUG #if DEBUG_ASSETS
beginseg beginseg
name "sasatest_scene" name "sasatest_scene"
romalign 0x1000 romalign 0x1000
@ -18916,7 +18921,7 @@ beginseg
number 3 number 3
endseg endseg
#if OOT_DEBUG #if DEBUG_ASSETS
beginseg beginseg
name "hairal_niwa2_scene" name "hairal_niwa2_scene"
romalign 0x1000 romalign 0x1000
@ -19404,7 +19409,7 @@ beginseg
number 3 number 3
endseg endseg
#if OOT_DEBUG #if DEBUG_ASSETS
beginseg beginseg
name "besitu_scene" name "besitu_scene"
romalign 0x1000 romalign 0x1000
@ -19476,7 +19481,7 @@ beginseg
number 3 number 3
endseg endseg
#if OOT_DEBUG #if DEBUG_ASSETS
beginseg beginseg
name "test01_scene" name "test01_scene"
romalign 0x1000 romalign 0x1000

View file

@ -44,7 +44,7 @@ s8 gSfxDefaultReverb = 0;
s32 D_801333EC = 0; // unused s32 D_801333EC = 0; // unused
#if OOT_DEBUG #if DEBUG_FEATURES
u8 D_801333F0 = 0; u8 D_801333F0 = 0;
u8 gAudioSfxSwapOff = 0; u8 gAudioSfxSwapOff = 0;
u8 D_801333F8 = 0; u8 D_801333F8 = 0;
@ -55,7 +55,7 @@ u8 gSeqCmdWritePos = 0;
u8 gSeqCmdReadPos = 0; u8 gSeqCmdReadPos = 0;
u8 gStartSeqDisabled = false; u8 gStartSeqDisabled = false;
#if OOT_DEBUG #if DEBUG_FEATURES
u8 gAudioDebugPrintSeqCmd = true; u8 gAudioDebugPrintSeqCmd = true;
#endif #endif

View file

@ -133,7 +133,7 @@ f32 D_801305E4[4] = { 1.0f, 1.12246f, 1.33484f, 1.33484f }; // 2**({0, 2, 5, 5}/
f32 D_801305F4 = 1.0f; f32 D_801305F4 = 1.0f;
u8 sGanonsTowerLevelsVol[8] = { 127, 80, 75, 73, 70, 68, 65, 60 }; u8 sGanonsTowerLevelsVol[8] = { 127, 80, 75, 73, 70, 68, 65, 60 };
u8 sEnterGanonsTowerTimer = 0; u8 sEnterGanonsTowerTimer = 0;
#if OOT_DEBUG #if DEBUG_FEATURES
s8 sSoundMode = SOUNDMODE_SURROUND; s8 sSoundMode = SOUNDMODE_SURROUND;
#else #else
s8 sSoundMode = SOUNDMODE_STEREO; s8 sSoundMode = SOUNDMODE_STEREO;
@ -161,7 +161,7 @@ u8 sAudioExtraFilter2 = 0;
Vec3f* sSariaBgmPtr = NULL; Vec3f* sSariaBgmPtr = NULL;
f32 D_80130650 = 2000.0f; f32 D_80130650 = 2000.0f;
#if OOT_DEBUG #if DEBUG_FEATURES
u8 sSeqModeInput = 0; u8 sSeqModeInput = 0;
#endif #endif
@ -1150,7 +1150,7 @@ OcarinaSongButtons gOcarinaSongButtons[OCARINA_SONG_MAX] = {
{ 0, { 0 } }, { 0, { 0 } },
}; };
#if OOT_DEBUG #if DEBUG_FEATURES
u32 sAudioUpdateStartTime; u32 sAudioUpdateStartTime;
u32 sAudioUpdateEndTime; u32 sAudioUpdateEndTime;
#endif #endif
@ -1163,7 +1163,7 @@ FreqLerp sWaterfallFreqScaleLerp;
f32 D_8016B7D8; f32 D_8016B7D8;
s8 D_8016B7DC; s8 D_8016B7DC;
f32 D_8016B7E0; f32 D_8016B7E0;
#if OOT_DEBUG #if DEBUG_FEATURES
u16 D_8016B7E4; u16 D_8016B7E4;
struct { struct {
char str[5]; char str[5];
@ -1176,11 +1176,11 @@ u8 sRiverSoundMainBgmLower;
u8 sRiverSoundMainBgmRestore; u8 sRiverSoundMainBgmRestore;
u8 sGanonsTowerVol; u8 sGanonsTowerVol;
SfxPlayerState sSfxChannelState[0x10]; SfxPlayerState sSfxChannelState[0x10];
#if OOT_DEBUG #if DEBUG_FEATURES
char sBinToStrBuf[0x20]; char sBinToStrBuf[0x20];
#endif #endif
u8 sMalonSingingTimer; u8 sMalonSingingTimer;
#if OOT_DEBUG #if DEBUG_FEATURES
u8 sAudioSpecPeakNumNotes[0x12]; u8 sAudioSpecPeakNumNotes[0x12];
#endif #endif
u8 sMalonSingingDisabled; u8 sMalonSingingDisabled;
@ -1213,7 +1213,7 @@ u16 sMusicStaffCurHeldLength[OCARINA_SONG_MAX];
u16 sMusicStaffExpectedLength[OCARINA_SONG_MAX]; u16 sMusicStaffExpectedLength[OCARINA_SONG_MAX];
u8 sMusicStaffExpectedPitch[OCARINA_SONG_MAX]; u8 sMusicStaffExpectedPitch[OCARINA_SONG_MAX];
OcarinaNote sScarecrowsLongSongSecondNote; OcarinaNote sScarecrowsLongSongSecondNote;
#if OOT_DEBUG #if DEBUG_FEATURES
u8 sIsMalonSinging; u8 sIsMalonSinging;
f32 sMalonSingingDist; f32 sMalonSingingDist;
u32 sDebugPadHold; u32 sDebugPadHold;
@ -2299,7 +2299,7 @@ void AudioOcarina_ResetStaffs(void) {
sOcarinaDropInputTimer = 0; sOcarinaDropInputTimer = 0;
} }
#if OOT_DEBUG #if DEBUG_FEATURES
#include "debug.inc.c" #include "debug.inc.c"
#else #else
void AudioDebug_Draw(GfxPrint* printer) { void AudioDebug_Draw(GfxPrint* printer) {
@ -2317,7 +2317,7 @@ void Audio_UpdateFanfare(void);
*/ */
void Audio_Update(void) { void Audio_Update(void) {
if (func_800FAD34() == 0) { if (func_800FAD34() == 0) {
#if OOT_DEBUG #if DEBUG_FEATURES
sAudioUpdateTaskStart = gAudioCtx.totalTaskCount; sAudioUpdateTaskStart = gAudioCtx.totalTaskCount;
sAudioUpdateStartTime = osGetTime(); sAudioUpdateStartTime = osGetTime();
#endif #endif
@ -2336,14 +2336,14 @@ void Audio_Update(void) {
func_800F8F88(); func_800F8F88();
Audio_UpdateActiveSequences(); Audio_UpdateActiveSequences();
#if OOT_DEBUG #if DEBUG_FEATURES
AudioDebug_SetInput(); AudioDebug_SetInput();
AudioDebug_ProcessInput(); AudioDebug_ProcessInput();
#endif #endif
AudioThread_ScheduleProcessCmds(); AudioThread_ScheduleProcessCmds();
#if OOT_DEBUG #if DEBUG_FEATURES
sAudioUpdateTaskEnd = gAudioCtx.totalTaskCount; sAudioUpdateTaskEnd = gAudioCtx.totalTaskCount;
sAudioUpdateEndTime = osGetTime(); sAudioUpdateEndTime = osGetTime();
#endif #endif
@ -2767,7 +2767,7 @@ void func_800F4010(Vec3f* pos, u16 sfxId, f32 arg2) {
u8 phi_v0; u8 phi_v0;
u16 sfxId2; u16 sfxId2;
#if OOT_DEBUG #if DEBUG_FEATURES
D_80131C8C = arg2; D_80131C8C = arg2;
#endif #endif
@ -3358,7 +3358,7 @@ s32 Audio_IsSequencePlaying(u16 seqId) {
void func_800F5ACC(u16 seqId) { void func_800F5ACC(u16 seqId) {
u16 curSeqId = Audio_GetActiveSeqId(SEQ_PLAYER_BGM_MAIN); u16 curSeqId = Audio_GetActiveSeqId(SEQ_PLAYER_BGM_MAIN);
#if !OOT_DEBUG #if !DEBUG_FEATURES
if (1) {} if (1) {}
#endif #endif
@ -3487,7 +3487,7 @@ void Audio_SetSequenceMode(u8 seqMode) {
u16 seqId; u16 seqId;
u8 volumeFadeOutTimer; u8 volumeFadeOutTimer;
#if OOT_DEBUG #if DEBUG_FEATURES
sSeqModeInput = seqMode; sSeqModeInput = seqMode;
#endif #endif
@ -3627,7 +3627,7 @@ void Audio_UpdateMalonSinging(f32 dist, u16 seqId) {
s8 melodyVolume; s8 melodyVolume;
s16 curSeqId; s16 curSeqId;
#if OOT_DEBUG #if DEBUG_FEATURES
sIsMalonSinging = true; sIsMalonSinging = true;
sMalonSingingDist = dist; sMalonSingingDist = dist;
#endif #endif
@ -3941,7 +3941,7 @@ void Audio_SetNatureAmbienceChannelIO(u8 channelIdxRange, u8 ioPort, u8 ioData)
if ((gActiveSeqs[SEQ_PLAYER_BGM_MAIN].seqId != NA_BGM_NATURE_AMBIENCE) && if ((gActiveSeqs[SEQ_PLAYER_BGM_MAIN].seqId != NA_BGM_NATURE_AMBIENCE) &&
Audio_IsSeqCmdNotQueued(SEQCMD_OP_PLAY_SEQUENCE << 28 | NA_BGM_NATURE_AMBIENCE, SEQCMD_OP_MASK | 0xFF)) { Audio_IsSeqCmdNotQueued(SEQCMD_OP_PLAY_SEQUENCE << 28 | NA_BGM_NATURE_AMBIENCE, SEQCMD_OP_MASK | 0xFF)) {
#if OOT_DEBUG #if DEBUG_FEATURES
sAudioNatureFailed = true; sAudioNatureFailed = true;
#endif #endif
@ -3982,7 +3982,7 @@ void Audio_StartNatureAmbienceSequence(u16 playerIO, u16 channelMask) {
channelIdx = false; channelIdx = false;
#if OOT_DEBUG #if DEBUG_FEATURES
if (gStartSeqDisabled) { if (gStartSeqDisabled) {
channelIdx = true; channelIdx = true;
SEQCMD_DISABLE_PLAY_SEQUENCES(false); SEQCMD_DISABLE_PLAY_SEQUENCES(false);

View file

@ -43,7 +43,7 @@ void Audio_StartSequence(u8 seqPlayerIndex, u8 seqId, u8 seqArgs, u16 fadeInDura
if (!gStartSeqDisabled || (seqPlayerIndex == SEQ_PLAYER_SFX)) { if (!gStartSeqDisabled || (seqPlayerIndex == SEQ_PLAYER_SFX)) {
seqArgs &= 0x7F; seqArgs &= 0x7F;
if (OOT_DEBUG && (seqArgs == 0x7F)) { if (DEBUG_FEATURES && (seqArgs == 0x7F)) {
// `fadeInDuration` interpreted as seconds, 60 is refresh rate and does not account for PAL // `fadeInDuration` interpreted as seconds, 60 is refresh rate and does not account for PAL
skipTicks = (fadeInDuration >> 3) * 60 * gAudioCtx.audioBufferParameters.ticksPerUpdate; skipTicks = (fadeInDuration >> 3) * 60 * gAudioCtx.audioBufferParameters.ticksPerUpdate;
AUDIOCMD_GLOBAL_INIT_SEQPLAYER_SKIP_TICKS((u32)seqPlayerIndex, (u32)seqId, skipTicks); AUDIOCMD_GLOBAL_INIT_SEQPLAYER_SKIP_TICKS((u32)seqPlayerIndex, (u32)seqId, skipTicks);
@ -103,7 +103,7 @@ void Audio_ProcessSeqCmd(u32 cmd) {
f32 freqScaleTarget; f32 freqScaleTarget;
s32 pad; s32 pad;
#if OOT_DEBUG #if DEBUG_FEATURES
if (gAudioDebugPrintSeqCmd && (cmd & SEQCMD_OP_MASK) != (SEQCMD_OP_SET_SEQPLAYER_IO << 28)) { if (gAudioDebugPrintSeqCmd && (cmd & SEQCMD_OP_MASK) != (SEQCMD_OP_SET_SEQPLAYER_IO << 28)) {
AudioDebug_ScrPrt("SEQ H", (cmd >> 16) & 0xFFFF); AudioDebug_ScrPrt("SEQ H", (cmd >> 16) & 0xFFFF);
AudioDebug_ScrPrt(" L", cmd & 0xFFFF); AudioDebug_ScrPrt(" L", cmd & 0xFFFF);

View file

@ -34,7 +34,7 @@ u8 sCurSfxPlayerChannelIndex;
u8 gSfxBankMuted[7]; u8 gSfxBankMuted[7];
UnusedBankLerp sUnusedBankLerp[7]; UnusedBankLerp sUnusedBankLerp[7];
#if OOT_DEBUG #if DEBUG_FEATURES
u16 gAudioSfxSwapSource[10]; u16 gAudioSfxSwapSource[10];
u16 gAudioSfxSwapTarget[10]; u16 gAudioSfxSwapTarget[10];
u8 gAudioSfxSwapMode[10]; u8 gAudioSfxSwapMode[10];
@ -74,7 +74,7 @@ void Audio_PlaySfxGeneral(u16 sfxId, Vec3f* pos, u8 token, f32* freqScale, f32*
if (!gSfxBankMuted[SFX_BANK_SHIFT(sfxId)]) { if (!gSfxBankMuted[SFX_BANK_SHIFT(sfxId)]) {
req = &sSfxRequests[gSfxRequestWriteIndex]; req = &sSfxRequests[gSfxRequestWriteIndex];
#if OOT_DEBUG #if DEBUG_FEATURES
if (!gAudioSfxSwapOff) { if (!gAudioSfxSwapOff) {
for (i = 0; i < 10; i++) { for (i = 0; i < 10; i++) {
if (sfxId == gAudioSfxSwapSource[i]) { if (sfxId == gAudioSfxSwapSource[i]) {
@ -172,7 +172,7 @@ void Audio_ProcessSfxRequest(void) {
bankId = SFX_BANK(req->sfxId); bankId = SFX_BANK(req->sfxId);
#if OOT_DEBUG #if DEBUG_FEATURES
if ((1 << bankId) & D_801333F0) { if ((1 << bankId) & D_801333F0) {
AudioDebug_ScrPrt("SE", req->sfxId); AudioDebug_ScrPrt("SE", req->sfxId);
bankId = SFX_BANK(req->sfxId); bankId = SFX_BANK(req->sfxId);
@ -739,7 +739,7 @@ void Audio_ResetSfx(void) {
gSfxBanks[bankId][i].next = 0xFF; gSfxBanks[bankId][i].next = 0xFF;
} }
#if OOT_DEBUG #if DEBUG_FEATURES
if (D_801333F8 == 0) { if (D_801333F8 == 0) {
for (bankId = 0; bankId < 10; bankId++) { for (bankId = 0; bankId < 10; bankId++) {
gAudioSfxSwapSource[bankId] = 0; gAudioSfxSwapSource[bankId] = 0;

View file

@ -30,7 +30,7 @@ void bootproc(void) {
gCartHandle = osCartRomInit(); gCartHandle = osCartRomInit();
osDriveRomInit(); osDriveRomInit();
#if OOT_DEBUG #if DEBUG_FEATURES
isPrintfInit(); isPrintfInit();
#endif #endif
Locale_Init(); Locale_Init();

View file

@ -80,7 +80,7 @@ void Idle_ThreadEntry(void* arg) {
gViConfigYScale = 1.0f; gViConfigYScale = 1.0f;
#endif #endif
#if OOT_DEBUG #if DEBUG_FEATURES
// Allow both 60 Hz and 50 Hz // Allow both 60 Hz and 50 Hz
switch (osTvType) { switch (osTvType) {
case OS_TV_NTSC: case OS_TV_NTSC:
@ -96,7 +96,9 @@ void Idle_ThreadEntry(void* arg) {
case OS_TV_PAL: case OS_TV_PAL:
gViConfigModeType = OS_VI_FPAL_LAN1; gViConfigModeType = OS_VI_FPAL_LAN1;
gViConfigMode = osViModeFpalLan1; gViConfigMode = osViModeFpalLan1;
#if OOT_VERSION >= PAL_1_0
gViConfigYScale = 0.833f; gViConfigYScale = 0.833f;
#endif
break; break;
} }
#elif !OOT_PAL_N64 #elif !OOT_PAL_N64

View file

@ -3,7 +3,7 @@
#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 #if DEBUG_FEATURES
OSPiHandle* sISVHandle; // official name : is_Handle OSPiHandle* sISVHandle; // official name : is_Handle
void isPrintfInit(void) { void isPrintfInit(void) {
@ -18,7 +18,7 @@ void osSyncPrintfUnused(const char* fmt, ...) {
va_list args; va_list args;
va_start(args, fmt); va_start(args, fmt);
#if OOT_DEBUG #if DEBUG_FEATURES
_Printf(is_proutSyncPrintf, NULL, fmt, args); _Printf(is_proutSyncPrintf, NULL, fmt, args);
#endif #endif
@ -29,7 +29,7 @@ void osSyncPrintf(const char* fmt, ...) {
va_list args; va_list args;
va_start(args, fmt); va_start(args, fmt);
#if OOT_DEBUG #if DEBUG_FEATURES
_Printf(is_proutSyncPrintf, NULL, fmt, args); _Printf(is_proutSyncPrintf, NULL, fmt, args);
#endif #endif
@ -41,7 +41,7 @@ void rmonPrintf(const char* fmt, ...) {
va_list args; va_list args;
va_start(args, fmt); va_start(args, fmt);
#if OOT_DEBUG #if DEBUG_FEATURES
_Printf(is_proutSyncPrintf, NULL, fmt, args); _Printf(is_proutSyncPrintf, NULL, fmt, args);
#endif #endif
@ -53,7 +53,7 @@ void func_800015F4(void) {
} }
#endif #endif
#if OOT_DEBUG #if DEBUG_FEATURES
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;

View file

@ -60,7 +60,7 @@ void Locale_ResetRegion(void) {
gCurrentRegion = REGION_NULL; gCurrentRegion = REGION_NULL;
} }
#if OOT_DEBUG #if DEBUG_FEATURES
u32 func_80001F48(void) { u32 func_80001F48(void) {
if (gCurrentRegion == OOT_REGION) { if (gCurrentRegion == OOT_REGION) {
return 0; return 0;

View file

@ -40,7 +40,7 @@ u32 sDmaMgrIsRomCompressed = false;
OSThread sDmaMgrThread; OSThread sDmaMgrThread;
STACK(sDmaMgrStack, 0x500); STACK(sDmaMgrStack, 0x500);
#if OOT_DEBUG #if DEBUG_FEATURES
const char* sDmaMgrCurFileName; const char* sDmaMgrCurFileName;
s32 sDmaMgrCurFileLine; s32 sDmaMgrCurFileLine;
@ -56,7 +56,7 @@ const char* sDmaMgrFileNames[] = {
#undef DEFINE_DMA_ENTRY #undef DEFINE_DMA_ENTRY
#if PLATFORM_N64 || OOT_DEBUG #if PLATFORM_N64 || DEBUG_FEATURES
/** /**
* Compares `str1` and `str2`. * Compares `str1` and `str2`.
* *
@ -252,7 +252,7 @@ void DmaMgr_DmaFromDriveRom(void* ram, uintptr_t rom, size_t size) {
osRecvMesg(&queue, NULL, OS_MESG_BLOCK); osRecvMesg(&queue, NULL, OS_MESG_BLOCK);
} }
#if OOT_DEBUG #if DEBUG_FEATURES
/** /**
* DMA error encountered, print error messages and bring up the crash screen. * DMA error encountered, print error messages and bring up the crash screen.
* *
@ -315,7 +315,7 @@ NORETURN void DmaMgr_Error(DmaRequest* req, const char* filename, const char* er
* @return Pointer to associated filename * @return Pointer to associated filename
*/ */
const char* DmaMgr_FindFileName(uintptr_t vrom) { const char* DmaMgr_FindFileName(uintptr_t vrom) {
#if OOT_DEBUG #if DEBUG_FEATURES
DmaEntry* iter = gDmaDataTable; DmaEntry* iter = gDmaDataTable;
const char** name = sDmaMgrFileNames; const char** name = sDmaMgrFileNames;
@ -339,7 +339,7 @@ const char* DmaMgr_FindFileName(uintptr_t vrom) {
#endif #endif
const char* DmaMgr_GetFileName(uintptr_t vrom) { const char* DmaMgr_GetFileName(uintptr_t vrom) {
#if OOT_DEBUG #if PLATFORM_GC && DEBUG_FEATURES
const char* ret = DmaMgr_FindFileName(vrom); const char* ret = DmaMgr_FindFileName(vrom);
if (ret == NULL) { if (ret == NULL) {
@ -352,10 +352,10 @@ const char* DmaMgr_GetFileName(uintptr_t vrom) {
return NULL; return NULL;
} }
return ret; return ret;
#elif PLATFORM_N64
return "??";
#elif PLATFORM_GC #elif PLATFORM_GC
return ""; return "";
#elif PLATFORM_N64
return "??";
#endif #endif
} }
@ -370,7 +370,7 @@ void DmaMgr_ProcessRequest(DmaRequest* req) {
const char* filename; const char* filename;
s32 i = 0; s32 i = 0;
#if OOT_DEBUG #if DEBUG_FEATURES
// Get the filename (for debugging) // Get the filename (for debugging)
filename = DmaMgr_GetFileName(vrom); filename = DmaMgr_GetFileName(vrom);
#elif PLATFORM_GC #elif PLATFORM_GC
@ -538,7 +538,7 @@ s32 DmaMgr_RequestAsync(DmaRequest* req, void* ram, uintptr_t vrom, size_t size,
OSMesg msg) { OSMesg msg) {
static s32 sDmaMgrQueueFullLogged = 0; static s32 sDmaMgrQueueFullLogged = 0;
#if OOT_DEBUG #if DEBUG_FEATURES
if ((ram == NULL) || (osMemSize < OS_K0_TO_PHYSICAL(ram) + size) || (vrom & 1) || (vrom > 0x4000000) || if ((ram == NULL) || (osMemSize < OS_K0_TO_PHYSICAL(ram) + size) || (vrom & 1) || (vrom > 0x4000000) ||
(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
@ -562,7 +562,7 @@ s32 DmaMgr_RequestAsync(DmaRequest* req, void* ram, uintptr_t vrom, size_t size,
req->notifyQueue = queue; req->notifyQueue = queue;
req->notifyMsg = msg; req->notifyMsg = msg;
#if OOT_DEBUG #if DEBUG_FEATURES
if (1 && (sDmaMgrQueueFullLogged == 0) && MQ_IS_FULL(&sDmaMgrMsgQueue)) { if (1 && (sDmaMgrQueueFullLogged == 0) && MQ_IS_FULL(&sDmaMgrMsgQueue)) {
sDmaMgrQueueFullLogged++; sDmaMgrQueueFullLogged++;
PRINTF("%c", BEL); PRINTF("%c", BEL);
@ -614,7 +614,7 @@ void DmaMgr_Init(void) {
(u32)(_dmadataSegmentRomEnd - _dmadataSegmentRomStart)); (u32)(_dmadataSegmentRomEnd - _dmadataSegmentRomStart));
PRINTF("dma_rom_ad[]\n"); PRINTF("dma_rom_ad[]\n");
#if OOT_DEBUG #if DEBUG_FEATURES
name = sDmaMgrFileNames; name = sDmaMgrFileNames;
iter = gDmaDataTable; iter = gDmaDataTable;
idx = 0; idx = 0;
@ -662,7 +662,7 @@ void DmaMgr_Init(void) {
osStartThread(&sDmaMgrThread); osStartThread(&sDmaMgrThread);
} }
#if OOT_DEBUG #if DEBUG_FEATURES
/** /**
* Asynchronous DMA Request with source file and line info for debugging. * Asynchronous DMA Request with source file and line info for debugging.
* *

View file

@ -598,7 +598,7 @@ void PreRender_AntiAliasFilter(PreRender* this, s32 x, s32 y) {
buffCvg[i] = this->cvgSave[xi + yi * this->width] >> 5; buffCvg[i] = this->cvgSave[xi + yi * this->width] >> 5;
} }
#if OOT_DEBUG #if DEBUG_FEATURES
if (buffCvg[7] == 7) { if (buffCvg[7] == 7) {
PRINTF("Error, should not be in here \n"); PRINTF("Error, should not be in here \n");
return; return;
@ -693,7 +693,7 @@ void PreRender_AntiAliasFilter(PreRender* this, s32 x, s32 y) {
(((a2) >= (a1)) ? (((a3) >= (a2)) ? (a2) : (((a1) >= (a3)) ? (a1) : (a3))) \ (((a2) >= (a1)) ? (((a3) >= (a2)) ? (a2) : (((a1) >= (a3)) ? (a1) : (a3))) \
: (((a2) >= (a3)) ? (a2) : (((a3) >= (a1)) ? (a1) : (a3)))) : (((a2) >= (a3)) ? (a2) : (((a3) >= (a1)) ? (a1) : (a3))))
#if OOT_DEBUG #if DEBUG_FEATURES
#define R_HREG_MODE_DEBUG R_HREG_MODE #define R_HREG_MODE_DEBUG R_HREG_MODE
#else #else
#define R_HREG_MODE_DEBUG ((void)0, 0) #define R_HREG_MODE_DEBUG ((void)0, 0)

View file

@ -36,7 +36,7 @@ void DynaPolyActor_UpdateCarriedActorPos(CollisionContext* colCtx, s32 bgId, Act
SkinMatrix_Vec3fMtxFMultXYZ(&curTransform, &tempPos, &pos); SkinMatrix_Vec3fMtxFMultXYZ(&curTransform, &tempPos, &pos);
carriedActor->world.pos = pos; carriedActor->world.pos = pos;
#if OOT_DEBUG #if DEBUG_FEATURES
if (BGCHECK_XYZ_ABSMAX <= pos.x || pos.x <= -BGCHECK_XYZ_ABSMAX || BGCHECK_XYZ_ABSMAX <= pos.y || if (BGCHECK_XYZ_ABSMAX <= pos.x || pos.x <= -BGCHECK_XYZ_ABSMAX || BGCHECK_XYZ_ABSMAX <= pos.y ||
pos.y <= -BGCHECK_XYZ_ABSMAX || BGCHECK_XYZ_ABSMAX <= pos.z || pos.z <= -BGCHECK_XYZ_ABSMAX) { pos.y <= -BGCHECK_XYZ_ABSMAX || BGCHECK_XYZ_ABSMAX <= pos.z || pos.z <= -BGCHECK_XYZ_ABSMAX) {

View file

@ -1,7 +1,7 @@
#include "global.h" #include "global.h"
#include "terminal.h" #include "terminal.h"
#if OOT_DEBUG #if DEBUG_FEATURES
u32 gIsCtrlr2Valid = false; u32 gIsCtrlr2Valid = false;
#endif #endif
@ -12,7 +12,7 @@ NORETURN void func_800D31A0(void) {
} }
} }
#if OOT_DEBUG #if DEBUG_FEATURES
void func_800D31F0(void) { void func_800D31F0(void) {
gIsCtrlr2Valid = (gPadMgr.validCtrlrsMask & 2) != 0; gIsCtrlr2Valid = (gPadMgr.validCtrlrsMask & 2) != 0;
} }

View file

@ -7,14 +7,16 @@
Arena sDebugArena; Arena sDebugArena;
#if OOT_DEBUG #if DEBUG_FEATURES
s32 gDebugArenaLogSeverity = LOG_SEVERITY_ERROR; s32 gDebugArenaLogSeverity = LOG_SEVERITY_ERROR;
void DebugArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action) { void DebugArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action) {
if (ptr == NULL) { if (ptr == NULL) {
if (gDebugArenaLogSeverity >= LOG_SEVERITY_ERROR) { if (gDebugArenaLogSeverity >= LOG_SEVERITY_ERROR) {
PRINTF(T("%s: %u バイトの%sに失敗しました\n", "%s: %u bytes %s failed\n"), name, size, action); PRINTF(T("%s: %u バイトの%sに失敗しました\n", "%s: %u bytes %s failed\n"), name, size, action);
#if PLATFORM_GC
__osDisplayArena(&sDebugArena); __osDisplayArena(&sDebugArena);
#endif
return; return;
} }
} else if (gDebugArenaLogSeverity >= LOG_SEVERITY_VERBOSE) { } else if (gDebugArenaLogSeverity >= LOG_SEVERITY_VERBOSE) {
@ -34,7 +36,7 @@ void* DebugArena_Malloc(u32 size) {
return ptr; return ptr;
} }
#if OOT_DEBUG #if DEBUG_FEATURES
void* DebugArena_MallocDebug(u32 size, const char* file, int line) { void* DebugArena_MallocDebug(u32 size, const char* file, int line) {
void* ptr = __osMallocDebug(&sDebugArena, size, file, line); void* ptr = __osMallocDebug(&sDebugArena, size, file, line);
@ -50,7 +52,7 @@ void* DebugArena_MallocR(u32 size) {
return ptr; return ptr;
} }
#if OOT_DEBUG #if DEBUG_FEATURES
void* DebugArena_MallocRDebug(u32 size, const char* file, int line) { void* DebugArena_MallocRDebug(u32 size, const char* file, int line) {
void* ptr = __osMallocRDebug(&sDebugArena, size, file, line); void* ptr = __osMallocRDebug(&sDebugArena, size, file, line);
@ -65,7 +67,7 @@ void* DebugArena_Realloc(void* ptr, u32 newSize) {
return ptr; return ptr;
} }
#if OOT_DEBUG #if DEBUG_FEATURES
void* DebugArena_ReallocDebug(void* ptr, u32 newSize, const char* file, int line) { void* DebugArena_ReallocDebug(void* ptr, u32 newSize, const char* file, int line) {
ptr = __osReallocDebug(&sDebugArena, ptr, newSize, file, line); ptr = __osReallocDebug(&sDebugArena, ptr, newSize, file, line);
DEBUG_ARENA_CHECK_POINTER(ptr, newSize, "debug_realloc_DEBUG", "再確保"); // "Re-securing" DEBUG_ARENA_CHECK_POINTER(ptr, newSize, "debug_realloc_DEBUG", "再確保"); // "Re-securing"
@ -77,7 +79,7 @@ void DebugArena_Free(void* ptr) {
__osFree(&sDebugArena, ptr); __osFree(&sDebugArena, ptr);
} }
#if OOT_DEBUG #if DEBUG_FEATURES
void DebugArena_FreeDebug(void* ptr, const char* file, int line) { void DebugArena_FreeDebug(void* ptr, const char* file, int line) {
__osFreeDebug(&sDebugArena, ptr, file, line); __osFreeDebug(&sDebugArena, ptr, file, line);
} }
@ -96,7 +98,7 @@ void* DebugArena_Calloc(u32 num, u32 size) {
return ret; return ret;
} }
#if OOT_DEBUG #if PLATFORM_GC && DEBUG_FEATURES
void DebugArena_Display(void) { void DebugArena_Display(void) {
// Likely copypasted from ZeldaArena_Display, should say "Debug" // Likely copypasted from ZeldaArena_Display, should say "Debug"
PRINTF(T("ゼルダヒープ表示\n", "Zelda heap display\n")); PRINTF(T("ゼルダヒープ表示\n", "Zelda heap display\n"));
@ -113,14 +115,14 @@ void DebugArena_Check(void) {
} }
void DebugArena_Init(void* start, u32 size) { void DebugArena_Init(void* start, u32 size) {
#if OOT_DEBUG #if DEBUG_FEATURES
gDebugArenaLogSeverity = LOG_SEVERITY_NOLOG; gDebugArenaLogSeverity = LOG_SEVERITY_NOLOG;
#endif #endif
__osMallocInit(&sDebugArena, start, size); __osMallocInit(&sDebugArena, start, size);
} }
void DebugArena_Cleanup(void) { void DebugArena_Cleanup(void) {
#if OOT_DEBUG #if DEBUG_FEATURES
gDebugArenaLogSeverity = LOG_SEVERITY_NOLOG; gDebugArenaLogSeverity = LOG_SEVERITY_NOLOG;
#endif #endif
__osMallocCleanup(&sDebugArena); __osMallocCleanup(&sDebugArena);

View file

@ -15,7 +15,7 @@ VisZBuf sVisZBuf;
VisMono sVisMono; VisMono sVisMono;
ViMode sViMode; ViMode sViMode;
#if OOT_DEBUG #if DEBUG_FEATURES
FaultClient sGameFaultClient; FaultClient sGameFaultClient;
u16 sLastButtonPressed; u16 sLastButtonPressed;
@ -73,18 +73,16 @@ void GameState_SetFBFilter(Gfx** gfxP) {
} }
void func_800C4344(GameState* gameState) { void func_800C4344(GameState* gameState) {
#if PLATFORM_N64 #if DEBUG_FEATURES
if (D_80121212 != 0) {
func_801C7E78();
}
#elif OOT_DEBUG
Input* selectedInput; Input* selectedInput;
s32 hexDumpSize; s32 hexDumpSize;
u16 inputCompareValue; u16 inputCompareValue;
#if PLATFORM_GC
if (R_HREG_MODE == HREG_MODE_HEAP_FREE_BLOCK_TEST) { if (R_HREG_MODE == HREG_MODE_HEAP_FREE_BLOCK_TEST) {
__osMalloc_FreeBlockTest_Enable = R_HEAP_FREE_BLOCK_TEST_TOGGLE; __osMalloc_FreeBlockTest_Enable = R_HEAP_FREE_BLOCK_TEST_TOGGLE;
} }
#endif
if (R_HREG_MODE == HREG_MODE_INPUT_TEST) { if (R_HREG_MODE == HREG_MODE_INPUT_TEST) {
selectedInput = selectedInput =
@ -128,9 +126,15 @@ void func_800C4344(GameState* gameState) {
} }
} }
#endif #endif
#if PLATFORM_N64
if (D_80121212 != 0) {
func_801C7E78();
}
#endif
} }
#if OOT_DEBUG #if DEBUG_FEATURES
void GameState_DrawInputDisplay(u16 input, Gfx** gfxP) { void GameState_DrawInputDisplay(u16 input, Gfx** gfxP) {
static const u16 sInpDispBtnColors[] = { static const u16 sInpDispBtnColors[] = {
GPACK_RGBA5551(255, 255, 0, 1), GPACK_RGBA5551(255, 255, 0, 1), GPACK_RGBA5551(255, 255, 0, 1), GPACK_RGBA5551(255, 255, 0, 1), GPACK_RGBA5551(255, 255, 0, 1), GPACK_RGBA5551(255, 255, 0, 1),
@ -176,7 +180,7 @@ void GameState_Draw(GameState* gameState, GraphicsContext* gfxCtx) {
GameState_SetFBFilter(&newDList); GameState_SetFBFilter(&newDList);
} }
#if OOT_DEBUG #if DEBUG_FEATURES
sLastButtonPressed = gameState->input[0].press.button | gameState->input[0].cur.button; sLastButtonPressed = gameState->input[0].press.button | gameState->input[0].cur.button;
if (R_DISABLE_INPUT_DISPLAY == 0) { if (R_DISABLE_INPUT_DISPLAY == 0) {
GameState_DrawInputDisplay(sLastButtonPressed, &newDList); GameState_DrawInputDisplay(sLastButtonPressed, &newDList);
@ -195,14 +199,14 @@ void GameState_Draw(GameState* gameState, GraphicsContext* gfxCtx) {
#endif #endif
if (R_ENABLE_ARENA_DBG < 0) { if (R_ENABLE_ARENA_DBG < 0) {
#if OOT_DEBUG #if PLATFORM_GC && DEBUG_FEATURES
s32 pad; s32 pad;
DebugArena_Display(); DebugArena_Display();
SystemArena_Display(); SystemArena_Display();
#endif
PRINTF(T("ハイラル滅亡まであと %08x バイト(game_alloc)\n", PRINTF(T("ハイラル滅亡まであと %08x バイト(game_alloc)\n",
"%08x bytes left until Hyrule is destroyed (game_alloc)\n"), "%08x bytes left until Hyrule is destroyed (game_alloc)\n"),
THA_GetRemaining(&gameState->tha)); THA_GetRemaining(&gameState->tha));
#endif
R_ENABLE_ARENA_DBG = 0; R_ENABLE_ARENA_DBG = 0;
} }
@ -290,7 +294,7 @@ void GameState_Update(GameState* gameState) {
} }
#endif #endif
#if OOT_DEBUG #if OOT_VERSION >= PAL_1_0 && DEBUG_FEATURES
if (SREG(63) == 1u) { if (SREG(63) == 1u) {
if (R_VI_MODE_EDIT_STATE < VI_MODE_EDIT_STATE_INACTIVE) { if (R_VI_MODE_EDIT_STATE < VI_MODE_EDIT_STATE_INACTIVE) {
R_VI_MODE_EDIT_STATE = VI_MODE_EDIT_STATE_INACTIVE; R_VI_MODE_EDIT_STATE = VI_MODE_EDIT_STATE_INACTIVE;
@ -431,7 +435,7 @@ void GameState_Realloc(GameState* gameState, size_t size) {
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_DEBUG #if PLATFORM_GC && DEBUG_FEATURES
SystemArena_Display(); SystemArena_Display();
#endif #endif
@ -488,7 +492,7 @@ void GameState_Init(GameState* gameState, GameStateFunc init, GraphicsContext* g
VisCvg_Init(&sVisCvg); VisCvg_Init(&sVisCvg);
VisZBuf_Init(&sVisZBuf); VisZBuf_Init(&sVisZBuf);
VisMono_Init(&sVisMono); VisMono_Init(&sVisMono);
if ((R_VI_MODE_EDIT_STATE == VI_MODE_EDIT_STATE_INACTIVE) || !OOT_DEBUG) { if ((R_VI_MODE_EDIT_STATE == VI_MODE_EDIT_STATE_INACTIVE) || !DEBUG_FEATURES) {
ViMode_Init(&sViMode); ViMode_Init(&sViMode);
} }
SpeedMeter_Init(&D_801664D0); SpeedMeter_Init(&D_801664D0);
@ -498,7 +502,7 @@ void GameState_Init(GameState* gameState, GameStateFunc init, GraphicsContext* g
PRINTF(T("その他初期化 処理時間 %d us\n", "Other initialization processing time %d us\n"), PRINTF(T("その他初期化 処理時間 %d us\n", "Other initialization processing time %d us\n"),
OS_CYCLES_TO_USEC(endTime - startTime)); OS_CYCLES_TO_USEC(endTime - startTime));
#if OOT_DEBUG #if DEBUG_FEATURES
Fault_AddClient(&sGameFaultClient, GameState_FaultPrint, NULL, NULL); Fault_AddClient(&sGameFaultClient, GameState_FaultPrint, NULL, NULL);
#endif #endif
@ -519,14 +523,17 @@ void GameState_Destroy(GameState* gameState) {
VisCvg_Destroy(&sVisCvg); VisCvg_Destroy(&sVisCvg);
VisZBuf_Destroy(&sVisZBuf); VisZBuf_Destroy(&sVisZBuf);
VisMono_Destroy(&sVisMono); VisMono_Destroy(&sVisMono);
if ((R_VI_MODE_EDIT_STATE == VI_MODE_EDIT_STATE_INACTIVE) || !OOT_DEBUG) { if ((R_VI_MODE_EDIT_STATE == VI_MODE_EDIT_STATE_INACTIVE) || !DEBUG_FEATURES) {
ViMode_Destroy(&sViMode); ViMode_Destroy(&sViMode);
} }
THA_Destroy(&gameState->tha); THA_Destroy(&gameState->tha);
GameAlloc_Cleanup(&gameState->alloc); GameAlloc_Cleanup(&gameState->alloc);
#if OOT_DEBUG #if PLATFORM_GC && DEBUG_FEATURES
SystemArena_Display(); SystemArena_Display();
#endif
#if DEBUG_FEATURES
Fault_RemoveClient(&sGameFaultClient); Fault_RemoveClient(&sGameFaultClient);
#endif #endif
@ -545,7 +552,7 @@ u32 GameState_IsRunning(GameState* gameState) {
return gameState->running; return gameState->running;
} }
#if OOT_DEBUG #if DEBUG_FEATURES
void* GameState_Alloc(GameState* gameState, size_t size, const char* file, int line) { void* GameState_Alloc(GameState* gameState, size_t size, const char* file, int line) {
void* ret; void* ret;

View file

@ -12,7 +12,7 @@ void GameAlloc_Log(GameAlloc* this) {
} }
} }
#if OOT_DEBUG #if DEBUG_FEATURES
void* GameAlloc_MallocDebug(GameAlloc* this, u32 size, const char* file, int line) { void* GameAlloc_MallocDebug(GameAlloc* this, u32 size, const char* file, int line) {
GameAllocEntry* ptr = SystemArena_MallocDebug(size + sizeof(GameAllocEntry), file, line); GameAllocEntry* ptr = SystemArena_MallocDebug(size + sizeof(GameAllocEntry), file, line);

View file

@ -20,7 +20,7 @@ OSTime sGraphPrevUpdateEndTime;
*/ */
OSTime sGraphPrevTaskTimeStart; OSTime sGraphPrevTaskTimeStart;
#if OOT_DEBUG #if DEBUG_FEATURES
FaultClient sGraphFaultClient; FaultClient sGraphFaultClient;
UCodeInfo D_8012D230[3] = { UCodeInfo D_8012D230[3] = {
@ -152,21 +152,21 @@ void Graph_Init(GraphicsContext* gfxCtx) {
osCreateMesgQueue(&gfxCtx->queue, gfxCtx->msgBuff, ARRAY_COUNT(gfxCtx->msgBuff)); osCreateMesgQueue(&gfxCtx->queue, gfxCtx->msgBuff, ARRAY_COUNT(gfxCtx->msgBuff));
#if OOT_DEBUG #if DEBUG_FEATURES
func_800D31F0(); func_800D31F0();
Fault_AddClient(&sGraphFaultClient, Graph_FaultClient, NULL, NULL); Fault_AddClient(&sGraphFaultClient, Graph_FaultClient, NULL, NULL);
#endif #endif
} }
void Graph_Destroy(GraphicsContext* gfxCtx) { void Graph_Destroy(GraphicsContext* gfxCtx) {
#if OOT_DEBUG #if DEBUG_FEATURES
func_800D3210(); func_800D3210();
Fault_RemoveClient(&sGraphFaultClient); Fault_RemoveClient(&sGraphFaultClient);
#endif #endif
} }
void Graph_TaskSet00(GraphicsContext* gfxCtx) { void Graph_TaskSet00(GraphicsContext* gfxCtx) {
#if OOT_DEBUG #if DEBUG_FEATURES
static Gfx* sPrevTaskWorkBuffer = NULL; static Gfx* sPrevTaskWorkBuffer = NULL;
#endif #endif
OSTask_t* task = &gfxCtx->task.list.t; OSTask_t* task = &gfxCtx->task.list.t;
@ -186,7 +186,7 @@ void Graph_TaskSet00(GraphicsContext* gfxCtx) {
osStopTimer(&timer); osStopTimer(&timer);
if (msg == (OSMesg)666) { if (msg == (OSMesg)666) {
#if OOT_DEBUG #if DEBUG_FEATURES
PRINTF(VT_FGCOL(RED)); PRINTF(VT_FGCOL(RED));
PRINTF(T("RCPが帰ってきませんでした。", "RCP did not return.")); PRINTF(T("RCPが帰ってきませんでした。", "RCP did not return."));
PRINTF(VT_RST); PRINTF(VT_RST);
@ -209,7 +209,7 @@ void Graph_TaskSet00(GraphicsContext* gfxCtx) {
osRecvMesg(&gfxCtx->queue, &msg, OS_MESG_NOBLOCK); osRecvMesg(&gfxCtx->queue, &msg, OS_MESG_NOBLOCK);
#if OOT_DEBUG #if DEBUG_FEATURES
sPrevTaskWorkBuffer = gfxCtx->workBuffer; sPrevTaskWorkBuffer = gfxCtx->workBuffer;
#endif #endif
} }
@ -302,7 +302,7 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) {
gameState->inPreNMIState = false; gameState->inPreNMIState = false;
Graph_InitTHGA(gfxCtx); Graph_InitTHGA(gfxCtx);
#if OOT_DEBUG #if DEBUG_FEATURES
OPEN_DISPS(gfxCtx, "../graph.c", 966); OPEN_DISPS(gfxCtx, "../graph.c", 966);
gDPNoOpString(WORK_DISP++, "WORK_DISP 開始", 0); gDPNoOpString(WORK_DISP++, "WORK_DISP 開始", 0);
@ -316,7 +316,7 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) {
GameState_ReqPadData(gameState); GameState_ReqPadData(gameState);
GameState_Update(gameState); GameState_Update(gameState);
#if OOT_DEBUG #if DEBUG_FEATURES
OPEN_DISPS(gfxCtx, "../graph.c", 987); OPEN_DISPS(gfxCtx, "../graph.c", 987);
gDPNoOpString(WORK_DISP++, "WORK_DISP 終了", 0); gDPNoOpString(WORK_DISP++, "WORK_DISP 終了", 0);
@ -338,7 +338,7 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) {
CLOSE_DISPS(gfxCtx, "../graph.c", 1028); CLOSE_DISPS(gfxCtx, "../graph.c", 1028);
#if OOT_DEBUG #if DEBUG_FEATURES
if (R_HREG_MODE == HREG_MODE_PLAY && R_PLAY_ENABLE_UCODE_DISAS == 2) { if (R_HREG_MODE == HREG_MODE_PLAY && R_PLAY_ENABLE_UCODE_DISAS == 2) {
R_HREG_MODE = HREG_MODE_UCODE_DISAS; R_HREG_MODE = HREG_MODE_UCODE_DISAS;
R_UCODE_DISAS_TOGGLE = -1; R_UCODE_DISAS_TOGGLE = -1;
@ -450,7 +450,7 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) {
sGraphPrevUpdateEndTime = timeNow; sGraphPrevUpdateEndTime = timeNow;
} }
#if OOT_DEBUG #if DEBUG_FEATURES
if (gIsCtrlr2Valid && CHECK_BTN_ALL(gameState->input[0].press.button, BTN_Z) && if (gIsCtrlr2Valid && CHECK_BTN_ALL(gameState->input[0].press.button, BTN_Z) &&
CHECK_BTN_ALL(gameState->input[0].cur.button, BTN_L | BTN_R)) { CHECK_BTN_ALL(gameState->input[0].cur.button, BTN_L | BTN_R)) {
gSaveContext.gameMode = GAMEMODE_NORMAL; gSaveContext.gameMode = GAMEMODE_NORMAL;
@ -487,7 +487,7 @@ void Graph_ThreadEntry(void* arg0) {
gameState = SYSTEM_ARENA_MALLOC(size, "../graph.c", 1196); gameState = SYSTEM_ARENA_MALLOC(size, "../graph.c", 1196);
if (gameState == NULL) { if (gameState == NULL) {
#if OOT_DEBUG #if DEBUG_FEATURES
char faultMsg[0x50]; char faultMsg[0x50];
PRINTF(T("確保失敗\n", "Failure to secure\n")); PRINTF(T("確保失敗\n", "Failure to secure\n"));
@ -540,7 +540,7 @@ void* Graph_Alloc2(GraphicsContext* gfxCtx, size_t size) {
return THGA_AllocTail(&gfxCtx->polyOpa, ALIGN16(size)); return THGA_AllocTail(&gfxCtx->polyOpa, ALIGN16(size));
} }
#if OOT_DEBUG #if DEBUG_FEATURES
void Graph_OpenDisps(Gfx** dispRefs, GraphicsContext* gfxCtx, const char* file, int line) { void Graph_OpenDisps(Gfx** dispRefs, GraphicsContext* gfxCtx, const char* file, int line) {
if (R_HREG_MODE == HREG_MODE_UCODE_DISAS && R_UCODE_DISAS_LOG_MODE != 4) { if (R_HREG_MODE == HREG_MODE_UCODE_DISAS && R_UCODE_DISAS_LOG_MODE != 4) {
dispRefs[0] = gfxCtx->polyOpa.p; dispRefs[0] = gfxCtx->polyOpa.p;

View file

@ -57,7 +57,7 @@ AudioMgr sAudioMgr;
OSMesgQueue sSerialEventQueue; OSMesgQueue sSerialEventQueue;
OSMesg sSerialMsgBuf[1]; OSMesg sSerialMsgBuf[1];
#if OOT_DEBUG #if DEBUG_FEATURES
void Main_LogSystemHeap(void) { void Main_LogSystemHeap(void) {
PRINTF(VT_FGCOL(GREEN)); PRINTF(VT_FGCOL(GREEN));
PRINTF( PRINTF(
@ -100,7 +100,7 @@ void Main(void* arg) {
fb, gSystemHeapSize); fb, gSystemHeapSize);
SystemHeap_Init((void*)systemHeapStart, gSystemHeapSize); // initializes the system heap SystemHeap_Init((void*)systemHeapStart, gSystemHeapSize); // initializes the system heap
#if OOT_DEBUG #if DEBUG_FEATURES
{ {
void* debugHeapStart; void* debugHeapStart;
u32 debugHeapSize; u32 debugHeapSize;
@ -125,7 +125,7 @@ void Main(void* arg) {
osCreateMesgQueue(&sSerialEventQueue, sSerialMsgBuf, ARRAY_COUNT(sSerialMsgBuf)); osCreateMesgQueue(&sSerialEventQueue, sSerialMsgBuf, ARRAY_COUNT(sSerialMsgBuf));
osSetEventMesg(OS_EVENT_SI, &sSerialEventQueue, NULL); osSetEventMesg(OS_EVENT_SI, &sSerialEventQueue, NULL);
#if OOT_DEBUG #if DEBUG_FEATURES
Main_LogSystemHeap(); Main_LogSystemHeap();
#endif #endif

View file

@ -33,7 +33,7 @@
#include "terminal.h" #include "terminal.h"
#define PADMGR_LOG(controllerNum, msg) \ #define PADMGR_LOG(controllerNum, msg) \
if (OOT_DEBUG) { \ if (DEBUG_FEATURES) { \
PRINTF(VT_FGCOL(YELLOW)); \ PRINTF(VT_FGCOL(YELLOW)); \
PRINTF(T("padmgr: %dコン: %s\n", "padmgr: Controller %d: %s\n"), (controllerNum) + 1, (msg)); \ PRINTF(T("padmgr: %dコン: %s\n", "padmgr: Controller %d: %s\n"), (controllerNum) + 1, (msg)); \
PRINTF(VT_RST); \ PRINTF(VT_RST); \
@ -68,7 +68,7 @@ s32 gPadMgrLogSeverity = LOG_SEVERITY_CRITICAL;
OSMesgQueue* PadMgr_AcquireSerialEventQueue(PadMgr* padMgr) { OSMesgQueue* PadMgr_AcquireSerialEventQueue(PadMgr* padMgr) {
OSMesgQueue* serialEventQueue; OSMesgQueue* serialEventQueue;
#if OOT_DEBUG #if DEBUG_FEATURES
serialEventQueue = NULL; serialEventQueue = NULL;
#endif #endif
@ -184,7 +184,7 @@ void PadMgr_UpdateRumble(PadMgr* padMgr) {
} }
} else { } else {
if (padMgr->pakType[i] != CONT_PAK_NONE) { if (padMgr->pakType[i] != CONT_PAK_NONE) {
if (padMgr->pakType[i] == CONT_PAK_RUMBLE || !OOT_DEBUG) { if (padMgr->pakType[i] == CONT_PAK_RUMBLE || !DEBUG_FEATURES) {
PADMGR_LOG(i, T("振動パックが抜かれたようです", "It seems that a rumble pak was pulled out")); PADMGR_LOG(i, T("振動パックが抜かれたようです", "It seems that a rumble pak was pulled out"));
padMgr->pakType[i] = CONT_PAK_NONE; padMgr->pakType[i] = CONT_PAK_NONE;
} else { } else {
@ -363,7 +363,7 @@ void PadMgr_HandleRetrace(PadMgr* padMgr) {
osRecvMesg(serialEventQueue, NULL, OS_MESG_BLOCK); osRecvMesg(serialEventQueue, NULL, OS_MESG_BLOCK);
osContGetReadData(padMgr->pads); osContGetReadData(padMgr->pads);
#if !OOT_DEBUG #if !DEBUG_FEATURES
// Clear controllers 2 and 4 // Clear controllers 2 and 4
bzero(&padMgr->pads[1], sizeof(OSContPad)); bzero(&padMgr->pads[1], sizeof(OSContPad));
bzero(&padMgr->pads[3], sizeof(OSContPad)); bzero(&padMgr->pads[3], sizeof(OSContPad));

View file

@ -54,7 +54,7 @@ OSTime sRSPAudioTimeStart;
OSTime sRSPOtherTimeStart; OSTime sRSPOtherTimeStart;
OSTime sRDPTimeStart; OSTime sRDPTimeStart;
#if OOT_VERSION < PAL_1_0 || OOT_DEBUG #if OOT_VERSION < PAL_1_0 || DEBUG_FEATURES
vs32 sSchedDebugPrintfEnabled = false; vs32 sSchedDebugPrintfEnabled = false;
#define SCHED_DEBUG_PRINTF \ #define SCHED_DEBUG_PRINTF \
@ -85,7 +85,7 @@ void Sched_SwapFrameBufferImpl(CfbInfo* cfbInfo) {
Fault_SetFrameBuffer(cfbInfo->swapBuffer, width, 16); Fault_SetFrameBuffer(cfbInfo->swapBuffer, width, 16);
} }
#if OOT_DEBUG #if DEBUG_FEATURES
if (R_HREG_MODE == HREG_MODE_SCHED && R_SCHED_INIT != HREG_MODE_SCHED) { if (R_HREG_MODE == HREG_MODE_SCHED && R_SCHED_INIT != HREG_MODE_SCHED) {
R_SCHED_TOGGLE_SPECIAL_FEATURES = 0; R_SCHED_TOGGLE_SPECIAL_FEATURES = 0;
R_SCHED_GAMMA_ON = 0; R_SCHED_GAMMA_ON = 0;
@ -151,7 +151,7 @@ void Sched_SwapFrameBuffer(Scheduler* sc, CfbInfo* cfbInfo) {
} }
void Sched_HandlePreNMI(Scheduler* sc) { void Sched_HandlePreNMI(Scheduler* sc) {
#if OOT_DEBUG #if DEBUG_FEATURES
OSTime now; OSTime now;
if (sc->curRSPTask != NULL) { if (sc->curRSPTask != NULL) {

View file

@ -86,7 +86,7 @@ void Letterbox_Update(s32 updateRate) {
sLetterboxState = LETTERBOX_STATE_IDLE; sLetterboxState = LETTERBOX_STATE_IDLE;
} }
if (OOT_DEBUG && (R_HREG_MODE == HREG_MODE_LETTERBOX)) { if (DEBUG_FEATURES && (R_HREG_MODE == HREG_MODE_LETTERBOX)) {
if (R_LETTERBOX_INIT != HREG_MODE_LETTERBOX) { if (R_LETTERBOX_INIT != HREG_MODE_LETTERBOX) {
R_LETTERBOX_INIT = HREG_MODE_LETTERBOX; R_LETTERBOX_INIT = HREG_MODE_LETTERBOX;
R_LETTERBOX_ENABLE_LOGS = 0; R_LETTERBOX_ENABLE_LOGS = 0;

View file

@ -15,7 +15,7 @@ void SysCfb_Init(s32 n64dd) {
tmpFbEnd = 0x8044BE80; tmpFbEnd = 0x8044BE80;
if (n64dd == 1) { if (n64dd == 1) {
PRINTF(T("RAM 8M mode (N64DD対応)\n", "RAM 8M mode (N64DD compatible)\n")); PRINTF(T("RAM 8M mode (N64DD対応)\n", "RAM 8M mode (N64DD compatible)\n"));
#if OOT_DEBUG #if DEBUG_FEATURES
sSysCfbEnd = 0x805FB000; sSysCfbEnd = 0x805FB000;
#else #else
sSysCfbEnd = 0x80600000; sSysCfbEnd = 0x80600000;
@ -23,7 +23,7 @@ void SysCfb_Init(s32 n64dd) {
} else { } else {
PRINTF(T("このバージョンのマージンは %dK バイトです\n", "The margin for this version is %dK bytes\n"), PRINTF(T("このバージョンのマージンは %dK バイトです\n", "The margin for this version is %dK bytes\n"),
(0x4BC00 / 1024)); (0x4BC00 / 1024));
#if OOT_DEBUG #if DEBUG_FEATURES
sSysCfbEnd = tmpFbEnd; sSysCfbEnd = tmpFbEnd;
#else #else
sSysCfbEnd = 0x80400000; sSysCfbEnd = 0x80400000;

View file

@ -929,7 +929,7 @@ f32 Math3D_Plane(Plane* plane, Vec3f* pointOnPlane) {
* `nx`, `ny`, `nz`, and `originDist` * `nx`, `ny`, `nz`, and `originDist`
*/ */
f32 Math3D_UDistPlaneToPos(f32 nx, f32 ny, f32 nz, f32 originDist, Vec3f* p) { f32 Math3D_UDistPlaneToPos(f32 nx, f32 ny, f32 nz, f32 originDist, Vec3f* p) {
if (OOT_DEBUG && IS_ZERO(sqrtf(SQ(nx) + SQ(ny) + SQ(nz)))) { if (DEBUG_FEATURES && IS_ZERO(sqrtf(SQ(nx) + SQ(ny) + SQ(nz)))) {
PRINTF(VT_COL(YELLOW, BLACK)); PRINTF(VT_COL(YELLOW, BLACK));
PRINTF(T("Math3DLengthPlaneAndPos():法線size がゼロ近いです%f %f %f\n", PRINTF(T("Math3DLengthPlaneAndPos():法線size がゼロ近いです%f %f %f\n",
"Math3DLengthPlaneAndPos(): Normal size is near zero %f %f %f\n"), "Math3DLengthPlaneAndPos(): Normal size is near zero %f %f %f\n"),

View file

@ -1,5 +1,5 @@
#include "global.h" #include "global.h"
#if OOT_DEBUG #if DEBUG_FEATURES
#include "fault.h" #include "fault.h"
#endif #endif
@ -609,7 +609,7 @@ Mtx* Matrix_MtxFToMtx(MtxF* src, Mtx* dest) {
return dest; return dest;
} }
#if OOT_DEBUG #if DEBUG_FEATURES
Mtx* Matrix_ToMtx(Mtx* dest, const char* file, int line) { Mtx* Matrix_ToMtx(Mtx* dest, const char* file, int line) {
return Matrix_MtxFToMtx(MATRIX_CHECK_FLOATS(sCurrentMatrix, file, line), dest); return Matrix_MtxFToMtx(MATRIX_CHECK_FLOATS(sCurrentMatrix, file, line), dest);
@ -629,7 +629,7 @@ Mtx* Matrix_Finalize(GraphicsContext* gfxCtx) {
return Matrix_ToMtx(GRAPH_ALLOC(gfxCtx, sizeof(Mtx))); return Matrix_ToMtx(GRAPH_ALLOC(gfxCtx, sizeof(Mtx)));
} }
#endif /* OOT_DEBUG */ #endif /* DEBUG_FEATURES */
Mtx* Matrix_MtxFToNewMtx(MtxF* src, GraphicsContext* gfxCtx) { Mtx* Matrix_MtxFToNewMtx(MtxF* src, GraphicsContext* gfxCtx) {
return Matrix_MtxFToMtx(src, GRAPH_ALLOC(gfxCtx, sizeof(Mtx))); return Matrix_MtxFToMtx(src, GRAPH_ALLOC(gfxCtx, sizeof(Mtx)));
@ -975,7 +975,7 @@ void Matrix_RotateAxis(f32 angle, Vec3f* axis, u8 mode) {
} }
} }
#if OOT_DEBUG #if DEBUG_FEATURES
MtxF* Matrix_CheckFloats(MtxF* mf, const char* file, int line) { MtxF* Matrix_CheckFloats(MtxF* mf, const char* file, int line) {
s32 i, j; s32 i, j;

View file

@ -147,7 +147,7 @@ void RumbleMgr_Init(RumbleMgr* rumbleMgr) {
} }
void RumbleMgr_Destroy(RumbleMgr* rumbleMgr) { void RumbleMgr_Destroy(RumbleMgr* rumbleMgr) {
#if OOT_DEBUG #if DEBUG_FEATURES
bzero(rumbleMgr, sizeof(RumbleMgr)); bzero(rumbleMgr, sizeof(RumbleMgr));
#endif #endif
} }

View file

@ -17,7 +17,7 @@
static CollisionPoly* sCurCeilingPoly; static CollisionPoly* sCurCeilingPoly;
static s32 sCurCeilingBgId; static s32 sCurCeilingBgId;
#if OOT_DEBUG #if DEBUG_FEATURES
#define ACTOR_DEBUG_PRINTF \ #define ACTOR_DEBUG_PRINTF \
if (R_ENABLE_ACTOR_DEBUG_PRINTF) \ if (R_ENABLE_ACTOR_DEBUG_PRINTF) \
PRINTF PRINTF
@ -917,7 +917,7 @@ void Actor_Destroy(Actor* actor, PlayState* play) {
actor->destroy(actor, play); actor->destroy(actor, play);
actor->destroy = NULL; actor->destroy = NULL;
} else { } else {
#if OOT_DEBUG #if DEBUG_FEATURES
overlayEntry = actor->overlayEntry; overlayEntry = actor->overlayEntry;
name = overlayEntry->name != NULL ? overlayEntry->name : ""; name = overlayEntry->name != NULL ? overlayEntry->name : "";
@ -1468,7 +1468,7 @@ Gfx* func_8002E830(Vec3f* object, Vec3f* eye, Vec3f* lightDir, GraphicsContext*
*hilite = GRAPH_ALLOC(gfxCtx, sizeof(Hilite)); *hilite = GRAPH_ALLOC(gfxCtx, sizeof(Hilite));
#if OOT_DEBUG #if DEBUG_FEATURES
if (R_HREG_MODE == HREG_MODE_PRINT_HILITE_INFO) { if (R_HREG_MODE == HREG_MODE_PRINT_HILITE_INFO) {
PRINTF("z_actor.c 3529 eye=[%f(%f) %f %f] object=[%f %f %f] light_direction=[%f %f %f]\n", correctedEyeX, PRINTF("z_actor.c 3529 eye=[%f(%f) %f %f] object=[%f %f %f] light_direction=[%f %f %f]\n", correctedEyeX,
eye->x, eye->y, eye->z, object->x, object->y, object->z, lightDir->x, lightDir->y, lightDir->z); eye->x, eye->y, eye->z, object->x, object->y, object->z, lightDir->x, lightDir->y, lightDir->z);
@ -2365,7 +2365,7 @@ void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx) {
actorCtx->unk_02--; actorCtx->unk_02--;
} }
#if OOT_DEBUG #if DEBUG_FEATURES
if (KREG(0) == -100) { if (KREG(0) == -100) {
Actor* player = &GET_PLAYER(play)->actor; Actor* player = &GET_PLAYER(play)->actor;
@ -2488,7 +2488,7 @@ void Actor_FaultPrint(Actor* actor, char* command) {
Fault_Printf("ACTOR NAME is NULL"); Fault_Printf("ACTOR NAME is NULL");
} }
#if OOT_DEBUG #if DEBUG_FEATURES
overlayEntry = actor->overlayEntry; overlayEntry = actor->overlayEntry;
name = overlayEntry->name != NULL ? overlayEntry->name : ""; name = overlayEntry->name != NULL ? overlayEntry->name : "";
@ -2741,22 +2741,22 @@ void func_800315AC(PlayState* play, ActorContext* actorCtx) {
gDPNoOpString(POLY_OPA_DISP++, actorName, i); gDPNoOpString(POLY_OPA_DISP++, actorName, i);
gDPNoOpString(POLY_XLU_DISP++, actorName, i); gDPNoOpString(POLY_XLU_DISP++, actorName, i);
if (OOT_DEBUG) { if (DEBUG_FEATURES) {
HREG(66) = i; HREG(66) = i;
} }
if (!OOT_DEBUG || (HREG(64) != 1) || ((HREG(65) != -1) && (HREG(65) != HREG(66))) || (HREG(68) == 0)) { if (!DEBUG_FEATURES || (HREG(64) != 1) || ((HREG(65) != -1) && (HREG(65) != HREG(66))) || (HREG(68) == 0)) {
SkinMatrix_Vec3fMtxFMultXYZW(&play->viewProjectionMtxF, &actor->world.pos, &actor->projectedPos, SkinMatrix_Vec3fMtxFMultXYZW(&play->viewProjectionMtxF, &actor->world.pos, &actor->projectedPos,
&actor->projectedW); &actor->projectedW);
} }
if (!OOT_DEBUG || (HREG(64) != 1) || ((HREG(65) != -1) && (HREG(65) != HREG(66))) || (HREG(69) == 0)) { if (!DEBUG_FEATURES || (HREG(64) != 1) || ((HREG(65) != -1) && (HREG(65) != HREG(66))) || (HREG(69) == 0)) {
if (actor->sfx != 0) { if (actor->sfx != 0) {
Actor_UpdateFlaggedAudio(actor); Actor_UpdateFlaggedAudio(actor);
} }
} }
if (!OOT_DEBUG || (HREG(64) != 1) || ((HREG(65) != -1) && (HREG(65) != HREG(66))) || (HREG(70) == 0)) { if (!DEBUG_FEATURES || (HREG(64) != 1) || ((HREG(65) != -1) && (HREG(65) != HREG(66))) || (HREG(70) == 0)) {
if (func_800314B0(play, actor)) { if (func_800314B0(play, actor)) {
actor->flags |= ACTOR_FLAG_6; actor->flags |= ACTOR_FLAG_6;
} else { } else {
@ -2766,7 +2766,7 @@ void func_800315AC(PlayState* play, ActorContext* actorCtx) {
actor->isDrawn = false; actor->isDrawn = false;
if (!OOT_DEBUG || (HREG(64) != 1) || ((HREG(65) != -1) && (HREG(65) != HREG(66))) || (HREG(71) == 0)) { if (!DEBUG_FEATURES || (HREG(64) != 1) || ((HREG(65) != -1) && (HREG(65) != HREG(66))) || (HREG(71) == 0)) {
if ((actor->init == NULL) && (actor->draw != NULL) && (actor->flags & (ACTOR_FLAG_5 | ACTOR_FLAG_6))) { if ((actor->init == NULL) && (actor->draw != NULL) && (actor->flags & (ACTOR_FLAG_5 | ACTOR_FLAG_6))) {
if ((actor->flags & ACTOR_FLAG_REACT_TO_LENS) && if ((actor->flags & ACTOR_FLAG_REACT_TO_LENS) &&
((play->roomCtx.curRoom.lensMode == LENS_MODE_SHOW_ACTORS) || play->actorCtx.lensActive || ((play->roomCtx.curRoom.lensMode == LENS_MODE_SHOW_ACTORS) || play->actorCtx.lensActive ||
@ -2776,7 +2776,7 @@ void func_800315AC(PlayState* play, ActorContext* actorCtx) {
invisibleActors[invisibleActorCounter] = actor; invisibleActors[invisibleActorCounter] = actor;
invisibleActorCounter++; invisibleActorCounter++;
} else { } else {
if (!OOT_DEBUG || (HREG(64) != 1) || ((HREG(65) != -1) && (HREG(65) != HREG(66))) || if (!DEBUG_FEATURES || (HREG(64) != 1) || ((HREG(65) != -1) && (HREG(65) != HREG(66))) ||
(HREG(72) == 0)) { (HREG(72) == 0)) {
Actor_Draw(play, actor); Actor_Draw(play, actor);
actor->isDrawn = true; actor->isDrawn = true;
@ -2789,15 +2789,15 @@ void func_800315AC(PlayState* play, ActorContext* actorCtx) {
} }
} }
if (!OOT_DEBUG || (HREG(64) != 1) || (HREG(73) != 0)) { if (!DEBUG_FEATURES || (HREG(64) != 1) || (HREG(73) != 0)) {
Effect_DrawAll(play->state.gfxCtx); Effect_DrawAll(play->state.gfxCtx);
} }
if (!OOT_DEBUG || (HREG(64) != 1) || (HREG(74) != 0)) { if (!DEBUG_FEATURES || (HREG(64) != 1) || (HREG(74) != 0)) {
EffectSs_DrawAll(play); EffectSs_DrawAll(play);
} }
if (!OOT_DEBUG || (HREG(64) != 1) || (HREG(72) != 0)) { if (!DEBUG_FEATURES || (HREG(64) != 1) || (HREG(72) != 0)) {
if (play->actorCtx.lensActive) { if (play->actorCtx.lensActive) {
Actor_DrawLensActors(play, invisibleActorCounter, invisibleActors); Actor_DrawLensActors(play, invisibleActorCounter, invisibleActors);
if ((play->csCtx.state != CS_STATE_IDLE) || Player_InCsMode(play)) { if ((play->csCtx.state != CS_STATE_IDLE) || Player_InCsMode(play)) {
@ -2812,11 +2812,11 @@ void func_800315AC(PlayState* play, ActorContext* actorCtx) {
Lights_DrawGlow(play); Lights_DrawGlow(play);
} }
if (!OOT_DEBUG || (HREG(64) != 1) || (HREG(75) != 0)) { if (!DEBUG_FEATURES || (HREG(64) != 1) || (HREG(75) != 0)) {
TitleCard_Draw(play, &actorCtx->titleCtx); TitleCard_Draw(play, &actorCtx->titleCtx);
} }
#if OOT_DEBUG #if DEBUG_FEATURES
if ((HREG(64) != 1) || (HREG(76) != 0)) { if ((HREG(64) != 1) || (HREG(76) != 0)) {
CollisionCheck_DrawCollision(play, &play->colChkCtx); CollisionCheck_DrawCollision(play, &play->colChkCtx);
} }
@ -3009,7 +3009,7 @@ Actor* Actor_Spawn(ActorContext* actorCtx, PlayState* play, s16 actorId, f32 pos
overlayEntry = &gActorOverlayTable[actorId]; overlayEntry = &gActorOverlayTable[actorId];
ASSERT(actorId < ACTOR_ID_MAX, "profile < ACTOR_DLF_MAX", "../z_actor.c", 6883); ASSERT(actorId < ACTOR_ID_MAX, "profile < ACTOR_DLF_MAX", "../z_actor.c", 6883);
#if OOT_DEBUG #if DEBUG_FEATURES
name = overlayEntry->name != NULL ? overlayEntry->name : ""; name = overlayEntry->name != NULL ? overlayEntry->name : "";
#endif #endif

View file

@ -24,7 +24,7 @@
#undef DEFINE_ACTOR_UNSET #undef DEFINE_ACTOR_UNSET
// Actor Overlay Table definition // Actor Overlay Table definition
#if OOT_DEBUG #if DEBUG_FEATURES
#define DEFINE_ACTOR(name, _1, allocType, nameString) \ #define DEFINE_ACTOR(name, _1, allocType, nameString) \
{ \ { \
@ -80,7 +80,7 @@ s32 gMaxActorId = 0;
static FaultClient sFaultClient; static FaultClient sFaultClient;
void ActorOverlayTable_LogPrint(void) { void ActorOverlayTable_LogPrint(void) {
#if OOT_DEBUG #if DEBUG_FEATURES
ActorOverlay* overlayEntry; ActorOverlay* overlayEntry;
u32 i; u32 i;
@ -137,7 +137,7 @@ void ActorOverlayTable_FaultPrint(void* arg0, void* arg1) {
Fault_Printf("\n"); Fault_Printf("\n");
#else #else
Fault_Printf("%3d %08x-%08x %3d %s\n", i, ramStart, ramEnd, overlayEntry->numLoaded, Fault_Printf("%3d %08x-%08x %3d %s\n", i, ramStart, ramEnd, overlayEntry->numLoaded,
(OOT_DEBUG && overlayEntry->name != NULL) ? overlayEntry->name : ""); (DEBUG_FEATURES && overlayEntry->name != NULL) ? overlayEntry->name : "");
#endif #endif
} }
} }

View file

@ -81,7 +81,7 @@ u16 sSurfaceMaterialToSfxOffset[SURFACE_MATERIAL_MAX] = {
SURFACE_SFX_OFFSET_CARPET, // SURFACE_MATERIAL_CARPET SURFACE_SFX_OFFSET_CARPET, // SURFACE_MATERIAL_CARPET
}; };
#if OOT_DEBUG #if DEBUG_FEATURES
/** /**
* original name: T_BGCheck_PosErrorCheck * original name: T_BGCheck_PosErrorCheck
*/ */
@ -1724,7 +1724,7 @@ f32 BgCheck_RaycastDownImpl(PlayState* play, CollisionContext* colCtx, u16 xpFla
break; break;
} }
#if OOT_DEBUG #if DEBUG_FEATURES
if (BgCheck_PosErrorCheck(&checkPos, "../z_bgcheck.c", 4410)) { if (BgCheck_PosErrorCheck(&checkPos, "../z_bgcheck.c", 4410)) {
if (actor != NULL) { if (actor != NULL) {
PRINTF(T("こいつ,pself_actor->name %d\n", "This guy, pself_actor->name %d\n"), actor->id); PRINTF(T("こいつ,pself_actor->name %d\n", "This guy, pself_actor->name %d\n"), actor->id);
@ -1976,7 +1976,7 @@ s32 BgCheck_CheckWallImpl(CollisionContext* colCtx, u16 xpFlags, Vec3f* posResul
dy = posNext->y - posPrev->y; dy = posNext->y - posPrev->y;
dz = posNext->z - posPrev->z; dz = posNext->z - posPrev->z;
#if OOT_DEBUG #if DEBUG_FEATURES
if (BgCheck_PosErrorCheck(posNext, "../z_bgcheck.c", 4831) == true || if (BgCheck_PosErrorCheck(posNext, "../z_bgcheck.c", 4831) == true ||
BgCheck_PosErrorCheck(posPrev, "../z_bgcheck.c", 4832) == true) { BgCheck_PosErrorCheck(posPrev, "../z_bgcheck.c", 4832) == true) {
if (actor != NULL) { if (actor != NULL) {
@ -2170,7 +2170,7 @@ s32 BgCheck_CheckCeilingImpl(CollisionContext* colCtx, u16 xpFlags, f32* outY, V
*outBgId = BGCHECK_SCENE; *outBgId = BGCHECK_SCENE;
*outY = pos->y; *outY = pos->y;
#if OOT_DEBUG #if DEBUG_FEATURES
if (BgCheck_PosErrorCheck(pos, "../z_bgcheck.c", 5206) == true) { if (BgCheck_PosErrorCheck(pos, "../z_bgcheck.c", 5206) == true) {
if (actor != NULL) { if (actor != NULL) {
PRINTF(T("こいつ,pself_actor->name %d\n", "This guy, pself_actor->name %d\n"), actor->id); PRINTF(T("こいつ,pself_actor->name %d\n", "This guy, pself_actor->name %d\n"), actor->id);
@ -2243,7 +2243,7 @@ s32 BgCheck_CheckLineImpl(CollisionContext* colCtx, u16 xpFlags1, u16 xpFlags2,
*outBgId = BGCHECK_SCENE; *outBgId = BGCHECK_SCENE;
#if OOT_DEBUG #if DEBUG_FEATURES
if (BgCheck_PosErrorCheck(posA, "../z_bgcheck.c", 5334) == true || if (BgCheck_PosErrorCheck(posA, "../z_bgcheck.c", 5334) == true ||
BgCheck_PosErrorCheck(posB, "../z_bgcheck.c", 5335) == true) { BgCheck_PosErrorCheck(posB, "../z_bgcheck.c", 5335) == true) {
if (actor != NULL) { if (actor != NULL) {
@ -2466,7 +2466,7 @@ s32 BgCheck_SphVsFirstPolyImpl(CollisionContext* colCtx, u16 xpFlags, CollisionP
*outBgId = BGCHECK_SCENE; *outBgId = BGCHECK_SCENE;
#if OOT_DEBUG #if DEBUG_FEATURES
if (BgCheck_PosErrorCheck(center, "../z_bgcheck.c", 5852) == true) { if (BgCheck_PosErrorCheck(center, "../z_bgcheck.c", 5852) == true) {
if (actor != NULL) { if (actor != NULL) {
PRINTF(T("こいつ,pself_actor->name %d\n", "This guy, pself_actor->name %d\n"), actor->id); PRINTF(T("こいつ,pself_actor->name %d\n", "This guy, pself_actor->name %d\n"), actor->id);
@ -2810,7 +2810,7 @@ void DynaPoly_DeleteBgActor(PlayState* play, DynaCollisionContext* dyna, s32 bgI
PRINTF(VT_RST); PRINTF(VT_RST);
if (!DynaPoly_IsBgIdBgActor(bgId)) { if (!DynaPoly_IsBgIdBgActor(bgId)) {
#if OOT_DEBUG #if DEBUG_FEATURES
if (bgId == -1) { if (bgId == -1) {
PRINTF(VT_FGCOL(GREEN)); PRINTF(VT_FGCOL(GREEN));
PRINTF(T("DynaPolyInfo_delReserve():削除されているはずの(?)\n" PRINTF(T("DynaPolyInfo_delReserve():削除されているはずの(?)\n"
@ -2882,7 +2882,7 @@ void DynaPoly_AddBgActorToLookup(PlayState* play, DynaCollisionContext* dyna, s3
return; return;
} }
#if OOT_DEBUG #if DEBUG_FEATURES
if (!(dyna->polyListMax >= *polyStartIndex + pbgdata->numPolygons)) { if (!(dyna->polyListMax >= *polyStartIndex + pbgdata->numPolygons)) {
PRINTF(VT_FGCOL(RED)); PRINTF(VT_FGCOL(RED));
PRINTF(T("DynaPolyInfo_expandSRT():polygon over %dが%dを越えるとダメ\n", PRINTF(T("DynaPolyInfo_expandSRT():polygon over %dが%dを越えるとダメ\n",
@ -4447,7 +4447,7 @@ s32 func_800427B4(CollisionPoly* polyA, CollisionPoly* polyB, Vec3f* pointA, Vec
return result; return result;
} }
#if OOT_DEBUG #if DEBUG_FEATURES
/** /**
* Draw a list of dyna polys, specified by `ssList` * Draw a list of dyna polys, specified by `ssList`
*/ */

View file

@ -17,11 +17,11 @@ s32 Camera_UpdateWater(Camera* camera);
#define CAMERA_CHECK_BTN(input, btn) CHECK_BTN_ALL((input)->press.button, (btn)) #define CAMERA_CHECK_BTN(input, btn) CHECK_BTN_ALL((input)->press.button, (btn))
#endif #endif
#if OOT_DEBUG #if DEBUG_FEATURES
s32 Camera_QRegInit(void); s32 Camera_QRegInit(void);
#endif #endif
#if OOT_DEBUG #if DEBUG_FEATURES
#define CAM_DEBUG_RELOAD_PREG(camera) \ #define CAM_DEBUG_RELOAD_PREG(camera) \
if (R_RELOAD_CAM_PARAMS) { \ if (R_RELOAD_CAM_PARAMS) { \
Camera_CopyPREGToModeValues(camera); \ Camera_CopyPREGToModeValues(camera); \
@ -35,7 +35,7 @@ s32 Camera_QRegInit(void);
// CameraModeValue arrays. Although sometimes some read-write data is reset as well // CameraModeValue arrays. Although sometimes some read-write data is reset as well
#define RELOAD_PARAMS(camera) (camera->animState == 0 || camera->animState == 10 || camera->animState == 20) #define RELOAD_PARAMS(camera) (camera->animState == 0 || camera->animState == 10 || camera->animState == 20)
#if OOT_DEBUG #if DEBUG_FEATURES
#define CAM_DEBUG_RELOAD_PARAMS R_RELOAD_CAM_PARAMS #define CAM_DEBUG_RELOAD_PARAMS R_RELOAD_CAM_PARAMS
#else #else
#define CAM_DEBUG_RELOAD_PARAMS true #define CAM_DEBUG_RELOAD_PARAMS true
@ -53,7 +53,7 @@ s32 Camera_QRegInit(void);
// Load the next value and scale down from camera read-only data stored in CameraModeValue // Load the next value and scale down from camera read-only data stored in CameraModeValue
#define GET_NEXT_SCALED_RO_DATA(values) CAM_DATA_SCALED(GET_NEXT_RO_DATA(values)) #define GET_NEXT_SCALED_RO_DATA(values) CAM_DATA_SCALED(GET_NEXT_RO_DATA(values))
#if OOT_DEBUG #if DEBUG_FEATURES
#define CAM_GLOBAL_0 OREG(0) #define CAM_GLOBAL_0 OREG(0)
#define CAM_GLOBAL_1 OREG(1) #define CAM_GLOBAL_1 OREG(1)
@ -583,7 +583,7 @@ f32 Camera_GetFloorYLayer(Camera* camera, Vec3f* norm, Vec3f* pos, s32* bgId) {
} }
} }
#if OOT_DEBUG #if DEBUG_FEATURES
if (i == 0) { if (i == 0) {
PRINTF(VT_COL(YELLOW, BLACK) "camera: foward check: too many layer!\n" VT_RST); PRINTF(VT_COL(YELLOW, BLACK) "camera: foward check: too many layer!\n" VT_RST);
} }
@ -868,7 +868,7 @@ void Camera_CopyDataToRegs(Camera* camera, s16 mode) {
CameraModeValue* valueP; CameraModeValue* valueP;
s32 i; s32 i;
#if OOT_DEBUG #if DEBUG_FEATURES
if (PREG(82)) { if (PREG(82)) {
PRINTF("camera: res: stat (%d/%d/%d)\n", camera->camId, camera->setting, mode); PRINTF("camera: res: stat (%d/%d/%d)\n", camera->camId, camera->setting, mode);
} }
@ -887,7 +887,7 @@ void Camera_CopyDataToRegs(Camera* camera, s16 mode) {
camera->animState = 0; camera->animState = 0;
} }
#if OOT_DEBUG #if DEBUG_FEATURES
s32 Camera_CopyPREGToModeValues(Camera* camera) { s32 Camera_CopyPREGToModeValues(Camera* camera) {
CameraModeValue* values = sCameraSettings[camera->setting].cameraModes[camera->mode].values; CameraModeValue* values = sCameraSettings[camera->setting].cameraModes[camera->mode].values;
CameraModeValue* valueP; CameraModeValue* valueP;
@ -950,7 +950,7 @@ Vec3f Camera_BGCheckCorner(Vec3f* linePointA, Vec3f* linePointB, CamColChk* poin
bool result; bool result;
result = func_800427B4(pointAColChk->poly, pointBColChk->poly, linePointA, linePointB, &closestPoint); result = func_800427B4(pointAColChk->poly, pointBColChk->poly, linePointA, linePointB, &closestPoint);
#if OOT_DEBUG #if DEBUG_FEATURES
if (!result) { if (!result) {
PRINTF(VT_COL(YELLOW, BLACK) "camera: corner check no cross point %x %x\n" VT_RST, pointAColChk, pointBColChk); PRINTF(VT_COL(YELLOW, BLACK) "camera: corner check no cross point %x %x\n" VT_RST, pointAColChk, pointBColChk);
return pointAColChk->pos; return pointAColChk->pos;
@ -2725,7 +2725,7 @@ s32 Camera_Jump3(Camera* camera) {
roData->interfaceField = GET_NEXT_RO_DATA(values); roData->interfaceField = GET_NEXT_RO_DATA(values);
} }
#if OOT_DEBUG #if DEBUG_FEATURES
if (R_RELOAD_CAM_PARAMS) { if (R_RELOAD_CAM_PARAMS) {
prevMode = camera->mode; prevMode = camera->mode;
camera->mode = rwData->mode; camera->mode = rwData->mode;
@ -2982,7 +2982,7 @@ s32 Camera_Battle1(Camera* camera) {
rwData->target = camera->target; rwData->target = camera->target;
camera->animState++; camera->animState++;
#if OOT_DEBUG #if DEBUG_FEATURES
if (rwData->target->id > 0) { if (rwData->target->id > 0) {
PRINTF("camera: battle: target actor name " VT_FGCOL(BLUE) "%d" VT_RST "\n", rwData->target->id); PRINTF("camera: battle: target actor name " VT_FGCOL(BLUE) "%d" VT_RST "\n", rwData->target->id);
} else { } else {
@ -3890,7 +3890,7 @@ s32 Camera_KeepOn4(Camera* camera) {
spB8.pitch = D_8011D3CC[i] + spA2; spB8.pitch = D_8011D3CC[i] + spA2;
D_8015BD70 = Camera_AddVecGeoToVec3f(&D_8015BD50, &spB8); D_8015BD70 = Camera_AddVecGeoToVec3f(&D_8015BD50, &spB8);
} }
#if OOT_DEBUG #if DEBUG_FEATURES
PRINTF("camera: item: BG&collision check %d time(s)\n", i); PRINTF("camera: item: BG&collision check %d time(s)\n", i);
#endif #endif
} }
@ -4372,7 +4372,7 @@ s32 Camera_Subj3(Camera* camera) {
func_80043ABC(camera); func_80043ABC(camera);
#if OOT_DEBUG #if DEBUG_FEATURES
Camera_CopyPREGToModeValues(camera); Camera_CopyPREGToModeValues(camera);
#endif #endif
@ -5744,7 +5744,7 @@ s32 Camera_Unique9(Camera* camera) {
return true; return true;
} }
#if OOT_DEBUG #if DEBUG_FEATURES
void Camera_DebugPrintSplineArray(char* name, s16 length, CutsceneCameraPoint cameraPoints[]) { void Camera_DebugPrintSplineArray(char* name, s16 length, CutsceneCameraPoint cameraPoints[]) {
s32 i; s32 i;
@ -5825,7 +5825,7 @@ s32 Camera_Demo1(Camera* camera) {
PRINTF(VT_SGR("1") "%06u:" VT_RST " camera: spline demo: start %s \n", camera->play->state.frames, PRINTF(VT_SGR("1") "%06u:" VT_RST " camera: spline demo: start %s \n", camera->play->state.frames,
*relativeToPlayer == 0 ? T("絶対", "absolute") : T("相対", "relative")); *relativeToPlayer == 0 ? T("絶対", "absolute") : T("相対", "relative"));
#if OOT_DEBUG #if DEBUG_FEATURES
if (PREG(93)) { if (PREG(93)) {
Camera_DebugPrintSplineArray("CENTER", 5, csAtPoints); Camera_DebugPrintSplineArray("CENTER", 5, csAtPoints);
Camera_DebugPrintSplineArray(" EYE", 5, csEyePoints); Camera_DebugPrintSplineArray(" EYE", 5, csEyePoints);
@ -5846,7 +5846,7 @@ s32 Camera_Demo1(Camera* camera) {
Camera_RotateAroundPoint(&curPlayerPosRot, &csEyeUpdate, eyeNext); Camera_RotateAroundPoint(&curPlayerPosRot, &csEyeUpdate, eyeNext);
Camera_RotateAroundPoint(&curPlayerPosRot, &csAtUpdate, at); Camera_RotateAroundPoint(&curPlayerPosRot, &csAtUpdate, at);
} }
#if OOT_DEBUG #if DEBUG_FEATURES
else { else {
PRINTF(VT_COL(RED, WHITE) "camera: spline demo: owner dead\n" VT_RST); PRINTF(VT_COL(RED, WHITE) "camera: spline demo: owner dead\n" VT_RST);
} }
@ -7458,7 +7458,7 @@ void Camera_Init(Camera* camera, View* view, CollisionContext* colCtx, PlayState
if (sInitRegs) { if (sInitRegs) {
s32 i; s32 i;
#if OOT_DEBUG #if DEBUG_FEATURES
for (i = 0; i < sOREGInitCnt; i++) { for (i = 0; i < sOREGInitCnt; i++) {
OREG(i) = sOREGInit[i]; OREG(i) = sOREGInit[i];
} }
@ -7473,7 +7473,7 @@ void Camera_Init(Camera* camera, View* view, CollisionContext* colCtx, PlayState
PREG(88) = -1; PREG(88) = -1;
} }
camera->play = D_8015BD7C = play; camera->play = D_8015BD7C = play;
#if OOT_DEBUG #if DEBUG_FEATURES
DebugCamera_Init(&D_8015BD80, camera); DebugCamera_Init(&D_8015BD80, camera);
#endif #endif
curUID = sNextUID; curUID = sNextUID;
@ -7528,7 +7528,7 @@ void Camera_Init(Camera* camera, View* view, CollisionContext* colCtx, PlayState
camera->quakeOffset.z = 0; camera->quakeOffset.z = 0;
camera->atLERPStepScale = 1; camera->atLERPStepScale = 1;
sCameraInterfaceField = CAM_INTERFACE_FIELD(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, 0); sCameraInterfaceField = CAM_INTERFACE_FIELD(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, 0);
#if OOT_DEBUG #if DEBUG_FEATURES
sDbgModeIdx = -1; sDbgModeIdx = -1;
#endif #endif
D_8011D3F0 = 3; D_8011D3F0 = 3;
@ -7630,7 +7630,7 @@ void Camera_InitDataUsingPlayer(Camera* camera, Player* player) {
camera->nextBgCamIndex = -1; camera->nextBgCamIndex = -1;
camera->atLERPStepScale = 1.0f; camera->atLERPStepScale = 1.0f;
Camera_CopyDataToRegs(camera, camera->mode); Camera_CopyDataToRegs(camera, camera->mode);
#if OOT_DEBUG #if DEBUG_FEATURES
Camera_QRegInit(); Camera_QRegInit();
#endif #endif
PRINTF(VT_FGCOL(BLUE) "camera: personalize ---" VT_RST "\n"); PRINTF(VT_FGCOL(BLUE) "camera: personalize ---" VT_RST "\n");
@ -7645,7 +7645,7 @@ s16 Camera_ChangeStatus(Camera* camera, s16 status) {
CameraModeValue* valueP; CameraModeValue* valueP;
s32 i; s32 i;
#if OOT_DEBUG #if DEBUG_FEATURES
if (PREG(82)) { if (PREG(82)) {
PRINTF("camera: change camera status: cond %c%c\n", status == CAM_STAT_ACTIVE ? 'o' : 'x', PRINTF("camera: change camera status: cond %c%c\n", status == CAM_STAT_ACTIVE ? 'o' : 'x',
camera->status != CAM_STAT_ACTIVE ? 'o' : 'x'); camera->status != CAM_STAT_ACTIVE ? 'o' : 'x');
@ -7671,7 +7671,7 @@ s16 Camera_ChangeStatus(Camera* camera, s16 status) {
return camera->status; return camera->status;
} }
#if OOT_DEBUG #if DEBUG_FEATURES
void Camera_PrintSettings(Camera* camera) { void Camera_PrintSettings(Camera* camera) {
char sp58[8]; char sp58[8];
char sp50[8]; char sp50[8];
@ -7888,7 +7888,7 @@ s32 Camera_UpdateHotRoom(Camera* camera) {
return 1; return 1;
} }
#if OOT_DEBUG #if DEBUG_FEATURES
s32 Camera_DbgChangeMode(Camera* camera) { s32 Camera_DbgChangeMode(Camera* camera) {
static s16 D_8011DAFC[] = { static s16 D_8011DAFC[] = {
CAM_SET_NORMAL0, CAM_SET_NORMAL1, CAM_SET_NORMAL2, CAM_SET_DUNGEON0, CAM_SET_DUNGEON1, CAM_SET_DUNGEON2, CAM_SET_NORMAL0, CAM_SET_NORMAL1, CAM_SET_NORMAL2, CAM_SET_DUNGEON0, CAM_SET_DUNGEON1, CAM_SET_DUNGEON2,
@ -8007,7 +8007,7 @@ void Camera_UpdateDistortion(Camera* camera) {
} }
} }
#if OOT_DEBUG #if DEBUG_FEATURES
#define ENABLE_DEBUG_CAM_UPDATE R_DEBUG_CAM_UPDATE #define ENABLE_DEBUG_CAM_UPDATE R_DEBUG_CAM_UPDATE
#else #else
#define ENABLE_DEBUG_CAM_UPDATE false #define ENABLE_DEBUG_CAM_UPDATE false
@ -8108,7 +8108,7 @@ Vec3s Camera_Update(Camera* camera) {
} }
} }
#if OOT_DEBUG #if DEBUG_FEATURES
Camera_PrintSettings(camera); Camera_PrintSettings(camera);
Camera_DbgChangeMode(camera); Camera_DbgChangeMode(camera);
#endif #endif
@ -8168,7 +8168,7 @@ Vec3s Camera_Update(Camera* camera) {
sCameraSettings[camera->setting].cameraModes[camera->mode].funcIdx); sCameraSettings[camera->setting].cameraModes[camera->mode].funcIdx);
} }
#if OOT_DEBUG #if DEBUG_FEATURES
// enable/disable debug cam // enable/disable debug cam
if (CAMERA_CHECK_BTN(&D_8015BD7C->state.input[2], BTN_START)) { if (CAMERA_CHECK_BTN(&D_8015BD7C->state.input[2], BTN_START)) {
gDebugCamEnabled ^= 1; gDebugCamEnabled ^= 1;
@ -8257,7 +8257,7 @@ Vec3s Camera_Update(Camera* camera) {
CAM_BINANG_TO_DEG(camera->camDir.x), camera->camDir.y, CAM_BINANG_TO_DEG(camera->camDir.y)); CAM_BINANG_TO_DEG(camera->camDir.x), camera->camDir.y, CAM_BINANG_TO_DEG(camera->camDir.y));
} }
#if OOT_DEBUG #if DEBUG_FEATURES
if (camera->timer != -1 && CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_DRIGHT)) { if (camera->timer != -1 && CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_DRIGHT)) {
camera->timer = 0; camera->timer = 0;
} }
@ -8591,7 +8591,7 @@ s32 Camera_RequestBgCam(Camera* camera, s32 requestedBgCamIndex) {
if (!(camera->behaviorFlags & CAM_BEHAVIOR_BG_PROCESSED)) { if (!(camera->behaviorFlags & CAM_BEHAVIOR_BG_PROCESSED)) {
requestedCamSetting = Camera_GetBgCamSetting(camera, requestedBgCamIndex); requestedCamSetting = Camera_GetBgCamSetting(camera, requestedBgCamIndex);
camera->behaviorFlags |= CAM_BEHAVIOR_BG_PROCESSED; camera->behaviorFlags |= CAM_BEHAVIOR_BG_PROCESSED;
#if OOT_DEBUG #if DEBUG_FEATURES
settingChangeSuccessful = Camera_RequestSettingImpl(camera, requestedCamSetting, settingChangeSuccessful = Camera_RequestSettingImpl(camera, requestedCamSetting,
CAM_REQUEST_SETTING_PRESERVE_BG_CAM_INDEX | CAM_REQUEST_SETTING_PRESERVE_BG_CAM_INDEX |
CAM_REQUEST_SETTING_FORCE_CHANGE) >= 0; CAM_REQUEST_SETTING_FORCE_CHANGE) >= 0;
@ -8622,7 +8622,7 @@ s32 Camera_RequestBgCam(Camera* camera, s32 requestedBgCamIndex) {
} }
Vec3s Camera_GetInputDir(Camera* camera) { Vec3s Camera_GetInputDir(Camera* camera) {
#if OOT_DEBUG #if DEBUG_FEATURES
if (gDebugCamEnabled) { if (gDebugCamEnabled) {
return D_8015BD80.sub.unk_104A; return D_8015BD80.sub.unk_104A;
} }
@ -8644,7 +8644,7 @@ s16 Camera_GetInputDirYaw(Camera* camera) {
} }
Vec3s Camera_GetCamDir(Camera* camera) { Vec3s Camera_GetCamDir(Camera* camera) {
#if OOT_DEBUG #if DEBUG_FEATURES
if (gDebugCamEnabled) { if (gDebugCamEnabled) {
return D_8015BD80.sub.unk_104A; return D_8015BD80.sub.unk_104A;
} }
@ -8841,7 +8841,7 @@ s32 Camera_Copy(Camera* dstCamera, Camera* srcCamera) {
} }
s32 Camera_IsDebugCamEnabled(void) { s32 Camera_IsDebugCamEnabled(void) {
#if OOT_DEBUG #if DEBUG_FEATURES
return gDebugCamEnabled; return gDebugCamEnabled;
#else #else
return false; return false;
@ -8875,7 +8875,7 @@ void Camera_SetCameraData(Camera* camera, s16 setDataFlags, void* data0, void* d
} }
} }
#if OOT_DEBUG #if DEBUG_FEATURES
s32 Camera_QRegInit(void) { s32 Camera_QRegInit(void) {
if (!R_RELOAD_CAM_PARAMS) { if (!R_RELOAD_CAM_PARAMS) {
QREG(2) = 1; QREG(2) = 1;

View file

@ -27,7 +27,7 @@ typedef struct CameraSetting {
/*==================================================================*/ /*==================================================================*/
// Data // Data
#if OOT_DEBUG #if DEBUG_FEATURES
s16 sOREGInit[] = { s16 sOREGInit[] = {
0, // OREG(0) 0, // OREG(0)
1, // OREG(1) 1, // OREG(1)
@ -119,7 +119,7 @@ s16 sCamDataRegsInit[CAM_DATA_MAX] = {
s16 sCamDataRegsInitCount = ARRAY_COUNT(sCamDataRegsInit); s16 sCamDataRegsInitCount = ARRAY_COUNT(sCamDataRegsInit);
#if OOT_DEBUG #if DEBUG_FEATURES
char sCameraSettingNames[][12] = { char sCameraSettingNames[][12] = {
"NONE ", // CAM_SET_NONE "NONE ", // CAM_SET_NONE
"NORMAL0 ", // CAM_SET_NORMAL0 "NORMAL0 ", // CAM_SET_NORMAL0
@ -2562,7 +2562,7 @@ s32 sInitRegs = 1;
s32 gDebugCamEnabled = false; s32 gDebugCamEnabled = false;
#if OOT_DEBUG #if DEBUG_FEATURES
s32 sDbgModeIdx = -1; s32 sDbgModeIdx = -1;
#endif #endif
@ -2588,7 +2588,7 @@ s32 D_8011D3F0 = 0;
s32 sDemo5PrevAction12Frame = -16; s32 sDemo5PrevAction12Frame = -16;
#if OOT_DEBUG #if DEBUG_FEATURES
char sCameraFunctionNames[][8] = { char sCameraFunctionNames[][8] = {
"NONE ", // CAM_FUNC_NONE "NONE ", // CAM_FUNC_NONE
"NORM0()", // CAM_FUNC_NORM0 "NORM0()", // CAM_FUNC_NORM0
@ -2681,7 +2681,7 @@ Vec3f D_8011D678[] = {
PlayState* D_8015BD7C; PlayState* D_8015BD7C;
#if OOT_DEBUG #if DEBUG_FEATURES
DebugCam D_8015BD80; DebugCam D_8015BD80;
#endif #endif

View file

@ -25,7 +25,7 @@ typedef s32 (*ColChkLineFunc)(PlayState*, CollisionCheckContext*, Collider*, Vec
#define SAC_ENABLE (1 << 0) #define SAC_ENABLE (1 << 0)
#if OOT_DEBUG #if DEBUG_FEATURES
/** /**
* Draws a red triangle with vertices vA, vB, and vC. * Draws a red triangle with vertices vA, vB, and vC.
*/ */
@ -1028,7 +1028,7 @@ void CollisionCheck_InitContext(PlayState* play, CollisionCheckContext* colChkCt
colChkCtx->sacFlags = 0; colChkCtx->sacFlags = 0;
CollisionCheck_ClearContext(play, colChkCtx); CollisionCheck_ClearContext(play, colChkCtx);
#if OOT_DEBUG #if DEBUG_FEATURES
AREG(21) = true; AREG(21) = true;
AREG(22) = true; AREG(22) = true;
AREG(23) = true; AREG(23) = true;
@ -1082,7 +1082,7 @@ void CollisionCheck_DisableSAC(PlayState* play, CollisionCheckContext* colChkCtx
colChkCtx->sacFlags &= ~SAC_ENABLE; colChkCtx->sacFlags &= ~SAC_ENABLE;
} }
#if OOT_DEBUG #if DEBUG_FEATURES
/** /**
* Draws a collider of any shape. * Draws a collider of any shape.
* Math3D_DrawSphere and Math3D_DrawCylinder are noops, so JntSph and Cylinder are not drawn. * Math3D_DrawSphere and Math3D_DrawCylinder are noops, so JntSph and Cylinder are not drawn.
@ -2339,7 +2339,7 @@ void CollisionCheck_ATQuadVsACCyl(PlayState* play, CollisionCheckContext* colChk
} }
} }
#if OOT_DEBUG #if DEBUG_FEATURES
static s8 sBssDummy3; static s8 sBssDummy3;
static s8 sBssDummy4; static s8 sBssDummy4;
#endif #endif
@ -3351,7 +3351,7 @@ void Collider_SetTrisDim(PlayState* play, ColliderTris* tris, s32 elemIndex, Col
Collider_SetTrisElementDim(play, &trisElem->dim, src); Collider_SetTrisElementDim(play, &trisElem->dim, src);
} }
#if OOT_DEBUG #if DEBUG_FEATURES
// The two static Vec3f variables in the function below cross a block index rollover, causing a bss order swap. // The two static Vec3f variables in the function below cross a block index rollover, causing a bss order swap.
//! In order to replicate this behavior, we declare a certain amount of sBssDummy variables throughout the file, which //! In order to replicate this behavior, we declare a certain amount of sBssDummy variables throughout the file, which
//! we fit inside padding added by the compiler between structs like TriNorm and/or Vec3f, so they don't take space in //! we fit inside padding added by the compiler between structs like TriNorm and/or Vec3f, so they don't take space in
@ -3734,7 +3734,7 @@ u8 CollisionCheck_GetSwordDamage(s32 dmgFlags) {
damage = 8; damage = 8;
} }
#if OOT_DEBUG #if DEBUG_FEATURES
KREG(7) = damage; KREG(7) = damage;
#endif #endif

View file

@ -32,7 +32,7 @@ Color_RGBA8 sDebugCamTextColors[] = {
{ 128, 255, 32, 128 }, // DEBUG_CAM_TEXT_GREEN { 128, 255, 32, 128 }, // DEBUG_CAM_TEXT_GREEN
}; };
#if OOT_DEBUG #if DEBUG_FEATURES
InputCombo sRegGroupInputCombos[REG_GROUPS] = { InputCombo sRegGroupInputCombos[REG_GROUPS] = {
{ BTN_L, BTN_CUP }, // REG { BTN_L, BTN_CUP }, // REG
{ BTN_L, BTN_CLEFT }, // SREG { BTN_L, BTN_CLEFT }, // SREG
@ -158,7 +158,7 @@ void DebugCamera_DrawScreenText(GfxPrint* printer) {
} }
} }
#if OOT_DEBUG #if DEBUG_FEATURES
/** /**
* Updates the state of the Reg Editor according to user input. * Updates the state of the Reg Editor according to user input.
* Also contains a controller rumble test that can be interfaced with via related REGs. * Also contains a controller rumble test that can be interfaced with via related REGs.
@ -298,7 +298,7 @@ void Debug_DrawText(GraphicsContext* gfxCtx) {
DebugCamera_DrawScreenText(&printer); DebugCamera_DrawScreenText(&printer);
} }
#if OOT_DEBUG #if DEBUG_FEATURES
if (gRegEditor->regPage != 0) { if (gRegEditor->regPage != 0) {
Regs_DrawEditor(&printer); Regs_DrawEditor(&printer);
} }

View file

@ -138,7 +138,7 @@ s16 sQuakeIndex;
void Cutscene_SetupScripted(PlayState* play, CutsceneContext* csCtx); void Cutscene_SetupScripted(PlayState* play, CutsceneContext* csCtx);
#if OOT_DEBUG #if DEBUG_FEATURES
void Cutscene_DrawDebugInfo(PlayState* play, Gfx** dlist, CutsceneContext* csCtx) { void Cutscene_DrawDebugInfo(PlayState* play, Gfx** dlist, CutsceneContext* csCtx) {
GfxPrint printer; GfxPrint printer;
s32 pad[2]; s32 pad[2];
@ -183,7 +183,7 @@ void Cutscene_UpdateManual(PlayState* play, CutsceneContext* csCtx) {
} }
void Cutscene_UpdateScripted(PlayState* play, CutsceneContext* csCtx) { void Cutscene_UpdateScripted(PlayState* play, CutsceneContext* csCtx) {
#if OOT_DEBUG #if DEBUG_FEATURES
{ {
Input* input = &play->state.input[0]; Input* input = &play->state.input[0];
@ -576,7 +576,7 @@ void CutsceneCmd_Destination(PlayState* play, CutsceneContext* csCtx, CsCmdDesti
} }
if ((csCtx->curFrame == cmd->startFrame) || titleDemoSkipped || if ((csCtx->curFrame == cmd->startFrame) || titleDemoSkipped ||
(OOT_DEBUG && (csCtx->curFrame > 20) && CHECK_BTN_ALL(play->state.input[0].press.button, BTN_START) && (DEBUG_FEATURES && (csCtx->curFrame > 20) && CHECK_BTN_ALL(play->state.input[0].press.button, BTN_START) &&
(gSaveContext.fileNum != 0xFEDC))) { (gSaveContext.fileNum != 0xFEDC))) {
csCtx->state = CS_STATE_RUN_UNSTOPPABLE; csCtx->state = CS_STATE_RUN_UNSTOPPABLE;
Audio_SetCutsceneFlag(0); Audio_SetCutsceneFlag(0);
@ -731,7 +731,7 @@ void CutsceneCmd_Destination(PlayState* play, CutsceneContext* csCtx, CsCmdDesti
break; break;
case CS_DEST_TEMPLE_OF_TIME_AFTER_LIGHT_MEDALLION: case CS_DEST_TEMPLE_OF_TIME_AFTER_LIGHT_MEDALLION:
#if OOT_DEBUG #if DEBUG_FEATURES
SET_EVENTCHKINF(EVENTCHKINF_WATCHED_SHEIK_AFTER_MASTER_SWORD_CS); SET_EVENTCHKINF(EVENTCHKINF_WATCHED_SHEIK_AFTER_MASTER_SWORD_CS);
#endif #endif
play->nextEntranceIndex = ENTR_TEMPLE_OF_TIME_4; play->nextEntranceIndex = ENTR_TEMPLE_OF_TIME_4;
@ -902,7 +902,7 @@ void CutsceneCmd_Destination(PlayState* play, CutsceneContext* csCtx, CsCmdDesti
break; break;
case CS_DEST_TEMPLE_OF_TIME_AFTER_LIGHT_MEDALLION_ALT: case CS_DEST_TEMPLE_OF_TIME_AFTER_LIGHT_MEDALLION_ALT:
#if OOT_DEBUG #if DEBUG_FEATURES
SET_EVENTCHKINF(EVENTCHKINF_WATCHED_SHEIK_AFTER_MASTER_SWORD_CS); SET_EVENTCHKINF(EVENTCHKINF_WATCHED_SHEIK_AFTER_MASTER_SWORD_CS);
#endif #endif
play->nextEntranceIndex = ENTR_TEMPLE_OF_TIME_4; play->nextEntranceIndex = ENTR_TEMPLE_OF_TIME_4;
@ -959,7 +959,7 @@ void CutsceneCmd_Destination(PlayState* play, CutsceneContext* csCtx, CsCmdDesti
break; break;
case CS_DEST_GERUDO_VALLEY_CREDITS: case CS_DEST_GERUDO_VALLEY_CREDITS:
#if OOT_DEBUG #if DEBUG_FEATURES
gSaveContext.gameMode = GAMEMODE_END_CREDITS; gSaveContext.gameMode = GAMEMODE_END_CREDITS;
Audio_SetSfxBanksMute(0x6F); Audio_SetSfxBanksMute(0x6F);
#endif #endif
@ -1802,7 +1802,7 @@ void Cutscene_ProcessScript(PlayState* play, CutsceneContext* csCtx, u8* script)
return; return;
} }
#if OOT_DEBUG #if DEBUG_FEATURES
if (CHECK_BTN_ALL(play->state.input[0].press.button, BTN_DRIGHT)) { if (CHECK_BTN_ALL(play->state.input[0].press.button, BTN_DRIGHT)) {
csCtx->state = CS_STATE_STOP; csCtx->state = CS_STATE_STOP;
return; return;
@ -2215,7 +2215,7 @@ void Cutscene_ProcessScript(PlayState* play, CutsceneContext* csCtx, u8* script)
void CutsceneHandler_RunScript(PlayState* play, CutsceneContext* csCtx) { void CutsceneHandler_RunScript(PlayState* play, CutsceneContext* csCtx) {
if (gSaveContext.save.cutsceneIndex >= 0xFFF0) { if (gSaveContext.save.cutsceneIndex >= 0xFFF0) {
#if OOT_DEBUG #if DEBUG_FEATURES
if (BREG(0) != 0) { if (BREG(0) != 0) {
Gfx* displayList; Gfx* displayList;
Gfx* prevDisplayList; Gfx* prevDisplayList;
@ -2236,7 +2236,7 @@ void CutsceneHandler_RunScript(PlayState* play, CutsceneContext* csCtx) {
csCtx->curFrame++; csCtx->curFrame++;
#if OOT_DEBUG #if DEBUG_FEATURES
if (R_USE_DEBUG_CUTSCENE) { if (R_USE_DEBUG_CUTSCENE) {
Cutscene_ProcessScript(play, csCtx, gDebugCutsceneScript); Cutscene_ProcessScript(play, csCtx, gDebugCutsceneScript);
} else { } else {

View file

@ -10,7 +10,7 @@ void EffectSs_InitInfo(PlayState* play, s32 tableSize) {
EffectSs* effectSs; EffectSs* effectSs;
EffectSsOverlay* overlay; EffectSsOverlay* overlay;
#if OOT_DEBUG #if DEBUG_FEATURES
for (i = 0; i < ARRAY_COUNT(gEffectSsOverlayTable); i++) { for (i = 0; i < ARRAY_COUNT(gEffectSsOverlayTable); i++) {
overlay = &gEffectSsOverlayTable[i]; overlay = &gEffectSsOverlayTable[i];
PRINTF("effect index %3d:size=%6dbyte romsize=%6dbyte\n", i, PRINTF("effect index %3d:size=%6dbyte romsize=%6dbyte\n", i,

View file

@ -60,7 +60,7 @@ void KaleidoScopeCall_Update(PlayState* play) {
if (IS_PAUSED(&play->pauseCtx)) { if (IS_PAUSED(&play->pauseCtx)) {
if (pauseCtx->state == PAUSE_STATE_WAIT_LETTERBOX) { if (pauseCtx->state == PAUSE_STATE_WAIT_LETTERBOX) {
if (Letterbox_GetSize() == 0) { if (Letterbox_GetSize() == 0) {
#if OOT_DEBUG #if DEBUG_FEATURES
R_HREG_MODE = HREG_MODE_UCODE_DISAS; R_HREG_MODE = HREG_MODE_UCODE_DISAS;
R_UCODE_DISAS_LOG_MODE = 3; R_UCODE_DISAS_LOG_MODE = 3;
#endif #endif
@ -71,7 +71,7 @@ void KaleidoScopeCall_Update(PlayState* play) {
pauseCtx->state = (pauseCtx->state & 0xFFFF) + 1; // PAUSE_STATE_WAIT_BG_PRERENDER pauseCtx->state = (pauseCtx->state & 0xFFFF) + 1; // PAUSE_STATE_WAIT_BG_PRERENDER
} }
} else if (pauseCtx->state == PAUSE_STATE_GAME_OVER_START) { } else if (pauseCtx->state == PAUSE_STATE_GAME_OVER_START) {
#if OOT_DEBUG #if DEBUG_FEATURES
R_HREG_MODE = HREG_MODE_UCODE_DISAS; R_HREG_MODE = HREG_MODE_UCODE_DISAS;
R_UCODE_DISAS_LOG_MODE = 3; R_UCODE_DISAS_LOG_MODE = 3;
#endif #endif

View file

@ -72,7 +72,7 @@ void KaleidoSetup_Update(PlayState* play) {
(play->sceneId != SCENE_BOMBCHU_BOWLING_ALLEY || !Flags_GetSwitch(play, 0x38))) { (play->sceneId != SCENE_BOMBCHU_BOWLING_ALLEY || !Flags_GetSwitch(play, 0x38))) {
if (CHECK_BTN_ALL(input->cur.button, BTN_L) && CHECK_BTN_ALL(input->press.button, BTN_CUP)) { if (CHECK_BTN_ALL(input->cur.button, BTN_L) && CHECK_BTN_ALL(input->press.button, BTN_CUP)) {
if (OOT_DEBUG && BREG(0)) { if (DEBUG_FEATURES && BREG(0)) {
pauseCtx->debugState = 3; pauseCtx->debugState = 3;
} }
} else if (CHECK_BTN_ALL(input->press.button, BTN_START)) { } else if (CHECK_BTN_ALL(input->press.button, BTN_START)) {

View file

@ -349,7 +349,7 @@ void Environment_Init(PlayState* play2, EnvironmentContext* envCtx, s32 unused)
envCtx->sceneTimeSpeed = 0; envCtx->sceneTimeSpeed = 0;
gTimeSpeed = envCtx->sceneTimeSpeed; gTimeSpeed = envCtx->sceneTimeSpeed;
#if OOT_DEBUG #if DEBUG_FEATURES
R_ENV_TIME_SPEED_OLD = gTimeSpeed; R_ENV_TIME_SPEED_OLD = gTimeSpeed;
R_ENV_DISABLE_DBG = true; R_ENV_DISABLE_DBG = true;
@ -421,7 +421,7 @@ void Environment_Init(PlayState* play2, EnvironmentContext* envCtx, s32 unused)
gSkyboxIsChanging = false; gSkyboxIsChanging = false;
gSaveContext.retainWeatherMode = false; gSaveContext.retainWeatherMode = false;
#if OOT_DEBUG #if DEBUG_FEATURES
R_ENV_LIGHT1_DIR(0) = 80; R_ENV_LIGHT1_DIR(0) = 80;
R_ENV_LIGHT1_DIR(1) = 80; R_ENV_LIGHT1_DIR(1) = 80;
R_ENV_LIGHT1_DIR(2) = 80; R_ENV_LIGHT1_DIR(2) = 80;
@ -718,7 +718,7 @@ void Environment_UpdateSkybox(u8 skyboxId, EnvironmentContext* envCtx, SkyboxCon
} }
} }
#if OOT_DEBUG #if DEBUG_FEATURES
if (newSkybox1Index == 0xFF) { if (newSkybox1Index == 0xFF) {
PRINTF(VT_COL(RED, WHITE) T("\n環境VRデータ取得失敗! ささきまでご報告を!", PRINTF(VT_COL(RED, WHITE) T("\n環境VRデータ取得失敗! ささきまでご報告を!",
"\nEnvironment VR data acquisition failed! Report to Sasaki!") VT_RST); "\nEnvironment VR data acquisition failed! Report to Sasaki!") VT_RST);
@ -835,7 +835,7 @@ void Environment_DisableUnderwaterLights(PlayState* play) {
} }
} }
#if OOT_DEBUG #if DEBUG_FEATURES
void Environment_PrintDebugInfo(PlayState* play, Gfx** gfx) { void Environment_PrintDebugInfo(PlayState* play, Gfx** gfx) {
GfxPrint printer; GfxPrint printer;
s32 pad[2]; s32 pad[2];
@ -979,7 +979,7 @@ void Environment_Update(PlayState* play, EnvironmentContext* envCtx, LightContex
gSaveContext.save.nightFlag = 0; gSaveContext.save.nightFlag = 0;
} }
#if OOT_DEBUG #if DEBUG_FEATURES
if (R_ENABLE_ARENA_DBG != 0 || CREG(2) != 0) { if (R_ENABLE_ARENA_DBG != 0 || CREG(2) != 0) {
Gfx* displayList; Gfx* displayList;
Gfx* prevDisplayList; Gfx* prevDisplayList;
@ -1146,7 +1146,7 @@ void Environment_Update(PlayState* play, EnvironmentContext* envCtx, LightContex
envCtx->lightSettings.zFar = LERP16(blend16[0], blend16[1], configChangeBlend); envCtx->lightSettings.zFar = LERP16(blend16[0], blend16[1], configChangeBlend);
#if OOT_DEBUG #if DEBUG_FEATURES
if (sTimeBasedLightConfigs[envCtx->changeLightNextConfig][i].nextLightSetting >= if (sTimeBasedLightConfigs[envCtx->changeLightNextConfig][i].nextLightSetting >=
envCtx->numLightSettings) { envCtx->numLightSettings) {
PRINTF(VT_COL(RED, WHITE) T("\nカラーパレットの設定がおかしいようです!", PRINTF(VT_COL(RED, WHITE) T("\nカラーパレットの設定がおかしいようです!",
@ -1226,7 +1226,7 @@ void Environment_Update(PlayState* play, EnvironmentContext* envCtx, LightContex
lightSettingsList[envCtx->lightSetting].zFar, envCtx->lightBlend); lightSettingsList[envCtx->lightSetting].zFar, envCtx->lightBlend);
} }
#if OOT_DEBUG #if DEBUG_FEATURES
if (envCtx->lightSetting >= envCtx->numLightSettings) { if (envCtx->lightSetting >= envCtx->numLightSettings) {
PRINTF("\n" VT_FGCOL(RED) PRINTF("\n" VT_FGCOL(RED)
T("カラーパレットがおかしいようです!", "The color palette seems to be wrong!")); T("カラーパレットがおかしいようです!", "The color palette seems to be wrong!"));
@ -1300,7 +1300,7 @@ void Environment_Update(PlayState* play, EnvironmentContext* envCtx, LightContex
lightCtx->zFar = ENV_ZFAR_MAX; lightCtx->zFar = ENV_ZFAR_MAX;
} }
#if OOT_DEBUG #if DEBUG_FEATURES
// When environment debug is enabled, various environment related variables can be configured via the reg editor // When environment debug is enabled, various environment related variables can be configured via the reg editor
if (R_ENV_DISABLE_DBG) { if (R_ENV_DISABLE_DBG) {
R_ENV_AMBIENT_COLOR(0) = lightCtx->ambientColor[0]; R_ENV_AMBIENT_COLOR(0) = lightCtx->ambientColor[0];

View file

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

View file

@ -118,8 +118,8 @@ void MapMark_DrawForDungeon(PlayState* play) {
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
rectLeft = ((OOT_DEBUG ? GREG(94) : 0) + markPoint->x + 204) << 2; rectLeft = ((DEBUG_FEATURES ? GREG(94) : 0) + markPoint->x + 204) << 2;
rectTop = ((OOT_DEBUG ? GREG(95) : 0) + markPoint->y + 140) << 2; rectTop = ((DEBUG_FEATURES ? GREG(95) : 0) + markPoint->y + 140) << 2;
gSPTextureRectangle(OVERLAY_DISP++, rectLeft, rectTop, markInfo->rectWidth + rectLeft, gSPTextureRectangle(OVERLAY_DISP++, rectLeft, rectTop, markInfo->rectWidth + rectLeft,
rectTop + markInfo->rectHeight, G_TX_RENDERTILE, 0, 0, markInfo->dsdx, rectTop + markInfo->rectHeight, G_TX_RENDERTILE, 0, 0, markInfo->dsdx,
markInfo->dtdy); markInfo->dtdy);

View file

@ -3921,7 +3921,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
*p = gfx; *p = gfx;
} }
#if OOT_DEBUG #if DEBUG_FEATURES
/** /**
* If the s16 variable pointed to by `var` changes in value, a black bar and white box * If the s16 variable pointed to by `var` changes in value, a black bar and white box
* are briefly drawn onto the screen. It can only watch one variable per build due to * are briefly drawn onto the screen. It can only watch one variable per build due to
@ -3981,13 +3981,13 @@ void Message_Draw(PlayState* play) {
#if OOT_VERSION < GC_US #if OOT_VERSION < GC_US
s32 pad; s32 pad;
#endif #endif
#if OOT_DEBUG #if DEBUG_FEATURES
s16 watchVar; s16 watchVar;
#endif #endif
OPEN_DISPS(play->state.gfxCtx, "../z_message_PAL.c", 3554); OPEN_DISPS(play->state.gfxCtx, "../z_message_PAL.c", 3554);
#if OOT_DEBUG #if DEBUG_FEATURES
watchVar = gSaveContext.save.info.scarecrowLongSongSet; watchVar = gSaveContext.save.info.scarecrowLongSongSet;
Message_DrawDebugVariableChanged(&watchVar, play->state.gfxCtx); Message_DrawDebugVariableChanged(&watchVar, play->state.gfxCtx);
if (BREG(0) != 0 && play->msgCtx.textId != 0) { if (BREG(0) != 0 && play->msgCtx.textId != 0) {
@ -4050,7 +4050,7 @@ void Message_Update(PlayState* play) {
s32 pad2; s32 pad2;
#endif #endif
#if OOT_DEBUG #if DEBUG_FEATURES
if (BREG(0) != 0) { if (BREG(0) != 0) {
static u16 sMessageDebuggerTextboxCount = 0; static u16 sMessageDebuggerTextboxCount = 0;

View file

@ -5255,7 +5255,7 @@ s32 OnePointCutscene_Attention(PlayState* play, Actor* actor) {
s32 temp2; s32 temp2;
s32 timer; s32 timer;
#if OOT_DEBUG #if DEBUG_FEATURES
if (sDisableAttention) { if (sDisableAttention) {
PRINTF(VT_COL(YELLOW, BLACK) "actor attention demo camera: canceled by other camera\n" VT_RST); PRINTF(VT_COL(YELLOW, BLACK) "actor attention demo camera: canceled by other camera\n" VT_RST);
return CAM_ID_NONE; return CAM_ID_NONE;

View file

@ -3986,7 +3986,7 @@ void Interface_Draw(PlayState* play) {
} }
} }
#if OOT_DEBUG #if DEBUG_FEATURES
if (pauseCtx->debugState == 3) { if (pauseCtx->debugState == 3) {
FlagSet_Update(play); FlagSet_Update(play);
} }
@ -4012,7 +4012,7 @@ void Interface_Update(PlayState* play) {
s16 risingAlpha; s16 risingAlpha;
u16 action; u16 action;
#if OOT_DEBUG #if OOT_PAL && DEBUG_FEATURES
{ {
Input* debugInput = &play->state.input[2]; Input* debugInput = &play->state.input[2];

View file

@ -17,13 +17,13 @@ s32 gTransitionTileState;
VisMono gPlayVisMono; VisMono gPlayVisMono;
Color_RGBA8_u32 gVisMonoColor; Color_RGBA8_u32 gVisMonoColor;
#if OOT_DEBUG #if DEBUG_FEATURES
FaultClient D_801614B8; FaultClient D_801614B8;
#endif #endif
s16 sTransitionFillTimer; s16 sTransitionFillTimer;
#if OOT_DEBUG #if DEBUG_FEATURES
void* gDebugCutsceneScript = NULL; void* gDebugCutsceneScript = NULL;
UNK_TYPE D_8012D1F4 = 0; // unused UNK_TYPE D_8012D1F4 = 0; // unused
#endif #endif
@ -34,7 +34,7 @@ void Play_SpawnScene(PlayState* this, s32 sceneId, s32 spawn);
// This macro prints the number "1" with a file and line number if R_ENABLE_PLAY_LOGS is enabled. // This macro prints the number "1" with a file and line number if R_ENABLE_PLAY_LOGS is enabled.
// For example, it can be used to trace the play state execution at a high level. // For example, it can be used to trace the play state execution at a high level.
#if OOT_DEBUG #if DEBUG_FEATURES
#define PLAY_LOG(line) \ #define PLAY_LOG(line) \
do { \ do { \
if (R_ENABLE_PLAY_LOGS) { \ if (R_ENABLE_PLAY_LOGS) { \
@ -254,7 +254,7 @@ void Play_Destroy(GameState* thisx) {
} }
#endif #endif
#if OOT_DEBUG #if DEBUG_FEATURES
Fault_RemoveClient(&D_801614B8); Fault_RemoveClient(&D_801614B8);
#endif #endif
} }
@ -278,7 +278,7 @@ void Play_Init(GameState* thisx) {
return; return;
} }
#if OOT_DEBUG #if PLATFORM_GC && DEBUG_FEATURES
SystemArena_Display(); SystemArena_Display();
#endif #endif
@ -468,7 +468,7 @@ void Play_Init(GameState* thisx) {
PRINTF(T("ゼルダヒープ %08x-%08x\n", "Zelda Heap %08x-%08x\n"), zAllocAligned, PRINTF(T("ゼルダヒープ %08x-%08x\n", "Zelda Heap %08x-%08x\n"), zAllocAligned,
(u8*)zAllocAligned + zAllocSize - (s32)(zAllocAligned - zAlloc)); (u8*)zAllocAligned + zAllocSize - (s32)(zAllocAligned - zAlloc));
#if OOT_DEBUG #if PLATFORM_GC && DEBUG_FEATURES
Fault_AddClient(&D_801614B8, ZeldaArena_Display, NULL, NULL); Fault_AddClient(&D_801614B8, ZeldaArena_Display, NULL, NULL);
#endif #endif
@ -505,7 +505,7 @@ void Play_Init(GameState* thisx) {
AnimTaskQueue_Update(this, &this->animTaskQueue); AnimTaskQueue_Update(this, &this->animTaskQueue);
gSaveContext.respawnFlag = 0; gSaveContext.respawnFlag = 0;
#if OOT_DEBUG #if DEBUG_FEATURES
if (R_USE_DEBUG_CUTSCENE) { if (R_USE_DEBUG_CUTSCENE) {
static u64 sDebugCutsceneScriptBuf[0xA00]; static u64 sDebugCutsceneScriptBuf[0xA00];
@ -524,10 +524,12 @@ void Play_Update(PlayState* this) {
s32 isPaused; s32 isPaused;
s32 pad1; s32 pad1;
#if OOT_DEBUG #if DEBUG_FEATURES
if ((SREG(1) < 0) || (DREG(0) != 0)) { if ((SREG(1) < 0) || (DREG(0) != 0)) {
SREG(1) = 0; SREG(1) = 0;
#if PLATFORM_GC
ZeldaArena_Display(); ZeldaArena_Display();
#endif
} }
if ((R_HREG_MODE == HREG_MODE_PRINT_OBJECT_TABLE) && (R_PRINT_OBJECT_TABLE_TRIGGER < 0)) { if ((R_HREG_MODE == HREG_MODE_PRINT_OBJECT_TABLE) && (R_PRINT_OBJECT_TABLE_TRIGGER < 0)) {
@ -613,7 +615,7 @@ void Play_Update(PlayState* this) {
} }
} }
#if OOT_DEBUG #if DEBUG_FEATURES
if (!R_TRANS_DBG_ENABLED) { if (!R_TRANS_DBG_ENABLED) {
Play_SetupTransition(this, this->transitionType); Play_SetupTransition(this, this->transitionType);
} else { } else {
@ -931,7 +933,7 @@ void Play_Update(PlayState* this) {
PLAY_LOG(3555); PLAY_LOG(3555);
AnimTaskQueue_Reset(&this->animTaskQueue); AnimTaskQueue_Reset(&this->animTaskQueue);
if (!OOT_DEBUG) {} if (!DEBUG_FEATURES) {}
PLAY_LOG(3561); PLAY_LOG(3561);
Object_UpdateEntries(&this->objectCtx); Object_UpdateEntries(&this->objectCtx);
@ -1139,7 +1141,7 @@ void Play_Draw(PlayState* this) {
Gfx_SetupFrame(gfxCtx, 0, 0, 0); Gfx_SetupFrame(gfxCtx, 0, 0, 0);
if (!OOT_DEBUG || (R_HREG_MODE != HREG_MODE_PLAY) || R_PLAY_RUN_DRAW) { if (!DEBUG_FEATURES || (R_HREG_MODE != HREG_MODE_PLAY) || R_PLAY_RUN_DRAW) {
POLY_OPA_DISP = Play_SetFog(this, POLY_OPA_DISP); POLY_OPA_DISP = Play_SetFog(this, POLY_OPA_DISP);
POLY_XLU_DISP = Play_SetFog(this, POLY_XLU_DISP); POLY_XLU_DISP = Play_SetFog(this, POLY_XLU_DISP);
@ -1162,7 +1164,7 @@ void Play_Draw(PlayState* this) {
gSPSegment(POLY_OPA_DISP++, 0x01, this->billboardMtx); gSPSegment(POLY_OPA_DISP++, 0x01, this->billboardMtx);
if (!OOT_DEBUG || (R_HREG_MODE != HREG_MODE_PLAY) || R_PLAY_DRAW_COVER_ELEMENTS) { if (!DEBUG_FEATURES || (R_HREG_MODE != HREG_MODE_PLAY) || R_PLAY_DRAW_COVER_ELEMENTS) {
Gfx* gfxP; Gfx* gfxP;
Gfx* sp1CC = POLY_OPA_DISP; Gfx* sp1CC = POLY_OPA_DISP;
@ -1231,7 +1233,7 @@ void Play_Draw(PlayState* this) {
goto Play_Draw_DrawOverlayElements; goto Play_Draw_DrawOverlayElements;
} }
if (!OOT_DEBUG || (R_HREG_MODE != HREG_MODE_PLAY) || R_PLAY_DRAW_SKYBOX) { if (!DEBUG_FEATURES || (R_HREG_MODE != HREG_MODE_PLAY) || R_PLAY_DRAW_SKYBOX) {
if (this->skyboxId && (this->skyboxId != SKYBOX_UNSET_1D) && !this->envCtx.skyboxDisabled) { if (this->skyboxId && (this->skyboxId != SKYBOX_UNSET_1D) && !this->envCtx.skyboxDisabled) {
if ((this->skyboxId == SKYBOX_NORMAL_SKY) || (this->skyboxId == SKYBOX_CUTSCENE_MAP)) { if ((this->skyboxId == SKYBOX_NORMAL_SKY) || (this->skyboxId == SKYBOX_CUTSCENE_MAP)) {
Environment_UpdateSkybox(this->skyboxId, &this->envCtx, &this->skyboxCtx); Environment_UpdateSkybox(this->skyboxId, &this->envCtx, &this->skyboxCtx);
@ -1244,32 +1246,34 @@ void Play_Draw(PlayState* this) {
} }
} }
if (!OOT_DEBUG || (R_HREG_MODE != HREG_MODE_PLAY) || (R_PLAY_DRAW_ENV_FLAGS & PLAY_ENV_DRAW_SUN_AND_MOON)) { if (!DEBUG_FEATURES || (R_HREG_MODE != HREG_MODE_PLAY) ||
(R_PLAY_DRAW_ENV_FLAGS & PLAY_ENV_DRAW_SUN_AND_MOON)) {
if (!this->envCtx.sunMoonDisabled) { if (!this->envCtx.sunMoonDisabled) {
Environment_DrawSunAndMoon(this); Environment_DrawSunAndMoon(this);
} }
} }
if (!OOT_DEBUG || (R_HREG_MODE != HREG_MODE_PLAY) || (R_PLAY_DRAW_ENV_FLAGS & PLAY_ENV_DRAW_SKYBOX_FILTERS)) { if (!DEBUG_FEATURES || (R_HREG_MODE != HREG_MODE_PLAY) ||
(R_PLAY_DRAW_ENV_FLAGS & PLAY_ENV_DRAW_SKYBOX_FILTERS)) {
Environment_DrawSkyboxFilters(this); Environment_DrawSkyboxFilters(this);
} }
if (!OOT_DEBUG || (R_HREG_MODE != HREG_MODE_PLAY) || (R_PLAY_DRAW_ENV_FLAGS & PLAY_ENV_DRAW_LIGHTNING)) { if (!DEBUG_FEATURES || (R_HREG_MODE != HREG_MODE_PLAY) || (R_PLAY_DRAW_ENV_FLAGS & PLAY_ENV_DRAW_LIGHTNING)) {
Environment_UpdateLightningStrike(this); Environment_UpdateLightningStrike(this);
Environment_DrawLightning(this, 0); Environment_DrawLightning(this, 0);
} }
if (!OOT_DEBUG || (R_HREG_MODE != HREG_MODE_PLAY) || (R_PLAY_DRAW_ENV_FLAGS & PLAY_ENV_DRAW_LIGHTS)) { if (!DEBUG_FEATURES || (R_HREG_MODE != HREG_MODE_PLAY) || (R_PLAY_DRAW_ENV_FLAGS & PLAY_ENV_DRAW_LIGHTS)) {
sp228 = LightContext_NewLights(&this->lightCtx, gfxCtx); sp228 = LightContext_NewLights(&this->lightCtx, gfxCtx);
Lights_BindAll(sp228, this->lightCtx.listHead, NULL); Lights_BindAll(sp228, this->lightCtx.listHead, NULL);
Lights_Draw(sp228, gfxCtx); Lights_Draw(sp228, gfxCtx);
} }
if (!OOT_DEBUG || (R_HREG_MODE != HREG_MODE_PLAY) || (R_PLAY_DRAW_ROOM_FLAGS != 0)) { if (!DEBUG_FEATURES || (R_HREG_MODE != HREG_MODE_PLAY) || (R_PLAY_DRAW_ROOM_FLAGS != 0)) {
if (VREG(94) == 0) { if (VREG(94) == 0) {
s32 roomDrawFlags; s32 roomDrawFlags;
if (!OOT_DEBUG || (R_HREG_MODE != HREG_MODE_PLAY)) { if (!DEBUG_FEATURES || (R_HREG_MODE != HREG_MODE_PLAY)) {
roomDrawFlags = ROOM_DRAW_OPA | ROOM_DRAW_XLU; roomDrawFlags = ROOM_DRAW_OPA | ROOM_DRAW_XLU;
} else { } else {
roomDrawFlags = R_PLAY_DRAW_ROOM_FLAGS; roomDrawFlags = R_PLAY_DRAW_ROOM_FLAGS;
@ -1280,7 +1284,7 @@ void Play_Draw(PlayState* this) {
} }
} }
if (!OOT_DEBUG || (R_HREG_MODE != HREG_MODE_PLAY) || R_PLAY_DRAW_SKYBOX) { if (!DEBUG_FEATURES || (R_HREG_MODE != HREG_MODE_PLAY) || R_PLAY_DRAW_SKYBOX) {
if ((this->skyboxCtx.drawType != SKYBOX_DRAW_128) && if ((this->skyboxCtx.drawType != SKYBOX_DRAW_128) &&
(GET_ACTIVE_CAM(this)->setting != CAM_SET_PREREND_FIXED)) { (GET_ACTIVE_CAM(this)->setting != CAM_SET_PREREND_FIXED)) {
Vec3f quakeOffset; Vec3f quakeOffset;
@ -1295,15 +1299,15 @@ void Play_Draw(PlayState* this) {
Environment_DrawRain(this, &this->view, gfxCtx); Environment_DrawRain(this, &this->view, gfxCtx);
} }
if (!OOT_DEBUG || (R_HREG_MODE != HREG_MODE_PLAY) || (R_PLAY_DRAW_ROOM_FLAGS != 0)) { if (!DEBUG_FEATURES || (R_HREG_MODE != HREG_MODE_PLAY) || (R_PLAY_DRAW_ROOM_FLAGS != 0)) {
Environment_FillScreen(gfxCtx, 0, 0, 0, this->bgCoverAlpha, FILL_SCREEN_OPA); Environment_FillScreen(gfxCtx, 0, 0, 0, this->bgCoverAlpha, FILL_SCREEN_OPA);
} }
if (!OOT_DEBUG || (R_HREG_MODE != HREG_MODE_PLAY) || R_PLAY_DRAW_ACTORS) { if (!DEBUG_FEATURES || (R_HREG_MODE != HREG_MODE_PLAY) || R_PLAY_DRAW_ACTORS) {
func_800315AC(this, &this->actorCtx); func_800315AC(this, &this->actorCtx);
} }
if (!OOT_DEBUG || (R_HREG_MODE != HREG_MODE_PLAY) || R_PLAY_DRAW_LENS_FLARES) { if (!DEBUG_FEATURES || (R_HREG_MODE != HREG_MODE_PLAY) || R_PLAY_DRAW_LENS_FLARES) {
if (!this->envCtx.sunMoonDisabled) { if (!this->envCtx.sunMoonDisabled) {
sp21C.x = this->view.eye.x + this->envCtx.sunPos.x; sp21C.x = this->view.eye.x + this->envCtx.sunPos.x;
sp21C.y = this->view.eye.y + this->envCtx.sunPos.y; sp21C.y = this->view.eye.y + this->envCtx.sunPos.y;
@ -1313,7 +1317,7 @@ void Play_Draw(PlayState* this) {
Environment_DrawCustomLensFlare(this); Environment_DrawCustomLensFlare(this);
} }
if (!OOT_DEBUG || (R_HREG_MODE != HREG_MODE_PLAY) || R_PLAY_DRAW_SCREEN_FILLS) { if (!DEBUG_FEATURES || (R_HREG_MODE != HREG_MODE_PLAY) || R_PLAY_DRAW_SCREEN_FILLS) {
if (MREG(64) != 0) { if (MREG(64) != 0) {
Environment_FillScreen(gfxCtx, MREG(65), MREG(66), MREG(67), MREG(68), Environment_FillScreen(gfxCtx, MREG(65), MREG(66), MREG(67), MREG(68),
FILL_SCREEN_OPA | FILL_SCREEN_XLU); FILL_SCREEN_OPA | FILL_SCREEN_XLU);
@ -1330,13 +1334,13 @@ void Play_Draw(PlayState* this) {
} }
} }
if (!OOT_DEBUG || (R_HREG_MODE != HREG_MODE_PLAY) || R_PLAY_DRAW_SANDSTORM) { if (!DEBUG_FEATURES || (R_HREG_MODE != HREG_MODE_PLAY) || R_PLAY_DRAW_SANDSTORM) {
if (this->envCtx.sandstormState != SANDSTORM_OFF) { if (this->envCtx.sandstormState != SANDSTORM_OFF) {
Environment_DrawSandstorm(this, this->envCtx.sandstormState); Environment_DrawSandstorm(this, this->envCtx.sandstormState);
} }
} }
if (!OOT_DEBUG || (R_HREG_MODE != HREG_MODE_PLAY) || R_PLAY_DRAW_DEBUG_OBJECTS) { if (!DEBUG_FEATURES || (R_HREG_MODE != HREG_MODE_PLAY) || R_PLAY_DRAW_DEBUG_OBJECTS) {
DebugDisplay_DrawObjects(this); DebugDisplay_DrawObjects(this);
} }
@ -1363,7 +1367,7 @@ void Play_Draw(PlayState* this) {
} }
Play_Draw_DrawOverlayElements: Play_Draw_DrawOverlayElements:
if (!OOT_DEBUG || (R_HREG_MODE != HREG_MODE_PLAY) || R_PLAY_DRAW_OVERLAY_ELEMENTS) { if (!DEBUG_FEATURES || (R_HREG_MODE != HREG_MODE_PLAY) || R_PLAY_DRAW_OVERLAY_ELEMENTS) {
Play_DrawOverlayElements(this); Play_DrawOverlayElements(this);
} }
} }
@ -1393,7 +1397,7 @@ void Play_Main(GameState* thisx) {
PLAY_LOG(4556); PLAY_LOG(4556);
if (OOT_DEBUG && (R_HREG_MODE == HREG_MODE_PLAY) && (R_PLAY_INIT != HREG_MODE_PLAY)) { if (DEBUG_FEATURES && (R_HREG_MODE == HREG_MODE_PLAY) && (R_PLAY_INIT != HREG_MODE_PLAY)) {
R_PLAY_RUN_UPDATE = true; R_PLAY_RUN_UPDATE = true;
R_PLAY_RUN_DRAW = true; R_PLAY_RUN_DRAW = true;
R_PLAY_DRAW_SKYBOX = true; R_PLAY_DRAW_SKYBOX = true;
@ -1411,7 +1415,7 @@ void Play_Main(GameState* thisx) {
R_PLAY_INIT = HREG_MODE_PLAY; R_PLAY_INIT = HREG_MODE_PLAY;
} }
if (!OOT_DEBUG || (R_HREG_MODE != HREG_MODE_PLAY) || R_PLAY_RUN_UPDATE) { if (!DEBUG_FEATURES || (R_HREG_MODE != HREG_MODE_PLAY) || R_PLAY_RUN_UPDATE) {
Play_Update(this); Play_Update(this);
} }

View file

@ -1246,7 +1246,7 @@ Gfx* Gfx_SetupDL_69NoCD(Gfx* gfx) {
return gfx; return gfx;
} }
#if OOT_DEBUG #if DEBUG_FEATURES
#define HREG_21 HREG(21) #define HREG_21 HREG(21)
#define HREG_22 HREG(22) #define HREG_22 HREG(22)
#else #else
@ -1482,7 +1482,7 @@ void Gfx_SetupFrame(GraphicsContext* gfxCtx, u8 r, u8 g, u8 b) {
if ((R_PAUSE_BG_PRERENDER_STATE <= PAUSE_BG_PRERENDER_SETUP) && (gTransitionTileState <= TRANS_TILE_SETUP)) { if ((R_PAUSE_BG_PRERENDER_STATE <= PAUSE_BG_PRERENDER_SETUP) && (gTransitionTileState <= TRANS_TILE_SETUP)) {
s32 letterboxSize = Letterbox_GetSize(); s32 letterboxSize = Letterbox_GetSize();
#if OOT_DEBUG #if DEBUG_FEATURES
if (R_HREG_MODE == HREG_MODE_SETUP_FRAME) { if (R_HREG_MODE == HREG_MODE_SETUP_FRAME) {
if (R_SETUP_FRAME_INIT != HREG_MODE_SETUP_FRAME) { if (R_SETUP_FRAME_INIT != HREG_MODE_SETUP_FRAME) {
R_SETUP_FRAME_GET = (SETUP_FRAME_LETTERBOX_SIZE_FLAG | SETUP_FRAME_BASE_COLOR_FLAG); R_SETUP_FRAME_GET = (SETUP_FRAME_LETTERBOX_SIZE_FLAG | SETUP_FRAME_BASE_COLOR_FLAG);

View file

@ -1758,7 +1758,7 @@ SceneDrawConfigFunc sSceneDrawConfigs[SDC_MAX] = {
}; };
void Scene_Draw(PlayState* play) { void Scene_Draw(PlayState* play) {
#if OOT_DEBUG #if DEBUG_FEATURES
if (R_HREG_MODE == HREG_MODE_SCENE_CONFIG) { if (R_HREG_MODE == HREG_MODE_SCENE_CONFIG) {
if (R_SCENE_CONFIG_INIT != HREG_MODE_SCENE_CONFIG) { if (R_SCENE_CONFIG_INIT != HREG_MODE_SCENE_CONFIG) {
R_SCENE_CONFIG_INIT = HREG_MODE_SCENE_CONFIG; R_SCENE_CONFIG_INIT = HREG_MODE_SCENE_CONFIG;

View file

@ -671,7 +671,7 @@ void Sram_VerifyAndLoadAllSaves(FileSelectState* fileSelect, SramContext* sramCt
bzero(&gSaveContext.save.totalDays, sizeof(s32)); bzero(&gSaveContext.save.totalDays, sizeof(s32));
bzero(&gSaveContext.save.bgsDayCount, sizeof(s32)); bzero(&gSaveContext.save.bgsDayCount, sizeof(s32));
#if OOT_DEBUG #if DEBUG_FEATURES
if (!slotNum) { if (!slotNum) {
Sram_InitDebugSave(); Sram_InitDebugSave();
gSaveContext.save.info.playerData.newf[0] = 'Z'; gSaveContext.save.info.playerData.newf[0] = 'Z';
@ -780,7 +780,7 @@ void Sram_InitSave(FileSelectState* fileSelect, SramContext* sramCtx) {
u16* ptr; u16* ptr;
u16 checksum; u16 checksum;
#if OOT_DEBUG #if DEBUG_FEATURES
if (fileSelect->buttonIndex != 0) { if (fileSelect->buttonIndex != 0) {
Sram_InitNewSave(); Sram_InitNewSave();
} else { } else {
@ -795,7 +795,7 @@ void Sram_InitSave(FileSelectState* fileSelect, SramContext* sramCtx) {
gSaveContext.save.dayTime = CLOCK_TIME(10, 0); gSaveContext.save.dayTime = CLOCK_TIME(10, 0);
gSaveContext.save.cutsceneIndex = 0xFFF1; gSaveContext.save.cutsceneIndex = 0xFFF1;
#if OOT_DEBUG #if DEBUG_FEATURES
if (fileSelect->buttonIndex == 0) { if (fileSelect->buttonIndex == 0) {
gSaveContext.save.cutsceneIndex = 0; gSaveContext.save.cutsceneIndex = 0;
} }
@ -973,7 +973,7 @@ void Sram_InitSram(GameState* gameState, SramContext* sramCtx) {
} }
#endif #endif
#if OOT_DEBUG #if DEBUG_FEATURES
if (CHECK_BTN_ANY(gameState->input[2].cur.button, BTN_DRIGHT)) { if (CHECK_BTN_ANY(gameState->input[2].cur.button, BTN_DRIGHT)) {
bzero(sramCtx->readBuff, SRAM_SIZE); bzero(sramCtx->readBuff, SRAM_SIZE);
for (i = 0; i < CHECKSUM_SIZE; i++) { for (i = 0; i < CHECKSUM_SIZE; i++) {

View file

@ -316,7 +316,7 @@ s32 View_ApplyPerspective(View* view) {
height = view->viewport.bottomY - view->viewport.topY; height = view->viewport.bottomY - view->viewport.topY;
aspect = (f32)width / (f32)height; aspect = (f32)width / (f32)height;
if (OOT_DEBUG && R_HREG_MODE == HREG_MODE_PERSPECTIVE) { if (DEBUG_FEATURES && R_HREG_MODE == HREG_MODE_PERSPECTIVE) {
if (R_PERSPECTIVE_INIT != HREG_MODE_PERSPECTIVE) { if (R_PERSPECTIVE_INIT != HREG_MODE_PERSPECTIVE) {
R_PERSPECTIVE_INIT = HREG_MODE_PERSPECTIVE; R_PERSPECTIVE_INIT = HREG_MODE_PERSPECTIVE;
R_PERSPECTIVE_FOVY = 60; R_PERSPECTIVE_FOVY = 60;
@ -331,7 +331,7 @@ s32 View_ApplyPerspective(View* view) {
guPerspective(projection, &view->normal, view->fovy, aspect, view->zNear, view->zFar, view->scale); guPerspective(projection, &view->normal, view->fovy, aspect, view->zNear, view->zFar, view->scale);
} }
#if OOT_DEBUG #if DEBUG_FEATURES
if (QREG(88) & 1) { if (QREG(88) & 1) {
s32 i; s32 i;
MtxF mf; MtxF mf;
@ -375,7 +375,7 @@ s32 View_ApplyPerspective(View* view) {
view->viewing = *viewing; view->viewing = *viewing;
#if OOT_DEBUG #if DEBUG_FEATURES
// Debug print view matrix // Debug print view matrix
if (QREG(88) & 2) { if (QREG(88) & 2) {
s32 i; s32 i;
@ -625,7 +625,7 @@ s32 View_ApplyTo(View* view, s32 mask, Gfx** gfxP) {
return 1; return 1;
} }
#if OOT_DEBUG #if DEBUG_FEATURES
/** /**
* Logs an error and returns nonzero if camera is too far from the origin. * Logs an error and returns nonzero if camera is too far from the origin.
*/ */

View file

@ -1,6 +1,6 @@
#include "ultra64/asm.h" #include "ultra64/asm.h"
#if OOT_DEBUG #if DEBUG_FEATURES
.set noreorder .set noreorder
#endif #endif

View file

@ -1,6 +1,6 @@
#include "ultra64/asm.h" #include "ultra64/asm.h"
#if OOT_DEBUG #if DEBUG_FEATURES
.set noreorder .set noreorder
#endif #endif

View file

@ -20,7 +20,7 @@
#define NODE_IS_VALID(node) (((node) != NULL) && ((node)->magic == NODE_MAGIC)) #define NODE_IS_VALID(node) (((node) != NULL) && ((node)->magic == NODE_MAGIC))
#if OOT_DEBUG #if DEBUG_FEATURES
#define NODE_GET_NEXT(node) ArenaImpl_GetNextBlock(node) #define NODE_GET_NEXT(node) ArenaImpl_GetNextBlock(node)
#define NODE_GET_PREV(node) ArenaImpl_GetPrevBlock(node) #define NODE_GET_PREV(node) ArenaImpl_GetPrevBlock(node)
@ -76,7 +76,7 @@ OSMesg sArenaLockMsg;
void __osMallocAddBlock(Arena* arena, void* start, s32 size); void __osMallocAddBlock(Arena* arena, void* start, s32 size);
#if OOT_DEBUG #if DEBUG_FEATURES
u32 __osMalloc_FreeBlockTest_Enable; u32 __osMalloc_FreeBlockTest_Enable;
u32 ArenaImpl_GetFillAllocBlock(Arena* arena) { u32 ArenaImpl_GetFillAllocBlock(Arena* arena) {
@ -130,7 +130,7 @@ void ArenaImpl_Unlock(Arena* arena) {
osRecvMesg(&arena->lockQueue, NULL, OS_MESG_BLOCK); osRecvMesg(&arena->lockQueue, NULL, OS_MESG_BLOCK);
} }
#if OOT_DEBUG #if DEBUG_FEATURES
ArenaNode* ArenaImpl_GetNextBlock(ArenaNode* node) { ArenaNode* ArenaImpl_GetNextBlock(ArenaNode* node) {
ArenaNode* next = node->next; ArenaNode* next = node->next;
@ -211,7 +211,7 @@ void __osMallocAddBlock(Arena* arena, void* start, s32 size) {
} }
} }
#if OOT_DEBUG #if DEBUG_FEATURES
void ArenaImpl_RemoveAllBlocks(Arena* arena) { void ArenaImpl_RemoveAllBlocks(Arena* arena) {
ArenaNode* iter; ArenaNode* iter;
ArenaNode* next; ArenaNode* next;
@ -230,7 +230,7 @@ void ArenaImpl_RemoveAllBlocks(Arena* arena) {
#endif #endif
void __osMallocCleanup(Arena* arena) { void __osMallocCleanup(Arena* arena) {
#if OOT_DEBUG #if DEBUG_FEATURES
ArenaImpl_RemoveAllBlocks(arena); ArenaImpl_RemoveAllBlocks(arena);
#endif #endif
bzero(arena, sizeof(*arena)); bzero(arena, sizeof(*arena));
@ -240,7 +240,7 @@ s32 __osMallocIsInitialized(Arena* arena) {
return arena->isInit; return arena->isInit;
} }
#if OOT_DEBUG #if DEBUG_FEATURES
void __osMalloc_FreeBlockTest(Arena* arena, ArenaNode* node) { void __osMalloc_FreeBlockTest(Arena* arena, ArenaNode* node) {
ArenaNode* node2 = node; ArenaNode* node2 = node;
u32* start; u32* start;
@ -497,7 +497,7 @@ void __osFree_NoLock(Arena* arena, void* ptr) {
PRINTF(VT_COL(RED, WHITE) T("__osFree:二重解放(%08x)\n", "__osFree: Double release (%08x)\n") VT_RST, ptr); PRINTF(VT_COL(RED, WHITE) T("__osFree:二重解放(%08x)\n", "__osFree: Double release (%08x)\n") VT_RST, ptr);
return; return;
} }
#if OOT_DEBUG #if DEBUG_FEATURES
if (arena != node->arena && arena != NULL) { if (arena != node->arena && arena != NULL) {
PRINTF(VT_COL(RED, WHITE) PRINTF(VT_COL(RED, WHITE)
T("__osFree:確保時と違う方法で解放しようとした (%08x:%08x)\n", T("__osFree:確保時と違う方法で解放しようとした (%08x:%08x)\n",
@ -542,7 +542,7 @@ void __osFree(Arena* arena, void* ptr) {
ArenaImpl_Unlock(arena); ArenaImpl_Unlock(arena);
} }
#if OOT_DEBUG #if DEBUG_FEATURES
void __osFree_NoLockDebug(Arena* arena, void* ptr, const char* file, int line) { void __osFree_NoLockDebug(Arena* arena, void* ptr, const char* file, int line) {
ArenaNode* node; ArenaNode* node;
ArenaNode* next; ArenaNode* next;
@ -711,7 +711,7 @@ void* __osRealloc(Arena* arena, void* ptr, u32 newSize) {
return ptr; return ptr;
} }
#if OOT_DEBUG #if DEBUG_FEATURES
void* __osReallocDebug(Arena* arena, void* ptr, u32 newSize, const char* file, int line) { void* __osReallocDebug(Arena* arena, void* ptr, u32 newSize, const char* file, int line) {
return __osRealloc(arena, ptr, newSize); return __osRealloc(arena, ptr, newSize);
} }
@ -743,7 +743,7 @@ void ArenaImpl_GetSizes(Arena* arena, u32* outMaxFree, u32* outFree, u32* outAll
ArenaImpl_Unlock(arena); ArenaImpl_Unlock(arena);
} }
#if OOT_DEBUG #if DEBUG_FEATURES
void __osDisplayArena(Arena* arena) { void __osDisplayArena(Arena* arena) {
u32 freeSize; u32 freeSize;
u32 allocatedSize; u32 allocatedSize;
@ -867,7 +867,7 @@ s32 __osCheckArena(Arena* arena) {
while (iter != NULL) { while (iter != NULL) {
//! @bug: Probably intended to be `!NODE_IS_VALID(iter)` //! @bug: Probably intended to be `!NODE_IS_VALID(iter)`
if (NODE_IS_VALID(iter)) { if (NODE_IS_VALID(iter)) {
#if OOT_DEBUG #if DEBUG_FEATURES
osSyncPrintf(VT_COL(RED, WHITE) T("おおっと!! (%08x %08x)\n", "Oops!! (%08x %08x)\n") VT_RST, iter, osSyncPrintf(VT_COL(RED, WHITE) T("おおっと!! (%08x %08x)\n", "Oops!! (%08x %08x)\n") VT_RST, iter,
iter->magic); iter->magic);
#else #else
@ -886,7 +886,7 @@ s32 __osCheckArena(Arena* arena) {
return error; return error;
} }
#if OOT_DEBUG #if DEBUG_FEATURES
u8 ArenaImpl_GetAllocFailures(Arena* arena) { u8 ArenaImpl_GetAllocFailures(Arena* arena) {
return arena->allocFailures; return arena->allocFailures;
} }

View file

@ -9,14 +9,16 @@
Arena gSystemArena; Arena gSystemArena;
#if OOT_DEBUG #if DEBUG_FEATURES
s32 gSystemArenaLogSeverity = LOG_SEVERITY_NOLOG; s32 gSystemArenaLogSeverity = LOG_SEVERITY_NOLOG;
void SystemArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action) { void SystemArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action) {
if (ptr == NULL) { if (ptr == NULL) {
if (gSystemArenaLogSeverity >= LOG_SEVERITY_ERROR) { if (gSystemArenaLogSeverity >= LOG_SEVERITY_ERROR) {
PRINTF(T("%s: %u バイトの%sに失敗しました\n", "%s: %u bytes %s failed\n"), name, size, action); PRINTF(T("%s: %u バイトの%sに失敗しました\n", "%s: %u bytes %s failed\n"), name, size, action);
#if PLATFORM_GC
__osDisplayArena(&gSystemArena); __osDisplayArena(&gSystemArena);
#endif
return; return;
} }
} else if (gSystemArenaLogSeverity >= LOG_SEVERITY_VERBOSE) { } else if (gSystemArenaLogSeverity >= LOG_SEVERITY_VERBOSE) {
@ -41,7 +43,7 @@ void* SystemArena_Malloc(u32 size) {
return ptr; return ptr;
} }
#if OOT_DEBUG #if DEBUG_FEATURES
void* SystemArena_MallocDebug(u32 size, const char* file, int line) { void* SystemArena_MallocDebug(u32 size, const char* file, int line) {
DECLARE_INTERRUPT_MASK DECLARE_INTERRUPT_MASK
void* ptr; void* ptr;
@ -67,7 +69,7 @@ void* SystemArena_MallocR(u32 size) {
return ptr; return ptr;
} }
#if OOT_DEBUG #if DEBUG_FEATURES
void* SystemArena_MallocRDebug(u32 size, const char* file, int line) { void* SystemArena_MallocRDebug(u32 size, const char* file, int line) {
DECLARE_INTERRUPT_MASK DECLARE_INTERRUPT_MASK
void* ptr; void* ptr;
@ -92,7 +94,7 @@ void* SystemArena_Realloc(void* ptr, u32 newSize) {
return ptr; return ptr;
} }
#if OOT_DEBUG #if DEBUG_FEATURES
void* SystemArena_ReallocDebug(void* ptr, u32 newSize, const char* file, int line) { void* SystemArena_ReallocDebug(void* ptr, u32 newSize, const char* file, int line) {
DECLARE_INTERRUPT_MASK DECLARE_INTERRUPT_MASK
@ -113,7 +115,7 @@ void SystemArena_Free(void* ptr) {
RESTORE_INTERRUPTS(); RESTORE_INTERRUPTS();
} }
#if OOT_DEBUG #if DEBUG_FEATURES
void SystemArena_FreeDebug(void* ptr, const char* file, int line) { void SystemArena_FreeDebug(void* ptr, const char* file, int line) {
DECLARE_INTERRUPT_MASK DECLARE_INTERRUPT_MASK
@ -140,7 +142,7 @@ void* SystemArena_Calloc(u32 num, u32 size) {
return ret; return ret;
} }
#if OOT_DEBUG #if PLATFORM_GC && DEBUG_FEATURES
void SystemArena_Display(void) { void SystemArena_Display(void) {
PRINTF(T("システムヒープ表示\n", "System heap display\n")); PRINTF(T("システムヒープ表示\n", "System heap display\n"));
__osDisplayArena(&gSystemArena); __osDisplayArena(&gSystemArena);
@ -156,14 +158,14 @@ void SystemArena_Check(void) {
} }
void SystemArena_Init(void* start, u32 size) { void SystemArena_Init(void* start, u32 size) {
#if OOT_DEBUG #if DEBUG_FEATURES
gSystemArenaLogSeverity = LOG_SEVERITY_NOLOG; gSystemArenaLogSeverity = LOG_SEVERITY_NOLOG;
#endif #endif
__osMallocInit(&gSystemArena, start, size); __osMallocInit(&gSystemArena, start, size);
} }
void SystemArena_Cleanup(void) { void SystemArena_Cleanup(void) {
#if OOT_DEBUG #if DEBUG_FEATURES
gSystemArenaLogSeverity = LOG_SEVERITY_NOLOG; gSystemArenaLogSeverity = LOG_SEVERITY_NOLOG;
#endif #endif
__osMallocCleanup(&gSystemArena); __osMallocCleanup(&gSystemArena);

View file

@ -14,7 +14,7 @@ typedef struct InitFunc {
// .data // .data
void* sInitFuncs = NULL; void* sInitFuncs = NULL;
#if OOT_DEBUG #if DEBUG_FEATURES
char sNew[] = "new"; char sNew[] = "new";
#else #else
char sNew[] = ""; char sNew[] = "";
@ -38,7 +38,7 @@ void* func_800FC800(u32 size) {
size = 1; size = 1;
} }
#if OOT_DEBUG #if DEBUG_FEATURES
ptr = __osMallocDebug(&gSystemArena, size, sNew, 0); ptr = __osMallocDebug(&gSystemArena, size, sNew, 0);
#else #else
ptr = __osMalloc(&gSystemArena, size); ptr = __osMalloc(&gSystemArena, size);

View file

@ -2,7 +2,7 @@
#include "fault.h" #include "fault.h"
#include "terminal.h" #include "terminal.h"
#if PLATFORM_N64 || OOT_DEBUG #if PLATFORM_N64 || DEBUG_FEATURES
f32 LogUtils_CheckFloatRange(const char* exp, int line, const char* valueName, f32 value, const char* minName, f32 min, f32 LogUtils_CheckFloatRange(const char* exp, int line, const char* valueName, f32 value, const char* minName, f32 min,
const char* maxName, f32 max) { const char* maxName, f32 max) {
if (value < min || max < value) { if (value < min || max < value) {
@ -13,7 +13,7 @@ f32 LogUtils_CheckFloatRange(const char* exp, int line, const char* valueName, f
} }
#endif #endif
#if OOT_DEBUG #if DEBUG_FEATURES
s32 LogUtils_CheckIntRange(const char* exp, int line, const char* valueName, s32 value, const char* minName, s32 min, s32 LogUtils_CheckIntRange(const char* exp, int line, const char* valueName, s32 value, const char* minName, s32 min,
const char* maxName, s32 max) { const char* maxName, s32 max) {
if (value < min || max < value) { if (value < min || max < value) {
@ -113,14 +113,14 @@ void LogUtils_LogThreadId(const char* name, int line) {
void LogUtils_HungupThread(const char* name, int line) { void LogUtils_HungupThread(const char* name, int line) {
OSId threadId = osGetThreadId(NULL); OSId threadId = osGetThreadId(NULL);
#if PLATFORM_N64 || OOT_DEBUG #if PLATFORM_N64 || DEBUG_FEATURES
osSyncPrintf("*** HungUp in thread %d, [%s:%d] ***\n", threadId, name, line); osSyncPrintf("*** HungUp in thread %d, [%s:%d] ***\n", threadId, name, line);
#endif #endif
Fault_AddHungupAndCrash(name, line); Fault_AddHungupAndCrash(name, line);
} }
void LogUtils_ResetHungup(void) { void LogUtils_ResetHungup(void) {
#if PLATFORM_N64 || OOT_DEBUG #if PLATFORM_N64 || DEBUG_FEATURES
osSyncPrintf("*** Reset ***\n"); osSyncPrintf("*** Reset ***\n");
#endif #endif
Fault_AddHungupAndCrash("Reset", 0); Fault_AddHungupAndCrash("Reset", 0);

View file

@ -382,7 +382,7 @@ void GfxPrint_Open(GfxPrint* this, Gfx* dList) {
this->dList = dList; this->dList = dList;
GfxPrint_Setup(this); GfxPrint_Setup(this);
} else { } else {
#if PLATFORM_N64 || OOT_DEBUG #if PLATFORM_N64 || DEBUG_FEATURES
osSyncPrintf(T("gfxprint_open:2重オープンです\n", "gfxprint_open: Double open\n")); osSyncPrintf(T("gfxprint_open:2重オープンです\n", "gfxprint_open: Double open\n"));
#endif #endif
} }

View file

@ -1,6 +1,6 @@
#include "global.h" #include "global.h"
#if PLATFORM_N64 || OOT_DEBUG #if PLATFORM_N64 || DEBUG_FEATURES
#define RCP_UTILS_PRINTF osSyncPrintf #define RCP_UTILS_PRINTF osSyncPrintf
#elif IDO_PRINTF_WORKAROUND #elif IDO_PRINTF_WORKAROUND
#define RCP_UTILS_PRINTF(args) (void)0 #define RCP_UTILS_PRINTF(args) (void)0

View file

@ -167,7 +167,7 @@ u32 StackCheck_GetState(StackEntry* entry) {
ret = STACK_STATUS_OK; ret = STACK_STATUS_OK;
} }
#if !OOT_DEBUG #if !DEBUG_FEATURES
// This string is still in .rodata for retail builds // This string is still in .rodata for retail builds
(void)"(null)"; (void)"(null)";
#endif #endif
@ -176,7 +176,7 @@ u32 StackCheck_GetState(StackEntry* entry) {
entry->name != NULL ? entry->name : "(null)"); entry->name != NULL ? entry->name : "(null)");
PRINTF(VT_RST); PRINTF(VT_RST);
#if OOT_DEBUG #if DEBUG_FEATURES
if (ret != STACK_STATUS_OK) { if (ret != STACK_STATUS_OK) {
LogUtils_LogHexDump(entry->head, (uintptr_t)entry->tail - (uintptr_t)entry->head); LogUtils_LogHexDump(entry->head, (uintptr_t)entry->tail - (uintptr_t)entry->head);
} }

View file

@ -97,7 +97,7 @@ void BgBdanSwitch_InitDynaPoly(BgBdanSwitch* this, PlayState* play, CollisionHea
CollisionHeader_GetVirtual(collision, &colHeader); CollisionHeader_GetVirtual(collision, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader);
#if OOT_DEBUG #if DEBUG_FEATURES
if (this->dyna.bgId == BG_ACTOR_MAX) { if (this->dyna.bgId == BG_ACTOR_MAX) {
s32 pad2; s32 pad2;

View file

@ -287,7 +287,7 @@ void BgDyYoseizo_ChooseType(BgDyYoseizo* this, PlayState* play) {
} }
if (givingReward) { if (givingReward) {
if (!IS_CUTSCENE_LAYER || !OOT_DEBUG) { if (!IS_CUTSCENE_LAYER || !DEBUG_FEATURES) {
if (play->sceneId != SCENE_GREAT_FAIRYS_FOUNTAIN_MAGIC) { if (play->sceneId != SCENE_GREAT_FAIRYS_FOUNTAIN_MAGIC) {
switch (this->fountainType) { switch (this->fountainType) {
case FAIRY_SPELL_FARORES_WIND: case FAIRY_SPELL_FARORES_WIND:

View file

@ -86,7 +86,7 @@ void BgHidanCurtain_Init(Actor* thisx, PlayState* play) {
this->treasureFlag = PARAMS_GET_U(thisx->params, 6, 6); this->treasureFlag = PARAMS_GET_U(thisx->params, 6, 6);
thisx->params &= 0x3F; thisx->params &= 0x3F;
if (OOT_DEBUG && ((this->actor.params < 0) || (this->actor.params > 0x3F))) { if (DEBUG_FEATURES && ((this->actor.params < 0) || (this->actor.params > 0x3F))) {
// "Save bit is not set" // "Save bit is not set"
PRINTF("Warning : object のセーブビットが設定されていない(%s %d)(arg_data 0x%04x)\n", "../z_bg_hidan_curtain.c", PRINTF("Warning : object のセーブビットが設定されていない(%s %d)(arg_data 0x%04x)\n", "../z_bg_hidan_curtain.c",
373, this->actor.params); 373, this->actor.params);

View file

@ -348,7 +348,7 @@ void func_80888A58(BgHidanHamstep* this, PlayState* play) {
Actor_MoveXZGravity(&this->dyna.actor); Actor_MoveXZGravity(&this->dyna.actor);
func_80888694(this, (BgHidanHamstep*)this->dyna.actor.parent); func_80888694(this, (BgHidanHamstep*)this->dyna.actor.parent);
#if OOT_DEBUG #if DEBUG_FEATURES
if (PARAMS_GET_U(this->dyna.actor.params, 0, 8) <= 0 || PARAMS_GET_U(this->dyna.actor.params, 0, 8) >= 6) { if (PARAMS_GET_U(this->dyna.actor.params, 0, 8) <= 0 || PARAMS_GET_U(this->dyna.actor.params, 0, 8) >= 6) {
// "[Hammer Step] arg_data strange (arg_data = %d)" // "[Hammer Step] arg_data strange (arg_data = %d)"
PRINTF("【ハンマーステップ】 arg_data おかしい (arg_data = %d)", this->dyna.actor.params); PRINTF("【ハンマーステップ】 arg_data おかしい (arg_data = %d)", this->dyna.actor.params);

View file

@ -74,7 +74,7 @@ void BgHidanKousi_Init(Actor* thisx, PlayState* play) {
Actor_ProcessInitChain(thisx, sInitChain); Actor_ProcessInitChain(thisx, sInitChain);
#if OOT_DEBUG #if DEBUG_FEATURES
if (PARAMS_GET_U(thisx->params, 0, 8) < 0 || PARAMS_GET_U(thisx->params, 0, 8) >= 3) { if (PARAMS_GET_U(thisx->params, 0, 8) < 0 || PARAMS_GET_U(thisx->params, 0, 8) >= 3) {
PRINTF("arg_data おかしい 【格子】\n"); PRINTF("arg_data おかしい 【格子】\n");
} }

View file

@ -120,7 +120,7 @@ void BgIceShelter_InitDynaPoly(BgIceShelter* this, PlayState* play, CollisionHea
CollisionHeader_GetVirtual(collision, &colHeader); CollisionHeader_GetVirtual(collision, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader);
#if OOT_DEBUG #if DEBUG_FEATURES
if (this->dyna.bgId == BG_ACTOR_MAX) { if (this->dyna.bgId == BG_ACTOR_MAX) {
s32 pad2; s32 pad2;

View file

@ -74,7 +74,7 @@ void BgJya1flift_InitDynapoly(BgJya1flift* this, PlayState* play, CollisionHeade
CollisionHeader_GetVirtual(collision, &colHeader); CollisionHeader_GetVirtual(collision, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader);
#if OOT_DEBUG #if DEBUG_FEATURES
if (this->dyna.bgId == BG_ACTOR_MAX) { if (this->dyna.bgId == BG_ACTOR_MAX) {
s32 pad2; s32 pad2;

View file

@ -50,7 +50,7 @@ void BgJyaAmishutter_InitDynaPoly(BgJyaAmishutter* this, PlayState* play, Collis
CollisionHeader_GetVirtual(collision, &colHeader); CollisionHeader_GetVirtual(collision, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader);
#if OOT_DEBUG #if DEBUG_FEATURES
if (this->dyna.bgId == BG_ACTOR_MAX) { if (this->dyna.bgId == BG_ACTOR_MAX) {
s32 pad2; s32 pad2;

View file

@ -74,7 +74,7 @@ void BgJyaBigmirror_HandleCobra(Actor* thisx, PlayState* play) {
this->puzzleFlags &= ~cobraPuzzleFlags[i]; this->puzzleFlags &= ~cobraPuzzleFlags[i];
} }
#if OOT_DEBUG #if DEBUG_FEATURES
if (curCobraInfo->cobra->dyna.actor.update == NULL) { if (curCobraInfo->cobra->dyna.actor.update == NULL) {
// "Cobra deleted" // "Cobra deleted"
PRINTF("Error : コブラ削除された (%s %d)\n", "../z_bg_jya_bigmirror.c", 203); PRINTF("Error : コブラ削除された (%s %d)\n", "../z_bg_jya_bigmirror.c", 203);
@ -153,7 +153,7 @@ void BgJyaBigmirror_HandleMirRay(Actor* thisx, PlayState* play) {
Actor_Spawn(&play->actorCtx, play, ACTOR_MIR_RAY, sMirRayPositions[i].x, sMirRayPositions[i].y, Actor_Spawn(&play->actorCtx, play, ACTOR_MIR_RAY, sMirRayPositions[i].x, sMirRayPositions[i].y,
sMirRayPositions[i].z, 0, 0, 0, sMirRayParamsVals[i]); sMirRayPositions[i].z, 0, 0, 0, sMirRayParamsVals[i]);
#if OOT_DEBUG #if DEBUG_FEATURES
if (this->lightBeams[i] == NULL) { if (this->lightBeams[i] == NULL) {
// "Mir Ray generation failed" // "Mir Ray generation failed"
PRINTF("Error : Mir Ray 発生失敗 (%s %d)\n", "../z_bg_jya_bigmirror.c", 310); PRINTF("Error : Mir Ray 発生失敗 (%s %d)\n", "../z_bg_jya_bigmirror.c", 310);

View file

@ -70,7 +70,7 @@ void BgJyaBombiwa_SetupDynaPoly(BgJyaBombiwa* this, PlayState* play, CollisionHe
CollisionHeader_GetVirtual(collision, &colHeader); CollisionHeader_GetVirtual(collision, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader);
#if OOT_DEBUG #if DEBUG_FEATURES
if (this->dyna.bgId == BG_ACTOR_MAX) { if (this->dyna.bgId == BG_ACTOR_MAX) {
s32 pad2; s32 pad2;

View file

@ -123,7 +123,7 @@ void BgJyaCobra_InitDynapoly(BgJyaCobra* this, PlayState* play, CollisionHeader*
CollisionHeader_GetVirtual(collision, &colHeader); CollisionHeader_GetVirtual(collision, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader);
#if OOT_DEBUG #if DEBUG_FEATURES
if (this->dyna.bgId == BG_ACTOR_MAX) { if (this->dyna.bgId == BG_ACTOR_MAX) {
s32 pad2; s32 pad2;
@ -138,7 +138,7 @@ void BgJyaCobra_SpawnRay(BgJyaCobra* this, PlayState* play) {
Actor_SpawnAsChild(&play->actorCtx, &this->dyna.actor, play, ACTOR_MIR_RAY, this->dyna.actor.world.pos.x, Actor_SpawnAsChild(&play->actorCtx, &this->dyna.actor, play, ACTOR_MIR_RAY, this->dyna.actor.world.pos.x,
this->dyna.actor.world.pos.y + 57.0f, this->dyna.actor.world.pos.z, 0, 0, 0, 6); this->dyna.actor.world.pos.y + 57.0f, this->dyna.actor.world.pos.z, 0, 0, 0, 6);
#if OOT_DEBUG #if DEBUG_FEATURES
if (this->dyna.actor.child == NULL) { if (this->dyna.actor.child == NULL) {
PRINTF(VT_FGCOL(RED)); PRINTF(VT_FGCOL(RED));
// " : Mir Ray occurrence failure" // " : Mir Ray occurrence failure"

View file

@ -106,7 +106,7 @@ void BgJyaIronobj_SpawnPillarParticles(BgJyaIronobj* this, PlayState* play, EnIk
f32 sins; f32 sins;
s32 pad[2]; s32 pad[2];
#if OOT_DEBUG #if DEBUG_FEATURES
if (enIk->unk_2FF <= 0 || enIk->unk_2FF >= 4) { if (enIk->unk_2FF <= 0 || enIk->unk_2FF >= 4) {
PRINTF("Error 攻撃方法が分からない(%s %d)\n", "../z_bg_jya_ironobj.c", 233); PRINTF("Error 攻撃方法が分からない(%s %d)\n", "../z_bg_jya_ironobj.c", 233);
return; return;
@ -172,7 +172,7 @@ void BgJyaIronobj_SpawnThroneParticles(BgJyaIronobj* this, PlayState* play, EnIk
f32 sins; f32 sins;
s32 pad[2]; s32 pad[2];
#if OOT_DEBUG #if DEBUG_FEATURES
if (enIk->unk_2FF <= 0 || enIk->unk_2FF >= 4) { if (enIk->unk_2FF <= 0 || enIk->unk_2FF >= 4) {
PRINTF("Error 攻撃方法が分からない(%s %d)\n", "../z_bg_jya_ironobj.c", 362); PRINTF("Error 攻撃方法が分からない(%s %d)\n", "../z_bg_jya_ironobj.c", 362);
return; return;

View file

@ -48,7 +48,7 @@ void BgJyaKanaami_InitDynaPoly(BgJyaKanaami* this, PlayState* play, CollisionHea
CollisionHeader_GetVirtual(collision, &colHeader); CollisionHeader_GetVirtual(collision, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader);
#if OOT_DEBUG #if DEBUG_FEATURES
if (this->dyna.bgId == BG_ACTOR_MAX) { if (this->dyna.bgId == BG_ACTOR_MAX) {
s32 pad2; s32 pad2;

View file

@ -67,7 +67,7 @@ void BgJyaZurerukabe_InitDynaPoly(BgJyaZurerukabe* this, PlayState* play, Collis
CollisionHeader_GetVirtual(collision, &colHeader); CollisionHeader_GetVirtual(collision, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader);
#if OOT_DEBUG #if DEBUG_FEATURES
if (this->dyna.bgId == BG_ACTOR_MAX) { if (this->dyna.bgId == BG_ACTOR_MAX) {
s32 pad2; s32 pad2;

View file

@ -53,7 +53,7 @@ static InitChainEntry sInitChain[] = {
u32 BgMizuWater_GetWaterLevelActionIndex(s16 switchFlag, PlayState* play) { u32 BgMizuWater_GetWaterLevelActionIndex(s16 switchFlag, PlayState* play) {
u32 ret; u32 ret;
#if OOT_DEBUG #if DEBUG_FEATURES
if (bREG(0) != 0) { if (bREG(0) != 0) {
switch (bREG(1)) { switch (bREG(1)) {
case 0: case 0:
@ -300,7 +300,7 @@ void BgMizuWater_Update(Actor* thisx, PlayState* play) {
s32 unk1; s32 unk1;
s32 pad; s32 pad;
#if OOT_DEBUG #if DEBUG_FEATURES
if (bREG(15) == 0) { if (bREG(15) == 0) {
PRINTF("%x %x %x\n", Flags_GetSwitch(play, WATER_TEMPLE_WATER_F1_FLAG), PRINTF("%x %x %x\n", Flags_GetSwitch(play, WATER_TEMPLE_WATER_F1_FLAG),
Flags_GetSwitch(play, WATER_TEMPLE_WATER_F2_FLAG), Flags_GetSwitch(play, WATER_TEMPLE_WATER_F3_FLAG)); Flags_GetSwitch(play, WATER_TEMPLE_WATER_F2_FLAG), Flags_GetSwitch(play, WATER_TEMPLE_WATER_F3_FLAG));

View file

@ -58,7 +58,7 @@ void BgMoriBigst_InitDynapoly(BgMoriBigst* this, PlayState* play, CollisionHeade
CollisionHeader_GetVirtual(collision, &colHeader); CollisionHeader_GetVirtual(collision, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader);
#if OOT_DEBUG #if DEBUG_FEATURES
if (this->dyna.bgId == BG_ACTOR_MAX) { if (this->dyna.bgId == BG_ACTOR_MAX) {
s32 pad2; s32 pad2;

View file

@ -89,7 +89,7 @@ void BgMoriElevator_Init(Actor* thisx, PlayState* play) {
this->unk_172 = sIsSpawned; this->unk_172 = sIsSpawned;
this->moriTexObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_MORI_TEX); this->moriTexObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_MORI_TEX);
#if OOT_DEBUG #if DEBUG_FEATURES
if (this->moriTexObjectSlot < 0) { if (this->moriTexObjectSlot < 0) {
Actor_Kill(thisx); Actor_Kill(thisx);
// "Forest Temple obj elevator Bank Danger!" // "Forest Temple obj elevator Bank Danger!"

View file

@ -87,7 +87,7 @@ void BgMoriHashigo_InitDynapoly(BgMoriHashigo* this, PlayState* play, CollisionH
CollisionHeader_GetVirtual(collision, &colHeader); CollisionHeader_GetVirtual(collision, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader);
#if OOT_DEBUG #if DEBUG_FEATURES
if (this->dyna.bgId == BG_ACTOR_MAX) { if (this->dyna.bgId == BG_ACTOR_MAX) {
s32 pad2; s32 pad2;

View file

@ -56,7 +56,7 @@ void BgMoriHashira4_InitDynaPoly(BgMoriHashira4* this, PlayState* play, Collisio
CollisionHeader_GetVirtual(collision, &colHeader); CollisionHeader_GetVirtual(collision, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader);
#if OOT_DEBUG #if DEBUG_FEATURES
if (this->dyna.bgId == BG_ACTOR_MAX) { if (this->dyna.bgId == BG_ACTOR_MAX) {
s32 pad2; s32 pad2;

View file

@ -53,7 +53,7 @@ void BgMoriRakkatenjo_Init(Actor* thisx, PlayState* play) {
DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS); DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS);
#if OOT_DEBUG #if DEBUG_FEATURES
// "Forest Temple obj. Falling Ceiling" // "Forest Temple obj. Falling Ceiling"
PRINTF("森の神殿 obj. 落下天井 (home posY %f)\n", this->dyna.actor.home.pos.y); PRINTF("森の神殿 obj. 落下天井 (home posY %f)\n", this->dyna.actor.home.pos.y);
if ((fabsf(1991.0f - this->dyna.actor.home.pos.x) > 0.001f) || if ((fabsf(1991.0f - this->dyna.actor.home.pos.x) > 0.001f) ||

Some files were not shown because too many files have changed in this diff Show more