Fix wrapper generator

This commit is contained in:
ptitSeb 2019-06-23 17:40:39 +02:00
parent 6b01e4226c
commit 29a33b9836
3 changed files with 33 additions and 21 deletions

View File

@ -104,6 +104,9 @@ def main(root, defines):
continue
if gbl_vals.has_key(v):
for other_key in gbl_vals[v]:
if "!" + other_key == k:
gbl_vals[v].append(k)
break
if other_key == "()":
break
other_key_vals = other_key.split(" && ")

View File

@ -829,11 +829,20 @@ typedef void (*vFfffffffffffffff_t)(float, float, float, float, float, float, fl
typedef uint32_t (*uFpppppppppppppppp_t)(void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*, void*);
typedef void (*vFppuiiiiipuiiiiiiii_t)(void*, void*, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, void*, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t);
#if (!defined(HAVE_LD80BITS))
typedef double (*LFL_t)(double);
typedef double (*LFLL_t)(double, double);
typedef double (*LFLp_t)(double, void*);
#endif
#if (defined(NOALIGN)) || (!defined(NOALIGN))
typedef int32_t (*iFEpppipppp_t)(x86emu_t*, void*, void*, void*, int32_t, void*, void*, void*, void*);
#endif
#if (defined(NOALIGN))
typedef int64_t (*IFpi_t)(void*, int32_t);
typedef double (*dFpi_t)(void*, int32_t);
typedef int32_t (*iFppiiiip_t)(void*, void*, int32_t, int32_t, int32_t, int32_t, void*);
typedef int32_t (*iFEpppipppp_t)(x86emu_t*, void*, void*, void*, int32_t, void*, void*, void*, void*);
#endif
#if (!defined(NOALIGN))
@ -855,12 +864,6 @@ typedef long double (*DFD_t)(long double);
typedef long double (*DFDD_t)(long double, long double);
typedef long double (*DFDp_t)(long double, void*);
#endif
#if (!defined(HAVE_LD80BITS))
typedef double (*LFL_t)(double);
typedef double (*LFLL_t)(double, double);
typedef double (*LFLp_t)(double, void*);
#endif
void iF(x86emu_t *emu, uintptr_t fcn) { iF_t fn = (iF_t)fcn; R_EAX=fn(); }
void vFE(x86emu_t *emu, uintptr_t fcn) { vFE_t fn = (vFE_t)fcn; fn(emu); }
void vFv(x86emu_t *emu, uintptr_t fcn) { vFv_t fn = (vFv_t)fcn; fn(); }
@ -1667,11 +1670,20 @@ void vFfffffffffffffff(x86emu_t *emu, uintptr_t fcn) { vFfffffffffffffff_t fn =
void uFpppppppppppppppp(x86emu_t *emu, uintptr_t fcn) { uFpppppppppppppppp_t fn = (uFpppppppppppppppp_t)fcn; R_EAX=(uint32_t)fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24), *(void**)(R_ESP + 28), *(void**)(R_ESP + 32), *(void**)(R_ESP + 36), *(void**)(R_ESP + 40), *(void**)(R_ESP + 44), *(void**)(R_ESP + 48), *(void**)(R_ESP + 52), *(void**)(R_ESP + 56), *(void**)(R_ESP + 60), *(void**)(R_ESP + 64)); }
void vFppuiiiiipuiiiiiiii(x86emu_t *emu, uintptr_t fcn) { vFppuiiiiipuiiiiiiii_t fn = (vFppuiiiiipuiiiiiiii_t)fcn; fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(int32_t*)(R_ESP + 20), *(int32_t*)(R_ESP + 24), *(int32_t*)(R_ESP + 28), *(int32_t*)(R_ESP + 32), *(void**)(R_ESP + 36), *(uint32_t*)(R_ESP + 40), *(int32_t*)(R_ESP + 44), *(int32_t*)(R_ESP + 48), *(int32_t*)(R_ESP + 52), *(int32_t*)(R_ESP + 56), *(int32_t*)(R_ESP + 60), *(int32_t*)(R_ESP + 64), *(int32_t*)(R_ESP + 68), *(int32_t*)(R_ESP + 72)); }
#if (!defined(HAVE_LD80BITS))
void LFL(x86emu_t *emu, uintptr_t fcn) { LFL_t fn = (LFL_t)fcn; double db=fn(FromLD((void*)(R_ESP + 4))); fpu_do_push(emu); ST0val = db; }
void LFLL(x86emu_t *emu, uintptr_t fcn) { LFLL_t fn = (LFLL_t)fcn; double db=fn(FromLD((void*)(R_ESP + 4)), FromLD((void*)(R_ESP + 16))); fpu_do_push(emu); ST0val = db; }
void LFLp(x86emu_t *emu, uintptr_t fcn) { LFLp_t fn = (LFLp_t)fcn; double db=fn(FromLD((void*)(R_ESP + 4)), *(void**)(R_ESP + 16)); fpu_do_push(emu); ST0val = db; }
#endif
#if (defined(NOALIGN)) || (!defined(NOALIGN))
void iFEpppipppp(x86emu_t *emu, uintptr_t fcn) { iFEpppipppp_t fn = (iFEpppipppp_t)fcn; R_EAX=fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24), *(void**)(R_ESP + 28), *(void**)(R_ESP + 32)); }
#endif
#if (defined(NOALIGN))
void IFpi(x86emu_t *emu, uintptr_t fcn) { IFpi_t fn = (IFpi_t)fcn; ui64_t r; r.i=fn(*(void**)(R_ESP + 4), *(int32_t*)(R_ESP + 8)); R_EAX=r.d[0]; R_EDX=r.d[1]; }
void dFpi(x86emu_t *emu, uintptr_t fcn) { dFpi_t fn = (dFpi_t)fcn; double db=fn(*(void**)(R_ESP + 4), *(int32_t*)(R_ESP + 8)); fpu_do_push(emu); ST0val = db; }
void iFppiiiip(x86emu_t *emu, uintptr_t fcn) { iFppiiiip_t fn = (iFppiiiip_t)fcn; R_EAX=fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(int32_t*)(R_ESP + 20), *(int32_t*)(R_ESP + 24), *(void**)(R_ESP + 28)); }
void iFEpppipppp(x86emu_t *emu, uintptr_t fcn) { iFEpppipppp_t fn = (iFEpppipppp_t)fcn; R_EAX=fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24), *(void**)(R_ESP + 28), *(void**)(R_ESP + 32)); }
#endif
#if (!defined(NOALIGN))
@ -1694,12 +1706,6 @@ void DFDD(x86emu_t *emu, uintptr_t fcn) { DFDD_t fn = (DFDD_t)fcn; long double l
void DFDp(x86emu_t *emu, uintptr_t fcn) { DFDp_t fn = (DFDp_t)fcn; long double ld=fn(*(long double*)(R_ESP + 4), *(void**)(R_ESP + 16)); fpu_do_push(emu); ST0val = ld; }
#endif
#if (!defined(HAVE_LD80BITS))
void LFL(x86emu_t *emu, uintptr_t fcn) { LFL_t fn = (LFL_t)fcn; double db=fn(FromLD((void*)(R_ESP + 4))); fpu_do_push(emu); ST0val = db; }
void LFLL(x86emu_t *emu, uintptr_t fcn) { LFLL_t fn = (LFLL_t)fcn; double db=fn(FromLD((void*)(R_ESP + 4)), FromLD((void*)(R_ESP + 16))); fpu_do_push(emu); ST0val = db; }
void LFLp(x86emu_t *emu, uintptr_t fcn) { LFLp_t fn = (LFLp_t)fcn; double db=fn(FromLD((void*)(R_ESP + 4)), *(void**)(R_ESP + 16)); fpu_do_push(emu); ST0val = db; }
#endif
void iFEpvvpp(x86emu_t *emu, uintptr_t fcn) { iFEppp_t fn = (iFEppp_t)fcn; R_EAX=fn(emu, *(void**)(R_ESP + 4), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20)); }
void iFEvpVV(x86emu_t *emu, uintptr_t fcn) { iFEpVV_t fn = (iFEpVV_t)fcn; R_EAX=fn(emu, *(void**)(R_ESP + 8), (void*)(R_ESP + 12), (void*)(R_ESP + 12)); }
void iFEv(x86emu_t *emu, uintptr_t fcn) { iFE_t fn = (iFE_t)fcn; R_EAX=fn(emu); }

