From b28a805f9cc17d4efe896b34924723d96b75e760 Mon Sep 17 00:00:00 2001 From: pstef <3462925+pstef@users.noreply.github.com> Date: Sat, 5 Apr 2025 17:41:08 +0000 Subject: [PATCH 1/5] Remove remnants of a rejected idea This was replaced simply by importing 3DS support from upstream. --- deps/rcheevos/src/rc_compat.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/deps/rcheevos/src/rc_compat.c b/deps/rcheevos/src/rc_compat.c index 9477c79cf7..e3e6371605 100644 --- a/deps/rcheevos/src/rc_compat.c +++ b/deps/rcheevos/src/rc_compat.c @@ -3,10 +3,6 @@ #include #include -#if defined(_3DS) && !defined(_POSIX_THREADS) -#include <../rthreads/ctr_pthread.h> -#endif - #ifdef RC_C89_HELPERS int rc_strncasecmp(const char* left, const char* right, size_t length) From e8d43b3d99a0886e48424950fc3315710adb52d0 Mon Sep 17 00:00:00 2001 From: pstef <3462925+pstef@users.noreply.github.com> Date: Sun, 6 Apr 2025 11:13:47 +0000 Subject: [PATCH 2/5] Add missing function declarations They are absent even in upstream, so I decided against copying to the local copy of libogc. And a couple of function prototypes doesn't seem to warrant a new header file. --- gfx/drivers/gx_gfx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gfx/drivers/gx_gfx.c b/gfx/drivers/gx_gfx.c index 0e27b6f955..baca247fc0 100644 --- a/gfx/drivers/gx_gfx.c +++ b/gfx/drivers/gx_gfx.c @@ -74,6 +74,9 @@ } #endif +void VIDEO_SetTrapFilter(bool enable); +void VIDEO_SetGamma(int gamma); + enum { GX_RESOLUTIONS_DEFAULT = 0, From d65c17f6b802ff49b215728b9481231dbac12330 Mon Sep 17 00:00:00 2001 From: pstef <3462925+pstef@users.noreply.github.com> Date: Sun, 6 Apr 2025 11:16:30 +0000 Subject: [PATCH 3/5] Add missing includes malloc.h for memalign() and unistd.h for usleep(). --- input/drivers_hid/wiiusb_hid.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/input/drivers_hid/wiiusb_hid.c b/input/drivers_hid/wiiusb_hid.c index ec29be501d..bab98695bb 100644 --- a/input/drivers_hid/wiiusb_hid.c +++ b/input/drivers_hid/wiiusb_hid.c @@ -15,6 +15,8 @@ */ #include +#include +#include #include #include From 7dce21c7d538291ed375abb3c16437b62756b3ec Mon Sep 17 00:00:00 2001 From: pstef <3462925+pstef@users.noreply.github.com> Date: Sun, 6 Apr 2025 11:17:12 +0000 Subject: [PATCH 4/5] Copy quiet compilation mode from other Makefiles --- Makefile.wii | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile.wii b/Makefile.wii index 3f702da3df..072282ca5e 100644 --- a/Makefile.wii +++ b/Makefile.wii @@ -265,6 +265,10 @@ ifeq ($(LOAD_WITHOUT_CORE_INFO),1) CFLAGS += -DLOAD_WITHOUT_CORE_INFO endif +ifneq ($(V),1) + Q := @ +endif + OBJOUT = -o LINKOUT = -o LINK = $(CXX) @@ -278,7 +282,8 @@ $(EXT_INTER_TARGET): $(OBJ) $(LINK) $(LINKOUT)$@ $(LDFLAGS) $(LIBDIRS) $(OBJ) $(PLATEXTRA) $(LIBS) %.o: %.c - $(CC) $(CFLAGS) -c $(OBJOUT)$@ $< + @$(if $(Q), $(shell echo echo CC $<),) + $(Q)$(CC) $(CFLAGS) -c $(OBJOUT)$@ $< %.o: %.cpp $(CXX) $(CFLAGS) -c $(OBJOUT)$@ $< From 6f95b974bab3520bfe24a01596c68621747d527e Mon Sep 17 00:00:00 2001 From: pstef <3462925+pstef@users.noreply.github.com> Date: Sun, 6 Apr 2025 13:09:34 +0000 Subject: [PATCH 5/5] Bring in changes for GEKKO from upstream --- deps/rcheevos/src/rc_compat.c | 10 ++++++---- deps/rcheevos/src/rc_compat.h | 5 +++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/deps/rcheevos/src/rc_compat.c b/deps/rcheevos/src/rc_compat.c index e3e6371605..80044d37de 100644 --- a/deps/rcheevos/src/rc_compat.c +++ b/deps/rcheevos/src/rc_compat.c @@ -120,22 +120,24 @@ void rc_mutex_unlock(rc_mutex_t* mutex) void rc_mutex_init(rc_mutex_t* mutex) { - LWP_MutexInit(mutex, NULL); + /* LWP_MutexInit has the handle passed by reference */ + /* Other LWP_Mutex* calls have the handle passed by value */ + LWP_MutexInit(&mutex->handle, 1); } void rc_mutex_destroy(rc_mutex_t* mutex) { - LWP_MutexDestroy(mutex); + LWP_MutexDestroy(mutex->handle); } void rc_mutex_lock(rc_mutex_t* mutex) { - LWP_MutexLock(mutex); + LWP_MutexLock(mutex->handle); } void rc_mutex_unlock(rc_mutex_t* mutex) { - LWP_MutexUnlock(mutex); + LWP_MutexUnlock(mutex->handle); } #elif defined(_3DS) diff --git a/deps/rcheevos/src/rc_compat.h b/deps/rcheevos/src/rc_compat.h index 9d44f2828e..614d1bc273 100644 --- a/deps/rcheevos/src/rc_compat.h +++ b/deps/rcheevos/src/rc_compat.h @@ -81,6 +81,11 @@ RC_BEGIN_C_DECLS typedef struct rc_mutex_t { void* handle; /* HANDLE is defined as "void*" */ } rc_mutex_t; + #elif defined(GEKKO) + #include + typedef struct rc_mutex_t { + mutex_t handle; + } rc_mutex_t; #elif defined(_3DS) #include <3ds/synchronization.h> typedef RecursiveLock rc_mutex_t;