Skip to content

Commit

Permalink
post decomp merge build fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Yanis002 committed Nov 29, 2024
1 parent 4e3ed27 commit aea3652
Show file tree
Hide file tree
Showing 35 changed files with 281 additions and 123 deletions.
214 changes: 167 additions & 47 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -1,37 +1,86 @@
{
"configurations": [
{
"name": "hackeroot-mq",
"compilerPath": "/usr/bin/gcc",
"name": "oot-ntsc-1.2",
"compilerArgs": [
"-m32"
],
"intelliSenseMode": "gcc-x86",
"includePath": [
"include",
"include/libc",
"src",
"build/hackeroot-mq",
"build/ntsc-1.2",
".",
"extracted/hackeroot-mq"
"extracted/ntsc-1.2"
],
"defines": [
"_LANGUAGE_C",
"OOT_VERSION=NTSC_1_2",
"OOT_REGION=REGION_JP",
"PLATFORM_N64=1",
"PLATFORM_GC=0",
"DEBUG_FEATURES=0",
"NDEBUG",
"F3DEX_GBI_2",
"ENABLE_HACKEROOT=1",
"RELEASE_ROM=0",
"COMPRESS_YAZ=1",
"OOT_VERSION=OOT_GC_EU_MQ_DBG",
"OOT_REGION=REGION_EU",
"OOT_PAL=1",
"OOT_MQ=1",
"OOT_DEBUG=1",
"COMPRESS_YAZ=1"
],
"cStandard": "gnu89"
},
{
"name": "oot-gc-jp",
"compilerArgs": [
"-m32"
],
"includePath": [
"include",
"include/libc",
"src",
"build/gc-jp",
".",
"extracted/gc-jp"
],
"defines": [
"_LANGUAGE_C",
"OOT_VERSION=GC_JP",
"OOT_REGION=REGION_JP",
"PLATFORM_N64=0",
"PLATFORM_GC=1",
"DEBUG_FEATURES=0",
"NDEBUG",
"F3DEX_GBI_2",
"F3DEX_GBI_PL",
"GBI_DOWHILE",
"GBI_DEBUG"
"GBI_DOWHILE"
],
"cStandard": "gnu89"
},
{
"name": "oot-gc-jp-mq",
"compilerArgs": [
"-m32"
],
"includePath": [
"include",
"include/libc",
"src",
"build/gc-jp-mq",
".",
"extracted/gc-jp-mq"
],
"cStandard": "gnu89",
"cppStandard": "${default}"
"defines": [
"_LANGUAGE_C",
"OOT_VERSION=GC_JP_MQ",
"OOT_REGION=REGION_JP",
"PLATFORM_N64=0",
"PLATFORM_GC=1",
"DEBUG_FEATURES=0",
"NDEBUG",
"F3DEX_GBI_2",
"F3DEX_GBI_PL",
"GBI_DOWHILE"
],
"cStandard": "gnu89"
},
{
"name": "oot-gc-us",
Expand All @@ -48,21 +97,72 @@
],
"defines": [
"_LANGUAGE_C",
"ENABLE_HACKEROOT=0",
"RELEASE_ROM=0",
"COMPRESS_YAZ=1",
"OOT_VERSION=OOT_GC_US",
"OOT_VERSION=GC_US",
"OOT_REGION=REGION_US",
"PLATFORM_N64=0",
"PLATFORM_GC=1",
"DEBUG_FEATURES=0",
"NDEBUG",
"F3DEX_GBI_2",
"F3DEX_GBI_PL",
"GBI_DOWHILE"
],
"cStandard": "gnu89"
},
{
"name": "oot-gc-us-mq",
"compilerArgs": [
"-m32"
],
"includePath": [
"include",
"include/libc",
"src",
"build/gc-us-mq",
".",
"extracted/gc-us-mq"
],
"defines": [
"_LANGUAGE_C",
"OOT_VERSION=GC_US_MQ",
"OOT_REGION=REGION_US",
"OOT_NTSC=1",
"OOT_MQ=0",
"OOT_DEBUG=0",
"PLATFORM_N64=0",
"PLATFORM_GC=1",
"DEBUG_FEATURES=0",
"NDEBUG",
"F3DEX_GBI_2",
"F3DEX_GBI_PL",
"GBI_DOWHILE"
],
"cStandard": "gnu89"
},
{
"name": "oot-gc-eu-mq-dbg",
"compilerArgs": [
"-m32"
],
"includePath": [
"include",
"include/libc",
"src",
"build/gc-eu-mq-dbg",
".",
"extracted/gc-eu-mq-dbg"
],
"defines": [
"_LANGUAGE_C",
"OOT_VERSION=GC_EU_MQ_DBG",
"OOT_REGION=REGION_EU",
"PLATFORM_N64=0",
"PLATFORM_GC=1",
"DEBUG_FEATURES=1",
"F3DEX_GBI_2",
"F3DEX_GBI_PL",
"GBI_DOWHILE",
"GBI_DEBUG"
],
"cStandard": "gnu89"
},
{
"name": "oot-gc-eu",
"compilerArgs": [
Expand All @@ -78,14 +178,11 @@
],
"defines": [
"_LANGUAGE_C",
"ENABLE_HACKEROOT=0",
"RELEASE_ROM=0",
"COMPRESS_YAZ=1",
"OOT_VERSION=OOT_GC_EU",
"OOT_VERSION=GC_EU",
"OOT_REGION=REGION_EU",
"OOT_PAL=1",
"OOT_MQ=0",
"OOT_DEBUG=0",
"PLATFORM_N64=0",
"PLATFORM_GC=1",
"DEBUG_FEATURES=0",
"NDEBUG",
"F3DEX_GBI_2",
"F3DEX_GBI_PL",
Expand All @@ -108,14 +205,11 @@
],
"defines": [
"_LANGUAGE_C",
"ENABLE_HACKEROOT=0",
"RELEASE_ROM=0",
"COMPRESS_YAZ=1",
"OOT_VERSION=OOT_GC_EU_MQ",
"OOT_VERSION=GC_EU_MQ",
"OOT_REGION=REGION_EU",
"OOT_PAL=1",
"OOT_MQ=1",
"OOT_DEBUG=0",
"PLATFORM_N64=0",
"PLATFORM_GC=1",
"DEBUG_FEATURES=0",
"NDEBUG",
"F3DEX_GBI_2",
"F3DEX_GBI_PL",
Expand All @@ -124,36 +218,62 @@
"cStandard": "gnu89"
},
{
"name": "oot-gc-eu-mq-dbg",
"name": "oot-gc-jp-ce",
"compilerArgs": [
"-m32"
],
"includePath": [
"include",
"include/libc",
"src",
"build/gc-eu-mq-dbg",
"build/gc-jp-ce",
".",
"extracted/gc-eu-mq-dbg"
"extracted/gc-jp-ce"
],
"defines": [
"_LANGUAGE_C",
"OOT_VERSION=GC_JP_CE",
"OOT_REGION=REGION_JP",
"PLATFORM_N64=0",
"PLATFORM_GC=1",
"DEBUG_FEATURES=0",
"NDEBUG",
"F3DEX_GBI_2",
"F3DEX_GBI_PL",
"GBI_DOWHILE"
],
"cStandard": "gnu89"
},
{
"name": "hackeroot",
"compilerArgs": [
"-m32"
],
"includePath": [
"include",
"include/libc",
"src",
"build/hackeroot-mq",
".",
"extracted/hackeroot-mq"
],
"defines": [
"_LANGUAGE_C",
"ENABLE_HACKEROOT=0",
"RELEASE_ROM=0",
"COMPRESS_YAZ=1",
"OOT_VERSION=OOT_GC_EU_MQ_DBG",
"OOT_REGION=REGION_EU",
"OOT_PAL=1",
"OOT_MQ=1",
"OOT_DEBUG=1",
"PLATFORM_N64=0",
"PLATFORM_GC=1",
"DEBUG_FEATURES=1",
"NDEBUG",
"F3DEX_GBI_2",
"F3DEX_GBI_PL",
"GBI_DOWHILE",
"GBI_DEBUG"
"ENABLE_HACKEROOT=1",
"RELEASE_ROM=0",
"COMPRESS_YAZ=1"
],
"cStandard": "gnu89"
}
],
"version": 4
}

