about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2024-10-04 20:57:16 +0200
committerptitSeb <sebastien.chev@gmail.com>2024-10-04 20:57:24 +0200
commitbaa3f573aebb4872dfb582d6523dafb8e0130753 (patch)
treefed7bb2668f95044fcf701ff61068779e6e0a367 /src
parent0243e93e971f90dded5c82474e8f391540b5f3b6 (diff)
downloadbox64-baa3f573aebb4872dfb582d6523dafb8e0130753.tar.gz
box64-baa3f573aebb4872dfb582d6523dafb8e0130753.zip
[BOX32] Added some more wrapped function and a profile (PixelJunk Shooter linux version now Works)
Diffstat (limited to 'src')
-rw-r--r--src/librarian/library.c2
-rw-r--r--src/libtools/sdl2align32.c40
-rw-r--r--src/wrapped32/generated/converter32.c15
-rw-r--r--src/wrapped32/generated/converter32.h7
-rw-r--r--src/wrapped32/generated/functions_list.txt7
-rw-r--r--src/wrapped32/generated/wrappedsdl2types32.h3
-rw-r--r--src/wrapped32/generated/wrapper32.c8
-rw-r--r--src/wrapped32/generated/wrapper32.h4
-rwxr-xr-xsrc/wrapped32/wrappedlibc_private.h2
-rw-r--r--src/wrapped32/wrappedlibx11_private.h4
-rw-r--r--src/wrapped32/wrappedsdl2.c19
-rw-r--r--src/wrapped32/wrappedsdl2_private.h36
12 files changed, 125 insertions, 22 deletions
diff --git a/src/librarian/library.c b/src/librarian/library.c
index d4f57854..b454a3ac 100644
--- a/src/librarian/library.c
+++ b/src/librarian/library.c
@@ -886,7 +886,7 @@ static int getSymbolInSymbolMaps(library_t*lib, const char* name, int noweak, ui
                 printf_log(LOG_NONE, "Warning, function %s not found\n", buff);
                 return 0;
             }
-            s->addr = AddBridge(lib->w.bridge, s->w, symbol, sizeof(void*), name);
+            s->addr = AddBridge(lib->w.bridge, s->w, symbol, box64_is32bits?4:sizeof(void*), name);
             s->resolved = 1;
         }
         *addr = s->addr;
diff --git a/src/libtools/sdl2align32.c b/src/libtools/sdl2align32.c
index 68c0540b..3adfed3d 100644
--- a/src/libtools/sdl2align32.c
+++ b/src/libtools/sdl2align32.c
@@ -202,6 +202,26 @@ void convert_SDL2_Event_to_64(void* dst_, const void* src_)
             dst->common.timestamp = src->common.timestamp;
             dst->common.type = src->common.type;
             break;
+        case SDL2_JOYBUTTONDOWN:
+        case SDL2_JOYBUTTONUP:
+            dst->jbutton.type = src->jbutton.type;
+            dst->jbutton.timestamp = src->jbutton.timestamp;
+            dst->jbutton.which = src->jbutton.which;
+            dst->jbutton.button = src->jbutton.button;
+            dst->jbutton.state = src->jbutton.state;
+            dst->jbutton.padding1 = src->jbutton.padding1;
+            dst->jbutton.padding2 = src->jbutton.padding2;
+            break;
+        case SDL2_CONTROLLERBUTTONDOWN:
+        case SDL2_CONTROLLERBUTTONUP:
+            dst->cbutton.type = src->cbutton.type;
+            dst->cbutton.timestamp = src->cbutton.timestamp;
+            dst->cbutton.which = src->cbutton.which;
+            dst->cbutton.button = src->cbutton.button;
+            dst->cbutton.state = src->cbutton.state;
+            dst->cbutton.padding1 = src->cbutton.padding1;
+            dst->cbutton.padding2 = src->cbutton.padding2;
+            break;
         default:
             printf_log(LOG_INFO, "Warning, unsuported SDL2 event %d\n", src->type);
             if(dst_!=src_)
@@ -355,6 +375,26 @@ void convert_SDL2_Event_to_32(void* dst_, const void* src_)
             dst->common.type = src->common.type;
             dst->common.timestamp = src->common.timestamp;
             break;
