diff --git a/src/wrapped32/generated/functions_list.txt b/src/wrapped32/generated/functions_list.txt index e1b0e77b3..3dab4f72c 100644 --- a/src/wrapped32/generated/functions_list.txt +++ b/src/wrapped32/generated/functions_list.txt @@ -195,6 +195,7 @@ #() cFpp -> cFpp #() wFpi -> wFpi #() iEEv -> iEEv +#() iFEv -> iFEv #() iEEi -> iEEi #() iEEL -> iEEL #() iEEp -> iEEp @@ -2871,6 +2872,8 @@ wrappedsdl2: % J SDL2_GUID_t uuuu - vFp: - SDL_FreeSurface +- iFv: + - SDL_GetCPUCount - iFp: - SDL_PollEvent - SDL_PushEvent diff --git a/src/wrapped32/generated/wrappedsdl2types32.h b/src/wrapped32/generated/wrappedsdl2types32.h index 8eb57d36d..083578ee9 100644 --- a/src/wrapped32/generated/wrappedsdl2types32.h +++ b/src/wrapped32/generated/wrappedsdl2types32.h @@ -12,6 +12,7 @@ #endif typedef void (*vFp_t)(void*); +typedef int32_t (*iFv_t)(void); typedef int32_t (*iFp_t)(void*); typedef int64_t (*IFp_t)(void*); typedef uint32_t (*uFp_t)(void*); @@ -52,6 +53,7 @@ typedef void* (*pFpiiiiuuuu_t)(void*, int32_t, int32_t, int32_t, int32_t, uint32 #define SUPER() ADDED_FUNCTIONS() \ GO(SDL_FreeSurface, vFp_t) \ + GO(SDL_GetCPUCount, iFv_t) \ GO(SDL_PollEvent, iFp_t) \ GO(SDL_PushEvent, iFp_t) \ GO(SDL_RWclose, iFp_t) \ diff --git a/src/wrapped32/generated/wrapper32.c b/src/wrapped32/generated/wrapper32.c index 6434a3715..a65b5cc47 100644 --- a/src/wrapped32/generated/wrapper32.c +++ b/src/wrapped32/generated/wrapper32.c @@ -289,6 +289,7 @@ typedef void (*vFnp_t)(void*, void*); typedef int8_t (*cFpp_t)(void*, void*); typedef int16_t (*wFpi_t)(void*, int32_t); typedef int32_t (*iEEv_t)(x64emu_t*); +typedef int32_t (*iFEv_t)(x64emu_t*); typedef int32_t (*iEEi_t)(x64emu_t*, int32_t); typedef int32_t (*iEEL_t)(x64emu_t*, uintptr_t); typedef int32_t (*iEEp_t)(x64emu_t*, void*); @@ -2096,6 +2097,7 @@ void vFnp_32(x64emu_t *emu, uintptr_t fcn) { vFnp_t fn = (vFnp_t)fcn; void *alig void cFpp_32(x64emu_t *emu, uintptr_t fcn) { cFpp_t fn = (cFpp_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8)); } void wFpi_32(x64emu_t *emu, uintptr_t fcn) { wFpi_t fn = (wFpi_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8)); } void iEEv_32(x64emu_t *emu, uintptr_t fcn) { iEEv_t fn = (iEEv_t)fcn; errno = emu->libc_err; R_EAX = fn(emu); emu->libc_err = errno; } +void iFEv_32(x64emu_t *emu, uintptr_t fcn) { iFEv_t fn = (iFEv_t)fcn; R_EAX = fn(emu); } void iEEi_32(x64emu_t *emu, uintptr_t fcn) { iEEi_t fn = (iEEi_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptri(int32_t, R_ESP + 4)); emu->libc_err = errno; } void iEEL_32(x64emu_t *emu, uintptr_t fcn) { iEEL_t fn = (iEEL_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ulong(from_ptri(ulong_t, R_ESP + 4))); emu->libc_err = errno; } void iEEp_32(x64emu_t *emu, uintptr_t fcn) { iEEp_t fn = (iEEp_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptriv(R_ESP + 4)); emu->libc_err = errno; } diff --git a/src/wrapped32/generated/wrapper32.h b/src/wrapped32/generated/wrapper32.h index d6d068cd3..926241f3f 100644 --- a/src/wrapped32/generated/wrapper32.h +++ b/src/wrapped32/generated/wrapper32.h @@ -236,6 +236,7 @@ void vFnp_32(x64emu_t *emu, uintptr_t fnc); void cFpp_32(x64emu_t *emu, uintptr_t fnc); void wFpi_32(x64emu_t *emu, uintptr_t fnc); void iEEv_32(x64emu_t *emu, uintptr_t fnc); +void iFEv_32(x64emu_t *emu, uintptr_t fnc); void iEEi_32(x64emu_t *emu, uintptr_t fnc); void iEEL_32(x64emu_t *emu, uintptr_t fnc); void iEEp_32(x64emu_t *emu, uintptr_t fnc); diff --git a/src/wrapped32/wrappedsdl2.c b/src/wrapped32/wrappedsdl2.c index e1fdc4389..3b0434313 100644 --- a/src/wrapped32/wrappedsdl2.c +++ b/src/wrapped32/wrappedsdl2.c @@ -780,6 +780,16 @@ EXPORT unsigned long my32_2_SDL_GetThreadID(x64emu_t* emu, void* thread) return ret; } +EXPORT int my32_2_SDL_GetCPUCount(x64emu_t* emu) +{ + int ret = my->SDL_GetCPUCount(); + if(box64_maxcpu && ret>box64_maxcpu) + ret = box64_maxcpu; + return ret; +} + + + #define ALTMY my32_2_ #define CUSTOM_INIT \ diff --git a/src/wrapped32/wrappedsdl2_private.h b/src/wrapped32/wrappedsdl2_private.h index c9f6fb12a..6ba5533fd 100644 --- a/src/wrapped32/wrappedsdl2_private.h +++ b/src/wrapped32/wrappedsdl2_private.h @@ -189,7 +189,7 @@ GO(SDL_GetClipboardText, pFv) GOM(SDL_GetClosestDisplayMode, pFipp) //%noE //GO(SDL_GetColorKey, iFpp) GO(SDL_GetCPUCacheLineSize, iFv) -GO(SDL_GetCPUCount, iFv) +GOM(SDL_GetCPUCount, iFEv) GO(SDL_GetCurrentAudioDriver, pFv) GOM(SDL_GetCurrentDisplayMode, iFip) //%noE GO(SDL_GetCurrentVideoDriver, pFv)