Replace debug libultra builds with their ido counterparts (#572)

* Replace debug libultra builds with their ido counterparts

This is necessary because GameCube controllers apparently rely on the IDO build, also the release build is IDO anyway

* Remove fallthrough warnings from usb/debug.c

* remove need for debug libultra with unf and use lib define in ld

Co-authored-by: thecozies <collinpferguson@gmail.com>
This commit is contained in:
Gregory Heskett
2023-01-26 10:03:07 -05:00
committed by GitHub
parent 7fdb5af8fd
commit 52a7aedaf4
6 changed files with 20 additions and 32 deletions

View File

@@ -213,7 +213,6 @@ endif
ifeq ($(UNF),1) ifeq ($(UNF),1)
DEFINES += UNF=1 DEFINES += UNF=1
SRC_DIRS += src/usb SRC_DIRS += src/usb
USE_DEBUG := 1
endif endif
# ISVPRINT - whether to fake IS-Viewer presence, # ISVPRINT - whether to fake IS-Viewer presence,
@@ -229,10 +228,13 @@ endif
ifeq ($(USE_DEBUG),1) ifeq ($(USE_DEBUG),1)
ULTRALIB := ultra_d ULTRALIB := ultra_d
DEFINES += DEBUG=1 DEFINES += DEBUG=1 OVERWRITE_OSPRINT=1
else ifeq ($(UNF),1)
ULTRALIB := ultra
DEFINES += _FINALROM=1 NDEBUG=1 OVERWRITE_OSPRINT=1
else else
ULTRALIB := ultra_rom ULTRALIB := ultra_rom
DEFINES += _FINALROM=1 NDEBUG=1 DEFINES += _FINALROM=1 NDEBUG=1 OVERWRITE_OSPRINT=0
endif endif
# HVQM - whether to use HVQM fmv library # HVQM - whether to use HVQM fmv library
@@ -841,7 +843,7 @@ $(BUILD_DIR)/rsp/%.bin $(BUILD_DIR)/rsp/%_data.bin: rsp/%.s
# Run linker script through the C preprocessor # Run linker script through the C preprocessor
$(BUILD_DIR)/$(LD_SCRIPT): $(LD_SCRIPT) $(BUILD_DIR)/goddard.txt $(BUILD_DIR)/$(LD_SCRIPT): $(LD_SCRIPT) $(BUILD_DIR)/goddard.txt
$(call print,Preprocessing linker script:,$<,$@) $(call print,Preprocessing linker script:,$<,$@)
$(V)$(CPP) $(CPPFLAGS) -DBUILD_DIR=$(BUILD_DIR) $(DEBUG_MAP_STACKTRACE_FLAG) -MMD -MP -MT $@ -MF $@.d -o $@ $< $(V)$(CPP) $(CPPFLAGS) -DBUILD_DIR=$(BUILD_DIR) -DULTRALIB=lib$(ULTRALIB) $(DEBUG_MAP_STACKTRACE_FLAG) -MMD -MP -MT $@ -MF $@.d -o $@ $<
# Link libgoddard # Link libgoddard
$(BUILD_DIR)/libgoddard.a: $(GODDARD_O_FILES) $(BUILD_DIR)/libgoddard.a: $(GODDARD_O_FILES)
@@ -856,7 +858,7 @@ $(BUILD_DIR)/libz.a: $(LIBZ_O_FILES)
# SS2: Goddard rules to get size # SS2: Goddard rules to get size
$(BUILD_DIR)/sm64_prelim.ld: sm64.ld $(O_FILES) $(YAY0_OBJ_FILES) $(SEG_FILES) $(BUILD_DIR)/libgoddard.a $(BUILD_DIR)/libz.a $(BUILD_DIR)/sm64_prelim.ld: sm64.ld $(O_FILES) $(YAY0_OBJ_FILES) $(SEG_FILES) $(BUILD_DIR)/libgoddard.a $(BUILD_DIR)/libz.a
$(call print,Preprocessing preliminary linker script:,$<,$@) $(call print,Preprocessing preliminary linker script:,$<,$@)
$(V)$(CPP) $(CPPFLAGS) -DPRELIMINARY=1 -DBUILD_DIR=$(BUILD_DIR) -MMD -MP -MT $@ -MF $@.d -o $@ $< $(V)$(CPP) $(CPPFLAGS) -DPRELIMINARY=1 -DBUILD_DIR=$(BUILD_DIR) -DULTRALIB=lib$(ULTRALIB) -MMD -MP -MT $@ -MF $@.d -o $@ $<
$(BUILD_DIR)/sm64_prelim.elf: $(BUILD_DIR)/sm64_prelim.ld $(BUILD_DIR)/sm64_prelim.elf: $(BUILD_DIR)/sm64_prelim.ld
@$(PRINT) "$(GREEN)Linking Preliminary ELF file: $(BLUE)$@ $(NO_COL)\n" @$(PRINT) "$(GREEN)Linking Preliminary ELF file: $(BLUE)$@ $(NO_COL)\n"

Binary file not shown.

Binary file not shown.

30
sm64.ld
View File

@@ -168,11 +168,7 @@ SECTIONS
#ifdef S2DEX_TEXT_ENGINE #ifdef S2DEX_TEXT_ENGINE
lib/libs2d_engine.a:*(.text*); lib/libs2d_engine.a:*(.text*);
#endif #endif
#if defined(ISVPRINT) || defined(UNF) */ULTRALIB.a:*.o(.text*);
*/libultra_d.a:*.o(.text*);
#else
*/libultra_rom.a:*.o(.text*);
#endif
*/libnustd.a:*.o(.text*); */libnustd.a:*.o(.text*);
*/libgcc.a:*.o(.text*); */libgcc.a:*.o(.text*);
*/librtc.a:*.o(.text*); */librtc.a:*.o(.text*);
@@ -194,11 +190,7 @@ SECTIONS
#ifdef S2DEX_TEXT_ENGINE #ifdef S2DEX_TEXT_ENGINE
lib/libs2d_engine.a:*(.*data*); lib/libs2d_engine.a:*(.*data*);
#endif #endif
#if defined(ISVPRINT) || defined(UNF) */ULTRALIB.a:*.o(.data*);
*/libultra_d.a:*.o(.data*);
#else
*/libultra_rom.a:*.o(.data*);
#endif
*/libhvqm2.a:*.o(.data*); */libhvqm2.a:*.o(.data*);
*/librtc.a:*.o(.data*); */librtc.a:*.o(.data*);
*/libz.a:*.o(.data*); */libz.a:*.o(.data*);
@@ -214,11 +206,7 @@ SECTIONS
#ifdef S2DEX_TEXT_ENGINE #ifdef S2DEX_TEXT_ENGINE
lib/libs2d_engine.a:*(.rodata*); lib/libs2d_engine.a:*(.rodata*);
#endif #endif
#if defined(ISVPRINT) || defined(UNF) */ULTRALIB.a:*.o(.rodata*);
*/libultra_d.a:*.o(.rodata*);
#else
*/libultra_rom.a:*.o(.rodata*);
#endif
*/libgcc.a:*.o(.rodata*); */libgcc.a:*.o(.rodata*);
*/librtc.a:*.o(.rodata*); */librtc.a:*.o(.rodata*);
*/libz.a:*.o(.rodata*); */libz.a:*.o(.rodata*);
@@ -235,15 +223,9 @@ SECTIONS
#ifdef S2DEX_TEXT_ENGINE #ifdef S2DEX_TEXT_ENGINE
lib/libs2d_engine.a:*(.*bss*); lib/libs2d_engine.a:*(.*bss*);
#endif #endif
#if defined(ISVPRINT) || defined(UNF) */ULTRALIB.a:*.o(COMMON);
*/libultra_d.a:*.o(COMMON); */ULTRALIB.a:*.o(.scommon);
*/libultra_d.a:*.o(.scommon); */ULTRALIB.a:*.o(.*bss*);
*/libultra_d.a:*.o(.*bss*);
#else
*/libultra_rom.a:*.o(COMMON);
*/libultra_rom.a:*.o(.scommon);
*/libultra_rom.a:*.o(.*bss*);
#endif
*/libhvqm2.a:*.o(.bss*); */libhvqm2.a:*.o(.bss*);
*/librtc.a:*.o(.bss*); */librtc.a:*.o(.bss*);
*/libz.a:*.o(.bss*); */libz.a:*.o(.bss*);

View File

@@ -660,10 +660,12 @@ https://github.com/buu342/N64-UNFLoader
dataleft = 0; dataleft = 0;
break; break;
} }
// fallthrough
case '@': case '@':
filestep++; filestep++;
if (filestep < 3) if (filestep < 3)
break; break;
// fallthrough
default: default:
// Decide what to do based on the file handle // Decide what to do based on the file handle
if (filestep == 0 && debug_command_incoming_start[tok] == -1) if (filestep == 0 && debug_command_incoming_start[tok] == -1)

