Pull in symbols from the decomp elf automatically when building the patches elf

This commit is contained in:
Mr-Wiseguy 2023-11-27 23:39:18 -05:00
parent e0ac016936
commit ddaac3cd8f
2 changed files with 4 additions and 16 deletions

View File

@ -4,9 +4,9 @@ CC := clang
LD := ld.lld
OBJCOPY := llvm-objcopy
CFLAGS := -target mips -mips2 -mabi=32 -O2 -mno-odd-spreg -fomit-frame-pointer -G0 -Wall -Wextra -Wno-incompatible-library-redeclaration -Wno-unused-parameter -Wno-unknown-pragmas -Wno-unused-variable
CPPFLAGS := -nostdinc -D_LANGUAGE_C -DMIPS -I ../../mm/include -I ../../mm/src -I ../../mm/build -I ../../mm/assets
LDFLAGS := -nostdlib -T patches.ld -T syms.ld
CFLAGS := -target mips -mips2 -mabi=32 -O2 -mno-abicalls -mno-odd-spreg -fomit-frame-pointer -mno-check-zero-division -G0 -Wall -Wextra -Wno-incompatible-library-redeclaration -Wno-unused-parameter -Wno-unknown-pragmas -Wno-unused-variable -Wno-missing-braces
CPPFLAGS := -nostdinc -D_LANGUAGE_C -DMIPS -I ../../mm/include -I ../../mm/src -I ../../mm/build -I ../../mm/assets -I../../mupen_rt64/mupen64plus-video-rt64/include
LDFLAGS := -nostdlib -T patches.ld -T syms.ld --just-symbols=../mm.us.rev1.elf --allow-multiple-definition
BINFLAGS := -O binary
C_SRCS := $(wildcard *.c)
@ -19,7 +19,7 @@ $(DATABIN): $(TARGET)
$(OBJCOPY) $(BINFLAGS) $(TARGET) $@
$(TARGET): $(C_OBJS) patches.ld syms.ld
$(LD) $(LDFLAGS) $(C_OBJS) -o $@
$(LD) $(C_OBJS) $(LDFLAGS) -o $@
$(C_OBJS): %.o : %.c
$(CC) $(CFLAGS) $(CPPFLAGS) $< -MMD -MF $(@:.o=.d) -c -o $@

View File

@ -3,15 +3,3 @@ __start = 0x80000000;
/* Dummy addresses that get recompiled into function calls */
recomp_get_item_inputs = 0x81000000;
recomp_puts = 0x81000004;
/* TODO pull these symbols from the elf file directly */
Player_PostLimbDrawGameplay = 0x80128BD0;
Player_DrawImpl = 0x801246F4;
gRegEditor = 0x801f3f60;
Audio_PlaySfx = 0x8019f0c8;
gSaveContext = 0x801ef670;
Interface_SetHudVisibility = 0x8010ef68;
PadMgr_GetInput = 0x80175f98;
Inventory_GetBtnBItem = 0x8012ec80;
gItemSlots = 0x801c2078;
_Printf = 0x8008e050;