diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2024-09-24 14:13:33 +0200 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2024-09-24 14:13:45 +0200 |
| commit | 4299e0a3a3b0eba117ad83c8504cec7d8c0a64ce (patch) | |
| tree | def202c91541ad69d2651072dec238341bf0ccd9 /src | |
| parent | c4af15c2e210a91a30c974901468650533918d39 (diff) | |
| download | box64-4299e0a3a3b0eba117ad83c8504cec7d8c0a64ce.tar.gz box64-4299e0a3a3b0eba117ad83c8504cec7d8c0a64ce.zip | |
[BOX32][WRAPPER] Added more 32bits wrapped functions
Diffstat (limited to 'src')
| -rw-r--r-- | src/include/sdl1align32.h | 32 | ||||
| -rw-r--r-- | src/libtools/sdl1align32.c | 113 | ||||
| -rw-r--r-- | src/libtools/sdl1rwops.c | 52 | ||||
| -rw-r--r-- | src/wrapped32/generated/functions_list.txt | 25 | ||||
| -rw-r--r-- | src/wrapped32/generated/wrappedsdl1types32.h | 17 | ||||
| -rw-r--r-- | src/wrapped32/generated/wrapper32.c | 20 | ||||
| -rw-r--r-- | src/wrapped32/generated/wrapper32.h | 10 | ||||
| -rw-r--r-- | src/wrapped32/wrappedfreetype_private.h | 8 | ||||
| -rwxr-xr-x | src/wrapped32/wrappedlibc_private.h | 2 | ||||
| -rw-r--r-- | src/wrapped32/wrappedsdl1.c | 90 | ||||
| -rw-r--r-- | src/wrapped32/wrappedsdl1_private.h | 22 |
11 files changed, 350 insertions, 41 deletions
diff --git a/src/include/sdl1align32.h b/src/include/sdl1align32.h index c7e8c1f2..66153621 100644 --- a/src/include/sdl1align32.h +++ b/src/include/sdl1align32.h @@ -495,6 +495,7 @@ typedef union my_SDL_Event_32_s void convert_SDL_Event_to_32(void* dst, const void* src); +void convert_SDL_Event_to_64(void* dst, const void* src); // simplified RWops typedef struct my_SDL_RWops_s { @@ -556,4 +557,35 @@ typedef struct my_SDL_VideoInfo_32_s { int current_h; } my_SDL_VideoInfo_32_t; +typedef struct my_SDL_AudioCVT_s { + int needed; + uint16_t src_format; + uint16_t dest_format; + double rate_incr; + uint8_t *buf; + int len; + int len_cvt; + int len_mult; + double len_ratio; + void (*filters[10])(struct my_SDL_AudioCVT_s *cvt, uint16_t format); + int filter_index; +} my_SDL_AudioCVT_t; + +typedef struct my_SDL_AudioCVT_32_s { + int needed; + uint16_t src_format; + uint16_t dest_format; + double rate_incr; + ptr_t buf; //uint8_t * + int len; + int len_cvt; + int len_mult; + double len_ratio; + ptr_t filters[10]; //void (*filters[10])(struct my_SDL_AudioCVT_s *cvt, uint16_t format); + int filter_index; +} my_SDL_AudioCVT_32_t; + +void convert_AudioCVT_to_32(void* d, void* s); +void convert_AudioCVT_to_64(void* d, void* s); + #endif//__MY_SDL1ALIGN32_H_ \ No newline at end of file diff --git a/src/libtools/sdl1align32.c b/src/libtools/sdl1align32.c index cb0b8176..c9c68a8a 100644 --- a/src/libtools/sdl1align32.c +++ b/src/libtools/sdl1align32.c @@ -170,6 +170,84 @@ void convert_SDL_Event_to_32(void* dst_, const void* src_) memcpy(dst, src, sizeof(my_SDL_Event_32_t)); } } +void convert_SDL_Event_to_64(void* dst_, const void* src_) +{ + if(!src_|| !dst_) return; + const my_SDL_Event_32_t *src = src_; + my_SDL_Event_t* dst = dst_; + dst->type = src->type; + switch(src->type) { + case SDL_ACTIVEEVENT: + dst->active.gain = src->active.gain; + dst->active.state = src->active.state; + break; + case SDL_KEYUP: + case SDL_KEYDOWN: + dst->key.keysym.mod = src->key.keysym.mod; + dst->key.keysym.scancode = src->key.keysym.scancode; + dst->key.keysym.sym = src->key.keysym.sym; + dst->key.keysym.unicode = src->key.keysym.unicode; + dst->key.state = src->key.state; + dst->key.which = dst->key.which; + break; + case SDL_MOUSEMOTION: + dst->motion.state = src->motion.state; + dst->motion.which = src->motion.which; + dst->motion.x = src->motion.x; + dst->motion.y = src->motion.y; + dst->motion.xrel = src->motion.xrel; + dst->motion.yrel = src->motion.yrel; + break; + case SDL_MOUSEBUTTONUP: + case SDL_MOUSEBUTTONDOWN: + dst->button.button = src->button.button; + dst->button.state = src->button.state; + dst->button.which = src->button.which; + dst->button.x = src->button.x; + dst->button.y = src->button.y; + break; + case SDL_JOYAXISMOTION: + dst->jaxis.axis = src->jaxis.axis; + dst->jaxis.value = src->jaxis.value; + dst->jaxis.which = src->jaxis.which; + break; + case SDL_JOYBALLMOTION: + dst->jball.ball = src->jball.ball; + dst->jball.which = src->jball.which; + dst->jball.xrel = src->jball.xrel; + dst->jball.yrel = src->jball.yrel; + break; + case SDL_JOYHATMOTION: + dst->jhat.hat = src->jhat.hat; + dst->jhat.value = src->jhat.value; + dst->jhat.which = src->jhat.which; + break; + case SDL_JOYBUTTONUP: + case SDL_JOYBUTTONDOWN: + dst->jbutton.button = src->jbutton.button; + dst->jbutton.state = src->jbutton.state; + dst->jbutton.which = src->jbutton.which; + break; + case SDL_VIDEORESIZE: + dst->resize.h = src->resize.h; + dst->resize.w = src->resize.w; + break; + case SDL_VIDEOEXPOSE: + case SDL_QUIT: + break; + case SDL_USEREVENT: + dst->user.code = src->user.code; + dst->user.data1 = from_ptrv(src->user.data1); + dst->user.data2 = from_ptrv(src->user.data2); + case SDL_SYSWMEVENT: + printf_log(LOG_NONE, "TODO: Convert SDL_SYSWMEVENT\n"); + abort(); + break; + default: + printf_log(LOG_INFO, "Warning, unsuported SDL1.2 (un)event %d\n", src->type); + memcpy(dst, src, sizeof(my_SDL_Event_32_t)); + } +} void inplace_SDL_RWops_to_64(void* a) { @@ -196,3 +274,38 @@ void inplace_SDL_RWops_to_32(void* a) dst->type = src->type; memmove(&dst->hidden, &src->hidden, sizeof(dst->hidden)); } + +void convert_AudioCVT_to_32(void* d, void* s) +{ + my_SDL_AudioCVT_32_t* dst = d; + my_SDL_AudioCVT_t* src = s; + dst->needed = src->needed; + dst->src_format = src->src_format; + dst->dest_format = src->dest_format; + dst->rate_incr = src->rate_incr; + dst->buf = to_ptrv(src->buf); + dst->len = src->len; + dst->len_cvt = src->len_cvt; + dst->len_mult = src->len_mult; + dst->len_ratio = src->len_ratio; + for(int i=0; i<10; ++i) + dst->filters[i] = to_ptrv(src->filters[i]); + dst->filter_index = src->filter_index; +} +void convert_AudioCVT_to_64(void* d, void* s) +{ + my_SDL_AudioCVT_t* dst = d; + my_SDL_AudioCVT_32_t* src = s; + dst->needed = src->needed; + dst->src_format = src->src_format; + dst->dest_format = src->dest_format; + dst->rate_incr = src->rate_incr; + dst->buf = from_ptrv(src->buf); + dst->len = src->len; + dst->len_cvt = src->len_cvt; + dst->len_mult = src->len_mult; + dst->len_ratio = src->len_ratio; + for(int i=0; i<10; ++i) + dst->filters[i] = from_ptrv(src->filters[i]); + dst->filter_index = src->filter_index; +} diff --git a/src/libtools/sdl1rwops.c b/src/libtools/sdl1rwops.c index ec3f8abd..edb900ce 100644 --- a/src/libtools/sdl1rwops.c +++ b/src/libtools/sdl1rwops.c @@ -6,6 +6,10 @@ #include "sdl1rwops.h" #include "debug.h" #include "wrapper.h" +#ifdef BOX32 +#include "wrapper32.h" +#include "sdl1align32.h" +#endif #include "box64context.h" #include "x64run.h" #include "x64emu.h" @@ -54,18 +58,47 @@ typedef struct SDL1_RWops_s { EXPORT int32_t my_native_seek(SDL1_RWops_t *context, int32_t offset, int32_t whence) { + #ifdef BOX32 + if(box64_is32bits) { + inplace_SDL_RWops_to_64(context); + int ret = context->hidden.my.orig->seek(context->hidden.my.orig, offset, whence); + inplace_SDL_RWops_to_32(context); + return ret; + } + #endif return context->hidden.my.orig->seek(context->hidden.my.orig, offset, whence); } EXPORT int32_t my_native_read(SDL1_RWops_t *context, void *ptr, int32_t size, int32_t maxnum) { + #ifdef BOX32 + if(box64_is32bits) { + inplace_SDL_RWops_to_64(context); + int ret = context->hidden.my.orig->read(context->hidden.my.orig, ptr, size, maxnum); + inplace_SDL_RWops_to_32(context); + return ret; + } + #endif return context->hidden.my.orig->read(context->hidden.my.orig, ptr, size, maxnum); } EXPORT int32_t my_native_write(SDL1_RWops_t *context, const void *ptr, int32_t size, int32_t num) { + #ifdef BOX32 + if(box64_is32bits) { + inplace_SDL_RWops_to_64(context); + int ret = context->hidden.my.orig->write(context->hidden.my.orig, ptr, size, num); + inplace_SDL_RWops_to_32(context); + return ret; + } + #endif return context->hidden.my.orig->write(context->hidden.my.orig, ptr, size, num); } EXPORT int32_t my_native_close(SDL1_RWops_t *context) { + #ifdef BOX32 + if(box64_is32bits) { + inplace_SDL_RWops_to_64(context); + } + #endif int32_t ret = context->hidden.my.orig->close(context->hidden.my.orig); context->hidden.my.custom_free(context); return ret; @@ -109,10 +142,21 @@ SDL1_RWops_t* AddNativeRW(x64emu_t* emu, SDL1_RWops_t* ops) fnc = AddCheckBridge(system, W, my_native_##A, 0, NULL); \ newrw->A = (sdl1_##A)fnc; - GO(seek, iFpii) - GO(read, iFppii) - GO(write, iFppii) - GO(close, iFp) + #ifdef BOX32 + if(box64_is32bits) + { + GO(seek, iFpii_32) + GO(read, iFppii_32) + GO(write, iFppii_32) + GO(close, iFp_32) + } else + #endif + { + GO(seek, iFpii) + GO(read, iFppii) + GO(write, iFppii) + GO(close, iFp) + } #undef GO diff --git a/src/wrapped32/generated/functions_list.txt b/src/wrapped32/generated/functions_list.txt index 55b7693b..c58cdc05 100644 --- a/src/wrapped32/generated/functions_list.txt +++ b/src/wrapped32/generated/functions_list.txt @@ -153,6 +153,7 @@ #() CFpi -> CFpi #() CFpp -> CFpp #() uFEu -> uFEu +#() uFEp -> uFEp #() uFEV -> uFEV #() uFuu -> uFuu #() uFup -> uFup @@ -281,6 +282,7 @@ #() vFXLp -> vFXLp #() vFXpi -> vFXpi #() iFEip -> iFEip +#() iFEup -> iFEup #() iFEpi -> iFEpi #() iFEpL -> iFEpL #() iFEpp -> iFEpp @@ -311,6 +313,7 @@ #() iFpii -> iFpii #() iFpiu -> iFpiu #() iFpip -> iFpip +#() iFpui -> iFpui #() iFpuC -> iFpuC #() iFpuu -> iFpuu #() iFpuU -> iFpuU @@ -477,6 +480,7 @@ #() vFpddd -> vFpddd #() vFplpp -> vFplpp #() vFppip -> vFppip +#() vFppui -> vFppui #() vFpppp -> vFpppp #() vFXiiL -> vFXiiL #() vFXLpL -> vFXLpL @@ -524,6 +528,7 @@ #() iFXppp -> iFXppp #() CFuuff -> CFuuff #() uFuuuu -> uFuuuu +#() uFpCCC -> uFpCCC #() lFEipi -> lFEipi #() lFiipL -> lFiipL #() lFipLi -> lFipLi @@ -533,6 +538,7 @@ #() LFppLp -> LFppLp #() LFppLa -> LFppLa #() LFXLpi -> LFXLpi +#() pFEupp -> pFEupp #() pFEppi -> pFEppi #() pFEppp -> pFEppp #() pFiiiu -> pFiiiu @@ -549,6 +555,7 @@ #() pFXLLp -> pFXLLp #() pFXppi -> pFXppi #() pFXppp -> pFXppp +#() iFpplBp_ -> iFpplB #() iFppbp_p -> iFppBp #() iFBp_pui -> iFBpui #() IFpBp_ii -> IFpBii @@ -665,6 +672,7 @@ #() iFiiipp -> iFiiipp #() iFiLLLL -> iFiLLLL #() iFipLLi -> iFipLLi +#() iFplluu -> iFplluu #() iFpLuLi -> iFpLuLi #() iFpppip -> iFpppip #() iFpppup -> iFpppup @@ -754,6 +762,7 @@ #() vFpipipV -> vFpipipV #() vFpdddii -> vFpdddii #() vFppupii -> vFppupii +#() vFpppppp -> vFpppppp #() iFEuppup -> iFEuppup #() iFEuppLp -> iFEuppLp #() iFEpiLpp -> iFEpiLpp @@ -825,6 +834,7 @@ #() vFpddiidd -> vFpddiidd #() iFEpLiipV -> iFEpLiipV #() iFuiiiuup -> iFuiiiuup +#() iFpWCiWCi -> iFpWCiWCi #() iFpupLpLi -> iFpupLpLi #() iFXiuLiii -> iFXiuLiii #() uFuippppp -> uFuippppp @@ -1422,9 +1432,14 @@ wrappedsdl1: - SDL_HasSSE - SDL_HasSSE2 - iFp: + - SDL_ConvertAudio - SDL_Flip - SDL_LockSurface - SDL_PollEvent + - SDL_PushEvent + - SDL_RemoveTimer +- uFp: + - SDL_ReadLE32 - pFv: - SDL_GetVideoInfo - SDL_GetVideoSurface @@ -1433,6 +1448,8 @@ wrappedsdl1: - SDL_LoadObject - vFpp: - SDL_WM_SetIcon +- iFup: + - SDL_SetTimer - iFpp: - SDL_OpenAudio - pFpi: @@ -1444,7 +1461,15 @@ wrappedsdl1: - SDL_CreateThread - SDL_LoadFunction - SDL_RWFromFile +- iFpuu: + - SDL_SetColorKey +- pFupp: + - SDL_AddTimer +- uFpCCC: + - SDL_MapRGB - pFiiiu: - SDL_SetVideoMode - vFupppp: - SDL_GetRGB +- iFpWCiWCi: + - SDL_BuildAudioCVT diff --git a/src/wrapped32/generated/wrappedsdl1types32.h b/src/wrapped32/generated/wrappedsdl1types32.h index ad47d0a5..97f17cf8 100644 --- a/src/wrapped32/generated/wrappedsdl1types32.h +++ b/src/wrapped32/generated/wrappedsdl1types32.h @@ -15,15 +15,21 @@ typedef void (*vFv_t)(void); typedef void (*vFp_t)(void*); typedef int32_t (*iFv_t)(void); typedef int32_t (*iFp_t)(void*); +typedef uint32_t (*uFp_t)(void*); typedef void* (*pFv_t)(void); typedef void* (*pFp_t)(void*); typedef void (*vFpp_t)(void*, void*); +typedef int32_t (*iFup_t)(uint32_t, void*); typedef int32_t (*iFpp_t)(void*, void*); typedef void* (*pFpi_t)(void*, int32_t); typedef void* (*pFpu_t)(void*, uint32_t); typedef void* (*pFpp_t)(void*, void*); +typedef int32_t (*iFpuu_t)(void*, uint32_t, uint32_t); +typedef void* (*pFupp_t)(uint32_t, void*, void*); +typedef uint32_t (*uFpCCC_t)(void*, uint8_t, uint8_t, uint8_t); typedef void* (*pFiiiu_t)(int32_t, int32_t, int32_t, uint32_t); typedef void (*vFupppp_t)(uint32_t, void*, void*, void*, void*); +typedef int32_t (*iFpWCiWCi_t)(void*, uint16_t, uint8_t, int32_t, uint16_t, uint8_t, int32_t); #define SUPER() ADDED_FUNCTIONS() \ GO(SDL_Quit, vFv_t) \ @@ -38,14 +44,19 @@ typedef void (*vFupppp_t)(uint32_t, void*, void*, void*, void*); GO(SDL_HasRDTSC, iFv_t) \ GO(SDL_HasSSE, iFv_t) \ GO(SDL_HasSSE2, iFv_t) \ + GO(SDL_ConvertAudio, iFp_t) \ GO(SDL_Flip, iFp_t) \ GO(SDL_LockSurface, iFp_t) \ GO(SDL_PollEvent, iFp_t) \ + GO(SDL_PushEvent, iFp_t) \ + GO(SDL_RemoveTimer, iFp_t) \ + GO(SDL_ReadLE32, uFp_t) \ GO(SDL_GetVideoInfo, pFv_t) \ GO(SDL_GetVideoSurface, pFv_t) \ GO(SDL_GL_GetProcAddress, pFp_t) \ GO(SDL_LoadObject, pFp_t) \ GO(SDL_WM_SetIcon, vFpp_t) \ + GO(SDL_SetTimer, iFup_t) \ GO(SDL_OpenAudio, iFpp_t) \ GO(SDL_LoadBMP_RW, pFpi_t) \ GO(SDL_RWFromMem, pFpi_t) \ @@ -53,7 +64,11 @@ typedef void (*vFupppp_t)(uint32_t, void*, void*, void*, void*); GO(SDL_CreateThread, pFpp_t) \ GO(SDL_LoadFunction, pFpp_t) \ GO(SDL_RWFromFile, pFpp_t) \ + GO(SDL_SetColorKey, iFpuu_t) \ + GO(SDL_AddTimer, pFupp_t) \ + GO(SDL_MapRGB, uFpCCC_t) \ GO(SDL_SetVideoMode, pFiiiu_t) \ - GO(SDL_GetRGB, vFupppp_t) + GO(SDL_GetRGB, vFupppp_t) \ + GO(SDL_BuildAudioCVT, iFpWCiWCi_t) #endif // __wrappedsdl1TYPES32_H_ diff --git a/src/wrapped32/generated/wrapper32.c b/src/wrapped32/generated/wrapper32.c index 1c78b534..fd908410 100644 --- a/src/wrapped32/generated/wrapper32.c +++ b/src/wrapped32/generated/wrapper32.c @@ -242,6 +242,7 @@ typedef uint8_t (*CFuU_t)(uint32_t, uint64_t); typedef uint8_t (*CFpi_t)(void*, int32_t); typedef uint8_t (*CFpp_t)(void*, void*); typedef uint32_t (*uFEu_t)(x64emu_t*, uint32_t); +typedef uint32_t (*uFEp_t)(x64emu_t*, void*); typedef uint32_t (*uFEV_t)(x64emu_t*, void*); typedef uint32_t (*uFuu_t)(uint32_t, uint32_t); typedef uint32_t (*uFup_t)(uint32_t, void*); @@ -370,6 +371,7 @@ typedef void (*vFppp_t)(void*, void*, void*); typedef void (*vFXLp_t)(void*, uintptr_t, void*); typedef void (*vFXpi_t)(void*, void*, int32_t); typedef int32_t (*iFEip_t)(x64emu_t*, int32_t, void*); +typedef int32_t (*iFEup_t)(x64emu_t*, uint32_t, void*); typedef int32_t (*iFEpi_t)(x64emu_t*, void*, int32_t); typedef int32_t (*iFEpL_t)(x64emu_t*, void*, uintptr_t); typedef int32_t (*iFEpp_t)(x64emu_t*, void*, void*); @@ -400,6 +402,7 @@ typedef int32_t (*iFfff_t)(float, float, float); typedef int32_t (*iFpii_t)(void*, int32_t, int32_t); typedef int32_t (*iFpiu_t)(void*, int32_t, uint32_t); typedef int32_t (*iFpip_t)(void*, int32_t, void*); +typedef int32_t (*iFpui_t)(void*, uint32_t, int32_t); typedef int32_t (*iFpuC_t)(void*, uint32_t, uint8_t); typedef int32_t (*iFpuu_t)(void*, uint32_t, uint32_t); typedef int32_t (*iFpuU_t)(void*, uint32_t, uint64_t); @@ -566,6 +569,7 @@ typedef void (*vFpdii_t)(void*, double, int32_t, int32_t); typedef void (*vFpddd_t)(void*, double, double, double); typedef void (*vFplpp_t)(void*, intptr_t, void*, void*); typedef void (*vFppip_t)(void*, void*, int32_t, void*); +typedef void (*vFppui_t)(void*, void*, uint32_t, int32_t); typedef void (*vFpppp_t)(void*, void*, void*, void*); typedef void (*vFXiiL_t)(void*, int32_t, int32_t, uintptr_t); typedef void (*vFXLpL_t)(void*, uintptr_t, void*, uintptr_t); @@ -613,6 +617,7 @@ typedef int32_t (*iFXLii_t)(void*, uintptr_t, int32_t, int32_t); typedef int32_t (*iFXppp_t)(void*, void*, void*, void*); typedef uint8_t (*CFuuff_t)(uint32_t, uint32_t, float, float); typedef uint32_t (*uFuuuu_t)(uint32_t, uint32_t, uint32_t, uint32_t); +typedef uint32_t (*uFpCCC_t)(void*, uint8_t, uint8_t, uint8_t); typedef intptr_t (*lFEipi_t)(x64emu_t*, int32_t, void*, int32_t); typedef intptr_t (*lFiipL_t)(int32_t, int32_t, void*, uintptr_t); typedef intptr_t (*lFipLi_t)(int32_t, void*, uintptr_t, int32_t); @@ -622,6 +627,7 @@ typedef uintptr_t (*LFpLLS_t)(void*, uintptr_t, uintptr_t, void*); typedef uintptr_t (*LFppLp_t)(void*, void*, uintptr_t, void*); typedef uintptr_t (*LFppLa_t)(void*, void*, uintptr_t, void*); typedef uintptr_t (*LFXLpi_t)(void*, uintptr_t, void*, int32_t); +typedef void* (*pFEupp_t)(x64emu_t*, uint32_t, void*, void*); typedef void* (*pFEppi_t)(x64emu_t*, void*, void*, int32_t); typedef void* (*pFEppp_t)(x64emu_t*, void*, void*, void*); typedef void* (*pFiiiu_t)(int32_t, int32_t, int32_t, uint32_t); @@ -638,6 +644,7 @@ typedef void* (*pFXiii_t)(void*, int32_t, int32_t, int32_t); typedef void* (*pFXLLp_t)(void*, uintptr_t, uintptr_t, void*); typedef void* (*pFXppi_t)(void*, void*, void*, int32_t); typedef void* (*pFXppp_t)(void*, void*, void*, void*); +typedef int32_t (*iFpplBp__t)(void*, void*, intptr_t, struct_p_t*); typedef int32_t (*iFppbp_p_t)(void*, void*, struct_p_t*, void*); typedef int32_t (*iFBp_pui_t)(struct_p_t*, void*, uint32_t, int32_t); typedef int64_t (*IFpBp_ii_t)(void*, struct_p_t*, int32_t, int32_t); @@ -754,6 +761,7 @@ typedef int32_t (*iFiiipu_t)(int32_t, int32_t, int32_t, void*, uint32_t); typedef int32_t (*iFiiipp_t)(int32_t, int32_t, int32_t, void*, void*); typedef int32_t (*iFiLLLL_t)(int32_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); typedef int32_t (*iFipLLi_t)(int32_t, void*, uintptr_t, uintptr_t, int32_t); +typedef int32_t (*iFplluu_t)(void*, intptr_t, intptr_t, uint32_t, uint32_t); typedef int32_t (*iFpLuLi_t)(void*, uintptr_t, uint32_t, uintptr_t, int32_t); typedef int32_t (*iFpppip_t)(void*, void*, void*, int32_t, void*); typedef int32_t (*iFpppup_t)(void*, void*, void*, uint32_t, void*); @@ -843,6 +851,7 @@ typedef void (*vFdddddd_t)(double, double, double, double, double, double); typedef void (*vFpipipV_t)(void*, int32_t, void*, int32_t, void*, void*); typedef void (*vFpdddii_t)(void*, double, double, double, int32_t, int32_t); typedef void (*vFppupii_t)(void*, void*, uint32_t, void*, int32_t, int32_t); +typedef void (*vFpppppp_t)(void*, void*, void*, void*, void*, void*); typedef int32_t (*iFEuppup_t)(x64emu_t*, uint32_t, void*, void*, uint32_t, void*); typedef int32_t (*iFEuppLp_t)(x64emu_t*, uint32_t, void*, void*, uintptr_t, void*); typedef int32_t (*iFEpiLpp_t)(x64emu_t*, void*, int32_t, uintptr_t, void*, void*); @@ -914,6 +923,7 @@ typedef void (*vFpipipiu_t)(void*, int32_t, void*, int32_t, void*, int32_t, uint typedef void (*vFpddiidd_t)(void*, double, double, int32_t, int32_t, double, double); typedef int32_t (*iFEpLiipV_t)(x64emu_t*, void*, uintptr_t, int32_t, int32_t, void*, void*); typedef int32_t (*iFuiiiuup_t)(uint32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, void*); +typedef int32_t (*iFpWCiWCi_t)(void*, uint16_t, uint8_t, int32_t, uint16_t, uint8_t, int32_t); typedef int32_t (*iFpupLpLi_t)(void*, uint32_t, void*, uintptr_t, void*, uintptr_t, int32_t); typedef int32_t (*iFXiuLiii_t)(void*, int32_t, uint32_t, uintptr_t, int32_t, int32_t, int32_t); typedef uint32_t (*uFuippppp_t)(uint32_t, int32_t, void*, void*, void*, void*, void*); @@ -1221,6 +1231,7 @@ void CFuU_32(x64emu_t *emu, uintptr_t fcn) { CFuU_t fn = (CFuU_t)fcn; R_EAX = (u void CFpi_32(x64emu_t *emu, uintptr_t fcn) { CFpi_t fn = (CFpi_t)fcn; R_EAX = (unsigned char)fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8)); } void CFpp_32(x64emu_t *emu, uintptr_t fcn) { CFpp_t fn = (CFpp_t)fcn; R_EAX = (unsigned char)fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8)); } void uFEu_32(x64emu_t *emu, uintptr_t fcn) { uFEu_t fn = (uFEu_t)fcn; R_EAX = (uint32_t)fn(emu, from_ptri(uint32_t, R_ESP + 4)); } +void uFEp_32(x64emu_t *emu, uintptr_t fcn) { uFEp_t fn = (uFEp_t)fcn; R_EAX = (uint32_t)fn(emu, from_ptriv(R_ESP + 4)); } void uFEV_32(x64emu_t *emu, uintptr_t fcn) { uFEV_t fn = (uFEV_t)fcn; R_EAX = (uint32_t)fn(emu, from_ptrv(R_ESP + 4)); } void uFuu_32(x64emu_t *emu, uintptr_t fcn) { uFuu_t fn = (uFuu_t)fcn; R_EAX = (uint32_t)fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8)); } void uFup_32(x64emu_t *emu, uintptr_t fcn) { uFup_t fn = (uFup_t)fcn; R_EAX = (uint32_t)fn(from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8)); } @@ -1349,6 +1360,7 @@ void vFppp_32(x64emu_t *emu, uintptr_t fcn) { vFppp_t fn = (vFppp_t)fcn; fn(from void vFXLp_32(x64emu_t *emu, uintptr_t fcn) { vFXLp_t fn = (vFXLp_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), to_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12)); } void vFXpi_32(x64emu_t *emu, uintptr_t fcn) { vFXpi_t fn = (vFXpi_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12)); } void iFEip_32(x64emu_t *emu, uintptr_t fcn) { iFEip_t fn = (iFEip_t)fcn; R_EAX = fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8)); } +void iFEup_32(x64emu_t *emu, uintptr_t fcn) { iFEup_t fn = (iFEup_t)fcn; R_EAX = fn(emu, from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8)); } void iFEpi_32(x64emu_t *emu, uintptr_t fcn) { iFEpi_t fn = (iFEpi_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8)); } void iFEpL_32(x64emu_t *emu, uintptr_t fcn) { iFEpL_t fn = (iFEpL_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), to_ulong(from_ptri(ulong_t, R_ESP + 8))); } void iFEpp_32(x64emu_t *emu, uintptr_t fcn) { iFEpp_t fn = (iFEpp_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8)); } @@ -1379,6 +1391,7 @@ void iFfff_32(x64emu_t *emu, uintptr_t fcn) { iFfff_t fn = (iFfff_t)fcn; R_EAX = void iFpii_32(x64emu_t *emu, uintptr_t fcn) { iFpii_t fn = (iFpii_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12)); } void iFpiu_32(x64emu_t *emu, uintptr_t fcn) { iFpiu_t fn = (iFpiu_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12)); } void iFpip_32(x64emu_t *emu, uintptr_t fcn) { iFpip_t fn = (iFpip_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12)); } +void iFpui_32(x64emu_t *emu, uintptr_t fcn) { iFpui_t fn = (iFpui_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12)); } void iFpuC_32(x64emu_t *emu, uintptr_t fcn) { iFpuC_t fn = (iFpuC_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint8_t, R_ESP + 12)); } void iFpuu_32(x64emu_t *emu, uintptr_t fcn) { iFpuu_t fn = (iFpuu_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12)); } void iFpuU_32(x64emu_t *emu, uintptr_t fcn) { iFpuU_t fn = (iFpuU_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint64_t, R_ESP + 12)); } @@ -1545,6 +1558,7 @@ void vFpdii_32(x64emu_t *emu, uintptr_t fcn) { vFpdii_t fn = (vFpdii_t)fcn; fn(f void vFpddd_32(x64emu_t *emu, uintptr_t fcn) { vFpddd_t fn = (vFpddd_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptri(double, R_ESP + 8), from_ptri(double, R_ESP + 16), from_ptri(double, R_ESP + 24)); } void vFplpp_32(x64emu_t *emu, uintptr_t fcn) { vFplpp_t fn = (vFplpp_t)fcn; fn(from_ptriv(R_ESP + 4), to_long(from_ptri(long_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); } void vFppip_32(x64emu_t *emu, uintptr_t fcn) { vFppip_t fn = (vFppip_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); } +void vFppui_32(x64emu_t *emu, uintptr_t fcn) { vFppui_t fn = (vFppui_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); } void vFpppp_32(x64emu_t *emu, uintptr_t fcn) { vFpppp_t fn = (vFpppp_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); } void vFXiiL_32(x64emu_t *emu, uintptr_t fcn) { vFXiiL_t fn = (vFXiiL_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), to_ulong(from_ptri(ulong_t, R_ESP + 16))); } void vFXLpL_32(x64emu_t *emu, uintptr_t fcn) { vFXLpL_t fn = (vFXLpL_t)fcn; fn(getDisplay(from_ptriv(R_ESP + 4)), to_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), to_ulong(from_ptri(ulong_t, R_ESP + 16))); } @@ -1592,6 +1606,7 @@ void iFXLii_32(x64emu_t *emu, uintptr_t fcn) { iFXLii_t fn = (iFXLii_t)fcn; R_EA void iFXppp_32(x64emu_t *emu, uintptr_t fcn) { iFXppp_t fn = (iFXppp_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); } void CFuuff_32(x64emu_t *emu, uintptr_t fcn) { CFuuff_t fn = (CFuuff_t)fcn; R_EAX = (unsigned char)fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(float, R_ESP + 12), from_ptri(float, R_ESP + 16)); } void uFuuuu_32(x64emu_t *emu, uintptr_t fcn) { uFuuuu_t fn = (uFuuuu_t)fcn; R_EAX = (uint32_t)fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16)); } +void uFpCCC_32(x64emu_t *emu, uintptr_t fcn) { uFpCCC_t fn = (uFpCCC_t)fcn; R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), from_ptri(uint8_t, R_ESP + 8), from_ptri(uint8_t, R_ESP + 12), from_ptri(uint8_t, R_ESP + 16)); } void lFEipi_32(x64emu_t *emu, uintptr_t fcn) { lFEipi_t fn = (lFEipi_t)fcn; R_EAX = to_long(fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12))); } void lFiipL_32(x64emu_t *emu, uintptr_t fcn) { lFiipL_t fn = (lFiipL_t)fcn; R_EAX = to_long(fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), to_ulong(from_ptri(ulong_t, R_ESP + 16)))); } void lFipLi_32(x64emu_t *emu, uintptr_t fcn) { lFipLi_t fn = (lFipLi_t)fcn; R_EAX = to_long(fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), to_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptri(int32_t, R_ESP + 16))); } @@ -1601,6 +1616,7 @@ void LFpLLS_32(x64emu_t *emu, uintptr_t fcn) { LFpLLS_t fn = (LFpLLS_t)fcn; R_EA void LFppLp_32(x64emu_t *emu, uintptr_t fcn) { LFppLp_t fn = (LFppLp_t)fcn; R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), to_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptriv(R_ESP + 16))); } void LFppLa_32(x64emu_t *emu, uintptr_t fcn) { LFppLa_t fn = (LFppLa_t)fcn; R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), to_ulong(from_ptri(ulong_t, R_ESP + 12)), from_locale(from_ptri(ptr_t, R_ESP + 16)))); } void LFXLpi_32(x64emu_t *emu, uintptr_t fcn) { LFXLpi_t fn = (LFXLpi_t)fcn; R_EAX = to_ulong(fn(getDisplay(from_ptriv(R_ESP + 4)), to_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16))); } +void pFEupp_32(x64emu_t *emu, uintptr_t fcn) { pFEupp_t fn = (pFEupp_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12))); } void pFEppi_32(x64emu_t *emu, uintptr_t fcn) { pFEppi_t fn = (pFEppi_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12))); } void pFEppp_32(x64emu_t *emu, uintptr_t fcn) { pFEppp_t fn = (pFEppp_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12))); } void pFiiiu_32(x64emu_t *emu, uintptr_t fcn) { pFiiiu_t fn = (pFiiiu_t)fcn; R_EAX = to_ptrv(fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16))); } @@ -1617,6 +1633,7 @@ void pFXiii_32(x64emu_t *emu, uintptr_t fcn) { pFXiii_t fn = (pFXiii_t)fcn; R_EA void pFXLLp_32(x64emu_t *emu, uintptr_t fcn) { pFXLLp_t fn = (pFXLLp_t)fcn; R_EAX = to_ptrv(fn(getDisplay(from_ptriv(R_ESP + 4)), to_ulong(from_ptri(ulong_t, R_ESP + 8)), to_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptriv(R_ESP + 16))); } void pFXppi_32(x64emu_t *emu, uintptr_t fcn) { pFXppi_t fn = (pFXppi_t)fcn; R_EAX = to_ptrv(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16))); } void pFXppp_32(x64emu_t *emu, uintptr_t fcn) { pFXppp_t fn = (pFXppp_t)fcn; R_EAX = to_ptrv(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16))); } +void iFpplBp__32(x64emu_t *emu, uintptr_t fcn) { iFpplBp__t fn = (iFpplBp__t)fcn; struct_p_t arg_16={0}; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), to_long(from_ptri(long_t, R_ESP + 12)), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } void iFppbp_p_32(x64emu_t *emu, uintptr_t fcn) { iFppbp_p_t fn = (iFppbp_p_t)fcn; struct_p_t arg_12={0}; from_struct_p(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, from_ptriv(R_ESP + 16)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); } void iFBp_pui_32(x64emu_t *emu, uintptr_t fcn) { iFBp_pui_t fn = (iFBp_pui_t)fcn; struct_p_t arg_4={0}; R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } void IFpBp_ii_32(x64emu_t *emu, uintptr_t fcn) { IFpBp_ii_t fn = (IFpBp_ii_t)fcn; struct_p_t arg_8={0}; ui64_t r; r.i = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); R_EAX = r.d[0]; R_EDX = r.d[1]; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } @@ -1733,6 +1750,7 @@ void iFiiipu_32(x64emu_t *emu, uintptr_t fcn) { iFiiipu_t fn = (iFiiipu_t)fcn; R void iFiiipp_32(x64emu_t *emu, uintptr_t fcn) { iFiiipp_t fn = (iFiiipp_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20)); } void iFiLLLL_32(x64emu_t *emu, uintptr_t fcn) { iFiLLLL_t fn = (iFiLLLL_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), to_ulong(from_ptri(ulong_t, R_ESP + 8)), to_ulong(from_ptri(ulong_t, R_ESP + 12)), to_ulong(from_ptri(ulong_t, R_ESP + 16)), to_ulong(from_ptri(ulong_t, R_ESP + 20))); } void iFipLLi_32(x64emu_t *emu, uintptr_t fcn) { iFipLLi_t fn = (iFipLLi_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), to_ulong(from_ptri(ulong_t, R_ESP + 12)), to_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptri(int32_t, R_ESP + 20)); } +void iFplluu_32(x64emu_t *emu, uintptr_t fcn) { iFplluu_t fn = (iFplluu_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), to_long(from_ptri(long_t, R_ESP + 8)), to_long(from_ptri(long_t, R_ESP + 12)), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20)); } void iFpLuLi_32(x64emu_t *emu, uintptr_t fcn) { iFpLuLi_t fn = (iFpLuLi_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), to_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(uint32_t, R_ESP + 12), to_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptri(int32_t, R_ESP + 20)); } void iFpppip_32(x64emu_t *emu, uintptr_t fcn) { iFpppip_t fn = (iFpppip_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); } void iFpppup_32(x64emu_t *emu, uintptr_t fcn) { iFpppup_t fn = (iFpppup_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); } @@ -1822,6 +1840,7 @@ void vFdddddd_32(x64emu_t *emu, uintptr_t fcn) { vFdddddd_t fn = (vFdddddd_t)fcn void vFpipipV_32(x64emu_t *emu, uintptr_t fcn) { vFpipipV_t fn = (vFpipipV_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20), from_ptrv(R_ESP + 24)); } void vFpdddii_32(x64emu_t *emu, uintptr_t fcn) { vFpdddii_t fn = (vFpdddii_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptri(double, R_ESP + 8), from_ptri(double, R_ESP + 16), from_ptri(double, R_ESP + 24), from_ptri(int32_t, R_ESP + 32), from_ptri(int32_t, R_ESP + 36)); } void vFppupii_32(x64emu_t *emu, uintptr_t fcn) { vFppupii_t fn = (vFppupii_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24)); } +void vFpppppp_32(x64emu_t *emu, uintptr_t fcn) { vFpppppp_t fn = (vFpppppp_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24)); } void iFEuppup_32(x64emu_t *emu, uintptr_t fcn) { iFEuppup_t fn = (iFEuppup_t)fcn; R_EAX = fn(emu, from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); } void iFEuppLp_32(x64emu_t *emu, uintptr_t fcn) { iFEuppLp_t fn = (iFEuppLp_t)fcn; R_EAX = fn(emu, from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), to_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptriv(R_ESP + 20)); } void iFEpiLpp_32(x64emu_t *emu, uintptr_t fcn) { iFEpiLpp_t fn = (iFEpiLpp_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), to_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20)); } @@ -1893,6 +1912,7 @@ void vFpipipiu_32(x64emu_t *emu, uintptr_t fcn) { vFpipipiu_t fn = (vFpipipiu_t) void vFpddiidd_32(x64emu_t *emu, uintptr_t fcn) { vFpddiidd_t fn = (vFpddiidd_t)fcn; fn(from_ptriv(R_ESP + 4), from_ptri(double, R_ESP + 8), from_ptri(double, R_ESP + 16), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(double, R_ESP + 32), from_ptri(double, R_ESP + 40)); } void iFEpLiipV_32(x64emu_t *emu, uintptr_t fcn) { iFEpLiipV_t fn = (iFEpLiipV_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), to_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20), from_ptrv(R_ESP + 24)); } void iFuiiiuup_32(x64emu_t *emu, uintptr_t fcn) { iFuiiiuup_t fn = (iFuiiiuup_t)fcn; R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptriv(R_ESP + 28)); } +void iFpWCiWCi_32(x64emu_t *emu, uintptr_t fcn) { iFpWCiWCi_t fn = (iFpWCiWCi_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint16_t, R_ESP + 8), from_ptri(uint8_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(uint16_t, R_ESP + 20), from_ptri(uint8_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28)); } void iFpupLpLi_32(x64emu_t *emu, uintptr_t fcn) { iFpupLpLi_t fn = (iFpupLpLi_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), to_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptriv(R_ESP + 20), to_ulong(from_ptri(ulong_t, R_ESP + 24)), from_ptri(int32_t, R_ESP + 28)); } void iFXiuLiii_32(x64emu_t *emu, uintptr_t fcn) { iFXiuLiii_t fn = (iFXiuLiii_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), to_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28)); } void uFuippppp_32(x64emu_t *emu, uintptr_t fcn) { uFuippppp_t fn = (uFuippppp_t)fcn; R_EAX = (uint32_t)fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24), from_ptriv(R_ESP + 28)); } diff --git a/src/wrapped32/generated/wrapper32.h b/src/wrapped32/generated/wrapper32.h index 97530d42..226f700d 100644 --- a/src/wrapped32/generated/wrapper32.h +++ b/src/wrapped32/generated/wrapper32.h @@ -194,6 +194,7 @@ void CFuU_32(x64emu_t *emu, uintptr_t fnc); void CFpi_32(x64emu_t *emu, uintptr_t fnc); void CFpp_32(x64emu_t *emu, uintptr_t fnc); void uFEu_32(x64emu_t *emu, uintptr_t fnc); +void uFEp_32(x64emu_t *emu, uintptr_t fnc); void uFEV_32(x64emu_t *emu, uintptr_t fnc); void uFuu_32(x64emu_t *emu, uintptr_t fnc); void uFup_32(x64emu_t *emu, uintptr_t fnc); @@ -322,6 +323,7 @@ void vFppp_32(x64emu_t *emu, uintptr_t fnc); void vFXLp_32(x64emu_t *emu, uintptr_t fnc); void vFXpi_32(x64emu_t *emu, uintptr_t fnc); void iFEip_32(x64emu_t *emu, uintptr_t fnc); +void iFEup_32(x64emu_t *emu, uintptr_t fnc); void iFEpi_32(x64emu_t *emu, uintptr_t fnc); void iFEpL_32(x64emu_t *emu, uintptr_t fnc); void iFEpp_32(x64emu_t *emu, uintptr_t fnc); @@ -352,6 +354,7 @@ void iFfff_32(x64emu_t *emu, uintptr_t fnc); void iFpii_32(x64emu_t *emu, uintptr_t fnc); void iFpiu_32(x64emu_t *emu, uintptr_t fnc); void iFpip_32(x64emu_t *emu, uintptr_t fnc); +void iFpui_32(x64emu_t *emu, uintptr_t fnc); void iFpuC_32(x64emu_t *emu, uintptr_t fnc); void iFpuu_32(x64emu_t *emu, uintptr_t fnc); void iFpuU_32(x64emu_t *emu, uintptr_t fnc); @@ -518,6 +521,7 @@ void vFpdii_32(x64emu_t *emu, uintptr_t fnc); void vFpddd_32(x64emu_t *emu, uintptr_t fnc); void vFplpp_32(x64emu_t *emu, uintptr_t fnc); void vFppip_32(x64emu_t *emu, uintptr_t fnc); +void vFppui_32(x64emu_t *emu, uintptr_t fnc); void vFpppp_32(x64emu_t *emu, uintptr_t fnc); void vFXiiL_32(x64emu_t *emu, uintptr_t fnc); void vFXLpL_32(x64emu_t *emu, uintptr_t fnc); @@ -565,6 +569,7 @@ void iFXLii_32(x64emu_t *emu, uintptr_t fnc); void iFXppp_32(x64emu_t *emu, uintptr_t fnc); void CFuuff_32(x64emu_t *emu, uintptr_t fnc); void uFuuuu_32(x64emu_t *emu, uintptr_t fnc); +void uFpCCC_32(x64emu_t *emu, uintptr_t fnc); void lFEipi_32(x64emu_t *emu, uintptr_t fnc); void lFiipL_32(x64emu_t *emu, uintptr_t fnc); void lFipLi_32(x64emu_t *emu, uintptr_t fnc); @@ -574,6 +579,7 @@ void LFpLLS_32(x64emu_t *emu, uintptr_t fnc); void LFppLp_32(x64emu_t *emu, uintptr_t fnc); void LFppLa_32(x64emu_t *emu, uintptr_t fnc); void LFXLpi_32(x64emu_t *emu, uintptr_t fnc); +void pFEupp_32(x64emu_t *emu, uintptr_t fnc); void pFEppi_32(x64emu_t *emu, uintptr_t fnc); void pFEppp_32(x64emu_t *emu, uintptr_t fnc); void pFiiiu_32(x64emu_t *emu, uintptr_t fnc); @@ -590,6 +596,7 @@ void pFXiii_32(x64emu_t *emu, uintptr_t fnc); void pFXLLp_32(x64emu_t *emu, uintptr_t fnc); void pFXppi_32(x64emu_t *emu, uintptr_t fnc); void pFXppp_32(x64emu_t *emu, uintptr_t fnc); +void iFpplBp__32(x64emu_t *emu, uintptr_t fnc); void iFppbp_p_32(x64emu_t *emu, uintptr_t fnc); void iFBp_pui_32(x64emu_t *emu, uintptr_t fnc); void IFpBp_ii_32(x64emu_t *emu, uintptr_t fnc); @@ -706,6 +713,7 @@ void iFiiipu_32(x64emu_t *emu, uintptr_t fnc); void iFiiipp_32(x64emu_t *emu, uintptr_t fnc); void iFiLLLL_32(x64emu_t *emu, uintptr_t fnc); void iFipLLi_32(x64emu_t *emu, uintptr_t fnc); +void iFplluu_32(x64emu_t *emu, uintptr_t fnc); void iFpLuLi_32(x64emu_t *emu, uintptr_t fnc); void iFpppip_32(x64emu_t *emu, uintptr_t fnc); void iFpppup_32(x64emu_t *emu, uintptr_t fnc); @@ -795,6 +803,7 @@ void vFdddddd_32(x64emu_t *emu, uintptr_t fnc); void vFpipipV_32(x64emu_t *emu, uintptr_t fnc); void vFpdddii_32(x64emu_t *emu, uintptr_t fnc); void vFppupii_32(x64emu_t *emu, uintptr_t fnc); +void vFpppppp_32(x64emu_t *emu, uintptr_t fnc); void iFEuppup_32(x64emu_t *emu, uintptr_t fnc); void iFEuppLp_32(x64emu_t *emu, uintptr_t fnc); void iFEpiLpp_32(x64emu_t *emu, uintptr_t fnc); @@ -866,6 +875,7 @@ void vFpipipiu_32(x64emu_t *emu, uintptr_t fnc); void vFpddiidd_32(x64emu_t *emu, uintptr_t fnc); void iFEpLiipV_32(x64emu_t *emu, uintptr_t fnc); void iFuiiiuup_32(x64emu_t *emu, uintptr_t fnc); +void iFpWCiWCi_32(x64emu_t *emu, uintptr_t fnc); void iFpupLpLi_32(x64emu_t *emu, uintptr_t fnc); void iFXiuLiii_32(x64emu_t *emu, uintptr_t fnc); void uFuippppp_32(x64emu_t *emu, uintptr_t fnc); diff --git a/src/wrapped32/wrappedfreetype_private.h b/src/wrapped32/wrappedfreetype_private.h index 9f1c031e..baa5457a 100644 --- a/src/wrapped32/wrappedfreetype_private.h +++ b/src/wrapped32/wrappedfreetype_private.h @@ -96,7 +96,7 @@ GO(FT_FloorFix, lFl) //GO(FT_Glyph_Transform, iFppp) //GO(FT_Gzip_Uncompress, //GO(FT_Has_PS_Glyph_Names, -//GO(FT_Init_FreeType, iFp) +GO(FT_Init_FreeType, iFBp_) //GO(FT_Library_SetLcdFilter, iFpu) //GO(FT_Library_SetLcdFilterWeights, iFpp) //GO(FT_Library_Version, vFpppp) @@ -108,13 +108,13 @@ GO(FT_FloorFix, lFl) //GO(FT_List_Remove, //GO(FT_List_Up, vFpp) //GO(FT_Load_Char, iFpLi) -//GO(FT_Load_Glyph, iFpui) +GO(FT_Load_Glyph, iFpui) //GO(FT_Load_Sfnt_Table, iFpLlpp) //GO(FT_Matrix_Invert, iFp) //GO(FT_Matrix_Multiply, vFpp) //GO(FT_MulDiv, lFlll) //GO(FT_MulFix, lFll) -//GO(FT_New_Face, iFpplp) +GO(FT_New_Face, iFpplBp_) //GOM(FT_New_Library, iFEpp) //GO(FT_New_Memory_Face, iFppllp) //GO(FT_New_Size, iFpp) @@ -152,7 +152,7 @@ GO(FT_FloorFix, lFl) //GO(FT_Select_Charmap, iFpi) //GO(FT_Select_Size, iFpi) //GO(FT_Set_Charmap, iFpp) -//GO(FT_Set_Char_Size, iFplluu) +GO(FT_Set_Char_Size, iFplluu) //GO(FT_Set_Debug_Hook, //GO(FT_Set_Default_Properties, vFp) //GO(FT_Set_MM_Blend_Coordinates, diff --git a/src/wrapped32/wrappedlibc_private.h b/src/wrapped32/wrappedlibc_private.h index 3f86affd..7935b250 100755 --- a/src/wrapped32/wrappedlibc_private.h +++ b/src/wrapped32/wrappedlibc_private.h @@ -207,7 +207,7 @@ GOW(dgettext, pFpp) GO(__dgettext, pFpp) GO(difftime, dFLL) //GO(dirfd, iFp) -//GO(dirname, pFp) +GO(dirname, pFp) GOS(div, pFpii) //%%,noE // _dl_addr GO2(dl_iterate_phdr, iFEpp, my_dl_iterate_phdr) //%% diff --git a/src/wrapped32/wrappedsdl1.c b/src/wrapped32/wrappedsdl1.c index 6cbb6102..661e1dbd 100644 --- a/src/wrapped32/wrappedsdl1.c +++ b/src/wrapped32/wrappedsdl1.c @@ -250,13 +250,15 @@ EXPORT void *my32_SDL_LoadBMP_RW(x64emu_t* emu, void* a, int b) // RWNativeEnd(rw); // return r; //} -//EXPORT uint32_t my32_SDL_ReadLE32(x64emu_t* emu, void* a) -//{ -// SDL1_RWops_t* rw = RWNativeStart(emu, (SDL1_RWops_t*)a); -// uint32_t r = my->SDL_ReadLE32(rw); -// RWNativeEnd(rw); -// return r; -//} +EXPORT uint32_t my32_SDL_ReadLE32(x64emu_t* emu, void* a) +{ + inplace_SDL_RWops_to_64(a); + SDL1_RWops_t* rw = RWNativeStart(emu, (SDL1_RWops_t*)a); + uint32_t r = my->SDL_ReadLE32(rw); + RWNativeEnd(rw); + inplace_SDL_RWops_to_32(a); + return r; +} //EXPORT uint64_t my32_SDL_ReadLE64(x64emu_t* emu, void* a) //{ // SDL1_RWops_t* rw = RWNativeStart(emu, (SDL1_RWops_t*)a); @@ -382,20 +384,20 @@ EXPORT void* my32_SDL_GetVideoInfo() return &vm; } -//EXPORT void *my32_SDL_AddTimer(x64emu_t* emu, uint32_t a, void* cb, void* p) -//{ -// return my->SDL_AddTimer(a, find_TimerCallback_Fct(cb), p); -//} -// -//EXPORT int my32_SDL_RemoveTimer(x64emu_t* emu, void *t) -//{ -// return my->SDL_RemoveTimer(t); -//} +EXPORT void *my32_SDL_AddTimer(x64emu_t* emu, uint32_t a, void* cb, void* p) +{ + return my->SDL_AddTimer(a, find_TimerCallback_Fct(cb), p); +} -//EXPORT int32_t my32_SDL_SetTimer(x64emu_t* emu, uint32_t t, void* p) -//{ -// return my->SDL_SetTimer(t, find_TimerCallback_Fct(p)); -//} +EXPORT int my32_SDL_RemoveTimer(x64emu_t* emu, void *t) +{ + return my->SDL_RemoveTimer(t); +} + +EXPORT int32_t my32_SDL_SetTimer(x64emu_t* emu, uint32_t t, void* p) +{ + return my->SDL_SetTimer(t, find_TimerCallback_Fct(p)); +} #if 0 EXPORT int32_t my32_SDL_BuildAudioCVT(x64emu_t* emu, void* a, uint32_t b, uint32_t c, int32_t d, uint32_t e, uint32_t f, int32_t g) { @@ -569,6 +571,13 @@ EXPORT void my32_SDL_FreeSurface(void* s) sdl1_videomode_org = NULL; } +EXPORT int my32_SDL_SetColorKey(void* s, uint32_t flags, uint32_t key) +{ + int ret = my->SDL_SetColorKey(wrapSurface(s), flags, key); + unwrapSurface(s); + return ret; +} + EXPORT int my32_SDL_PollEvent(my_SDL_Event_32_t* evt) { my_SDL_Event_t event; @@ -579,6 +588,13 @@ EXPORT int my32_SDL_PollEvent(my_SDL_Event_32_t* evt) return ret; } +EXPORT int my32_SDL_PushEvent(my_SDL_Event_32_t* evt) +{ + my_SDL_Event_t event; + convert_SDL_Event_to_64(&event, evt); + return my->SDL_PushEvent(&event); +} + EXPORT void* my32_SDL_ListModes(my_SDL_PixelFormat_32_t* fmt, uint32_t flags) { my_SDL_PixelFormat_t format; @@ -608,6 +624,40 @@ EXPORT void* my32_SDL_ListModes(my_SDL_PixelFormat_32_t* fmt, uint32_t flags) return &available; } +EXPORT uint32_t my32_SDL_MapRGB(my_SDL_PixelFormat_32_t* fmt, uint8_t r, uint8_t g, uint8_t b) +{ + my_SDL_PixelFormat_t format; + my_SDL_Palette_t palette; + if(fmt) { + memcpy(&format, fmt, sizeof(format)); + inplace_SDL_PixelFormat_to_64_nopalette(&format); + if(fmt->palette) { + memcpy(&palette, from_ptrv(fmt->palette), sizeof(palette)); + format.palette = &palette; + inplace_SDL_Palette_to_64(&palette); + } + } + return my->SDL_MapRGB(fmt?(&format):NULL, r, g, b); +} + +EXPORT int my32_SDL_BuildAudioCVT(my_SDL_AudioCVT_32_t* cvt, uint16_t src_fmt, uint16_t src_chn, int src_rate, uint16_t dst_fmt, uint16_t dst_ch, int dst_rate) +{ + my_SDL_AudioCVT_t l_cvt; + int ret = my->SDL_BuildAudioCVT(&l_cvt, src_fmt, src_chn, src_rate, dst_fmt, dst_ch, dst_rate); + if(ret!=-1) + convert_AudioCVT_to_32(cvt, &l_cvt); + return ret; +} + +EXPORT int my32_SDL_ConvertAudio(my_SDL_AudioCVT_32_t* cvt) +{ + my_SDL_AudioCVT_t l_cvt; + convert_AudioCVT_to_64(&l_cvt, cvt); + int ret = my->SDL_ConvertAudio(&l_cvt); + convert_AudioCVT_to_32(cvt, &l_cvt); + return ret; +} + //EXPORT int32_t my32_SDL_GetWMInfo(x64emu_t* emu, void* p) //{ // // does SDL_SysWMinfo needs alignment? diff --git a/src/wrapped32/wrappedsdl1_private.h b/src/wrapped32/wrappedsdl1_private.h index f7f159ac..d260bcd3 100644 --- a/src/wrapped32/wrappedsdl1_private.h +++ b/src/wrapped32/wrappedsdl1_private.h @@ -4,7 +4,7 @@ // _fini // _init -//GOM(SDL_AddTimer, pFEupp) +GOM(SDL_AddTimer, pFEupp) GO(SDL_AllocRW, pFv) // no need to use a my_ version here //GO(SDL_CDClose, vFp) //GO(SDL_CDEject, iFp) @@ -110,13 +110,13 @@ GOM(SDL_LoadObject, pFEp) GOM(SDL_LockSurface, iFp) //%noE //GO(SDL_LockYUVOverlay, iFp) //GO(SDL_LowerBlit, iFpppp) -//GO(SDL_MapRGB, uFpCCC) +GOM(SDL_MapRGB, uFpCCC) //%noE //GO(SDL_MapRGBA, uFpCCCC) GO(SDL_NumJoysticks, iFv) //GO(SDL_PeepEvents, iFpiuu) GOM(SDL_PollEvent, iFp) //%noE //GO(SDL_PumpEvents, vFv) -//GO(SDL_PushEvent, iFp) +GOM(SDL_PushEvent, iFp) //%noE GOM(SDL_Quit, vFv) //%noE GO(SDL_QuitSubSystem, vFu) //GOM(SDL_RWFromConstMem, pFEpi) @@ -127,10 +127,10 @@ GOM(SDL_RWFromMem, pFEpi) //GOM(SDL_ReadBE32, uFEp) //GOM(SDL_ReadBE64, UFEp) //GOM(SDL_ReadLE16, uFEp) -//GOM(SDL_ReadLE32, uFEp) +GOM(SDL_ReadLE32, uFEp) //GOM(SDL_ReadLE64, UFEp) //GO(SDL_RegisterApp, iFpup) -//GOM(SDL_RemoveTimer, iFEp) +GOM(SDL_RemoveTimer, iFEp) //GOM(SDL_SaveBMP_RW, iFEppi) GO(SDL_SemPost, iFp) GO(SDL_SemTryWait, iFp) @@ -139,17 +139,17 @@ GO(SDL_SemWait, iFp) GO(SDL_SemWaitTimeout, iFpu) GO(SDL_SetAlpha, iFpuC) //GO(SDL_SetClipRect, uFpp) -//GO(SDL_SetColorKey, iFpuu) +GOM(SDL_SetColorKey, iFpuu) //%noE //GO(SDL_SetColors, iFppii) //GO(SDL_SetCursor, vFp) -//GO(SDL_SetError, vFpppppp) // use ..., so putting arbitrary number of arguments... +GO(SDL_SetError, vFpppppp) // use ..., so putting arbitrary number of arguments... //GOM(SDL_SetEventFilter, vFEp) GO(SDL_SetGamma, iFfff) GO(SDL_SetGammaRamp, iFppp) GO(SDL_SetModState, vFu) //GO(SDL_SetModuleHandle, vFp) //GO(SDL_SetPalette, iFpipii) -//GOM(SDL_SetTimer, iFEup) +GOM(SDL_SetTimer, iFEup) GOM(SDL_SetVideoMode, pFiiiu) //%noE GO(SDL_ShowCursor, iFi) //GO(SDL_SoftStretch, iFpppp) @@ -229,10 +229,10 @@ GO(SDL_GetAudioStatus, uFv) //GO(SDL_LoadWAV, pFpppp) //GO(SDL_FreeWAV, vFp) //GOM(SDL_LoadWAV_RW, pFEpippp) -//GO(SDL_BuildAudioCVT, iFpWCiWCi) -//GO(SDL_ConvertAudio, iFp) +GOM(SDL_BuildAudioCVT, iFpWCiWCi) //%noE +GOM(SDL_ConvertAudio, iFp) //%noE //GO(SDL_AudioInit, iFp) GO(SDL_AudioQuit, vFv) -//GO(SDL_MixAudio, vFppui) +GO(SDL_MixAudio, vFppui) GO(SDL_CloseAudio, vFv) //GO(SDL_AudioDriverName, pFpi) |