View File

@ -828,11 +828,20 @@ void vFfffffffffffffff(x86emu_t *emu, uintptr_t fnc);
void uFpppppppppppppppp(x86emu_t *emu, uintptr_t fnc);
void vFppuiiiiipuiiiiiiii(x86emu_t *emu, uintptr_t fnc);
#if (!defined(HAVE_LD80BITS))
void LFL(x86emu_t *emu, uintptr_t fnc);
void LFLL(x86emu_t *emu, uintptr_t fnc);
void LFLp(x86emu_t *emu, uintptr_t fnc);
#endif
#if (defined(NOALIGN)) || (!defined(NOALIGN))
void iFEpppipppp(x86emu_t *emu, uintptr_t fnc);
#endif
#if (defined(NOALIGN))
void IFpi(x86emu_t *emu, uintptr_t fnc);
void dFpi(x86emu_t *emu, uintptr_t fnc);
void iFppiiiip(x86emu_t *emu, uintptr_t fnc);
void iFEpppipppp(x86emu_t *emu, uintptr_t fnc);
#endif
#if (!defined(NOALIGN))
@ -855,12 +864,6 @@ void DFDD(x86emu_t *emu, uintptr_t fnc);
void DFDp(x86emu_t *emu, uintptr_t fnc);
#endif
#if (!defined(HAVE_LD80BITS))
void LFL(x86emu_t *emu, uintptr_t fnc);
void LFLL(x86emu_t *emu, uintptr_t fnc);
void LFLp(x86emu_t *emu, uintptr_t fnc);
#endif
void iFEpvvpp(x86emu_t *emu, uintptr_t fnc);
void iFEvpVV(x86emu_t *emu, uintptr_t fnc);
void iFEv(x86emu_t *emu, uintptr_t fnc);