6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,10 @@ ifeq ($(VERSION),hackeroot-mq)
OPTFLAGS := -Os

ifeq ($(RELEASE),1)
CPP_DEFINES += -DRELEASE_ROM=1 -DOOT_DEBUG=0
CFLAGS_IDO += -DOOT_DEBUG=0
CPP_DEFINES += -DRELEASE_ROM=1 -DDEBUG_FEATURES=0 -DNDEBUG
CFLAGS_IDO += -DDEBUG_FEATURES=0
else
CPP_DEFINES += -DRELEASE_ROM=0 -DOOT_DEBUG=1
CPP_DEFINES += -DRELEASE_ROM=0 -DDEBUG_FEATURES=1
endif
else
ifeq ($(DEBUG_FEATURES),1)
Expand Down
13 changes: 2 additions & 11 deletions include/config/config_safeguards.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
#define BOOT_TO_SCENE false
#define BOOT_TO_SCENE_NEW_GAME_ONLY false
#define BOOT_TO_FILE_SELECT false
#define DEBUG_FEATURES true
#define DEBUG_FEATURES false
#endif

#if DISABLE_DEBUG_FEATURES
#if !DEBUG_FEATURES
#undef SHOW_CS_INFOS
#undef SHOW_INPUT_DISPLAY
#undef SHOW_TIME_INFOS
Expand Down Expand Up @@ -200,15 +200,6 @@
#define ENABLE_MOTION_BLUR_DEBUG false
#endif

