about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2024-12-13 16:19:12 +0100
committerptitSeb <sebastien.chev@gmail.com>2024-12-13 16:19:12 +0100
commit3ee5558c70a384d3791c27ab94ca97f7e8198732 (patch)
treef824e9182c117a56b7f2c875fcb87064376d9844
parent059dc12adc1c61122ff298b98f922d7f9a042fe0 (diff)
downloadbox64-3ee5558c70a384d3791c27ab94ca97f7e8198732.tar.gz
box64-3ee5558c70a384d3791c27ab94ca97f7e8198732.zip
[BOX32][WRAPPER] Added a 32bits dummy libvdpau wrapped lib
-rw-r--r--CMakeLists.txt1
-rw-r--r--src/library_list_32.h2
-rw-r--r--src/wrapped32/generated/functions_list.txt4
-rw-r--r--src/wrapped32/generated/wrappedlibvdpaudefs32.h8
-rw-r--r--src/wrapped32/generated/wrappedlibvdpautypes32.h19
-rw-r--r--src/wrapped32/generated/wrappedlibvdpauundefs32.h8
-rw-r--r--src/wrapped32/generated/wrapper32.c2
-rw-r--r--src/wrapped32/generated/wrapper32.h1
-rw-r--r--src/wrapped32/wrappedlibvdpau.c35
-rw-r--r--src/wrapped32/wrappedlibvdpau_private.h5
10 files changed, 85 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4ea3b8c8..7e2a3070 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -839,6 +839,7 @@ if(BOX32)
         "${BOX64_ROOT}/src/wrapped32/wrappedtcmallocminimal.c"
         "${BOX64_ROOT}/src/wrapped32/wrappedcairo.c"
         "${BOX64_ROOT}/src/wrapped32/wrappedlibdrm.c"
+        "${BOX64_ROOT}/src/wrapped32/wrappedlibvdpau.c"
     )
     endif()
     string(REPLACE ".c" "_private.h" MODROOT ${BOX64_ROOT})
diff --git a/src/library_list_32.h b/src/library_list_32.h
index 2adf7777..8111b6b6 100644
--- a/src/library_list_32.h
+++ b/src/library_list_32.h
@@ -75,6 +75,8 @@ GO("libcairo.so.2", cairo)
 GO("libcairo.so", cairo)
 GO("libdrm.so.2", libdrm)
 GO("libdrm.so", libdrm)
+GO("libvdpau.so.1", libvdpau)
+GO("libvdpau.so", libvdpau)
 
 GO("crashhandler.so", crashhandler)
 GO("libtcmalloc_minimal.so.0", tcmallocminimal)
diff --git a/src/wrapped32/generated/functions_list.txt b/src/wrapped32/generated/functions_list.txt
index 9bd5d433..e40ec5a1 100644
--- a/src/wrapped32/generated/functions_list.txt
+++ b/src/wrapped32/generated/functions_list.txt
@@ -1168,6 +1168,7 @@
 #() iEEipuu -> iEEipuu
 #() iEEippL -> iEEippL
 #() iEEpipp -> iEEpipp
+#() iFEpipp -> iFEpipp
 #() iEEpipV -> iEEpipV
 #() iFEpuip -> iFEpuip
 #() iFEpupu -> iFEpupu
@@ -2375,6 +2376,9 @@ wrappedlibrt:
 - iEuBLL_:
   - __clock_gettime
 wrappedlibuuid:
+wrappedlibvdpau:
+- iFpipp:
+  - vdp_device_create_x11
 wrappedlibx11:
 - vFp:
   - XFreeStringList
diff --git a/src/wrapped32/generated/wrappedlibvdpaudefs32.h b/src/wrapped32/generated/wrappedlibvdpaudefs32.h
new file mode 100644
index 00000000..78de7a74
--- /dev/null
+++ b/src/wrapped32/generated/wrappedlibvdpaudefs32.h
@@ -0,0 +1,8 @@
+/*********************************************************************
+ * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) *
+ *********************************************************************/
+#ifndef __wrappedlibvdpauDEFS32_H_
+#define __wrappedlibvdpauDEFS32_H_
+
+
+#endif // __wrappedlibvdpauDEFS32_H_
diff --git a/src/wrapped32/generated/wrappedlibvdpautypes32.h b/src/wrapped32/generated/wrappedlibvdpautypes32.h
new file mode 100644
index 00000000..dcc89d02
--- /dev/null
+++ b/src/wrapped32/generated/wrappedlibvdpautypes32.h
@@ -0,0 +1,19 @@
+/*********************************************************************
+ * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) *
+ *********************************************************************/
+#ifndef __wrappedlibvdpauTYPES32_H_
+#define __wrappedlibvdpauTYPES32_H_
+
+#ifndef LIBNAME
+#error You should only #include this file inside a wrapped*.c file
+#endif
+#ifndef ADDED_FUNCTIONS
+#define ADDED_FUNCTIONS() 
+#endif
+
+typedef int32_t (*iFpipp_t)(void*, int32_t, void*, void*);
+
+#define SUPER() ADDED_FUNCTIONS() \
+	GO(vdp_device_create_x11, iFpipp_t)
+
+#endif // __wrappedlibvdpauTYPES32_H_
diff --git a/src/wrapped32/generated/wrappedlibvdpauundefs32.h b/src/wrapped32/generated/wrappedlibvdpauundefs32.h
new file mode 100644
index 00000000..97149775
--- /dev/null
+++ b/src/wrapped32/generated/wrappedlibvdpauundefs32.h
@@ -0,0 +1,8 @@
+/*********************************************************************
+ * File automatically generated by rebuild_wrappers_32.py (v0.0.2.2) *
+ *********************************************************************/
+#ifndef __wrappedlibvdpauUNDEFS32_H_
+#define __wrappedlibvdpauUNDEFS32_H_
+
+
+#endif // __wrappedlibvdpauUNDEFS32_H_
diff --git a/src/wrapped32/generated/wrapper32.c b/src/wrapped32/generated/wrapper32.c
index fa5dc5e8..8b6ba9c0 100644
--- a/src/wrapped32/generated/wrapper32.c
+++ b/src/wrapped32/generated/wrapper32.c
@@ -1259,6 +1259,7 @@ typedef int32_t (*iEEipii_t)(x64emu_t*, int32_t, void*, int32_t, int32_t);
 typedef int32_t (*iEEipuu_t)(x64emu_t*, int32_t, void*, uint32_t, uint32_t);
 typedef int32_t (*iEEippL_t)(x64emu_t*, int32_t, void*, void*, uintptr_t);
 typedef int32_t (*iEEpipp_t)(x64emu_t*, void*, int32_t, void*, void*);
