From c8fac11c4286c91d784ee1a0f30dc465da0e4940 Mon Sep 17 00:00:00 2001 From: Mr-Wiseguy Date: Sat, 6 Sep 2025 23:46:50 -0400 Subject: [PATCH] Update decomp and symbols --- BanjoRecompSyms | 2 +- banjo.us.rev0.toml | 23 +++++++++++++++++++++-- lib/bk-decomp | 2 +- patches.toml | 2 +- patches/actor_patches.c | 4 ++-- patches/print.c | 9 +++++++++ patches/xldtob.c | 5 ++++- patches/xprintf.c | 3 +++ 8 files changed, 42 insertions(+), 8 deletions(-) diff --git a/BanjoRecompSyms b/BanjoRecompSyms index 9d2625f..ccbe591 160000 --- a/BanjoRecompSyms +++ b/BanjoRecompSyms @@ -1 +1 @@ -Subproject commit 9d2625f2b106e7a1196fbc7d2317c672a18d1e35 +Subproject commit ccbe591f4424913e2965d3feb4e66ba43b75cf4d diff --git a/banjo.us.rev0.toml b/banjo.us.rev0.toml index 17e4893..180fbee 100644 --- a/banjo.us.rev0.toml +++ b/banjo.us.rev0.toml @@ -4,16 +4,35 @@ entrypoint = 0x80000400 # Paths are relative to the location of this config file. output_func_path = "RecompiledFuncs" -symbols_file_path = "BanjoRecompSyms/bk.us.rev0.syms.toml" rom_file_path = "banjo.us.v10.decompressed.z64" +symbols_file_path = "BanjoRecompSyms/bk.us.rev0.syms.toml" # elf_path = "banjo.us.v10.elf" +# use_mdebug = true +# trace_mode = true +bss_section_suffix = "_bss" manual_funcs = [ - { name = "__n_CSPVoiceHandler", section = ".core1", vram = 0x8025E438, size = 0x684 }, + { name = "boot___osLeoAbnormalResume", section = ".boot_bk_boot", vram = 0x800037E4, size = 0xE8 }, + { name = "boot___osLeoResume", section = ".boot_bk_boot", vram = 0x800038CC, size = 0xEC }, +] + +mdebug_file_mappings = [ + { filename = "src/TTC/ch/clam.c", input_section = ".text", output_section = ".TTC" }, + { filename = "src/TTC/ch/blubber.c", input_section = ".text", output_section = ".TTC" }, + { filename = "src/TTC/ch/lockup.c", input_section = ".text", output_section = ".TTC" }, + { filename = "src/TTC/ch/treasure.c", input_section = ".text", output_section = ".TTC" }, + { filename = "src/SM/ch/attacktutorial.c", input_section = ".text", output_section = ".SM" }, + { filename = "src/SM/ch/vegetables.c", input_section = ".text", output_section = ".SM" }, ] [patches] +ignored = [ + "boot_n_aspMainTextStart", + "boot_gSPF3DEX_fifoTextStart", + "boot_gSPL3DEX_fifoTextStart", +] + renamed = [ "wmemcpy" ] diff --git a/lib/bk-decomp b/lib/bk-decomp index fd208f7..351ca15 160000 --- a/lib/bk-decomp +++ b/lib/bk-decomp @@ -1 +1 @@ -Subproject commit fd208f77ca80cc07a7adbeb205a3c40dd8fa4539 +Subproject commit 351ca1580c10e550160ac11c77824fa9a498015e diff --git a/patches.toml b/patches.toml index 743454b..6cbde8c 100644 --- a/patches.toml +++ b/patches.toml @@ -9,7 +9,7 @@ single_file_output = true use_absolute_symbols = true # Point the recompiler at the symbol files so that it can resolve relocations during recompilation. func_reference_syms_file = "BanjoRecompSyms/bk.us.rev0.syms.toml" -data_reference_syms_files = [ "BanjoRecompSyms/bk.us.rev0.datasyms.toml", "BanjoRecompSyms/bk.us.rev0.datasyms_static.toml" ] +data_reference_syms_files = [ "BanjoRecompSyms/bk.us.rev0.datasyms.toml" ] # Tell the recompiler to write the output binary. Doing this instead of using objcopy allows the recompiler to patch MIPS32 relocs. output_binary_path = "patches/patches.bin" # Do not emit warnings for unpaired LO16 values, as clang produces many of them. diff --git a/patches/actor_patches.c b/patches/actor_patches.c index 5c90005..f79b8fe 100644 --- a/patches/actor_patches.c +++ b/patches/actor_patches.c @@ -45,7 +45,7 @@ RECOMP_PATCH ActorMarker * marker_init(s32 *pos, MarkerDrawFunc draw_func, int a marker->actrArrayIdx = 0; marker->unk14_10 = 0; marker->modelId = 0; - marker->unk3E_1 = 0; + marker->isBanjoOnTop = 0; marker->unk14_22 = 0; marker->unk14_21 = 0; marker->yaw = 0; @@ -66,7 +66,7 @@ RECOMP_PATCH ActorMarker * marker_init(s32 *pos, MarkerDrawFunc draw_func, int a marker->unk18 = 0; marker->actorUpdateFunc = NULL; marker->actorFreeFunc = NULL; - marker->unk28 = 0; + marker->commonParticleIndex = 0; marker->actorUpdate2Func = NULL; marker->unk38[0] = 0; marker->unk38[1] = 0; diff --git a/patches/print.c b/patches/print.c index 3e1db83..4164415 100644 --- a/patches/print.c +++ b/patches/print.c @@ -17,3 +17,12 @@ RECOMP_EXPORT int recomp_printf(const char* fmt, ...) { return ret; } + +void rmonPrintf_recomp(const char* fmt, ...) { + va_list args; + va_start(args, fmt); + + int ret = _Printf(&proutPrintf, NULL, fmt, args); + + va_end(args); +} diff --git a/patches/xldtob.c b/patches/xldtob.c index 293554d..197ded8 100644 --- a/patches/xldtob.c +++ b/patches/xldtob.c @@ -1,3 +1,6 @@ +#pragma GCC diagnostic ignored "-Wpointer-sign" +#pragma GCC diagnostic ignored "-Wlogical-op-parentheses" + #include "patches.h" #include "string.h" #include "xstdio.h" @@ -55,7 +58,7 @@ static const ldouble pows[] = {10e0L, 10e1L, 10e3L, 10e7L, 10e15L, 10e31L, 10e63 #define _D2 2 #define _D3 3 -#define ALIGN(s, align) (((unsigned int)(s) + ((align)-1)) & ~((align)-1)) +// #define ALIGN(s, align) (((unsigned int)(s) + ((align)-1)) & ~((align)-1)) void _Ldtob(_Pft* px, char code) { char buff[BUFF_LEN]; diff --git a/patches/xprintf.c b/patches/xprintf.c index c53aa4f..14ad98d 100644 --- a/patches/xprintf.c +++ b/patches/xprintf.c @@ -1,3 +1,6 @@ +#pragma GCC diagnostic ignored "-Wpointer-sign" +#pragma GCC diagnostic ignored "-Wunused-value" + #include "patches.h" #include "string.h" #include "stdarg.h"