Added some SDL2 and libc wrapped lib stuff (and now Torchlight2 boots)

This commit is contained in:
ptitSeb 2019-12-03 08:47:13 +01:00
parent 36dc893334
commit 53b56ba123
5 changed files with 14 additions and 5 deletions

View File

@ -360,6 +360,7 @@ typedef int32_t (*iFiiiu_t)(int32_t, int32_t, int32_t, uint32_t);
typedef int32_t (*iFiiip_t)(int32_t, int32_t, int32_t, void*);
typedef int32_t (*iFiipi_t)(int32_t, int32_t, void*, int32_t);
typedef int32_t (*iFiipu_t)(int32_t, int32_t, void*, uint32_t);
typedef int32_t (*iFiipp_t)(int32_t, int32_t, void*, void*);
typedef int32_t (*iFiuii_t)(int32_t, uint32_t, int32_t, int32_t);
typedef int32_t (*iFiuui_t)(int32_t, uint32_t, uint32_t, int32_t);
typedef int32_t (*iFiupp_t)(int32_t, uint32_t, void*, void*);
@ -1291,6 +1292,7 @@ void iFiiiu(x86emu_t *emu, uintptr_t fcn) { iFiiiu_t fn = (iFiiiu_t)fcn; R_EAX=f
void iFiiip(x86emu_t *emu, uintptr_t fcn) { iFiiip_t fn = (iFiiip_t)fcn; R_EAX=fn(*(int32_t*)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(void**)(R_ESP + 16)); }
void iFiipi(x86emu_t *emu, uintptr_t fcn) { iFiipi_t fn = (iFiipi_t)fcn; R_EAX=fn(*(int32_t*)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(void**)(R_ESP + 12), *(int32_t*)(R_ESP + 16)); }
void iFiipu(x86emu_t *emu, uintptr_t fcn) { iFiipu_t fn = (iFiipu_t)fcn; R_EAX=fn(*(int32_t*)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(void**)(R_ESP + 12), *(uint32_t*)(R_ESP + 16)); }
void iFiipp(x86emu_t *emu, uintptr_t fcn) { iFiipp_t fn = (iFiipp_t)fcn; R_EAX=fn(*(int32_t*)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16)); }
void iFiuii(x86emu_t *emu, uintptr_t fcn) { iFiuii_t fn = (iFiuii_t)fcn; R_EAX=fn(*(int32_t*)(R_ESP + 4), *(uint32_t*)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16)); }
void iFiuui(x86emu_t *emu, uintptr_t fcn) { iFiuui_t fn = (iFiuui_t)fcn; R_EAX=fn(*(int32_t*)(R_ESP + 4), *(uint32_t*)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16)); }
void iFiupp(x86emu_t *emu, uintptr_t fcn) { iFiupp_t fn = (iFiupp_t)fcn; R_EAX=fn(*(int32_t*)(R_ESP + 4), *(uint32_t*)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16)); }

View File

@ -356,6 +356,7 @@ void iFiiiu(x86emu_t *emu, uintptr_t fnc);
void iFiiip(x86emu_t *emu, uintptr_t fnc);
void iFiipi(x86emu_t *emu, uintptr_t fnc);
void iFiipu(x86emu_t *emu, uintptr_t fnc);
void iFiipp(x86emu_t *emu, uintptr_t fnc);
void iFiuii(x86emu_t *emu, uintptr_t fnc);
void iFiuui(x86emu_t *emu, uintptr_t fnc);
void iFiupp(x86emu_t *emu, uintptr_t fnc);

View File

@ -1781,9 +1781,9 @@ GOW(textdomain, pFp)
GO(time, uFp)
GO(timegm, uFp)
// timelocal // Weak
// timerfd_create
// timerfd_gettime
// timerfd_settime
GO(timerfd_create, iFii)
GO(timerfd_gettime, iFip)
GO(timerfd_settime, iFiipp)
GOW(times, iFp)
DATAV(timezone, 4)
DATAB(__timezone, 4) // type B

View File

@ -924,7 +924,13 @@ const char* sdl2Name = "libSDL2-2.0.so.0";
lib->priv.w.p2 = getSDL2My(lib); \
box86->sdl2allocrw = ((sdl2_my_t*)lib->priv.w.p2)->SDL_AllocRW; \
box86->sdl2freerw = ((sdl2_my_t*)lib->priv.w.p2)->SDL_FreeRW; \
lib->altmy = strdup("my2_");
lib->altmy = strdup("my2_"); \
lib->priv.w.needed = 4; \
lib->priv.w.neededlibs = (char**)calloc(lib->priv.w.needed, sizeof(char*)); \
lib->priv.w.neededlibs[0] = strdup("libdl.so.2"); \
lib->priv.w.neededlibs[1] = strdup("libm.so.6"); \
lib->priv.w.neededlibs[2] = strdup("librt.so.1"); \
lib->priv.w.neededlibs[3] = strdup("libpthread.so.0");
#define CUSTOM_FINI \
freeSDL2My(lib->priv.w.p2); \

View File

@ -589,7 +589,7 @@ GOM(SDL_snprintf, iFEpupVV)
GO(SDL_SoftStretch, iFpppp)
GO(SDL_sqrt, dFd)
GO(SDL_sqrtf, fFf)
// SDL_sscanf
GO2(SDL_sscanf, iFppV, SDL_vsscanf)
GO(SDL_StartTextInput, vFv)
GO(SDL_StopTextInput, vFv)
GO(SDL_strcasecmp, iFpp)