+        case SDL2_JOYBUTTONDOWN:
+        case SDL2_JOYBUTTONUP:
+            dst->jbutton.type = src->jbutton.type;
+            dst->jbutton.timestamp = src->jbutton.timestamp;
+            dst->jbutton.which = src->jbutton.which;
+            dst->jbutton.button = src->jbutton.button;
+            dst->jbutton.state = src->jbutton.state;
+            dst->jbutton.padding1 = src->jbutton.padding1;
+            dst->jbutton.padding2 = src->jbutton.padding2;
+            break;
+        case SDL2_CONTROLLERBUTTONDOWN:
+        case SDL2_CONTROLLERBUTTONUP:
+            dst->cbutton.type = src->cbutton.type;
+            dst->cbutton.timestamp = src->cbutton.timestamp;
+            dst->cbutton.which = src->cbutton.which;
+            dst->cbutton.button = src->cbutton.button;
+            dst->cbutton.state = src->cbutton.state;
+            dst->cbutton.padding1 = src->cbutton.padding1;
+            dst->cbutton.padding2 = src->cbutton.padding2;
+            break;
         default:
             printf_log(LOG_INFO, "Warning, unsuported SDL2 event %d\n", src->type);
             if(dst_!=src_)
diff --git a/src/wrapped32/generated/converter32.c b/src/wrapped32/generated/converter32.c
index a82c2da8..d70acf86 100644
--- a/src/wrapped32/generated/converter32.c
+++ b/src/wrapped32/generated/converter32.c
@@ -71,6 +71,21 @@ void to_struct_LC(ptr_t d, const struct_LC_t *src) {
 	*(uint8_t*)dest = to_ulong(src->C1); dest += 1;
 }
 