+typedef int32_t (*iFEpipp_t)(x64emu_t*, void*, int32_t, void*, void*);
 typedef int32_t (*iEEpipV_t)(x64emu_t*, void*, int32_t, void*, void*);
 typedef int32_t (*iFEpuip_t)(x64emu_t*, void*, uint32_t, int32_t, void*);
 typedef int32_t (*iFEpupu_t)(x64emu_t*, void*, uint32_t, void*, uint32_t);
@@ -3018,6 +3019,7 @@ void iEEipii_32(x64emu_t *emu, uintptr_t fcn) { iEEipii_t fn = (iEEipii_t)fcn; e
 void iEEipuu_32(x64emu_t *emu, uintptr_t fcn) { iEEipuu_t fn = (iEEipuu_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16)); emu->libc_err = errno; }
 void iEEippL_32(x64emu_t *emu, uintptr_t fcn) { iEEippL_t fn = (iEEippL_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ulong(from_ptri(ulong_t, R_ESP + 16))); emu->libc_err = errno; }
 void iEEpipp_32(x64emu_t *emu, uintptr_t fcn) { iEEpipp_t fn = (iEEpipp_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); emu->libc_err = errno; }
+void iFEpipp_32(x64emu_t *emu, uintptr_t fcn) { iFEpipp_t fn = (iFEpipp_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16)); }
 void iEEpipV_32(x64emu_t *emu, uintptr_t fcn) { iEEpipV_t fn = (iEEpipV_t)fcn; errno = emu->libc_err; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptrv(R_ESP + 16)); emu->libc_err = errno; }
 void iFEpuip_32(x64emu_t *emu, uintptr_t fcn) { iFEpuip_t fn = (iFEpuip_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16)); }
 void iFEpupu_32(x64emu_t *emu, uintptr_t fcn) { iFEpupu_t fn = (iFEpupu_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16)); }
diff --git a/src/wrapped32/generated/wrapper32.h b/src/wrapped32/generated/wrapper32.h
index 56328d42..51d50e4a 100644
--- a/src/wrapped32/generated/wrapper32.h
+++ b/src/wrapped32/generated/wrapper32.h
@@ -1209,6 +1209,7 @@ void iEEipii_32(x64emu_t *emu, uintptr_t fnc);
 void iEEipuu_32(x64emu_t *emu, uintptr_t fnc);
 void iEEippL_32(x64emu_t *emu, uintptr_t fnc);
 void iEEpipp_32(x64emu_t *emu, uintptr_t fnc);
+void iFEpipp_32(x64emu_t *emu, uintptr_t fnc);
 void iEEpipV_32(x64emu_t *emu, uintptr_t fnc);
 void iFEpuip_32(x64emu_t *emu, uintptr_t fnc);
 void iFEpupu_32(x64emu_t *emu, uintptr_t fnc);
diff --git a/src/wrapped32/wrappedlibvdpau.c b/src/wrapped32/wrappedlibvdpau.c
new file mode 100644
index 00000000..92989308
--- /dev/null
+++ b/src/wrapped32/wrappedlibvdpau.c
@@ -0,0 +1,35 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#define _GNU_SOURCE         /* See feature_test_macros(7) */
+#include <dlfcn.h>
+
+#include "wrappedlibs.h"
+
+#include "debug.h"
+#include "wrapper32.h"
+#include "bridge.h"
+#include "librarian/library_private.h"
+#include "x64emu.h"
+#include "callback.h"
+#include "librarian.h"
+#include "box32context.h"
+#include "emu/x64emu_private.h"
+#include "myalign32.h"
+
+static const char* libvdpauName = "libvdpau.so.1";
+#define LIBNAME libvdpau
+
+
+#define ADDED_FUNCTIONS()       \
+
+#include "generated/wrappedlibvdpautypes32.h"
+
+#include "wrappercallback32.h"
+
+EXPORT uint32_t my32_vdp_device_create_x11(x64emu_t* emu, void* display, int screen, void* device, ptr_t* get_proc_address)
+{
+    return 1;   // VDP_STATUS_NO_IMPLEMENTATION
+}
+
+#include "wrappedlib_init32.h"
diff --git a/src/wrapped32/wrappedlibvdpau_private.h b/src/wrapped32/wrappedlibvdpau_private.h
new file mode 100644
index 00000000..9bfa63ff
--- /dev/null
+++ b/src/wrapped32/wrappedlibvdpau_private.h
@@ -0,0 +1,5 @@
+#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA))
+#error meh!
+#endif
+
+GOM(vdp_device_create_x11, iFEpipp) // last is a pointer to a VdpGetProcAddress function
\ No newline at end of file