Skip to content

Commit 80dafff

Browse files
committed
[BOX32][WRAPPER] Refactored libGL wrapping
1 parent 3eb8e16 commit 80dafff

File tree

5 files changed

+190
-942
lines changed

5 files changed

+190
-942
lines changed

src/wrapped32/generated/functions_list.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@
216216
#() iEEv -> iEEv
217217
#() iFEv -> iFEv
218218
#() iEEi -> iEEi
219+
#() iFEi -> iFEi
219220
#() iEEL -> iEEL
220221
#() iEEp -> iEEp
221222
#() iFEp -> iFEp
@@ -887,6 +888,7 @@
887888
#() vEEppp -> vEEppp
888889
#() vFEppp -> vFEppp
889890
#() vFEXLp -> vFEXLp
891+
#() vFEXpi -> vFEXpi
890892
#() vFcccc -> vFcccc
891893
#() vFwwww -> vFwwww
892894
#() vFiiii -> vFiiii

src/wrapped32/generated/wrapper32.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ typedef int16_t (*wFpi_t)(void*, int32_t);
310310
typedef int32_t (*iEEv_t)(x64emu_t*);
311311
typedef int32_t (*iFEv_t)(x64emu_t*);
312312
typedef int32_t (*iEEi_t)(x64emu_t*, int32_t);
313+
typedef int32_t (*iFEi_t)(x64emu_t*, int32_t);
313314
typedef int32_t (*iEEL_t)(x64emu_t*, uintptr_t);
314315
typedef int32_t (*iEEp_t)(x64emu_t*, void*);
315316
typedef int32_t (*iFEp_t)(x64emu_t*, void*);
@@ -981,6 +982,7 @@ typedef void (*vFEpll_t)(x64emu_t*, void*, intptr_t, intptr_t);
981982
typedef void (*vEEppp_t)(x64emu_t*, void*, void*, void*);
982983
typedef void (*vFEppp_t)(x64emu_t*, void*, void*, void*);
983984
typedef void (*vFEXLp_t)(x64emu_t*, void*, uintptr_t, void*);
985+
typedef void (*vFEXpi_t)(x64emu_t*, void*, void*, int32_t);
984986
typedef void (*vFcccc_t)(int8_t, int8_t, int8_t, int8_t);
985987
typedef void (*vFwwww_t)(int16_t, int16_t, int16_t, int16_t);
986988
typedef void (*vFiiii_t)(int32_t, int32_t, int32_t, int32_t);
@@ -2492,6 +2494,7 @@ void wFpi_32(x64emu_t *emu, uintptr_t fcn) { wFpi_t fn = (wFpi_t)fcn; R_EAX = fn
24922494
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; }
24932495
void iFEv_32(x64emu_t *emu, uintptr_t fcn) { iFEv_t fn = (iFEv_t)fcn; R_EAX = fn(emu); }
24942496
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; }
2497+
void iFEi_32(x64emu_t *emu, uintptr_t fcn) { iFEi_t fn = (iFEi_t)fcn; R_EAX = fn(emu, from_ptri(int32_t, R_ESP + 4)); }
24952498
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; }
24962499
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; }
24972500
void iFEp_32(x64emu_t *emu, uintptr_t fcn) { iFEp_t fn = (iFEp_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4)); }
@@ -3163,6 +3166,7 @@ void vFEpll_32(x64emu_t *emu, uintptr_t fcn) { vFEpll_t fn = (vFEpll_t)fcn; fn(e
31633166
void vEEppp_32(x64emu_t *emu, uintptr_t fcn) { vEEppp_t fn = (vEEppp_t)fcn; errno = emu->libc_err; fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12)); emu->libc_err = errno; }
31643167
void vFEppp_32(x64emu_t *emu, uintptr_t fcn) { vFEppp_t fn = (vFEppp_t)fcn; fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12)); }
31653168
void vFEXLp_32(x64emu_t *emu, uintptr_t fcn) { vFEXLp_t fn = (vFEXLp_t)fcn; fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12)); }
3169+
void vFEXpi_32(x64emu_t *emu, uintptr_t fcn) { vFEXpi_t fn = (vFEXpi_t)fcn; fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12)); }
31663170
void vFcccc_32(x64emu_t *emu, uintptr_t fcn) { vFcccc_t fn = (vFcccc_t)fcn; fn(from_ptri(int8_t, R_ESP + 4), from_ptri(int8_t, R_ESP + 8), from_ptri(int8_t, R_ESP + 12), from_ptri(int8_t, R_ESP + 16)); }
31673171
void vFwwww_32(x64emu_t *emu, uintptr_t fcn) { vFwwww_t fn = (vFwwww_t)fcn; fn(from_ptri(int16_t, R_ESP + 4), from_ptri(int16_t, R_ESP + 8), from_ptri(int16_t, R_ESP + 12), from_ptri(int16_t, R_ESP + 16)); }
31683172
void vFiiii_32(x64emu_t *emu, uintptr_t fcn) { vFiiii_t fn = (vFiiii_t)fcn; fn(from_ptri(int32_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)); }

src/wrapped32/generated/wrapper32.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ void wFpi_32(x64emu_t *emu, uintptr_t fnc);
257257
void iEEv_32(x64emu_t *emu, uintptr_t fnc);
258258
void iFEv_32(x64emu_t *emu, uintptr_t fnc);
259259
void iEEi_32(x64emu_t *emu, uintptr_t fnc);
260+
void iFEi_32(x64emu_t *emu, uintptr_t fnc);
260261
void iEEL_32(x64emu_t *emu, uintptr_t fnc);
261262
void iEEp_32(x64emu_t *emu, uintptr_t fnc);
262263
void iFEp_32(x64emu_t *emu, uintptr_t fnc);
@@ -928,6 +929,7 @@ void vFEpll_32(x64emu_t *emu, uintptr_t fnc);
928929
void vEEppp_32(x64emu_t *emu, uintptr_t fnc);
929930
void vFEppp_32(x64emu_t *emu, uintptr_t fnc);
930931
void vFEXLp_32(x64emu_t *emu, uintptr_t fnc);
932+
void vFEXpi_32(x64emu_t *emu, uintptr_t fnc);
931933
void vFcccc_32(x64emu_t *emu, uintptr_t fnc);
932934
void vFwwww_32(x64emu_t *emu, uintptr_t fnc);
933935
void vFiiii_32(x64emu_t *emu, uintptr_t fnc);

0 commit comments

Comments
 (0)