+void from_struct_liu(struct_liu_t *dest, ptr_t s) {
+	if(!s) return;
+	uint8_t* src = (uint8_t*)from_ptrv(s);
+	dest->l0 = from_long(*(long_t*)src); src += 4;
+	dest->i1 = *(int*)src; src += 4;
+	dest->u2 = *(uint32_t*)src; src += 4;
+}
+void to_struct_liu(ptr_t d, const struct_liu_t *src) {
+	if (!src) return;
+	uint8_t* dest = (uint8_t*)from_ptrv(d);
+	*(long_t*)dest = to_long(src->l0); dest += 4;
+	*(int*)dest = src->i1; dest += 2;
+	*(uint32_t*)dest = src->u2; dest += 2;
+}
+
 void from_struct_llll(struct_llll_t *dest, ptr_t s) {
 	if(!s) return;
 	uint8_t* src = (uint8_t*)from_ptrv(s);
diff --git a/src/wrapped32/generated/converter32.h b/src/wrapped32/generated/converter32.h
index 2469b614..c2344c65 100644
--- a/src/wrapped32/generated/converter32.h
+++ b/src/wrapped32/generated/converter32.h
@@ -37,6 +37,13 @@ typedef struct struct_LC_s {
 } struct_LC_t;
 void from_struct_LC(struct_LC_t *dest, ptr_t src);
 void to_struct_LC(ptr_t dest, const struct_LC_t *src);
+typedef struct struct_liu_s {
+	long l0;
+	int i1;
+	uint32_t u2;
+} struct_liu_t;
+void from_struct_liu(struct_liu_t *dest, ptr_t src);
+void to_struct_liu(ptr_t dest, const struct_liu_t *src);
 typedef struct struct_llll_s {
 	long l0;
 	long l1;
diff --git a/src/wrapped32/generated/functions_list.txt b/src/wrapped32/generated/functions_list.txt
index af9387dd..5f7c2337 100644
--- a/src/wrapped32/generated/functions_list.txt
+++ b/src/wrapped32/generated/functions_list.txt
@@ -243,6 +243,7 @@
 #() iFpbup_ -> iFpB
 #() iFprLL_ -> iFpB
 #() iFBll_p -> iFBp
+#() iFSBliu_ -> iFSB
 #() iFXbLipi_ -> iFXB
 #() iFrLL_BLL_ -> iFBB
 #() iFpruuipWCCp_ -> iFpB
@@ -426,6 +427,7 @@
 #() pFEXp -> pFEXp
 #() pFipi -> pFipi
 #() pFipL -> pFipL
+#() pFipp -> pFipp
 #() pFulu -> pFulu
 #() pFupi -> pFupi
 #() pFupp -> pFupp
@@ -616,6 +618,7 @@
 #() iFXWWW -> iFXWWW
 #() iFXuup -> iFXuup
 #() iFXLii -> iFXLii
+#() iFXLuu -> iFXLuu
 #() iFXpii -> iFXpii
 #() iFXpip -> iFXpip
 #() iFXppi -> iFXppi
@@ -828,6 +831,7 @@
 #() LFpbp_LLp -> LFpBLLp
 #() LFpBp_LLp -> LFpBLLp
 #() iFippprLL_ -> iFipppB
+#() iFiiuBp_Bp_ -> iFiiuBB
 #() LFLbp_bL_bp_bL_ -> LFLBBBB
 #() LFpLpriiiiiiiiilt_a -> LFpLpBa
 #() iFXLpBLWWWcc_BLWWWcc_ -> iFXLpBB
@@ -1810,6 +1814,7 @@ wrappedsdl2:
   - SDL_LoadBMP_RW
   - SDL_notreal
 - pFpp:
+  - SDL_CreateTextureFromSurface
   - SDL_RWFromFile
 - iFiip:
   - SDL_GetDisplayMode
@@ -1819,6 +1824,8 @@ wrappedsdl2:
   - SDL_sscanf
 - IFpIi:
   - SDL_RWseek
+- pFipp:
+  - SDL_GetClosestDisplayMode
 - pFpii:
   - SDL_CreateColorCursor
 - pFppp:
diff --git a/src/wrapped32/generated/wrappedsdl2types32.h b/src/wrapped32/generated/wrappedsdl2types32.h
index 6e5e276e..30d6e4a2 100644
--- a/src/wrapped32/generated/wrappedsdl2types32.h
+++ b/src/wrapped32/generated/wrappedsdl2types32.h
@@ -28,6 +28,7 @@ typedef int32_t (*iFiip_t)(int32_t, int32_t, void*);
 typedef int32_t (*iFppu_t)(void*, void*, uint32_t);
 typedef int32_t (*iFppV_t)(void*, void*, ...);
 typedef int64_t (*IFpIi_t)(void*, int64_t, int32_t);
+typedef void* (*pFipp_t)(int32_t, void*, void*);
 typedef void* (*pFpii_t)(void*, int32_t, int32_t);
 typedef void* (*pFppp_t)(void*, void*, void*);
 typedef int32_t (*iFpLpp_t)(void*, uintptr_t, void*, void*);
@@ -61,11 +62,13 @@ typedef void* (*pFuiiiuuuu_t)(uint32_t, int32_t, int32_t, int32_t, uint32_t, uin
 	GO(SDL_SetWindowDisplayMode, iFpp_t) \
 	GO(SDL_LoadBMP_RW, pFpi_t) \
 	GO(SDL_notreal, pFpi_t) \
+	GO(SDL_CreateTextureFromSurface, pFpp_t) \
 	GO(SDL_RWFromFile, pFpp_t) \
 	GO(SDL_GetDisplayMode, iFiip_t) \
 	GO(SDL_FillRect, iFppu_t) \
 	GO(SDL_sscanf, iFppV_t) \
 	GO(SDL_RWseek, IFpIi_t) \
+	GO(SDL_GetClosestDisplayMode, pFipp_t) \
 	GO(SDL_CreateColorCursor, pFpii_t) \
 	GO(SDL_CreateThread, pFppp_t) \
 	GO(SDL_vsnprintf, iFpLpp_t) \
diff --git a/src/wrapped32/generated/wrapper32.c b/src/wrapped32/generated/wrapper32.c
index 4a29e747..cbae9d1a 100644
--- a/src/wrapped32/generated/wrapper32.c
+++ b/src/wrapped32/generated/wrapper32.c
@@ -333,6 +333,7 @@ typedef int32_t (*iFprll__t)(void*, struct_ll_t*);
 typedef int32_t (*iFpbup__t)(void*, struct_up_t*);
 typedef int32_t (*iFprLL__t)(void*, struct_LL_t*);
 typedef int32_t (*iFBll_p_t)(struct_ll_t*, void*);
+typedef int32_t (*iFSBliu__t)(void*, struct_liu_t*);
 typedef int32_t (*iFXbLipi__t)(void*, struct_Lipi_t*);
 typedef int32_t (*iFrLL_BLL__t)(struct_LL_t*, struct_LL_t*);
 typedef int32_t (*iFpruuipWCCp__t)(void*, struct_uuipWCCp_t*);
@@ -516,6 +517,7 @@ typedef void* (*pFEXL_t)(x64emu_t*, void*, uintptr_t);
 typedef void* (*pFEXp_t)(x64emu_t*, void*, void*);
 typedef void* (*pFipi_t)(int32_t, void*, int32_t);
 typedef void* (*pFipL_t)(int32_t, void*, uintptr_t);
+typedef void* (*pFipp_t)(int32_t, void*, void*);
 typedef void* (*pFulu_t)(uint32_t, intptr_t, uint32_t);
 typedef void* (*pFupi_t)(uint32_t, void*, int32_t);
 typedef void* (*pFupp_t)(uint32_t, void*, void*);
@@ -706,6 +708,7 @@ typedef int32_t (*iFXipp_t)(void*, int32_t, void*, void*);
 typedef int32_t (*iFXWWW_t)(void*, uint16_t, uint16_t, uint16_t);
 typedef int32_t (*iFXuup_t)(void*, uint32_t, uint32_t, void*);
 typedef int32_t (*iFXLii_t)(void*, uintptr_t, int32_t, int32_t);
+typedef int32_t (*iFXLuu_t)(void*, uintptr_t, uint32_t, uint32_t);
 typedef int32_t (*iFXpii_t)(void*, void*, int32_t, int32_t);
 typedef int32_t (*iFXpip_t)(void*, void*, int32_t, void*);
 typedef int32_t (*iFXppi_t)(void*, void*, void*, int32_t);
@@ -918,6 +921,7 @@ typedef int32_t (*iFEBh_ppp_t)(x64emu_t*, struct_h_t*, void*, void*, void*);
 typedef uintptr_t (*LFpbp_LLp_t)(void*, struct_p_t*, uintptr_t, uintptr_t, void*);
 typedef uintptr_t (*LFpBp_LLp_t)(void*, struct_p_t*, uintptr_t, uintptr_t, void*);
 typedef int32_t (*iFippprLL__t)(int32_t, void*, void*, void*, struct_LL_t*);
+typedef int32_t (*iFiiuBp_Bp__t)(int32_t, int32_t, uint32_t, struct_p_t*, struct_p_t*);
 typedef uintptr_t (*LFLbp_bL_bp_bL__t)(uintptr_t, struct_p_t*, struct_L_t*, struct_p_t*, struct_L_t*);
 typedef uintptr_t (*LFpLpriiiiiiiiilt_a_t)(void*, uintptr_t, void*, struct_iiiiiiiiilt_t*, void*);
 typedef int32_t (*iFXLpBLWWWcc_BLWWWcc__t)(void*, uintptr_t, void*, struct_LWWWcc_t*, struct_LWWWcc_t*);
@@ -1492,6 +1496,7 @@ void iFprll__32(x64emu_t *emu, uintptr_t fcn) { iFprll__t fn = (iFprll__t)fcn; s
 void iFpbup__32(x64emu_t *emu, uintptr_t fcn) { iFpbup__t fn = (iFpbup__t)fcn; struct_up_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_up(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_up(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); }
 void iFprLL__32(x64emu_t *emu, uintptr_t fcn) { iFprLL__t fn = (iFprLL__t)fcn; struct_LL_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_LL(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); }
 void iFBll_p_32(x64emu_t *emu, uintptr_t fcn) { iFBll_p_t fn = (iFBll_p_t)fcn; struct_ll_t arg_4={0}; R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptriv(R_ESP + 8)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_ll(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); }
+void iFSBliu__32(x64emu_t *emu, uintptr_t fcn) { iFSBliu__t fn = (iFSBliu__t)fcn; struct_liu_t arg_8={0}; R_EAX = fn(io_convert32(from_ptriv(R_ESP + 4)), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_liu(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); }
 void iFXbLipi__32(x64emu_t *emu, uintptr_t fcn) { iFXbLipi__t fn = (iFXbLipi__t)fcn; struct_Lipi_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_Lipi(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_Lipi(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); }
 void iFrLL_BLL__32(x64emu_t *emu, uintptr_t fcn) { iFrLL_BLL__t fn = (iFrLL_BLL__t)fcn; struct_LL_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_LL(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); struct_LL_t arg_8={0}; R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_LL(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); }
 void iFpruuipWCCp__32(x64emu_t *emu, uintptr_t fcn) { iFpruuipWCCp__t fn = (iFpruuipWCCp__t)fcn; struct_uuipWCCp_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_uuipWCCp(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); }
@@ -1675,6 +1680,7 @@ void pFEXL_32(x64emu_t *emu, uintptr_t fcn) { pFEXL_t fn = (pFEXL_t)fcn; R_EAX =
 void pFEXp_32(x64emu_t *emu, uintptr_t fcn) { pFEXp_t fn = (pFEXp_t)fcn; R_EAX = to_ptrv(fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8))); }
 void pFipi_32(x64emu_t *emu, uintptr_t fcn) { pFipi_t fn = (pFipi_t)fcn; R_EAX = to_ptrv(fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12))); }
 void pFipL_32(x64emu_t *emu, uintptr_t fcn) { pFipL_t fn = (pFipL_t)fcn; R_EAX = to_ptrv(fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)))); }
+void pFipp_32(x64emu_t *emu, uintptr_t fcn) { pFipp_t fn = (pFipp_t)fcn; R_EAX = to_ptrv(fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12))); }
 void pFulu_32(x64emu_t *emu, uintptr_t fcn) { pFulu_t fn = (pFulu_t)fcn; R_EAX = to_ptrv(fn(from_ptri(uint32_t, R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8)), from_ptri(uint32_t, R_ESP + 12))); }
 void pFupi_32(x64emu_t *emu, uintptr_t fcn) { pFupi_t fn = (pFupi_t)fcn; R_EAX = to_ptrv(fn(from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12))); }
 void pFupp_32(x64emu_t *emu, uintptr_t fcn) { pFupp_t fn = (pFupp_t)fcn; R_EAX = to_ptrv(fn(from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12))); }
