Skip to content

Commit

Permalink
[BOX32][WRAPPER] Added a few more wrapped functions to libGL, libasou…
Browse files Browse the repository at this point in the history
…nd and libX11
  • Loading branch information
ptitSeb committed Sep 30, 2024
1 parent f26146b commit 28dedd6
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 23 deletions.
14 changes: 14 additions & 0 deletions src/wrapped32/generated/functions_list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@
#() pFpL -> pFpL
#() pFpp -> pFpp
#() pFXi -> pFXi
#() pFXu -> pFXu
#() hFpa -> hFpa
#() SFip -> SFip
#() SFpp -> SFpp
Expand Down Expand Up @@ -362,6 +363,7 @@
#() iFXii -> iFXii
#() iFXip -> iFXip
#() iFXuu -> iFXuu
#() iFXup -> iFXup
#() iFXLl -> iFXLl
#() iFXLL -> iFXLL
#() iFXLp -> iFXLp
Expand Down Expand Up @@ -432,6 +434,7 @@
#() iFpbL_p -> iFpBp
#() iFBp_LL -> iFBLL
#() iFBp_pi -> iFBpi
#() iFXBL_p -> iFXBp
#() IFpBp_i -> IFpBi
#() UFpBp_i -> UFpBi
#() fFpBp_p -> fFpBp
Expand Down Expand Up @@ -579,10 +582,13 @@
#() iFpppi -> iFpppi
#() iFpppp -> iFpppp
#() iFSpiL -> iFSpiL
#() iFXiip -> iFXiip
#() iFXipi -> iFXipi
#() iFXipp -> iFXipp
#() iFXuup -> iFXuup
#() iFXLii -> iFXLii
#() iFXpip -> iFXpip
#() iFXppi -> iFXppi
#() iFXppp -> iFXppp
#() IFEpIi -> IFEpIi
#() CFuuff -> CFuuff
Expand Down Expand Up @@ -746,13 +752,15 @@
#() iFiLLLL -> iFiLLLL
#() iFipLLi -> iFipLLi
#() iFuiuup -> iFuiuup
#() iFpippp -> iFpippp
#() iFpCCCC -> iFpCCCC
#() iFpLuLi -> iFpLuLi
#() iFppiUi -> iFppiUi
#() iFpppip -> iFpppip
#() iFpppLp -> iFpppLp
#() iFppppp -> iFppppp
#() iFXiiip -> iFXiiip
#() iFXpipi -> iFXpipi
#() iFXpppp -> iFXpppp
#() IFXpIII -> IFXpIII
#() uFpLLLS -> uFpLLLS
Expand All @@ -771,6 +779,7 @@
#() pFppuup -> pFppuup
#() pFppupp -> pFppupp
#() pFXpipi -> pFXpipi
#() pFXppip -> pFXppip
#() iFEBh_ppp -> iFEBppp
#() LFpbp_LLp -> LFpBLLp
#() LFpBp_LLp -> LFpBLLp
Expand Down Expand Up @@ -1072,6 +1081,7 @@
#() vFuuiiiiuuiiiiiii -> vFuuiiiiuuiiiiiii
#() vFfffffffffffffff -> vFfffffffffffffff
#() vFuuuuiiiiuuiiiiiii -> vFuuuuiiiiuuiiiiiii
#() vFXpuiiiiipuiiiiiiii -> vFXpuiiiiipuiiiiiiii
#() uFippuuuuiiiiuuiiiiiiiipp -> uFippuuuuiiiiuuiiiiiiiipp
#defined(HAVE_LD80BITS) DFD -> DFD
#defined(HAVE_LD80BITS) DFDD -> DFDD
Expand Down Expand Up @@ -1160,6 +1170,10 @@ wrappedldlinux:
- pFp:
- __tls_get_addr
wrappedlibasound:
- iFp:
- snd_device_name_free_hint
- iFipp:
- snd_device_name_hint
- iFpppp:
- snd_pcm_mmap_begin
wrappedlibc:
Expand Down
4 changes: 4 additions & 0 deletions src/wrapped32/generated/wrappedlibasoundtypes32.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@
#define ADDED_FUNCTIONS()
#endif

typedef int32_t (*iFp_t)(void*);
typedef int32_t (*iFipp_t)(int32_t, void*, void*);
typedef int32_t (*iFpppp_t)(void*, void*, void*, void*);

#define SUPER() ADDED_FUNCTIONS() \
GO(snd_device_name_free_hint, iFp_t) \
GO(snd_device_name_hint, iFipp_t) \
GO(snd_pcm_mmap_begin, iFpppp_t)