/**
* Used in if statements
*/
#if ENABLE_HACKEROOT
#define IS_DEBUG (OOT_DEBUG && !DISABLE_DEBUG_FEATURES)
#else
#define IS_DEBUG OOT_DEBUG
#endif

#if ENABLE_PROFILER && !ENABLE_HACKER_DEBUG
#error "ENABLE_PROFILER requires ENABLE_HACKER_DEBUG"
#endif
Expand Down
2 changes: 1 addition & 1 deletion include/functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ void DebugArena_Check(void);
void DebugArena_Init(void* start, u32 size);
void DebugArena_Cleanup(void);
s32 DebugArena_IsInitialized(void);
#if DEBUG_FEATURES
#if IS_DEBUG_HEAP_ENABLED
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);
Expand Down
2 changes: 1 addition & 1 deletion include/gfx.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ typedef struct GraphicsContext {
/* 0x02F4 */ f32 xScale;
/* 0x02F8 */ f32 yScale;
#endif
#if IS_DEBUG
#if DEBUG_FEATURES
/* 0x02FC */ Gfx* debugBuffer;
TwoHeadGfxArena debug;
#endif
Expand Down
4 changes: 2 additions & 2 deletions include/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
#define LOG_UTILS_CHECK_VALID_POINTER(exp, ptr, ...) (void)0
#define GAME_ALLOC_MALLOC(alloc, size, ...) GameAlloc_Malloc(alloc, size)

#endif /* IS_DEBUG */
#endif /* DEBUG_FEATURES */

#if PLATFORM_N64 || DEBUG_FEATURES
#define HUNGUP_AND_CRASH(...) Fault_AddHungupAndCrash(__FILE__, __LINE__)
Expand Down Expand Up @@ -169,7 +169,7 @@ _DW({ \

// HackerOoT

#if IS_DEBUG
#if DEBUG_FEATURES
// if using button combo check for the input, else simply return true
#define DEBUG_BTN_COMBO(useCombo, btnToHold, btnToPress, input) ((useCombo ? CHECK_BTN_ALL(input->cur.button, btnToHold) : true) && CHECK_BTN_ALL(input->press.button, btnToPress))
#else
Expand Down
Loading

0 comments on commit aea3652

Please sign in to comment.