@@ -1865,6 +1871,7 @@ void iFXipp_32(x64emu_t *emu, uintptr_t fcn) { iFXipp_t fn = (iFXipp_t)fcn; R_EA
 void iFXWWW_32(x64emu_t *emu, uintptr_t fcn) { iFXWWW_t fn = (iFXWWW_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(uint16_t, R_ESP + 8), from_ptri(uint16_t, R_ESP + 12), from_ptri(uint16_t, R_ESP + 16)); }
 void iFXuup_32(x64emu_t *emu, uintptr_t fcn) { iFXuup_t fn = (iFXuup_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(uint32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); }
 void iFXLii_32(x64emu_t *emu, uintptr_t fcn) { iFXLii_t fn = (iFXLii_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); }
+void iFXLuu_32(x64emu_t *emu, uintptr_t fcn) { iFXLuu_t fn = (iFXLuu_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16)); }
 void iFXpii_32(x64emu_t *emu, uintptr_t fcn) { iFXpii_t fn = (iFXpii_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); }
 void iFXpip_32(x64emu_t *emu, uintptr_t fcn) { iFXpip_t fn = (iFXpip_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); }
 void iFXppi_32(x64emu_t *emu, uintptr_t fcn) { iFXppi_t fn = (iFXppi_t)fcn; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16)); }
