Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
3e96730
add all remaining easy instructions
Jun 15, 2025
320237a
move branch and C1 instructions to top so that they get detected first
Jun 15, 2025
ce0da79
de-prioritize double bitmath because it seems to conflict with branches
Jun 15, 2025
7412862
fix emux print
Jun 16, 2025
12c3ada
deprioritize more double instructions
Jun 16, 2025
49586a9
Add REGIMM branches
Jun 16, 2025
ab2599b
Add n64sym from libdragon
Jun 16, 2025
e898278
turn magic numbers into defines for draw_glyph
Jun 17, 2025
a7648c8
Replace crash screen font; reorganize crash screen to use more of the…
Jun 17, 2025
c2d8188
move elements around; add some lowercase instructions
Jun 17, 2025
e706faa
COP1 disasm from libdragon
Jun 17, 2025
4aeca68
add jal address to disasm; off-by-one error in map parsing if the add…
Jun 17, 2025
28bc67d
give ra's funcname more space; actually draw rectangles on all pages
Jun 17, 2025
3f7858e
Add failsafe for instruction disasm
Jun 17, 2025
8ab428a
start on porting libdragon backtrace (does not work)
Jun 18, 2025
916f391
remove segmented addresses from sym file
Jun 18, 2025
8ebae9f
don't dox user in n64sym, actually get filenames
Jun 19, 2025
7c8f95b
remove unnecessary debug sections; pretty up page 0
Jun 19, 2025
ac51866
try the old heuristic
Jun 19, 2025
0aa4cc8
ok maybe i do need a new heuristic
Jun 19, 2025
c94386d
Add line support for all lines
Jun 19, 2025
23a009b
start moving files to src/debugger
Jun 20, 2025
af3a977
split out symtable and map_parser
Jun 20, 2025
1dbb958
diff and warning reduction; finally move crash_screen over
Jun 20, 2025
39142c3
--all-lines work
Jun 20, 2025
d221c98
properly guard --all-lines in the code itself
Jun 20, 2025
2f9e4a3
add text color; fix J disasm
Jun 20, 2025
3d576aa
fix the makefile switch; decontrast the line numbers in disasm
Jun 20, 2025
5b2d8cb
diff reductions
Jun 20, 2025
7b11772
make search_symbol return all info instead
Jun 20, 2025
b2ee294
add func names to starts in disasm; more robust make switches
Jun 21, 2025
17904c6
actually generate line tables when generating symbols; fix function n…
Jun 21, 2025
3a69ecc
I thought assertf was in the repo already :thinking:
Jun 21, 2025
b2d8658
Assert/f and aggress/f tested
Jun 21, 2025
856455a
new stack trace that verifies entries
Jun 23, 2025
d29ba9f
label the end of stack; add syscall
Jun 23, 2025
915ad43
fix prelim link
Jun 23, 2025
b8cb13c
diff reduction
Jun 23, 2025
c00f64c
turn off isv
Jun 23, 2025
f1c2660
allow stack trace to be disabled
Jun 24, 2025
6bf198b
fully handle disabling export_symbols
Jun 24, 2025
802c921
and dont include the sym file in the rom either
Jun 24, 2025
582126f
oops
Jun 24, 2025
1e724ed
set my defaults
Jun 24, 2025
4c0adf3
fix compile errors
Jun 24, 2025
5e39bf4
actually export debug data
Jun 24, 2025
835c216
oops
Jun 25, 2025
69d3b8b
aglab gave this patch to anime and games fan, and I edited it so that…
Jun 26, 2025
d63a464
subprocess searches the path on linux, no more mingw-specific behavio…
Jun 28, 2025
860bc0e
dont need objdump_exe anymore
Jun 28, 2025
8ddacea
add errorf
Jul 3, 2025
4476fb8
asserts no longer unreachable when disabled
Jul 3, 2025
8d357ab
merge 2.4
Jul 3, 2025
c52dcb3
merge upstream
Jul 3, 2025
a8bf89c
fix the case of errorf with one arg
Jul 4, 2025
d96152d
use cpp concatenation for errorf
Jul 4, 2025
c195c27
swap macro order
Jul 12, 2025
d18faaa
address feedback
Sep 14, 2025
a654603
DEBUG_FULL_STACK_TRACE promoted to a makefile switch
Oct 8, 2025
596cbb7
compile error
Oct 8, 2025
4ccff73
crash_screen external header
Oct 8, 2025
b68d787
more header moving
Oct 8, 2025
5fec133
C
Oct 8, 2025
105be23
start diff reduction
Oct 24, 2025
8c1db60
move the file
Oct 24, 2025
20e0a5c
get the diffs
Oct 24, 2025
8797a8c
start addressing feedback
Nov 4, 2025
4123c82
tool warnings (keep n64sym changes less involved so that we can pull …
Nov 4, 2025
994c762
assert fix
Nov 4, 2025
a458dde
make the condition use the newline func too
Nov 4, 2025
3ae7910
assert page colored
Nov 4, 2025
00350b2
now assert page is fully colored
Nov 4, 2025
c4fa4f9
add string ... function
Nov 4, 2025
de6cf12
truncate a bit more
Nov 4, 2025
aa2b355
add a margin to just about everything
Nov 6, 2025
e7837f5
split out foldername in path split func
Nov 6, 2025
d3bb8b6
handle (some) cache memes on ares
Nov 6, 2025
fed3323
remove debug print comment
Nov 6, 2025
205fd75
don't let disasm go out of bounds; fast scroll
Nov 6, 2025
a303132
overview
Nov 6, 2025
1984181
assert page with more
Nov 6, 2025
8581459
Add tab support
Nov 7, 2025
c132532
bring back the truncation
Nov 7, 2025
55a61bf
ellide in disasm view too
Nov 7, 2025
1b683ed
dont print file/line and then line
Nov 7, 2025
30a74dc
stuff on same line as descriptor
Nov 7, 2025
9106c47
and the overview screen
Nov 7, 2025
4a8982b
Merge branch 'develop/2.4.0' into crash_c1
someone2639 Nov 7, 2025
021f812
manual edit to overview page
Nov 7, 2025
d9282e7
allow DEBUG_EXPORT_ALL_LINES to work again
Nov 7, 2025
70eacc0
color overview
Nov 7, 2025
dd6c2f7
we dont use this define anymore
Nov 7, 2025
5b0462d
feed1
Nov 11, 2025
a0c167f
feed2
Nov 11, 2025
d8a1331
page_ -> CRASH_SCREEN_PAGE_
Nov 11, 2025
fe1e595
feedback so far
Nov 11, 2025
4f38e49
indent
Nov 11, 2025
1c9cd99
rename crashscreen.h defs
Nov 12, 2025
136593c
tab ->
Nov 12, 2025
10ff904
and order
Nov 12, 2025
9b727e1
translucent crash
Nov 13, 2025
4227828
address feedback kinda
Nov 13, 2025
03679f5
add comment
Nov 19, 2025
81b183e
Merge branch 'develop/2.4.0' into crash_c1
gheskett Nov 19, 2025
b2e8506
fix background on puppyprint page
Nov 23, 2025
aa9482e
fix spacing
Nov 23, 2025
f89440a
fix the disasm bug (dont even remember why i added that logic)
Nov 23, 2025
51b2272
add dwarf to some audio files too
Nov 24, 2025
84c900d
update heuristic to catch a weird edge case
Nov 24, 2025
35a76d6
remove debug print
Nov 24, 2025
5702a6b
remove all hardcoded x positions and replace them with spaces
Nov 25, 2025
f57652f
puppyprint swap
Nov 25, 2025
0dce81f
Add new Makefile flags to vscode c_cpp_properties.json
gheskett Dec 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
"F3DEX_GBI_2=1",
"F3DZEX_NON_GBI_2=1",
"F3DEX_GBI_SHARED=1",
"DEBUG_EXPORT_SYMBOLS=1",
"DEBUG_FULL_STACK_TRACE=1",
"LIBPL=1"
],
"compilerPath": "/usr/bin/mips-linux-gnu-gcc",
Expand Down
55 changes: 40 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,30 @@ endif
# FIXLIGHTS - converts light objects to light color commands for assets, needed for vanilla-style lighting
FIXLIGHTS ?= 1

