1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-25 01:34:18 +00:00

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

* rename OOT_DEBUG to DEBUG_FEATURES

* makefile changes

* add DEBUG_ASSETS

* fix DEBUG_FEATURES usages

* format

* fix errors

* review

* fix problem and review2

* review

* add DEBUG_FEATURES to DEBUG_ASSETS check

* review

* whoops

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

View file

@ -49,6 +49,11 @@ N64_EMULATOR ?=
# Set to override game region in the ROM header (options: JP, US, EU). This can be used to build a fake US version
# 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

View file

@ -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"

View file

@ -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",

View file

@ -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",

View file

@ -15,17 +15,17 @@ void Yaz0_DecompressImpl(u8* src, u8* dst);
void Yaz0_Decompress(uintptr_t romStart, u8* dst, size_t size);
void 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);

View file

@ -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);

View file

@ -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);

View file

@ -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

View file

@ -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)

View file

@ -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)

View file

@ -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

View file

@ -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);

View file

@ -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

View file

@ -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)

View file

@ -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[];

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -34,7 +34,7 @@ extern size_t gDmaMgrDmaBuffSize;
s32 DmaMgr_RequestAsync(DmaRequest* req, void* ram, uintptr_t vrom, size_t size, u32 unk5, OSMesgQueue* queue,
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);

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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);

79
spec
View file

@ -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

View file

@ -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

View file

@ -133,7 +133,7 @@ f32 D_801305E4[4] = { 1.0f, 1.12246f, 1.33484f, 1.33484f }; // 2**({0, 2, 5, 5}/
f32 D_801305F4 = 1.0f;
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);

View file

@ -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);

View file

@ -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;

View file

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

View file

@ -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

View file

@ -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;

View file

@ -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;

View file

@ -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.
*

View file

@ -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)

View file

@ -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) {

View file

@ -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;
}

View file

@ -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);

View file

@ -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;

View file

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

View file

@ -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;

View file

@ -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

View file

@ -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));

View file

@ -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) {

View file

@ -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;

View file

@ -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;

View file

@ -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"),

View file

@ -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;

View file

@ -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
}

View file

@ -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

View file

@ -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
}
}

View file

@ -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`
*/

View file

@ -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;

View file

@ -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

View file

@ -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

View file

@ -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);
}

View file

@ -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 {

View file

@ -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,

View file

@ -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

View file

@ -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)) {

View file

@ -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];

View file

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

View file

@ -118,8 +118,8 @@ void MapMark_DrawForDungeon(PlayState* play) {
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
G_TX_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);

View file

@ -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;

View file

@ -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;

View file

@ -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];

View file

@ -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);
}

View file

@ -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);

View file

@ -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;

View file

@ -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++) {

View file

@ -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.
*/

View file

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

View file

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

View file

@ -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;
}

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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
}

View file

@ -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

View file

@ -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);
}

View file

@ -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;

View file

@ -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:

View file

@ -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);

View file

@ -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);

View file

@ -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");
}

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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);

View file

@ -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;

View file

@ -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));
// " : Mir Ray occurrence failure"

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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));

View file

@ -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;

View file

@ -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!"

View file

@ -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;

View file

@ -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;

View file

@ -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) ||

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