@@ -2077,6 +2084,7 @@ void iFEBh_ppp_32(x64emu_t *emu, uintptr_t fcn) { iFEBh_ppp_t fn = (iFEBh_ppp_t)
 void LFpbp_LLp_32(x64emu_t *emu, uintptr_t fcn) { LFpbp_LLp_t fn = (LFpbp_LLp_t)fcn; struct_p_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_p(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptriv(R_ESP + 20))); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); }
 void LFpBp_LLp_32(x64emu_t *emu, uintptr_t fcn) { LFpBp_LLp_t fn = (LFpBp_LLp_t)fcn; struct_p_t arg_8={0}; R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptriv(R_ESP + 20))); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); }
 void iFippprLL__32(x64emu_t *emu, uintptr_t fcn) { iFippprLL__t fn = (iFippprLL__t)fcn; struct_LL_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_LL(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL); }
+void iFiiuBp_Bp__32(x64emu_t *emu, uintptr_t fcn) { iFiiuBp_Bp__t fn = (iFiiuBp_Bp__t)fcn; struct_p_t arg_16={0}; struct_p_t arg_20={0}; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); }
 void LFLbp_bL_bp_bL__32(x64emu_t *emu, uintptr_t fcn) { LFLbp_bL_bp_bL__t fn = (LFLbp_bL_bp_bL__t)fcn; struct_p_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_p(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); struct_L_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_L(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); struct_p_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_p(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); struct_L_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_L(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); R_EAX = to_ulong(fn(from_ulong(from_ptri(ulong_t, R_ESP + 4)), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); }
 void LFpLpriiiiiiiiilt_a_32(x64emu_t *emu, uintptr_t fcn) { LFpLpriiiiiiiiilt_a_t fn = (LFpLpriiiiiiiiilt_a_t)fcn; struct_iiiiiiiiilt_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_iiiiiiiiilt(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, from_locale(from_ptri(ptr_t, R_ESP + 20)))); }
 void iFXLpBLWWWcc_BLWWWcc__32(x64emu_t *emu, uintptr_t fcn) { iFXLpBLWWWcc_BLWWWcc__t fn = (iFXLpBLWWWcc_BLWWWcc__t)fcn; struct_LWWWcc_t arg_16={0}; struct_LWWWcc_t arg_20={0}; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_LWWWcc(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_LWWWcc(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); }
diff --git a/src/wrapped32/generated/wrapper32.h b/src/wrapped32/generated/wrapper32.h
index ecdf84e9..b39ab350 100644
--- a/src/wrapped32/generated/wrapper32.h
+++ b/src/wrapped32/generated/wrapper32.h
@@ -284,6 +284,7 @@ void iFprll__32(x64emu_t *emu, uintptr_t fnc);
 void iFpbup__32(x64emu_t *emu, uintptr_t fnc);
 void iFprLL__32(x64emu_t *emu, uintptr_t fnc);
 void iFBll_p_32(x64emu_t *emu, uintptr_t fnc);
+void iFSBliu__32(x64emu_t *emu, uintptr_t fnc);
 void iFXbLipi__32(x64emu_t *emu, uintptr_t fnc);
 void iFrLL_BLL__32(x64emu_t *emu, uintptr_t fnc);
 void iFpruuipWCCp__32(x64emu_t *emu, uintptr_t fnc);
@@ -467,6 +468,7 @@ void pFEXL_32(x64emu_t *emu, uintptr_t fnc);
 void pFEXp_32(x64emu_t *emu, uintptr_t fnc);
 void pFipi_32(x64emu_t *emu, uintptr_t fnc);
 void pFipL_32(x64emu_t *emu, uintptr_t fnc);
+void pFipp_32(x64emu_t *emu, uintptr_t fnc);
 void pFulu_32(x64emu_t *emu, uintptr_t fnc);
 void pFupi_32(x64emu_t *emu, uintptr_t fnc);
 void pFupp_32(x64emu_t *emu, uintptr_t fnc);
@@ -657,6 +659,7 @@ void iFXipp_32(x64emu_t *emu, uintptr_t fnc);
 void iFXWWW_32(x64emu_t *emu, uintptr_t fnc);
 void iFXuup_32(x64emu_t *emu, uintptr_t fnc);
 void iFXLii_32(x64emu_t *emu, uintptr_t fnc);
+void iFXLuu_32(x64emu_t *emu, uintptr_t fnc);
 void iFXpii_32(x64emu_t *emu, uintptr_t fnc);
 void iFXpip_32(x64emu_t *emu, uintptr_t fnc);
 void iFXppi_32(x64emu_t *emu, uintptr_t fnc);
@@ -869,6 +872,7 @@ void iFEBh_ppp_32(x64emu_t *emu, uintptr_t fnc);
 void LFpbp_LLp_32(x64emu_t *emu, uintptr_t fnc);
 void LFpBp_LLp_32(x64emu_t *emu, uintptr_t fnc);
 void iFippprLL__32(x64emu_t *emu, uintptr_t fnc);
+void iFiiuBp_Bp__32(x64emu_t *emu, uintptr_t fnc);
 void LFLbp_bL_bp_bL__32(x64emu_t *emu, uintptr_t fnc);
 void LFpLpriiiiiiiiilt_a_32(x64emu_t *emu, uintptr_t fnc);
 void iFXLpBLWWWcc_BLWWWcc__32(x64emu_t *emu, uintptr_t fnc);
diff --git a/src/wrapped32/wrappedlibc_private.h b/src/wrapped32/wrappedlibc_private.h
index 8da72365..ad2e9707 100755
--- a/src/wrapped32/wrappedlibc_private.h
+++ b/src/wrapped32/wrappedlibc_private.h
@@ -333,7 +333,7 @@ GOW(fgetc, iFS)
 GOW(fgetc_unlocked, iFS)
 // fgetgrent
 // fgetgrent_r  // Weak
-//GO(fgetpos, iFSBLii_)
+GO(fgetpos, iFSBliu_)
 GO(fgetpos64, iFSp)
 // fgetpwent
 // fgetpwent_r  // Weak
diff --git a/src/wrapped32/wrappedlibx11_private.h b/src/wrapped32/wrappedlibx11_private.h
index 93700d46..2f993086 100644
--- a/src/wrapped32/wrappedlibx11_private.h
+++ b/src/wrapped32/wrappedlibx11_private.h
@@ -404,7 +404,7 @@ GO(dummy_XGetPixel, LFpii)     // for the wrapper
 //GO(XGetRGBColormaps, iFpLppL)
 //GO(_XGetScanlinePad, 
 //GO(XGetScreenSaver, iFppppp)
-//GO(XGetSelectionOwner, LFpL)
+GO(XGetSelectionOwner, LFXL)
 //GO(XGetSizeHints, iFpLpL)
 //GO(XGetStandardColormap, iFpLpL)
 GOM(XGetSubImage, pFEXLiiuuLipii)
@@ -998,7 +998,7 @@ GO(XRaiseWindow, iFXL)
 //GO(XReparentWindow, iFpLLii)
 //GO(_XReply, iFppii)
 //GO(XResetScreenSaver, iFp)
-//GO(XResizeWindow, iFpLuu)
+GO(XResizeWindow, iFXLuu)
 //GO(XResourceManagerString, pFp)
 //GO(XRestackWindows, iFppi)
 //GO(_XReverse_Bytes, 
diff --git a/src/wrapped32/wrappedsdl2.c b/src/wrapped32/wrappedsdl2.c
index 2510a8ea..f574532a 100644
--- a/src/wrapped32/wrappedsdl2.c
+++ b/src/wrapped32/wrappedsdl2.c
@@ -184,6 +184,17 @@ EXPORT int my32_2_SDL_SetWindowDisplayMode(void* window, void* mode)
     return my->SDL_SetWindowDisplayMode(window, &mode_l);
 }
 
