From cbc2ca037aeada9bb05e60b5bc4ca29885625e03 Mon Sep 17 00:00:00 2001 From: kub Date: Mon, 25 Oct 2021 18:33:43 +0200 Subject: [PATCH] libretro, enable drc usage on WiiU --- Makefile.libretro | 5 +---- platform/libretro/libretro.c | 6 +++++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Makefile.libretro b/Makefile.libretro index 9effd3c8..aa20d456 100644 --- a/Makefile.libretro +++ b/Makefile.libretro @@ -281,12 +281,9 @@ else ifeq ($(platform), wiiu) CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT) CXX = $(DEVKITPPC)/bin/powerpc-eabi-g++$(EXE_EXT) AR = $(DEVKITPPC)/bin/powerpc-eabi-ar$(EXE_EXT) - CFLAGS += -DGEKKO -DWIIU -DHW_RVL -mwup -mcpu=750 -meabi -mhard-float -D__ppc__ -DMSB_FIRST + CFLAGS += -DGEKKO -DWIIU -DHW_RVL -DHW_WUP -mwup -mcpu=750 -meabi -mhard-float -D__ppc__ -DMSB_FIRST STATIC_LINKING = 1 NO_MMAP = 1 - # Wii U has memory mapped in a way not suitable for DRC - use_sh2drc = 0 - use_svpdrc = 0 # Nintendo Switch (libtransistor) else ifeq ($(platform), switch) diff --git a/platform/libretro/libretro.c b/platform/libretro/libretro.c index ea640c22..4a12c686 100644 --- a/platform/libretro/libretro.c +++ b/platform/libretro/libretro.c @@ -572,8 +572,12 @@ void plat_munmap(void *ptr, size_t size) void *plat_mem_get_for_drc(size_t size) { void *mem = NULL; -#ifdef VITA +#if defined VITA sceKernelGetMemBlockBase(sceBlock, &mem); +#elif defined HW_WUP + // For WiiU, a slice of RWX memory left from the exploit is used, see: + // https://github.com/embercold/pcsx_rearmed/commit/af0453223 + mem = (void *)(0x01000000 - size); #endif return mem; } -- 2.39.2