Enable cheevos for Wii builds (#16116)

* Fixed libogc error codes interpretation for sockets

* Added thread code for libogc rc_compat

* Enabled cheevos for Wii
This commit is contained in:
Rafael Sá Menezes 2024-01-14 02:47:28 +00:00 committed by GitHub
parent eb76f00c7a
commit 340f733488
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 2 deletions

View File

@ -162,8 +162,9 @@ HAVE_XMB := 0
HAVE_OZONE := 0
HAVE_RGUI := 1
HAVE_MATERIALUI := 0
HAVE_CHEEVOS := 1
CFLAGS += -DHAVE_SOCKET_LEGACY
CFLAGS += -DHAVE_SOCKET_LEGACY -DHAVE_CHEEVOS
APP_BOOTER_DIR = wii/app_booter
PLATOBJS := $(APP_BOOTER_DIR)/app_booter.binobj
@ -174,6 +175,7 @@ endif
INCLUDE += -I./libretro-common/include \
-Ideps \
-Ideps/rcheevos/include \
-Ideps/stb
CFLAGS += -Wall -std=gnu99 $(MACHDEP) $(PLATCFLAGS) $(INCLUDE)

View File

@ -85,7 +85,8 @@ struct tm* rc_gmtime_s(struct tm* buf, const time_t* timer)
#endif
#ifndef RC_NO_THREADS
#ifdef _WIN32
#if defined(_WIN32)
/* https://gist.github.com/roxlu/1c1af99f92bafff9d8d9 */
@ -113,6 +114,28 @@ void rc_mutex_unlock(rc_mutex_t* mutex)
ReleaseMutex(mutex->handle);
}
#elif defined(GEKKO)
void rc_mutex_init(rc_mutex_t *mutex)
{
LWP_MutexInit(mutex, NULL);
}
void rc_mutex_destroy(rc_mutex_t* mutex)
{
LWP_MutexDestroy(mutex);
}
void rc_mutex_lock(rc_mutex_t* mutex)
{
LWP_MutexLock(mutex);
}
void rc_mutex_unlock(rc_mutex_t* mutex)
{
LWP_MutexUnlock(mutex);
}
#else
void rc_mutex_init(rc_mutex_t* mutex)

View File

@ -352,6 +352,8 @@ static INLINE bool isagain(int val)
return (val == SCE_NET_ERROR_EAGAIN) || (val == SCE_NET_ERROR_EWOULDBLOCK);
#elif defined(WIIU)
return (val == -1) && (socketlasterr() == SO_SUCCESS || socketlasterr() == SO_EWOULDBLOCK);
#elif defined(GEKKO)
return (-val == EAGAIN);
#else
return (val < 0) && (errno == EAGAIN || errno == EWOULDBLOCK);
#endif
@ -367,6 +369,8 @@ static INLINE bool isinprogress(int val)
return (val == SCE_NET_ERROR_EINPROGRESS);
#elif defined(WIIU)
return (val == -1) && (socketlasterr() == SO_EINPROGRESS);
#elif defined(GEKKO)
return (-val == EINPROGRESS);
#else
return (val < 0) && (errno == EINPROGRESS);
#endif