Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions ASM/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ CFLAGS = -O1 -G0 -fno-reorder-blocks -march=vr4300 -mtune=vr4300 -mabi=32 -mno-g
-mexplicit-relocs
CPPFLAGS = -DF3DEX_GBI_2

ifdef DEBUG_MODE
CFLAGS += -DDEBUG_MODE=1
endif

OUTDIR := build
OBJDIR := build/bin
SRCDIR := c
Expand Down
4 changes: 4 additions & 0 deletions ASM/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@
parser.add_argument('--dump-obj', action='store_true', help="Dumps extra object info for debugging purposes. Does nothing with --no-compile-c")
parser.add_argument('--diff-only', action='store_true', help="Creates diff output without running armips")
parser.add_argument('--mips-binutils-prefix', type=str, default="mips64-", help="Use a different prefix for N64 toolchain")
parser.add_argument('--debug-c', action='store_true', help="Define DEBUG_MODE 1 for C modules")

args = parser.parse_args()
pj64_sym_path = args.pj64sym
compile_c = not args.no_compile_c
dump_obj = args.dump_obj
diff_only = args.diff_only
mips_binutils_prefix = args.mips_binutils_prefix
debug_c = args.debug_c

root_dir = os.path.dirname(os.path.realpath(__file__))
tools_dir = os.path.join(root_dir, 'tools')
Expand All @@ -47,6 +49,8 @@
if compile_c:
clist = ['make']
clist.append(f'MIPS_BINUTILS_PREFIX={mips_binutils_prefix}')
if debug_c:
clist.append(f'DEBUG_MODE=1')
if dump_obj:
clist.append('RUN_OBJDUMP=1')
try:
Expand Down
2 changes: 2 additions & 0 deletions ASM/c/debug.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#ifndef DEBUG_H
#define DEBUG_H

#ifndef DEBUG_MODE
#define DEBUG_MODE 0
#endif

#include "z64.h"
#include "gfx.h"
Expand Down
Loading