+EXPORT void* my32_2_SDL_GetClosestDisplayMode(int index, void* mode, void* closest)
+{
+    my_SDL2_DisplayMode_t mode_l = { 0 };
+    my_SDL2_DisplayMode_t closest_l = { 0 };
+    convert_SDL2_DisplayMode_to_64(&mode_l, mode);
+    void* ret = my->SDL_GetClosestDisplayMode(index, &mode_l, &closest_l);
+    if(!ret) return NULL;
+    convert_SDL2_DisplayMode_to_32(closest, &closest_l);
+    return closest;
+}
+
 EXPORT void* my32_2_SDL_JoystickGetDeviceGUID(void* ret, int index)
 {
    *(SDL2_GUID_t*)ret = my->SDL_JoystickGetDeviceGUID(index);
@@ -341,6 +352,14 @@ EXPORT int my32_2_SDL_FillRect(x64emu_t* emu, void* s, void* rect, uint32_t colo
     return ret;
 }
 
+EXPORT void* my32_2_SDL_CreateTextureFromSurface(void* r, void* s)
+{
+    inplace_SDL2_Surface_to_64(s);
+    void* ret = my->SDL_CreateTextureFromSurface(r, s);
+    inplace_SDL2_Surface_to_32(s);
+    return ret;
+}
+
 EXPORT void my32_2_SDL_FreeSurface(x64emu_t* emu, void* surface)
 {
     inplace_SDL2_Surface_to_64(surface);
diff --git a/src/wrapped32/wrappedsdl2_private.h b/src/wrapped32/wrappedsdl2_private.h
index 33dd356b..99568865 100644
--- a/src/wrapped32/wrappedsdl2_private.h
+++ b/src/wrapped32/wrappedsdl2_private.h
@@ -79,11 +79,11 @@ GOM(SDL_CreateRGBSurfaceWithFormatFrom, pFEpiiiiu)
 //GO(SDL_CreateSoftwareRenderer, pFp)
 GO(SDL_CreateSystemCursor, pFu)
 GO(SDL_CreateTexture, pFpuiii)
-//GO(SDL_CreateTextureFromSurface, pFpp)
+GOM(SDL_CreateTextureFromSurface, pFpp) //%noE
 GOM(SDL_CreateThread, pFEppp)
 // SDL_CreateThreadWithStackSize
 GO(SDL_CreateWindow, pFpiiiiu)
-//GO(SDL_CreateWindowAndRenderer, iFiiupp)
+GO(SDL_CreateWindowAndRenderer, iFiiuBp_Bp_)
 //GO(SDL_CreateWindowFrom, pFp)
 GO(SDL_Delay, vFu)
 GOM(SDL_DelEventWatch, vFEpp)
@@ -91,9 +91,9 @@ GOM(SDL_DelEventWatch, vFEpp)
 //GO(SDL_DequeueAudio, uFupu)
 //GO(SDL_DestroyCond, vFp)
 //GO(SDL_DestroyMutex, vFp)
-//GO(SDL_DestroyRenderer, vFp)
+GO(SDL_DestroyRenderer, vFp)
 //GO(SDL_DestroySemaphore, vFp)
-//GO(SDL_DestroyTexture, vFp)
+GO(SDL_DestroyTexture, vFp)
 GO(SDL_DestroyWindow, vFp)
 //GO(SDL_DestroyWindowSurface, iFp)
 //GO(SDL_DetachThread, vFp)
@@ -131,12 +131,12 @@ GO(SDL_GameControllerClose, vFp)
 GO(SDL_GameControllerEventState, iFi)
 //GO(SDL_GameControllerFromInstanceID, pFi)
 //GO(SDL_GameControllerFromPlayerIndex, pFi)
-//GO(SDL_GameControllerGetAttached, iFp)
-//GO(SDL_GameControllerGetAxis, wFpi)
+GO(SDL_GameControllerGetAttached, iFp)
+GO(SDL_GameControllerGetAxis, wFpi)
 //GO(SDL_GameControllerGetAxisFromString, iFp)
 //GO(SDL_GameControllerGetBindForAxis, HFpi)
 //GO(SDL_GameControllerGetBindForButton, HFpi)
-//GO(SDL_GameControllerGetButton, CFpi)
+GO(SDL_GameControllerGetButton, CFpi)
 //GO(SDL_GameControllerGetButtonFromString, iFp)
 //GO(SDL_GameControllerGetFirmwareVersion, WFp)
 GO(SDL_GameControllerGetJoystick, pFp)
@@ -162,9 +162,9 @@ GO(SDL_GameControllerGetJoystick, pFp)
 //GO(SDL_GameControllerMappingForDeviceIndex, pFi)
 //GO(SDL_GameControllerMappingForGUID, pFpp)
 //GO(SDL_GameControllerMappingForIndex, pFi)
-//GO(SDL_GameControllerName, pFp)
+GO(SDL_GameControllerName, pFp)
 //GO(SDL_GameControllerNameForIndex, pFi)
-//GO(SDL_GameControllerNumMappings, iFv)
+GO(SDL_GameControllerNumMappings, iFv)
 GO(SDL_GameControllerOpen, pFi)
 //GO(SDL_GameControllerPath, pFp)
 //GO(SDL_GameControllerPathForIndex, pFi)
@@ -173,19 +173,19 @@ GO(SDL_GameControllerOpen, pFi)
 //GO(SDL_GameControllerSetLED, iFpCCC)
 //GO(SDL_GameControllerSetPlayerIndex, vFpi)
 //GO(SDL_GameControllerSetSensorEnabled, iFpiu)
-//GO(SDL_GameControllerTypeForIndex, uFi)
-//GO(SDL_GameControllerUpdate, vFv)
+GO(SDL_GameControllerTypeForIndex, uFi)
+GO(SDL_GameControllerUpdate, vFv)
 // SDL_GetAssertionHandler
 //GO(SDL_GetAssertionReport, pFv)
 //GO(SDL_GetAudioDeviceName, pFii)
-//GO(SDL_GetAudioDeviceStatus, uFu)
+GO(SDL_GetAudioDeviceStatus, uFu)
 //GO(SDL_GetAudioDriver, pFi)
 //GO(SDL_GetAudioDeviceSpec, iFiip)
-//GO(SDL_GetAudioStatus, uFv)
+GO(SDL_GetAudioStatus, uFv)
 GOM(SDL_GetBasePath, pFEv)
 GO(SDL_GetClipboardText, pFv)
 //GO(SDL_GetClipRect, vFpp)
-//GO(SDL_GetClosestDisplayMode, pFipp)
+GOM(SDL_GetClosestDisplayMode, pFipp)   //%noE
 //GO(SDL_GetColorKey, iFpp)
 //GO(SDL_GetCPUCacheLineSize, iFv)
 //GO(SDL_GetCPUCount, iFv)
@@ -212,7 +212,7 @@ GO(SDL_GetError, pFv)
 GO(SDL_GetHintBoolean, uFpu)
 //GOM(SDL_GetJoystickGUIDInfo, vFGpppp)
 GO(SDL_GetKeyboardFocus, pFv)
-//GO(SDL_GetKeyboardState, pFp)
+GO(SDL_GetKeyboardState, pFp)
 //GO(SDL_GetKeyFromName, iFp)
 //GO(SDL_GetKeyFromScancode, iFu)
 //GO(SDL_GetKeyName, pFi)
@@ -377,10 +377,10 @@ GO(SDL_InitSubSystem, iFu)
 //GO(SDL_isdigit, iFi)
 GO(SDL_IsGameController, uFi)
 //GO(SDL_IsScreenKeyboardShown, uFp)
-//GO(SDL_IsScreenSaverEnabled, iFv)
+GO(SDL_IsScreenSaverEnabled, iFv)
 //GO(SDL_IsShapedWindow, uFp)
-//GO(SDL_isspace, iFi)
-//GO(SDL_IsTablet, uFv)
+GO(SDL_isspace, iFi)
+GO(SDL_IsTablet, uFv)
 GO(SDL_IsTextInputActive, iFv)
 //GO(SDL_itoa, pFipi)
 //GO(SDL_JoystickAttachVirtualEx, iFp)