View File

@@ -9,7 +9,7 @@
#define DEBUG_MODE 1 // Enable/Disable debug mode #define DEBUG_MODE 1 // Enable/Disable debug mode
#define DEBUG_INIT_MSG 1 // Print a message when debug mode has initialized #define DEBUG_INIT_MSG 1 // Print a message when debug mode has initialized
#define USE_FAULTTHREAD 1 // Create a fault detection thread (libultra only) #define USE_FAULTTHREAD 1 // Create a fault detection thread (libultra only)
#define OVERWRITE_OSPRINT 1 // Replaces osSyncPrintf calls with debug_printf (libultra only) // #define OVERWRITE_OSPRINT 1 // Replaces osSyncPrintf calls with debug_printf (defined in makefile - libultra_rom does not have osSyncPrintf)
#define MAX_COMMANDS 25 // The max amount of user defined commands possible #define MAX_COMMANDS 25 // The max amount of user defined commands possible
// Fault thread definitions (libultra only) // Fault thread definitions (libultra only)
@@ -46,7 +46,9 @@
==============================*/ ==============================*/
extern void debug_printf(const char* message, ...); extern void debug_printf(const char* message, ...);
#if OVERWRITE_OSPRINT == 0
#define osSyncPrintf debug_printf
#endif
/*============================== /*==============================
debug_dumpbinary debug_dumpbinary
@@ -153,4 +155,4 @@
#endif #endif
#endif #endif