DEBUG_MAP_STACKTRACE_FLAG := -D DEBUG_MAP_STACKTRACE
#----------------
# Debug Switches - Comment these out to remove the functionality, then run `make clean`
#----------------
# Export symbols and stack trace data for crash screen
DEBUG_EXPORT_SYMBOLS := 1
# Crash Screen: enable symbol-assisted stack trace. Adds a bit more code to (somewhat) intelligently walk the stack.
# If disabled, stack trace will just dump the memory at the stack pointer, from which one can cross-reference with the function map.
DEBUG_FULL_STACK_TRACE := 1
# Include line data, at the cost of a significantly longer link time and a few extra megabytes of ROM
DEBUG_EXPORT_ALL_LINES := 0

ifeq ($(DEBUG_EXPORT_SYMBOLS),1)
ifeq ($(DEBUG_EXPORT_ALL_LINES),1)
DEBUG_EXPORT_ALL_LINES_FLAG += --all-lines
DEFINES += DEBUG_EXPORT_ALL_LINES=1
endif
DEFINES += DEBUG_EXPORT_SYMBOLS=1
GENERATE_DWARF := -g1 -gdwarf-4
DEFAULT_OPT_FLAGS += $(GENERATE_DWARF)
SYMBOL_TABLE = $(BUILD_DIR)/sm64.sym.o
endif
ifeq ($(DEBUG_FULL_STACK_TRACE),1)
DEFINES += DEBUG_FULL_STACK_TRACE=1
endif