#endif // __wrappedlibasoundTYPES32_H_
20 changes: 20 additions & 0 deletions src/wrapped32/generated/wrapper32.c

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions src/wrapped32/generated/wrapper32.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ void pFpu_32(x64emu_t *emu, uintptr_t fnc);
void pFpL_32(x64emu_t *emu, uintptr_t fnc);
void pFpp_32(x64emu_t *emu, uintptr_t fnc);
void pFXi_32(x64emu_t *emu, uintptr_t fnc);
void pFXu_32(x64emu_t *emu, uintptr_t fnc);
void hFpa_32(x64emu_t *emu, uintptr_t fnc);
void SFip_32(x64emu_t *emu, uintptr_t fnc);
void SFpp_32(x64emu_t *emu, uintptr_t fnc);
Expand Down Expand Up @@ -403,6 +404,7 @@ void iFSli_32(x64emu_t *emu, uintptr_t fnc);
void iFXii_32(x64emu_t *emu, uintptr_t fnc);
void iFXip_32(x64emu_t *emu, uintptr_t fnc);
void iFXuu_32(x64emu_t *emu, uintptr_t fnc);
void iFXup_32(x64emu_t *emu, uintptr_t fnc);
void iFXLl_32(x64emu_t *emu, uintptr_t fnc);
void iFXLL_32(x64emu_t *emu, uintptr_t fnc);
void iFXLp_32(x64emu_t *emu, uintptr_t fnc);
Expand Down Expand Up @@ -473,6 +475,7 @@ void iFppbL__32(x64emu_t *emu, uintptr_t fnc);
void iFpbL_p_32(x64emu_t *emu, uintptr_t fnc);
void iFBp_LL_32(x64emu_t *emu, uintptr_t fnc);
void iFBp_pi_32(x64emu_t *emu, uintptr_t fnc);
void iFXBL_p_32(x64emu_t *emu, uintptr_t fnc);
void IFpBp_i_32(x64emu_t *emu, uintptr_t fnc);
void UFpBp_i_32(x64emu_t *emu, uintptr_t fnc);
void fFpBp_p_32(x64emu_t *emu, uintptr_t fnc);
Expand Down Expand Up @@ -620,10 +623,13 @@ void iFppLi_32(x64emu_t *emu, uintptr_t fnc);
void iFpppi_32(x64emu_t *emu, uintptr_t fnc);
void iFpppp_32(x64emu_t *emu, uintptr_t fnc);
void iFSpiL_32(x64emu_t *emu, uintptr_t fnc);
void iFXiip_32(x64emu_t *emu, uintptr_t fnc);
void iFXipi_32(x64emu_t *emu, uintptr_t fnc);
void iFXipp_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 iFXpip_32(x64emu_t *emu, uintptr_t fnc);
void iFXppi_32(x64emu_t *emu, uintptr_t fnc);
void iFXppp_32(x64emu_t *emu, uintptr_t fnc);
void IFEpIi_32(x64emu_t *emu, uintptr_t fnc);
void CFuuff_32(x64emu_t *emu, uintptr_t fnc);
Expand Down Expand Up @@ -787,13 +793,15 @@ 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 iFuiuup_32(x64emu_t *emu, uintptr_t fnc);
void iFpippp_32(x64emu_t *emu, uintptr_t fnc);
void iFpCCCC_32(x64emu_t *emu, uintptr_t fnc);
void iFpLuLi_32(x64emu_t *emu, uintptr_t fnc);
void iFppiUi_32(x64emu_t *emu, uintptr_t fnc);
void iFpppip_32(x64emu_t *emu, uintptr_t fnc);
void iFpppLp_32(x64emu_t *emu, uintptr_t fnc);
void iFppppp_32(x64emu_t *emu, uintptr_t fnc);
void iFXiiip_32(x64emu_t *emu, uintptr_t fnc);
void iFXpipi_32(x64emu_t *emu, uintptr_t fnc);
void iFXpppp_32(x64emu_t *emu, uintptr_t fnc);
void IFXpIII_32(x64emu_t *emu, uintptr_t fnc);
void uFpLLLS_32(x64emu_t *emu, uintptr_t fnc);
Expand All @@ -812,6 +820,7 @@ void pFpuuip_32(x64emu_t *emu, uintptr_t fnc);
void pFppuup_32(x64emu_t *emu, uintptr_t fnc);
void pFppupp_32(x64emu_t *emu, uintptr_t fnc);
void pFXpipi_32(x64emu_t *emu, uintptr_t fnc);
void pFXppip_32(x64emu_t *emu, uintptr_t fnc);
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);
Expand Down Expand Up @@ -1113,6 +1122,7 @@ void vFuiiiiiuiiiiilll_32(x64emu_t *emu, uintptr_t fnc);
void vFuuiiiiuuiiiiiii_32(x64emu_t *emu, uintptr_t fnc);
void vFfffffffffffffff_32(x64emu_t *emu, uintptr_t fnc);
void vFuuuuiiiiuuiiiiiii_32(x64emu_t *emu, uintptr_t fnc);
void vFXpuiiiiipuiiiiiiii_32(x64emu_t *emu, uintptr_t fnc);
void uFippuuuuiiiiuuiiiiiiiipp_32(x64emu_t *emu, uintptr_t fnc);

