From 0554a8aeb79a9f65cff6189399de85ce30da7d4f Mon Sep 17 00:00:00 2001 From: Wiseguy <68165316+Mr-Wiseguy@users.noreply.github.com> Date: Wed, 5 Mar 2025 20:01:03 -0500 Subject: [PATCH] Patch virtual address translation to support entire extended RAM address space (#533) --- patches/memory_patches.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 patches/memory_patches.c diff --git a/patches/memory_patches.c b/patches/memory_patches.c new file mode 100644 index 0000000..9033993 --- /dev/null +++ b/patches/memory_patches.c @@ -0,0 +1,12 @@ +#include "patches.h" + +// @recomp Leave the entire KSEG0 range unmodified when translating to a virtual address. This will allow +// using the entirety of the extended RAM address space for custom assets. +RECOMP_PATCH void* Lib_SegmentedToVirtual(void* ptr) { + if (IS_KSEG0(ptr)) { + return ptr; + } + else { + return SEGMENTED_TO_K0(ptr); + } +}