TARGET := sm64

Expand Down Expand Up @@ -135,7 +158,7 @@ endif
#==============================================================================#

# Default non-gcc opt flags
DEFAULT_OPT_FLAGS = -Os -ffinite-math-only -fno-signed-zeros -fno-math-errno
DEFAULT_OPT_FLAGS += -Os -ffinite-math-only -fno-signed-zeros -fno-math-errno
# Note: -fno-associative-math is used here to suppress warnings, ideally we would enable this as an optimization but
# this conflicts with -ftrapping-math apparently.
# TODO: Figure out how to allow -fassociative-math to be enabled
Expand Down Expand Up @@ -360,7 +383,7 @@ ACTOR_DIR := actors
LEVEL_DIRS := $(patsubst levels/%,%,$(dir $(wildcard levels/*/header.h)))

# Directories containing source files
SRC_DIRS += src src/boot src/boot/deflate src/game src/engine src/audio src/menu src/buffers lib/librtc actors levels bin data assets asm lib sound
SRC_DIRS += src src/boot src/boot/deflate src/game src/engine src/audio src/menu src/buffers src/debugger lib/librtc actors levels bin data assets asm lib sound
LIBZ_SRC_DIRS := src/libz
GODDARD_SRC_DIRS := src/goddard src/goddard/dynlists
BIN_DIRS := bin bin/$(VERSION)
Expand Down Expand Up @@ -443,6 +466,7 @@ endif
AR := $(CROSS)ar
OBJDUMP := $(CROSS)objdump
OBJCOPY := $(CROSS)objcopy
ADDR2LINE := addr2line

ifeq ($(LD), tools/mips64-elf-ld)
ifeq ($(shell ls -la tools/mips64-elf-ld | awk '{print $1}' | grep x),)
Expand Down Expand Up @@ -624,8 +648,8 @@ patch: $(ROM)

# Extra object file dependencies
$(BUILD_DIR)/asm/ipl3.o: $(IPL3_RAW_FILES)
$(BUILD_DIR)/src/game/crash_screen.o: $(CRASH_TEXTURE_C_FILES)
$(BUILD_DIR)/src/game/fasttext.o: $(FASTTEXT_TEXTURE_C_FILES)
$(BUILD_DIR)/src/debugger/crash_screen.o: $(CRASH_TEXTURE_C_FILES)
$(BUILD_DIR)/src/game/version.o: $(BUILD_DIR)/src/game/version_data.h
$(BUILD_DIR)/lib/aspMain.o: $(BUILD_DIR)/rsp/audio.bin
$(SOUND_BIN_DIR)/sound_data.o: $(SOUND_BIN_DIR)/sound_data.ctl $(SOUND_BIN_DIR)/sound_data.tbl $(SOUND_BIN_DIR)/sequences.bin $(SOUND_BIN_DIR)/bank_sets
Expand Down Expand Up @@ -660,13 +684,13 @@ else
endif
endif

$(BUILD_DIR)/src/usb/usb.o: OPT_FLAGS := -O0
$(BUILD_DIR)/src/usb/usb.o: OPT_FLAGS := $(GENERATE_DWARF) -O0
$(BUILD_DIR)/src/usb/usb.o: CFLAGS += -Wno-unused-variable -Wno-sign-compare -Wno-unused-function
$(BUILD_DIR)/src/usb/debug.o: OPT_FLAGS := -O0
$(BUILD_DIR)/src/usb/debug.o: OPT_FLAGS := $(GENERATE_DWARF) -O0
$(BUILD_DIR)/src/usb/debug.o: CFLAGS += -Wno-unused-parameter -Wno-maybe-uninitialized
# File specific opt flags
$(BUILD_DIR)/src/audio/heap.o: OPT_FLAGS := -Os -fno-jump-tables
$(BUILD_DIR)/src/audio/synthesis.o: OPT_FLAGS := -Os -fno-jump-tables
$(BUILD_DIR)/src/audio/heap.o: OPT_FLAGS := $(GENERATE_DWARF) -Os -fno-jump-tables
$(BUILD_DIR)/src/audio/synthesis.o: OPT_FLAGS := $(GENERATE_DWARF) -Os -fno-jump-tables

$(BUILD_DIR)/src/engine/surface_collision.o: OPT_FLAGS := $(COLLISION_OPT_FLAGS)
$(BUILD_DIR)/src/engine/math_util.o: OPT_FLAGS := $(MATH_UTIL_OPT_FLAGS)
Expand All @@ -677,7 +701,7 @@ $(BUILD_DIR)/src/game/rendering_graph_node.o: OPT_FLAGS := $(GRAPH_NODE_OPT_FLAG
# $(info MATH_UTIL_OPT_FLAGS: $(MATH_UTIL_OPT_FLAGS))
# $(info GRAPH_NODE_OPT_FLAGS: $(GRAPH_NODE_OPT_FLAGS))

ALL_DIRS := $(BUILD_DIR) $(addprefix $(BUILD_DIR)/,$(SRC_DIRS) asm/debug $(GODDARD_SRC_DIRS) $(ULTRA_BIN_DIRS) $(BIN_DIRS) $(TEXTURE_DIRS) $(TEXT_DIRS) $(SOUND_SAMPLE_DIRS) $(addprefix levels/,$(LEVEL_DIRS)) rsp include) $(YAY0_DIR) $(addprefix $(YAY0_DIR)/,$(VERSION)) $(SOUND_BIN_DIR) $(SOUND_BIN_DIR)/sequences/$(VERSION)
ALL_DIRS := $(BUILD_DIR) $(addprefix $(BUILD_DIR)/,$(SRC_DIRS) $(GODDARD_SRC_DIRS) $(ULTRA_BIN_DIRS) $(BIN_DIRS) $(TEXTURE_DIRS) $(TEXT_DIRS) $(SOUND_SAMPLE_DIRS) $(addprefix levels/,$(LEVEL_DIRS)) rsp include) $(YAY0_DIR) $(addprefix $(YAY0_DIR)/,$(VERSION)) $(SOUND_BIN_DIR) $(SOUND_BIN_DIR)/sequences/$(VERSION)

# Make sure build directory exists before compiling anything
DUMMY != mkdir -p $(ALL_DIRS)
Expand Down Expand Up @@ -877,7 +901,7 @@ $(BUILD_DIR)/rsp/%.bin $(BUILD_DIR)/rsp/%_data.bin: rsp/%.s
# Run linker script through the C preprocessor
$(BUILD_DIR)/$(LD_SCRIPT): $(LD_SCRIPT) $(BUILD_DIR)/goddard.txt
$(call print,Preprocessing linker script:,$<,$@)
$(V)$(CPP) $(CPPFLAGS) -DBUILD_DIR=$(BUILD_DIR) -DULTRALIB=lib$(ULTRALIB) $(DEBUG_MAP_STACKTRACE_FLAG) -MMD -MP -MT $@ -MF $@.d -o $@ $<
$(V)$(CPP) $(CPPFLAGS) -DBUILD_DIR=$(BUILD_DIR) -DULTRALIB=lib$(ULTRALIB) -MMD -MP -MT $@ -MF $@.d -o $@ $<

# Link libgoddard
$(BUILD_DIR)/libgoddard.a: $(GODDARD_O_FILES)
Expand All @@ -897,13 +921,14 @@ $(BUILD_DIR)/goddard.txt: $(BUILD_DIR)/sm64_prelim.elf
$(call print,Getting Goddard size...)
$(V)python3 tools/getGoddardSize.py $(BUILD_DIR)/sm64_prelim.map $(VERSION)

$(BUILD_DIR)/asm/debug/map.o: asm/debug/map.s $(BUILD_DIR)/sm64_prelim.elf
$(call print,Assembling:,$<,$@)
$(V)python3 tools/mapPacker.py $(BUILD_DIR)/sm64_prelim.elf $(BUILD_DIR)/bin/addr.bin $(BUILD_DIR)/bin/name.bin
$(V)$(CROSS)gcc -c $(ASMFLAGS) $(foreach i,$(INCLUDE_DIRS),-Wa,-I$(i)) -x assembler-with-cpp -MMD -MF $(BUILD_DIR)/$*.d -o $@ $<
$(SYMBOL_TABLE): $(BUILD_DIR)/sm64_prelim.elf
$(call print,Generating symbol table:,$(@F))
$(V)tools/n64sym $(DEBUG_EXPORT_ALL_LINES_FLAG) --objdump $(OBJDUMP) --addr2line $(ADDR2LINE) $(BUILD_DIR)/sm64_prelim.elf
$(call print,Assembling:,$@)
$(LD) -r -b binary -o $@ $(BUILD_DIR)/sm64_prelim.sym

# Link SM64 ELF file
$(ELF): $(BUILD_DIR)/sm64_prelim.elf $(BUILD_DIR)/asm/debug/map.o $(O_FILES) $(YAY0_OBJ_FILES) $(SEG_FILES) $(BUILD_DIR)/$(LD_SCRIPT) $(BUILD_DIR)/libgoddard.a
$(ELF): $(BUILD_DIR)/sm64_prelim.elf $(SYMBOL_TABLE) $(O_FILES) $(YAY0_OBJ_FILES) $(SEG_FILES) $(BUILD_DIR)/$(LD_SCRIPT) $(BUILD_DIR)/libgoddard.a
@$(PRINT) "$(GREEN)Linking ELF file: $(BLUE)$@ $(NO_COL)\n"
$(V)$(LD) --gc-sections -L $(BUILD_DIR) -T $(BUILD_DIR)/$(LD_SCRIPT) -T goddard.txt -Map $(BUILD_DIR)/sm64.$(VERSION).map --no-check-sections $(addprefix -R ,$(SEG_FILES)) -o $@ $(O_FILES) -L$(LIBS_DIR) -l$(ULTRALIB) -Llib $(LINK_LIBRARIES) -u sprintf -u osMapTLB -Llib/gcclib/$(LIBGCCDIR) -lgcc

Expand Down
17 changes: 0 additions & 17 deletions asm/debug/map.s

This file was deleted.

7 changes: 5 additions & 2 deletions asm/n64_assert.s
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
.include "macros.inc"
#include "src/debugger/assert.h"

.section .data
glabel __n64Assert_Filename
.skip 4
glabel __n64Assert_LineNum
.skip 4
glabel __n64Assert_Message
glabel __n64Assert_Condition
.skip 4
glabel __n64Assert_MessageBuf
.skip ASSERT_MESGBUF_SIZE

.section .text

glabel __n64Assert
sw $a0, __n64Assert_Filename
sw $a1, __n64Assert_LineNum
sw $a2, __n64Assert_Message
sw $a2, __n64Assert_Condition
syscall
nop

2 changes: 1 addition & 1 deletion include/config/config_debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// #define DEBUG_ALL

/**
* Disables all debug options (except PUPPYPRINT).
* Disables all debug options (except PUPPYPRINT and DEBUG_FULL_STACK_TRACE).
*/
// #define DISABLE_ALL

Expand Down
3 changes: 3 additions & 0 deletions include/segment_symbols.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,13 @@ DECLARE_SEGMENT(goddard)
DECLARE_SEGMENT(framebuffers)
DECLARE_SEGMENT(assets)
extern u8 _goddardSegmentStart[];
extern u8 _goddardSegmentTextEnd[];
extern u8 _goddardSegmentEnd[];
extern u8 _engineSegmentStart[];
extern u8 _engineSegmentTextEnd[];
extern u8 _engineSegmentBssEnd[];
extern u8 _mainSegmentStart[];
extern u8 _mainSegmentTextEnd[];
extern u8 _mainSegmentEnd[];
extern u8 _engineSegmentEnd[];
extern u8 _framebuffersSegmentBssStart[];
Expand Down
19 changes: 12 additions & 7 deletions sm64.ld
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,8 @@ SECTIONS
#endif

/* hardcoded symbols to satisfy preliminary link for map parser */
#ifndef DEBUG_MAP_STACKTRACE
#ifndef DEBUG_EXPORT_SYMBOLS
_mapDataSegmentRomStart = 0;
gMapEntries = 0;
gMapEntrySize = 0;
gMapStrings = 0;
#endif

BEGIN_SEG(main, .) SUBALIGN(16)
Expand All @@ -167,6 +164,7 @@ SECTIONS
BUILD_DIR/src/hvqm*.o(.text*);
BUILD_DIR/src/usb*.o(.text*);
BUILD_DIR/src/audio*.o(.text*);
BUILD_DIR/src/debugger*.o(.text*);
#ifdef S2DEX_TEXT_ENGINE
BUILD_DIR/src/s2d_engine*.o(.text*);
#endif
Expand All @@ -189,6 +187,7 @@ SECTIONS
BUILD_DIR/asm/n64_assert.o(.*data*);
BUILD_DIR/src/boot*.o(.*data*);
BUILD_DIR/src/audio*.o(.*data*);
BUILD_DIR/src/debugger*.o(.*data*);
#ifdef S2DEX_TEXT_ENGINE
BUILD_DIR/src/s2d_engine*.o(.*data*);
#endif
Expand All @@ -207,6 +206,7 @@ SECTIONS
BUILD_DIR/src/boot*.o(.rodata*);
BUILD_DIR/src/usb*.o(.rodata*);
BUILD_DIR/src/audio*.o(.rodata*);
BUILD_DIR/src/debugger*.o(.rodata*);
#ifdef S2DEX_TEXT_ENGINE
BUILD_DIR/src/s2d_engine*.o(.rodata*);
#endif
Expand All @@ -226,6 +226,7 @@ SECTIONS
BUILD_DIR/src/hvqm*.o(.*bss*);
BUILD_DIR/src/usb*.o(.*bss*);
BUILD_DIR/src/audio*.o(.*bss*);
BUILD_DIR/src/debugger*.o(.*bss*);
#ifdef S2DEX_TEXT_ENGINE
BUILD_DIR/src/s2d_engine*.o(.*bss*);
#endif
Expand Down Expand Up @@ -524,15 +525,19 @@ SECTIONS
END_SEG(capcom)
#endif

#ifdef DEBUG_MAP_STACKTRACE
BEGIN_SEG(mapData, (RAM_END - 0x00100000)) {
KEEP(BUILD_DIR/asm/debug/map.o(.data*));
#ifdef DEBUG_EXPORT_SYMBOLS
BEGIN_SEG(mapData, 0) ALIGN(16) {
#ifndef PRELIMINARY
KEEP(BUILD_DIR/sm64.sym.o(.data*));
#endif
}
END_SEG(mapData)
#endif
/* DWARF debug sections.
Symbols in the DWARF debugging sections are relative to the beginning
of the section so we begin them at 0. */
.debug_rnglists 0 : { *(.debug_rnglists) }
.debug_line_str 0 : { *(.debug_line_str) }
/* DWARF 1 */
.debug 0 : { *(.debug) }
.line 0 : { *(.line) }
Expand Down
5 changes: 3 additions & 2 deletions src/audio/external.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "external.h"
#include "playback.h"
#include "synthesis.h"
#include "debugger/assert.h"
#include "game/debug.h"
#include "game/main.h"
#include "game/level_update.h"
Expand Down Expand Up @@ -686,7 +687,7 @@ struct SPTask *create_next_audio_frame_task(void) {
task->yield_data_ptr = NULL;
task->yield_data_size = 0;

assert_args(writtenCmds <= gMaxAudioCmds, "Audio RSP pool exceeded: %d command(s) over!", (s32) gMaxAudioCmds - (s32) writtenCmds);
assertf(writtenCmds <= gMaxAudioCmds, "Audio RSP pool exceeded: %d command(s) over!", (s32) gMaxAudioCmds - (s32) writtenCmds);

decrease_sample_dma_ttls();

Expand All @@ -698,7 +699,7 @@ struct SPTask *create_next_audio_frame_task(void) {
* Called from threads: thread5_game_loop
*/
void play_sound(s32 soundBits, f32 *pos) {
assert(((soundBits & SOUNDARGS_MASK_SOUNDID) >> SOUNDARGS_SHIFT_SOUNDID) != 0xff, "Sfx tables do not support a sound id of 0xff!");
assertf(((soundBits & SOUNDARGS_MASK_SOUNDID) >> SOUNDARGS_SHIFT_SOUNDID) != 0xff, "Sfx tables do not support a sound id of 0xff!");
sSoundRequests[sSoundRequestCount].soundBits = soundBits;
sSoundRequests[sSoundRequestCount].position = pos;
sSoundRequestCount++;
Expand Down
4 changes: 2 additions & 2 deletions src/audio/heap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1056,9 +1056,9 @@ void init_reverb_us(s32 presetId) {
#else
if (gBetterReverbPresetValue >= gBetterReverbPresetCount) {
#endif
aggress(gBetterReverbPresetCount > 0, "No BETTER_REVERB presets exist!");
aggressf(gBetterReverbPresetCount > 0, "No BETTER_REVERB presets exist!");

assert(gBetterReverbPresetValue < gBetterReverbPresetCount, "BETTER_REVERB preset value exceeds total number of available presets!");
assertf(gBetterReverbPresetValue < gBetterReverbPresetCount, "BETTER_REVERB preset value exceeds total number of available presets!");
betterReverbPreset = &gBetterReverbSettings[0];
}

Expand Down
2 changes: 1 addition & 1 deletion src/audio/synthesis.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ void set_better_reverb_buffers(u32 *inputDelaysL, u32 *inputDelaysR) {
}
}

aggress_args(bufOffset * sizeof(s16) + BETTER_REVERB_PTR_SIZE <= BETTER_REVERB_SIZE, "BETTER_REVERB_SIZE is too small for this preset!\nSize should be at least 0x%06x!", bufOffset * sizeof(s16) + BETTER_REVERB_PTR_SIZE);
aggressf(bufOffset * sizeof(s16) + BETTER_REVERB_PTR_SIZE <= BETTER_REVERB_SIZE, "BETTER_REVERB_SIZE is too small for this preset!\nSize should be at least 0x%06x!", bufOffset * sizeof(s16) + BETTER_REVERB_PTR_SIZE);

bzero(allpassIdx, sizeof(allpassIdx));
}
Expand Down
13 changes: 7 additions & 6 deletions src/boot/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

#include "sm64.h"
#include "audio/external.h"
#include "debugger/assert.h"
#include "debugger/crash_screen.h"
#include "game/game_init.h"
#include "game/debug.h"
#include "game/memory.h"
Expand Down Expand Up @@ -324,26 +326,25 @@ void alert_rcp_hung_up(void) {
void check_stack_validity(void) {
gIdleThreadStack[0]++;
gIdleThreadStack[THREAD1_STACK - 1]++;
assert(gIdleThreadStack[0] == gIdleThreadStack[THREAD1_STACK - 1], "Thread 1 stack overflow.")
assertf(gIdleThreadStack[0] == gIdleThreadStack[THREAD1_STACK - 1], "Thread 1 stack overflow.");
gThread3Stack[0]++;
gThread3Stack[THREAD3_STACK - 1]++;
assert(gThread3Stack[0] == gThread3Stack[THREAD3_STACK - 1], "Thread 3 stack overflow.")
assertf(gThread3Stack[0] == gThread3Stack[THREAD3_STACK - 1], "Thread 3 stack overflow.");
gThread4Stack[0]++;
gThread4Stack[THREAD4_STACK - 1]++;
assert(gThread4Stack[0] == gThread4Stack[THREAD4_STACK - 1], "Thread 4 stack overflow.")
assertf(gThread4Stack[0] == gThread4Stack[THREAD4_STACK - 1], "Thread 4 stack overflow.");
gThread5Stack[0]++;
gThread5Stack[THREAD5_STACK - 1]++;
assert(gThread5Stack[0] == gThread5Stack[THREAD5_STACK - 1], "Thread 5 stack overflow.")
assertf(gThread5Stack[0] == gThread5Stack[THREAD5_STACK - 1], "Thread 5 stack overflow.");
#if ENABLE_RUMBLE
gThread6Stack[0]++;
gThread6Stack[THREAD6_STACK - 1]++;
assert(gThread6Stack[0] == gThread6Stack[THREAD6_STACK - 1], "Thread 6 stack overflow.")
assertf(gThread6Stack[0] == gThread6Stack[THREAD6_STACK - 1], "Thread 6 stack overflow.");
#endif
}
#endif


extern void crash_screen_init(void);
extern OSViMode VI;
void thread3_main(UNUSED void *arg) {
setup_mesg_queues();
Expand Down
Loading