diff --git a/BanjoRecompSyms b/BanjoRecompSyms index 03bc19e..38e4320 160000 --- a/BanjoRecompSyms +++ b/BanjoRecompSyms @@ -1 +1 @@ -Subproject commit 03bc19eb3a26c64db2fd196c424de443bdcc724b +Subproject commit 38e4320a052000af1d5158c640cf4802f4014f49 diff --git a/patches/overlay_loading.c b/patches/overlay_loading.c index de37045..f4b1843 100644 --- a/patches/overlay_loading.c +++ b/patches/overlay_loading.c @@ -2,9 +2,6 @@ #include "overlay_loading.h" #include "misc_funcs.h" -// Forced .data to make patches.bin not be empty. -__attribute__((used)) int x = 4; - struct Overlay { void *start; void *end; @@ -176,10 +173,6 @@ RECOMP_PATCH void ucode_load(void) { } } -// @recomp Stub this out -RECOMP_PATCH void func_80247380(void){ -} - typedef struct Animation_s Animation; typedef struct animctrl_s{ diff --git a/patches/patches.h b/patches/patches.h index 6daf4ee..b04e77f 100644 --- a/patches/patches.h +++ b/patches/patches.h @@ -10,18 +10,19 @@ __attribute__((noinline, weak, used, section(".recomp_event"))) void func {} \ _Pragma("GCC diagnostic pop") -#include "n64_types.h" - #define osInvalDCache osInvalDCache_recomp #define osInvalICache osInvalICache_recomp #define osWritebackDCache osWritebackDCache_recomp #define osWriteBackDCacheAll osWritebackDCacheAll_recomp -#define bzero bzero_recomp -void osInvalDCache(void *, s32); -void osInvalICache(void *, s32); -void osWritebackDCache(void *, s32); +#define osSendMesg osSendMesg_recomp +#define osRecvMesg osRecvMesg_recomp +#define osGetCount osGetCount_recomp +#define osCreateMesgQueue osCreateMesgQueue_recomp void osWriteBackDCacheAll(void); -void bzero(void *, int); +#define bzero bzero_recomp +#define osDpSetStatus osDpSetStatus_recomp + +#include "ultra64.h" typedef int bool; diff --git a/patches/scheduler_patches.c b/patches/scheduler_patches.c new file mode 100644 index 0000000..c09eab2 --- /dev/null +++ b/patches/scheduler_patches.c @@ -0,0 +1,17 @@ +#include "patches.h" + +extern OSMesgQueue sMesgQueue2; + +// @recomp Clear the RDP freeze bit here to prevent a race condition. +// TODO look into why this is needed. +RECOMP_PATCH void viMgr_func_8024BFAC(void){ + osSendMesg(&sMesgQueue2, 0, OS_MESG_NOBLOCK); + + // @recomp Clear the freeze bit. + osDpSetStatus(DPC_CLR_FREEZE); +} + +// @recomp Remove the original functionality. +RECOMP_PATCH void func_80247380(void){ +} + diff --git a/patches/syms.ld b/patches/syms.ld index 56a527b..c732ca6 100644 --- a/patches/syms.ld +++ b/patches/syms.ld @@ -10,3 +10,8 @@ osWritebackDCache_recomp = 0x8F000014; osWritebackDCacheAll_recomp = 0x8F000018; bzero_recomp = 0x8F00001C; recomp_load_overlays_by_rom = 0x8F000020; +osSendMesg_recomp = 0x8F000024; +osGetCount_recomp = 0x8F000028; +osCreateMesgQueue_recomp = 0x8F00002C; +osRecvMesg_recomp = 0x8F000030; +osDpSetStatus_recomp = 0x8F000034;