#if defined(HAVE_LD80BITS)
Expand Down
25 changes: 25 additions & 0 deletions src/wrapped32/wrappedlibasound.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,31 @@ EXPORT int my32_snd_pcm_mmap_begin(x64emu_t* emu, void* pcm, ptr_t* areas, ulong
return ret;
}

EXPORT int my32_snd_device_name_hint(x64emu_t* emu, int card, void* iface, ptr_t* hints)
{
void** hints_l = NULL;
int ret = my->snd_device_name_hint(card, iface, &hints_l);
if(ret) return ret;
*hints = to_ptrv(hints_l);
// inplace shrink
int n = 0;
while(hints_l[n]) ++n;
++n;
for(int i=0; i<n; ++i)
((ptr_t*)hints_l)[i] = to_ptrv(hints_l[i]);
return ret;
}

EXPORT int my32_snd_device_name_free_hint(x64emu_t* emu, ptr_t* hints)
{
void** hints_l = (void**)hints;
int n=0;
while(hints[n]) ++n;
for(int i=n; i>=0; --i)
hints_l[i] = from_ptrv(hints[i]);
return my->snd_device_name_free_hint(hints_l);
}

void* my_dlopen(x64emu_t* emu, void *filename, int flag); // defined in wrappedlibdl.c
char* my_dlerror(x64emu_t* emu);
int my_dlclose(x64emu_t* emu, void *handle);
Expand Down
6 changes: 3 additions & 3 deletions src/wrapped32/wrappedlibasound_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ GO(snd_strerror, pFi)
//GO(snd_config_get_bool, iFp)
//GO(snd_config_get_ctl_iface_ascii, iFp)
//GO(snd_config_get_ctl_iface, iFp)
//GO(snd_device_name_free_hint, iFp)
//GO(snd_device_name_get_hint, pFpp)
//GO(snd_device_name_hint, iFipp)
GOM(snd_device_name_free_hint, iFEp)
GO(snd_device_name_get_hint, pFpp)
GOM(snd_device_name_hint, iFEipp)
//GO(snd_names_list, iFpp)
//GO(snd_names_list_free, vFp)
//GO(snd_pcm_format_mask_sizeof, LFv)
Expand Down
38 changes: 19 additions & 19 deletions src/wrapped32/wrappedlibgl_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -2930,17 +2930,17 @@ GO(glXBindHyperpipeSGIX, iFXi)
GO(glXBindTexImageEXT, vFXpip)
GO(glXBindSwapBarrierNV, iFXuu)
GO(glXBindSwapBarrierSGIX,vFii)
//GO(glXBindVideoCaptureDeviceNV, iFpup)
//GO(glXBindVideoDeviceNV, iFpuup)
//GO(glXBindVideoImageNV, iFpppi)
GO(glXBindVideoCaptureDeviceNV, iFXup)
GO(glXBindVideoDeviceNV, iFXuup)
GO(glXBindVideoImageNV, iFXppi)
//GO(glXChangeDrawableAttributes, vFp)
//GO(glXChangeDrawableAttributesSGIX, vFp)
GO(glXClientInfo, vFv)
//GO(glXCopyContext, vFppp)
GOM(glXChooseFBConfig, pFEXipp)
//GO(glXChooseFBConfigSGIX, pFpipp)
GO(glXCreateContext,pFXppi)
//GO(glXCreateContextAttribsARB, pFpppip)
GO(glXCreateContextAttribsARB, pFXppip)
//GO(glXCreateContextWithConfigSGIX, pFppipi)
//GO(glXCreateGLXPbufferSGIX, pFppuup)
//GO(glXCreateGLXPixmap, pFppp)
Expand All @@ -2951,7 +2951,7 @@ GO(glXCreatePbuffer, pFXpp)
GO(glXCreatePixmap, pFXpp)
GO(glXCreateWindow, pFXppp)
GO(glXChooseVisual, pFXip) // need to wrap XVisualInfo?
//GO(glXCopyImageSubDataNV, vFppuiiiiipuiiiiiiii)
GO(glXCopyImageSubDataNV, vFXpuiiiiipuiiiiiiii)
//GO(glXCopySubBufferMESA, vFppiiii)
GO(glXDestroyContext,vFXp)
//GO(glXDestroyGLXPbufferSGIX,vFpp)
Expand All @@ -2961,12 +2961,12 @@ GO(glXDestroyContext,vFXp)
GO(glXDestroyPbuffer,vFXp)
GO(glXDestroyPixmap,vFXp)
GO(glXDestroyWindow,vFXp)
//GO(glXEnumerateVideoCaptureDevicesNV, pFpip)
//GO(glXEnumerateVideoDevicesNV, pFpip)
//GO(glXFreeContextEXT, vFpp)
GO(glXEnumerateVideoCaptureDevicesNV, pFXip)
GO(glXEnumerateVideoDevicesNV, pFXip)
GO(glXFreeContextEXT, vFXp)
GO(glXGetClientString, pFXi)
//GO(glXGetConfig, iFppip)
//GO(glXGetContextIDEXT, uFp)
GO(glXGetContextIDEXT, uFp)
GO(glXGetCurrentContext, pFv)
GO(glXGetCurrentDisplay, XFv)
GO(glXGetCurrentDrawable, pFv)
Expand All @@ -2980,23 +2980,23 @@ GO(glXGetFBConfigAttrib, iFXpip)
//GO(glXGetFBConfigsSGIX,pFpip)
GO(glXGetSelectedEvent, vFXpp)
GO(glXGetSelectedEventSGIX, vFXpp)
//GO(glXGetVideoDeviceNV, iFpiip)
//GO(glXGetVideoInfoNV, iFpippp)
GO(glXGetVideoDeviceNV, iFXiip)
GO(glXGetVideoInfoNV, iFpippp)
//GO(glXGetVideoSyncSGI, iFp)
//GO(glXGetVisualConfigs,pFpp)
GOM(glXGetVisualFromFBConfig, pFEXp)
//GO(glXGetVisualFromFBConfigSGIX, pFpp)
//GO(glXHyperpipeAttribSGIX,iFpiiip)
//GO(glXHyperpipeConfigSGIX, iFpiipp)
//GO(glXImportContextEXT, pFpu)
GO(glXImportContextEXT, pFXu)
//GO(glXIsDirect,iFpp)
GO(glXJoinSwapGroupNV, iFXpu)
//GO(glXJoinSwapGroupSGIX,vFpp)
//GO(glXLockVideoCaptureDeviceNV, vFpp)
GO(glXLockVideoCaptureDeviceNV, vFXp)
GO(glXMakeContextCurrent,iFXppp)
GO(glXMakeCurrent,iFXpp)
GO(glXQueryContext,iFXpip)
//GO(glXQueryContextInfoEXT,iFppip)
GO(glXQueryContextInfoEXT,iFXpip)
GO(glXQueryDrawable, iFXpip)
GO(glXQueryExtension, iFXpp)
GO(glXQueryExtensionsString,pFXi)
Expand All @@ -3011,17 +3011,17 @@ GO(glXQueryMaxSwapGroupsNV, iFXipp)
//GO(glXQueryServerString,pFpii)
GO(glXQuerySwapGroupNV, iFXipp)
GO(glXQueryVersion,iFXpp)
//GO(glXQueryVideoCaptureDeviceNV, iFppip)
GO(glXQueryVideoCaptureDeviceNV, iFXpip)
GO(glXReleaseTexImageEXT, vFXpi)
//GO(glXReleaseVideoCaptureDeviceNV, vFpp)
//GO(glXReleaseVideoDeviceNV, iFpip)
//GO(glXReleaseVideoImageNV, iFpp)
GO(glXReleaseVideoCaptureDeviceNV, vFXp)
GO(glXReleaseVideoDeviceNV, iFXip)
GO(glXReleaseVideoImageNV, iFXp)
GO(glXRender, vFv)
GO(glXRenderLarge, vFv)
GO(glXResetFrameCountNV, iFXi)
GO(glXSelectEvent, vFXpu)
//GO(glXSelectEventSGIX, vFppu)
//GO(glXSendPbufferToVideoNV, iFppipi)
GO(glXSendPbufferToVideoNV, iFXpipi)
GO(glXSwapBuffers,vFXp)
//GO(glXUseXFont,vFpiii)
GO(glXVendorPrivate, vFv)
Expand Down
2 changes: 1 addition & 1 deletion src/wrapped32/wrappedlibx11_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ GO(XGetErrorText, iFXipi)
GO(XGetICValues, pFpppppppppp) // use varargs...
GOM(XGetImage, pFEXLiiuuLi) // return an XImage with callbacks that needs wrapping
//GO(XGetIMValues, pFppppppp) // use varargs
//GO(XGetInputFocus, iFppp)
GO(XGetInputFocus, iFXBL_p)
//GO(XGetKeyboardControl, iFpp)
//GO(XGetKeyboardMapping, pFpCip)
//GO(_XGetLCValues,
Expand Down

0 comments on commit 28dedd6

Please sign in to comment.