From 17edb82c0d22fb78135033f92a624bd6cde6f495 Mon Sep 17 00:00:00 2001 From: fig02 Date: Sun, 17 Nov 2024 17:02:07 -0500 Subject: [PATCH] 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 --- Makefile | 41 +++++----- data/z_text.data.s | 3 +- docs/c_cpp_properties.json | 18 ++--- docs/vscode.md | 2 +- include/functions.h | 12 +-- include/gfx.h | 2 +- include/libc64/malloc.h | 2 +- include/libc64/os_malloc.h | 12 ++- include/macros.h | 8 +- include/segment_symbols.h | 7 +- include/sfx.h | 2 +- include/sys_matrix.h | 2 +- include/tables/dmadata_table.h | 8 +- include/tables/scene_table.h | 2 +- include/variables.h | 6 +- include/versions.h | 9 +++ include/z64actor.h | 4 +- include/z64bgcheck.h | 2 +- include/z64collision_check.h | 4 +- include/z64dma.h | 2 +- include/z64play.h | 2 +- include/z64scene.h | 2 +- include/z64view.h | 4 +- include/zelda_arena.h | 2 +- spec | 79 ++++++++++--------- src/audio/data.c | 4 +- src/audio/general.c | 34 ++++---- src/audio/sequence.c | 4 +- src/audio/sfx.c | 8 +- src/boot/boot_main.c | 2 +- src/boot/idle.c | 4 +- src/boot/is_debug.c | 10 +-- src/boot/z_locale.c | 2 +- src/boot/z_std_dma.c | 24 +++--- src/code/PreRender.c | 4 +- src/code/code_800430A0.c | 2 +- src/code/code_800D31A0.c | 4 +- src/code/debug_malloc.c | 18 +++-- src/code/game.c | 41 ++++++---- src/code/gamealloc.c | 2 +- src/code/graph.c | 24 +++--- src/code/main.c | 6 +- src/code/padmgr.c | 8 +- src/code/sched.c | 6 +- src/code/shrink_window.c | 2 +- src/code/sys_cfb.c | 4 +- src/code/sys_math3d.c | 2 +- src/code/sys_matrix.c | 8 +- src/code/sys_rumble.c | 2 +- src/code/z_actor.c | 34 ++++---- src/code/z_actor_dlftbls.c | 6 +- src/code/z_bgcheck.c | 18 ++--- src/code/z_camera.c | 62 +++++++-------- src/code/z_camera_data.inc.c | 10 +-- src/code/z_collision_check.c | 12 +-- src/code/z_debug.c | 6 +- src/code/z_demo.c | 18 ++--- src/code/z_effect_soft_sprite.c | 2 +- src/code/z_kaleido_scope_call.c | 4 +- src/code/z_kaleido_setup.c | 2 +- src/code/z_kankyo.c | 16 ++-- src/code/z_malloc.c | 18 +++-- src/code/z_map_mark.c | 4 +- src/code/z_message.c | 8 +- src/code/z_onepointdemo.c | 2 +- src/code/z_parameter.c | 4 +- src/code/z_play.c | 62 ++++++++------- src/code/z_rcp.c | 4 +- src/code/z_scene_table.c | 2 +- src/code/z_sram.c | 8 +- src/code/z_view.c | 8 +- src/libc/absf.s | 2 +- src/libc/sqrt.s | 2 +- src/libc64/__osMalloc_gc.c | 24 +++--- src/libc64/malloc.c | 18 +++-- src/libu64/code_800FC620.c | 4 +- src/libu64/debug.c | 8 +- src/libu64/gfxprint.c | 2 +- src/libu64/rcp_utils.c | 2 +- src/libu64/stackcheck.c | 4 +- .../ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c | 2 +- .../ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c | 2 +- .../ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c | 2 +- .../ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c | 2 +- .../ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c | 2 +- .../ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c | 2 +- .../ovl_Bg_Jya_1flift/z_bg_jya_1flift.c | 2 +- .../z_bg_jya_amishutter.c | 2 +- .../ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c | 4 +- .../ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c | 2 +- .../actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c | 4 +- .../ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c | 4 +- .../ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c | 2 +- .../z_bg_jya_zurerukabe.c | 2 +- .../ovl_Bg_Mizu_Water/z_bg_mizu_water.c | 4 +- .../ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c | 2 +- .../ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c | 2 +- .../ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c | 2 +- .../ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c | 2 +- .../z_bg_mori_rakkatenjo.c | 2 +- .../z_bg_spot08_iceblock.c | 2 +- .../ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c | 2 +- .../ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c | 2 +- .../ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c | 2 +- .../z_bg_spot16_bombstone.c | 4 +- src/overlays/actors/ovl_Demo_Du/z_demo_du.c | 8 +- .../actors/ovl_Demo_Geff/z_demo_geff.c | 2 +- src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c | 14 ++-- src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c | 38 ++++----- src/overlays/actors/ovl_Demo_Im/z_demo_im.c | 12 +-- src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c | 10 +-- src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c | 6 +- src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c | 6 +- .../ovl_En_Anubice_Tag/z_en_anubice_tag.c | 2 +- .../actors/ovl_En_Changer/z_en_changer.c | 2 +- src/overlays/actors/ovl_En_Dns/z_en_dns.c | 2 +- .../actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c | 2 +- src/overlays/actors/ovl_En_Eg/z_en_eg.c | 2 +- src/overlays/actors/ovl_En_Elf/z_en_elf.c | 4 +- .../actors/ovl_En_Encount1/z_en_encount1.c | 2 +- .../actors/ovl_En_Fire_Rock/z_en_fire_rock.c | 2 +- src/overlays/actors/ovl_En_Fr/z_en_fr.c | 2 +- .../actors/ovl_En_G_Switch/z_en_g_switch.c | 2 +- src/overlays/actors/ovl_En_GirlA/z_en_girla.c | 2 +- .../actors/ovl_En_Goroiwa/z_en_goroiwa.c | 8 +- src/overlays/actors/ovl_En_Gs/z_en_gs.c | 4 +- .../actors/ovl_En_Heishi1/z_en_heishi1.c | 6 +- .../actors/ovl_En_Ice_Hono/z_en_ice_hono.c | 2 +- .../actors/ovl_En_Kakasi2/z_en_kakasi2.c | 4 +- src/overlays/actors/ovl_En_Nb/z_en_nb.c | 10 +-- .../actors/ovl_En_Niw_Lady/z_en_niw_lady.c | 2 +- .../z_en_okarina_effect.c | 2 +- .../ovl_En_Okarina_Tag/z_en_okarina_tag.c | 2 +- src/overlays/actors/ovl_En_Ossan/z_en_ossan.c | 2 +- src/overlays/actors/ovl_En_Reeba/z_en_reeba.c | 2 +- src/overlays/actors/ovl_En_Rl/z_en_rl.c | 10 +-- src/overlays/actors/ovl_En_Rr/z_en_rr.c | 2 +- src/overlays/actors/ovl_En_Ru1/z_en_ru1.c | 18 ++--- src/overlays/actors/ovl_En_Ru2/z_en_ru2.c | 10 +-- src/overlays/actors/ovl_En_Skj/z_en_skj.c | 6 +- .../ovl_En_Syateki_Itm/z_en_syateki_itm.c | 2 +- .../ovl_En_Syateki_Man/z_en_syateki_man.c | 8 +- src/overlays/actors/ovl_En_Tana/z_en_tana.c | 2 +- .../actors/ovl_En_Wall_Tubo/z_en_wall_tubo.c | 2 +- .../ovl_En_Weather_Tag/z_en_weather_tag.c | 2 +- .../ovl_En_Wonder_Item/z_en_wonder_item.c | 6 +- .../ovl_En_Wonder_Talk/z_en_wonder_talk.c | 2 +- .../ovl_En_Wonder_Talk2/z_en_wonder_talk2.c | 6 +- src/overlays/actors/ovl_En_Xc/z_en_xc.c | 16 ++-- .../ovl_En_Yabusame_Mark/z_en_yabusame_mark.c | 2 +- src/overlays/actors/ovl_En_Zl2/z_en_zl2.c | 4 +- src/overlays/actors/ovl_En_Zl3/z_en_zl3.c | 2 +- src/overlays/actors/ovl_Fishing/z_fishing.c | 34 ++++---- src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c | 6 +- .../actors/ovl_Obj_Elevator/z_obj_elevator.c | 2 +- .../actors/ovl_Obj_Hsblock/z_obj_hsblock.c | 6 +- src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c | 2 +- src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c | 8 +- .../actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c | 4 +- .../actors/ovl_Obj_Switch/z_obj_switch.c | 2 +- .../actors/ovl_player_actor/z_player.c | 12 +-- .../ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c | 2 +- .../ovl_file_choose/z_file_choose.c | 4 +- src/overlays/gamestates/ovl_select/z_select.c | 2 +- src/overlays/gamestates/ovl_title/z_title.c | 4 +- .../misc/ovl_kaleido_scope/z_kaleido_map.c | 2 +- .../misc/ovl_kaleido_scope/z_kaleido_scope.c | 4 +- .../misc/ovl_kaleido_scope/z_lmap_mark.c | 2 +- 168 files changed, 652 insertions(+), 606 deletions(-) diff --git a/Makefile b/Makefile index 67ec18b4c9..e390b5636c 100644 --- a/Makefile +++ b/Makefile @@ -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 # of the debug ROM for better emulator compatibility, or to build US versions of NTSC N64 ROMs. # 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 ?= CPPFLAGS ?= @@ -60,57 +65,57 @@ ifeq ($(VERSION),ntsc-1.0) REGIONAL_CHECKSUM := 1 REGION ?= JP PLATFORM := N64 - DEBUG := 0 + DEBUG_FEATURES ?= 0 else ifeq ($(VERSION),ntsc-1.1) REGIONAL_CHECKSUM := 1 REGION ?= JP PLATFORM := N64 - DEBUG := 0 + DEBUG_FEATURES ?= 0 else ifeq ($(VERSION),pal-1.0) REGION ?= EU PLATFORM := N64 - DEBUG := 0 + DEBUG_FEATURES ?= 0 else ifeq ($(VERSION),ntsc-1.2) REGIONAL_CHECKSUM := 1 REGION ?= JP PLATFORM := N64 - DEBUG := 0 + DEBUG_FEATURES ?= 0 else ifeq ($(VERSION),pal-1.1) REGION ?= EU PLATFORM := N64 - DEBUG := 0 + DEBUG_FEATURES ?= 0 else ifeq ($(VERSION),gc-jp) REGION ?= JP PLATFORM := GC - DEBUG := 0 + DEBUG_FEATURES ?= 0 else ifeq ($(VERSION),gc-jp-mq) REGION ?= JP PLATFORM := GC - DEBUG := 0 + DEBUG_FEATURES ?= 0 else ifeq ($(VERSION),gc-us) REGION ?= US PLATFORM := GC - DEBUG := 0 + DEBUG_FEATURES ?= 0 else ifeq ($(VERSION),gc-us-mq) REGION ?= US PLATFORM := GC - DEBUG := 0 + DEBUG_FEATURES ?= 0 else ifeq ($(VERSION),gc-eu-mq-dbg) REGION ?= EU PLATFORM := GC - DEBUG := 1 + DEBUG_FEATURES ?= 1 else ifeq ($(VERSION),gc-eu) REGION ?= EU PLATFORM := GC - DEBUG := 0 + DEBUG_FEATURES ?= 0 else ifeq ($(VERSION),gc-eu-mq) REGION ?= EU PLATFORM := GC - DEBUG := 0 + DEBUG_FEATURES ?= 0 else ifeq ($(VERSION),gc-jp-ce) REGION ?= JP PLATFORM := GC - DEBUG := 0 + DEBUG_FEATURES ?= 0 else $(error Unsupported version $(VERSION)) endif @@ -155,11 +160,11 @@ else $(error Unsupported platform $(PLATFORM)) endif -ifeq ($(DEBUG),1) - CPP_DEFINES += -DOOT_DEBUG=1 +ifeq ($(DEBUG_FEATURES),1) + CPP_DEFINES += -DDEBUG_FEATURES=1 OPTFLAGS := -O2 else - CPP_DEFINES += -DOOT_DEBUG=0 -DNDEBUG + CPP_DEFINES += -DDEBUG_FEATURES=0 -DNDEBUG OPTFLAGS := -O2 -g3 endif @@ -254,7 +259,7 @@ GBI_DEFINES := -DF3DEX_GBI_2 ifeq ($(PLATFORM),GC) GBI_DEFINES += -DF3DEX_GBI_PL -DGBI_DOWHILE endif -ifeq ($(DEBUG),1) +ifeq ($(DEBUG_FEATURES),1) GBI_DEFINES += -DGBI_DEBUG endif @@ -459,7 +464,7 @@ endif $(BUILD_DIR)/src/code/jpegutils.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 else $(BUILD_DIR)/src/libc/%.o: OPTFLAGS := -O2 diff --git a/data/z_text.data.s b/data/z_text.data.s index d2a76e0b8e..6efaf07205 100644 --- a/data/z_text.data.s +++ b/data/z_text.data.s @@ -1,4 +1,5 @@ .include "macro.inc" +#include "versions.h" /* assembler directives */ .set noat /* allow manual use of $at */ @@ -11,7 +12,7 @@ /* temporary file name, rename to something more appropriate when decompiled */ -#if OOT_DEBUG +#if DEBUG_ASSETS glabel gMojiFontTLUTs .incbin "incbin/gMojiFontTLUTs" diff --git a/docs/c_cpp_properties.json b/docs/c_cpp_properties.json index b863d21c63..c3e94325c2 100644 --- a/docs/c_cpp_properties.json +++ b/docs/c_cpp_properties.json @@ -19,7 +19,7 @@ "OOT_REGION=REGION_JP", "PLATFORM_N64=1", "PLATFORM_GC=0", - "OOT_DEBUG=0", + "DEBUG_FEATURES=0", "NDEBUG", "F3DEX_GBI_2" ], @@ -44,7 +44,7 @@ "OOT_REGION=REGION_JP", "PLATFORM_N64=0", "PLATFORM_GC=1", - "OOT_DEBUG=0", + "DEBUG_FEATURES=0", "NDEBUG", "F3DEX_GBI_2", "F3DEX_GBI_PL", @@ -71,7 +71,7 @@ "OOT_REGION=REGION_JP", "PLATFORM_N64=0", "PLATFORM_GC=1", - "OOT_DEBUG=0", + "DEBUG_FEATURES=0", "NDEBUG", "F3DEX_GBI_2", "F3DEX_GBI_PL", @@ -98,7 +98,7 @@ "OOT_REGION=REGION_US", "PLATFORM_N64=0", "PLATFORM_GC=1", - "OOT_DEBUG=0", + "DEBUG_FEATURES=0", "NDEBUG", "F3DEX_GBI_2", "F3DEX_GBI_PL", @@ -125,7 +125,7 @@ "OOT_REGION=REGION_US", "PLATFORM_N64=0", "PLATFORM_GC=1", - "OOT_DEBUG=0", + "DEBUG_FEATURES=0", "NDEBUG", "F3DEX_GBI_2", "F3DEX_GBI_PL", @@ -152,7 +152,7 @@ "OOT_REGION=REGION_EU", "PLATFORM_N64=0", "PLATFORM_GC=1", - "OOT_DEBUG=1", + "DEBUG_FEATURES=1", "F3DEX_GBI_2", "F3DEX_GBI_PL", "GBI_DOWHILE", @@ -179,7 +179,7 @@ "OOT_REGION=REGION_EU", "PLATFORM_N64=0", "PLATFORM_GC=1", - "OOT_DEBUG=0", + "DEBUG_FEATURES=0", "NDEBUG", "F3DEX_GBI_2", "F3DEX_GBI_PL", @@ -206,7 +206,7 @@ "OOT_REGION=REGION_EU", "PLATFORM_N64=0", "PLATFORM_GC=1", - "OOT_DEBUG=0", + "DEBUG_FEATURES=0", "NDEBUG", "F3DEX_GBI_2", "F3DEX_GBI_PL", @@ -233,7 +233,7 @@ "OOT_REGION=REGION_JP", "PLATFORM_N64=0", "PLATFORM_GC=1", - "OOT_DEBUG=0", + "DEBUG_FEATURES=0", "NDEBUG", "F3DEX_GBI_2", "F3DEX_GBI_PL", diff --git a/docs/vscode.md b/docs/vscode.md index 6450e0020e..4262d0beae 100644 --- a/docs/vscode.md +++ b/docs/vscode.md @@ -64,7 +64,7 @@ A more complete `c_cpp_properties.json` with configurations for all supported ve "OOT_REGION=REGION_EU", "PLATFORM_N64=0", "PLATFORM_GC=1", - "OOT_DEBUG=1", + "DEBUG_FEATURES=1", "F3DEX_GBI_2", "F3DEX_GBI_PL", "GBI_DOWHILE", diff --git a/include/functions.h b/include/functions.h index 292d8bde5d..0a4c8004c0 100644 --- a/include/functions.h +++ b/include/functions.h @@ -15,17 +15,17 @@ void Yaz0_DecompressImpl(u8* src, u8* dst); void Yaz0_Decompress(uintptr_t romStart, u8* dst, size_t size); void Locale_Init(void); void Locale_ResetRegion(void); -#if OOT_DEBUG +#if DEBUG_FEATURES void isPrintfInit(void); #endif void rmonPrintf(const char* fmt, ...); -#if OOT_DEBUG +#if DEBUG_FEATURES void* is_proutSyncPrintf(void* arg, const char* str, size_t count); NORETURN void func_80002384(const char* exp, const char* file, int line); #endif OSPiHandle* osDriveRomInit(void); void Mio0_Decompress(u8* src, u8* dst); -#if OOT_DEBUG +#if DEBUG_FEATURES void LogUtils_LogHexDump(void* ptr, s32 size0); 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); @@ -51,7 +51,7 @@ s32 func_800635D0(s32); void Regs_Init(void); void DebugCamera_ScreenText(u8 x, u8 y, 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); #endif void Debug_DrawText(GraphicsContext* gfxCtx); @@ -231,7 +231,7 @@ void GameState_Init(GameState* gameState, GameStateFunc init, GraphicsContext* g void GameState_Destroy(GameState* gameState); GameStateFunc GameState_GetInit(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* GameAlloc_MallocDebug(GameAlloc* this, u32 size, const char* file, int line); #endif @@ -273,7 +273,7 @@ void DebugArena_Check(void); void DebugArena_Init(void* start, u32 size); void DebugArena_Cleanup(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_MallocDebug(u32 size, const char* file, int line); void* DebugArena_MallocRDebug(u32 size, const char* file, int line); diff --git a/include/gfx.h b/include/gfx.h index 2c3d2b0a87..46a06649b9 100644 --- a/include/gfx.h +++ b/include/gfx.h @@ -77,7 +77,7 @@ void* Graph_Alloc2(GraphicsContext* gfxCtx, size_t size); #define POLY_XLU_DISP __gfxCtx->polyXlu.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_CloseDisps(Gfx** dispRefs, GraphicsContext* gfxCtx, const char* file, int line); diff --git a/include/libc64/malloc.h b/include/libc64/malloc.h index b9ae324b96..86b58d17ca 100644 --- a/include/libc64/malloc.h +++ b/include/libc64/malloc.h @@ -15,7 +15,7 @@ void SystemArena_Init(void* start, u32 size); void SystemArena_Cleanup(void); s32 SystemArena_IsInitialized(void); -#if OOT_DEBUG +#if DEBUG_FEATURES void* SystemArena_MallocDebug(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); diff --git a/include/libc64/os_malloc.h b/include/libc64/os_malloc.h index e31a6f08fa..91b0d93c47 100644 --- a/include/libc64/os_malloc.h +++ b/include/libc64/os_malloc.h @@ -25,7 +25,7 @@ typedef struct ArenaNode { /* 0x04 */ u32 size; /* 0x08 */ struct ArenaNode* next; /* 0x0C */ struct ArenaNode* prev; -#if PLATFORM_N64 || OOT_DEBUG +#if PLATFORM_N64 || DEBUG_FEATURES /* 0x10 */ const char* filename; /* 0x14 */ int line; /* 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); s32 __osCheckArena(Arena* arena); -#if OOT_DEBUG +#if PLATFORM_N64 || DEBUG_FEATURES void* __osMallocDebug(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* __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; -#else +#endif + +#if PLATFORM_N64 extern u32 gTotalAllocFailures; #endif diff --git a/include/macros.h b/include/macros.h index 744fd51cb0..59360541d0 100644 --- a/include/macros.h +++ b/include/macros.h @@ -49,7 +49,7 @@ // ensure that these do not use the IDO workaround to avoid errors. #define IDO_PRINTF_WORKAROUND (__sgi && !__GNUC__ && !M2CTX) -#if OOT_DEBUG +#if DEBUG_FEATURES #define PRINTF osSyncPrintf #elif IDO_PRINTF_WORKAROUND #define PRINTF(args) (void)0 @@ -57,7 +57,7 @@ #define PRINTF(format, ...) (void)0 #endif -#if OOT_DEBUG +#if DEBUG_FEATURES #define LOG(exp, value, format, file, line) \ do { \ LogUtils_LogThreadId(file, line); \ @@ -83,7 +83,7 @@ (state)->size = sizeof(newStruct); \ } 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_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 -#if PLATFORM_N64 || OOT_DEBUG +#if PLATFORM_N64 || DEBUG_FEATURES #define HUNGUP_AND_CRASH(file, line) Fault_AddHungupAndCrash(file, line) #else #define HUNGUP_AND_CRASH(file, line) LogUtils_HungupThread(file, line) diff --git a/include/segment_symbols.h b/include/segment_symbols.h index 95e44a51b5..1aacb246d0 100644 --- a/include/segment_symbols.h +++ b/include/segment_symbols.h @@ -85,7 +85,7 @@ DECLARE_SEGMENT(code) DECLARE_ROM_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. DECLARE_SEGMENT(n64dd) DECLARE_ROM_SEGMENT(n64dd) @@ -655,8 +655,9 @@ DECLARE_ROM_SEGMENT(spot20_room_0) DECLARE_ROM_SEGMENT(ganon_tou_room_0) -// Room symbols for compiling test scenes, these are not wrapped in an `#if OOT_DEBUG` -// so that debug ROMs (including gc-eu-mq-dbg) can be built with OOT_DEBUG=0. +// Room symbols for compiling test scenes. +// 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) diff --git a/include/sfx.h b/include/sfx.h index 4d90cf5a6a..47a449e9c4 100644 --- a/include/sfx.h +++ b/include/sfx.h @@ -123,7 +123,7 @@ typedef struct SfxParams { u16 params; } SfxParams; -#if OOT_DEBUG +#if DEBUG_FEATURES #define SFX_DIST_SCALING 1.0f #else #define SFX_DIST_SCALING 10.0f diff --git a/include/sys_matrix.h b/include/sys_matrix.h index daf3aa39ca..1d136a06ee 100644 --- a/include/sys_matrix.h +++ b/include/sys_matrix.h @@ -43,7 +43,7 @@ void Matrix_SetTranslateScaleMtx2(Mtx* mtx, f32 scaleX, f32 scaleY, f32 scaleZ, 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_Finalize(struct GraphicsContext* gfxCtx, const char* file, int line); diff --git a/include/tables/dmadata_table.h b/include/tables/dmadata_table.h index 13c3d4bb5b..739d16e1e0 100644 --- a/include/tables/dmadata_table.h +++ b/include/tables/dmadata_table.h @@ -1,9 +1,11 @@ +#include "versions.h" + /** * 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 #include "dmadata_table_spec.h" -#else -#include "dmadata_table_mqdbg.h" #endif diff --git a/include/tables/scene_table.h b/include/tables/scene_table.h index 5c6dd595a2..f18faab35c 100644 --- a/include/tables/scene_table.h +++ b/include/tables/scene_table.h @@ -110,7 +110,7 @@ /* 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) /* 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) /* 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) diff --git a/include/variables.h b/include/variables.h index b2f8039759..7ba7a69ef0 100644 --- a/include/variables.h +++ b/include/variables.h @@ -73,7 +73,7 @@ extern u64 gMojiFontTLUTs[4][4]; // original name: "moji_tlut" extern u64 gMojiFontTex[]; // original name: "font_ff" extern u8 gBossMarkState; -#if OOT_DEBUG +#if DEBUG_FEATURES extern u32 gIsCtrlr2Valid; #endif extern s16* gWaveSamples[9]; @@ -113,7 +113,7 @@ extern u16 D_801333D0; extern Vec3f gSfxDefaultPos; extern f32 gSfxDefaultFreqAndVolScale; extern s8 gSfxDefaultReverb; -#if OOT_DEBUG +#if DEBUG_FEATURES extern u8 D_801333F0; extern u8 gAudioSfxSwapOff; extern u8 D_801333F8; @@ -121,7 +121,7 @@ extern u8 D_801333F8; extern u8 gSeqCmdWritePos; extern u8 gSeqCmdReadPos; extern u8 gStartSeqDisabled; -#if OOT_DEBUG +#if DEBUG_FEATURES extern u8 gAudioDebugPrintSeqCmd; #endif extern u8 gSoundModeList[]; diff --git a/include/versions.h b/include/versions.h index 778e28d93c..96ae716f06 100644 --- a/include/versions.h +++ b/include/versions.h @@ -46,4 +46,13 @@ #define FRAMERATE_CONST(value60Hz, value50Hz) (value50Hz) #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 diff --git a/include/z64actor.h b/include/z64actor.h index 228de4bcd6..04217cbdcb 100644 --- a/include/z64actor.h +++ b/include/z64actor.h @@ -41,7 +41,7 @@ typedef struct ActorProfile { /** * @see ACTOROVL_ALLOC_ABSOLUTE */ -#if OOT_DEBUG +#if DEBUG_FEATURES #define ACTOROVL_ABSOLUTE_SPACE_SIZE 0x27A0 #else #define ACTOROVL_ABSOLUTE_SPACE_SIZE 0x24E0 @@ -287,7 +287,7 @@ typedef struct Actor { /* 0x130 */ ActorFunc update; // Update Routine. Called by `Actor_UpdateAll` /* 0x134 */ ActorFunc draw; // Draw Routine. Called by `Actor_Draw` /* 0x138 */ ActorOverlay* overlayEntry; // Pointer to the overlay table entry for this actor -#if OOT_DEBUG +#if DEBUG_FEATURES /* 0x13C */ char dbgPad[0x10]; #endif } Actor; // size = 0x14C diff --git a/include/z64bgcheck.h b/include/z64bgcheck.h index 6412741962..bb9e9cf148 100644 --- a/include/z64bgcheck.h +++ b/include/z64bgcheck.h @@ -469,7 +469,7 @@ u16 WaterBox_GetBgCamSetting(CollisionContext* colCtx, WaterBox* waterBox); u32 WaterBox_GetLightIndex(CollisionContext* colCtx, WaterBox* waterBox); s32 func_80042708(CollisionPoly* polyA, CollisionPoly* polyB, Vec3f* point, 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_DrawStaticCollision(struct PlayState*, CollisionContext*); #endif diff --git a/include/z64collision_check.h b/include/z64collision_check.h index 1b96c4a46e..2c27563766 100644 --- a/include/z64collision_check.h +++ b/include/z64collision_check.h @@ -471,7 +471,7 @@ typedef struct CollisionCheckInfo { DamageTable* DamageTable_Get(s32 index); 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_DrawPoly(struct GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC, u8 r, u8 g, u8 b); #endif @@ -522,7 +522,7 @@ void CollisionCheck_DestroyContext(struct PlayState* play, CollisionCheckContext void CollisionCheck_ClearContext(struct PlayState* play, CollisionCheckContext* colChkCtx); void CollisionCheck_EnableSAC(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 CollisionCheck_DrawCollision(struct PlayState* play, CollisionCheckContext* colChkCtx); #endif diff --git a/include/z64dma.h b/include/z64dma.h index aab5556d7c..b9cbf6a42d 100755 --- a/include/z64dma.h +++ b/include/z64dma.h @@ -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, OSMesg msg); 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, OSMesg msg, const char* file, int line); s32 DmaMgr_RequestSyncDebug(void* ram, uintptr_t vrom, size_t size, const char* file, int line); diff --git a/include/z64play.h b/include/z64play.h index 562ad756d4..224ca196d2 100644 --- a/include/z64play.h +++ b/include/z64play.h @@ -149,7 +149,7 @@ void Play_TriggerVoidOut(PlayState* this); void Play_TriggerRespawn(PlayState* this); int Play_CamIsNotFixed(PlayState* this); -#if OOT_DEBUG +#if DEBUG_FEATURES extern void* gDebugCutsceneScript; #endif diff --git a/include/z64scene.h b/include/z64scene.h index a9bd01bae0..4acf9df16a 100644 --- a/include/z64scene.h +++ b/include/z64scene.h @@ -418,7 +418,7 @@ typedef enum SceneID { #undef DEFINE_SCENE // Fake enum values for scenes that are still referenced in the entrance table -#if !OOT_DEBUG +#if !DEBUG_ASSETS // Debug-only scenes #define SCENE_TEST01 0x65 #define SCENE_BESITU 0x66 diff --git a/include/z64view.h b/include/z64view.h index d8de114224..1d78920141 100644 --- a/include/z64view.h +++ b/include/z64view.h @@ -60,7 +60,7 @@ typedef struct View { #define VIEW_FORCE_PROJECTION_PERSPECTIVE (VIEW_PROJECTION_PERSPECTIVE << 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)) #else #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_UpdateViewingMatrix(View* view); s32 View_ApplyTo(View* view, s32 mask, Gfx** gfxP); -#if OOT_DEBUG +#if DEBUG_FEATURES s32 View_ErrorCheckEyePosition(f32 eyeX, f32 eyeY, f32 eyeZ); #endif diff --git a/include/zelda_arena.h b/include/zelda_arena.h index 6bec3e4f02..1d035a0bbe 100644 --- a/include/zelda_arena.h +++ b/include/zelda_arena.h @@ -14,7 +14,7 @@ void ZeldaArena_Init(void* start, u32 size); void ZeldaArena_Cleanup(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_MallocDebug(u32 size, const char* file, int line); void* ZeldaArena_MallocRDebug(u32 size, const char* file, int line); diff --git a/spec b/spec index ffc25c14b5..4ad7a6f145 100644 --- a/spec +++ b/spec @@ -26,7 +26,7 @@ beginseg #if PLATFORM_N64 include "$(BUILD_DIR)/src/boot/cic6105.o" #endif -#if OOT_DEBUG +#if DEBUG_FEATURES include "$(BUILD_DIR)/src/boot/assert.o" #endif include "$(BUILD_DIR)/src/boot/is_debug.o" @@ -37,7 +37,7 @@ beginseg #if PLATFORM_N64 include "$(BUILD_DIR)/src/libc64/sleep.o" #endif -#if OOT_DEBUG +#if DEBUG_FEATURES include "$(BUILD_DIR)/src/libc64/sprintf.o" #endif 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/getmemsize.o" include "$(BUILD_DIR)/src/libultra/os/seteventmesg.o" -#if OOT_DEBUG +#if DEBUG_FEATURES include "$(BUILD_DIR)/src/libultra/libc/xprintf.o" #endif include "$(BUILD_DIR)/src/libultra/os/unmaptlball.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" #endif include "$(BUILD_DIR)/src/libultra/os/invalicache.o" @@ -130,19 +130,19 @@ beginseg include "$(BUILD_DIR)/src/libultra/io/visetspecial.o" #endif 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" #endif include "$(BUILD_DIR)/src/libultra/os/setfpccsr.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" #endif include "$(BUILD_DIR)/src/libultra/os/maptlbrdb.o" include "$(BUILD_DIR)/src/libultra/os/yieldthread.o" include "$(BUILD_DIR)/src/libultra/os/getcause.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/ldiv.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_malloc.o" include "$(BUILD_DIR)/src/code/z_map_mark.o" -#if OOT_DEBUG +#if DEBUG_ASSETS include "$(BUILD_DIR)/src/code/z_moji.o" #endif 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_ss_sram.o" include "$(BUILD_DIR)/src/code/z_rumble.o" -#if OOT_DEBUG +#if DEBUG_ASSETS include "$(BUILD_DIR)/data/z_text.data.o" #endif 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_fade.o" include "$(BUILD_DIR)/src/code/shrink_window.o" -#if OOT_DEBUG +#if DEBUG_FEATURES include "$(BUILD_DIR)/src/code/db_camera.o" #endif include "$(BUILD_DIR)/src/code/code_800BB0A0.o" -#if OOT_DEBUG +#if DEBUG_FEATURES include "$(BUILD_DIR)/src/code/mempak.o" #endif 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_math.o" include "$(BUILD_DIR)/src/code/sys_math3d.o" -#if OOT_DEBUG +#if DEBUG_FEATURES include "$(BUILD_DIR)/src/code/sys_math3d_draw.o" #endif 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_800AD4C0.o" #endif -#if OOT_DEBUG +#if DEBUG_FEATURES include "$(BUILD_DIR)/src/code/debug_malloc.o" #endif #if PLATFORM_N64 @@ -707,7 +707,7 @@ beginseg include "$(BUILD_DIR)/src/code/fault_gc_drawer.o" #endif include "$(BUILD_DIR)/src/code/kanread.o" -#if OOT_DEBUG +#if DEBUG_FEATURES include "$(BUILD_DIR)/src/code/ucode_disas.o" #endif #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/seqplayer.o" include "$(BUILD_DIR)/src/audio/general.o" -#if PLATFORM_GC && !OOT_DEBUG +#if PLATFORM_GC && !DEBUG_FEATURES pad_text #endif 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/rcp_utils.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/code_800FC620.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/rcp_utils.o" include "$(BUILD_DIR)/src/libu64/loadfragment2_gc.o" -#if OOT_DEBUG +#if DEBUG_FEATURES include "$(BUILD_DIR)/src/libu64/mtxuty-cvt.o" #endif include "$(BUILD_DIR)/src/libu64/relocation_gc.o" @@ -767,7 +772,7 @@ beginseg #else include "$(BUILD_DIR)/src/libc64/__osMalloc_gc.o" #endif -#if !OOT_DEBUG +#if !DEBUG_FEATURES include "$(BUILD_DIR)/src/libc64/sprintf.o" #endif include "$(BUILD_DIR)/src/libc64/aprintf.o" @@ -776,7 +781,7 @@ beginseg #endif include "$(BUILD_DIR)/src/code/jpegutils.o" include "$(BUILD_DIR)/src/code/jpegdecoder.o" -#if OOT_DEBUG +#if DEBUG_FEATURES include "$(BUILD_DIR)/src/libultra/io/pfsfreeblocks.o" #endif #if PLATFORM_N64 @@ -798,7 +803,7 @@ beginseg include "$(BUILD_DIR)/src/libultra/io/sprawdma.o" include "$(BUILD_DIR)/src/libultra/io/sirawdma.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/pfsgetstatus.o" #endif @@ -809,11 +814,11 @@ beginseg include "$(BUILD_DIR)/src/libultra/mgu/mtxidentf.o" #endif include "$(BUILD_DIR)/src/libultra/gu/lookat.o" -#if OOT_DEBUG +#if DEBUG_FEATURES include "$(BUILD_DIR)/src/libultra/io/pfsallocatefile.o" #endif include "$(BUILD_DIR)/src/libultra/os/stoptimer.o" -#if OOT_DEBUG +#if DEBUG_FEATURES include "$(BUILD_DIR)/src/libultra/io/contpfs.o" #if !PLATFORM_N64 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/io/contquery.o" include "$(BUILD_DIR)/src/libultra/gu/lookathil.o" -#if !OOT_DEBUG +#if !DEBUG_FEATURES include "$(BUILD_DIR)/src/libultra/libc/xprintf.o" #endif -#if !OOT_DEBUG && !defined(COMPILER_GCC) +#if !DEBUG_FEATURES && !defined(COMPILER_GCC) include "$(BUILD_DIR)/src/libultra/libc/string.o" #endif include "$(BUILD_DIR)/src/libultra/io/sp.o" @@ -849,7 +854,7 @@ beginseg #endif include "$(BUILD_DIR)/src/libultra/io/dpgetstat.o" include "$(BUILD_DIR)/src/libultra/io/dpsetstat.o" -#if OOT_DEBUG +#if DEBUG_FEATURES include "$(BUILD_DIR)/src/libultra/io/pfsdeletefile.o" #endif include "$(BUILD_DIR)/src/libultra/gu/ortho.o" @@ -863,13 +868,13 @@ beginseg include "$(BUILD_DIR)/src/libultra/os/settime.o" #endif include "$(BUILD_DIR)/src/libultra/io/visetevent.o" -#if OOT_DEBUG +#if DEBUG_FEATURES include "$(BUILD_DIR)/src/libultra/io/pfsisplug.o" #endif include "$(BUILD_DIR)/src/libultra/gu/us2dex.o" include "$(BUILD_DIR)/src/libultra/io/pfsselectbank.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/pfsinitpak.o" include "$(BUILD_DIR)/src/libultra/io/pfschecker.o" @@ -881,10 +886,10 @@ beginseg include "$(BUILD_DIR)/src/libultra/mgu/translate.o" #endif 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" #endif -#if !OOT_DEBUG +#if !DEBUG_FEATURES include "$(BUILD_DIR)/src/libultra/io/pfsgetstatus.o" include "$(BUILD_DIR)/src/libultra/io/contpfs.o" #endif @@ -893,7 +898,7 @@ beginseg #endif include "$(BUILD_DIR)/src/libultra/io/contramread.o" include "$(BUILD_DIR)/src/libultra/io/crc.o" -#if !OOT_DEBUG +#if !DEBUG_FEATURES include "$(BUILD_DIR)/src/libultra/io/pfsisplug.o" #endif #if !PLATFORM_N64 @@ -903,7 +908,7 @@ beginseg include "$(BUILD_DIR)/src/libultra/libc/xlitob.o" include "$(BUILD_DIR)/src/libultra/libc/ldiv.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/ldiv.o" include "$(BUILD_DIR)/src/libultra/libc/xlitob.o" @@ -17268,7 +17273,7 @@ beginseg number 3 endseg -#if OOT_DEBUG +#if DEBUG_ASSETS beginseg name "syotes_scene" romalign 0x1000 @@ -17792,7 +17797,7 @@ beginseg number 3 endseg -#if OOT_DEBUG +#if DEBUG_ASSETS beginseg name "testroom_scene" romalign 0x1000 @@ -17876,7 +17881,7 @@ beginseg number 3 endseg -#if OOT_DEBUG +#if DEBUG_ASSETS beginseg name "sutaru_scene" romalign 0x1000 @@ -18164,7 +18169,7 @@ beginseg number 3 endseg -#if OOT_DEBUG +#if DEBUG_ASSETS beginseg name "sasatest_scene" romalign 0x1000 @@ -18916,7 +18921,7 @@ beginseg number 3 endseg -#if OOT_DEBUG +#if DEBUG_ASSETS beginseg name "hairal_niwa2_scene" romalign 0x1000 @@ -19404,7 +19409,7 @@ beginseg number 3 endseg -#if OOT_DEBUG +#if DEBUG_ASSETS beginseg name "besitu_scene" romalign 0x1000 @@ -19476,7 +19481,7 @@ beginseg number 3 endseg -#if OOT_DEBUG +#if DEBUG_ASSETS beginseg name "test01_scene" romalign 0x1000 diff --git a/src/audio/data.c b/src/audio/data.c index 41d4f75226..5f8bfa71f3 100644 --- a/src/audio/data.c +++ b/src/audio/data.c @@ -44,7 +44,7 @@ s8 gSfxDefaultReverb = 0; s32 D_801333EC = 0; // unused -#if OOT_DEBUG +#if DEBUG_FEATURES u8 D_801333F0 = 0; u8 gAudioSfxSwapOff = 0; u8 D_801333F8 = 0; @@ -55,7 +55,7 @@ u8 gSeqCmdWritePos = 0; u8 gSeqCmdReadPos = 0; u8 gStartSeqDisabled = false; -#if OOT_DEBUG +#if DEBUG_FEATURES u8 gAudioDebugPrintSeqCmd = true; #endif diff --git a/src/audio/general.c b/src/audio/general.c index 090a727a42..cbbb0c0709 100644 --- a/src/audio/general.c +++ b/src/audio/general.c @@ -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; u8 sGanonsTowerLevelsVol[8] = { 127, 80, 75, 73, 70, 68, 65, 60 }; u8 sEnterGanonsTowerTimer = 0; -#if OOT_DEBUG +#if DEBUG_FEATURES s8 sSoundMode = SOUNDMODE_SURROUND; #else s8 sSoundMode = SOUNDMODE_STEREO; @@ -161,7 +161,7 @@ u8 sAudioExtraFilter2 = 0; Vec3f* sSariaBgmPtr = NULL; f32 D_80130650 = 2000.0f; -#if OOT_DEBUG +#if DEBUG_FEATURES u8 sSeqModeInput = 0; #endif @@ -1150,7 +1150,7 @@ OcarinaSongButtons gOcarinaSongButtons[OCARINA_SONG_MAX] = { { 0, { 0 } }, }; -#if OOT_DEBUG +#if DEBUG_FEATURES u32 sAudioUpdateStartTime; u32 sAudioUpdateEndTime; #endif @@ -1163,7 +1163,7 @@ FreqLerp sWaterfallFreqScaleLerp; f32 D_8016B7D8; s8 D_8016B7DC; f32 D_8016B7E0; -#if OOT_DEBUG +#if DEBUG_FEATURES u16 D_8016B7E4; struct { char str[5]; @@ -1176,11 +1176,11 @@ u8 sRiverSoundMainBgmLower; u8 sRiverSoundMainBgmRestore; u8 sGanonsTowerVol; SfxPlayerState sSfxChannelState[0x10]; -#if OOT_DEBUG +#if DEBUG_FEATURES char sBinToStrBuf[0x20]; #endif u8 sMalonSingingTimer; -#if OOT_DEBUG +#if DEBUG_FEATURES u8 sAudioSpecPeakNumNotes[0x12]; #endif u8 sMalonSingingDisabled; @@ -1213,7 +1213,7 @@ u16 sMusicStaffCurHeldLength[OCARINA_SONG_MAX]; u16 sMusicStaffExpectedLength[OCARINA_SONG_MAX]; u8 sMusicStaffExpectedPitch[OCARINA_SONG_MAX]; OcarinaNote sScarecrowsLongSongSecondNote; -#if OOT_DEBUG +#if DEBUG_FEATURES u8 sIsMalonSinging; f32 sMalonSingingDist; u32 sDebugPadHold; @@ -2299,7 +2299,7 @@ void AudioOcarina_ResetStaffs(void) { sOcarinaDropInputTimer = 0; } -#if OOT_DEBUG +#if DEBUG_FEATURES #include "debug.inc.c" #else void AudioDebug_Draw(GfxPrint* printer) { @@ -2317,7 +2317,7 @@ void Audio_UpdateFanfare(void); */ void Audio_Update(void) { if (func_800FAD34() == 0) { -#if OOT_DEBUG +#if DEBUG_FEATURES sAudioUpdateTaskStart = gAudioCtx.totalTaskCount; sAudioUpdateStartTime = osGetTime(); #endif @@ -2336,14 +2336,14 @@ void Audio_Update(void) { func_800F8F88(); Audio_UpdateActiveSequences(); -#if OOT_DEBUG +#if DEBUG_FEATURES AudioDebug_SetInput(); AudioDebug_ProcessInput(); #endif AudioThread_ScheduleProcessCmds(); -#if OOT_DEBUG +#if DEBUG_FEATURES sAudioUpdateTaskEnd = gAudioCtx.totalTaskCount; sAudioUpdateEndTime = osGetTime(); #endif @@ -2767,7 +2767,7 @@ void func_800F4010(Vec3f* pos, u16 sfxId, f32 arg2) { u8 phi_v0; u16 sfxId2; -#if OOT_DEBUG +#if DEBUG_FEATURES D_80131C8C = arg2; #endif @@ -3358,7 +3358,7 @@ s32 Audio_IsSequencePlaying(u16 seqId) { void func_800F5ACC(u16 seqId) { u16 curSeqId = Audio_GetActiveSeqId(SEQ_PLAYER_BGM_MAIN); -#if !OOT_DEBUG +#if !DEBUG_FEATURES if (1) {} #endif @@ -3487,7 +3487,7 @@ void Audio_SetSequenceMode(u8 seqMode) { u16 seqId; u8 volumeFadeOutTimer; -#if OOT_DEBUG +#if DEBUG_FEATURES sSeqModeInput = seqMode; #endif @@ -3627,7 +3627,7 @@ void Audio_UpdateMalonSinging(f32 dist, u16 seqId) { s8 melodyVolume; s16 curSeqId; -#if OOT_DEBUG +#if DEBUG_FEATURES sIsMalonSinging = true; sMalonSingingDist = dist; #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) && Audio_IsSeqCmdNotQueued(SEQCMD_OP_PLAY_SEQUENCE << 28 | NA_BGM_NATURE_AMBIENCE, SEQCMD_OP_MASK | 0xFF)) { -#if OOT_DEBUG +#if DEBUG_FEATURES sAudioNatureFailed = true; #endif @@ -3982,7 +3982,7 @@ void Audio_StartNatureAmbienceSequence(u16 playerIO, u16 channelMask) { channelIdx = false; -#if OOT_DEBUG +#if DEBUG_FEATURES if (gStartSeqDisabled) { channelIdx = true; SEQCMD_DISABLE_PLAY_SEQUENCES(false); diff --git a/src/audio/sequence.c b/src/audio/sequence.c index 8d16b94a9b..c1530377a2 100644 --- a/src/audio/sequence.c +++ b/src/audio/sequence.c @@ -43,7 +43,7 @@ void Audio_StartSequence(u8 seqPlayerIndex, u8 seqId, u8 seqArgs, u16 fadeInDura if (!gStartSeqDisabled || (seqPlayerIndex == SEQ_PLAYER_SFX)) { 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 skipTicks = (fadeInDuration >> 3) * 60 * gAudioCtx.audioBufferParameters.ticksPerUpdate; AUDIOCMD_GLOBAL_INIT_SEQPLAYER_SKIP_TICKS((u32)seqPlayerIndex, (u32)seqId, skipTicks); @@ -103,7 +103,7 @@ void Audio_ProcessSeqCmd(u32 cmd) { f32 freqScaleTarget; s32 pad; -#if OOT_DEBUG +#if DEBUG_FEATURES if (gAudioDebugPrintSeqCmd && (cmd & SEQCMD_OP_MASK) != (SEQCMD_OP_SET_SEQPLAYER_IO << 28)) { AudioDebug_ScrPrt("SEQ H", (cmd >> 16) & 0xFFFF); AudioDebug_ScrPrt(" L", cmd & 0xFFFF); diff --git a/src/audio/sfx.c b/src/audio/sfx.c index b3de8eef5d..ce94cf5483 100644 --- a/src/audio/sfx.c +++ b/src/audio/sfx.c @@ -34,7 +34,7 @@ u8 sCurSfxPlayerChannelIndex; u8 gSfxBankMuted[7]; UnusedBankLerp sUnusedBankLerp[7]; -#if OOT_DEBUG +#if DEBUG_FEATURES u16 gAudioSfxSwapSource[10]; u16 gAudioSfxSwapTarget[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)]) { req = &sSfxRequests[gSfxRequestWriteIndex]; -#if OOT_DEBUG +#if DEBUG_FEATURES if (!gAudioSfxSwapOff) { for (i = 0; i < 10; i++) { if (sfxId == gAudioSfxSwapSource[i]) { @@ -172,7 +172,7 @@ void Audio_ProcessSfxRequest(void) { bankId = SFX_BANK(req->sfxId); -#if OOT_DEBUG +#if DEBUG_FEATURES if ((1 << bankId) & D_801333F0) { AudioDebug_ScrPrt("SE", req->sfxId); bankId = SFX_BANK(req->sfxId); @@ -739,7 +739,7 @@ void Audio_ResetSfx(void) { gSfxBanks[bankId][i].next = 0xFF; } -#if OOT_DEBUG +#if DEBUG_FEATURES if (D_801333F8 == 0) { for (bankId = 0; bankId < 10; bankId++) { gAudioSfxSwapSource[bankId] = 0; diff --git a/src/boot/boot_main.c b/src/boot/boot_main.c index d485a5b1f9..0c1eeea49e 100644 --- a/src/boot/boot_main.c +++ b/src/boot/boot_main.c @@ -30,7 +30,7 @@ void bootproc(void) { gCartHandle = osCartRomInit(); osDriveRomInit(); -#if OOT_DEBUG +#if DEBUG_FEATURES isPrintfInit(); #endif Locale_Init(); diff --git a/src/boot/idle.c b/src/boot/idle.c index 7128309e00..ce1eaa9b5c 100644 --- a/src/boot/idle.c +++ b/src/boot/idle.c @@ -80,7 +80,7 @@ void Idle_ThreadEntry(void* arg) { gViConfigYScale = 1.0f; #endif -#if OOT_DEBUG +#if DEBUG_FEATURES // Allow both 60 Hz and 50 Hz switch (osTvType) { case OS_TV_NTSC: @@ -96,7 +96,9 @@ void Idle_ThreadEntry(void* arg) { case OS_TV_PAL: gViConfigModeType = OS_VI_FPAL_LAN1; gViConfigMode = osViModeFpalLan1; +#if OOT_VERSION >= PAL_1_0 gViConfigYScale = 0.833f; +#endif break; } #elif !OOT_PAL_N64 diff --git a/src/boot/is_debug.c b/src/boot/is_debug.c index 44d22fa874..5415b8a7b3 100644 --- a/src/boot/is_debug.c +++ b/src/boot/is_debug.c @@ -3,7 +3,7 @@ #define gISVDbgPrnAdrs ((ISVDbg*)0xB3FF0000) #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 void isPrintfInit(void) { @@ -18,7 +18,7 @@ void osSyncPrintfUnused(const char* fmt, ...) { va_list args; va_start(args, fmt); -#if OOT_DEBUG +#if DEBUG_FEATURES _Printf(is_proutSyncPrintf, NULL, fmt, args); #endif @@ -29,7 +29,7 @@ void osSyncPrintf(const char* fmt, ...) { va_list args; va_start(args, fmt); -#if OOT_DEBUG +#if DEBUG_FEATURES _Printf(is_proutSyncPrintf, NULL, fmt, args); #endif @@ -41,7 +41,7 @@ void rmonPrintf(const char* fmt, ...) { va_list args; va_start(args, fmt); -#if OOT_DEBUG +#if DEBUG_FEATURES _Printf(is_proutSyncPrintf, NULL, fmt, args); #endif @@ -53,7 +53,7 @@ void func_800015F4(void) { } #endif -#if OOT_DEBUG +#if DEBUG_FEATURES void* is_proutSyncPrintf(void* arg, const char* str, size_t count) { u32 data; s32 pos; diff --git a/src/boot/z_locale.c b/src/boot/z_locale.c index ec752bcd05..cf5a64d2f9 100644 --- a/src/boot/z_locale.c +++ b/src/boot/z_locale.c @@ -60,7 +60,7 @@ void Locale_ResetRegion(void) { gCurrentRegion = REGION_NULL; } -#if OOT_DEBUG +#if DEBUG_FEATURES u32 func_80001F48(void) { if (gCurrentRegion == OOT_REGION) { return 0; diff --git a/src/boot/z_std_dma.c b/src/boot/z_std_dma.c index b8eaecf74e..53a53cb01c 100644 --- a/src/boot/z_std_dma.c +++ b/src/boot/z_std_dma.c @@ -40,7 +40,7 @@ u32 sDmaMgrIsRomCompressed = false; OSThread sDmaMgrThread; STACK(sDmaMgrStack, 0x500); -#if OOT_DEBUG +#if DEBUG_FEATURES const char* sDmaMgrCurFileName; s32 sDmaMgrCurFileLine; @@ -56,7 +56,7 @@ const char* sDmaMgrFileNames[] = { #undef DEFINE_DMA_ENTRY -#if PLATFORM_N64 || OOT_DEBUG +#if PLATFORM_N64 || DEBUG_FEATURES /** * 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); } -#if OOT_DEBUG +#if DEBUG_FEATURES /** * 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 */ const char* DmaMgr_FindFileName(uintptr_t vrom) { -#if OOT_DEBUG +#if DEBUG_FEATURES DmaEntry* iter = gDmaDataTable; const char** name = sDmaMgrFileNames; @@ -339,7 +339,7 @@ const char* DmaMgr_FindFileName(uintptr_t vrom) { #endif const char* DmaMgr_GetFileName(uintptr_t vrom) { -#if OOT_DEBUG +#if PLATFORM_GC && DEBUG_FEATURES const char* ret = DmaMgr_FindFileName(vrom); if (ret == NULL) { @@ -352,10 +352,10 @@ const char* DmaMgr_GetFileName(uintptr_t vrom) { return NULL; } return ret; -#elif PLATFORM_N64 - return "??"; #elif PLATFORM_GC return ""; +#elif PLATFORM_N64 + return "??"; #endif } @@ -370,7 +370,7 @@ void DmaMgr_ProcessRequest(DmaRequest* req) { const char* filename; s32 i = 0; -#if OOT_DEBUG +#if DEBUG_FEATURES // Get the filename (for debugging) filename = DmaMgr_GetFileName(vrom); #elif PLATFORM_GC @@ -538,7 +538,7 @@ s32 DmaMgr_RequestAsync(DmaRequest* req, void* ram, uintptr_t vrom, size_t size, OSMesg msg) { static s32 sDmaMgrQueueFullLogged = 0; -#if OOT_DEBUG +#if DEBUG_FEATURES if ((ram == NULL) || (osMemSize < OS_K0_TO_PHYSICAL(ram) + size) || (vrom & 1) || (vrom > 0x4000000) || (size == 0) || (size & 1)) { //! @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->notifyMsg = msg; -#if OOT_DEBUG +#if DEBUG_FEATURES if (1 && (sDmaMgrQueueFullLogged == 0) && MQ_IS_FULL(&sDmaMgrMsgQueue)) { sDmaMgrQueueFullLogged++; PRINTF("%c", BEL); @@ -614,7 +614,7 @@ void DmaMgr_Init(void) { (u32)(_dmadataSegmentRomEnd - _dmadataSegmentRomStart)); PRINTF("dma_rom_ad[]\n"); -#if OOT_DEBUG +#if DEBUG_FEATURES name = sDmaMgrFileNames; iter = gDmaDataTable; idx = 0; @@ -662,7 +662,7 @@ void DmaMgr_Init(void) { osStartThread(&sDmaMgrThread); } -#if OOT_DEBUG +#if DEBUG_FEATURES /** * Asynchronous DMA Request with source file and line info for debugging. * diff --git a/src/code/PreRender.c b/src/code/PreRender.c index 441dddade5..d8d96d1b8c 100644 --- a/src/code/PreRender.c +++ b/src/code/PreRender.c @@ -598,7 +598,7 @@ void PreRender_AntiAliasFilter(PreRender* this, s32 x, s32 y) { buffCvg[i] = this->cvgSave[xi + yi * this->width] >> 5; } -#if OOT_DEBUG +#if DEBUG_FEATURES if (buffCvg[7] == 7) { PRINTF("Error, should not be in here \n"); return; @@ -693,7 +693,7 @@ void PreRender_AntiAliasFilter(PreRender* this, s32 x, s32 y) { (((a2) >= (a1)) ? (((a3) >= (a2)) ? (a2) : (((a1) >= (a3)) ? (a1) : (a3))) \ : (((a2) >= (a3)) ? (a2) : (((a3) >= (a1)) ? (a1) : (a3)))) -#if OOT_DEBUG +#if DEBUG_FEATURES #define R_HREG_MODE_DEBUG R_HREG_MODE #else #define R_HREG_MODE_DEBUG ((void)0, 0) diff --git a/src/code/code_800430A0.c b/src/code/code_800430A0.c index 90ae85187a..2bdfc6bcdc 100644 --- a/src/code/code_800430A0.c +++ b/src/code/code_800430A0.c @@ -36,7 +36,7 @@ void DynaPolyActor_UpdateCarriedActorPos(CollisionContext* colCtx, s32 bgId, Act SkinMatrix_Vec3fMtxFMultXYZ(&curTransform, &tempPos, &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 || pos.y <= -BGCHECK_XYZ_ABSMAX || BGCHECK_XYZ_ABSMAX <= pos.z || pos.z <= -BGCHECK_XYZ_ABSMAX) { diff --git a/src/code/code_800D31A0.c b/src/code/code_800D31A0.c index b4e0495e13..e7bd207d75 100644 --- a/src/code/code_800D31A0.c +++ b/src/code/code_800D31A0.c @@ -1,7 +1,7 @@ #include "global.h" #include "terminal.h" -#if OOT_DEBUG +#if DEBUG_FEATURES u32 gIsCtrlr2Valid = false; #endif @@ -12,7 +12,7 @@ NORETURN void func_800D31A0(void) { } } -#if OOT_DEBUG +#if DEBUG_FEATURES void func_800D31F0(void) { gIsCtrlr2Valid = (gPadMgr.validCtrlrsMask & 2) != 0; } diff --git a/src/code/debug_malloc.c b/src/code/debug_malloc.c index a1def050ae..b6aa81b329 100644 --- a/src/code/debug_malloc.c +++ b/src/code/debug_malloc.c @@ -7,14 +7,16 @@ Arena sDebugArena; -#if OOT_DEBUG +#if DEBUG_FEATURES s32 gDebugArenaLogSeverity = LOG_SEVERITY_ERROR; void DebugArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action) { if (ptr == NULL) { if (gDebugArenaLogSeverity >= LOG_SEVERITY_ERROR) { PRINTF(T("%s: %u バイトの%sに失敗しました\n", "%s: %u bytes %s failed\n"), name, size, action); +#if PLATFORM_GC __osDisplayArena(&sDebugArena); +#endif return; } } else if (gDebugArenaLogSeverity >= LOG_SEVERITY_VERBOSE) { @@ -34,7 +36,7 @@ void* DebugArena_Malloc(u32 size) { return ptr; } -#if OOT_DEBUG +#if DEBUG_FEATURES void* DebugArena_MallocDebug(u32 size, const char* file, int line) { void* ptr = __osMallocDebug(&sDebugArena, size, file, line); @@ -50,7 +52,7 @@ void* DebugArena_MallocR(u32 size) { return ptr; } -#if OOT_DEBUG +#if DEBUG_FEATURES void* DebugArena_MallocRDebug(u32 size, const char* file, int line) { void* ptr = __osMallocRDebug(&sDebugArena, size, file, line); @@ -65,7 +67,7 @@ void* DebugArena_Realloc(void* ptr, u32 newSize) { return ptr; } -#if OOT_DEBUG +#if DEBUG_FEATURES void* DebugArena_ReallocDebug(void* ptr, u32 newSize, const char* file, int line) { ptr = __osReallocDebug(&sDebugArena, ptr, newSize, file, line); DEBUG_ARENA_CHECK_POINTER(ptr, newSize, "debug_realloc_DEBUG", "再確保"); // "Re-securing" @@ -77,7 +79,7 @@ void DebugArena_Free(void* ptr) { __osFree(&sDebugArena, ptr); } -#if OOT_DEBUG +#if DEBUG_FEATURES void DebugArena_FreeDebug(void* ptr, const char* file, int line) { __osFreeDebug(&sDebugArena, ptr, file, line); } @@ -96,7 +98,7 @@ void* DebugArena_Calloc(u32 num, u32 size) { return ret; } -#if OOT_DEBUG +#if PLATFORM_GC && DEBUG_FEATURES void DebugArena_Display(void) { // Likely copypasted from ZeldaArena_Display, should say "Debug" PRINTF(T("ゼルダヒープ表示\n", "Zelda heap display\n")); @@ -113,14 +115,14 @@ void DebugArena_Check(void) { } void DebugArena_Init(void* start, u32 size) { -#if OOT_DEBUG +#if DEBUG_FEATURES gDebugArenaLogSeverity = LOG_SEVERITY_NOLOG; #endif __osMallocInit(&sDebugArena, start, size); } void DebugArena_Cleanup(void) { -#if OOT_DEBUG +#if DEBUG_FEATURES gDebugArenaLogSeverity = LOG_SEVERITY_NOLOG; #endif __osMallocCleanup(&sDebugArena); diff --git a/src/code/game.c b/src/code/game.c index bd129ef775..8aad6bf00c 100644 --- a/src/code/game.c +++ b/src/code/game.c @@ -15,7 +15,7 @@ VisZBuf sVisZBuf; VisMono sVisMono; ViMode sViMode; -#if OOT_DEBUG +#if DEBUG_FEATURES FaultClient sGameFaultClient; u16 sLastButtonPressed; @@ -73,18 +73,16 @@ void GameState_SetFBFilter(Gfx** gfxP) { } void func_800C4344(GameState* gameState) { -#if PLATFORM_N64 - if (D_80121212 != 0) { - func_801C7E78(); - } -#elif OOT_DEBUG +#if DEBUG_FEATURES Input* selectedInput; s32 hexDumpSize; u16 inputCompareValue; +#if PLATFORM_GC if (R_HREG_MODE == HREG_MODE_HEAP_FREE_BLOCK_TEST) { __osMalloc_FreeBlockTest_Enable = R_HEAP_FREE_BLOCK_TEST_TOGGLE; } +#endif if (R_HREG_MODE == HREG_MODE_INPUT_TEST) { selectedInput = @@ -128,9 +126,15 @@ void func_800C4344(GameState* gameState) { } } #endif + +#if PLATFORM_N64 + if (D_80121212 != 0) { + func_801C7E78(); + } +#endif } -#if OOT_DEBUG +#if DEBUG_FEATURES void GameState_DrawInputDisplay(u16 input, Gfx** gfxP) { static const u16 sInpDispBtnColors[] = { 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); } -#if OOT_DEBUG +#if DEBUG_FEATURES sLastButtonPressed = gameState->input[0].press.button | gameState->input[0].cur.button; if (R_DISABLE_INPUT_DISPLAY == 0) { GameState_DrawInputDisplay(sLastButtonPressed, &newDList); @@ -195,14 +199,14 @@ void GameState_Draw(GameState* gameState, GraphicsContext* gfxCtx) { #endif if (R_ENABLE_ARENA_DBG < 0) { -#if OOT_DEBUG +#if PLATFORM_GC && DEBUG_FEATURES s32 pad; DebugArena_Display(); SystemArena_Display(); +#endif PRINTF(T("ハイラル滅亡まであと %08x バイト(game_alloc)\n", "%08x bytes left until Hyrule is destroyed (game_alloc)\n"), THA_GetRemaining(&gameState->tha)); -#endif R_ENABLE_ARENA_DBG = 0; } @@ -290,7 +294,7 @@ void GameState_Update(GameState* gameState) { } #endif -#if OOT_DEBUG +#if OOT_VERSION >= PAL_1_0 && DEBUG_FEATURES if (SREG(63) == 1u) { if (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); PRINTF(T("ハイラル再確保失敗\n", "Failure to secure Hyrule\n")); -#if OOT_DEBUG +#if PLATFORM_GC && DEBUG_FEATURES SystemArena_Display(); #endif @@ -488,7 +492,7 @@ void GameState_Init(GameState* gameState, GameStateFunc init, GraphicsContext* g VisCvg_Init(&sVisCvg); VisZBuf_Init(&sVisZBuf); 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); } 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"), OS_CYCLES_TO_USEC(endTime - startTime)); -#if OOT_DEBUG +#if DEBUG_FEATURES Fault_AddClient(&sGameFaultClient, GameState_FaultPrint, NULL, NULL); #endif @@ -519,14 +523,17 @@ void GameState_Destroy(GameState* gameState) { VisCvg_Destroy(&sVisCvg); VisZBuf_Destroy(&sVisZBuf); 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); } THA_Destroy(&gameState->tha); GameAlloc_Cleanup(&gameState->alloc); -#if OOT_DEBUG +#if PLATFORM_GC && DEBUG_FEATURES SystemArena_Display(); +#endif + +#if DEBUG_FEATURES Fault_RemoveClient(&sGameFaultClient); #endif @@ -545,7 +552,7 @@ u32 GameState_IsRunning(GameState* gameState) { return gameState->running; } -#if OOT_DEBUG +#if DEBUG_FEATURES void* GameState_Alloc(GameState* gameState, size_t size, const char* file, int line) { void* ret; diff --git a/src/code/gamealloc.c b/src/code/gamealloc.c index b80ece7b26..d625bc65f7 100644 --- a/src/code/gamealloc.c +++ b/src/code/gamealloc.c @@ -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) { GameAllocEntry* ptr = SystemArena_MallocDebug(size + sizeof(GameAllocEntry), file, line); diff --git a/src/code/graph.c b/src/code/graph.c index e7c3a2d864..405be9cb70 100644 --- a/src/code/graph.c +++ b/src/code/graph.c @@ -20,7 +20,7 @@ OSTime sGraphPrevUpdateEndTime; */ OSTime sGraphPrevTaskTimeStart; -#if OOT_DEBUG +#if DEBUG_FEATURES FaultClient sGraphFaultClient; UCodeInfo D_8012D230[3] = { @@ -152,21 +152,21 @@ void Graph_Init(GraphicsContext* gfxCtx) { osCreateMesgQueue(&gfxCtx->queue, gfxCtx->msgBuff, ARRAY_COUNT(gfxCtx->msgBuff)); -#if OOT_DEBUG +#if DEBUG_FEATURES func_800D31F0(); Fault_AddClient(&sGraphFaultClient, Graph_FaultClient, NULL, NULL); #endif } void Graph_Destroy(GraphicsContext* gfxCtx) { -#if OOT_DEBUG +#if DEBUG_FEATURES func_800D3210(); Fault_RemoveClient(&sGraphFaultClient); #endif } void Graph_TaskSet00(GraphicsContext* gfxCtx) { -#if OOT_DEBUG +#if DEBUG_FEATURES static Gfx* sPrevTaskWorkBuffer = NULL; #endif OSTask_t* task = &gfxCtx->task.list.t; @@ -186,7 +186,7 @@ void Graph_TaskSet00(GraphicsContext* gfxCtx) { osStopTimer(&timer); if (msg == (OSMesg)666) { -#if OOT_DEBUG +#if DEBUG_FEATURES PRINTF(VT_FGCOL(RED)); PRINTF(T("RCPが帰ってきませんでした。", "RCP did not return.")); PRINTF(VT_RST); @@ -209,7 +209,7 @@ void Graph_TaskSet00(GraphicsContext* gfxCtx) { osRecvMesg(&gfxCtx->queue, &msg, OS_MESG_NOBLOCK); -#if OOT_DEBUG +#if DEBUG_FEATURES sPrevTaskWorkBuffer = gfxCtx->workBuffer; #endif } @@ -302,7 +302,7 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) { gameState->inPreNMIState = false; Graph_InitTHGA(gfxCtx); -#if OOT_DEBUG +#if DEBUG_FEATURES OPEN_DISPS(gfxCtx, "../graph.c", 966); gDPNoOpString(WORK_DISP++, "WORK_DISP 開始", 0); @@ -316,7 +316,7 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) { GameState_ReqPadData(gameState); GameState_Update(gameState); -#if OOT_DEBUG +#if DEBUG_FEATURES OPEN_DISPS(gfxCtx, "../graph.c", 987); gDPNoOpString(WORK_DISP++, "WORK_DISP 終了", 0); @@ -338,7 +338,7 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) { 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) { R_HREG_MODE = HREG_MODE_UCODE_DISAS; R_UCODE_DISAS_TOGGLE = -1; @@ -450,7 +450,7 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) { sGraphPrevUpdateEndTime = timeNow; } -#if OOT_DEBUG +#if DEBUG_FEATURES if (gIsCtrlr2Valid && CHECK_BTN_ALL(gameState->input[0].press.button, BTN_Z) && CHECK_BTN_ALL(gameState->input[0].cur.button, BTN_L | BTN_R)) { gSaveContext.gameMode = GAMEMODE_NORMAL; @@ -487,7 +487,7 @@ void Graph_ThreadEntry(void* arg0) { gameState = SYSTEM_ARENA_MALLOC(size, "../graph.c", 1196); if (gameState == NULL) { -#if OOT_DEBUG +#if DEBUG_FEATURES char faultMsg[0x50]; 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)); } -#if OOT_DEBUG +#if DEBUG_FEATURES 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) { dispRefs[0] = gfxCtx->polyOpa.p; diff --git a/src/code/main.c b/src/code/main.c index a0671605de..1ba4bc5850 100644 --- a/src/code/main.c +++ b/src/code/main.c @@ -57,7 +57,7 @@ AudioMgr sAudioMgr; OSMesgQueue sSerialEventQueue; OSMesg sSerialMsgBuf[1]; -#if OOT_DEBUG +#if DEBUG_FEATURES void Main_LogSystemHeap(void) { PRINTF(VT_FGCOL(GREEN)); PRINTF( @@ -100,7 +100,7 @@ void Main(void* arg) { fb, gSystemHeapSize); SystemHeap_Init((void*)systemHeapStart, gSystemHeapSize); // initializes the system heap -#if OOT_DEBUG +#if DEBUG_FEATURES { void* debugHeapStart; u32 debugHeapSize; @@ -125,7 +125,7 @@ void Main(void* arg) { osCreateMesgQueue(&sSerialEventQueue, sSerialMsgBuf, ARRAY_COUNT(sSerialMsgBuf)); osSetEventMesg(OS_EVENT_SI, &sSerialEventQueue, NULL); -#if OOT_DEBUG +#if DEBUG_FEATURES Main_LogSystemHeap(); #endif diff --git a/src/code/padmgr.c b/src/code/padmgr.c index f9ccce7809..4486e541a0 100644 --- a/src/code/padmgr.c +++ b/src/code/padmgr.c @@ -33,7 +33,7 @@ #include "terminal.h" #define PADMGR_LOG(controllerNum, msg) \ - if (OOT_DEBUG) { \ + if (DEBUG_FEATURES) { \ PRINTF(VT_FGCOL(YELLOW)); \ PRINTF(T("padmgr: %dコン: %s\n", "padmgr: Controller %d: %s\n"), (controllerNum) + 1, (msg)); \ PRINTF(VT_RST); \ @@ -68,7 +68,7 @@ s32 gPadMgrLogSeverity = LOG_SEVERITY_CRITICAL; OSMesgQueue* PadMgr_AcquireSerialEventQueue(PadMgr* padMgr) { OSMesgQueue* serialEventQueue; -#if OOT_DEBUG +#if DEBUG_FEATURES serialEventQueue = NULL; #endif @@ -184,7 +184,7 @@ void PadMgr_UpdateRumble(PadMgr* padMgr) { } } else { 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->pakType[i] = CONT_PAK_NONE; } else { @@ -363,7 +363,7 @@ void PadMgr_HandleRetrace(PadMgr* padMgr) { osRecvMesg(serialEventQueue, NULL, OS_MESG_BLOCK); osContGetReadData(padMgr->pads); -#if !OOT_DEBUG +#if !DEBUG_FEATURES // Clear controllers 2 and 4 bzero(&padMgr->pads[1], sizeof(OSContPad)); bzero(&padMgr->pads[3], sizeof(OSContPad)); diff --git a/src/code/sched.c b/src/code/sched.c index 3374da65e6..b22f38b402 100644 --- a/src/code/sched.c +++ b/src/code/sched.c @@ -54,7 +54,7 @@ OSTime sRSPAudioTimeStart; OSTime sRSPOtherTimeStart; OSTime sRDPTimeStart; -#if OOT_VERSION < PAL_1_0 || OOT_DEBUG +#if OOT_VERSION < PAL_1_0 || DEBUG_FEATURES vs32 sSchedDebugPrintfEnabled = false; #define SCHED_DEBUG_PRINTF \ @@ -85,7 +85,7 @@ void Sched_SwapFrameBufferImpl(CfbInfo* cfbInfo) { 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) { R_SCHED_TOGGLE_SPECIAL_FEATURES = 0; R_SCHED_GAMMA_ON = 0; @@ -151,7 +151,7 @@ void Sched_SwapFrameBuffer(Scheduler* sc, CfbInfo* cfbInfo) { } void Sched_HandlePreNMI(Scheduler* sc) { -#if OOT_DEBUG +#if DEBUG_FEATURES OSTime now; if (sc->curRSPTask != NULL) { diff --git a/src/code/shrink_window.c b/src/code/shrink_window.c index 2dbe295e6e..ad8da58d35 100644 --- a/src/code/shrink_window.c +++ b/src/code/shrink_window.c @@ -86,7 +86,7 @@ void Letterbox_Update(s32 updateRate) { 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) { R_LETTERBOX_INIT = HREG_MODE_LETTERBOX; R_LETTERBOX_ENABLE_LOGS = 0; diff --git a/src/code/sys_cfb.c b/src/code/sys_cfb.c index 76012588b2..c7e2933be3 100644 --- a/src/code/sys_cfb.c +++ b/src/code/sys_cfb.c @@ -15,7 +15,7 @@ void SysCfb_Init(s32 n64dd) { tmpFbEnd = 0x8044BE80; if (n64dd == 1) { PRINTF(T("RAM 8M mode (N64DD対応)\n", "RAM 8M mode (N64DD compatible)\n")); -#if OOT_DEBUG +#if DEBUG_FEATURES sSysCfbEnd = 0x805FB000; #else sSysCfbEnd = 0x80600000; @@ -23,7 +23,7 @@ void SysCfb_Init(s32 n64dd) { } else { PRINTF(T("このバージョンのマージンは %dK バイトです\n", "The margin for this version is %dK bytes\n"), (0x4BC00 / 1024)); -#if OOT_DEBUG +#if DEBUG_FEATURES sSysCfbEnd = tmpFbEnd; #else sSysCfbEnd = 0x80400000; diff --git a/src/code/sys_math3d.c b/src/code/sys_math3d.c index 9cf75240c3..96b352d693 100644 --- a/src/code/sys_math3d.c +++ b/src/code/sys_math3d.c @@ -929,7 +929,7 @@ f32 Math3D_Plane(Plane* plane, Vec3f* pointOnPlane) { * `nx`, `ny`, `nz`, and `originDist` */ 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(T("Math3DLengthPlaneAndPos():法線size がゼロ近いです%f %f %f\n", "Math3DLengthPlaneAndPos(): Normal size is near zero %f %f %f\n"), diff --git a/src/code/sys_matrix.c b/src/code/sys_matrix.c index b5c0b206bc..19db7799e6 100644 --- a/src/code/sys_matrix.c +++ b/src/code/sys_matrix.c @@ -1,5 +1,5 @@ #include "global.h" -#if OOT_DEBUG +#if DEBUG_FEATURES #include "fault.h" #endif @@ -609,7 +609,7 @@ Mtx* Matrix_MtxFToMtx(MtxF* src, Mtx* dest) { return dest; } -#if OOT_DEBUG +#if DEBUG_FEATURES Mtx* Matrix_ToMtx(Mtx* dest, const char* file, int line) { 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))); } -#endif /* OOT_DEBUG */ +#endif /* DEBUG_FEATURES */ Mtx* Matrix_MtxFToNewMtx(MtxF* src, GraphicsContext* gfxCtx) { 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) { s32 i, j; diff --git a/src/code/sys_rumble.c b/src/code/sys_rumble.c index fdb204af57..10844f3674 100644 --- a/src/code/sys_rumble.c +++ b/src/code/sys_rumble.c @@ -147,7 +147,7 @@ void RumbleMgr_Init(RumbleMgr* rumbleMgr) { } void RumbleMgr_Destroy(RumbleMgr* rumbleMgr) { -#if OOT_DEBUG +#if DEBUG_FEATURES bzero(rumbleMgr, sizeof(RumbleMgr)); #endif } diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 45370e83bf..2fde9f8a92 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -17,7 +17,7 @@ static CollisionPoly* sCurCeilingPoly; static s32 sCurCeilingBgId; -#if OOT_DEBUG +#if DEBUG_FEATURES #define ACTOR_DEBUG_PRINTF \ if (R_ENABLE_ACTOR_DEBUG_PRINTF) \ PRINTF @@ -917,7 +917,7 @@ void Actor_Destroy(Actor* actor, PlayState* play) { actor->destroy(actor, play); actor->destroy = NULL; } else { -#if OOT_DEBUG +#if DEBUG_FEATURES overlayEntry = actor->overlayEntry; 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)); -#if OOT_DEBUG +#if DEBUG_FEATURES 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, 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--; } -#if OOT_DEBUG +#if DEBUG_FEATURES if (KREG(0) == -100) { Actor* player = &GET_PLAYER(play)->actor; @@ -2488,7 +2488,7 @@ void Actor_FaultPrint(Actor* actor, char* command) { Fault_Printf("ACTOR NAME is NULL"); } -#if OOT_DEBUG +#if DEBUG_FEATURES overlayEntry = actor->overlayEntry; 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_XLU_DISP++, actorName, i); - if (OOT_DEBUG) { + if (DEBUG_FEATURES) { 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, &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) { 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)) { actor->flags |= ACTOR_FLAG_6; } else { @@ -2766,7 +2766,7 @@ void func_800315AC(PlayState* play, ActorContext* actorCtx) { 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->flags & ACTOR_FLAG_REACT_TO_LENS) && ((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; invisibleActorCounter++; } 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)) { Actor_Draw(play, actor); 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); } - if (!OOT_DEBUG || (HREG(64) != 1) || (HREG(74) != 0)) { + if (!DEBUG_FEATURES || (HREG(64) != 1) || (HREG(74) != 0)) { 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) { Actor_DrawLensActors(play, invisibleActorCounter, invisibleActors); if ((play->csCtx.state != CS_STATE_IDLE) || Player_InCsMode(play)) { @@ -2812,11 +2812,11 @@ void func_800315AC(PlayState* play, ActorContext* actorCtx) { 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); } -#if OOT_DEBUG +#if DEBUG_FEATURES if ((HREG(64) != 1) || (HREG(76) != 0)) { CollisionCheck_DrawCollision(play, &play->colChkCtx); } @@ -3009,7 +3009,7 @@ Actor* Actor_Spawn(ActorContext* actorCtx, PlayState* play, s16 actorId, f32 pos overlayEntry = &gActorOverlayTable[actorId]; 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 : ""; #endif diff --git a/src/code/z_actor_dlftbls.c b/src/code/z_actor_dlftbls.c index 6e1fdb97cf..65b118efd2 100644 --- a/src/code/z_actor_dlftbls.c +++ b/src/code/z_actor_dlftbls.c @@ -24,7 +24,7 @@ #undef DEFINE_ACTOR_UNSET // Actor Overlay Table definition -#if OOT_DEBUG +#if DEBUG_FEATURES #define DEFINE_ACTOR(name, _1, allocType, nameString) \ { \ @@ -80,7 +80,7 @@ s32 gMaxActorId = 0; static FaultClient sFaultClient; void ActorOverlayTable_LogPrint(void) { -#if OOT_DEBUG +#if DEBUG_FEATURES ActorOverlay* overlayEntry; u32 i; @@ -137,7 +137,7 @@ void ActorOverlayTable_FaultPrint(void* arg0, void* arg1) { Fault_Printf("\n"); #else 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 } } diff --git a/src/code/z_bgcheck.c b/src/code/z_bgcheck.c index 15d1364be7..37d839dff3 100644 --- a/src/code/z_bgcheck.c +++ b/src/code/z_bgcheck.c @@ -81,7 +81,7 @@ u16 sSurfaceMaterialToSfxOffset[SURFACE_MATERIAL_MAX] = { SURFACE_SFX_OFFSET_CARPET, // SURFACE_MATERIAL_CARPET }; -#if OOT_DEBUG +#if DEBUG_FEATURES /** * original name: T_BGCheck_PosErrorCheck */ @@ -1724,7 +1724,7 @@ f32 BgCheck_RaycastDownImpl(PlayState* play, CollisionContext* colCtx, u16 xpFla break; } -#if OOT_DEBUG +#if DEBUG_FEATURES if (BgCheck_PosErrorCheck(&checkPos, "../z_bgcheck.c", 4410)) { if (actor != NULL) { 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; dz = posNext->z - posPrev->z; -#if OOT_DEBUG +#if DEBUG_FEATURES if (BgCheck_PosErrorCheck(posNext, "../z_bgcheck.c", 4831) == true || BgCheck_PosErrorCheck(posPrev, "../z_bgcheck.c", 4832) == true) { if (actor != NULL) { @@ -2170,7 +2170,7 @@ s32 BgCheck_CheckCeilingImpl(CollisionContext* colCtx, u16 xpFlags, f32* outY, V *outBgId = BGCHECK_SCENE; *outY = pos->y; -#if OOT_DEBUG +#if DEBUG_FEATURES if (BgCheck_PosErrorCheck(pos, "../z_bgcheck.c", 5206) == true) { if (actor != NULL) { 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; -#if OOT_DEBUG +#if DEBUG_FEATURES if (BgCheck_PosErrorCheck(posA, "../z_bgcheck.c", 5334) == true || BgCheck_PosErrorCheck(posB, "../z_bgcheck.c", 5335) == true) { if (actor != NULL) { @@ -2466,7 +2466,7 @@ s32 BgCheck_SphVsFirstPolyImpl(CollisionContext* colCtx, u16 xpFlags, CollisionP *outBgId = BGCHECK_SCENE; -#if OOT_DEBUG +#if DEBUG_FEATURES if (BgCheck_PosErrorCheck(center, "../z_bgcheck.c", 5852) == true) { if (actor != NULL) { 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); if (!DynaPoly_IsBgIdBgActor(bgId)) { -#if OOT_DEBUG +#if DEBUG_FEATURES if (bgId == -1) { PRINTF(VT_FGCOL(GREEN)); PRINTF(T("DynaPolyInfo_delReserve():削除されているはずの(?)\n" @@ -2882,7 +2882,7 @@ void DynaPoly_AddBgActorToLookup(PlayState* play, DynaCollisionContext* dyna, s3 return; } -#if OOT_DEBUG +#if DEBUG_FEATURES if (!(dyna->polyListMax >= *polyStartIndex + pbgdata->numPolygons)) { PRINTF(VT_FGCOL(RED)); 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; } -#if OOT_DEBUG +#if DEBUG_FEATURES /** * Draw a list of dyna polys, specified by `ssList` */ diff --git a/src/code/z_camera.c b/src/code/z_camera.c index af1d69b1fe..db9fbddcb0 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -17,11 +17,11 @@ s32 Camera_UpdateWater(Camera* camera); #define CAMERA_CHECK_BTN(input, btn) CHECK_BTN_ALL((input)->press.button, (btn)) #endif -#if OOT_DEBUG +#if DEBUG_FEATURES s32 Camera_QRegInit(void); #endif -#if OOT_DEBUG +#if DEBUG_FEATURES #define CAM_DEBUG_RELOAD_PREG(camera) \ if (R_RELOAD_CAM_PARAMS) { \ Camera_CopyPREGToModeValues(camera); \ @@ -35,7 +35,7 @@ s32 Camera_QRegInit(void); // 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) -#if OOT_DEBUG +#if DEBUG_FEATURES #define CAM_DEBUG_RELOAD_PARAMS R_RELOAD_CAM_PARAMS #else #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 #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_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) { 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; s32 i; -#if OOT_DEBUG +#if DEBUG_FEATURES if (PREG(82)) { 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; } -#if OOT_DEBUG +#if DEBUG_FEATURES s32 Camera_CopyPREGToModeValues(Camera* camera) { CameraModeValue* values = sCameraSettings[camera->setting].cameraModes[camera->mode].values; CameraModeValue* valueP; @@ -950,7 +950,7 @@ Vec3f Camera_BGCheckCorner(Vec3f* linePointA, Vec3f* linePointB, CamColChk* poin bool result; result = func_800427B4(pointAColChk->poly, pointBColChk->poly, linePointA, linePointB, &closestPoint); -#if OOT_DEBUG +#if DEBUG_FEATURES if (!result) { PRINTF(VT_COL(YELLOW, BLACK) "camera: corner check no cross point %x %x\n" VT_RST, pointAColChk, pointBColChk); return pointAColChk->pos; @@ -2725,7 +2725,7 @@ s32 Camera_Jump3(Camera* camera) { roData->interfaceField = GET_NEXT_RO_DATA(values); } -#if OOT_DEBUG +#if DEBUG_FEATURES if (R_RELOAD_CAM_PARAMS) { prevMode = camera->mode; camera->mode = rwData->mode; @@ -2982,7 +2982,7 @@ s32 Camera_Battle1(Camera* camera) { rwData->target = camera->target; camera->animState++; -#if OOT_DEBUG +#if DEBUG_FEATURES if (rwData->target->id > 0) { PRINTF("camera: battle: target actor name " VT_FGCOL(BLUE) "%d" VT_RST "\n", rwData->target->id); } else { @@ -3890,7 +3890,7 @@ s32 Camera_KeepOn4(Camera* camera) { spB8.pitch = D_8011D3CC[i] + spA2; D_8015BD70 = Camera_AddVecGeoToVec3f(&D_8015BD50, &spB8); } -#if OOT_DEBUG +#if DEBUG_FEATURES PRINTF("camera: item: BG&collision check %d time(s)\n", i); #endif } @@ -4372,7 +4372,7 @@ s32 Camera_Subj3(Camera* camera) { func_80043ABC(camera); -#if OOT_DEBUG +#if DEBUG_FEATURES Camera_CopyPREGToModeValues(camera); #endif @@ -5744,7 +5744,7 @@ s32 Camera_Unique9(Camera* camera) { return true; } -#if OOT_DEBUG +#if DEBUG_FEATURES void Camera_DebugPrintSplineArray(char* name, s16 length, CutsceneCameraPoint cameraPoints[]) { 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, *relativeToPlayer == 0 ? T("絶対", "absolute") : T("相対", "relative")); -#if OOT_DEBUG +#if DEBUG_FEATURES if (PREG(93)) { Camera_DebugPrintSplineArray("CENTER", 5, csAtPoints); Camera_DebugPrintSplineArray(" EYE", 5, csEyePoints); @@ -5846,7 +5846,7 @@ s32 Camera_Demo1(Camera* camera) { Camera_RotateAroundPoint(&curPlayerPosRot, &csEyeUpdate, eyeNext); Camera_RotateAroundPoint(&curPlayerPosRot, &csAtUpdate, at); } -#if OOT_DEBUG +#if DEBUG_FEATURES else { 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) { s32 i; -#if OOT_DEBUG +#if DEBUG_FEATURES for (i = 0; i < sOREGInitCnt; i++) { OREG(i) = sOREGInit[i]; } @@ -7473,7 +7473,7 @@ void Camera_Init(Camera* camera, View* view, CollisionContext* colCtx, PlayState PREG(88) = -1; } camera->play = D_8015BD7C = play; -#if OOT_DEBUG +#if DEBUG_FEATURES DebugCamera_Init(&D_8015BD80, camera); #endif curUID = sNextUID; @@ -7528,7 +7528,7 @@ void Camera_Init(Camera* camera, View* view, CollisionContext* colCtx, PlayState camera->quakeOffset.z = 0; camera->atLERPStepScale = 1; sCameraInterfaceField = CAM_INTERFACE_FIELD(CAM_LETTERBOX_IGNORE, CAM_HUD_VISIBILITY_IGNORE, 0); -#if OOT_DEBUG +#if DEBUG_FEATURES sDbgModeIdx = -1; #endif D_8011D3F0 = 3; @@ -7630,7 +7630,7 @@ void Camera_InitDataUsingPlayer(Camera* camera, Player* player) { camera->nextBgCamIndex = -1; camera->atLERPStepScale = 1.0f; Camera_CopyDataToRegs(camera, camera->mode); -#if OOT_DEBUG +#if DEBUG_FEATURES Camera_QRegInit(); #endif PRINTF(VT_FGCOL(BLUE) "camera: personalize ---" VT_RST "\n"); @@ -7645,7 +7645,7 @@ s16 Camera_ChangeStatus(Camera* camera, s16 status) { CameraModeValue* valueP; s32 i; -#if OOT_DEBUG +#if DEBUG_FEATURES if (PREG(82)) { PRINTF("camera: change camera status: cond %c%c\n", 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; } -#if OOT_DEBUG +#if DEBUG_FEATURES void Camera_PrintSettings(Camera* camera) { char sp58[8]; char sp50[8]; @@ -7888,7 +7888,7 @@ s32 Camera_UpdateHotRoom(Camera* camera) { return 1; } -#if OOT_DEBUG +#if DEBUG_FEATURES s32 Camera_DbgChangeMode(Camera* camera) { static s16 D_8011DAFC[] = { 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 #else #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_DbgChangeMode(camera); #endif @@ -8168,7 +8168,7 @@ Vec3s Camera_Update(Camera* camera) { sCameraSettings[camera->setting].cameraModes[camera->mode].funcIdx); } -#if OOT_DEBUG +#if DEBUG_FEATURES // enable/disable debug cam if (CAMERA_CHECK_BTN(&D_8015BD7C->state.input[2], BTN_START)) { 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)); } -#if OOT_DEBUG +#if DEBUG_FEATURES if (camera->timer != -1 && CAMERA_CHECK_BTN(&D_8015BD7C->state.input[0], BTN_DRIGHT)) { camera->timer = 0; } @@ -8591,7 +8591,7 @@ s32 Camera_RequestBgCam(Camera* camera, s32 requestedBgCamIndex) { if (!(camera->behaviorFlags & CAM_BEHAVIOR_BG_PROCESSED)) { requestedCamSetting = Camera_GetBgCamSetting(camera, requestedBgCamIndex); camera->behaviorFlags |= CAM_BEHAVIOR_BG_PROCESSED; -#if OOT_DEBUG +#if DEBUG_FEATURES settingChangeSuccessful = Camera_RequestSettingImpl(camera, requestedCamSetting, CAM_REQUEST_SETTING_PRESERVE_BG_CAM_INDEX | CAM_REQUEST_SETTING_FORCE_CHANGE) >= 0; @@ -8622,7 +8622,7 @@ s32 Camera_RequestBgCam(Camera* camera, s32 requestedBgCamIndex) { } Vec3s Camera_GetInputDir(Camera* camera) { -#if OOT_DEBUG +#if DEBUG_FEATURES if (gDebugCamEnabled) { return D_8015BD80.sub.unk_104A; } @@ -8644,7 +8644,7 @@ s16 Camera_GetInputDirYaw(Camera* camera) { } Vec3s Camera_GetCamDir(Camera* camera) { -#if OOT_DEBUG +#if DEBUG_FEATURES if (gDebugCamEnabled) { return D_8015BD80.sub.unk_104A; } @@ -8841,7 +8841,7 @@ s32 Camera_Copy(Camera* dstCamera, Camera* srcCamera) { } s32 Camera_IsDebugCamEnabled(void) { -#if OOT_DEBUG +#if DEBUG_FEATURES return gDebugCamEnabled; #else 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) { if (!R_RELOAD_CAM_PARAMS) { QREG(2) = 1; diff --git a/src/code/z_camera_data.inc.c b/src/code/z_camera_data.inc.c index 3212173fd7..fece55ea3d 100644 --- a/src/code/z_camera_data.inc.c +++ b/src/code/z_camera_data.inc.c @@ -27,7 +27,7 @@ typedef struct CameraSetting { /*==================================================================*/ // Data -#if OOT_DEBUG +#if DEBUG_FEATURES s16 sOREGInit[] = { 0, // OREG(0) 1, // OREG(1) @@ -119,7 +119,7 @@ s16 sCamDataRegsInit[CAM_DATA_MAX] = { s16 sCamDataRegsInitCount = ARRAY_COUNT(sCamDataRegsInit); -#if OOT_DEBUG +#if DEBUG_FEATURES char sCameraSettingNames[][12] = { "NONE ", // CAM_SET_NONE "NORMAL0 ", // CAM_SET_NORMAL0 @@ -2562,7 +2562,7 @@ s32 sInitRegs = 1; s32 gDebugCamEnabled = false; -#if OOT_DEBUG +#if DEBUG_FEATURES s32 sDbgModeIdx = -1; #endif @@ -2588,7 +2588,7 @@ s32 D_8011D3F0 = 0; s32 sDemo5PrevAction12Frame = -16; -#if OOT_DEBUG +#if DEBUG_FEATURES char sCameraFunctionNames[][8] = { "NONE ", // CAM_FUNC_NONE "NORM0()", // CAM_FUNC_NORM0 @@ -2681,7 +2681,7 @@ Vec3f D_8011D678[] = { PlayState* D_8015BD7C; -#if OOT_DEBUG +#if DEBUG_FEATURES DebugCam D_8015BD80; #endif diff --git a/src/code/z_collision_check.c b/src/code/z_collision_check.c index f2741865a9..7904809bf9 100644 --- a/src/code/z_collision_check.c +++ b/src/code/z_collision_check.c @@ -25,7 +25,7 @@ typedef s32 (*ColChkLineFunc)(PlayState*, CollisionCheckContext*, Collider*, Vec #define SAC_ENABLE (1 << 0) -#if OOT_DEBUG +#if DEBUG_FEATURES /** * Draws a red triangle with vertices vA, vB, and vC. */ @@ -1028,7 +1028,7 @@ void CollisionCheck_InitContext(PlayState* play, CollisionCheckContext* colChkCt colChkCtx->sacFlags = 0; CollisionCheck_ClearContext(play, colChkCtx); -#if OOT_DEBUG +#if DEBUG_FEATURES AREG(21) = true; AREG(22) = true; AREG(23) = true; @@ -1082,7 +1082,7 @@ void CollisionCheck_DisableSAC(PlayState* play, CollisionCheckContext* colChkCtx colChkCtx->sacFlags &= ~SAC_ENABLE; } -#if OOT_DEBUG +#if DEBUG_FEATURES /** * Draws a collider of any shape. * 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 sBssDummy4; #endif @@ -3351,7 +3351,7 @@ void Collider_SetTrisDim(PlayState* play, ColliderTris* tris, s32 elemIndex, Col 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. //! 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 @@ -3734,7 +3734,7 @@ u8 CollisionCheck_GetSwordDamage(s32 dmgFlags) { damage = 8; } -#if OOT_DEBUG +#if DEBUG_FEATURES KREG(7) = damage; #endif diff --git a/src/code/z_debug.c b/src/code/z_debug.c index f937b2d174..d83dc23375 100644 --- a/src/code/z_debug.c +++ b/src/code/z_debug.c @@ -32,7 +32,7 @@ Color_RGBA8 sDebugCamTextColors[] = { { 128, 255, 32, 128 }, // DEBUG_CAM_TEXT_GREEN }; -#if OOT_DEBUG +#if DEBUG_FEATURES InputCombo sRegGroupInputCombos[REG_GROUPS] = { { BTN_L, BTN_CUP }, // REG { 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. * 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); } -#if OOT_DEBUG +#if DEBUG_FEATURES if (gRegEditor->regPage != 0) { Regs_DrawEditor(&printer); } diff --git a/src/code/z_demo.c b/src/code/z_demo.c index 0b177a1d3a..453a9f3fb0 100644 --- a/src/code/z_demo.c +++ b/src/code/z_demo.c @@ -138,7 +138,7 @@ s16 sQuakeIndex; void Cutscene_SetupScripted(PlayState* play, CutsceneContext* csCtx); -#if OOT_DEBUG +#if DEBUG_FEATURES void Cutscene_DrawDebugInfo(PlayState* play, Gfx** dlist, CutsceneContext* csCtx) { GfxPrint printer; s32 pad[2]; @@ -183,7 +183,7 @@ void Cutscene_UpdateManual(PlayState* play, CutsceneContext* csCtx) { } void Cutscene_UpdateScripted(PlayState* play, CutsceneContext* csCtx) { -#if OOT_DEBUG +#if DEBUG_FEATURES { Input* input = &play->state.input[0]; @@ -576,7 +576,7 @@ void CutsceneCmd_Destination(PlayState* play, CutsceneContext* csCtx, CsCmdDesti } 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))) { csCtx->state = CS_STATE_RUN_UNSTOPPABLE; Audio_SetCutsceneFlag(0); @@ -731,7 +731,7 @@ void CutsceneCmd_Destination(PlayState* play, CutsceneContext* csCtx, CsCmdDesti break; case CS_DEST_TEMPLE_OF_TIME_AFTER_LIGHT_MEDALLION: -#if OOT_DEBUG +#if DEBUG_FEATURES SET_EVENTCHKINF(EVENTCHKINF_WATCHED_SHEIK_AFTER_MASTER_SWORD_CS); #endif play->nextEntranceIndex = ENTR_TEMPLE_OF_TIME_4; @@ -902,7 +902,7 @@ void CutsceneCmd_Destination(PlayState* play, CutsceneContext* csCtx, CsCmdDesti break; 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); #endif play->nextEntranceIndex = ENTR_TEMPLE_OF_TIME_4; @@ -959,7 +959,7 @@ void CutsceneCmd_Destination(PlayState* play, CutsceneContext* csCtx, CsCmdDesti break; case CS_DEST_GERUDO_VALLEY_CREDITS: -#if OOT_DEBUG +#if DEBUG_FEATURES gSaveContext.gameMode = GAMEMODE_END_CREDITS; Audio_SetSfxBanksMute(0x6F); #endif @@ -1802,7 +1802,7 @@ void Cutscene_ProcessScript(PlayState* play, CutsceneContext* csCtx, u8* script) return; } -#if OOT_DEBUG +#if DEBUG_FEATURES if (CHECK_BTN_ALL(play->state.input[0].press.button, BTN_DRIGHT)) { csCtx->state = CS_STATE_STOP; return; @@ -2215,7 +2215,7 @@ void Cutscene_ProcessScript(PlayState* play, CutsceneContext* csCtx, u8* script) void CutsceneHandler_RunScript(PlayState* play, CutsceneContext* csCtx) { if (gSaveContext.save.cutsceneIndex >= 0xFFF0) { -#if OOT_DEBUG +#if DEBUG_FEATURES if (BREG(0) != 0) { Gfx* displayList; Gfx* prevDisplayList; @@ -2236,7 +2236,7 @@ void CutsceneHandler_RunScript(PlayState* play, CutsceneContext* csCtx) { csCtx->curFrame++; -#if OOT_DEBUG +#if DEBUG_FEATURES if (R_USE_DEBUG_CUTSCENE) { Cutscene_ProcessScript(play, csCtx, gDebugCutsceneScript); } else { diff --git a/src/code/z_effect_soft_sprite.c b/src/code/z_effect_soft_sprite.c index 2acc362b5e..4041426b41 100644 --- a/src/code/z_effect_soft_sprite.c +++ b/src/code/z_effect_soft_sprite.c @@ -10,7 +10,7 @@ void EffectSs_InitInfo(PlayState* play, s32 tableSize) { EffectSs* effectSs; EffectSsOverlay* overlay; -#if OOT_DEBUG +#if DEBUG_FEATURES for (i = 0; i < ARRAY_COUNT(gEffectSsOverlayTable); i++) { overlay = &gEffectSsOverlayTable[i]; PRINTF("effect index %3d:size=%6dbyte romsize=%6dbyte\n", i, diff --git a/src/code/z_kaleido_scope_call.c b/src/code/z_kaleido_scope_call.c index 42dc94ed89..69d2b2d9ba 100644 --- a/src/code/z_kaleido_scope_call.c +++ b/src/code/z_kaleido_scope_call.c @@ -60,7 +60,7 @@ void KaleidoScopeCall_Update(PlayState* play) { if (IS_PAUSED(&play->pauseCtx)) { if (pauseCtx->state == PAUSE_STATE_WAIT_LETTERBOX) { if (Letterbox_GetSize() == 0) { -#if OOT_DEBUG +#if DEBUG_FEATURES R_HREG_MODE = HREG_MODE_UCODE_DISAS; R_UCODE_DISAS_LOG_MODE = 3; #endif @@ -71,7 +71,7 @@ void KaleidoScopeCall_Update(PlayState* play) { pauseCtx->state = (pauseCtx->state & 0xFFFF) + 1; // PAUSE_STATE_WAIT_BG_PRERENDER } } else if (pauseCtx->state == PAUSE_STATE_GAME_OVER_START) { -#if OOT_DEBUG +#if DEBUG_FEATURES R_HREG_MODE = HREG_MODE_UCODE_DISAS; R_UCODE_DISAS_LOG_MODE = 3; #endif diff --git a/src/code/z_kaleido_setup.c b/src/code/z_kaleido_setup.c index 990b1c0405..075a13dcdb 100644 --- a/src/code/z_kaleido_setup.c +++ b/src/code/z_kaleido_setup.c @@ -72,7 +72,7 @@ void KaleidoSetup_Update(PlayState* play) { (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 (OOT_DEBUG && BREG(0)) { + if (DEBUG_FEATURES && BREG(0)) { pauseCtx->debugState = 3; } } else if (CHECK_BTN_ALL(input->press.button, BTN_START)) { diff --git a/src/code/z_kankyo.c b/src/code/z_kankyo.c index fd8900e770..2fa1a719e1 100644 --- a/src/code/z_kankyo.c +++ b/src/code/z_kankyo.c @@ -349,7 +349,7 @@ void Environment_Init(PlayState* play2, EnvironmentContext* envCtx, s32 unused) envCtx->sceneTimeSpeed = 0; gTimeSpeed = envCtx->sceneTimeSpeed; -#if OOT_DEBUG +#if DEBUG_FEATURES R_ENV_TIME_SPEED_OLD = gTimeSpeed; R_ENV_DISABLE_DBG = true; @@ -421,7 +421,7 @@ void Environment_Init(PlayState* play2, EnvironmentContext* envCtx, s32 unused) gSkyboxIsChanging = false; gSaveContext.retainWeatherMode = false; -#if OOT_DEBUG +#if DEBUG_FEATURES R_ENV_LIGHT1_DIR(0) = 80; R_ENV_LIGHT1_DIR(1) = 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) { PRINTF(VT_COL(RED, WHITE) T("\n環境VRデータ取得失敗! ささきまでご報告を!", "\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) { GfxPrint printer; s32 pad[2]; @@ -979,7 +979,7 @@ void Environment_Update(PlayState* play, EnvironmentContext* envCtx, LightContex gSaveContext.save.nightFlag = 0; } -#if OOT_DEBUG +#if DEBUG_FEATURES if (R_ENABLE_ARENA_DBG != 0 || CREG(2) != 0) { Gfx* displayList; Gfx* prevDisplayList; @@ -1146,7 +1146,7 @@ void Environment_Update(PlayState* play, EnvironmentContext* envCtx, LightContex envCtx->lightSettings.zFar = LERP16(blend16[0], blend16[1], configChangeBlend); -#if OOT_DEBUG +#if DEBUG_FEATURES if (sTimeBasedLightConfigs[envCtx->changeLightNextConfig][i].nextLightSetting >= envCtx->numLightSettings) { 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); } -#if OOT_DEBUG +#if DEBUG_FEATURES if (envCtx->lightSetting >= envCtx->numLightSettings) { PRINTF("\n" VT_FGCOL(RED) 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; } -#if OOT_DEBUG +#if DEBUG_FEATURES // When environment debug is enabled, various environment related variables can be configured via the reg editor if (R_ENV_DISABLE_DBG) { R_ENV_AMBIENT_COLOR(0) = lightCtx->ambientColor[0]; diff --git a/src/code/z_malloc.c b/src/code/z_malloc.c index 901e7b4e73..eaa1408bf4 100644 --- a/src/code/z_malloc.c +++ b/src/code/z_malloc.c @@ -7,14 +7,16 @@ Arena sZeldaArena; -#if OOT_DEBUG +#if DEBUG_FEATURES s32 gZeldaArenaLogSeverity = LOG_SEVERITY_ERROR; void ZeldaArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action) { if (ptr == NULL) { if (gZeldaArenaLogSeverity >= LOG_SEVERITY_ERROR) { PRINTF(T("%s: %u バイトの%sに失敗しました\n", "%s: %u bytes %s failed\n"), name, size, action); +#if PLATFORM_GC __osDisplayArena(&sZeldaArena); +#endif } } else if (gZeldaArenaLogSeverity >= LOG_SEVERITY_VERBOSE) { PRINTF(T("%s: %u バイトの%sに成功しました\n", "%s: %u bytes %s succeeded\n"), name, size, action); @@ -34,7 +36,7 @@ void* ZeldaArena_Malloc(u32 size) { return ptr; } -#if OOT_DEBUG +#if DEBUG_FEATURES void* ZeldaArena_MallocDebug(u32 size, const char* file, int line) { void* ptr = __osMallocDebug(&sZeldaArena, size, file, line); @@ -50,7 +52,7 @@ void* ZeldaArena_MallocR(u32 size) { return ptr; } -#if OOT_DEBUG +#if DEBUG_FEATURES void* ZeldaArena_MallocRDebug(u32 size, const char* file, int line) { void* ptr = __osMallocRDebug(&sZeldaArena, size, file, line); @@ -65,7 +67,7 @@ void* ZeldaArena_Realloc(void* ptr, u32 newSize) { return ptr; } -#if OOT_DEBUG +#if DEBUG_FEATURES void* ZeldaArena_ReallocDebug(void* ptr, u32 newSize, const char* file, int line) { ptr = __osReallocDebug(&sZeldaArena, ptr, newSize, file, line); ZELDA_ARENA_CHECK_POINTER(ptr, newSize, "zelda_realloc_DEBUG", T("再確保", "Re-securing")); @@ -77,7 +79,7 @@ void ZeldaArena_Free(void* ptr) { __osFree(&sZeldaArena, ptr); } -#if OOT_DEBUG +#if DEBUG_FEATURES void ZeldaArena_FreeDebug(void* ptr, const char* file, int line) { __osFreeDebug(&sZeldaArena, ptr, file, line); } @@ -96,7 +98,7 @@ void* ZeldaArena_Calloc(u32 num, u32 size) { return ret; } -#if OOT_DEBUG +#if PLATFORM_GC && DEBUG_FEATURES void ZeldaArena_Display(void) { PRINTF(T("ゼルダヒープ表示\n", "Zelda heap display\n")); __osDisplayArena(&sZeldaArena); @@ -112,14 +114,14 @@ void ZeldaArena_Check(void) { } void ZeldaArena_Init(void* start, u32 size) { -#if OOT_DEBUG +#if DEBUG_FEATURES gZeldaArenaLogSeverity = LOG_SEVERITY_NOLOG; #endif __osMallocInit(&sZeldaArena, start, size); } void ZeldaArena_Cleanup(void) { -#if OOT_DEBUG +#if DEBUG_FEATURES gZeldaArenaLogSeverity = LOG_SEVERITY_NOLOG; #endif __osMallocCleanup(&sZeldaArena); diff --git a/src/code/z_map_mark.c b/src/code/z_map_mark.c index ae654c22d3..4d0ab0411b 100644 --- a/src/code/z_map_mark.c +++ b/src/code/z_map_mark.c @@ -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_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - rectLeft = ((OOT_DEBUG ? GREG(94) : 0) + markPoint->x + 204) << 2; - rectTop = ((OOT_DEBUG ? GREG(95) : 0) + markPoint->y + 140) << 2; + rectLeft = ((DEBUG_FEATURES ? GREG(94) : 0) + markPoint->x + 204) << 2; + rectTop = ((DEBUG_FEATURES ? GREG(95) : 0) + markPoint->y + 140) << 2; gSPTextureRectangle(OVERLAY_DISP++, rectLeft, rectTop, markInfo->rectWidth + rectLeft, rectTop + markInfo->rectHeight, G_TX_RENDERTILE, 0, 0, markInfo->dsdx, markInfo->dtdy); diff --git a/src/code/z_message.c b/src/code/z_message.c index 75ccc2c089..368a53723e 100644 --- a/src/code/z_message.c +++ b/src/code/z_message.c @@ -3921,7 +3921,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { *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 * 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 s32 pad; #endif -#if OOT_DEBUG +#if DEBUG_FEATURES s16 watchVar; #endif OPEN_DISPS(play->state.gfxCtx, "../z_message_PAL.c", 3554); -#if OOT_DEBUG +#if DEBUG_FEATURES watchVar = gSaveContext.save.info.scarecrowLongSongSet; Message_DrawDebugVariableChanged(&watchVar, play->state.gfxCtx); if (BREG(0) != 0 && play->msgCtx.textId != 0) { @@ -4050,7 +4050,7 @@ void Message_Update(PlayState* play) { s32 pad2; #endif -#if OOT_DEBUG +#if DEBUG_FEATURES if (BREG(0) != 0) { static u16 sMessageDebuggerTextboxCount = 0; diff --git a/src/code/z_onepointdemo.c b/src/code/z_onepointdemo.c index 2fd634e5eb..04ffc2f463 100644 --- a/src/code/z_onepointdemo.c +++ b/src/code/z_onepointdemo.c @@ -5255,7 +5255,7 @@ s32 OnePointCutscene_Attention(PlayState* play, Actor* actor) { s32 temp2; s32 timer; -#if OOT_DEBUG +#if DEBUG_FEATURES if (sDisableAttention) { PRINTF(VT_COL(YELLOW, BLACK) "actor attention demo camera: canceled by other camera\n" VT_RST); return CAM_ID_NONE; diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c index 1662361771..74b0ef5eea 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -3986,7 +3986,7 @@ void Interface_Draw(PlayState* play) { } } -#if OOT_DEBUG +#if DEBUG_FEATURES if (pauseCtx->debugState == 3) { FlagSet_Update(play); } @@ -4012,7 +4012,7 @@ void Interface_Update(PlayState* play) { s16 risingAlpha; u16 action; -#if OOT_DEBUG +#if OOT_PAL && DEBUG_FEATURES { Input* debugInput = &play->state.input[2]; diff --git a/src/code/z_play.c b/src/code/z_play.c index bfca2ab4ff..84c80119a6 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -17,13 +17,13 @@ s32 gTransitionTileState; VisMono gPlayVisMono; Color_RGBA8_u32 gVisMonoColor; -#if OOT_DEBUG +#if DEBUG_FEATURES FaultClient D_801614B8; #endif s16 sTransitionFillTimer; -#if OOT_DEBUG +#if DEBUG_FEATURES void* gDebugCutsceneScript = NULL; UNK_TYPE D_8012D1F4 = 0; // unused #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. // 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) \ do { \ if (R_ENABLE_PLAY_LOGS) { \ @@ -254,7 +254,7 @@ void Play_Destroy(GameState* thisx) { } #endif -#if OOT_DEBUG +#if DEBUG_FEATURES Fault_RemoveClient(&D_801614B8); #endif } @@ -278,7 +278,7 @@ void Play_Init(GameState* thisx) { return; } -#if OOT_DEBUG +#if PLATFORM_GC && DEBUG_FEATURES SystemArena_Display(); #endif @@ -468,7 +468,7 @@ void Play_Init(GameState* thisx) { PRINTF(T("ゼルダヒープ %08x-%08x\n", "Zelda Heap %08x-%08x\n"), zAllocAligned, (u8*)zAllocAligned + zAllocSize - (s32)(zAllocAligned - zAlloc)); -#if OOT_DEBUG +#if PLATFORM_GC && DEBUG_FEATURES Fault_AddClient(&D_801614B8, ZeldaArena_Display, NULL, NULL); #endif @@ -505,7 +505,7 @@ void Play_Init(GameState* thisx) { AnimTaskQueue_Update(this, &this->animTaskQueue); gSaveContext.respawnFlag = 0; -#if OOT_DEBUG +#if DEBUG_FEATURES if (R_USE_DEBUG_CUTSCENE) { static u64 sDebugCutsceneScriptBuf[0xA00]; @@ -524,10 +524,12 @@ void Play_Update(PlayState* this) { s32 isPaused; s32 pad1; -#if OOT_DEBUG +#if DEBUG_FEATURES if ((SREG(1) < 0) || (DREG(0) != 0)) { SREG(1) = 0; +#if PLATFORM_GC ZeldaArena_Display(); +#endif } 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) { Play_SetupTransition(this, this->transitionType); } else { @@ -931,7 +933,7 @@ void Play_Update(PlayState* this) { PLAY_LOG(3555); AnimTaskQueue_Reset(&this->animTaskQueue); - if (!OOT_DEBUG) {} + if (!DEBUG_FEATURES) {} PLAY_LOG(3561); Object_UpdateEntries(&this->objectCtx); @@ -1139,7 +1141,7 @@ void Play_Draw(PlayState* this) { 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_XLU_DISP = Play_SetFog(this, POLY_XLU_DISP); @@ -1162,7 +1164,7 @@ void Play_Draw(PlayState* this) { 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* sp1CC = POLY_OPA_DISP; @@ -1231,7 +1233,7 @@ void Play_Draw(PlayState* this) { 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 == SKYBOX_NORMAL_SKY) || (this->skyboxId == SKYBOX_CUTSCENE_MAP)) { 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) { 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); } - 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_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); Lights_BindAll(sp228, this->lightCtx.listHead, NULL); 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) { 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; } else { 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) && (GET_ACTIVE_CAM(this)->setting != CAM_SET_PREREND_FIXED)) { Vec3f quakeOffset; @@ -1295,15 +1299,15 @@ void Play_Draw(PlayState* this) { 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); } - 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); } - 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) { sp21C.x = this->view.eye.x + this->envCtx.sunPos.x; sp21C.y = this->view.eye.y + this->envCtx.sunPos.y; @@ -1313,7 +1317,7 @@ void Play_Draw(PlayState* 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) { Environment_FillScreen(gfxCtx, MREG(65), MREG(66), MREG(67), MREG(68), 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) { 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); } @@ -1363,7 +1367,7 @@ void Play_Draw(PlayState* this) { } 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); } } @@ -1393,7 +1397,7 @@ void Play_Main(GameState* thisx) { 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_DRAW = true; R_PLAY_DRAW_SKYBOX = true; @@ -1411,7 +1415,7 @@ void Play_Main(GameState* thisx) { 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); } diff --git a/src/code/z_rcp.c b/src/code/z_rcp.c index 1e85a8c7e2..8f0f61ed34 100644 --- a/src/code/z_rcp.c +++ b/src/code/z_rcp.c @@ -1246,7 +1246,7 @@ Gfx* Gfx_SetupDL_69NoCD(Gfx* gfx) { return gfx; } -#if OOT_DEBUG +#if DEBUG_FEATURES #define HREG_21 HREG(21) #define HREG_22 HREG(22) #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)) { s32 letterboxSize = Letterbox_GetSize(); -#if OOT_DEBUG +#if DEBUG_FEATURES if (R_HREG_MODE == 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); diff --git a/src/code/z_scene_table.c b/src/code/z_scene_table.c index d8386c6887..24521f3aa3 100644 --- a/src/code/z_scene_table.c +++ b/src/code/z_scene_table.c @@ -1758,7 +1758,7 @@ SceneDrawConfigFunc sSceneDrawConfigs[SDC_MAX] = { }; void Scene_Draw(PlayState* play) { -#if OOT_DEBUG +#if DEBUG_FEATURES if (R_HREG_MODE == HREG_MODE_SCENE_CONFIG) { if (R_SCENE_CONFIG_INIT != HREG_MODE_SCENE_CONFIG) { R_SCENE_CONFIG_INIT = HREG_MODE_SCENE_CONFIG; diff --git a/src/code/z_sram.c b/src/code/z_sram.c index 3a5060abff..0fcee6f032 100644 --- a/src/code/z_sram.c +++ b/src/code/z_sram.c @@ -671,7 +671,7 @@ void Sram_VerifyAndLoadAllSaves(FileSelectState* fileSelect, SramContext* sramCt bzero(&gSaveContext.save.totalDays, sizeof(s32)); bzero(&gSaveContext.save.bgsDayCount, sizeof(s32)); -#if OOT_DEBUG +#if DEBUG_FEATURES if (!slotNum) { Sram_InitDebugSave(); gSaveContext.save.info.playerData.newf[0] = 'Z'; @@ -780,7 +780,7 @@ void Sram_InitSave(FileSelectState* fileSelect, SramContext* sramCtx) { u16* ptr; u16 checksum; -#if OOT_DEBUG +#if DEBUG_FEATURES if (fileSelect->buttonIndex != 0) { Sram_InitNewSave(); } else { @@ -795,7 +795,7 @@ void Sram_InitSave(FileSelectState* fileSelect, SramContext* sramCtx) { gSaveContext.save.dayTime = CLOCK_TIME(10, 0); gSaveContext.save.cutsceneIndex = 0xFFF1; -#if OOT_DEBUG +#if DEBUG_FEATURES if (fileSelect->buttonIndex == 0) { gSaveContext.save.cutsceneIndex = 0; } @@ -973,7 +973,7 @@ void Sram_InitSram(GameState* gameState, SramContext* sramCtx) { } #endif -#if OOT_DEBUG +#if DEBUG_FEATURES if (CHECK_BTN_ANY(gameState->input[2].cur.button, BTN_DRIGHT)) { bzero(sramCtx->readBuff, SRAM_SIZE); for (i = 0; i < CHECKSUM_SIZE; i++) { diff --git a/src/code/z_view.c b/src/code/z_view.c index 1c27679e20..5395f38556 100644 --- a/src/code/z_view.c +++ b/src/code/z_view.c @@ -316,7 +316,7 @@ s32 View_ApplyPerspective(View* view) { height = view->viewport.bottomY - view->viewport.topY; 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) { R_PERSPECTIVE_INIT = HREG_MODE_PERSPECTIVE; 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); } -#if OOT_DEBUG +#if DEBUG_FEATURES if (QREG(88) & 1) { s32 i; MtxF mf; @@ -375,7 +375,7 @@ s32 View_ApplyPerspective(View* view) { view->viewing = *viewing; -#if OOT_DEBUG +#if DEBUG_FEATURES // Debug print view matrix if (QREG(88) & 2) { s32 i; @@ -625,7 +625,7 @@ s32 View_ApplyTo(View* view, s32 mask, Gfx** gfxP) { return 1; } -#if OOT_DEBUG +#if DEBUG_FEATURES /** * Logs an error and returns nonzero if camera is too far from the origin. */ diff --git a/src/libc/absf.s b/src/libc/absf.s index 9df0c0a380..b423334614 100644 --- a/src/libc/absf.s +++ b/src/libc/absf.s @@ -1,6 +1,6 @@ #include "ultra64/asm.h" -#if OOT_DEBUG +#if DEBUG_FEATURES .set noreorder #endif diff --git a/src/libc/sqrt.s b/src/libc/sqrt.s index b4246ec865..6ffb2b7085 100644 --- a/src/libc/sqrt.s +++ b/src/libc/sqrt.s @@ -1,6 +1,6 @@ #include "ultra64/asm.h" -#if OOT_DEBUG +#if DEBUG_FEATURES .set noreorder #endif diff --git a/src/libc64/__osMalloc_gc.c b/src/libc64/__osMalloc_gc.c index 8d903f5ae5..f2770767fa 100644 --- a/src/libc64/__osMalloc_gc.c +++ b/src/libc64/__osMalloc_gc.c @@ -20,7 +20,7 @@ #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_PREV(node) ArenaImpl_GetPrevBlock(node) @@ -76,7 +76,7 @@ OSMesg sArenaLockMsg; void __osMallocAddBlock(Arena* arena, void* start, s32 size); -#if OOT_DEBUG +#if DEBUG_FEATURES u32 __osMalloc_FreeBlockTest_Enable; u32 ArenaImpl_GetFillAllocBlock(Arena* arena) { @@ -130,7 +130,7 @@ void ArenaImpl_Unlock(Arena* arena) { osRecvMesg(&arena->lockQueue, NULL, OS_MESG_BLOCK); } -#if OOT_DEBUG +#if DEBUG_FEATURES ArenaNode* ArenaImpl_GetNextBlock(ArenaNode* node) { 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) { ArenaNode* iter; ArenaNode* next; @@ -230,7 +230,7 @@ void ArenaImpl_RemoveAllBlocks(Arena* arena) { #endif void __osMallocCleanup(Arena* arena) { -#if OOT_DEBUG +#if DEBUG_FEATURES ArenaImpl_RemoveAllBlocks(arena); #endif bzero(arena, sizeof(*arena)); @@ -240,7 +240,7 @@ s32 __osMallocIsInitialized(Arena* arena) { return arena->isInit; } -#if OOT_DEBUG +#if DEBUG_FEATURES void __osMalloc_FreeBlockTest(Arena* arena, ArenaNode* node) { ArenaNode* node2 = node; 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); return; } -#if OOT_DEBUG +#if DEBUG_FEATURES if (arena != node->arena && arena != NULL) { PRINTF(VT_COL(RED, WHITE) T("__osFree:確保時と違う方法で解放しようとした (%08x:%08x)\n", @@ -542,7 +542,7 @@ void __osFree(Arena* arena, void* ptr) { ArenaImpl_Unlock(arena); } -#if OOT_DEBUG +#if DEBUG_FEATURES void __osFree_NoLockDebug(Arena* arena, void* ptr, const char* file, int line) { ArenaNode* node; ArenaNode* next; @@ -711,7 +711,7 @@ void* __osRealloc(Arena* arena, void* ptr, u32 newSize) { return ptr; } -#if OOT_DEBUG +#if DEBUG_FEATURES void* __osReallocDebug(Arena* arena, void* ptr, u32 newSize, const char* file, int line) { return __osRealloc(arena, ptr, newSize); } @@ -743,7 +743,7 @@ void ArenaImpl_GetSizes(Arena* arena, u32* outMaxFree, u32* outFree, u32* outAll ArenaImpl_Unlock(arena); } -#if OOT_DEBUG +#if DEBUG_FEATURES void __osDisplayArena(Arena* arena) { u32 freeSize; u32 allocatedSize; @@ -867,7 +867,7 @@ s32 __osCheckArena(Arena* arena) { while (iter != NULL) { //! @bug: Probably intended to be `!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, iter->magic); #else @@ -886,7 +886,7 @@ s32 __osCheckArena(Arena* arena) { return error; } -#if OOT_DEBUG +#if DEBUG_FEATURES u8 ArenaImpl_GetAllocFailures(Arena* arena) { return arena->allocFailures; } diff --git a/src/libc64/malloc.c b/src/libc64/malloc.c index 57dd88e282..f7a642ce9d 100644 --- a/src/libc64/malloc.c +++ b/src/libc64/malloc.c @@ -9,14 +9,16 @@ Arena gSystemArena; -#if OOT_DEBUG +#if DEBUG_FEATURES s32 gSystemArenaLogSeverity = LOG_SEVERITY_NOLOG; void SystemArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action) { if (ptr == NULL) { if (gSystemArenaLogSeverity >= LOG_SEVERITY_ERROR) { PRINTF(T("%s: %u バイトの%sに失敗しました\n", "%s: %u bytes %s failed\n"), name, size, action); +#if PLATFORM_GC __osDisplayArena(&gSystemArena); +#endif return; } } else if (gSystemArenaLogSeverity >= LOG_SEVERITY_VERBOSE) { @@ -41,7 +43,7 @@ void* SystemArena_Malloc(u32 size) { return ptr; } -#if OOT_DEBUG +#if DEBUG_FEATURES void* SystemArena_MallocDebug(u32 size, const char* file, int line) { DECLARE_INTERRUPT_MASK void* ptr; @@ -67,7 +69,7 @@ void* SystemArena_MallocR(u32 size) { return ptr; } -#if OOT_DEBUG +#if DEBUG_FEATURES void* SystemArena_MallocRDebug(u32 size, const char* file, int line) { DECLARE_INTERRUPT_MASK void* ptr; @@ -92,7 +94,7 @@ void* SystemArena_Realloc(void* ptr, u32 newSize) { return ptr; } -#if OOT_DEBUG +#if DEBUG_FEATURES void* SystemArena_ReallocDebug(void* ptr, u32 newSize, const char* file, int line) { DECLARE_INTERRUPT_MASK @@ -113,7 +115,7 @@ void SystemArena_Free(void* ptr) { RESTORE_INTERRUPTS(); } -#if OOT_DEBUG +#if DEBUG_FEATURES void SystemArena_FreeDebug(void* ptr, const char* file, int line) { DECLARE_INTERRUPT_MASK @@ -140,7 +142,7 @@ void* SystemArena_Calloc(u32 num, u32 size) { return ret; } -#if OOT_DEBUG +#if PLATFORM_GC && DEBUG_FEATURES void SystemArena_Display(void) { PRINTF(T("システムヒープ表示\n", "System heap display\n")); __osDisplayArena(&gSystemArena); @@ -156,14 +158,14 @@ void SystemArena_Check(void) { } void SystemArena_Init(void* start, u32 size) { -#if OOT_DEBUG +#if DEBUG_FEATURES gSystemArenaLogSeverity = LOG_SEVERITY_NOLOG; #endif __osMallocInit(&gSystemArena, start, size); } void SystemArena_Cleanup(void) { -#if OOT_DEBUG +#if DEBUG_FEATURES gSystemArenaLogSeverity = LOG_SEVERITY_NOLOG; #endif __osMallocCleanup(&gSystemArena); diff --git a/src/libu64/code_800FC620.c b/src/libu64/code_800FC620.c index 8bed1af23c..94926d838e 100644 --- a/src/libu64/code_800FC620.c +++ b/src/libu64/code_800FC620.c @@ -14,7 +14,7 @@ typedef struct InitFunc { // .data void* sInitFuncs = NULL; -#if OOT_DEBUG +#if DEBUG_FEATURES char sNew[] = "new"; #else char sNew[] = ""; @@ -38,7 +38,7 @@ void* func_800FC800(u32 size) { size = 1; } -#if OOT_DEBUG +#if DEBUG_FEATURES ptr = __osMallocDebug(&gSystemArena, size, sNew, 0); #else ptr = __osMalloc(&gSystemArena, size); diff --git a/src/libu64/debug.c b/src/libu64/debug.c index aa67313134..80be25f9d0 100644 --- a/src/libu64/debug.c +++ b/src/libu64/debug.c @@ -2,7 +2,7 @@ #include "fault.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, const char* maxName, f32 max) { if (value < min || max < value) { @@ -13,7 +13,7 @@ f32 LogUtils_CheckFloatRange(const char* exp, int line, const char* valueName, f } #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, const char* maxName, s32 max) { 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) { 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); #endif Fault_AddHungupAndCrash(name, line); } void LogUtils_ResetHungup(void) { -#if PLATFORM_N64 || OOT_DEBUG +#if PLATFORM_N64 || DEBUG_FEATURES osSyncPrintf("*** Reset ***\n"); #endif Fault_AddHungupAndCrash("Reset", 0); diff --git a/src/libu64/gfxprint.c b/src/libu64/gfxprint.c index db586a8513..b3ebfcd0ef 100644 --- a/src/libu64/gfxprint.c +++ b/src/libu64/gfxprint.c @@ -382,7 +382,7 @@ void GfxPrint_Open(GfxPrint* this, Gfx* dList) { this->dList = dList; GfxPrint_Setup(this); } else { -#if PLATFORM_N64 || OOT_DEBUG +#if PLATFORM_N64 || DEBUG_FEATURES osSyncPrintf(T("gfxprint_open:2重オープンです\n", "gfxprint_open: Double open\n")); #endif } diff --git a/src/libu64/rcp_utils.c b/src/libu64/rcp_utils.c index 574a1a5df8..420ac51f98 100644 --- a/src/libu64/rcp_utils.c +++ b/src/libu64/rcp_utils.c @@ -1,6 +1,6 @@ #include "global.h" -#if PLATFORM_N64 || OOT_DEBUG +#if PLATFORM_N64 || DEBUG_FEATURES #define RCP_UTILS_PRINTF osSyncPrintf #elif IDO_PRINTF_WORKAROUND #define RCP_UTILS_PRINTF(args) (void)0 diff --git a/src/libu64/stackcheck.c b/src/libu64/stackcheck.c index 399b6c051b..596c0b4115 100644 --- a/src/libu64/stackcheck.c +++ b/src/libu64/stackcheck.c @@ -167,7 +167,7 @@ u32 StackCheck_GetState(StackEntry* entry) { ret = STACK_STATUS_OK; } -#if !OOT_DEBUG +#if !DEBUG_FEATURES // This string is still in .rodata for retail builds (void)"(null)"; #endif @@ -176,7 +176,7 @@ u32 StackCheck_GetState(StackEntry* entry) { entry->name != NULL ? entry->name : "(null)"); PRINTF(VT_RST); -#if OOT_DEBUG +#if DEBUG_FEATURES if (ret != STACK_STATUS_OK) { LogUtils_LogHexDump(entry->head, (uintptr_t)entry->tail - (uintptr_t)entry->head); } diff --git a/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c b/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c index fb0310acbe..d22c6124eb 100644 --- a/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c +++ b/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c @@ -97,7 +97,7 @@ void BgBdanSwitch_InitDynaPoly(BgBdanSwitch* this, PlayState* play, CollisionHea CollisionHeader_GetVirtual(collision, &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) { s32 pad2; diff --git a/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c b/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c index 89928eb6e3..567b141e72 100644 --- a/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c +++ b/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c @@ -287,7 +287,7 @@ void BgDyYoseizo_ChooseType(BgDyYoseizo* this, PlayState* play) { } if (givingReward) { - if (!IS_CUTSCENE_LAYER || !OOT_DEBUG) { + if (!IS_CUTSCENE_LAYER || !DEBUG_FEATURES) { if (play->sceneId != SCENE_GREAT_FAIRYS_FOUNTAIN_MAGIC) { switch (this->fountainType) { case FAIRY_SPELL_FARORES_WIND: diff --git a/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c b/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c index 3bfa831b73..ffe3b6c837 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c @@ -86,7 +86,7 @@ void BgHidanCurtain_Init(Actor* thisx, PlayState* play) { this->treasureFlag = PARAMS_GET_U(thisx->params, 6, 6); 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" PRINTF("Warning : object のセーブビットが設定されていない(%s %d)(arg_data 0x%04x)\n", "../z_bg_hidan_curtain.c", 373, this->actor.params); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c index 812a97f51f..4888bc381f 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c @@ -348,7 +348,7 @@ void func_80888A58(BgHidanHamstep* this, PlayState* play) { Actor_MoveXZGravity(&this->dyna.actor); 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) { // "[Hammer Step] arg_data strange (arg_data = %d)" PRINTF("【ハンマーステップ】 arg_data おかしい (arg_data = %d)", this->dyna.actor.params); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c b/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c index a4f1b187c8..7a65b45343 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c @@ -74,7 +74,7 @@ void BgHidanKousi_Init(Actor* thisx, PlayState* play) { 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) { PRINTF("arg_data おかしい 【格子】\n"); } diff --git a/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c b/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c index 652b83ad0f..5f9a1a6ca1 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c +++ b/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c @@ -120,7 +120,7 @@ void BgIceShelter_InitDynaPoly(BgIceShelter* this, PlayState* play, CollisionHea CollisionHeader_GetVirtual(collision, &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) { s32 pad2; diff --git a/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c b/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c index 1110d2dbb8..0e35886304 100644 --- a/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c +++ b/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c @@ -74,7 +74,7 @@ void BgJya1flift_InitDynapoly(BgJya1flift* this, PlayState* play, CollisionHeade CollisionHeader_GetVirtual(collision, &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) { s32 pad2; diff --git a/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.c b/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.c index 10548a1d16..df98fa50ae 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.c +++ b/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.c @@ -50,7 +50,7 @@ void BgJyaAmishutter_InitDynaPoly(BgJyaAmishutter* this, PlayState* play, Collis CollisionHeader_GetVirtual(collision, &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) { s32 pad2; diff --git a/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c b/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c index d705c08bb5..4c065932f0 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c +++ b/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c @@ -74,7 +74,7 @@ void BgJyaBigmirror_HandleCobra(Actor* thisx, PlayState* play) { this->puzzleFlags &= ~cobraPuzzleFlags[i]; } -#if OOT_DEBUG +#if DEBUG_FEATURES if (curCobraInfo->cobra->dyna.actor.update == NULL) { // "Cobra deleted" 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, sMirRayPositions[i].z, 0, 0, 0, sMirRayParamsVals[i]); -#if OOT_DEBUG +#if DEBUG_FEATURES if (this->lightBeams[i] == NULL) { // "Mir Ray generation failed" PRINTF("Error : Mir Ray 発生失敗 (%s %d)\n", "../z_bg_jya_bigmirror.c", 310); diff --git a/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c b/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c index a9d953fb72..6268abe6ab 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c +++ b/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c @@ -70,7 +70,7 @@ void BgJyaBombiwa_SetupDynaPoly(BgJyaBombiwa* this, PlayState* play, CollisionHe CollisionHeader_GetVirtual(collision, &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) { s32 pad2; diff --git a/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c b/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c index 117878f8bf..e40258f9f6 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c +++ b/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c @@ -123,7 +123,7 @@ void BgJyaCobra_InitDynapoly(BgJyaCobra* this, PlayState* play, CollisionHeader* CollisionHeader_GetVirtual(collision, &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) { 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, 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) { PRINTF(VT_FGCOL(RED)); // "Error : Mir Ray occurrence failure" diff --git a/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c b/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c index 86e857d193..cf15c084b0 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c +++ b/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c @@ -106,7 +106,7 @@ void BgJyaIronobj_SpawnPillarParticles(BgJyaIronobj* this, PlayState* play, EnIk f32 sins; s32 pad[2]; -#if OOT_DEBUG +#if DEBUG_FEATURES if (enIk->unk_2FF <= 0 || enIk->unk_2FF >= 4) { PRINTF("Error 攻撃方法が分からない(%s %d)\n", "../z_bg_jya_ironobj.c", 233); return; @@ -172,7 +172,7 @@ void BgJyaIronobj_SpawnThroneParticles(BgJyaIronobj* this, PlayState* play, EnIk f32 sins; s32 pad[2]; -#if OOT_DEBUG +#if DEBUG_FEATURES if (enIk->unk_2FF <= 0 || enIk->unk_2FF >= 4) { PRINTF("Error 攻撃方法が分からない(%s %d)\n", "../z_bg_jya_ironobj.c", 362); return; diff --git a/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c b/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c index 1f4287aa2f..55f106a0ce 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c +++ b/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c @@ -48,7 +48,7 @@ void BgJyaKanaami_InitDynaPoly(BgJyaKanaami* this, PlayState* play, CollisionHea CollisionHeader_GetVirtual(collision, &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) { s32 pad2; diff --git a/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c b/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c index b4bd5d4e77..d33e173cee 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c +++ b/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c @@ -67,7 +67,7 @@ void BgJyaZurerukabe_InitDynaPoly(BgJyaZurerukabe* this, PlayState* play, Collis CollisionHeader_GetVirtual(collision, &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) { s32 pad2; diff --git a/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c b/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c index ade2f41741..2b3abc2733 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c @@ -53,7 +53,7 @@ static InitChainEntry sInitChain[] = { u32 BgMizuWater_GetWaterLevelActionIndex(s16 switchFlag, PlayState* play) { u32 ret; -#if OOT_DEBUG +#if DEBUG_FEATURES if (bREG(0) != 0) { switch (bREG(1)) { case 0: @@ -300,7 +300,7 @@ void BgMizuWater_Update(Actor* thisx, PlayState* play) { s32 unk1; s32 pad; -#if OOT_DEBUG +#if DEBUG_FEATURES if (bREG(15) == 0) { 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)); diff --git a/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c b/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c index a7d44a34b8..7726f3b2d1 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c +++ b/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c @@ -58,7 +58,7 @@ void BgMoriBigst_InitDynapoly(BgMoriBigst* this, PlayState* play, CollisionHeade CollisionHeader_GetVirtual(collision, &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) { s32 pad2; diff --git a/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c b/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c index 28087ca671..3ed26dfe1c 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c +++ b/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c @@ -89,7 +89,7 @@ void BgMoriElevator_Init(Actor* thisx, PlayState* play) { this->unk_172 = sIsSpawned; this->moriTexObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_MORI_TEX); -#if OOT_DEBUG +#if DEBUG_FEATURES if (this->moriTexObjectSlot < 0) { Actor_Kill(thisx); // "Forest Temple obj elevator Bank Danger!" diff --git a/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c b/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c index 3b54cc8e35..7db118d243 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c +++ b/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c @@ -87,7 +87,7 @@ void BgMoriHashigo_InitDynapoly(BgMoriHashigo* this, PlayState* play, CollisionH CollisionHeader_GetVirtual(collision, &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) { s32 pad2; diff --git a/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c b/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c index b52a0feb70..e1ce8bdc05 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c +++ b/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c @@ -56,7 +56,7 @@ void BgMoriHashira4_InitDynaPoly(BgMoriHashira4* this, PlayState* play, Collisio CollisionHeader_GetVirtual(collision, &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) { s32 pad2; diff --git a/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c b/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c index 63173262e7..e4d30217dd 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c +++ b/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c @@ -53,7 +53,7 @@ void BgMoriRakkatenjo_Init(Actor* thisx, PlayState* play) { DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS); -#if OOT_DEBUG +#if DEBUG_FEATURES // "Forest Temple obj. Falling Ceiling" PRINTF("森の神殿 obj. 落下天井 (home posY %f)\n", this->dyna.actor.home.pos.y); if ((fabsf(1991.0f - this->dyna.actor.home.pos.x) > 0.001f) || diff --git a/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c b/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c index 9fcaf42f7e..f9a7d9c695 100644 --- a/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c +++ b/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c @@ -46,7 +46,7 @@ void BgSpot08Iceblock_InitDynaPoly(BgSpot08Iceblock* this, PlayState* play, Coll CollisionHeader_GetVirtual(collision, &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) { s32 pad2; diff --git a/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c b/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c index 113fdfad9e..719baddf1b 100644 --- a/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c +++ b/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c @@ -51,7 +51,7 @@ void BgSpot12Gate_InitDynaPoly(BgSpot12Gate* this, PlayState* play, CollisionHea CollisionHeader_GetVirtual(collision, &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) { s32 pad2; diff --git a/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c b/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c index abbb7bd80b..bf53fec356 100644 --- a/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c +++ b/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c @@ -48,7 +48,7 @@ void func_808B3420(BgSpot12Saku* this, PlayState* play, CollisionHeader* collisi CollisionHeader_GetVirtual(collision, &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) { s32 pad2; diff --git a/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c b/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c index 1b0b3a9edf..bacf35e14d 100644 --- a/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c +++ b/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c @@ -63,7 +63,7 @@ void func_808B3960(BgSpot15Rrbox* this, PlayState* play, CollisionHeader* collis CollisionHeader_GetVirtual(collision, &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) { s32 pad2; diff --git a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c index 5aa678ef2e..7e2f27fcc9 100644 --- a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c +++ b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c @@ -251,7 +251,7 @@ void BgSpot16Bombstone_Init(Actor* thisx, PlayState* play) { shouldLive = func_808B4E58(this, play); break; -#if OOT_DEBUG +#if DEBUG_FEATURES default: PRINTF("Error : arg_data おかしいな(%s %d)(arg_data 0x%04x)\n", "../z_bg_spot16_bombstone.c", 668, this->actor.params); @@ -455,7 +455,7 @@ void func_808B5950(BgSpot16Bombstone* this, PlayState* play) { CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderJntSph.base); } -#if OOT_DEBUG +#if DEBUG_FEATURES if (mREG(64) == 1) { func_808B561C(this, play); mREG(64) = -10; diff --git a/src/overlays/actors/ovl_Demo_Du/z_demo_du.c b/src/overlays/actors/ovl_Demo_Du/z_demo_du.c index 35c6b7550f..4323de1380 100644 --- a/src/overlays/actors/ovl_Demo_Du/z_demo_du.c +++ b/src/overlays/actors/ovl_Demo_Du/z_demo_du.c @@ -67,7 +67,7 @@ void DemoDu_SetMouthTexIndex(DemoDu* this, s16 mouthTexIndex) { this->mouthTexIndex = mouthTexIndex; } -#if OOT_DEBUG +#if DEBUG_FEATURES // Resets all the values used in this cutscene. void DemoDu_CsAfterGanon_Reset(DemoDu* this) { this->updateIndex = CS_CHAMBERAFTERGANON_SUBSCENE(0); @@ -777,7 +777,7 @@ void DemoDu_CsAfterGanon_BackTo01(DemoDu* this, PlayState* play) { void DemoDu_UpdateCs_AG_00(DemoDu* this, PlayState* play) { DemoDu_CsAfterGanon_AdvanceTo01(this, play); -#if OOT_DEBUG +#if DEBUG_FEATURES DemoDu_CsAfterGanon_CheckIfShouldReset(this, play); #endif } @@ -787,7 +787,7 @@ void DemoDu_UpdateCs_AG_01(DemoDu* this, PlayState* play) { DemoDu_UpdateSkelAnime(this); DemoDu_UpdateEyes(this); DemoDu_CsAfterGanon_AdvanceTo02(this, play); -#if OOT_DEBUG +#if DEBUG_FEATURES DemoDu_CsAfterGanon_CheckIfShouldReset(this, play); #endif } @@ -797,7 +797,7 @@ void DemoDu_UpdateCs_AG_02(DemoDu* this, PlayState* play) { DemoDu_UpdateSkelAnime(this); DemoDu_UpdateEyes(this); DemoDu_CsAfterGanon_BackTo01(this, play); -#if OOT_DEBUG +#if DEBUG_FEATURES DemoDu_CsAfterGanon_CheckIfShouldReset(this, play); #endif } diff --git a/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c b/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c index 99bc65fbe3..a7087e8975 100644 --- a/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c +++ b/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.c @@ -166,7 +166,7 @@ void func_809782A0(DemoGeff* this, PlayState* play) { void func_80978308(DemoGeff* this, PlayState* play) { func_809781FC(this, play); func_809782A0(this, play); -#if OOT_DEBUG +#if DEBUG_FEATURES func_80978030(this, play); #endif } diff --git a/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c b/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c index 4072758cc9..4182a99e1a 100644 --- a/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c +++ b/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c @@ -263,7 +263,7 @@ s32 DemoGj_InitSetIndices(DemoGj* this, PlayState* play, s32 updateMode, s32 dra } void DemoGj_DrawCommon(DemoGj* this, PlayState* play, Gfx* displayList) { - if (!OOT_DEBUG || kREG(0) == 0) { + if (!DEBUG_FEATURES || kREG(0) == 0) { GraphicsContext* gfxCtx = play->state.gfxCtx; OPEN_DISPS(gfxCtx, "../z_demo_gj.c", 1163); @@ -975,7 +975,7 @@ void DemoGj_InitDestructableRubble1(DemoGj* this, PlayState* play) { DemoGj_InitCylinder(this, play, &this->cylinders[2], &sCylinderInit1); } -#if OOT_DEBUG +#if DEBUG_FEATURES void DemoGj_DoNothing1(DemoGj* this, PlayState* play) { } #endif @@ -1095,7 +1095,7 @@ void DemoGj_Update15(DemoGj* this, PlayState* play) { // func_8097B370 void DemoGj_Update18(DemoGj* this, PlayState* play) { func_8097B22C(this, play); -#if OOT_DEBUG +#if DEBUG_FEATURES DemoGj_DoNothing1(this, play); #endif } @@ -1112,7 +1112,7 @@ void DemoGj_InitDestructableRubble2(DemoGj* this, PlayState* play) { DemoGj_InitCylinder(this, play, &this->cylinders[2], &sCylinderInit2); } -#if OOT_DEBUG +#if DEBUG_FEATURES void DemoGj_DoNothing2(DemoGj* this, PlayState* play) { } #endif @@ -1230,7 +1230,7 @@ void DemoGj_Update16(DemoGj* this, PlayState* play) { // func_8097B894 void DemoGj_Update19(DemoGj* this, PlayState* play) { func_8097B750(this, play); -#if OOT_DEBUG +#if DEBUG_FEATURES DemoGj_DoNothing2(this, play); #endif } @@ -1245,7 +1245,7 @@ void DemoGj_InitDestructableRubbleTall(DemoGj* this, PlayState* play) { DemoGj_InitCylinder(this, play, &this->cylinders[0], &sCylinderInit3); } -#if OOT_DEBUG +#if DEBUG_FEATURES void DemoGj_DoNothing3(DemoGj* this, PlayState* play) { } #endif @@ -1319,7 +1319,7 @@ void DemoGj_Update17(DemoGj* this, PlayState* play) { // func_8097BBA8 void DemoGj_Update20(DemoGj* this, PlayState* play) { func_8097BA48(this, play); -#if OOT_DEBUG +#if DEBUG_FEATURES DemoGj_DoNothing3(this, play); #endif } diff --git a/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c b/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c index 2c0967f456..1f0c9e4dd9 100644 --- a/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c +++ b/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c @@ -440,7 +440,7 @@ void func_8097ED64(DemoGt* this, PlayState* play, s32 cueChannel) { } u8 DemoGt_IsCutsceneLayer(void) { - if (OOT_DEBUG && (kREG(2) != 0)) { + if (DEBUG_FEATURES && (kREG(2) != 0)) { return true; } else if (!IS_CUTSCENE_LAYER) { return false; @@ -506,7 +506,7 @@ void func_8097EF40(DemoGt* this, PlayState* play) { Vec3f* pos = &this->dyna.actor.world.pos; s32 pad; - if ((OOT_DEBUG && (kREG(1) == 20)) || (csCurFrame == 220)) { + if ((DEBUG_FEATURES && (kREG(1) == 20)) || (csCurFrame == 220)) { dustPos.x = pos->x + 256.0f; dustPos.y = pos->y + 679.0f; dustPos.z = pos->z + 82.0f; @@ -529,7 +529,7 @@ void func_8097F0AC(DemoGt* this, PlayState* play) { u16 csCurFrame = play->csCtx.curFrame; s32 pad2; -#if OOT_DEBUG +#if DEBUG_FEATURES if (csCurFrame == 140 || kREG(1) == 19) #else if (csCurFrame == 140) @@ -712,7 +712,7 @@ void func_8097F96C(DemoGt* this, PlayState* play) { Actor* actor; u16 csCurFrame = play->csCtx.curFrame; - if (((csCurFrame > 1059) && (csCurFrame < 1062)) || (OOT_DEBUG && (kREG(1) == 17))) { + if (((csCurFrame > 1059) && (csCurFrame < 1062)) || (DEBUG_FEATURES && (kREG(1) == 17))) { static Actor* cloudRing = NULL; pos.x = this->dyna.actor.world.pos.x; @@ -738,7 +738,7 @@ void func_8097FA1C(DemoGt* this, PlayState* play) { Vec3f velOffset = { -12.0f, -17.0, 5.0 }; s32 pad1[3]; - if (((csCurFrame > 502) && !(csCurFrame >= 581)) || (OOT_DEBUG && (kREG(1) == 5))) { + if (((csCurFrame > 502) && !(csCurFrame >= 581)) || (DEBUG_FEATURES && (kREG(1) == 5))) { dustPos.x = pos->x + 300.0f; dustPos.y = pos->y + 360.0f; dustPos.z = pos->z - 377.0f; @@ -752,7 +752,7 @@ void func_8097FAFC(DemoGt* this, PlayState* play) { Vec3f pos; f32 new_var = -200.0; - if (((csCurFrame > 582) && (csCurFrame < 683)) || (OOT_DEBUG && (kREG(1) == 6))) { + if (((csCurFrame > 582) && (csCurFrame < 683)) || (DEBUG_FEATURES && (kREG(1) == 6))) { static Vec3f velocity = { 0.0f, 1.0f, 0.0f }; static Vec3f accel = { 0.0f, 0.0f, 0.0f }; static f32 arg4 = 280.0f; @@ -782,7 +782,7 @@ void func_8097FC1C(DemoGt* this, PlayState* play) { Vec3f velOffset = { 5.0f, -16.0f, -16.0f }; s32 pad1[3]; - if (csCurFrame > 682 || (OOT_DEBUG && (kREG(1) == 7))) { + if (csCurFrame > 682 || (DEBUG_FEATURES && (kREG(1) == 7))) { dustPos.x = pos->x + 260.0f; dustPos.y = pos->y + 360.0f; dustPos.z = pos->z + 260.0f; @@ -795,7 +795,7 @@ void func_8097FCE4(DemoGt* this, PlayState* play) { Vec3f vec; u16 csCurFrame = play->csCtx.curFrame; -#if OOT_DEBUG +#if DEBUG_FEATURES if (csCurFrame == 503 || kREG(1) == 4) #else if (csCurFrame == 503) @@ -981,7 +981,7 @@ void func_80980430(DemoGt* this, PlayState* play) { Vec3f velOffset = { 5.0f, -3.0f, 0.0f }; s32 pad1[3]; - if (csCurFrame > 709 || (OOT_DEBUG && (kREG(1) == 8))) { + if (csCurFrame > 709 || (DEBUG_FEATURES && (kREG(1) == 8))) { dustPos.x = pos->x + 760.0f; dustPos.y = pos->y - 40.0f; dustPos.z = pos->z - 240.0f; @@ -997,7 +997,7 @@ void func_80980504(DemoGt* this, PlayState* play) { Vec3f velOffset = { 5.0f, -16.0f, -16.0f }; s32 pad1[3]; - if ((csCurFrame > 704) || (OOT_DEBUG && (kREG(1) == 9))) { + if ((csCurFrame > 704) || (DEBUG_FEATURES && (kREG(1) == 9))) { dustPos.x = pos->x + 830.0f; dustPos.y = pos->y + 60.0f; dustPos.z = pos->z + 390.0f; @@ -1013,7 +1013,7 @@ void func_809805D8(DemoGt* this, PlayState* play) { Vec3f velOffset = { 15.0f, -26.0, 0.0f }; s32 pad1[3]; - if (((csCurFrame > 739) && (csCurFrame < 781)) || (OOT_DEBUG && (kREG(1) == 11))) { + if (((csCurFrame > 739) && (csCurFrame < 781)) || (DEBUG_FEATURES && (kREG(1) == 11))) { dustPos.x = homePos->x + 550.0f; dustPos.y = homePos->y - 110.0f; dustPos.z = homePos->z + 50.0f; @@ -1029,7 +1029,7 @@ void func_809806B8(DemoGt* this, PlayState* play) { Vec3f velOffset = { 5.0f, -16.0f, -16.0f }; s32 pad1[3]; - if ((csCurFrame > 964) || (OOT_DEBUG && (kREG(1) == 12))) { + if ((csCurFrame > 964) || (DEBUG_FEATURES && (kREG(1) == 12))) { dustPos.x = pos->x + 460.0f; dustPos.y = pos->y + 60.0f; dustPos.z = pos->z + 760.0f; @@ -1045,7 +1045,7 @@ void func_8098078C(DemoGt* this, PlayState* play) { Vec3f velOffset = { 5.0f, -16.0f, -16.0f }; s32 pad1[3]; - if ((csCurFrame > 939) || (OOT_DEBUG && (kREG(1) == 14))) { + if ((csCurFrame > 939) || (DEBUG_FEATURES && (kREG(1) == 14))) { dustPos.x = pos->x + 360.0f; dustPos.y = pos->y + 70.0f; dustPos.z = pos->z - 640.0f; @@ -1059,7 +1059,7 @@ void func_8098085C(DemoGt* this, PlayState* play) { u16 csCurFrame = play->csCtx.curFrame; Vec3f* pos = &this->dyna.actor.world.pos; - if ((csCurFrame == 58) || (OOT_DEBUG && (kREG(1) == 1))) { + if ((csCurFrame == 58) || (DEBUG_FEATURES && (kREG(1) == 1))) { sp28.x = pos->x + 900.0f; sp28.y = pos->y - 50.0f; sp28.z = pos->z + 93.0f; @@ -1085,7 +1085,7 @@ void func_809809C0(DemoGt* this, PlayState* play2) { Vec3f sp54; s16 pad[3]; - if (((csCurFrame > 469) && (csCurFrame < 481)) || (OOT_DEBUG && (kREG(1) == 3))) { + if (((csCurFrame > 469) && (csCurFrame < 481)) || (DEBUG_FEATURES && (kREG(1) == 3))) { Vec3f sp40 = { 20.0f, 6.0f, 0.0f }; Vec3f sp34 = { 0.0f, 0.0f, 0.0f }; s16 pad2[3]; @@ -1105,7 +1105,7 @@ void func_80980AD4(DemoGt* this, PlayState* play) { Vec3f pos; u16 csCurFrame = play->csCtx.curFrame; - if ((csCurFrame == 477) || (OOT_DEBUG && (kREG(2) == 1))) { + if ((csCurFrame == 477) || (DEBUG_FEATURES && (kREG(2) == 1))) { pos.x = this->dyna.actor.world.pos.x + 790.0f; pos.y = this->dyna.actor.world.pos.y + 60.0f; pos.z = this->dyna.actor.world.pos.z + 23.0f; @@ -1120,7 +1120,7 @@ void func_80980B68(DemoGt* this, PlayState* play) { Vec3f pos; u16 csCurFrame = play->csCtx.curFrame; - if ((csCurFrame == 317) || (OOT_DEBUG && (kREG(3) == 1))) { + if ((csCurFrame == 317) || (DEBUG_FEATURES && (kREG(3) == 1))) { pos.x = this->dyna.actor.world.pos.x + 980.0f; pos.y = this->dyna.actor.world.pos.y + 410.0f; pos.z = this->dyna.actor.world.pos.z - 177.0f; @@ -1134,7 +1134,7 @@ void func_80980BFC(DemoGt* this, PlayState* play) { Vec3f pos; u16 csCurFrame = play->csCtx.curFrame; - if ((csCurFrame == 740) || (OOT_DEBUG && (kREG(4) == 1))) { + if ((csCurFrame == 740) || (DEBUG_FEATURES && (kREG(4) == 1))) { pos.x = this->dyna.actor.world.pos.x + 790.0f; pos.y = this->dyna.actor.world.pos.y + 60.0f; pos.z = this->dyna.actor.world.pos.z + 23.0f; @@ -1339,7 +1339,7 @@ void func_80981458(DemoGt* this, PlayState* play) { Vec3f dustPos; u16 csCurFrame = play->csCtx.curFrame; - if (((csCurFrame > 855) && (csCurFrame < 891)) || (OOT_DEBUG && (kREG(1) == 13))) { + if (((csCurFrame > 855) && (csCurFrame < 891)) || (DEBUG_FEATURES && (kREG(1) == 13))) { Vec3f velOffset = { 0.0f, -30.0f, 0.0f }; s32 pad1[3]; diff --git a/src/overlays/actors/ovl_Demo_Im/z_demo_im.c b/src/overlays/actors/ovl_Demo_Im/z_demo_im.c index 302bd6411e..ac9afd8d84 100644 --- a/src/overlays/actors/ovl_Demo_Im/z_demo_im.c +++ b/src/overlays/actors/ovl_Demo_Im/z_demo_im.c @@ -58,7 +58,7 @@ static void* sEyeTextures[] = { gImpaEyeClosedTex, }; -#if OOT_DEBUG +#if DEBUG_FEATURES static u32 D_8098783C = 0; #endif @@ -119,7 +119,7 @@ void func_80984BE0(DemoIm* this) { } } -#if OOT_DEBUG +#if DEBUG_FEATURES void func_80984C68(DemoIm* this) { this->action = 7; this->drawConfig = 0; @@ -500,7 +500,7 @@ void func_80985B34(DemoIm* this, PlayState* play) { void func_80985C10(DemoIm* this, PlayState* play) { func_80985948(this, play); -#if OOT_DEBUG +#if DEBUG_FEATURES func_80984C8C(this, play); #endif } @@ -510,7 +510,7 @@ void func_80985C40(DemoIm* this, PlayState* play) { DemoIm_UpdateSkelAnime(this); func_80984BE0(this); func_809859E0(this, play); -#if OOT_DEBUG +#if DEBUG_FEATURES func_80984C8C(this, play); #endif } @@ -520,7 +520,7 @@ void func_80985C94(DemoIm* this, PlayState* play) { DemoIm_UpdateSkelAnime(this); func_80984BE0(this); func_80985B34(this, play); -#if OOT_DEBUG +#if DEBUG_FEATURES func_80984C8C(this, play); #endif } @@ -935,7 +935,7 @@ void func_80986CFC(DemoIm* this, PlayState* play) { } void func_80986D40(DemoIm* this, PlayState* play) { -#if OOT_DEBUG +#if DEBUG_FEATURES if (gSaveContext.sceneLayer == 6) { this->action = 19; this->drawConfig = 1; diff --git a/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c b/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c index 478df2f3e5..63ab50cee7 100644 --- a/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c +++ b/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c @@ -69,7 +69,7 @@ static void* sMouthTextures[] = { gSariaMouthSmilingOpenTex, gSariaMouthFrowningTex, }; -#if OOT_DEBUG +#if DEBUG_FEATURES static u32 D_80990108 = 0; #endif @@ -128,7 +128,7 @@ void DemoSa_SetMouthIndex(DemoSa* this, s16 mouthIndex) { this->mouthIndex = mouthIndex; } -#if OOT_DEBUG +#if DEBUG_FEATURES void func_8098E530(DemoSa* this) { this->action = 7; this->drawConfig = 0; @@ -444,7 +444,7 @@ void func_8098F050(DemoSa* this, PlayState* play) { void func_8098F0E8(DemoSa* this, PlayState* play) { func_8098EEA8(this, play); -#if OOT_DEBUG +#if DEBUG_FEATURES func_8098E554(this, play); #endif } @@ -454,7 +454,7 @@ void func_8098F118(DemoSa* this, PlayState* play) { DemoSa_UpdateSkelAnime(this); func_8098E480(this); func_8098EEFC(this, play); -#if OOT_DEBUG +#if DEBUG_FEATURES func_8098E554(this, play); #endif } @@ -464,7 +464,7 @@ void func_8098F16C(DemoSa* this, PlayState* play) { DemoSa_UpdateSkelAnime(this); func_8098EDB0(this); func_8098F050(this, play); -#if OOT_DEBUG +#if DEBUG_FEATURES func_8098E554(this, play); #endif } diff --git a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c index 18175f1618..f0b2937df3 100644 --- a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c +++ b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c @@ -14,7 +14,7 @@ void ElfMsg_Init(Actor* thisx, PlayState* play); void ElfMsg_Destroy(Actor* thisx, PlayState* play); void ElfMsg_Update(Actor* thisx, PlayState* play); -#if OOT_DEBUG +#if DEBUG_ASSETS void ElfMsg_Draw(Actor* thisx, PlayState* play); #endif @@ -30,7 +30,7 @@ ActorProfile Elf_Msg_Profile = { /**/ ElfMsg_Init, /**/ ElfMsg_Destroy, /**/ ElfMsg_Update, -#if OOT_DEBUG +#if DEBUG_ASSETS /**/ ElfMsg_Draw, #else /**/ NULL, @@ -170,7 +170,7 @@ void ElfMsg_Update(Actor* thisx, PlayState* play) { } } -#if OOT_DEBUG +#if DEBUG_ASSETS #include "assets/overlays/ovl_Elf_Msg/ovl_Elf_Msg.c" void ElfMsg_Draw(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c index 58271dd259..769578d004 100644 --- a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c +++ b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c @@ -12,7 +12,7 @@ void ElfMsg2_Init(Actor* thisx, PlayState* play); void ElfMsg2_Destroy(Actor* thisx, PlayState* play); void ElfMsg2_Update(Actor* thisx, PlayState* play); -#if OOT_DEBUG +#if DEBUG_ASSETS void ElfMsg2_Draw(Actor* thisx, PlayState* play); #endif @@ -29,7 +29,7 @@ ActorProfile Elf_Msg2_Profile = { /**/ ElfMsg2_Init, /**/ ElfMsg2_Destroy, /**/ ElfMsg2_Update, -#if OOT_DEBUG +#if DEBUG_ASSETS /**/ ElfMsg2_Draw, #else /**/ NULL, @@ -153,7 +153,7 @@ void ElfMsg2_Update(Actor* thisx, PlayState* play) { } } -#if OOT_DEBUG +#if DEBUG_ASSETS #include "assets/overlays/ovl_Elf_Msg2/ovl_Elf_Msg2.c" void ElfMsg2_Draw(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.c b/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.c index ae88d59295..72ce0b646c 100644 --- a/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.c +++ b/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.c @@ -99,7 +99,7 @@ void EnAnubiceTag_Update(Actor* thisx, PlayState* play) { void EnAnubiceTag_Draw(Actor* thisx, PlayState* play) { EnAnubiceTag* this = (EnAnubiceTag*)thisx; - if (OOT_DEBUG && BREG(0) != 0) { + if (DEBUG_FEATURES && BREG(0) != 0) { DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 255, 0, 0, 255, 4, play->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_Changer/z_en_changer.c b/src/overlays/actors/ovl_En_Changer/z_en_changer.c index 9850651834..60594097ce 100644 --- a/src/overlays/actors/ovl_En_Changer/z_en_changer.c +++ b/src/overlays/actors/ovl_En_Changer/z_en_changer.c @@ -289,7 +289,7 @@ void EnChanger_Update(Actor* thisx, PlayState* play) { this->timer--; } - if (OOT_DEBUG && BREG(0) != 0) { + if (DEBUG_FEATURES && BREG(0) != 0) { DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 255, 0, 255, 255, 4, play->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_Dns/z_en_dns.c b/src/overlays/actors/ovl_En_Dns/z_en_dns.c index c4bf246d1f..5aa697f494 100644 --- a/src/overlays/actors/ovl_En_Dns/z_en_dns.c +++ b/src/overlays/actors/ovl_En_Dns/z_en_dns.c @@ -77,7 +77,7 @@ static u16 sStartingTextIds[] = { 0x10A0, 0x10A1, 0x10A2, 0x10CA, 0x10CB, 0x10CC, 0x10CD, 0x10CE, 0x10CF, 0x10DC, 0x10DD, }; -#if OOT_DEBUG +#if DEBUG_FEATURES static char* sItemDebugTxt[] = { "デクの実売り ", // "Deku Nuts" "デクの棒売り ", // "Deku Sticks" diff --git a/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c b/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c index 15ba4bb788..226a9e8d47 100644 --- a/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c +++ b/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c @@ -327,7 +327,7 @@ void EnDntDemo_Update(Actor* thisx, PlayState* play) { } this->actionFunc(this, play); - if (OOT_DEBUG && BREG(0) != 0) { + if (DEBUG_FEATURES && BREG(0) != 0) { if (this->debugArrowTimer != 0) { if (!(this->debugArrowTimer & 1)) { DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, diff --git a/src/overlays/actors/ovl_En_Eg/z_en_eg.c b/src/overlays/actors/ovl_En_Eg/z_en_eg.c index 4bfba816ab..733a9ccf83 100644 --- a/src/overlays/actors/ovl_En_Eg/z_en_eg.c +++ b/src/overlays/actors/ovl_En_Eg/z_en_eg.c @@ -49,7 +49,7 @@ void EnEg_Init(Actor* thisx, PlayState* play) { void func_809FFDC8(EnEg* this, PlayState* play) { if (!sVoided && (gSaveContext.subTimerSeconds <= 0) && Flags_GetSwitch(play, 0x36) && - (!OOT_DEBUG || kREG(0) == 0)) { + (!DEBUG_FEATURES || kREG(0) == 0)) { // Void the player out Play_TriggerRespawn(play); gSaveContext.respawnFlag = -2; diff --git a/src/overlays/actors/ovl_En_Elf/z_en_elf.c b/src/overlays/actors/ovl_En_Elf/z_en_elf.c index fb5760adb3..a83552b9bf 100644 --- a/src/overlays/actors/ovl_En_Elf/z_en_elf.c +++ b/src/overlays/actors/ovl_En_Elf/z_en_elf.c @@ -1379,7 +1379,7 @@ void func_80A053F0(Actor* thisx, PlayState* play) { if (player->naviTextId == 0) { if (player->focusActor == NULL) { -#if OOT_DEBUG +#if DEBUG_FEATURES if (((gSaveContext.save.info.playerData.naviTimer >= 600) && (gSaveContext.save.info.playerData.naviTimer <= 3000)) || (nREG(89) != 0)) @@ -1423,7 +1423,7 @@ void func_80A053F0(Actor* thisx, PlayState* play) { this->actionFunc(this, play); thisx->shape.rot.y = this->unk_2BC; -#if OOT_DEBUG +#if DEBUG_FEATURES // `gSaveContext.save.info.sceneFlags[127].chest` (like in the debug string) instead of `HIGH_SCORE(HS_HBA)` // matches too, but, with how the `SaveContext` struct is currently defined, it is an out-of-bounds read in the // `sceneFlags` array. It is theorized the original `room_inf` (currently `sceneFlags`) was an array of length diff --git a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c index 2854fd88dd..76546c3eb5 100644 --- a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c +++ b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c @@ -321,7 +321,7 @@ void EnEncount1_Update(Actor* thisx, PlayState* play) { this->updateFunc(this, play); - if (OOT_DEBUG && BREG(0) != 0) { + if (DEBUG_FEATURES && BREG(0) != 0) { if (this->outOfRangeTimer != 0) { if ((this->outOfRangeTimer & 1) == 0) { DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, diff --git a/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c b/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c index 255420e8e2..17011be7aa 100644 --- a/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c +++ b/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.c @@ -284,7 +284,7 @@ void FireRock_WaitSpawnRocksFromCeiling(EnFireRock* this, PlayState* play) { this->playerNearby = 0; } - if (OOT_DEBUG && BREG(0) != 0) { + if (DEBUG_FEATURES && BREG(0) != 0) { DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 0, 255, 0, 255, 4, play->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_Fr/z_en_fr.c b/src/overlays/actors/ovl_En_Fr/z_en_fr.c index 5a8dd2995a..d1bbe15141 100644 --- a/src/overlays/actors/ovl_En_Fr/z_en_fr.c +++ b/src/overlays/actors/ovl_En_Fr/z_en_fr.c @@ -1029,7 +1029,7 @@ void EnFr_SetIdle(EnFr* this, PlayState* play) { void EnFr_UpdateIdle(Actor* thisx, PlayState* play) { EnFr* this = (EnFr*)thisx; - if (OOT_DEBUG && BREG(0) != 0) { + if (DEBUG_FEATURES && BREG(0) != 0) { DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 255, 0, 0, 255, 4, play->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c b/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c index e1d6258611..cc15ac714b 100644 --- a/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c +++ b/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c @@ -448,7 +448,7 @@ void EnGSwitch_Update(Actor* thisx, PlayState* play) { } } - if (OOT_DEBUG && BREG(0) != 0 && (this->type == ENGSWITCH_SILVER_TRACKER)) { + if (DEBUG_FEATURES && BREG(0) != 0 && (this->type == ENGSWITCH_SILVER_TRACKER)) { DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 255, 0, 0, 255, 4, play->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_GirlA/z_en_girla.c b/src/overlays/actors/ovl_En_GirlA/z_en_girla.c index c02438a6e9..34bd2e0eb1 100644 --- a/src/overlays/actors/ovl_En_GirlA/z_en_girla.c +++ b/src/overlays/actors/ovl_En_GirlA/z_en_girla.c @@ -79,7 +79,7 @@ ActorProfile En_GirlA_Profile = { /**/ NULL, }; -#if OOT_DEBUG +#if DEBUG_FEATURES static char* sShopItemDescriptions[] = { "デクの実×5 ", // "Deku nut x5" "矢×30 ", // "Arrow x30" diff --git a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c index 209b0b7c4d..acf8a7b615 100644 --- a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c +++ b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c @@ -86,7 +86,7 @@ static CollisionCheckInfoInit sColChkInfoInit = { 0, 12, 60, MASS_HEAVY }; static f32 sSpeeds[] = { 10.0f, 9.2f }; -#if OOT_DEBUG +#if DEBUG_FEATURES #define EN_GOROIWA_SPEED(this) (R_EN_GOROIWA_SPEED * 0.01f) #else #define EN_GOROIWA_SPEED(this) sSpeeds[(this)->isInKokiri] @@ -135,12 +135,12 @@ s32 EnGoroiwa_Vec3fNormalize(Vec3f* ret, Vec3f* a) { void EnGoroiwa_SetSpeed(EnGoroiwa* this, PlayState* play) { if (play->sceneId == SCENE_KOKIRI_FOREST) { this->isInKokiri = true; -#if OOT_DEBUG +#if DEBUG_FEATURES R_EN_GOROIWA_SPEED = 920; #endif } else { this->isInKokiri = false; -#if OOT_DEBUG +#if DEBUG_FEATURES R_EN_GOROIWA_SPEED = 1000; #endif } @@ -252,7 +252,7 @@ s32 EnGoroiwa_GetAscendDirection(EnGoroiwa* this, PlayState* play) { Vec3s* currentPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->currentWaypoint; if (nextPointPos->x == currentPointPos->x && nextPointPos->z == currentPointPos->z) { -#if OOT_DEBUG +#if DEBUG_FEATURES if (nextPointPos->y == currentPointPos->y) { // "Error: Invalid path data (points overlap)" PRINTF("Error : レールデータ不正(点が重なっている)"); diff --git a/src/overlays/actors/ovl_En_Gs/z_en_gs.c b/src/overlays/actors/ovl_En_Gs/z_en_gs.c index c6c3aefd68..c1e9ed9d8d 100644 --- a/src/overlays/actors/ovl_En_Gs/z_en_gs.c +++ b/src/overlays/actors/ovl_En_Gs/z_en_gs.c @@ -139,12 +139,12 @@ s32 func_80A4E3EC(EnGs* this, PlayState* play) { void func_80A4E470(EnGs* this, PlayState* play) { Player* player = GET_PLAYER(play); -#if OOT_DEBUG +#if DEBUG_FEATURES bREG(15) = 0; #endif if (this->actor.xzDistToPlayer <= 100.0f) { -#if OOT_DEBUG +#if DEBUG_FEATURES bREG(15) = 1; #endif diff --git a/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c b/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c index 7b49afeee3..d4927a40db 100644 --- a/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c +++ b/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c @@ -182,7 +182,7 @@ void EnHeishi1_Walk(EnHeishi1* this, PlayState* play) { Math_ApproachF(&this->headAngle, this->headAngleTarget, this->headTurnSpeedScale, this->headTurnSpeedMax); - if (OOT_DEBUG && (this->path == BREG(1)) && (BREG(0) != 0)) { + if (DEBUG_FEATURES && (this->path == BREG(1)) && (BREG(0) != 0)) { PRINTF(VT_FGCOL(RED) " 種類 %d\n" VT_RST, this->path); PRINTF(VT_FGCOL(RED) " ぱす %d\n" VT_RST, this->waypoint); PRINTF(VT_FGCOL(RED) " 反転 %d\n" VT_RST, this->bodyTurnSpeed); @@ -300,7 +300,7 @@ void EnHeishi1_Wait(EnHeishi1* this, PlayState* play) { Math_ApproachF(&this->headAngle, this->headAngleTarget, this->headTurnSpeedScale, this->headTurnSpeedMax + this->headTurnSpeedMax); - if (OOT_DEBUG && (this->path == BREG(1)) && (BREG(0) != 0)) { + if (DEBUG_FEATURES && (this->path == BREG(1)) && (BREG(0) != 0)) { PRINTF(VT_FGCOL(GREEN) " 種類 %d\n" VT_RST, this->path); PRINTF(VT_FGCOL(GREEN) " ぱす %d\n" VT_RST, this->waypoint); PRINTF(VT_FGCOL(GREEN) " 反転 %d\n" VT_RST, this->bodyTurnSpeed); @@ -490,7 +490,7 @@ void EnHeishi1_Draw(Actor* thisx, PlayState* play) { this); func_80033C30(&this->actor.world.pos, &matrixScale, 0xFF, play); - if (OOT_DEBUG && (this->path == BREG(1)) && (BREG(0) != 0)) { + if (DEBUG_FEATURES && (this->path == BREG(1)) && (BREG(0) != 0)) { DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y + 100.0f, this->actor.world.pos.z, 17000, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 255, 0, 0, 255, 4, play->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.c b/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.c index ecd1ad5d3e..386b8c5e26 100644 --- a/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.c +++ b/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.c @@ -357,7 +357,7 @@ void EnIceHono_Update(Actor* thisx, PlayState* play) { sin154 = Math_SinS(this->unk_154); intensity = (Rand_ZeroOne() * 0.05f) + ((sin154 * 0.125f) + (sin156 * 0.1f)) + 0.425f; -#if OOT_DEBUG +#if DEBUG_FEATURES if ((intensity > 0.7f) || (intensity < 0.2f)) { PRINTF("ありえない値(ratio = %f)\n", intensity); // "impossible value(ratio = %f)" } diff --git a/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c b/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c index d169c933ed..f7ff903748 100644 --- a/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c +++ b/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c @@ -118,7 +118,7 @@ void func_80A90264(EnKakasi2* this, PlayState* play) { this->unk_194++; - if (OOT_DEBUG && (BREG(1) != 0) && (this->actor.xzDistToPlayer < this->maxSpawnDistance.x) && + if (DEBUG_FEATURES && (BREG(1) != 0) && (this->actor.xzDistToPlayer < this->maxSpawnDistance.x) && (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < this->maxSpawnDistance.y)) { this->actor.draw = func_80A90948; @@ -216,7 +216,7 @@ void EnKakasi2_Update(Actor* thisx, PlayState* play2) { CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); } - if (OOT_DEBUG && BREG(0) != 0) { + if (DEBUG_FEATURES && BREG(0) != 0) { if (BREG(5) != 0) { PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ this->actor.player_distance ☆☆☆☆☆ %f\n" VT_RST, this->actor.xzDistToPlayer); PRINTF(VT_FGCOL(YELLOW) "☆☆☆☆☆ this->hosei.x ☆☆☆☆☆ %f\n" VT_RST, this->maxSpawnDistance.x); diff --git a/src/overlays/actors/ovl_En_Nb/z_en_nb.c b/src/overlays/actors/ovl_En_Nb/z_en_nb.c index e1ef72e5f4..6c30a3ec0d 100644 --- a/src/overlays/actors/ovl_En_Nb/z_en_nb.c +++ b/src/overlays/actors/ovl_En_Nb/z_en_nb.c @@ -83,7 +83,7 @@ static void* sEyeTextures[] = { gNabooruEyeClosedTex, }; -#if OOT_DEBUG +#if DEBUG_FEATURES static s32 D_80AB4318 = 0; #endif @@ -194,7 +194,7 @@ void EnNb_UpdateEyes(EnNb* this) { } } -#if OOT_DEBUG +#if DEBUG_FEATURES void func_80AB11EC(EnNb* this) { this->action = NB_ACTION_7; this->drawMode = NB_DRAW_NOTHING; @@ -533,7 +533,7 @@ void EnNb_SetupLightOrb(EnNb* this, PlayState* play) { void EnNb_Hide(EnNb* this, PlayState* play) { EnNb_SetupHide(this, play); -#if OOT_DEBUG +#if DEBUG_FEATURES func_80AB1210(this, play); #endif } @@ -543,7 +543,7 @@ void EnNb_Fade(EnNb* this, PlayState* play) { EnNb_UpdateSkelAnime(this); EnNb_UpdateEyes(this); EnNb_CheckToFade(this, play); -#if OOT_DEBUG +#if DEBUG_FEATURES func_80AB1210(this, play); #endif } @@ -553,7 +553,7 @@ void EnNb_CreateLightOrb(EnNb* this, PlayState* play) { EnNb_UpdateSkelAnime(this); EnNb_UpdateEyes(this); EnNb_SetupLightOrb(this, play); -#if OOT_DEBUG +#if DEBUG_FEATURES func_80AB1210(this, play); #endif } diff --git a/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c b/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c index cf4411a1d5..89948d78c5 100644 --- a/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c +++ b/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c @@ -225,7 +225,7 @@ void func_80ABA244(EnNiwLady* this, PlayState* play) { } currentCucco = (EnNiw*)currentCucco->actor.next; } - if (OOT_DEBUG && BREG(7) != 0) { + if (DEBUG_FEATURES && BREG(7) != 0) { this->cuccosInPen = BREG(7) - 1; } phi_s1 = this->cuccosInPen; diff --git a/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c b/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c index 305740a431..f336eda447 100644 --- a/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c +++ b/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c @@ -124,7 +124,7 @@ void EnOkarinaEffect_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); - if (OOT_DEBUG && BREG(0) != 0) { + if (DEBUG_FEATURES && BREG(0) != 0) { DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 0xFF, 0, 0xFF, 0xFF, 4, play->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c b/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c index a959b46b4c..edd7cc8762 100644 --- a/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c +++ b/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c @@ -324,7 +324,7 @@ void EnOkarinaTag_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); - if (OOT_DEBUG && BREG(0) != 0) { + if (DEBUG_FEATURES && BREG(0) != 0) { if (this->unk_15A != 0) { if (!(this->unk_15A & 1)) { DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, diff --git a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c index e72837d85d..28713a4122 100644 --- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -153,7 +153,7 @@ static s16 sItemShelfRot[] = { 0xEAAC, 0xEAAC, 0xEAAC, 0xEAAC, 0x1554, 0x1554, 0 // unused values? static s16 D_80AC8904[] = { 0x001E, 0x001F, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025 }; -#if OOT_DEBUG +#if DEBUG_FEATURES static char* sShopkeeperPrintName[] = { "コキリの店 ", // "Kokiri Shop" "薬屋 ", // "Potion Shop" diff --git a/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c b/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c index 69f9bc1d7f..f36cfabbd2 100644 --- a/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c +++ b/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c @@ -695,7 +695,7 @@ void EnReeba_Draw(Actor* thisx, PlayState* play) { CLOSE_DISPS(play->state.gfxCtx, "../z_en_reeba.c", 1088); - if (OOT_DEBUG && BREG(0) != 0) { + if (DEBUG_FEATURES && BREG(0) != 0) { Vec3f debugPos; debugPos.x = (Math_SinS(this->actor.world.rot.y) * 30.0f) + this->actor.world.pos.x; diff --git a/src/overlays/actors/ovl_En_Rl/z_en_rl.c b/src/overlays/actors/ovl_En_Rl/z_en_rl.c index ad648f5eb1..8271dc4a6c 100644 --- a/src/overlays/actors/ovl_En_Rl/z_en_rl.c +++ b/src/overlays/actors/ovl_En_Rl/z_en_rl.c @@ -50,7 +50,7 @@ void func_80AE72D0(EnRl* this) { } } -#if OOT_DEBUG +#if DEBUG_FEATURES void func_80AE7358(EnRl* this) { Animation_Change(&this->skelAnime, &object_rl_Anim_000A3C, 1.0f, 0.0f, Animation_GetLastFrame(&object_rl_Anim_000A3C), ANIMMODE_LOOP, 0.0f); @@ -272,7 +272,7 @@ void func_80AE7BF8(EnRl* this, s32 arg1) { void func_80AE7C64(EnRl* this, PlayState* play) { func_80AE7954(this, play); -#if OOT_DEBUG +#if DEBUG_FEATURES func_80AE73D8(this, play); #endif } @@ -282,7 +282,7 @@ void func_80AE7C94(EnRl* this, PlayState* play) { func_80AE7494(this); func_80AE72D0(this); func_80AE79A4(this, play); -#if OOT_DEBUG +#if DEBUG_FEATURES func_80AE73D8(this, play); #endif } @@ -294,7 +294,7 @@ void func_80AE7CE8(EnRl* this, PlayState* play) { temp = func_80AE7494(this); func_80AE72D0(this); func_80AE7BF8(this, temp); -#if OOT_DEBUG +#if DEBUG_FEATURES func_80AE73D8(this, play); #endif } @@ -304,7 +304,7 @@ void func_80AE7D40(EnRl* this, PlayState* play) { func_80AE7494(this); func_80AE72D0(this); func_80AE7AF8(this, play); -#if OOT_DEBUG +#if DEBUG_FEATURES func_80AE73D8(this, play); #endif } diff --git a/src/overlays/actors/ovl_En_Rr/z_en_rr.c b/src/overlays/actors/ovl_En_Rr/z_en_rr.c index ac1f25b8b6..11918fd361 100644 --- a/src/overlays/actors/ovl_En_Rr/z_en_rr.c +++ b/src/overlays/actors/ovl_En_Rr/z_en_rr.c @@ -77,7 +77,7 @@ ActorProfile En_Rr_Profile = { /**/ EnRr_Draw, }; -#if OOT_DEBUG +#if DEBUG_FEATURES static char* sDropNames[] = { // "type 7", "small magic jar", "arrow", "fairy", "20 rupees", "50 rupees" "タイプ7 ", "魔法の壷小", "矢 ", "妖精 ", "20ルピー ", "50ルピー ", diff --git a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c index 79687c6dfd..2ea4e87dd3 100644 --- a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c +++ b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c @@ -341,7 +341,7 @@ s32 func_80AEB1B4(PlayState* play) { return Message_GetState(&play->msgCtx) == TEXT_STATE_CLOSING; } -#if OOT_DEBUG +#if DEBUG_FEATURES void func_80AEB1D8(EnRu1* this) { this->action = 36; this->drawConfig = 0; @@ -2023,7 +2023,7 @@ void func_80AEF890(EnRu1* this, PlayState* play) { s32 pad[2]; s8 curRoomNum; - if (!(OOT_DEBUG && IS_CUTSCENE_LAYER) && EnRu1_IsCsStateIdle(play)) { + if (!(DEBUG_FEATURES && IS_CUTSCENE_LAYER) && EnRu1_IsCsStateIdle(play)) { curRoomNum = play->roomCtx.curRoom.num; SET_INFTABLE(INFTABLE_145); Flags_SetSwitch(play, func_80AEADE0(this)); @@ -2060,7 +2060,7 @@ void func_80AEF9D8(EnRu1* this, PlayState* play) { EnRu1_UpdateSkelAnime(this); EnRu1_UpdateEyes(this); func_80AEF624(this, play); -#if OOT_DEBUG +#if DEBUG_FEATURES func_80AEB220(this, play); #endif } @@ -2076,7 +2076,7 @@ void func_80AEFA2C(EnRu1* this, PlayState* play) { func_80AEF5B8(this); func_80AEF40C(this); func_80AEF728(this, something); -#if OOT_DEBUG +#if DEBUG_FEATURES func_80AEB220(this, play); #endif } @@ -2086,7 +2086,7 @@ void func_80AEFAAC(EnRu1* this, PlayState* play) { func_80AEAECC(this, play); EnRu1_UpdateSkelAnime(this); func_80AEF79C(this, play); -#if OOT_DEBUG +#if DEBUG_FEATURES func_80AEB220(this, play); #endif } @@ -2099,7 +2099,7 @@ void func_80AEFB04(EnRu1* this, PlayState* play) { something = EnRu1_UpdateSkelAnime(this); EnRu1_UpdateEyes(this); func_80AEF820(this, something); -#if OOT_DEBUG +#if DEBUG_FEATURES func_80AEB220(this, play); #endif } @@ -2110,7 +2110,7 @@ void func_80AEFB68(EnRu1* this, PlayState* play) { EnRu1_UpdateSkelAnime(this); EnRu1_UpdateEyes(this); func_80AEF890(this, play); -#if OOT_DEBUG +#if DEBUG_FEATURES func_80AEB220(this, play); #endif } @@ -2235,7 +2235,7 @@ void func_80AEFF94(EnRu1* this, PlayState* play) { } } -#if OOT_DEBUG +#if DEBUG_FEATURES void func_80AF0050(EnRu1* this, PlayState* play) { func_80AEB264(this, &gRutoChildWait2Anim, 0, 0, 0); this->action = 36; @@ -2286,7 +2286,7 @@ void EnRu1_Init(Actor* thisx, PlayState* play) { case 6: func_80AEFF94(this, play); break; -#if OOT_DEBUG +#if DEBUG_FEATURES case 10: func_80AF0050(this, play); break; diff --git a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c index 733aefd47d..4e15ee767a 100644 --- a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c +++ b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c @@ -61,7 +61,7 @@ static void* sEyeTextures[] = { gAdultRutoEyeClosedTex, }; -#if OOT_DEBUG +#if DEBUG_FEATURES static UNK_TYPE D_80AF4118 = 0; #endif @@ -138,7 +138,7 @@ s32 func_80AF26A0(EnRu2* this) { return params; } -#if OOT_DEBUG +#if DEBUG_FEATURES void func_80AF26AC(EnRu2* this) { this->action = 7; this->drawConfig = 0; @@ -453,7 +453,7 @@ void func_80AF30AC(EnRu2* this, PlayState* play) { void func_80AF3144(EnRu2* this, PlayState* play) { func_80AF2F04(this, play); -#if OOT_DEBUG +#if DEBUG_FEATURES func_80AF26D0(this, play); #endif } @@ -463,7 +463,7 @@ void func_80AF3174(EnRu2* this, PlayState* play) { EnRu2_UpdateSkelAnime(this); func_80AF2608(this); func_80AF2F58(this, play); -#if OOT_DEBUG +#if DEBUG_FEATURES func_80AF26D0(this, play); #endif } @@ -473,7 +473,7 @@ void func_80AF31C8(EnRu2* this, PlayState* play) { EnRu2_UpdateSkelAnime(this); func_80AF2608(this); func_80AF30AC(this, play); -#if OOT_DEBUG +#if DEBUG_FEATURES func_80AF26D0(this, play); #endif } diff --git a/src/overlays/actors/ovl_En_Skj/z_en_skj.c b/src/overlays/actors/ovl_En_Skj/z_en_skj.c index 040490ed51..84d29be6a7 100644 --- a/src/overlays/actors/ovl_En_Skj/z_en_skj.c +++ b/src/overlays/actors/ovl_En_Skj/z_en_skj.c @@ -444,7 +444,7 @@ void EnSkj_Init(Actor* thisx, PlayState* play2) { this->actor.gravity = -1.0f; EnSkj_CalculateCenter(this); -#if OOT_DEBUG +#if DEBUG_FEATURES { Player* player = GET_PLAYER(play); @@ -1349,7 +1349,7 @@ void EnSkj_SariasSongShortStumpUpdate(Actor* thisx, PlayState* play) { D_80B01EA0 = Actor_TalkOfferAccepted(&this->actor, play); - if (OOT_DEBUG && BREG(0) != 0) { + if (DEBUG_FEATURES && BREG(0) != 0) { DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 255, 0, 0, 255, 4, play->state.gfxCtx); @@ -1591,7 +1591,7 @@ void EnSkj_OcarinaMinigameShortStumpUpdate(Actor* thisx, PlayState* play) { this->actor.focus.pos.y = -90.0f; this->actor.focus.pos.z = 450.0f; -#if OOT_DEBUG +#if DEBUG_FEATURES if (BREG(0) != 0) { DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, diff --git a/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c b/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c index 341f15e13d..832a1f1baf 100644 --- a/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c +++ b/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c @@ -343,7 +343,7 @@ void EnSyatekiItm_Update(Actor* thisx, PlayState* play) { this->unkTimer--; } - if (OOT_DEBUG && BREG(0) != 0) { + if (DEBUG_FEATURES && BREG(0) != 0) { DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 255, 0, 0, 255, 4, play->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c b/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c index 4db0f056c9..e768c2cc14 100644 --- a/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c +++ b/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c @@ -40,7 +40,7 @@ void EnSyatekiMan_RestartGame(EnSyatekiMan* this, PlayState* play); void EnSyatekiMan_BlinkWait(EnSyatekiMan* this); void EnSyatekiMan_Blink(EnSyatekiMan* this); -#if OOT_DEBUG +#if DEBUG_FEATURES void EnSyatekiMan_SetBgm(void); #endif @@ -56,7 +56,7 @@ ActorProfile En_Syateki_Man_Profile = { /**/ EnSyatekiMan_Draw, }; -#if OOT_DEBUG +#if DEBUG_FEATURES static u16 sBgmList[] = { NA_BGM_GENERAL_SFX, NA_BGM_NATURE_AMBIENCE, @@ -473,7 +473,7 @@ void EnSyatekiMan_Update(Actor* thisx, PlayState* play) { } this->actionFunc(this, play); -#if OOT_DEBUG +#if DEBUG_FEATURES EnSyatekiMan_SetBgm(); #endif @@ -511,7 +511,7 @@ void EnSyatekiMan_Draw(Actor* thisx, PlayState* play) { EnSyatekiMan_OverrideLimbDraw, NULL, this); } -#if OOT_DEBUG +#if DEBUG_FEATURES void EnSyatekiMan_SetBgm(void) { if (BREG(80)) { BREG(80) = false; diff --git a/src/overlays/actors/ovl_En_Tana/z_en_tana.c b/src/overlays/actors/ovl_En_Tana/z_en_tana.c index 1c3e4b2ab7..866329c2ab 100644 --- a/src/overlays/actors/ovl_En_Tana/z_en_tana.c +++ b/src/overlays/actors/ovl_En_Tana/z_en_tana.c @@ -27,7 +27,7 @@ ActorProfile En_Tana_Profile = { /**/ NULL, }; -#if OOT_DEBUG +#if DEBUG_FEATURES //! @bug A third entry is missing here. When printing the string indexed by `params` for type 2, the //! next data entry will be dereferenced and print garbage, stopping any future printing. //! In a non-matching context, this can cause a crash if the next item isn't a valid pointer. diff --git a/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.c b/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.c index c20a257544..0513d161cc 100644 --- a/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.c +++ b/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.c @@ -147,7 +147,7 @@ void EnWallTubo_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); - if (OOT_DEBUG && BREG(0) != 0) { + if (DEBUG_FEATURES && BREG(0) != 0) { DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 0, 0, 255, 255, 4, play->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c index 5e9e95ad3d..6e0d3b8e77 100644 --- a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c +++ b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c @@ -333,7 +333,7 @@ void EnWeatherTag_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); - if (OOT_DEBUG && BREG(0) != 0) { + if (DEBUG_FEATURES && BREG(0) != 0) { DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 255, 0, 255, 255, 4, play->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c b/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c index 3b5f2384ef..b60361d810 100644 --- a/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c +++ b/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c @@ -229,7 +229,7 @@ void EnWonderItem_MultitagFree(EnWonderItem* this, PlayState* play) { return; } -#if OOT_DEBUG +#if DEBUG_FEATURES if (BREG(0) != 0) { DebugDisplay_AddObject(sTagPointsFree[i].x, sTagPointsFree[i].y, sTagPointsFree[i].z, this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, @@ -306,7 +306,7 @@ void EnWonderItem_MultitagOrdered(EnWonderItem* this, PlayState* play) { } } -#if OOT_DEBUG +#if DEBUG_FEATURES if (BREG(0) != 0) { DebugDisplay_AddObject(sTagPointsOrdered[i].x, sTagPointsOrdered[i].y, sTagPointsOrdered[i].z, this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, @@ -375,7 +375,7 @@ void EnWonderItem_Update(Actor* thisx, PlayState* play) { colorIndex = 0; } - if (OOT_DEBUG && BREG(0) != 0) { + if (DEBUG_FEATURES && BREG(0) != 0) { DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, debugArrowColors[colorIndex], debugArrowColors[colorIndex + 1], diff --git a/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c b/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c index 769947d5b5..ba76e3877b 100644 --- a/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c +++ b/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c @@ -239,7 +239,7 @@ void EnWonderTalk_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); Actor_SetFocus(&this->actor, this->height); - if (OOT_DEBUG && BREG(0) != 0) { + if (DEBUG_FEATURES && BREG(0) != 0) { if (this->unk_15A != 0) { if ((this->unk_15A & 1) == 0) { DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, diff --git a/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c b/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c index f3cde9606f..5b31e6836d 100644 --- a/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c +++ b/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c @@ -131,7 +131,7 @@ void func_80B3A15C(EnWonderTalk2* this, PlayState* play) { if (!((this->actor.xzDistToPlayer > 40.0f + this->triggerRange) || (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) > 100.0f) || (yawDiff >= 0x4000))) { - if (OOT_DEBUG && this->unk_158 >= 2) { + if (DEBUG_FEATURES && this->unk_158 >= 2) { PRINTF("\n\n"); // "Transparent Message Kimi Set" PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 透明メッセージ君せっと %x\n" VT_RST, this->actor.params); @@ -220,7 +220,7 @@ void func_80B3A4F8(EnWonderTalk2* this, PlayState* play) { (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < 100.0f)) && !Play_InCsMode(play)) { - if (OOT_DEBUG && this->unk_158 >= 2) { + if (DEBUG_FEATURES && this->unk_158 >= 2) { PRINTF("\n\n"); // "Transparent Message Kimi Seto" PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 透明メッセージ君せっと %x\n" VT_RST, this->actor.params); @@ -278,7 +278,7 @@ void EnWonderTalk2_Update(Actor* thisx, PlayState* play) { Actor_SetFocus(&this->actor, this->height); - if (OOT_DEBUG && BREG(0) != 0) { + if (DEBUG_FEATURES && BREG(0) != 0) { if (this->unk_158 != 0) { if ((this->unk_158 & 1) == 0) { DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, diff --git a/src/overlays/actors/ovl_En_Xc/z_en_xc.c b/src/overlays/actors/ovl_En_Xc/z_en_xc.c index 14b68c5b0c..ccf9bf873f 100644 --- a/src/overlays/actors/ovl_En_Xc/z_en_xc.c +++ b/src/overlays/actors/ovl_En_Xc/z_en_xc.c @@ -229,7 +229,7 @@ void func_80B3C7D4(EnXc* this, s32 action1, s32 action2, s32 action3) { } } -#if OOT_DEBUG +#if DEBUG_FEATURES s32 EnXc_NoCutscenePlaying(PlayState* play) { if (play->csCtx.state == CS_STATE_IDLE) { return true; @@ -352,8 +352,8 @@ s32 EnXc_BoleroCS(EnXc* this, PlayState* play) { } void EnXc_SetupSerenadeAction(EnXc* this, PlayState* play) { - if (!(CHECK_OWNED_EQUIP(EQUIP_TYPE_BOOTS, EQUIP_INV_BOOTS_IRON) && OOT_DEBUG) && !GET_EVENTCHKINF(EVENTCHKINF_52) && - LINK_IS_ADULT) { + if (!(CHECK_OWNED_EQUIP(EQUIP_TYPE_BOOTS, EQUIP_INV_BOOTS_IRON) && DEBUG_FEATURES) && + !GET_EVENTCHKINF(EVENTCHKINF_52) && LINK_IS_ADULT) { s32 pad; this->action = SHEIK_ACTION_SERENADE; @@ -488,7 +488,7 @@ void EnXc_SetColossusWindSFX(PlayState* play) { if (D_80B41D90 != 0) { f32 speed = Math3D_Vec3f_DistXYZ(&D_80B42DB0, eye) / 7.058922f; -#if OOT_DEBUG +#if DEBUG_FEATURES static f32 sMaxSpeed = 0.0f; sMaxSpeed = CLAMP_MIN(sMaxSpeed, speed); @@ -1694,7 +1694,7 @@ void EnXc_ActionFunc54(EnXc* this, PlayState* play) { EnXc_BgCheck(this, play); EnXc_SetEyePattern(this); EnXc_SetupShowTriforceAction(this, play); -#if OOT_DEBUG +#if DEBUG_FEATURES func_80B3C888(this, play); #endif } @@ -1707,7 +1707,7 @@ void EnXc_ShowTriforce(EnXc* this, PlayState* play) { EnXc_CalcTriforce(&this->actor, play); func_80B3FAE0(this); EnXc_SetupShowTriforceIdleAction(this, animFinished); -#if OOT_DEBUG +#if DEBUG_FEATURES func_80B3C888(this, play); #endif } @@ -1849,7 +1849,7 @@ void EnXc_SetupContortions(EnXc* this, PlayState* play) { s32 pad[2]; SkelAnime* skelAnime = &this->skelAnime; -#if OOT_DEBUG +#if DEBUG_FEATURES Animation_Change(skelAnime, &gSheikIdleAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gSheikIdleAnim), ANIMMODE_LOOP, 0.0f); #endif @@ -2375,7 +2375,7 @@ void EnXc_Init(Actor* thisx, PlayState* play) { case SHEIK_TYPE_9: EnXc_InitTempleOfTime(this, play); break; -#if OOT_DEBUG +#if DEBUG_FEATURES case SHEIK_TYPE_0: EnXc_DoNothing(this, play); break; diff --git a/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c b/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c index 83a24f5f2b..a2b2e50fcf 100644 --- a/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c +++ b/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c @@ -215,7 +215,7 @@ void EnYabusameMark_Update(Actor* thisx, PlayState* play) { Collider_SetQuadVertices(&this->collider, &this->vertexA, &this->vertexB, &this->vertexC, &this->vertexD); CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); - if (OOT_DEBUG && BREG(0) != 0) { + if (DEBUG_FEATURES && BREG(0) != 0) { DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, 1.0f, 1.0f, 0, 0xFF, 0, 0xFF, 4, play->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c b/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c index 670568d122..7279c01f4c 100644 --- a/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c +++ b/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c @@ -1581,7 +1581,7 @@ void func_80B52114(EnZl2* this, PlayState* play) { case 4: func_80B51D0C(this, play); break; -#if OOT_DEBUG +#if DEBUG_FEATURES case 0: func_80B4FD90(this, play); break; @@ -1598,7 +1598,7 @@ void func_80B521A0(EnZl2* this, PlayState* play) { s32 objectSlot = Object_GetSlot(objectCtx, OBJECT_ZL2_ANIME1); s32 pad2; -#if OOT_DEBUG +#if DEBUG_FEATURES if (objectSlot < 0) { PRINTF(VT_FGCOL(RED) "En_Zl2_main_bankアニメーションのバンクを読めない!!!!!!!!!!!!\n" VT_RST); return; diff --git a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c index 6766da26ad..5a2018aeb6 100644 --- a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c +++ b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c @@ -2646,7 +2646,7 @@ void func_80B59DB8(EnZl3* this, PlayState* play) { s32 objectSlot = Object_GetSlot(objectCtx, OBJECT_ZL2_ANIME2); s32 pad2; -#if OOT_DEBUG +#if DEBUG_FEATURES if (objectSlot < 0) { PRINTF(VT_FGCOL(RED) "En_Zl3_main_bankアニメーションのバンクを読めない!!!!!!!!!!!!\n" VT_RST); return; diff --git a/src/overlays/actors/ovl_Fishing/z_fishing.c b/src/overlays/actors/ovl_Fishing/z_fishing.c index 64d95171f4..1bdd209176 100644 --- a/src/overlays/actors/ovl_Fishing/z_fishing.c +++ b/src/overlays/actors/ovl_Fishing/z_fishing.c @@ -42,7 +42,7 @@ #define WATER_SURFACE_Y(play) play->colCtx.colHeader->waterBoxes->ySurface -#if OOT_DEBUG +#if DEBUG_FEATURES #define KREG_DEBUG(i) KREG(i) #else #define KREG_DEBUG(i) 0 @@ -864,7 +864,7 @@ void Fishing_Init(Actor* thisx, PlayState* play2) { Actor_ProcessInitChain(thisx, sInitChain); ActorShape_Init(&thisx->shape, 0.0f, NULL, 0.0f); -#if OOT_DEBUG +#if DEBUG_FEATURES if (KREG(5) != 0) { sLinkAge = LINK_AGE_CHILD; } else { @@ -949,14 +949,14 @@ void Fishing_Init(Actor* thisx, PlayState* play2) { sFishingFoggy = 0; } -#if OOT_DEBUG +#if DEBUG_FEATURES if (((sFishGameNumber & 7) == 6) || (KREG(3) != 0)) #else if ((sFishGameNumber & 7) == 6) #endif { sStormChanceTimer = 100; -#if OOT_DEBUG +#if DEBUG_FEATURES if (KREG(3) != 0) { KREG(3) = 0; HIGH_SCORE(HS_FISHING) &= ~(HS_FISH_PLAYED * 255); @@ -1015,7 +1015,7 @@ void Fishing_Init(Actor* thisx, PlayState* play2) { ENKANBAN_FISHING); Actor_Spawn(&play->actorCtx, play, ACTOR_FISHING, 0.0f, 0.0f, 0.0f, 0, 0, 0, 200); -#if OOT_DEBUG +#if DEBUG_FEATURES if ((KREG(1) == 1) || ((sFishGameNumber & 3) == 3)) #else if ((sFishGameNumber & 3) == 3) @@ -1069,7 +1069,7 @@ void Fishing_Init(Actor* thisx, PlayState* play2) { this->fishLength += Rand_ZeroFloat(7.99999f); } -#if OOT_DEBUG +#if DEBUG_FEATURES if (KREG(6) != 0) { this->fishLength = KREG(6) + 80.0f; } @@ -2239,7 +2239,7 @@ void Fishing_UpdateLure(Fishing* this, PlayState* play) { case 0: sSinkingLureSegmentIndex = 0; -#if OOT_DEBUG +#if DEBUG_FEATURES if (KREG(14) != 0) { KREG(14) = 0; sLureEquipped = FS_LURE_SINKING - sLureEquipped; @@ -3167,7 +3167,7 @@ void Fishing_UpdateFish(Actor* thisx, PlayState* play2) { } } -#if OOT_DEBUG +#if DEBUG_FEATURES if (KREG(15) != 0) { KREG(15) = 0; this->fishState = 7; @@ -3270,7 +3270,7 @@ void Fishing_UpdateFish(Actor* thisx, PlayState* play2) { this->fishState = 10; this->fishStateNext = 10; } else if ((KREG_DEBUG(2) != 0) || (((this->unk_1A4 & 0x7FF) == 0) && (this->unk_1A4 < 15000))) { -#if OOT_DEBUG +#if DEBUG_FEATURES KREG(2) = 0; #endif this->fishState = -2; @@ -3431,7 +3431,7 @@ void Fishing_UpdateFish(Actor* thisx, PlayState* play2) { chance *= 5.0f; } -#if OOT_DEBUG +#if DEBUG_FEATURES if (((this->timerArray[0] == 1) || (Rand_ZeroOne() < chance)) && ((Rand_ZeroOne() < (this->perception * multiplier)) || ((this->isLoach + 1) == KREG(69)))) #else @@ -5105,7 +5105,7 @@ void Fishing_HandleOwnerDialog(Fishing* this, PlayState* play) { break; case 22: -#if OOT_DEBUG +#if DEBUG_FEATURES if (play) {} #endif @@ -5169,7 +5169,7 @@ void Fishing_UpdateOwner(Actor* thisx, PlayState* play2) { Player* player = GET_PLAYER(play); Input* input = &play->state.input[0]; -#if OOT_DEBUG +#if DEBUG_FEATURES if (0) { // Strings existing only in rodata PRINTF(VT_FGCOL(GREEN)); @@ -5234,7 +5234,7 @@ void Fishing_UpdateOwner(Actor* thisx, PlayState* play2) { f32 dz = sOwnerHeadPos.z - sLurePos.z; if ((sqrtf(SQ(dx) + SQ(dy) + SQ(dz)) < 25.0f) || (KREG_DEBUG(77) > 0)) { -#if OOT_DEBUG +#if DEBUG_FEATURES KREG(77) = 0; #endif sOwnerHair = FS_OWNER_BALD; @@ -5250,7 +5250,7 @@ void Fishing_UpdateOwner(Actor* thisx, PlayState* play2) { HIGH_SCORE(HS_FISHING) &= ~HS_FISH_STOLE_HAT; } -#if OOT_DEBUG +#if DEBUG_FEATURES if (KREG(77) < 0) { KREG(77) = 0; sIsOwnersHatSunk = true; @@ -5299,7 +5299,7 @@ void Fishing_UpdateOwner(Actor* thisx, PlayState* play2) { SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 20); } -#if OOT_DEBUG +#if DEBUG_FEATURES if (KREG(0) != 0) { s32 pad[3]; @@ -5653,7 +5653,7 @@ void Fishing_UpdateOwner(Actor* thisx, PlayState* play2) { } } -#if OOT_DEBUG +#if DEBUG_FEATURES if (sREG(15) != 0) { if (sStormStrengthTarget != (sREG(15) - 1)) { if (sStormStrengthTarget == 0) { @@ -5775,7 +5775,7 @@ void Fishing_UpdateOwner(Actor* thisx, PlayState* play2) { gSaveContext.minigameScore = (SQ((f32)sFishLengthToWeigh) * 0.0036f) + 0.5f; #endif -#if OOT_DEBUG +#if DEBUG_FEATURES if (BREG(26) != 0) { BREG(26) = 0; Message_StartTextbox(play, 0x407B + BREG(27), NULL); diff --git a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c index a9cded5748..570c645a24 100644 --- a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c +++ b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c @@ -141,7 +141,7 @@ void ObjBean_InitDynaPoly(ObjBean* this, PlayState* play, CollisionHeader* colli CollisionHeader_GetVirtual(collision, &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) { s32 pad2; @@ -469,7 +469,7 @@ void ObjBean_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); if (LINK_AGE_IN_YEARS == YEARS_ADULT) { - if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)) || (OOT_DEBUG && mREG(1) == 1)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)) || (DEBUG_FEATURES && mREG(1) == 1)) { path = PARAMS_GET_U(this->dyna.actor.params, 8, 5); if (path == 0x1F) { PRINTF(VT_COL(RED, WHITE)); @@ -505,7 +505,7 @@ void ObjBean_Init(Actor* thisx, PlayState* play) { return; } } else if ((Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)) != 0) || - (OOT_DEBUG && mREG(1) == 1)) { + (DEBUG_FEATURES && mREG(1) == 1)) { ObjBean_SetupWaitForWater(this); } else { ObjBean_SetupWaitForBean(this); diff --git a/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c b/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c index 4377ac6e26..fac468a29c 100644 --- a/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c +++ b/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c @@ -51,7 +51,7 @@ void func_80B92B08(ObjElevator* this, PlayState* play, CollisionHeader* collisio CollisionHeader_GetVirtual(collision, &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) { s32 pad2; diff --git a/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c b/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c index 0ac3a36afd..75163663e9 100644 --- a/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c +++ b/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c @@ -60,7 +60,7 @@ void func_80B93B68(ObjHsblock* this, PlayState* play, CollisionHeader* collision CollisionHeader_GetVirtual(collision, &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) { s32 pad2; @@ -98,7 +98,7 @@ void ObjHsblock_Init(Actor* thisx, PlayState* play) { } } -#if OOT_DEBUG +#if DEBUG_FEATURES mREG(13) = 255; mREG(14) = 255; mREG(15) = 255; @@ -163,7 +163,7 @@ void ObjHsblock_Draw(Actor* thisx, PlayState* play) { if (play->sceneId == SCENE_FIRE_TEMPLE) { color = &sFireTempleColor; } else { -#if OOT_DEBUG +#if DEBUG_FEATURES defaultColor.r = mREG(13); defaultColor.g = mREG(14); defaultColor.b = mREG(15); diff --git a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c index 23d798d6fe..3c63e0af1f 100644 --- a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c +++ b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c @@ -69,7 +69,7 @@ void ObjLift_InitDynaPoly(ObjLift* this, PlayState* play, CollisionHeader* colli CollisionHeader_GetVirtual(collision, &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) { s32 pad2; diff --git a/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c b/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c index 635ca3c4a8..7b52356690 100644 --- a/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c +++ b/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c @@ -110,7 +110,7 @@ void ObjMure_Init(Actor* thisx, PlayState* play) { PRINTF("群れな敵 (arg_data 0x%04x)(chNum(%d) ptn(%d) svNum(%d) type(%d))\n", thisx->params, this->chNum, this->ptn, this->svNum, this->type); -#if OOT_DEBUG +#if DEBUG_FEATURES if (ObjMure_GetMaxChildSpawns(this) <= 0) { PRINTF("Warning : 個体数が設定されていません(%s %d)(arg_data 0x%04x)\n", "../z_obj_mure.c", 268, thisx->params); } @@ -128,7 +128,7 @@ s32 ObjMure_GetMaxChildSpawns(ObjMure* this) { } void ObjMure_GetSpawnPos(Vec3f* outPos, Vec3f* inPos, s32 ptn, s32 idx) { -#if OOT_DEBUG +#if DEBUG_FEATURES if (ptn >= 4) { PRINTF("おかしなの (%s %d)\n", "../z_obj_mure.c", 307); } @@ -145,7 +145,7 @@ void ObjMure_SpawnActors0(ObjMure* this, PlayState* play) { s32 maxChildren = ObjMure_GetMaxChildSpawns(this); for (i = 0; i < maxChildren; i++) { -#if OOT_DEBUG +#if DEBUG_FEATURES if (this->children[i] != NULL) { // "Error: I already have a child(%s %d)(arg_data 0x%04x)" PRINTF("Error : 既に子供がいる(%s %d)(arg_data 0x%04x)\n", "../z_obj_mure.c", 333, actor->params); @@ -190,7 +190,7 @@ void ObjMure_SpawnActors1(ObjMure* this, PlayState* play2) { s32 i; for (i = 0; i < maxChildren; i++) { -#if OOT_DEBUG +#if DEBUG_FEATURES if (this->children[i] != NULL) { PRINTF("Error : 既に子供がいる(%s %d)(arg_data 0x%04x)\n", "../z_obj_mure.c", 407, actor->params); } diff --git a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c index 381bd44e84..1a0abd417f 100644 --- a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c +++ b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c @@ -92,7 +92,7 @@ void ObjOshihiki_InitDynapoly(ObjOshihiki* this, PlayState* play, CollisionHeade CollisionHeader_GetVirtual(collision, &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) { s32 pad2; @@ -646,7 +646,7 @@ void ObjOshihiki_Draw(Actor* thisx, PlayState* play) { MATRIX_FINALIZE_AND_LOAD(POLY_OPA_DISP++, play->state.gfxCtx, "../z_obj_oshihiki.c", 1308); -#if OOT_DEBUG +#if DEBUG_FEATURES switch (play->sceneId) { case SCENE_DEKU_TREE: case SCENE_DODONGOS_CAVERN: diff --git a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c index 96244eca8a..998dd7d575 100644 --- a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c +++ b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c @@ -198,7 +198,7 @@ void ObjSwitch_InitDynaPoly(ObjSwitch* this, PlayState* play, CollisionHeader* c CollisionHeader_GetVirtual(collision, &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) { s32 pad2; diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index 03524e5a86..83e3a11332 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -7295,7 +7295,7 @@ void func_8083E4C4(PlayState* play, Player* this, GetItemEntry* giEntry) { Sfx_PlaySfxCentered((this->getItemId < 0) ? NA_SE_SY_GET_BOXITEM : NA_SE_SY_GET_ITEM); } -#if OOT_DEBUG +#if DEBUG_FEATURES #define DEBUG_iREG_67 iREG(67) #else #define DEBUG_iREG_67 0 @@ -7314,7 +7314,7 @@ s32 Player_ActionHandler_2(Player* this, PlayState* play) { if (this->getItemId < GI_MAX) { GetItemEntry* giEntry = &sGetItemTable[this->getItemId - 1]; -#if OOT_DEBUG +#if DEBUG_FEATURES if ((interactedActor != &this->actor) && !iREG(67)) { interactedActor->parent = &this->actor; } @@ -12042,7 +12042,7 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) { Collider_ResetQuadAT(play, &this->shieldQuad.base); } -#if OOT_DEBUG +#if DEBUG_FEATURES s32 Player_UpdateNoclip(Player* this, PlayState* play); #endif @@ -12052,7 +12052,7 @@ void Player_Update(Actor* thisx, PlayState* play) { s32 pad; Input input; -#if OOT_DEBUG +#if DEBUG_FEATURES if (!Player_UpdateNoclip(this, play)) { goto skip_update; } @@ -12651,7 +12651,7 @@ void Player_Action_8084B9E4(Player* this, PlayState* play) { if (LinkAnimation_OnFrame(&this->skelAnime, 11.0f)) { Player_PlayVoiceSfx(this, NA_SE_VO_LI_PUSH); } - if (!OOT_DEBUG) {} + if (!DEBUG_FEATURES) {} } else { Player_ProcessAnimSfxList(this, D_80854878); } @@ -14410,7 +14410,7 @@ void Player_Action_8084FBF4(Player* this, PlayState* play) { Actor_PlaySfx_Flagged2(&this->actor, NA_SE_VO_LI_TAKEN_AWAY - SFX_FLAG + this->ageProperties->unk_92); } -#if OOT_DEBUG +#if DEBUG_FEATURES /** * Updates the "Noclip" debug feature, which allows the player to fly around anywhere * in the world and clip through any collision. diff --git a/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c b/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c index 63088f5cf9..a839900ec9 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c +++ b/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c @@ -83,7 +83,7 @@ u32 EffectSsKakera_Init(PlayState* play, u32 index, EffectSs* this, void* initPa f32 func_809A9818(f32 arg0, f32 arg1) { f32 temp_f2; -#if OOT_DEBUG +#if DEBUG_FEATURES if (arg1 < 0.0f) { PRINTF("範囲がマイナス!!(randomD_sectionUniformity)\n"); } diff --git a/src/overlays/gamestates/ovl_file_choose/z_file_choose.c b/src/overlays/gamestates/ovl_file_choose/z_file_choose.c index 77d2bf3b20..3288f115c4 100644 --- a/src/overlays/gamestates/ovl_file_choose/z_file_choose.c +++ b/src/overlays/gamestates/ovl_file_choose/z_file_choose.c @@ -714,7 +714,7 @@ void FileSelect_PulsateCursor(GameState* thisx) { SramContext* sramCtx = &this->sramCtx; Input* debugInput = &this->state.input[2]; -#if OOT_DEBUG +#if OOT_PAL && DEBUG_FEATURES if (CHECK_BTN_ALL(debugInput->press.button, BTN_DLEFT)) { sramCtx->readBuff[SRAM_HEADER_LANGUAGE] = gSaveContext.language = LANGUAGE_ENG; *((u8*)0x80000002) = LANGUAGE_ENG; @@ -1849,7 +1849,7 @@ void FileSelect_FadeOut(GameState* thisx) { void FileSelect_LoadGame(GameState* thisx) { FileSelectState* this = (FileSelectState*)thisx; -#if OOT_DEBUG +#if DEBUG_FEATURES if (this->buttonIndex == FS_BTN_SELECT_FILE_1) { Audio_PlaySfxGeneral(NA_SE_SY_FSEL_DECIDE_L, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); diff --git a/src/overlays/gamestates/ovl_select/z_select.c b/src/overlays/gamestates/ovl_select/z_select.c index c6fa26352c..9506d81338 100644 --- a/src/overlays/gamestates/ovl_select/z_select.c +++ b/src/overlays/gamestates/ovl_select/z_select.c @@ -250,7 +250,7 @@ static SceneSelectEntry sScenes[] = { // Rupees & Cow Grotto { "114:" T(GFXP_HIRAGANA "カクシトビコミアナ 13", "Hidden Dive Hole 13"), MapSelect_LoadGame, ENTR_GROTTOS_13 }, { "115:" T(GFXP_KATAKANA "ハイラル デモ", "Hyrule Cutscenes"), MapSelect_LoadGame, ENTR_CUTSCENE_MAP_0 }, -#if OOT_DEBUG +#if DEBUG_FEATURES { "116:" T(GFXP_HIRAGANA "ベッシツ (タカラバコ" GFXP_KATAKANA "ワープ)", "Special Room (Treasure Chest Warp)"), MapSelect_LoadGame, ENTR_BESITU_0 }, { "117:" T(GFXP_HIRAGANA "ササ" GFXP_KATAKANA "テスト", "Sasaki Test"), MapSelect_LoadGame, ENTR_SASATEST_0 }, diff --git a/src/overlays/gamestates/ovl_title/z_title.c b/src/overlays/gamestates/ovl_title/z_title.c index 6814e24da8..992cb945bd 100644 --- a/src/overlays/gamestates/ovl_title/z_title.c +++ b/src/overlays/gamestates/ovl_title/z_title.c @@ -15,7 +15,7 @@ #include "assets/textures/nintendo_rogo_static/nintendo_rogo_static.h" -#if OOT_DEBUG +#if DEBUG_FEATURES void ConsoleLogo_PrintBuildInfo(Gfx** gfxP) { Gfx* gfx; GfxPrint* printer; @@ -156,7 +156,7 @@ void ConsoleLogo_Main(GameState* thisx) { ConsoleLogo_Calc(this); ConsoleLogo_Draw(this); -#if OOT_DEBUG +#if DEBUG_FEATURES if (gIsCtrlr2Valid) { Gfx* gfx = POLY_OPA_DISP; diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map.c index b873337030..651f4328b8 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map.c @@ -640,7 +640,7 @@ void KaleidoScope_DrawWorldMap(PlayState* play, GraphicsContext* gfxCtx) { } #endif -#if OOT_DEBUG +#if DEBUG_FEATURES if (HREG(15) == 0) { gDPSetTextureFilter(POLY_OPA_DISP++, G_TF_POINT); diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c index 272ba33db4..71b32c4434 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c @@ -1074,7 +1074,7 @@ void KaleidoScope_SetupPageSwitch(PauseContext* pauseCtx, u8 pt) { void KaleidoScope_HandlePageToggles(PauseContext* pauseCtx, Input* input) { if ((pauseCtx->debugState == 0) && CHECK_BTN_ALL(input->press.button, BTN_L)) { -#if OOT_DEBUG +#if DEBUG_FEATURES pauseCtx->debugState = 1; #endif return; @@ -1874,7 +1874,7 @@ void KaleidoScope_DrawInfoPanel(PlayState* play) { ITEM_NAME_TEX_HEIGHT, 0); } -#if OOT_DEBUG +#if DEBUG_FEATURES if (pauseCtx->pageIndex == PAUSE_MAP) { if (YREG(7) != 0) { PRINTF(VT_FGCOL(YELLOW)); diff --git a/src/overlays/misc/ovl_kaleido_scope/z_lmap_mark.c b/src/overlays/misc/ovl_kaleido_scope/z_lmap_mark.c index 3f079430f8..89283bfc16 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_lmap_mark.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_lmap_mark.c @@ -131,7 +131,7 @@ void PauseMapMark_DrawForDungeon(PlayState* play) { Matrix_Push(); -#if OOT_DEBUG +#if DEBUG_FEATURES Matrix_Translate(markPoint->x + GREG(92), markPoint->y + GREG(93), 0.0f, MTXMODE_APPLY); #else Matrix_Translate(markPoint->x, markPoint->y, 0.0f, MTXMODE_APPLY);