mirror of
https://github.com/ptitSeb/box64.git
synced 2026-11-09 17:43:18 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
634f3c0f58 | ||
|
|
f3d3a8a8ed | ||
|
|
721038513f | ||
|
|
195efffa15 | ||
|
|
ae4f43fdb9 | ||
|
|
4ce40ad239 | ||
|
|
ca345d7f55 | ||
|
|
066410a31d | ||
|
|
30e8fa9620 | ||
|
|
64826243dd | ||
|
|
2357057bb5 | ||
|
|
c257075df0 | ||
|
|
b1fa994d82 | ||
|
|
56daf71a86 | ||
|
|
4ac26b61b3 | ||
|
|
cd3a042776 | ||
|
|
7fd7479b84 | ||
|
|
9a8c07faf5 | ||
|
|
335777a681 | ||
|
|
9479d7ae07 | ||
|
|
4827427ac0 | ||
|
|
8e732046ba | ||
|
|
f08b88cce5 | ||
|
|
5a244911cc | ||
|
|
02161dc4d7 | ||
|
|
a62f686024 | ||
|
|
1b09e8a6b0 | ||
|
|
23917fa07e | ||
|
|
0a7963588e | ||
|
|
42d281bfe3 | ||
|
|
5e28ebef06 | ||
|
|
3fa01e53b9 | ||
|
|
ecac1815db | ||
|
|
79f365753e | ||
|
|
64b7198144 | ||
|
|
f3743b6599 | ||
|
|
8a0af31a49 | ||
|
|
044b88dbce | ||
|
|
acf06e6a94 | ||
|
|
c8922d2efd | ||
|
|
3786e7569d | ||
|
|
70ad747a9c | ||
|
|
ce322774d8 | ||
|
|
7309be6339 | ||
|
|
5edc83c556 | ||
|
|
2c86fb8c73 | ||
|
|
25937c5b73 | ||
|
|
43833df092 | ||
|
|
93c19dc3f8 | ||
|
|
a4e53b929b | ||
|
|
18534d56e2 | ||
|
|
fd35361614 | ||
|
|
85dfd5b978 | ||
|
|
b23fcc83c1 | ||
|
|
d625cf68e5 | ||
|
|
b7683b77a7 | ||
|
|
3b81d44491 | ||
|
|
949bbb40eb | ||
|
|
5ce5951f5d | ||
|
|
09428c185e | ||
|
|
ad1bfc57b4 | ||
|
|
b971a37ee3 | ||
|
|
3ca6ac6145 | ||
|
|
c2f4ce9c5a | ||
|
|
66fee75fc2 | ||
|
|
367e4ac3f7 | ||
|
|
094f961a0a | ||
|
|
be676d7fa6 | ||
|
|
32d92866e9 | ||
|
|
de8a3de7ae | ||
|
|
cdd33ffec4 | ||
|
|
340bdb0b6c | ||
|
|
7f4762e632 | ||
|
|
22b4b9c18d | ||
|
|
d31a6c0ba6 | ||
|
|
59779aea37 | ||
|
|
50fa1046c7 | ||
|
|
0e958fed2e | ||
|
|
def0f3564c | ||
|
|
7da2c56d0a | ||
|
|
1321431812 | ||
|
|
d93a243738 | ||
|
|
fa24bbd96a | ||
|
|
5eca802a5a | ||
|
|
89d6f73aff | ||
|
|
0bb2043f97 | ||
|
|
62c22e55e7 | ||
|
|
23eef578f7 | ||
|
|
ce8a482a62 | ||
|
|
76f5319b05 | ||
|
|
448e5155a4 | ||
|
|
3ee26b727c | ||
|
|
544a496f08 | ||
|
|
14f0497e64 | ||
|
|
9ab80d228b | ||
|
|
3f4599e562 | ||
|
|
973714b4cc | ||
|
|
bb3458e26b | ||
|
|
0692d4f3f2 | ||
|
|
7a08d50f18 | ||
|
|
987e6e03f1 | ||
|
|
5004513596 | ||
|
|
749961af32 | ||
|
|
eda8b442e0 | ||
|
|
9d0e59b31c | ||
|
|
1771694ee1 | ||
|
|
85d16af0d0 | ||
|
|
a80c739067 | ||
|
|
73b2eb4a72 | ||
|
|
4c7cbe4128 | ||
|
|
343174fd47 | ||
|
|
3c20930550 | ||
|
|
0e109a9e33 |
No files matched your search
+13
-2
@@ -1,6 +1,17 @@
|
||||
Current version
|
||||
v0.0.4
|
||||
======
|
||||
* Using box86 as a base, implemented most planned box64 part except dyanrec
|
||||
* Added a lot of opcodes
|
||||
* Added SDL1 and SDL2 wrapping
|
||||
* OpenGL/GLU wrapping done
|
||||
* libasound / libpulse wrapping done
|
||||
* libopenal / libalure / libalut wrapping done
|
||||
* Many X11 libs wrapped
|
||||
* Added "install" with binfmt integration
|
||||
* A few games are actualy starting now (old WorldOfGoo, Into The Breach, VVVVVV and Thimbeweed Park)
|
||||
|
||||
v0.0.2
|
||||
======
|
||||
* Using box86 as a base, implemented most planned box64 part except dynarec
|
||||
* Wrapped a few libs
|
||||
* ELF loader a bit crude, but seems working
|
||||
* Signal handling implemented
|
||||
|
||||
+45
-2
@@ -113,8 +113,15 @@ set(ELFLOADER_SRC
|
||||
"${BOX64_ROOT}/src/emu/x64run64.c"
|
||||
"${BOX64_ROOT}/src/emu/x64run66.c"
|
||||
"${BOX64_ROOT}/src/emu/x64run660f.c"
|
||||
"${BOX64_ROOT}/src/emu/x64run6664.c"
|
||||
"${BOX64_ROOT}/src/emu/x64run66d9.c"
|
||||
"${BOX64_ROOT}/src/emu/x64run66dd.c"
|
||||
"${BOX64_ROOT}/src/emu/x64run67.c"
|
||||
"${BOX64_ROOT}/src/emu/x64rund8.c"
|
||||
"${BOX64_ROOT}/src/emu/x64rund9.c"
|
||||
"${BOX64_ROOT}/src/emu/x64runda.c"
|
||||
"${BOX64_ROOT}/src/emu/x64rundb.c"
|
||||
"${BOX64_ROOT}/src/emu/x64rundd.c"
|
||||
"${BOX64_ROOT}/src/emu/x64rundf.c"
|
||||
"${BOX64_ROOT}/src/emu/x64runf0.c"
|
||||
"${BOX64_ROOT}/src/emu/x64runf20f.c"
|
||||
@@ -127,6 +134,8 @@ set(ELFLOADER_SRC
|
||||
"${BOX64_ROOT}/src/librarian/library.c"
|
||||
"${BOX64_ROOT}/src/libtools/auxval.c"
|
||||
"${BOX64_ROOT}/src/libtools/myalign.c"
|
||||
"${BOX64_ROOT}/src/libtools/sdl1rwops.c"
|
||||
"${BOX64_ROOT}/src/libtools/sdl2rwops.c"
|
||||
"${BOX64_ROOT}/src/libtools/signals.c"
|
||||
"${BOX64_ROOT}/src/libtools/threads.c"
|
||||
"${BOX64_ROOT}/src/tools/box64stack.c"
|
||||
@@ -140,12 +149,41 @@ set(ELFLOADER_SRC
|
||||
)
|
||||
|
||||
set(WRAPPEDS
|
||||
"${BOX64_ROOT}/src/wrapped/wrappedalure.c"
|
||||
"${BOX64_ROOT}/src/wrapped/wrappedalut.c"
|
||||
"${BOX64_ROOT}/src/wrapped/wrappedldlinux.c"
|
||||
"${BOX64_ROOT}/src/wrapped/wrappedlibasound.c"
|
||||
"${BOX64_ROOT}/src/wrapped/wrappedlibc.c"
|
||||
"${BOX64_ROOT}/src/wrapped/wrappedlibm.c"
|
||||
"${BOX64_ROOT}/src/wrapped/wrappedlibdl.c"
|
||||
"${BOX64_ROOT}/src/wrapped/wrappedlibgl.c"
|
||||
"${BOX64_ROOT}/src/wrapped/wrappedlibglu.c"
|
||||
"${BOX64_ROOT}/src/wrapped/wrappedlibm.c"
|
||||
"${BOX64_ROOT}/src/wrapped/wrappedlibpthread.c"
|
||||
"${BOX64_ROOT}/src/wrapped/wrappedlibrt.c"
|
||||
"${BOX64_ROOT}/src/wrapped/wrappedldlinux.c"
|
||||
"${BOX64_ROOT}/src/wrapped/wrappedlibx11.c"
|
||||
"${BOX64_ROOT}/src/wrapped/wrappedlibxau.c"
|
||||
"${BOX64_ROOT}/src/wrapped/wrappedlibxcb.c"
|
||||
"${BOX64_ROOT}/src/wrapped/wrappedlibxdmcp.c"
|
||||
"${BOX64_ROOT}/src/wrapped/wrappedlibxext.c"
|
||||
"${BOX64_ROOT}/src/wrapped/wrappedlibxi.c"
|
||||
"${BOX64_ROOT}/src/wrapped/wrappedlibxrandr.c"
|
||||
"${BOX64_ROOT}/src/wrapped/wrappedlibxrender.c"
|
||||
"${BOX64_ROOT}/src/wrapped/wrappedlibxxf86vm.c"
|
||||
"${BOX64_ROOT}/src/wrapped/wrappedlibz.c"
|
||||
"${BOX64_ROOT}/src/wrapped/wrappedopenal.c"
|
||||
"${BOX64_ROOT}/src/wrapped/wrappedpulse.c"
|
||||
"${BOX64_ROOT}/src/wrapped/wrappedpulsesimple.c"
|
||||
"${BOX64_ROOT}/src/wrapped/wrappedsdl1.c"
|
||||
"${BOX64_ROOT}/src/wrapped/wrappedsdl1image.c"
|
||||
"${BOX64_ROOT}/src/wrapped/wrappedsdl1mixer.c"
|
||||
"${BOX64_ROOT}/src/wrapped/wrappedsdl1ttf.c"
|
||||
"${BOX64_ROOT}/src/wrapped/wrappedsmpeg.c"
|
||||
"${BOX64_ROOT}/src/wrapped/wrappedsdl2.c"
|
||||
"${BOX64_ROOT}/src/wrapped/wrappedsdl2image.c"
|
||||
"${BOX64_ROOT}/src/wrapped/wrappedsdl2mixer.c"
|
||||
"${BOX64_ROOT}/src/wrapped/wrappedsdl2ttf.c"
|
||||
"${BOX64_ROOT}/src/wrapped/wrappedsmpeg2.c"
|
||||
"${BOX64_ROOT}/src/wrapped/wrappedxinerama.c"
|
||||
)
|
||||
|
||||
#set(WRAPPEDS_HEAD "${BOX64_ROOT}/src/wrapped/wrappedd3dadapter9_gen.h")
|
||||
@@ -301,6 +339,11 @@ add_test(test13 ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64}
|
||||
# -D TEST_REFERENCE=${CMAKE_SOURCE_DIR}/tests/ref14.txt
|
||||
# -P ${CMAKE_SOURCE_DIR}/runTest.cmake )
|
||||
|
||||
add_test(test15 ${CMAKE_COMMAND} -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64}
|
||||
-D TEST_ARGS=${CMAKE_SOURCE_DIR}/tests/test15 -D TEST_OUTPUT=tmpfile.txt
|
||||
-D TEST_REFERENCE=${CMAKE_SOURCE_DIR}/tests/ref15.txt
|
||||
-P ${CMAKE_SOURCE_DIR}/runTest.cmake )
|
||||
|
||||
file(GLOB extension_tests "${CMAKE_SOURCE_DIR}/tests/extensions/*.c")
|
||||
foreach(file ${extension_tests})
|
||||
get_filename_component(testname "${file}" NAME_WE)
|
||||
|
||||
+19
-69
@@ -3,7 +3,7 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
values = ['E', 'e', 'v', 'c', 'w', 'i', 'I', 'C', 'W', 'u', 'U', 'f', 'd', 'D', 'K', 'l', 'L', 'p', 'V', 'O', 'S', '2', 'P', 'G', 'N', 'M']
|
||||
values = ['E', 'e', 'v', 'c', 'w', 'i', 'I', 'C', 'W', 'u', 'U', 'f', 'd', 'D', 'K', 'l', 'L', 'p', 'V', 'O', 'S', 'N', 'M', 'H']
|
||||
def splitchar(s):
|
||||
try:
|
||||
ret = [len(s), values.index(s[0])]
|
||||
@@ -224,17 +224,6 @@ def main(root, defines, files, ver):
|
||||
#include "regs.h"
|
||||
#include "x64emu.h"
|
||||
|
||||
typedef union ui64_s {
|
||||
int64_t i;
|
||||
uint64_t u;
|
||||
uint32_t d[2];
|
||||
} ui64_t;
|
||||
|
||||
typedef struct _2uint_struct_s {
|
||||
uint32_t a;
|
||||
uint32_t b;
|
||||
} _2uint_struct_t;
|
||||
|
||||
extern void* my__IO_2_1_stderr_;
|
||||
extern void* my__IO_2_1_stdin_ ;
|
||||
extern void* my__IO_2_1_stdout_;
|
||||
@@ -252,33 +241,6 @@ static void* io_convert(void* v)
|
||||
return v;
|
||||
}
|
||||
|
||||
typedef struct my_GValue_s
|
||||
{
|
||||
int g_type;
|
||||
union {
|
||||
int v_int;
|
||||
int64_t v_int64;
|
||||
uint64_t v_uint64;
|
||||
float v_float;
|
||||
double v_double;
|
||||
void* v_pointer;
|
||||
} data[2];
|
||||
} my_GValue_t;
|
||||
|
||||
static void alignGValue(my_GValue_t* v, void* value)
|
||||
{
|
||||
v->g_type = *(int*)value;
|
||||
memcpy(v->data, value+4, 2*sizeof(double));
|
||||
}
|
||||
static void unalignGValue(void* value, my_GValue_t* v)
|
||||
{
|
||||
*(int*)value = v->g_type;
|
||||
memcpy(value+4, v->data, 2*sizeof(double));
|
||||
}
|
||||
|
||||
void* VulkanFromx86(void* src, void** save);
|
||||
void VulkanTox86(void* src, void* save);
|
||||
|
||||
#define ST0val ST0.d
|
||||
|
||||
int of_convert(int);
|
||||
@@ -309,11 +271,9 @@ typedef void (*wrapper_t)(x64emu_t* emu, uintptr_t fnc);
|
||||
// O = libc O_ flags bitfield
|
||||
// S = _IO_2_1_stdXXX_ pointer (or FILE*)
|
||||
// Q = ...
|
||||
// 2 = struct of 2 uint
|
||||
// P = Vulkan struture pointer
|
||||
// G = a single GValue pointer
|
||||
// N = ... automatically sending 1 arg
|
||||
// M = ... automatically sending 2 args
|
||||
// H = Huge 128bits value/struct
|
||||
|
||||
"""
|
||||
}
|
||||
@@ -349,8 +309,8 @@ typedef void (*wrapper_t)(x64emu_t* emu, uintptr_t fnc);
|
||||
|
||||
# First part: typedefs
|
||||
for v in gbl["()"]:
|
||||
# E e v c w i I C W u U f d D K l L p V O S 2 P G N M
|
||||
types = ["x64emu_t*", "x64emu_t**", "void", "int8_t", "int16_t", "int32_t", "int64_t", "uint8_t", "uint16_t", "uint32_t", "uint64_t", "float", "double", "long double", "double", "intptr_t", "uintptr_t", "void*", "void*", "int32_t", "void*", "_2uint_struct_t", "void*", "void*", "...", "..."]
|
||||
# E e v c w i I C W u U f d D K l L p V O S N M H
|
||||
types = ["x64emu_t*", "x64emu_t**", "void", "int8_t", "int16_t", "int32_t", "int64_t", "uint8_t", "uint16_t", "uint32_t", "uint64_t", "float", "double", "long double", "double", "intptr_t", "uintptr_t", "void*", "void*", "int32_t", "void*", "...", "...", "unsigned __int128"]
|
||||
if len(values) != len(types):
|
||||
raise NotImplementedError("len(values) = {lenval} != len(types) = {lentypes}".format(lenval=len(values), lentypes=len(types)))
|
||||
|
||||
@@ -359,8 +319,8 @@ typedef void (*wrapper_t)(x64emu_t* emu, uintptr_t fnc);
|
||||
for k in gbl_idxs:
|
||||
file.write("\n#if " + k + "\n")
|
||||
for v in gbl[k]:
|
||||
# E e v c w i I C W u U f d D K l L p V O S 2 P G N M
|
||||
types = ["x64emu_t*", "x64emu_t**", "void", "int8_t", "int16_t", "int32_t", "int64_t", "uint8_t", "uint16_t", "uint32_t", "uint64_t", "float", "double", "long double", "double", "intptr_t", "uintptr_t", "void*", "void*", "int32_t", "void*", "_2uint_struct_t", "void*", "void*", "...", "..."]
|
||||
# E e v c w i I C W u U f d D K l L p V O S N M H
|
||||
types = ["x64emu_t*", "x64emu_t**", "void", "int8_t", "int16_t", "int32_t", "int64_t", "uint8_t", "uint16_t", "uint32_t", "uint64_t", "float", "double", "long double", "double", "intptr_t", "uintptr_t", "void*", "void*", "int32_t", "void*", "...", "...", "unsigned __int128"]
|
||||
if len(values) != len(types):
|
||||
raise NotImplementedError("len(values) = {lenval} != len(types) = {lentypes}".format(lenval=len(values), lentypes=len(types)))
|
||||
|
||||
@@ -375,17 +335,17 @@ typedef void (*wrapper_t)(x64emu_t* emu, uintptr_t fnc);
|
||||
# Helper variables
|
||||
reg_arg = ["R_RDI", "R_RSI", "R_RDX", "R_RCX", "R_R8", "R_R9"]
|
||||
# vreg: value is in a general register
|
||||
# E e v c w i I C W u U f d D K l L p V O S 2 P G N, M
|
||||
vreg = [0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 2]
|
||||
# E e v c w i I C W u U f d D K l L p V O S N M H
|
||||
vreg = [0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 2, 2]
|
||||
# vxmm: value is in a XMM register
|
||||
# E e v c w i I C W u U f d D K l L p V O S 2 P G N, M
|
||||
vxmm = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
||||
# E e v c w i I C W u U f d D K l L p V O S N M H
|
||||
vxmm = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
||||
# vother: value is elsewere
|
||||
# E e v c w i I C W u U f d D K l L p V O S 2 P G N, M
|
||||
vother = [1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0]
|
||||
# E e v c w i I C W u U f d D K l L p V O S N M, H
|
||||
vother = [1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0]
|
||||
# vstack: value is on the stack (or out of register)
|
||||
# E e v c w i I C W u U f d D K l L p V O S 2 P G N, M
|
||||
vstack = [0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 2]
|
||||
# E e v c w i I C W u U f d D K l L p V O S N M, H
|
||||
vstack = [0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 0, 1, 1, 1, 2, 2]
|
||||
arg_s = [
|
||||
"", # E
|
||||
"", # e
|
||||
@@ -408,11 +368,9 @@ typedef void (*wrapper_t)(x64emu_t* emu, uintptr_t fnc);
|
||||
"", # V
|
||||
"of_convert(*(int32_t*)(R_RSP + {p})), ", # O
|
||||
"io_convert(*(void**)(R_RSP + {p})), ", # S
|
||||
"(_2uint_struct_t){{*(uintptr_t*)(R_RSP + {p}),*(uintptr_t*)(R_RSP + {p} + 4)}}, ", # 2
|
||||
"", # P
|
||||
"", # G
|
||||
"*(void**)(R_RSP + {p}), ", # N
|
||||
"*(void**)(R_RSP + {p}),*(void**)(R_RSP + {p} + 8), ", # M
|
||||
"*(unsigned __int128)(R_RSP + {p}), " # H
|
||||
]
|
||||
arg_r = [
|
||||
"", # E
|
||||
@@ -436,11 +394,9 @@ typedef void (*wrapper_t)(x64emu_t* emu, uintptr_t fnc);
|
||||
"", # V
|
||||
"of_convert((int32_t){p}), ", # O
|
||||
"io_convert((void*){p}), ", # S
|
||||
"", # 2
|
||||
"", # P
|
||||
"", # G
|
||||
"(void*){p}, ", # N
|
||||
"(void*){p}, ", # M
|
||||
"#error use pp instead, ", #H
|
||||
]
|
||||
arg_x = [
|
||||
"", # E
|
||||
@@ -464,11 +420,9 @@ typedef void (*wrapper_t)(x64emu_t* emu, uintptr_t fnc);
|
||||
"", # V
|
||||
"", # O
|
||||
"", # S
|
||||
"", # 2
|
||||
"", # P
|
||||
"", # G
|
||||
"", # N
|
||||
"", # M
|
||||
"", # H
|
||||
]
|
||||
arg_o = [
|
||||
"emu, ", # E
|
||||
@@ -492,11 +446,9 @@ typedef void (*wrapper_t)(x64emu_t* emu, uintptr_t fnc);
|
||||
"(void*)(R_RSP + {p}), ", # V
|
||||
"", # O
|
||||
"", # S
|
||||
"", # 2
|
||||
"arg{p}, ", # P
|
||||
"&arg{p}, ", # G
|
||||
"", # N
|
||||
"", # M
|
||||
"", # H
|
||||
]
|
||||
|
||||
vals = [
|
||||
@@ -521,11 +473,9 @@ typedef void (*wrapper_t)(x64emu_t* emu, uintptr_t fnc);
|
||||
"\n#error Invalid return type: va_list\n", # V
|
||||
"\n#error Invalid return type: at_flags\n", # O
|
||||
"\n#error Invalid return type: _io_file*\n", # S
|
||||
"\n#error Invalid return type: _2uint_struct\n", # 2
|
||||
"\n#error Invalid return type: Vulkan Struct\n", # P
|
||||
"\n#error Invalid return type: GValue Pointer\n", # G
|
||||
"\n#error Invalid return type: ... with 1 arg\n", # N
|
||||
"\n#error Invalid return type: ... with 2 args\n", # M
|
||||
"unsigned __int128 u128 = fn({0}); R_RAX=(u128&0xFFFFFFFFFFFFFFFFL); R_RDX=(u128>>64)&0xFFFFFFFFFFFFFFFFL;", # H
|
||||
]
|
||||
# Asserts
|
||||
if len(values) != len(arg_s):
|
||||
|
||||
+5
-4
@@ -27,6 +27,7 @@ void initAllHelpers(box64context_t* context)
|
||||
return;
|
||||
my_context = context;
|
||||
init_pthread_helper();
|
||||
init_bridge_helper();
|
||||
init_signal_helper(context);
|
||||
inited = 1;
|
||||
}
|
||||
@@ -39,7 +40,7 @@ void finiAllHelpers(box64context_t* context)
|
||||
return;
|
||||
fini_pthread_helper(context);
|
||||
fini_signal_helper();
|
||||
cleanAlternate();
|
||||
fini_bridge_helper();
|
||||
fini_custommem_helper(context);
|
||||
finied = 1;
|
||||
}
|
||||
@@ -88,7 +89,7 @@ box64context_t *NewBox64Context(int argc)
|
||||
context->local_maplib = NewLibrarian(context, 1);
|
||||
context->system = NewBridge();
|
||||
// create vsyscall
|
||||
context->vsyscall = AddBridge(context->system, vFv, x64Syscall, 0);
|
||||
context->vsyscall = AddBridge(context->system, vFv, x64Syscall, 0, NULL);
|
||||
context->box64lib = dlopen(NULL, RTLD_NOW|RTLD_GLOBAL);
|
||||
context->dlprivate = NewDLPrivate();
|
||||
|
||||
@@ -180,8 +181,8 @@ void FreeBox64Context(box64context_t** context)
|
||||
|
||||
FreeBridge(&ctx->system);
|
||||
|
||||
// freeGLProcWrapper(ctx);
|
||||
// freeALProcWrapper(ctx);
|
||||
freeGLProcWrapper(ctx);
|
||||
freeALProcWrapper(ctx);
|
||||
|
||||
|
||||
void* ptr;
|
||||
|
||||
+2
-2
@@ -3,6 +3,6 @@
|
||||
|
||||
#define BOX64_MAJOR 0
|
||||
#define BOX64_MINOR 0
|
||||
#define BOX64_REVISION 2
|
||||
#define BOX64_REVISION 4
|
||||
|
||||
#endif //__BOX64_VERSION_H_
|
||||
#endif //__BOX64_VERSION_H_
|
||||
+10
-2
@@ -562,7 +562,15 @@ int RelocateElfRELA(lib_t *maplib, lib_t *local_maplib, elfheader_t* head, int c
|
||||
*p += head->delta;
|
||||
break;
|
||||
case R_X86_64_COPY:
|
||||
if(local_maplib)
|
||||
if(!strcmp(symname, "stdin") || !strcmp(symname, "stdout") || !strcmp(symname, "stderr")) {
|
||||
if(!strcmp(symname, "stdin"))
|
||||
offs = (uintptr_t)&stdin;
|
||||
else if(!strcmp(symname, "stdout"))
|
||||
offs = (uintptr_t)&stdout;
|
||||
else
|
||||
offs = (uintptr_t)&stderr;
|
||||
end = offs + 8;
|
||||
} else if(local_maplib)
|
||||
GetNoSelfSymbolStartEnd(local_maplib, symname, &offs, &end, head);
|
||||
if(!offs)
|
||||
GetNoSelfSymbolStartEnd(maplib, symname, &offs, &end, head);
|
||||
@@ -718,7 +726,7 @@ int RelocateElfPlt(lib_t *maplib, lib_t *local_maplib, elfheader_t* head)
|
||||
return -1;
|
||||
}
|
||||
if(pltResolver==~0) {
|
||||
pltResolver = AddBridge(my_context->system, vFE, PltResolver, 0);
|
||||
pltResolver = AddBridge(my_context->system, vFE, PltResolver, 0, "PltResolver");
|
||||
}
|
||||
if(head->pltgot) {
|
||||
*(uintptr_t*)(head->pltgot+head->delta+16) = pltResolver;
|
||||
|
||||
@@ -72,7 +72,7 @@ elfheader_t* ParseElfHeader(FILE* f, const char* name, int exec)
|
||||
}
|
||||
if(header.e_ident[EI_CLASS]!=ELFCLASS64) {
|
||||
if(header.e_ident[EI_CLASS]==ELFCLASS32) {
|
||||
printf_log(LOG_INFO, "This is a 64bits ELF! box64 can only run 64bits ELF!\n");
|
||||
printf_log(LOG_INFO, "This is a 32bits ELF! box64 can only run 64bits ELF!\n");
|
||||
} else {
|
||||
printf_log(LOG_INFO, "Not a 64bits ELF (%d)\n", header.e_ident[EI_CLASS]);
|
||||
}
|
||||
|
||||
@@ -14,12 +14,14 @@
|
||||
#endif
|
||||
|
||||
#define GETED(D) oped=GetEd(emu, rex, nextop, D)
|
||||
#define GETED32(D) oped=GetEd32O(emu, rex, nextop, D, 0)
|
||||
#define GETED_OFFS(D, O) oped=GetEdO(emu, rex, nextop, D, O)
|
||||
#define GETGD opgd=GetGd(emu, rex, nextop)
|
||||
#define GETEB(D) oped=GetEb(emu, rex, nextop, D)
|
||||
#define GETEB_OFFS(D, O) oped=GetEbO(emu, rex, nextop, D, O)
|
||||
#define GETGB opgd=GetGb(emu, rex, nextop)
|
||||
#define GETEW(D) oped=GetEw(emu, rex, nextop, D)
|
||||
#define GETEW_OFFS(D, O) oped=GetEdO(emu, rex, nextop, D, O)
|
||||
#define GETGW opgd=GetGw(emu, rex, nextop)
|
||||
#define GETEX(D) opex=GetEx(emu, rex, nextop, D)
|
||||
#define GETGX opgx=GetGx(emu, rex, nextop)
|
||||
|
||||
+7
-4
@@ -45,13 +45,13 @@ uint32_t* GetParityTab()
|
||||
|
||||
void PushExit(x64emu_t* emu)
|
||||
{
|
||||
uintptr_t endMarker = AddCheckBridge(my_context->system, NULL, NULL, 0);
|
||||
uintptr_t endMarker = AddCheckBridge(my_context->system, NULL, NULL, 0, "ExitEmulation");
|
||||
Push(emu, endMarker);
|
||||
}
|
||||
|
||||
void* GetExit()
|
||||
{
|
||||
return (void*)AddCheckBridge(my_context->system, NULL, NULL, 0);
|
||||
return (void*)AddCheckBridge(my_context->system, NULL, NULL, 0, "ExitEmulation");
|
||||
}
|
||||
|
||||
static void internalX64Setup(x64emu_t* emu, box64context_t *context, uintptr_t start, uintptr_t stack, int stacksize, int ownstack)
|
||||
@@ -77,6 +77,7 @@ static void internalX64Setup(x64emu_t* emu, box64context_t *context, uintptr_t s
|
||||
emu->segs[_GS] = default_gs;
|
||||
// setup fpu regs
|
||||
reset_fpu(emu);
|
||||
emu->mxcsr = 0x1f80;
|
||||
}
|
||||
|
||||
EXPORTDYN
|
||||
@@ -398,10 +399,12 @@ void UnimpOpcode(x64emu_t* emu)
|
||||
R_RIP = emu->old_ip;
|
||||
|
||||
int tid = syscall(SYS_gettid);
|
||||
printf_log(LOG_NONE, "%04d|%p: Unimplemented Opcode (%02X) %02X %02X %02X %02X %02X %02X %02X %02X\n",
|
||||
printf_log(LOG_NONE, "%04d|%p: Unimplemented Opcode (%02X) %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X\n",
|
||||
tid, (void*)emu->old_ip, Peek(emu, -1),
|
||||
Peek(emu, 0), Peek(emu, 1), Peek(emu, 2), Peek(emu, 3),
|
||||
Peek(emu, 4), Peek(emu, 5), Peek(emu, 6), Peek(emu, 7));
|
||||
Peek(emu, 4), Peek(emu, 5), Peek(emu, 6), Peek(emu, 7),
|
||||
Peek(emu, 8), Peek(emu, 9), Peek(emu,10), Peek(emu,11),
|
||||
Peek(emu,12), Peek(emu,13), Peek(emu,14));
|
||||
emu->quit=1;
|
||||
emu->error |= ERR_UNIMPL;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ typedef struct forkpty_s {
|
||||
typedef struct x64emu_s {
|
||||
// cpu
|
||||
reg64_t regs[16];
|
||||
x86flags_t eflags;
|
||||
x64flags_t eflags;
|
||||
reg64_t ip;
|
||||
uintptr_t old_ip;
|
||||
// fpu / mmx
|
||||
|
||||
+10
-9
@@ -93,20 +93,21 @@ void x64Int3(x64emu_t* emu)
|
||||
int perr = 0;
|
||||
uint32_t *pu32 = NULL;
|
||||
const char *s = NULL;
|
||||
{
|
||||
Dl_info info;
|
||||
if(dladdr((void*)addr, &info))
|
||||
s = info.dli_sname;
|
||||
}
|
||||
if(!s) s = GetNativeName((void*)addr);
|
||||
s = GetNativeName((void*)addr);
|
||||
if(addr==(uintptr_t)PltResolver) {
|
||||
snprintf(buff, 256, "%s", " ... ");
|
||||
} else if(strstr(s, "__open")==s || strcmp(s, "open")==0) {
|
||||
} else if(strstr(s, "__open")==s || !strcmp(s, "open") || !strcmp(s, "open ")) {
|
||||
tmp = (char*)(R_RDI);
|
||||
snprintf(buff, 255, "%04d|%p: Calling %s(\"%s\", %d (,%d))", tid, *(void**)(R_RSP), s, (tmp)?tmp:"(nil)", (int)(R_ESI), (int)(R_EDX));
|
||||
perr = 1;
|
||||
} else if(strstr(s, "my___printf_chk")) {
|
||||
tmp = (char*)(R_RSI);
|
||||
snprintf(buff, 255, "%04d|%p: Calling %s(%d, \"%s\" (,%p))", tid, *(void**)(R_RSP), s, R_EDI, (tmp)?tmp:"(nil)", (void*)(R_RDX));
|
||||
} else if(!strcmp(s, "sscanf")) {
|
||||
tmp = (char*)(R_RSI);
|
||||
snprintf(buff, 255, "%04d|%p: Calling %s(%p, \"%s\" (,%p))", tid, *(void**)(R_RSP), s, (void*)R_RDI, (tmp)?tmp:"(nil)", (void*)(R_RDX));
|
||||
} else {
|
||||
snprintf(buff, 255, "%04d|%p: Calling %s (%016lX, %016lX, %016lX, ...)", tid, *(void**)(R_RSP), s, R_RDI, R_RSI, R_RDX);
|
||||
snprintf(buff, 255, "%04d|%p: Calling %s(0x%lX, 0x%lX, 0x%lX, ...)", tid, *(void**)(R_RSP), s, R_RDI, R_RSI, R_RDX);
|
||||
}
|
||||
printf_log(LOG_NONE, "%s =>", buff);
|
||||
pthread_mutex_unlock(&emu->context->mutex_trace);
|
||||
@@ -135,7 +136,7 @@ void x64Int3(x64emu_t* emu)
|
||||
snprintf(buff3, 63, " (errno=%d:\"%s\")", errno, strerror(errno));
|
||||
else if(perr==2 && R_EAX==0)
|
||||
snprintf(buff3, 63, " (errno=%d:\"%s\")", errno, strerror(errno));
|
||||
printf_log(LOG_NONE, " return 0x%016lX%s%s\n", R_RAX, buff2, buff3);
|
||||
printf_log(LOG_NONE, " return 0x%lX%s%s\n", R_RAX, buff2, buff3);
|
||||
pthread_mutex_unlock(&emu->context->mutex_trace);
|
||||
} else
|
||||
w(emu, addr);
|
||||
|
||||
+16
-16
@@ -310,7 +310,7 @@ uint64_t adc64(x64emu_t *emu, uint64_t d, uint64_t s)
|
||||
|
||||
CONDITIONAL_SET_FLAG(hi & 0x100000000L, F_CF);
|
||||
CONDITIONAL_SET_FLAG(!res, F_ZF);
|
||||
CONDITIONAL_SET_FLAG(res & 0x8000000000000000L, F_SF);
|
||||
CONDITIONAL_SET_FLAG(res & 0x8000000000000000LL, F_SF);
|
||||
CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
|
||||
|
||||
/* calculate the carry chain SEE NOTE AT TOP. */
|
||||
@@ -393,13 +393,13 @@ uint64_t cmp64(x64emu_t *emu, uint64_t d, uint64_t s)
|
||||
RESET_FLAGS(emu);
|
||||
|
||||
res = d - s;
|
||||
CONDITIONAL_SET_FLAG(res & 0x8000000000000000L, F_SF);
|
||||
CONDITIONAL_SET_FLAG(res & 0x8000000000000000LL, F_SF);
|
||||
CONDITIONAL_SET_FLAG(!res, F_ZF);
|
||||
CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
|
||||
|
||||
/* calculate the borrow chain. See note at top */
|
||||
bc = (res & (~d | s)) | (~d & s);
|
||||
CONDITIONAL_SET_FLAG(bc & 0x8000000000000000L, F_CF);
|
||||
CONDITIONAL_SET_FLAG(bc & 0x8000000000000000LL, F_CF);
|
||||
CONDITIONAL_SET_FLAG(XOR2(bc >> 62), F_OF);
|
||||
CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
|
||||
return d;
|
||||
@@ -573,7 +573,7 @@ uint32_t rcl32(x64emu_t *emu, uint32_t d, uint8_t s)
|
||||
return res;
|
||||
}
|
||||
|
||||
uint32_t rcl64(x64emu_t *emu, uint64_t d, uint8_t s)
|
||||
uint64_t rcl64(x64emu_t *emu, uint64_t d, uint8_t s)
|
||||
{
|
||||
uint64_t res, cnt, mask, cf;
|
||||
CHECK_FLAGS(emu);
|
||||
@@ -583,10 +583,10 @@ uint32_t rcl64(x64emu_t *emu, uint64_t d, uint8_t s)
|
||||
if ((cnt = s % 65) != 0) {
|
||||
cf = (d >> (64 - cnt)) & 0x1;
|
||||
res = (d << cnt);
|
||||
mask = (1 << (cnt - 1)) - 1;
|
||||
mask = (1LL << (cnt - 1)) - 1;
|
||||
res |= (d >> (65 - cnt)) & mask;
|
||||
if (ACCESS_FLAG(F_CF)) { /* carry flag is set */
|
||||
res |= 1 << (cnt - 1);
|
||||
res |= 1LL << (cnt - 1);
|
||||
}
|
||||
CONDITIONAL_SET_FLAG(cf, F_CF);
|
||||
CONDITIONAL_SET_FLAG(cnt == 1 && XOR2(cf + ((res >> 62) & 0x2)),
|
||||
@@ -756,12 +756,12 @@ uint64_t rcr64(x64emu_t *emu, uint64_t d, uint8_t s)
|
||||
ocf = ACCESS_FLAG(F_CF) != 0;
|
||||
} else
|
||||
cf = (d >> (cnt - 1)) & 0x1;
|
||||
mask = (1 << (64 - cnt)) - 1;
|
||||
mask = (1LL << (64 - cnt)) - 1;
|
||||
res = (d >> cnt) & mask;
|
||||
if (cnt != 1)
|
||||
res |= (d << (65 - cnt));
|
||||
if (ACCESS_FLAG(F_CF)) { /* carry flag is set */
|
||||
res |= 1 << (64 - cnt);
|
||||
res |= 1LL << (64 - cnt);
|
||||
}
|
||||
CONDITIONAL_SET_FLAG(cf, F_CF);
|
||||
if (cnt == 1) {
|
||||
@@ -1033,17 +1033,17 @@ uint32_t shld32 (x64emu_t *emu, uint32_t d, uint32_t fill, uint8_t s)
|
||||
|
||||
uint64_t shld64 (x64emu_t *emu, uint64_t d, uint64_t fill, uint8_t s)
|
||||
{
|
||||
unsigned int cnt, res, cf;
|
||||
uint64_t cnt, res, cf;
|
||||
RESET_FLAGS(emu);
|
||||
|
||||
s = s&0x3f;
|
||||
cnt = s % 64;
|
||||
if (cnt > 0) {
|
||||
res = (d << cnt) | (fill >> (64-cnt));
|
||||
cf = d & (1 << (64 - cnt));
|
||||
cf = d & (1LL << (64 - cnt));
|
||||
CONDITIONAL_SET_FLAG(cf, F_CF);
|
||||
CONDITIONAL_SET_FLAG(!res, F_ZF);
|
||||
CONDITIONAL_SET_FLAG(res & 0x8000000000000000L, F_SF);
|
||||
CONDITIONAL_SET_FLAG(res & 0x8000000000000000LL, F_SF);
|
||||
CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
|
||||
} else {
|
||||
res = d;
|
||||
@@ -1139,11 +1139,11 @@ uint64_t shrd64 (x64emu_t *emu, uint64_t d, uint64_t fill, uint8_t s)
|
||||
s = s&0x3f;
|
||||
cnt = s % 64;
|
||||
if (cnt > 0) {
|
||||
cf = d & (1 << (cnt - 1));
|
||||
cf = d & (1LL << (cnt - 1));
|
||||
res = (d >> cnt) | (fill << (64 - cnt));
|
||||
CONDITIONAL_SET_FLAG(cf, F_CF);
|
||||
CONDITIONAL_SET_FLAG(!res, F_ZF);
|
||||
CONDITIONAL_SET_FLAG(res & 0x8000000000000000L, F_SF);
|
||||
CONDITIONAL_SET_FLAG(res & 0x8000000000000000LL, F_SF);
|
||||
CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
|
||||
} else {
|
||||
res = d;
|
||||
@@ -1235,13 +1235,13 @@ uint64_t sbb64(x64emu_t *emu, uint64_t d, uint64_t s)
|
||||
res = d - s - 1;
|
||||
else
|
||||
res = d - s;
|
||||
CONDITIONAL_SET_FLAG(res & 0x8000000000000000L, F_SF);
|
||||
CONDITIONAL_SET_FLAG(res & 0x8000000000000000LL, F_SF);
|
||||
CONDITIONAL_SET_FLAG(!res, F_ZF);
|
||||
CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
|
||||
|
||||
/* calculate the borrow chain. See note at top */
|
||||
bc = (res & (~d | s)) | (~d & s);
|
||||
CONDITIONAL_SET_FLAG(bc & 0x8000000000000000L, F_CF);
|
||||
CONDITIONAL_SET_FLAG(bc & 0x8000000000000000LL, F_CF);
|
||||
CONDITIONAL_SET_FLAG(XOR2(bc >> 62), F_OF);
|
||||
CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
|
||||
return res;
|
||||
@@ -1304,7 +1304,7 @@ void test64(x64emu_t *emu, uint64_t d, uint64_t s)
|
||||
res = d & s;
|
||||
|
||||
CLEAR_FLAG(F_OF);
|
||||
CONDITIONAL_SET_FLAG(res & 0x8000000000000000L, F_SF);
|
||||
CONDITIONAL_SET_FLAG(res & 0x8000000000000000LL, F_SF);
|
||||
CONDITIONAL_SET_FLAG(res == 0, F_ZF);
|
||||
CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
|
||||
/* AF == dont care */
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ static inline uint16_t add16(x64emu_t *emu, uint16_t d, uint16_t s)
|
||||
|
||||
static inline uint32_t add32(x64emu_t *emu, uint32_t d, uint32_t s)
|
||||
{
|
||||
emu->res = d + s;
|
||||
emu->res = (uint64_t)d + s;
|
||||
emu->op1 = d;
|
||||
emu->op2 = s;
|
||||
emu->df = d_add32;
|
||||
|
||||
+525
-21
@@ -33,11 +33,13 @@ int Run(x64emu_t *emu, int step)
|
||||
uint8_t opcode;
|
||||
uint8_t nextop;
|
||||
reg64_t *oped, *opgd;
|
||||
uint8_t tmp8u;
|
||||
uint8_t tmp8u, tmp8u2;
|
||||
int8_t tmp8s;
|
||||
uint32_t tmp32u;
|
||||
uint64_t tmp64u;
|
||||
uint16_t tmp16u;
|
||||
int32_t tmp32s;
|
||||
uint32_t tmp32u, tmp32u2;
|
||||
int64_t tmp64s;
|
||||
uint64_t tmp64u, tmp64u2, tmp64u3;
|
||||
rex_t rex;
|
||||
int rep; // 0 none, 1=F2 prefix, 2=F3 prefix
|
||||
int unimp = 0;
|
||||
@@ -246,14 +248,21 @@ x64emurun:
|
||||
break;
|
||||
|
||||
case 0x66: /* 16bits prefix */
|
||||
if(Run66(emu, rex)) {
|
||||
if(Run66(emu, rex, rep)) {
|
||||
unimp = 1;
|
||||
goto fini;
|
||||
}
|
||||
if(emu->quit)
|
||||
goto fini;
|
||||
break;
|
||||
case 0x67: /* reduce EASize prefix */
|
||||
if(Run67(emu, rex)) {
|
||||
unimp = 1;
|
||||
goto fini;
|
||||
}
|
||||
if(emu->quit)
|
||||
goto fini;
|
||||
break;
|
||||
|
||||
case 0x68: /* Push Id */
|
||||
Push(emu, F32S64);
|
||||
break;
|
||||
@@ -270,6 +279,20 @@ x64emurun:
|
||||
else
|
||||
GD->dword[0] = imul32(emu, ED->dword[0], tmp64u);
|
||||
break;
|
||||
case 0x6A: /* Push Ib */
|
||||
tmp64s = F8S;
|
||||
Push(emu, (uint64_t)tmp64s);
|
||||
break;
|
||||
case 0x6B: /* IMUL Gd,Ed,Ib */
|
||||
nextop = F8;
|
||||
GETED(1);
|
||||
GETGD;
|
||||
tmp64s = F8S;
|
||||
if(rex.w)
|
||||
GD->q[0] = imul64(emu, ED->q[0], (uint64_t)tmp64s);
|
||||
else
|
||||
GD->q[0] = imul32(emu, ED->dword[0], (uint32_t)tmp64s);
|
||||
break;
|
||||
|
||||
GOCOND(0x70
|
||||
, tmp8s = F8S; CHECK_FLAGS(emu);
|
||||
@@ -355,7 +378,33 @@ x64emurun:
|
||||
else
|
||||
test32(emu, ED->dword[0], GD->dword[0]);
|
||||
break;
|
||||
|
||||
case 0x86: /* XCHG Eb,Gb */
|
||||
nextop = F8;
|
||||
#ifdef DYNAREC
|
||||
GET_EB;
|
||||
if((nextop&0xC0)==0xC0) { // reg / reg: no lock
|
||||
tmp8u = GB;
|
||||
GB = EB->byte[0];
|
||||
EB->byte[0] = tmp8u;
|
||||
} else {
|
||||
do {
|
||||
tmp8u = arm_lock_read_b(EB);
|
||||
} while(arm_lock_write_b(EB, GB));
|
||||
GB = tmp8u;
|
||||
}
|
||||
// dynarec use need it's own mecanism
|
||||
#else
|
||||
GETEB(0);
|
||||
GETGB;
|
||||
if((nextop&0xC0)!=0xC0)
|
||||
pthread_mutex_lock(&emu->context->mutex_lock); // XCHG always LOCK (but when accessing memory only)
|
||||
tmp8u = GB;
|
||||
GB = EB->byte[0];
|
||||
EB->byte[0] = tmp8u;
|
||||
if((nextop&0xC0)!=0xC0)
|
||||
pthread_mutex_unlock(&emu->context->mutex_lock);
|
||||
#endif
|
||||
break;
|
||||
case 0x87: /* XCHG Ed,Gd */
|
||||
nextop = F8;
|
||||
#ifdef DYNAREC
|
||||
@@ -379,7 +428,7 @@ x64emurun:
|
||||
#else
|
||||
GETED(0);
|
||||
GETGD;
|
||||
if((nextop&0xC0)!=0xC0)
|
||||
if(!MODREG)
|
||||
pthread_mutex_lock(&emu->context->mutex_lock); // XCHG always LOCK (but when accessing memory only)
|
||||
if(rex.w) {
|
||||
tmp64u = GD->q[0];
|
||||
@@ -387,10 +436,13 @@ x64emurun:
|
||||
ED->q[0] = tmp64u;
|
||||
} else {
|
||||
tmp32u = GD->dword[0];
|
||||
GD->dword[0] = ED->dword[0];
|
||||
ED->dword[0] = tmp32u;
|
||||
GD->q[0] = ED->dword[0];
|
||||
if(MODREG)
|
||||
ED->q[0] = tmp32u;
|
||||
else
|
||||
ED->dword[0] = tmp32u;
|
||||
}
|
||||
if((nextop&0xC0)!=0xC0)
|
||||
if(!MODREG)
|
||||
pthread_mutex_unlock(&emu->context->mutex_lock);
|
||||
#endif
|
||||
break;
|
||||
@@ -432,25 +484,206 @@ x64emurun:
|
||||
if(rex.w)
|
||||
GD->q[0] = (uint64_t)ED;
|
||||
else
|
||||
GD->dword[0] = (uint32_t)(uintptr_t)ED; // RAZ upper part?
|
||||
GD->q[0] = (uint32_t)(uintptr_t)ED;
|
||||
break;
|
||||
|
||||
case 0x8F: /* POP Ed */
|
||||
nextop = F8;
|
||||
if(MODREG) {
|
||||
emu->regs[(nextop&7)+(rex.b<<3)].q[0] = Pop(emu);
|
||||
} else {
|
||||
tmp64u = Pop(emu); // this order allows handling POP [ESP] and variant
|
||||
GETED(0);
|
||||
R_ESP -= sizeof(void*); // to prevent issue with SEGFAULT
|
||||
ED->q[0] = tmp64u;
|
||||
R_ESP += sizeof(void*);
|
||||
}
|
||||
break;
|
||||
case 0x90: /* NOP */
|
||||
break;
|
||||
|
||||
case 0x98: /* CWDE */
|
||||
if(rex.w)
|
||||
emu->regs[_AX].sq[0] = emu->regs[_AX].sdword[0];
|
||||
else
|
||||
else {
|
||||
emu->regs[_AX].sdword[0] = emu->regs[_AX].sword[0];
|
||||
emu->regs[_AX].dword[1] = 0;
|
||||
}
|
||||
break;
|
||||
case 0x99: /* CDQ */
|
||||
if(rex.w)
|
||||
R_RDX=(R_RAX & 0x8000000000000000L)?0xFFFFFFFFFFFFFFFFL:0x0000000000000000L;
|
||||
R_RDX=(R_RAX & 0x8000000000000000LL)?0xFFFFFFFFFFFFFFFFLL:0x0000000000000000LL;
|
||||
else
|
||||
R_RDX=(R_EAX & 0x80000000)?0xFFFFFFFFFFFFFFFFL:0x0000000000000000L;
|
||||
R_RDX=(R_EAX & 0x80000000)?0x00000000FFFFFFFFLL:0x0000000000000000LL;
|
||||
break;
|
||||
|
||||
case 0x9B: /* FWAIT */
|
||||
break;
|
||||
case 0x9C: /* PUSHF */
|
||||
CHECK_FLAGS(emu);
|
||||
Push(emu, emu->eflags.x64);
|
||||
break;
|
||||
case 0x9D: /* POPF */
|
||||
emu->eflags.x64 = ((Pop(emu) & 0x3F7FD7)/* & (0xffff-40)*/ ) | 0x2; // mask off res2 and res3 and on res1
|
||||
RESET_FLAGS(emu);
|
||||
break;
|
||||
|
||||
case 0xA4: /* MOVSB */
|
||||
tmp8s = ACCESS_FLAG(F_DF)?-1:+1;
|
||||
tmp64u = (rep)?R_RCX:1L;
|
||||
while(tmp64u) {
|
||||
*(uint8_t*)R_RDI = *(uint8_t*)R_RSI;
|
||||
R_RDI += tmp8s;
|
||||
R_RSI += tmp8s;
|
||||
--tmp64u;
|
||||
}
|
||||
if(rep)
|
||||
R_RCX = tmp64u;
|
||||
break;
|
||||
case 0xA5: /* (REP) MOVSD */
|
||||
tmp8s = ACCESS_FLAG(F_DF)?-1:+1;
|
||||
tmp64u = (rep)?R_RCX:1L;
|
||||
if(rex.w) {
|
||||
tmp8s *= 8;
|
||||
while(tmp64u) {
|
||||
--tmp64u;
|
||||
*(uint64_t*)R_RDI = *(uint64_t*)R_RSI;
|
||||
R_RDI += tmp8s;
|
||||
R_RSI += tmp8s;
|
||||
}
|
||||
} else {
|
||||
tmp8s *= 4;
|
||||
while(tmp64u) {
|
||||
--tmp64u;
|
||||
*(uint32_t*)R_RDI = *(uint32_t*)R_RSI;
|
||||
R_RDI += tmp8s;
|
||||
R_RSI += tmp8s;
|
||||
}
|
||||
}
|
||||
if(rep)
|
||||
R_RCX = tmp64u;
|
||||
break;
|
||||
case 0xA6: /* (REPZ/REPNE) CMPSB */
|
||||
tmp8s = ACCESS_FLAG(F_DF)?-1:+1;
|
||||
switch(rep) {
|
||||
case 1:
|
||||
tmp64u = R_RCX;
|
||||
while(tmp64u) {
|
||||
--tmp64u;
|
||||
tmp8u = *(uint8_t*)R_RDI;
|
||||
tmp8u2 = *(uint8_t*)R_RSI;
|
||||
R_RDI += tmp8s;
|
||||
R_RSI += tmp8s;
|
||||
if(tmp8u==tmp8u2)
|
||||
break;
|
||||
}
|
||||
if(R_RCX) cmp8(emu, tmp8u2, tmp8u);
|
||||
R_RCX = tmp64u;
|
||||
break;
|
||||
case 2:
|
||||
tmp64u = R_RCX;
|
||||
while(tmp64u) {
|
||||
--tmp64u;
|
||||
tmp8u = *(uint8_t*)R_RDI;
|
||||
tmp8u2 = *(uint8_t*)R_RSI;
|
||||
R_RDI += tmp8s;
|
||||
R_RSI += tmp8s;
|
||||
if(tmp8u!=tmp8u2)
|
||||
break;
|
||||
}
|
||||
if(R_RCX) cmp8(emu, tmp8u2, tmp8u);
|
||||
R_RCX = tmp64u;
|
||||
break;
|
||||
default:
|
||||
tmp8s = ACCESS_FLAG(F_DF)?-1:+1;
|
||||
tmp8u = *(uint8_t*)R_RDI;
|
||||
tmp8u2 = *(uint8_t*)R_RSI;
|
||||
R_RDI += tmp8s;
|
||||
R_RSI += tmp8s;
|
||||
cmp8(emu, tmp8u2, tmp8u);
|
||||
}
|
||||
break;
|
||||
case 0xA7: /* (REPZ/REPNE) CMPSD */
|
||||
if(rex.w)
|
||||
tmp8s = ACCESS_FLAG(F_DF)?-8:+8;
|
||||
else
|
||||
tmp8s = ACCESS_FLAG(F_DF)?-4:+4;
|
||||
switch(rep) {
|
||||
case 1:
|
||||
tmp64u = R_RCX;
|
||||
if(rex.w) {
|
||||
while(tmp64u) {
|
||||
--tmp64u;
|
||||
tmp64u3 = *(uint64_t*)R_RDI;
|
||||
tmp64u2 = *(uint64_t*)R_RSI;
|
||||
R_RDI += tmp8s;
|
||||
R_RSI += tmp8s;
|
||||
if(tmp64u3==tmp64u2)
|
||||
break;
|
||||
}
|
||||
if(R_RCX) cmp64(emu, tmp64u2, tmp64u3);
|
||||
} else {
|
||||
while(tmp64u) {
|
||||
--tmp64u;
|
||||
tmp32u = *(uint32_t*)R_RDI;
|
||||
tmp32u2 = *(uint32_t*)R_RSI;
|
||||
R_RDI += tmp8s;
|
||||
R_RSI += tmp8s;
|
||||
if(tmp32u==tmp32u2)
|
||||
break;
|
||||
}
|
||||
if(R_RCX) cmp32(emu, tmp32u2, tmp32u);
|
||||
}
|
||||
R_RCX = tmp64u;
|
||||
break;
|
||||
case 2:
|
||||
tmp64u = R_RCX;
|
||||
if(rex.w) {
|
||||
while(tmp64u) {
|
||||
--tmp64u;
|
||||
tmp64u3 = *(uint64_t*)R_RDI;
|
||||
tmp64u2 = *(uint64_t*)R_RSI;
|
||||
R_RDI += tmp8s;
|
||||
R_RSI += tmp8s;
|
||||
if(tmp64u3!=tmp64u2)
|
||||
break;
|
||||
}
|
||||
if(R_RCX) cmp64(emu, tmp64u2, tmp64u3);
|
||||
} else {
|
||||
while(tmp64u) {
|
||||
--tmp64u;
|
||||
tmp32u = *(uint32_t*)R_RDI;
|
||||
tmp32u2 = *(uint32_t*)R_RSI;
|
||||
R_RDI += tmp8s;
|
||||
R_RSI += tmp8s;
|
||||
if(tmp32u!=tmp32u2)
|
||||
break;
|
||||
}
|
||||
if(R_RCX) cmp32(emu, tmp32u2, tmp32u);
|
||||
}
|
||||
R_RCX = tmp64u;
|
||||
break;
|
||||
default:
|
||||
if(rex.w) {
|
||||
tmp8s = ACCESS_FLAG(F_DF)?-8:+8;
|
||||
tmp64u = *(uint64_t*)R_RDI;
|
||||
tmp64u2 = *(uint64_t*)R_RSI;
|
||||
R_RDI += tmp8s;
|
||||
R_RSI += tmp8s;
|
||||
cmp64(emu, tmp64u2, tmp64u);
|
||||
} else {
|
||||
tmp8s = ACCESS_FLAG(F_DF)?-4:+4;
|
||||
tmp32u = *(uint32_t*)R_RDI;
|
||||
tmp32u2 = *(uint32_t*)R_RSI;
|
||||
R_RDI += tmp8s;
|
||||
R_RSI += tmp8s;
|
||||
cmp32(emu, tmp32u2, tmp32u);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0xA8: /* TEST AL, Ib */
|
||||
test8(emu, R_AL, F8);
|
||||
break;
|
||||
case 0xA9: /* TEST EAX, Id */
|
||||
if(rex.w)
|
||||
test64(emu, R_RAX, F32S64);
|
||||
@@ -458,6 +691,17 @@ x64emurun:
|
||||
test32(emu, R_EAX, F32);
|
||||
break;
|
||||
|
||||
case 0xAA: /* (REP) STOSB */
|
||||
tmp8s = ACCESS_FLAG(F_DF)?-1:+1;
|
||||
tmp64u = (rep)?R_RCX:1L;
|
||||
while(tmp64u) {
|
||||
*(uint8_t*)R_RDI = R_AL;
|
||||
R_RDI += tmp8s;
|
||||
--tmp64u;
|
||||
}
|
||||
if(rep)
|
||||
R_RCX = tmp64u;
|
||||
break;
|
||||
case 0xAB: /* (REP) STOSD */
|
||||
if(rex.w)
|
||||
tmp8s = ACCESS_FLAG(F_DF)?-8:+8;
|
||||
@@ -479,7 +723,148 @@ x64emurun:
|
||||
if(rep)
|
||||
R_RCX = tmp64u;
|
||||
break;
|
||||
|
||||
case 0xAC: /* LODSB */
|
||||
tmp8s = ACCESS_FLAG(F_DF)?-1:+1;
|
||||
tmp64u = (rep)?R_RCX:1L;
|
||||
while(tmp64u) {
|
||||
R_AL = *(uint8_t*)R_RSI;
|
||||
R_RSI += tmp8s;
|
||||
--tmp64u;
|
||||
}
|
||||
if(rep)
|
||||
R_RCX = tmp64u;
|
||||
break;
|
||||
case 0xAD: /* (REP) LODSD */
|
||||
if(rex.w)
|
||||
tmp8s = ACCESS_FLAG(F_DF)?-8:+8;
|
||||
else
|
||||
tmp8s = ACCESS_FLAG(F_DF)?-4:+4;
|
||||
tmp64u = (rep)?R_RCX:1L;
|
||||
if((rex.w))
|
||||
while(tmp64u) {
|
||||
R_RAX = *(uint64_t*)R_RSI;
|
||||
R_RSI += tmp8s;
|
||||
--tmp64u;
|
||||
}
|
||||
else
|
||||
while(tmp64u) {
|
||||
R_RAX = *(uint32_t*)R_RSI;
|
||||
R_RSI += tmp8s;
|
||||
--tmp64u;
|
||||
}
|
||||
if(rep)
|
||||
R_RCX = tmp64u;
|
||||
break;
|
||||
case 0xAE: /* (REPZ/REPNE) SCASB */
|
||||
tmp8s = ACCESS_FLAG(F_DF)?-1:+1;
|
||||
switch(rep) {
|
||||
case 1:
|
||||
tmp64u = R_RCX;
|
||||
while(tmp64u) {
|
||||
--tmp64u;
|
||||
tmp8u = *(uint8_t*)R_RDI;
|
||||
R_RDI += tmp8s;
|
||||
if(R_AL==tmp8u)
|
||||
break;
|
||||
}
|
||||
if(R_RCX) cmp8(emu, R_AL, tmp8u);
|
||||
R_RCX = tmp64u;
|
||||
break;
|
||||
case 2:
|
||||
tmp64u = R_RCX;
|
||||
while(tmp64u) {
|
||||
--tmp64u;
|
||||
tmp8u = *(uint8_t*)R_RDI;
|
||||
R_EDI += tmp8s;
|
||||
if(R_AL!=tmp8u)
|
||||
break;
|
||||
}
|
||||
if(R_RCX) cmp8(emu, R_AL, tmp8u);
|
||||
R_RCX = tmp64u;
|
||||
break;
|
||||
default:
|
||||
cmp8(emu, R_AL, *(uint8_t*)R_RDI);
|
||||
R_RDI += tmp8s;
|
||||
}
|
||||
break;
|
||||
case 0xAF: /* (REPZ/REPNE) SCASD */
|
||||
if(rex.w)
|
||||
tmp8s = ACCESS_FLAG(F_DF)?-8:+8;
|
||||
else
|
||||
tmp8s = ACCESS_FLAG(F_DF)?-4:+4;
|
||||
switch(rep) {
|
||||
case 1:
|
||||
tmp64u = R_RCX;
|
||||
if(rex.w) {
|
||||
while(tmp64u) {
|
||||
--tmp64u;
|
||||
tmp64u2 = *(uint64_t*)R_RDI;
|
||||
R_RDI += tmp8s;
|
||||
if(R_RAX==tmp64u2)
|
||||
break;
|
||||
}
|
||||
if(R_RCX) cmp64(emu, R_RAX, tmp64u2);
|
||||
} else {
|
||||
while(tmp64u) {
|
||||
--tmp64u;
|
||||
tmp32u = *(uint32_t*)R_RDI;
|
||||
R_RDI += tmp8s;
|
||||
if(R_EAX==tmp32u)
|
||||
break;
|
||||
}
|
||||
if(R_RCX) cmp32(emu, R_EAX, tmp32u);
|
||||
}
|
||||
R_RCX = tmp64u;
|
||||
break;
|
||||
case 2:
|
||||
tmp64u = R_RCX;
|
||||
if(rex.w) {
|
||||
while(tmp64u) {
|
||||
--tmp64u;
|
||||
tmp64u2 = *(uint64_t*)R_RDI;
|
||||
R_RDI += tmp8s;
|
||||
if(R_RAX!=tmp64u2)
|
||||
break;
|
||||
}
|
||||
if(R_RCX) cmp64(emu, R_RAX, tmp64u2);
|
||||
} else {
|
||||
while(tmp64u) {
|
||||
--tmp64u;
|
||||
tmp32u = *(uint32_t*)R_RDI;
|
||||
R_RDI += tmp8s;
|
||||
if(R_EAX!=tmp32u)
|
||||
break;
|
||||
}
|
||||
if(R_RCX) cmp32(emu, R_EAX, tmp32u);
|
||||
}
|
||||
R_RCX = tmp64u;
|
||||
break;
|
||||
default:
|
||||
if(rex.w)
|
||||
cmp64(emu, R_RAX, *(uint64_t*)R_RDI);
|
||||
else
|
||||
cmp32(emu, R_EAX, *(uint32_t*)R_RDI);
|
||||
R_RDI += tmp8s;
|
||||
}
|
||||
break;
|
||||
case 0xB0: /* MOV AL,Ib */
|
||||
case 0xB1: /* MOV CL,Ib */
|
||||
case 0xB2: /* MOV DL,Ib */
|
||||
case 0xB3: /* MOV BL,Ib */
|
||||
if(rex.rex)
|
||||
emu->regs[(opcode&7)+(rex.b<<3)].byte[0] = F8;
|
||||
else
|
||||
emu->regs[opcode&3].byte[0] = F8;
|
||||
break;
|
||||
case 0xB4: /* MOV AH,Ib */
|
||||
case 0xB5: /* ... */
|
||||
case 0xB6:
|
||||
case 0xB7:
|
||||
if(rex.rex)
|
||||
emu->regs[(opcode&7)+(rex.b<<3)].byte[0] = F8;
|
||||
else
|
||||
emu->regs[opcode&3].byte[1] = F8;
|
||||
break;
|
||||
case 0xB8: /* MOV EAX,Id */
|
||||
case 0xB9: /* MOV ECX,Id */
|
||||
case 0xBA: /* MOV EDX,Id */
|
||||
@@ -494,6 +879,21 @@ x64emurun:
|
||||
emu->regs[(opcode&7)+(rex.b<<3)].q[0] = F32;
|
||||
break;
|
||||
|
||||
case 0xC0: /* GRP2 Eb,Ib */
|
||||
nextop = F8;
|
||||
GETEB(1);
|
||||
tmp8u = F8/* & 0x1f*/; // masking done in each functions
|
||||
switch((nextop>>3)&7) {
|
||||
case 0: EB->byte[0] = rol8(emu, EB->byte[0], tmp8u); break;
|
||||
case 1: EB->byte[0] = ror8(emu, EB->byte[0], tmp8u); break;
|
||||
case 2: EB->byte[0] = rcl8(emu, EB->byte[0], tmp8u); break;
|
||||
case 3: EB->byte[0] = rcr8(emu, EB->byte[0], tmp8u); break;
|
||||
case 4:
|
||||
case 6: EB->byte[0] = shl8(emu, EB->byte[0], tmp8u); break;
|
||||
case 5: EB->byte[0] = shr8(emu, EB->byte[0], tmp8u); break;
|
||||
case 7: EB->byte[0] = sar8(emu, EB->byte[0], tmp8u); break;
|
||||
}
|
||||
break;
|
||||
case 0xC1: /* GRP2 Ed,Ib */
|
||||
nextop = F8;
|
||||
GETED(1);
|
||||
@@ -556,7 +956,21 @@ x64emurun:
|
||||
else
|
||||
ED->dword[0] = F32;
|
||||
break;
|
||||
|
||||
case 0xC8: /* ENTER Iw,Ib */
|
||||
tmp16u = F16;
|
||||
tmp8u = (F8) & 0x1f;
|
||||
tmp64u = R_RBP;
|
||||
Push(emu, R_RBP);
|
||||
R_RBP = R_RSP;
|
||||
if (tmp8u) {
|
||||
for (tmp8u2 = 1; tmp8u2 < tmp8u; tmp8u2++) {
|
||||
tmp64u -= sizeof(void*);
|
||||
Push(emu, *((uintptr_t*)tmp64u));
|
||||
}
|
||||
Push(emu, R_RBP);
|
||||
}
|
||||
R_RSP -= tmp16u;
|
||||
break;
|
||||
case 0xC9: /* LEAVE */
|
||||
R_RSP = R_RBP;
|
||||
R_RBP = Pop(emu);
|
||||
@@ -567,6 +981,22 @@ x64emurun:
|
||||
if(emu->quit) goto fini;
|
||||
break;
|
||||
|
||||
case 0xD0: /* GRP2 Eb,1 */
|
||||
case 0xD2: /* GRP2 Eb,CL */
|
||||
nextop = F8;
|
||||
GETEB(0);
|
||||
tmp8u = (opcode==0xD0)?1:R_CL;
|
||||
switch((nextop>>3)&7) {
|
||||
case 0: EB->byte[0] = rol8(emu, EB->byte[0], tmp8u); break;
|
||||
case 1: EB->byte[0] = ror8(emu, EB->byte[0], tmp8u); break;
|
||||
case 2: EB->byte[0] = rcl8(emu, EB->byte[0], tmp8u); break;
|
||||
case 3: EB->byte[0] = rcr8(emu, EB->byte[0], tmp8u); break;
|
||||
case 4:
|
||||
case 6: EB->byte[0] = shl8(emu, EB->byte[0], tmp8u); break;
|
||||
case 5: EB->byte[0] = shr8(emu, EB->byte[0], tmp8u); break;
|
||||
case 7: EB->byte[0] = sar8(emu, EB->byte[0], tmp8u); break;
|
||||
}
|
||||
break;
|
||||
case 0xD1: /* GRP2 Ed,1 */
|
||||
case 0xD3: /* GRP2 Ed,CL */
|
||||
nextop = F8;
|
||||
@@ -609,6 +1039,17 @@ x64emurun:
|
||||
}
|
||||
break;
|
||||
|
||||
case 0xD7: /* XLAT */
|
||||
R_AL = *(uint8_t*)(R_RBX + R_AL);
|
||||
break;
|
||||
case 0xD8: /* x87 opcodes */
|
||||
if(RunD8(emu, rex)) {
|
||||
unimp = 1;
|
||||
goto fini;
|
||||
}
|
||||
if(emu->quit)
|
||||
goto fini;
|
||||
break;
|
||||
case 0xD9: /* x87 opcodes */
|
||||
if(RunD9(emu, rex)) {
|
||||
unimp = 1;
|
||||
@@ -617,7 +1058,14 @@ x64emurun:
|
||||
if(emu->quit)
|
||||
goto fini;
|
||||
break;
|
||||
|
||||
case 0xDA: /* x87 opcodes */
|
||||
if(RunDA(emu, rex)) {
|
||||
unimp = 1;
|
||||
goto fini;
|
||||
}
|
||||
if(emu->quit)
|
||||
goto fini;
|
||||
break;
|
||||
case 0xDB: /* x87 opcodes */
|
||||
if(RunDB(emu, rex)) {
|
||||
unimp = 1;
|
||||
@@ -627,6 +1075,15 @@ x64emurun:
|
||||
goto fini;
|
||||
break;
|
||||
|
||||
case 0xDD: /* x87 opcodes */
|
||||
if(RunDD(emu, rex)) {
|
||||
unimp = 1;
|
||||
goto fini;
|
||||
}
|
||||
if(emu->quit)
|
||||
goto fini;
|
||||
break;
|
||||
|
||||
case 0xDF: /* x87 opcodes */
|
||||
if(RunDF(emu, rex)) {
|
||||
unimp = 1;
|
||||
@@ -731,27 +1188,74 @@ x64emurun:
|
||||
test32(emu, ED->dword[0], tmp32u);
|
||||
break;
|
||||
case 2: /* NOT Ed */
|
||||
ED->dword[0] = not32(emu, ED->dword[0]);
|
||||
if(MODREG)
|
||||
ED->q[0] = not32(emu, ED->dword[0]);
|
||||
else
|
||||
ED->dword[0] = not32(emu, ED->dword[0]);
|
||||
break;
|
||||
case 3: /* NEG Ed */
|
||||
ED->dword[0] = neg32(emu, ED->dword[0]);
|
||||
if(MODREG)
|
||||
ED->q[0] = neg32(emu, ED->dword[0]);
|
||||
else
|
||||
ED->dword[0] = neg32(emu, ED->dword[0]);
|
||||
break;
|
||||
case 4: /* MUL EAX,Ed */
|
||||
mul32_eax(emu, ED->dword[0]);
|
||||
emu->regs[_AX].dword[1] = 0;
|
||||
break;
|
||||
case 5: /* IMUL EAX,Ed */
|
||||
imul32_eax(emu, ED->dword[0]);
|
||||
emu->regs[_AX].dword[1] = 0;
|
||||
break;
|
||||
case 6: /* DIV Ed */
|
||||
div32(emu, ED->dword[0]);
|
||||
emu->regs[_AX].dword[1] = 0;
|
||||
emu->regs[_DX].dword[1] = 0;
|
||||
break;
|
||||
case 7: /* IDIV Ed */
|
||||
idiv32(emu, ED->dword[0]);
|
||||
emu->regs[_AX].dword[1] = 0;
|
||||
emu->regs[_DX].dword[1] = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 0xF8: /* CLC */
|
||||
CHECK_FLAGS(emu);
|
||||
CLEAR_FLAG(F_CF);
|
||||
break;
|
||||
case 0xF9: /* STC */
|
||||
CHECK_FLAGS(emu);
|
||||
SET_FLAG(F_CF);
|
||||
break;
|
||||
case 0xFA: /* CLI */
|
||||
CLEAR_FLAG(F_IF); //not really handled...
|
||||
break;
|
||||
case 0xFB: /* STI */
|
||||
SET_FLAG(F_IF);
|
||||
break;
|
||||
case 0xFC: /* CLD */
|
||||
CLEAR_FLAG(F_DF);
|
||||
break;
|
||||
case 0xFD: /* STD */
|
||||
SET_FLAG(F_DF);
|
||||
break;
|
||||
case 0xFE: /* GRP 5 Eb */
|
||||
nextop = F8;
|
||||
GETEB(0);
|
||||
switch((nextop>>3)&7) {
|
||||
case 0: /* INC Eb */
|
||||
ED->byte[0] = inc8(emu, ED->byte[0]);
|
||||
break;
|
||||
case 1: /* DEC Ed */
|
||||
ED->byte[0] = dec8(emu, ED->byte[0]);
|
||||
break;
|
||||
default:
|
||||
unimp = 1;
|
||||
goto fini;
|
||||
}
|
||||
break;
|
||||
case 0xFF: /* GRP 5 Ed */
|
||||
nextop = F8;
|
||||
GETED(0);
|
||||
@@ -760,13 +1264,13 @@ x64emurun:
|
||||
if(rex.w)
|
||||
ED->q[0] = inc64(emu, ED->q[0]);
|
||||
else
|
||||
ED->dword[0] = inc32(emu, ED->dword[0]);
|
||||
ED->q[0] = inc32(emu, ED->dword[0]);
|
||||
break;
|
||||
case 1: /* DEC Ed */
|
||||
if(rex.w)
|
||||
ED->q[0] = dec64(emu, ED->q[0]);
|
||||
else
|
||||
ED->dword[0] = dec32(emu, ED->dword[0]);
|
||||
ED->q[0] = dec32(emu, ED->dword[0]);
|
||||
break;
|
||||
case 2: /* CALL NEAR Ed */
|
||||
tmp64u = (uintptr_t)getAlternate((void*)ED->q[0]);
|
||||
|
||||
+689
-4
@@ -32,10 +32,12 @@ int Run0F(x64emu_t *emu, rex_t rex)
|
||||
uint8_t opcode;
|
||||
uint8_t nextop;
|
||||
uint8_t tmp8u;
|
||||
int8_t tmp8s;
|
||||
int32_t tmp32s, tmp32s2;
|
||||
uint32_t tmp32u;
|
||||
uint32_t tmp32u, tmp32u2;
|
||||
uint64_t tmp64u, tmp64u2;
|
||||
reg64_t *oped, *opgd;
|
||||
sse_regs_t *opex, *opgx;
|
||||
sse_regs_t *opex, *opgx, eax1;
|
||||
mmx87_regs_t *opem, *opgm;
|
||||
|
||||
opcode = F8;
|
||||
@@ -46,18 +48,75 @@ int Run0F(x64emu_t *emu, rex_t rex)
|
||||
x64Syscall(emu);
|
||||
break;
|
||||
|
||||
case 0x10: /* MOVUPS Gx,Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
memcpy(GX, EX, 16); // unaligned, so carreful
|
||||
break;
|
||||
case 0x11: /* MOVUPS Ex,Gx */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
memcpy(EX, GX, 16); // unaligned, so carreful
|
||||
break;
|
||||
case 0x12:
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
if((nextop&0xC0)==0xC0) /* MOVHLPS Gx,Ex */
|
||||
GX->q[0] = EX->q[1];
|
||||
else
|
||||
GX->q[0] = EX->q[0]; /* MOVLPS Gx,Ex */
|
||||
break;
|
||||
case 0x13: /* MOVLPS Ex,Gx */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
EX->q[0] = GX->q[0];
|
||||
break;
|
||||
case 0x14: /* UNPCKLPS Gx, Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
GX->ud[3] = EX->ud[1];
|
||||
GX->ud[2] = GX->ud[1];
|
||||
GX->ud[1] = EX->ud[0];
|
||||
break;
|
||||
case 0x15: /* UNPCKHPS Gx, Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
GX->ud[0] = GX->ud[2];
|
||||
GX->ud[1] = EX->ud[2];
|
||||
GX->ud[2] = GX->ud[3];
|
||||
GX->ud[3] = EX->ud[3];
|
||||
break;
|
||||
case 0x16: /* MOVHPS Gx,Ex */
|
||||
nextop = F8; /* MOVLHPS Gx,Ex (Ex==reg) */
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
GX->q[1] = EX->q[0];
|
||||
break;
|
||||
case 0x17: /* MOVHPS Ex,Gx */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
EX->q[0] = GX->q[1];
|
||||
break;
|
||||
|
||||
case 0x1F: /* NOP (multi-byte) */
|
||||
nextop = F8;
|
||||
GETED(0);
|
||||
break;
|
||||
|
||||
case 0x28: /* MOVAPS Gx,Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
GX->q[0] = EX->q[0];
|
||||
GX->q[1] = EX->q[1];
|
||||
break;
|
||||
case 0x29: /* MOVAPS Ex,Gx */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
@@ -65,6 +124,69 @@ int Run0F(x64emu_t *emu, rex_t rex)
|
||||
EX->q[0] = GX->q[0];
|
||||
EX->q[1] = GX->q[1];
|
||||
break;
|
||||
case 0x2A: /* CVTPI2PS Gx, Em */
|
||||
nextop = F8;
|
||||
GETEM(0);
|
||||
GETGX;
|
||||
GX->f[0] = EM->sd[0];
|
||||
GX->f[1] = EM->sd[1];
|
||||
break;
|
||||
case 0x2B: /* MOVNTPS Ex,Gx */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
EX->q[0] = GX->q[0];
|
||||
EX->q[1] = GX->q[1];
|
||||
break;
|
||||
case 0x2C: /* CVTTPS2PI Gm, Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGM;
|
||||
GM->sd[1] = EX->f[1];
|
||||
GM->sd[0] = EX->f[0];
|
||||
break;
|
||||
case 0x2D: /* CVTPS2PI Gm, Ex */
|
||||
// rounding should be done; and indefinite integer should also be assigned if overflow or NaN/Inf
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGM;
|
||||
switch((emu->mxcsr>>13)&3) {
|
||||
case ROUND_Nearest:
|
||||
GM->sd[1] = floorf(EX->f[1]+0.5f);
|
||||
GM->sd[0] = floorf(EX->f[0]+0.5f);
|
||||
break;
|
||||
case ROUND_Down:
|
||||
GM->sd[1] = floorf(EX->f[1]);
|
||||
GM->sd[0] = floorf(EX->f[0]);
|
||||
break;
|
||||
case ROUND_Up:
|
||||
GM->sd[1] = ceilf(EX->f[1]);
|
||||
GM->sd[0] = ceilf(EX->f[0]);
|
||||
break;
|
||||
case ROUND_Chop:
|
||||
GM->sd[1] = EX->f[1];
|
||||
GM->sd[0] = EX->f[0];
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 0x2E: /* UCOMISS Gx, Ex */
|
||||
// same for now
|
||||
case 0x2F: /* COMISS Gx, Ex */
|
||||
RESET_FLAGS(emu);
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
if(isnan(GX->f[0]) || isnan(EX->f[0])) {
|
||||
SET_FLAG(F_ZF); SET_FLAG(F_PF); SET_FLAG(F_CF);
|
||||
} else if(isgreater(GX->f[0], EX->f[0])) {
|
||||
CLEAR_FLAG(F_ZF); CLEAR_FLAG(F_PF); CLEAR_FLAG(F_CF);
|
||||
} else if(isless(GX->f[0], EX->f[0])) {
|
||||
CLEAR_FLAG(F_ZF); CLEAR_FLAG(F_PF); SET_FLAG(F_CF);
|
||||
} else {
|
||||
SET_FLAG(F_ZF); CLEAR_FLAG(F_PF); CLEAR_FLAG(F_CF);
|
||||
}
|
||||
CLEAR_FLAG(F_OF); CLEAR_FLAG(F_AF); CLEAR_FLAG(F_SF);
|
||||
break;
|
||||
|
||||
|
||||
GOCOND(0x40
|
||||
@@ -72,10 +194,129 @@ int Run0F(x64emu_t *emu, rex_t rex)
|
||||
GETED(0);
|
||||
GETGD;
|
||||
CHECK_FLAGS(emu);
|
||||
, if(rex.w) {GD->q[0] = ED->q[0]; } else {GD->dword[0] = ED->dword[0];}
|
||||
,
|
||||
, if(rex.w) {GD->q[0] = ED->q[0]; } else {GD->q[0] = ED->dword[0];}
|
||||
, if(!rex.w) GD->dword[1] = 0;
|
||||
) /* 0x40 -> 0x4F CMOVxx Gd,Ed */ // conditional move, no sign
|
||||
|
||||
case 0x50: /* MOVMSKPS Gd, Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGD;
|
||||
GD->dword[0] = 0;
|
||||
for(int i=0; i<4; ++i)
|
||||
GD->dword[0] |= ((EX->ud[i]>>31)&1)<<i;
|
||||
break;
|
||||
case 0x51: /* SQRTPS Gx, Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
for(int i=0; i<4; ++i)
|
||||
GX->f[i] = sqrtf(EX->f[i]);
|
||||
break;
|
||||
case 0x52: /* RSQRTPS Gx, Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
for(int i=0; i<4; ++i)
|
||||
GX->f[i] = 1.0f/sqrtf(EX->f[i]);
|
||||
break;
|
||||
case 0x53: /* RCPPS Gx, Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
for(int i=0; i<4; ++i)
|
||||
GX->f[i] = 1.0f/EX->f[i];
|
||||
break;
|
||||
case 0x54: /* ANDPS Gx, Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
for(int i=0; i<4; ++i)
|
||||
GX->ud[i] &= EX->ud[i];
|
||||
break;
|
||||
case 0x55: /* ANDNPS Gx, Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
for(int i=0; i<4; ++i)
|
||||
GX->ud[i] = (~GX->ud[i]) & EX->ud[i];
|
||||
break;
|
||||
case 0x56: /* ORPS Gx, Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
for(int i=0; i<4; ++i)
|
||||
GX->ud[i] |= EX->ud[i];
|
||||
break;
|
||||
case 0x57: /* XORPS Gx, Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
for(int i=0; i<4; ++i)
|
||||
GX->ud[i] ^= EX->ud[i];
|
||||
break;
|
||||
case 0x58: /* ADDPS Gx, Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
for(int i=0; i<4; ++i)
|
||||
GX->f[i] += EX->f[i];
|
||||
break;
|
||||
case 0x59: /* MULPS Gx, Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
for(int i=0; i<4; ++i)
|
||||
GX->f[i] *= EX->f[i];
|
||||
break;
|
||||
case 0x5A: /* CVTPS2PD Gx, Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
GX->d[1] = EX->f[1];
|
||||
GX->d[0] = EX->f[0];
|
||||
break;
|
||||
case 0x5B: /* CVTDQ2PS Gx, Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
GX->f[0] = EX->sd[0];
|
||||
GX->f[1] = EX->sd[1];
|
||||
GX->f[2] = EX->sd[2];
|
||||
GX->f[3] = EX->sd[3];
|
||||
break;
|
||||
case 0x5C: /* SUBPS Gx, Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
for(int i=0; i<4; ++i)
|
||||
GX->f[i] -= EX->f[i];
|
||||
break;
|
||||
case 0x5D: /* MINPS Gx, Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
for(int i=0; i<4; ++i) {
|
||||
if (isnan(GX->f[i]) || isnan(EX->f[i]) || isless(EX->f[i], GX->f[i]))
|
||||
GX->f[i] = EX->f[i];
|
||||
}
|
||||
break;
|
||||
case 0x5E: /* DIVPS Gx, Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
for(int i=0; i<4; ++i)
|
||||
GX->f[i] /= EX->f[i];
|
||||
break;
|
||||
case 0x5F: /* MAXPS Gx, Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
for(int i=0; i<4; ++i) {
|
||||
if (isnan(GX->f[i]) || isnan(EX->f[i]) || isgreater(EX->f[i], GX->f[i]))
|
||||
GX->f[i] = EX->f[i];
|
||||
}
|
||||
break;
|
||||
case 0x60: /* PUNPCKLBW Gm, Em */
|
||||
nextop = F8;
|
||||
GETEM(0);
|
||||
@@ -270,7 +511,86 @@ int Run0F(x64emu_t *emu, rex_t rex)
|
||||
tmp32u = R_EAX;
|
||||
my_cpuid(emu, tmp32u);
|
||||
break;
|
||||
case 0xA3: /* BT Ed,Gd */
|
||||
CHECK_FLAGS(emu);
|
||||
nextop = F8;
|
||||
GETED(0);
|
||||
GETGD;
|
||||
tmp8u = GD->byte[0];
|
||||
if(!MODREG)
|
||||
{
|
||||
ED=(reg64_t*)(((uint32_t*)(ED))+(tmp8u>>5));
|
||||
}
|
||||
if(rex.w) {
|
||||
tmp8u&=63;
|
||||
if(ED->q[0] & (1LL<<tmp8u))
|
||||
SET_FLAG(F_CF);
|
||||
else
|
||||
CLEAR_FLAG(F_CF);
|
||||
} else {
|
||||
tmp8u&=31;
|
||||
if(ED->dword[0] & (1<<tmp8u))
|
||||
SET_FLAG(F_CF);
|
||||
else
|
||||
CLEAR_FLAG(F_CF);
|
||||
}
|
||||
break;
|
||||
case 0xA4: /* SHLD Ed,Gd,Ib */
|
||||
case 0xA5: /* SHLD Ed,Gd,CL */
|
||||
nextop = F8;
|
||||
GETED((nextop==0xA4)?1:0);
|
||||
GETGD;
|
||||
if(opcode==0xA4)
|
||||
tmp8u = F8;
|
||||
else
|
||||
tmp8u = R_CL;
|
||||
if(rex.w)
|
||||
ED->q[0] = shld64(emu, ED->q[0], GD->q[0], tmp8u);
|
||||
else
|
||||
ED->q[0] = shld32(emu, ED->dword[0], GD->dword[0], tmp8u);
|
||||
break;
|
||||
|
||||
case 0xAB: /* BTS Ed,Gd */
|
||||
CHECK_FLAGS(emu);
|
||||
nextop = F8;
|
||||
GETED(0);
|
||||
GETGD;
|
||||
tmp8u = GD->byte[0];
|
||||
if(!MODREG)
|
||||
{
|
||||
ED=(reg64_t*)(((uint32_t*)(ED))+(tmp8u>>5));
|
||||
}
|
||||
if(rex.w) {
|
||||
tmp8u&=63;
|
||||
if(ED->q[0] & (1LL<<tmp8u))
|
||||
SET_FLAG(F_CF);
|
||||
else {
|
||||
ED->q[0] |= (1LL<<tmp8u);
|
||||
CLEAR_FLAG(F_CF);
|
||||
}
|
||||
} else {
|
||||
tmp8u&=31;
|
||||
if(ED->dword[0] & (1<<tmp8u))
|
||||
SET_FLAG(F_CF);
|
||||
else {
|
||||
ED->dword[0] |= (1<<tmp8u);
|
||||
CLEAR_FLAG(F_CF);
|
||||
}
|
||||
if(MODREG)
|
||||
ED->dword[1] = 0;
|
||||
}
|
||||
break;
|
||||
case 0xAC: /* SHRD Ed,Gd,Ib */
|
||||
case 0xAD: /* SHRD Ed,Gd,CL */
|
||||
nextop = F8;
|
||||
GETED((nextop==0xAC)?1:0);
|
||||
GETGD;
|
||||
tmp8u = (opcode==0xAC)?(F8):R_CL;
|
||||
if(rex.w)
|
||||
ED->q[0] = shrd64(emu, ED->q[0], GD->q[0], tmp8u);
|
||||
else
|
||||
ED->q[0] = shrd32(emu, ED->dword[0], GD->dword[0], tmp8u);
|
||||
break;
|
||||
case 0xAE: /* Grp Ed (SSE) */
|
||||
nextop = F8;
|
||||
if((nextop&0xF8)==0xE8) {
|
||||
@@ -284,6 +604,24 @@ int Run0F(x64emu_t *emu, rex_t rex)
|
||||
}
|
||||
GETED(0);
|
||||
switch((nextop>>3)&7) {
|
||||
case 0: /* FXSAVE Ed */
|
||||
if(rex.w)
|
||||
fpu_fxsave64(emu, ED);
|
||||
else
|
||||
fpu_fxsave32(emu, ED);
|
||||
break;
|
||||
case 1: /* FXRSTOR Ed */
|
||||
if(rex.w)
|
||||
fpu_fxrstor64(emu, ED);
|
||||
else
|
||||
fpu_fxrstor32(emu, ED);
|
||||
break;
|
||||
case 2: /* LDMXCSR Md */
|
||||
emu->mxcsr = ED->dword[0];
|
||||
break;
|
||||
case 3: /* STMXCSR Md */
|
||||
ED->dword[0] = emu->mxcsr;
|
||||
break;
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
@@ -297,6 +635,68 @@ int Run0F(x64emu_t *emu, rex_t rex)
|
||||
else
|
||||
GD->dword[0] = imul32(emu, GD->dword[0], ED->dword[0]);
|
||||
break;
|
||||
case 0xB0: /* CMPXCHG Eb,Gb */
|
||||
nextop = F8;
|
||||
GETEB(0);
|
||||
GETGB;
|
||||
cmp8(emu, R_AL, EB->byte[0]);
|
||||
if(ACCESS_FLAG(F_ZF)) {
|
||||
EB->byte[0] = GB;
|
||||
} else {
|
||||
R_AL = EB->byte[0];
|
||||
}
|
||||
break;
|
||||
case 0xB1: /* CMPXCHG Ed,Gd */
|
||||
nextop = F8;
|
||||
GETED(0);
|
||||
GETGD;
|
||||
if(rex.w) {
|
||||
cmp64(emu, R_RAX, ED->q[0]);
|
||||
if(ACCESS_FLAG(F_ZF)) {
|
||||
ED->q[0] = GD->q[0];
|
||||
} else {
|
||||
R_RAX = ED->q[0];
|
||||
}
|
||||
} else {
|
||||
cmp32(emu, R_EAX, ED->dword[0]);
|
||||
if(ACCESS_FLAG(F_ZF)) {
|
||||
if(MODREG)
|
||||
ED->q[0] = GD->dword[0];
|
||||
else
|
||||
ED->dword[0] = GD->dword[0];
|
||||
} else {
|
||||
R_RAX = ED->dword[0];
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0xB3: /* BTR Ed,Gd */
|
||||
CHECK_FLAGS(emu);
|
||||
nextop = F8;
|
||||
GETED(0);
|
||||
GETGD;
|
||||
tmp8u = GD->byte[0];
|
||||
if(!MODREG)
|
||||
{
|
||||
ED=(reg64_t*)(((uint32_t*)(ED))+(tmp8u>>5));
|
||||
}
|
||||
if(rex.w) {
|
||||
tmp8u&=63;
|
||||
if(ED->q[0] & (1LL<<tmp8u)) {
|
||||
SET_FLAG(F_CF);
|
||||
ED->q[0] ^= (1LL<<tmp8u);
|
||||
} else
|
||||
CLEAR_FLAG(F_CF);
|
||||
} else {
|
||||
tmp8u&=31;
|
||||
if(ED->dword[0] & (1<<tmp8u)) {
|
||||
SET_FLAG(F_CF);
|
||||
ED->dword[0] ^= (1<<tmp8u);
|
||||
} else
|
||||
CLEAR_FLAG(F_CF);
|
||||
if(MODREG)
|
||||
ED->dword[1] = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
case 0xB6: /* MOVZX Gd,Eb */
|
||||
nextop = F8;
|
||||
@@ -311,6 +711,187 @@ int Run0F(x64emu_t *emu, rex_t rex)
|
||||
GD->q[0] = EW->word[0];
|
||||
break;
|
||||
|
||||
case 0xBA:
|
||||
nextop = F8;
|
||||
switch((nextop>>3)&7) {
|
||||
case 4: /* BT Ed,Ib */
|
||||
CHECK_FLAGS(emu);
|
||||
GETED(1);
|
||||
tmp8u = F8;
|
||||
if(!MODREG)
|
||||
ED=(reg64_t*)(((uintptr_t*)(ED))+(tmp8u>>5));
|
||||
if(rex.w) {
|
||||
tmp8u&=63;
|
||||
if(ED->q[0] & (1LL<<tmp8u))
|
||||
SET_FLAG(F_CF);
|
||||
else
|
||||
CLEAR_FLAG(F_CF);
|
||||
} else {
|
||||
tmp8u&=31;
|
||||
if(ED->dword[0] & (1<<tmp8u))
|
||||
SET_FLAG(F_CF);
|
||||
else
|
||||
CLEAR_FLAG(F_CF);
|
||||
}
|
||||
break;
|
||||
case 5: /* BTS Ed, Ib */
|
||||
CHECK_FLAGS(emu);
|
||||
GETED(1);
|
||||
tmp8u = F8;
|
||||
if(!MODREG)
|
||||
ED=(reg64_t*)(((uintptr_t*)(ED))+(tmp8u>>5));
|
||||
if(rex.w) {
|
||||
tmp8u&=63;
|
||||
if(ED->q[0] & (1LL<<tmp8u)) {
|
||||
SET_FLAG(F_CF);
|
||||
} else {
|
||||
ED->q[0] ^= (1LL<<tmp8u);
|
||||
CLEAR_FLAG(F_CF);
|
||||
}
|
||||
} else {
|
||||
tmp8u&=31;
|
||||
if(ED->dword[0] & (1<<tmp8u)) {
|
||||
SET_FLAG(F_CF);
|
||||
} else {
|
||||
ED->dword[0] ^= (1<<tmp8u);
|
||||
CLEAR_FLAG(F_CF);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 6: /* BTR Ed, Ib */
|
||||
CHECK_FLAGS(emu);
|
||||
GETED(1);
|
||||
tmp8u = F8;
|
||||
if(!MODREG)
|
||||
ED=(reg64_t*)(((uintptr_t*)(ED))+(tmp8u>>5));
|
||||
if(rex.w) {
|
||||
tmp8u&=63;
|
||||
if(ED->q[0] & (1LL<<tmp8u)) {
|
||||
SET_FLAG(F_CF);
|
||||
ED->q[0] ^= (1LL<<tmp8u);
|
||||
} else
|
||||
CLEAR_FLAG(F_CF);
|
||||
} else {
|
||||
tmp8u&=31;
|
||||
if(ED->dword[0] & (1<<tmp8u)) {
|
||||
SET_FLAG(F_CF);
|
||||
ED->dword[0] ^= (1<<tmp8u);
|
||||
} else
|
||||
CLEAR_FLAG(F_CF);
|
||||
}
|
||||
break;
|
||||
case 7: /* BTC Ed, Ib */
|
||||
CHECK_FLAGS(emu);
|
||||
GETED(1);
|
||||
tmp8u = F8;
|
||||
if(!MODREG)
|
||||
ED=(reg64_t*)(((uintptr_t*)(ED))+(tmp8u>>5));
|
||||
if(rex.w) {
|
||||
tmp8u&=63;
|
||||
if(ED->q[0] & (1LL<<tmp8u))
|
||||
SET_FLAG(F_CF);
|
||||
else
|
||||
CLEAR_FLAG(F_CF);
|
||||
ED->q[0] ^= (1LL<<tmp8u);
|
||||
} else {
|
||||
tmp8u&=31;
|
||||
if(ED->dword[0] & (1<<tmp8u))
|
||||
SET_FLAG(F_CF);
|
||||
else
|
||||
CLEAR_FLAG(F_CF);
|
||||
ED->dword[0] ^= (1<<tmp8u);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
case 0xBB: /* BTC Ed,Gd */
|
||||
CHECK_FLAGS(emu);
|
||||
nextop = F8;
|
||||
GETED(0);
|
||||
GETGD;
|
||||
tmp8u = GD->byte[0];
|
||||
if(!MODREG)
|
||||
{
|
||||
if(rex.w)
|
||||
ED=(reg64_t*)(((uint64_t*)(ED))+(tmp8u>>6));
|
||||
else
|
||||
ED=(reg64_t*)(((uint32_t*)(ED))+(tmp8u>>5));
|
||||
}
|
||||
if(rex.w) {
|
||||
tmp8u&=63;
|
||||
if(ED->q[0] & (1LL<<tmp8u))
|
||||
SET_FLAG(F_CF);
|
||||
else
|
||||
CLEAR_FLAG(F_CF);
|
||||
ED->q[0] ^= (1LL<<tmp8u);
|
||||
} else {
|
||||
tmp8u&=31;
|
||||
if(ED->dword[0] & (1<<tmp8u))
|
||||
SET_FLAG(F_CF);
|
||||
else
|
||||
CLEAR_FLAG(F_CF);
|
||||
ED->dword[0] ^= (1<<tmp8u);
|
||||
if(MODREG)
|
||||
ED->dword[1] = 0;
|
||||
}
|
||||
break;
|
||||
case 0xBC: /* BSF Ed,Gd */
|
||||
CHECK_FLAGS(emu);
|
||||
nextop = F8;
|
||||
GETED(0);
|
||||
GETGD;
|
||||
if(rex.w) {
|
||||
tmp64u = ED->q[0];
|
||||
if(tmp64u) {
|
||||
CLEAR_FLAG(F_ZF);
|
||||
tmp8u = 0;
|
||||
while(!(tmp64u&(1LL<<tmp8u))) ++tmp8u;
|
||||
GD->q[0] = tmp8u;
|
||||
} else {
|
||||
SET_FLAG(F_ZF);
|
||||
}
|
||||
} else {
|
||||
tmp32u = ED->dword[0];
|
||||
if(tmp32u) {
|
||||
CLEAR_FLAG(F_ZF);
|
||||
tmp8u = 0;
|
||||
while(!(tmp32u&(1<<tmp8u))) ++tmp8u;
|
||||
GD->q[0] = tmp8u;
|
||||
} else {
|
||||
SET_FLAG(F_ZF);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0xBD: /* BSR Ed,Gd */
|
||||
CHECK_FLAGS(emu);
|
||||
nextop = F8;
|
||||
GETED(0);
|
||||
GETGD;
|
||||
if(rex.w) {
|
||||
tmp64u = ED->q[0];
|
||||
if(tmp64u) {
|
||||
CLEAR_FLAG(F_ZF);
|
||||
tmp8u = 63;
|
||||
while(!(tmp64u&(1LL<<tmp8u))) --tmp8u;
|
||||
GD->q[0] = tmp8u;
|
||||
} else {
|
||||
SET_FLAG(F_ZF);
|
||||
}
|
||||
} else {
|
||||
tmp32u = ED->dword[0];
|
||||
if(tmp32u) {
|
||||
CLEAR_FLAG(F_ZF);
|
||||
tmp8u = 31;
|
||||
while(!(tmp32u&(1<<tmp8u))) --tmp8u;
|
||||
GD->q[0] = tmp8u;
|
||||
} else {
|
||||
SET_FLAG(F_ZF);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0xBE: /* MOVSX Gd,Eb */
|
||||
nextop = F8;
|
||||
GETEB(0);
|
||||
@@ -333,6 +914,110 @@ int Run0F(x64emu_t *emu, rex_t rex)
|
||||
GD->dword[1] = 0;
|
||||
}
|
||||
break;
|
||||
case 0xC0: /* XADD Gb,Eb */
|
||||
nextop = F8;
|
||||
GETEB(0);
|
||||
GETGB;
|
||||
tmp8u = add8(emu, EB->byte[0], GB);
|
||||
GB = EB->byte[0];
|
||||
EB->byte[0] = tmp8u;
|
||||
break;
|
||||
case 0xC1: /* XADD Gd,Ed */
|
||||
nextop = F8;
|
||||
GETED(0);
|
||||
GETGD;
|
||||
if(rex.w) {
|
||||
tmp64u = add64(emu, ED->q[0], GD->q[0]);
|
||||
GD->q[0] = ED->q[0];
|
||||
ED->q[0] = tmp64u;
|
||||
} else {
|
||||
tmp32u = add32(emu, ED->dword[0], GD->dword[0]);
|
||||
GD->q[0] = ED->dword[0];
|
||||
if(MODREG)
|
||||
ED->q[0] = tmp32u;
|
||||
else
|
||||
ED->dword[0] = tmp32u;
|
||||
}
|
||||
break;
|
||||
case 0xC2: /* CMPPS Gx, Ex, Ib */
|
||||
nextop = F8;
|
||||
GETEX(1);
|
||||
GETGX;
|
||||
tmp8u = F8;
|
||||
for(int i=0; i<4; ++i) {
|
||||
tmp8s = 0;
|
||||
switch(tmp8u&7) {
|
||||
case 0: tmp8s=(GX->f[i] == EX->f[i]); break;
|
||||
case 1: tmp8s=isless(GX->f[i], EX->f[i]); break;
|
||||
case 2: tmp8s=islessequal(GX->f[i], EX->f[i]); break;
|
||||
case 3: tmp8s=isnan(GX->f[i]) || isnan(EX->f[i]); break;
|
||||
case 4: tmp8s=(GX->f[i] != EX->f[i]); break;
|
||||
case 5: tmp8s=isnan(GX->f[i]) || isnan(EX->f[i]) || isgreaterequal(GX->f[i], EX->f[i]); break;
|
||||
case 6: tmp8s=isnan(GX->f[i]) || isnan(EX->f[i]) || isgreater(GX->f[i], EX->f[i]); break;
|
||||
case 7: tmp8s=!isnan(GX->f[i]) && !isnan(EX->f[i]); break;
|
||||
}
|
||||
GX->ud[i]=(tmp8s)?0xffffffff:0;
|
||||
}
|
||||
break;
|
||||
|
||||
case 0xC6: /* SHUFPS Gx, Ex, Ib */
|
||||
nextop = F8;
|
||||
GETEX(1);
|
||||
GETGX;
|
||||
tmp8u = F8;
|
||||
for(int i=0; i<2; ++i) {
|
||||
eax1.ud[i] = GX->ud[(tmp8u>>(i*2))&3];
|
||||
}
|
||||
for(int i=2; i<4; ++i) {
|
||||
eax1.ud[i] = EX->ud[(tmp8u>>(i*2))&3];
|
||||
}
|
||||
GX->q[0] = eax1.q[0];
|
||||
GX->q[1] = eax1.q[1];
|
||||
break;
|
||||
case 0xC7: /* CMPXCHG8B Eq */
|
||||
CHECK_FLAGS(emu);
|
||||
nextop = F8;
|
||||
GETED(0);
|
||||
if(rex.w) {
|
||||
tmp64u = ED->q[0];
|
||||
tmp64u2= ED->q[1];
|
||||
if(R_RAX == tmp64u && R_RDX == tmp64u2) {
|
||||
SET_FLAG(F_ZF);
|
||||
ED->q[0] = R_EBX;
|
||||
ED->q[1] = R_ECX;
|
||||
} else {
|
||||
CLEAR_FLAG(F_ZF);
|
||||
R_RAX = tmp64u;
|
||||
R_RDX = tmp64u2;
|
||||
}
|
||||
} else {
|
||||
tmp32u = ED->dword[0];
|
||||
tmp32u2= ED->dword[1];
|
||||
if(R_EAX == tmp32u && R_EDX == tmp32u2) {
|
||||
SET_FLAG(F_ZF);
|
||||
ED->dword[0] = R_EBX;
|
||||
ED->dword[1] = R_ECX;
|
||||
} else {
|
||||
CLEAR_FLAG(F_ZF);
|
||||
R_RAX = tmp32u;
|
||||
R_RDX = tmp32u2;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0xC8:
|
||||
case 0xC9:
|
||||
case 0xCA:
|
||||
case 0xCB:
|
||||
case 0xCC:
|
||||
case 0xCD:
|
||||
case 0xCE:
|
||||
case 0xCF: /* BSWAP reg */
|
||||
tmp8u = (opcode&7)+(rex.b<<3);
|
||||
if(rex.w)
|
||||
emu->regs[tmp8u].q[0] = __builtin_bswap64(emu->regs[tmp8u].q[0]);
|
||||
else
|
||||
emu->regs[tmp8u].q[0] = __builtin_bswap32(emu->regs[tmp8u].dword[0]);
|
||||
break;
|
||||
|
||||
case 0xD1: /* PSRLW Gm,Em */
|
||||
nextop = F8;
|
||||
|
||||
@@ -33,6 +33,9 @@ int Run64(x64emu_t *emu, rex_t rex)
|
||||
uint8_t tmp8u;
|
||||
int16_t tmp16s;
|
||||
uint16_t tmp16u;
|
||||
int32_t tmp32s;
|
||||
uint32_t tmp32u;
|
||||
uint64_t tmp64u;
|
||||
reg64_t *oped, *opgd;
|
||||
uintptr_t tlsdata = GetFSBaseEmu(emu);
|
||||
|
||||
@@ -46,6 +49,64 @@ int Run64(x64emu_t *emu, rex_t rex)
|
||||
|
||||
switch(opcode) {
|
||||
|
||||
case 0x33: /* XOR Gd,Ed */
|
||||
nextop = F8;
|
||||
GETED_OFFS(0, tlsdata);
|
||||
GETGD;
|
||||
if(rex.w)
|
||||
GD->q[0] = xor64(emu, GD->q[0], ED->q[0]);
|
||||
else
|
||||
GD->q[0] = xor32(emu, GD->dword[0], ED->dword[0]);
|
||||
break;
|
||||
|
||||
case 0x81: /* GRP Ed,Id */
|
||||
case 0x83: /* GRP Ed,Ib */
|
||||
nextop = F8;
|
||||
GETED_OFFS((opcode==0x81)?4:1, tlsdata);
|
||||
if(opcode==0x81) {
|
||||
tmp32s = F32S;
|
||||
} else {
|
||||
tmp32s = F8S;
|
||||
}
|
||||
if(rex.w) {
|
||||
tmp64u = (uint64_t)tmp32s;
|
||||
switch((nextop>>3)&7) {
|
||||
case 0: ED->q[0] = add64(emu, ED->q[0], tmp64u); break;
|
||||
case 1: ED->q[0] = or64(emu, ED->q[0], tmp64u); break;
|
||||
case 2: ED->q[0] = adc64(emu, ED->q[0], tmp64u); break;
|
||||
case 3: ED->q[0] = sbb64(emu, ED->q[0], tmp64u); break;
|
||||
case 4: ED->q[0] = and64(emu, ED->q[0], tmp64u); break;
|
||||
case 5: ED->q[0] = sub64(emu, ED->q[0], tmp64u); break;
|
||||
case 6: ED->q[0] = xor64(emu, ED->q[0], tmp64u); break;
|
||||
case 7: cmp64(emu, ED->q[0], tmp64u); break;
|
||||
}
|
||||
} else {
|
||||
tmp32u = (uint32_t)tmp32s;
|
||||
if(MODREG)
|
||||
switch((nextop>>3)&7) {
|
||||
case 0: ED->q[0] = add32(emu, ED->dword[0], tmp32u); break;
|
||||
case 1: ED->q[0] = or32(emu, ED->dword[0], tmp32u); break;
|
||||
case 2: ED->q[0] = adc32(emu, ED->dword[0], tmp32u); break;
|
||||
case 3: ED->q[0] = sbb32(emu, ED->dword[0], tmp32u); break;
|
||||
case 4: ED->q[0] = and32(emu, ED->dword[0], tmp32u); break;
|
||||
case 5: ED->q[0] = sub32(emu, ED->dword[0], tmp32u); break;
|
||||
case 6: ED->q[0] = xor32(emu, ED->dword[0], tmp32u); break;
|
||||
case 7: cmp32(emu, ED->dword[0], tmp32u); break;
|
||||
}
|
||||
else
|
||||
switch((nextop>>3)&7) {
|
||||
case 0: ED->dword[0] = add32(emu, ED->dword[0], tmp32u); break;
|
||||
case 1: ED->dword[0] = or32(emu, ED->dword[0], tmp32u); break;
|
||||
case 2: ED->dword[0] = adc32(emu, ED->dword[0], tmp32u); break;
|
||||
case 3: ED->dword[0] = sbb32(emu, ED->dword[0], tmp32u); break;
|
||||
case 4: ED->dword[0] = and32(emu, ED->dword[0], tmp32u); break;
|
||||
case 5: ED->dword[0] = sub32(emu, ED->dword[0], tmp32u); break;
|
||||
case 6: ED->dword[0] = xor32(emu, ED->dword[0], tmp32u); break;
|
||||
case 7: cmp32(emu, ED->dword[0], tmp32u); break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x88: /* MOV Eb,Gb */
|
||||
nextop = F8;
|
||||
GETEB_OFFS(0, tlsdata);
|
||||
|
||||
+518
-5
@@ -26,16 +26,27 @@
|
||||
|
||||
#include "modrm.h"
|
||||
|
||||
int Run66(x64emu_t *emu, rex_t rex)
|
||||
int Run66(x64emu_t *emu, rex_t rex, int rep)
|
||||
{
|
||||
uint8_t opcode;
|
||||
uint8_t nextop;
|
||||
uint8_t tmp8u;
|
||||
int8_t tmp8s;
|
||||
uint8_t tmp8u, tmp8u2;
|
||||
int16_t tmp16s;
|
||||
uint16_t tmp16u;
|
||||
uint16_t tmp16u, tmp16u2;
|
||||
int64_t tmp64s;
|
||||
uint64_t tmp64u, tmp64u2, tmp64u3;
|
||||
reg64_t *oped, *opgd;
|
||||
|
||||
opcode = F8;
|
||||
|
||||
while((opcode==0x2E) || (opcode==0x66)) // ignoring CS: or multiple 0x66
|
||||
opcode = F8;
|
||||
|
||||
while((opcode==0xF2) || (opcode==0xF3)) {
|
||||
rep = opcode-0xF1;
|
||||
opcode = F8;
|
||||
}
|
||||
// REX prefix before the F0 are ignored
|
||||
rex.rex = 0;
|
||||
while(opcode>=0x40 && opcode<=0x4f) {
|
||||
@@ -44,10 +55,112 @@ int Run66(x64emu_t *emu, rex_t rex)
|
||||
}
|
||||
|
||||
switch(opcode) {
|
||||
#define GO(B, OP) \
|
||||
case B+0: \
|
||||
nextop = F8; \
|
||||
GETEB(0); \
|
||||
GETGB; \
|
||||
EB->byte[0] = OP##8(emu, EB->byte[0], GB); \
|
||||
break; \
|
||||
case B+1: \
|
||||
nextop = F8; \
|
||||
GETEW(0); \
|
||||
GETGW; \
|
||||
if(rex.w) \
|
||||
EW->q[0] = OP##64(emu, EW->q[0], GW->q[0]); \
|
||||
else \
|
||||
EW->word[0] = OP##16(emu, EW->word[0], GW->word[0]); \
|
||||
break; \
|
||||
case B+2: \
|
||||
nextop = F8; \
|
||||
GETEB(0); \
|
||||
GETGB; \
|
||||
GB = OP##8(emu, GB, EB->byte[0]); \
|
||||
break; \
|
||||
case B+3: \
|
||||
nextop = F8; \
|
||||
GETEW(0); \
|
||||
GETGW; \
|
||||
if(rex.w) \
|
||||
GW->q[0] = OP##64(emu, GW->q[0], EW->q[0]); \
|
||||
else \
|
||||
GW->word[0] = OP##16(emu, GW->word[0], EW->word[0]); \
|
||||
break; \
|
||||
case B+4: \
|
||||
R_AL = OP##8(emu, R_AL, F8); \
|
||||
break; \
|
||||
case B+5: \
|
||||
if(rex.w) \
|
||||
R_RAX = OP##64(emu, R_RAX, F32S64); \
|
||||
else \
|
||||
R_AX = OP##16(emu, R_AX, F16); \
|
||||
break;
|
||||
|
||||
GO(0x00, add) /* ADD 0x01 ~> 0x05 */
|
||||
GO(0x08, or) /* OR 0x09 ~> 0x0D */
|
||||
GO(0x10, adc) /* ADC 0x11 ~> 0x15 */
|
||||
GO(0x18, sbb) /* SBB 0x19 ~> 0x1D */
|
||||
GO(0x20, and) /* AND 0x21 ~> 0x25 */
|
||||
GO(0x28, sub) /* SUB 0x29 ~> 0x2D */
|
||||
GO(0x30, xor) /* XOR 0x31 ~> 0x35 */
|
||||
|
||||
case 0x0F: /* more opcdes */
|
||||
return Run660F(emu, rex);
|
||||
|
||||
case 0x39:
|
||||
nextop = F8;
|
||||
GETEW(0);
|
||||
GETGW;
|
||||
if(rex.w)
|
||||
cmp64(emu, EW->q[0], GW->q[0]);
|
||||
else
|
||||
cmp16(emu, EW->word[0], GW->word[0]);
|
||||
break;
|
||||
case 0x3B:
|
||||
nextop = F8;
|
||||
GETEW(0);
|
||||
GETGW;
|
||||
if(rex.w)
|
||||
cmp64(emu, GW->q[0], EW->dword[0]);
|
||||
else
|
||||
cmp16(emu, GW->word[0], EW->word[0]);
|
||||
break;
|
||||
case 0x3D:
|
||||
if(rex.w)
|
||||
cmp64(emu, R_RAX, F32S64);
|
||||
else
|
||||
cmp16(emu, R_AX, F16);
|
||||
break;
|
||||
|
||||
case 0x64: /* FS: */
|
||||
return Run6664(emu, rex);
|
||||
|
||||
case 0x69: /* IMUL Gw,Ew,Iw */
|
||||
nextop = F8;
|
||||
GETEW(rex.w?4:2);
|
||||
GETGW;
|
||||
if(rex.w) {
|
||||
tmp64u = F32S64;
|
||||
GW->q[0] = imul64(emu, EW->q[0], tmp64u);
|
||||
} else {
|
||||
tmp16u = F16;
|
||||
GW->word[0] = imul16(emu, EW->word[0], tmp16u);
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x6B: /* IMUL Gw,Ew,Ib */
|
||||
nextop = F8;
|
||||
GETEW(1);
|
||||
GETGW;
|
||||
if(rex.w) {
|
||||
tmp64s = F8S;
|
||||
GW->q[0] = imul64(emu, EW->q[0], (uint64_t)tmp64s);
|
||||
} else {
|
||||
tmp16s = F8S;
|
||||
GW->word[0] = imul16(emu, EW->word[0], (uint16_t)tmp16s);
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x81: /* GRP3 Ew,Iw */
|
||||
case 0x83: /* GRP3 Ew,Ib */
|
||||
nextop = F8;
|
||||
@@ -71,6 +184,28 @@ int Run66(x64emu_t *emu, rex_t rex)
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x85: /* TEST Ew,Gw */
|
||||
nextop = F8;
|
||||
GETEW(0);
|
||||
GETGW;
|
||||
test16(emu, EW->word[0], GW->word[0]);
|
||||
break;
|
||||
|
||||
case 0x87: /* XCHG Ew,Gw */
|
||||
nextop = F8;
|
||||
GETEW(0);
|
||||
GETGW;
|
||||
if(rex.w) {
|
||||
tmp64u = GW->q[0];
|
||||
GW->q[0] = EW->q[0];
|
||||
EW->q[0] = tmp64u;
|
||||
} else {
|
||||
tmp16u = GW->word[0];
|
||||
GW->word[0] = EW->word[0];
|
||||
EW->word[0] = tmp16u;
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x89: /* MOV Ew,Gw */
|
||||
nextop = F8;
|
||||
GETEW(0);
|
||||
@@ -81,6 +216,241 @@ int Run66(x64emu_t *emu, rex_t rex)
|
||||
case 0x90: /* NOP */
|
||||
break;
|
||||
|
||||
case 0x98: /* CBW */
|
||||
emu->regs[_AX].sword[0] = emu->regs[_AX].sbyte[0];
|
||||
break;
|
||||
case 0x99: /* CWD */
|
||||
R_DX=((R_AX & 0x8000)?0xFFFF:0x0000);
|
||||
break;
|
||||
|
||||
case 0xA5: /* (REP) MOVSW */
|
||||
tmp8s = ACCESS_FLAG(F_DF)?-1:+1;
|
||||
tmp64u = (rep)?R_RCX:1L;
|
||||
if(rex.w) {
|
||||
tmp8s *= 8;
|
||||
while(tmp64u) {
|
||||
--tmp64u;
|
||||
*(uint64_t*)R_RDI = *(uint64_t*)R_RSI;
|
||||
R_RDI += tmp8s;
|
||||
R_RSI += tmp8s;
|
||||
}
|
||||
} else {
|
||||
tmp8s *= 2;
|
||||
while(tmp64u) {
|
||||
--tmp64u;
|
||||
*(uint16_t*)R_RDI = *(uint16_t*)R_RSI;
|
||||
R_RDI += tmp8s;
|
||||
R_RSI += tmp8s;
|
||||
}
|
||||
}
|
||||
if(rep)
|
||||
R_RCX = tmp64u;
|
||||
break;
|
||||
|
||||
case 0xA7: /* (REPZ/REPNE) CMPSW */
|
||||
if(rex.w)
|
||||
tmp8s = ACCESS_FLAG(F_DF)?-8:+8;
|
||||
else
|
||||
tmp8s = ACCESS_FLAG(F_DF)?-2:+2;
|
||||
switch(rep) {
|
||||
case 1:
|
||||
tmp64u = R_RCX;
|
||||
if(rex.w) {
|
||||
while(tmp64u) {
|
||||
--tmp64u;
|
||||
tmp64u3 = *(uint64_t*)R_RDI;
|
||||
tmp64u2 = *(uint64_t*)R_RSI;
|
||||
R_RDI += tmp8s;
|
||||
R_RSI += tmp8s;
|
||||
if(tmp64u3==tmp64u2)
|
||||
break;
|
||||
}
|
||||
if(R_RCX) cmp64(emu, tmp64u2, tmp64u3);
|
||||
} else {
|
||||
while(tmp64u) {
|
||||
--tmp64u;
|
||||
tmp16u = *(uint16_t*)R_RDI;
|
||||
tmp16u2 = *(uint16_t*)R_RSI;
|
||||
R_RDI += tmp8s;
|
||||
R_RSI += tmp8s;
|
||||
if(tmp16u==tmp16u2)
|
||||
break;
|
||||
}
|
||||
if(R_RCX) cmp16(emu, tmp16u2, tmp16u);
|
||||
}
|
||||
R_RCX = tmp64u;
|
||||
break;
|
||||
case 2:
|
||||
tmp64u = R_RCX;
|
||||
if(rex.w) {
|
||||
while(tmp64u) {
|
||||
--tmp64u;
|
||||
tmp64u3 = *(uint64_t*)R_RDI;
|
||||
tmp64u2 = *(uint64_t*)R_RSI;
|
||||
R_RDI += tmp8s;
|
||||
R_RSI += tmp8s;
|
||||
if(tmp64u3!=tmp64u2)
|
||||
break;
|
||||
}
|
||||
if(R_RCX) cmp64(emu, tmp64u2, tmp64u3);
|
||||
} else {
|
||||
while(tmp64u) {
|
||||
--tmp64u;
|
||||
tmp16u = *(uint16_t*)R_RDI;
|
||||
tmp16u2 = *(uint16_t*)R_RSI;
|
||||
R_RDI += tmp8s;
|
||||
R_RSI += tmp8s;
|
||||
if(tmp16u!=tmp16u2)
|
||||
break;
|
||||
}
|
||||
if(R_RCX) cmp16(emu, tmp16u2, tmp16u);
|
||||
}
|
||||
R_RCX = tmp64u;
|
||||
break;
|
||||
default:
|
||||
if(rex.w) {
|
||||
tmp8s = ACCESS_FLAG(F_DF)?-8:+8;
|
||||
tmp64u = *(uint64_t*)R_RDI;
|
||||
tmp64u2 = *(uint64_t*)R_RSI;
|
||||
R_RDI += tmp8s;
|
||||
R_RSI += tmp8s;
|
||||
cmp64(emu, tmp64u2, tmp64u);
|
||||
} else {
|
||||
tmp8s = ACCESS_FLAG(F_DF)?-2:+2;
|
||||
tmp16u = *(uint16_t*)R_RDI;
|
||||
tmp16u2 = *(uint16_t*)R_RSI;
|
||||
R_RDI += tmp8s;
|
||||
R_RSI += tmp8s;
|
||||
cmp16(emu, tmp16u2, tmp16u);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 0xA9: /* TEST AX,Iw */
|
||||
if(rex.w)
|
||||
test64(emu, R_RAX, F32S64);
|
||||
else
|
||||
test16(emu, R_AX, F16);
|
||||
break;
|
||||
|
||||
case 0xAB: /* (REP) STOSW */
|
||||
if(rex.w)
|
||||
tmp8s = ACCESS_FLAG(F_DF)?-8:+8;
|
||||
else
|
||||
tmp8s = ACCESS_FLAG(F_DF)?-2:+2;
|
||||
tmp64u = (rep)?R_RCX:1L;
|
||||
if((rex.w))
|
||||
while(tmp64u) {
|
||||
*(uint64_t*)R_RDI = R_RAX;
|
||||
R_RDI += tmp8s;
|
||||
--tmp64u;
|
||||
}
|
||||
else
|
||||
while(tmp64u) {
|
||||
*(uint16_t*)R_RDI = R_AX;
|
||||
R_RDI += tmp8s;
|
||||
--tmp64u;
|
||||
}
|
||||
if(rep)
|
||||
R_RCX = tmp64u;
|
||||
break;
|
||||
case 0xAD: /* (REP) LODSW */
|
||||
if(rex.w)
|
||||
tmp8s = ACCESS_FLAG(F_DF)?-8:+8;
|
||||
else
|
||||
tmp8s = ACCESS_FLAG(F_DF)?-2:+2;
|
||||
tmp64u = (rep)?R_RCX:1L;
|
||||
if((rex.w))
|
||||
while(tmp64u) {
|
||||
R_RAX = *(uint64_t*)R_RSI;
|
||||
R_RSI += tmp8s;
|
||||
--tmp64u;
|
||||
}
|
||||
else
|
||||
while(tmp64u) {
|
||||
R_AX = *(uint16_t*)R_RSI;
|
||||
R_RSI += tmp8s;
|
||||
--tmp64u;
|
||||
}
|
||||
if(rep)
|
||||
R_RCX = tmp64u;
|
||||
break;
|
||||
|
||||
case 0xAF: /* (REPZ/REPNE) SCASD */
|
||||
if(rex.w)
|
||||
tmp8s = ACCESS_FLAG(F_DF)?-8:+8;
|
||||
else
|
||||
tmp8s = ACCESS_FLAG(F_DF)?-2:+2;
|
||||
switch(rep) {
|
||||
case 1:
|
||||
tmp64u = R_RCX;
|
||||
if(rex.w) {
|
||||
while(tmp64u) {
|
||||
--tmp64u;
|
||||
tmp64u = *(uint64_t*)R_RDI;
|
||||
R_RDI += tmp8s;
|
||||
if(R_RAX==tmp64u)
|
||||
break;
|
||||
}
|
||||
if(R_RCX) cmp64(emu, R_RAX, tmp64u);
|
||||
} else {
|
||||
while(tmp64u) {
|
||||
--tmp64u;
|
||||
tmp16u = *(uint16_t*)R_RDI;
|
||||
R_RDI += tmp8s;
|
||||
if(R_AX==tmp16u)
|
||||
break;
|
||||
}
|
||||
if(R_RCX) cmp16(emu, R_AX, tmp16u);
|
||||
}
|
||||
R_RCX = tmp64u;
|
||||
break;
|
||||
case 2:
|
||||
tmp64u = R_RCX;
|
||||
if(rex.w) {
|
||||
while(tmp64u) {
|
||||
--tmp64u;
|
||||
tmp64u = *(uint64_t*)R_RDI;
|
||||
R_RDI += tmp8s;
|
||||
if(R_RAX!=tmp64u)
|
||||
break;
|
||||
}
|
||||
if(R_RCX) cmp64(emu, R_RAX, tmp64u);
|
||||
} else {
|
||||
while(tmp64u) {
|
||||
--tmp64u;
|
||||
tmp16u = *(uint16_t*)R_RDI;
|
||||
R_RDI += tmp8s;
|
||||
if(R_AX!=tmp16u)
|
||||
break;
|
||||
}
|
||||
if(R_RCX) cmp16(emu, R_AX, tmp16u);
|
||||
}
|
||||
R_RCX = tmp64u;
|
||||
break;
|
||||
default:
|
||||
if(rex.w)
|
||||
cmp64(emu, R_RAX, *(uint64_t*)R_RDI);
|
||||
else
|
||||
cmp16(emu, R_AX, *(uint16_t*)R_RDI);
|
||||
R_RDI += tmp8s;
|
||||
}
|
||||
break;
|
||||
|
||||
case 0xB8: /* MOV AX,Iw */
|
||||
case 0xB9: /* MOV CX,Iw */
|
||||
case 0xBA: /* MOV DX,Iw */
|
||||
case 0xBB: /* MOV BX,Iw */
|
||||
case 0xBC: /* ... */
|
||||
case 0xBD:
|
||||
case 0xBE:
|
||||
case 0xBF:
|
||||
if(rex.w)
|
||||
emu->regs[(opcode&7)+(rex.b<<3)].q[0] = F64;
|
||||
else
|
||||
emu->regs[(opcode&7)+(rex.b<<3)].word[0] = F16;
|
||||
break;
|
||||
|
||||
case 0xC1: /* GRP2 Ew,Ib */
|
||||
nextop = F8;
|
||||
GETEW(1);
|
||||
@@ -102,9 +472,152 @@ int Run66(x64emu_t *emu, rex_t rex)
|
||||
GETEW(2);
|
||||
EW->word[0] = F16;
|
||||
break;
|
||||
case 0xC8: /* ENTER Iw,Ib */
|
||||
tmp16u = F16;
|
||||
tmp8u = (F8) & 0x1f;
|
||||
tmp64u = R_RBP;
|
||||
Push16(emu, R_BP);
|
||||
R_RBP = R_RSP;
|
||||
if (tmp8u) {
|
||||
for (tmp8u2 = 1; tmp8u2 < tmp8u; tmp8u2++) {
|
||||
tmp64u -= 2;
|
||||
Push16(emu, *((uint16_t*)tmp64u));
|
||||
}
|
||||
Push16(emu, R_BP);
|
||||
}
|
||||
R_RSP -= tmp16u;
|
||||
break;
|
||||
case 0xC9: /* LEAVE */
|
||||
R_RSP = R_RBP;
|
||||
R_BP = Pop16(emu);
|
||||
break;
|
||||
|
||||
default:
|
||||
return 1;
|
||||
case 0xD1: /* GRP2 Ew,1 */
|
||||
case 0xD3: /* GRP2 Ew,CL */
|
||||
nextop = F8;
|
||||
GETEW(0);
|
||||
tmp8u=(opcode==0xD3)?R_CL:1;
|
||||
if(rex.w) {
|
||||
switch((nextop>>3)&7) {
|
||||
case 0: EW->q[0] = rol64(emu, EW->q[0], tmp8u); break;
|
||||
case 1: EW->q[0] = ror64(emu, EW->q[0], tmp8u); break;
|
||||
case 2: EW->q[0] = rcl64(emu, EW->q[0], tmp8u); break;
|
||||
case 3: EW->q[0] = rcr64(emu, EW->q[0], tmp8u); break;
|
||||
case 4:
|
||||
case 6: EW->q[0] = shl64(emu, EW->q[0], tmp8u); break;
|
||||
case 5: EW->q[0] = shr64(emu, EW->q[0], tmp8u); break;
|
||||
case 7: EW->q[0] = sar64(emu, EW->q[0], tmp8u); break;
|
||||
}
|
||||
} else {
|
||||
switch((nextop>>3)&7) {
|
||||
case 0: EW->word[0] = rol16(emu, EW->word[0], tmp8u); break;
|
||||
case 1: EW->word[0] = ror16(emu, EW->word[0], tmp8u); break;
|
||||
case 2: EW->word[0] = rcl16(emu, EW->word[0], tmp8u); break;
|
||||
case 3: EW->word[0] = rcr16(emu, EW->word[0], tmp8u); break;
|
||||
case 4:
|
||||
case 6: EW->word[0] = shl16(emu, EW->word[0], tmp8u); break;
|
||||
case 5: EW->word[0] = shr16(emu, EW->word[0], tmp8u); break;
|
||||
case 7: EW->word[0] = sar16(emu, EW->word[0], tmp8u); break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 0xD9: /* x87 opcdes */
|
||||
return Run66D9(emu, rex);
|
||||
|
||||
case 0xDD: /* x87 opcdes */
|
||||
return Run66DD(emu, rex);
|
||||
|
||||
case 0xF7: /* GRP3 Ew(,Iw) */
|
||||
nextop = F8;
|
||||
tmp8u = (nextop>>3)&7;
|
||||
if(rex.w) {
|
||||
GETED((tmp8u<2)?4:0);
|
||||
switch(tmp8u) {
|
||||
case 0:
|
||||
case 1: /* TEST Ed,Id */
|
||||
tmp64u = F32S64;
|
||||
test64(emu, ED->q[0], tmp64u);
|
||||
break;
|
||||
case 2: /* NOT Ed */
|
||||
ED->q[0] = not64(emu, ED->q[0]);
|
||||
break;
|
||||
case 3: /* NEG Ed */
|
||||
ED->q[0] = neg64(emu, ED->q[0]);
|
||||
break;
|
||||
case 4: /* MUL RAX,Ed */
|
||||
mul64_rax(emu, ED->q[0]);
|
||||
break;
|
||||
case 5: /* IMUL RAX,Ed */
|
||||
imul64_rax(emu, ED->q[0]);
|
||||
break;
|
||||
case 6: /* DIV Ed */
|
||||
div64(emu, ED->q[0]);
|
||||
break;
|
||||
case 7: /* IDIV Ed */
|
||||
idiv64(emu, ED->q[0]);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
switch(tmp8u) {
|
||||
case 0:
|
||||
case 1: /* TEST Ew,Iw */
|
||||
GETEW(2);
|
||||
test16(emu, EW->word[0], F16);
|
||||
break;
|
||||
case 2: /* NOT Ew */
|
||||
GETEW(0);
|
||||
EW->word[0] = not16(emu, EW->word[0]);
|
||||
break;
|
||||
case 3: /* NEG Ew */
|
||||
GETEW(0);
|
||||
EW->word[0] = neg16(emu, EW->word[0]);
|
||||
break;
|
||||
case 4: /* MUL AX,Ew */
|
||||
GETEW(0);
|
||||
mul16(emu, EW->word[0]);
|
||||
break;
|
||||
case 5: /* IMUL AX,Ew */
|
||||
GETEW(0);
|
||||
imul16_eax(emu, EW->word[0]);
|
||||
break;
|
||||
case 6: /* DIV Ew */
|
||||
GETEW(0);
|
||||
div16(emu, EW->word[0]);
|
||||
break;
|
||||
case 7: /* IDIV Ew */
|
||||
GETEW(0);
|
||||
idiv16(emu, EW->word[0]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 0xFF: /* GRP 5 Ew */
|
||||
nextop = F8;
|
||||
GETEW(0);
|
||||
GETGW;
|
||||
switch((nextop>>3)&7) {
|
||||
case 0: /* INC Ed */
|
||||
EW->word[0] = inc16(emu, EW->word[0]);
|
||||
break;
|
||||
case 1: /* DEC Ed */
|
||||
EW->word[0] = dec16(emu, EW->word[0]);
|
||||
break;
|
||||
/*case 6:
|
||||
Push16(emu, EW->word[0]);
|
||||
break;*/
|
||||
default:
|
||||
R_RIP = emu->old_ip;
|
||||
printf_log(LOG_NONE, "Illegal Opcode %p: 66 %02X %02X %02X %02X %02X %02X\n",(void*)R_RIP, opcode, nextop, PK(2), PK(3), PK(4), PK(5));
|
||||
emu->quit=1;
|
||||
emu->error |= ERR_ILLEGAL;
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
+1126
-2
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,60 @@
|
||||
#define _GNU_SOURCE
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "debug.h"
|
||||
#include "box64stack.h"
|
||||
#include "x64emu.h"
|
||||
#include "x64run.h"
|
||||
#include "x64emu_private.h"
|
||||
#include "x64run_private.h"
|
||||
#include "x64primop.h"
|
||||
#include "x64trace.h"
|
||||
#include "x87emu_private.h"
|
||||
#include "box64context.h"
|
||||
#include "bridge.h"
|
||||
//#include "signals.h"
|
||||
#ifdef DYNAREC
|
||||
#include "../dynarec/arm_lock_helper.h"
|
||||
#endif
|
||||
|
||||
#include "modrm.h"
|
||||
|
||||
int Run6664(x64emu_t *emu, rex_t rex)
|
||||
{
|
||||
uint8_t opcode;
|
||||
uint8_t nextop;
|
||||
reg64_t *oped, *opgd;
|
||||
uintptr_t tlsdata = GetFSBaseEmu(emu);
|
||||
|
||||
opcode = F8;
|
||||
// REX prefix before the F0 are ignored
|
||||
rex.rex = 0;
|
||||
while(opcode>=0x40 && opcode<=0x4f) {
|
||||
rex.rex = opcode;
|
||||
opcode = F8;
|
||||
}
|
||||
|
||||
switch(opcode) {
|
||||
|
||||
case 0x8B: /* MOV Gd,Ed */
|
||||
nextop = F8;
|
||||
GETEW_OFFS(0, tlsdata);
|
||||
GETGW;
|
||||
if(rex.w)
|
||||
GW->q[0] = EW->q[0];
|
||||
else
|
||||
GW->word[0] = EW->word[0];
|
||||
break;
|
||||
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
#define _GNU_SOURCE
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "debug.h"
|
||||
#include "box64stack.h"
|
||||
#include "x64emu.h"
|
||||
#include "x64run.h"
|
||||
#include "x64emu_private.h"
|
||||
#include "x64run_private.h"
|
||||
#include "x64primop.h"
|
||||
#include "x64trace.h"
|
||||
#include "x87emu_private.h"
|
||||
#include "box64context.h"
|
||||
//#include "my_cpuid.h"
|
||||
#include "bridge.h"
|
||||
//#include "signals.h"
|
||||
#ifdef DYNAREC
|
||||
#include "../dynarec/arm_lock_helper.h"
|
||||
#endif
|
||||
|
||||
#include "modrm.h"
|
||||
|
||||
int Run66D9(x64emu_t *emu, rex_t rex)
|
||||
{
|
||||
uint8_t nextop;
|
||||
reg64_t *oped;
|
||||
|
||||
nextop = F8;
|
||||
switch (nextop) {
|
||||
case 0xC0:
|
||||
case 0xC1:
|
||||
case 0xC2:
|
||||
case 0xC3:
|
||||
case 0xC4:
|
||||
case 0xC5:
|
||||
case 0xC6:
|
||||
case 0xC7:
|
||||
case 0xC8:
|
||||
case 0xC9:
|
||||
case 0xCA:
|
||||
case 0xCB:
|
||||
case 0xCC:
|
||||
case 0xCD:
|
||||
case 0xCE:
|
||||
case 0xCF:
|
||||
case 0xD0:
|
||||
case 0xE0:
|
||||
case 0xE5:
|
||||
case 0xE8:
|
||||
case 0xE9:
|
||||
case 0xEA:
|
||||
case 0xEB:
|
||||
case 0xEC:
|
||||
case 0xED:
|
||||
case 0xEE:
|
||||
case 0xFC:
|
||||
case 0xE1:
|
||||
case 0xE4:
|
||||
case 0xF0:
|
||||
case 0xF1:
|
||||
case 0xF2:
|
||||
case 0xF3:
|
||||
case 0xF4:
|
||||
case 0xF5:
|
||||
case 0xF6:
|
||||
case 0xF7:
|
||||
case 0xF8:
|
||||
case 0xF9:
|
||||
case 0xFA:
|
||||
case 0xFB:
|
||||
case 0xFD:
|
||||
case 0xFE:
|
||||
case 0xFF:
|
||||
return 1;
|
||||
default:
|
||||
switch((nextop>>3)&7) {
|
||||
case 4: /* FLDENV m */
|
||||
// warning, incomplete
|
||||
GETEW(0);
|
||||
fpu_loadenv(emu, (char*)ED, 1);
|
||||
break;
|
||||
case 6: /* FNSTENV m */
|
||||
// warning, incomplete
|
||||
GETEW(0);
|
||||
fpu_savenv(emu, (char*)ED, 1);
|
||||
break;
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
#define _GNU_SOURCE
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "debug.h"
|
||||
#include "box64stack.h"
|
||||
#include "x64emu.h"
|
||||
#include "x64run.h"
|
||||
#include "x64emu_private.h"
|
||||
#include "x64run_private.h"
|
||||
#include "x64primop.h"
|
||||
#include "x64trace.h"
|
||||
#include "x87emu_private.h"
|
||||
#include "box64context.h"
|
||||
//#include "my_cpuid.h"
|
||||
#include "bridge.h"
|
||||
//#include "signals.h"
|
||||
#ifdef DYNAREC
|
||||
#include "../dynarec/arm_lock_helper.h"
|
||||
#endif
|
||||
|
||||
#include "modrm.h"
|
||||
|
||||
int Run66DD(x64emu_t *emu, rex_t rex)
|
||||
{
|
||||
uint8_t nextop;
|
||||
reg64_t *oped;
|
||||
|
||||
nextop = F8;
|
||||
switch (nextop) {
|
||||
case 0xC0:
|
||||
case 0xC1:
|
||||
case 0xC2:
|
||||
case 0xC3:
|
||||
case 0xC4:
|
||||
case 0xC5:
|
||||
case 0xC6:
|
||||
case 0xC7:
|
||||
case 0xC8:
|
||||
case 0xC9:
|
||||
case 0xCA:
|
||||
case 0xCB:
|
||||
case 0xCC:
|
||||
case 0xCD:
|
||||
case 0xCE:
|
||||
case 0xCF:
|
||||
case 0xD0:
|
||||
case 0xE0:
|
||||
case 0xE5:
|
||||
case 0xE8:
|
||||
case 0xE9:
|
||||
case 0xEA:
|
||||
case 0xEB:
|
||||
case 0xEC:
|
||||
case 0xED:
|
||||
case 0xEE:
|
||||
case 0xFC:
|
||||
case 0xE1:
|
||||
case 0xE4:
|
||||
case 0xF0:
|
||||
case 0xF1:
|
||||
case 0xF2:
|
||||
case 0xF3:
|
||||
case 0xF4:
|
||||
case 0xF5:
|
||||
case 0xF6:
|
||||
case 0xF7:
|
||||
case 0xF8:
|
||||
case 0xF9:
|
||||
case 0xFA:
|
||||
case 0xFB:
|
||||
case 0xFD:
|
||||
case 0xFE:
|
||||
case 0xFF:
|
||||
return 1;
|
||||
default:
|
||||
switch((nextop>>3)&7) {
|
||||
case 4: /* FRSTOR m94byte */
|
||||
GETEW(0);
|
||||
fpu_loadenv(emu, (char*)ED, 1);
|
||||
// get the STx
|
||||
{
|
||||
char* p =(char*)ED;
|
||||
p += 14;
|
||||
for (int i=0; i<8; ++i) {
|
||||
LD2D(p, &ST(i).d);
|
||||
p+=10;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 6: /* FNSAVE m94byte */
|
||||
GETEW(0);
|
||||
// ENV first...
|
||||
fpu_savenv(emu, (char*)ED, 1);
|
||||
// save the STx
|
||||
{
|
||||
char* p =(char*)ED;
|
||||
p += 14;
|
||||
for (int i=0; i<8; ++i) {
|
||||
D2LD(&ST(i).d, p);
|
||||
p+=10;
|
||||
}
|
||||
}
|
||||
reset_fpu(emu);
|
||||
break;
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
#define _GNU_SOURCE
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "debug.h"
|
||||
#include "box64stack.h"
|
||||
#include "x64emu.h"
|
||||
#include "x64run.h"
|
||||
#include "x64emu_private.h"
|
||||
#include "x64run_private.h"
|
||||
#include "x64primop.h"
|
||||
#include "x64trace.h"
|
||||
#include "x87emu_private.h"
|
||||
#include "box64context.h"
|
||||
#include "bridge.h"
|
||||
//#include "signals.h"
|
||||
#ifdef DYNAREC
|
||||
#include "../dynarec/arm_lock_helper.h"
|
||||
#endif
|
||||
|
||||
#include "modrm.h"
|
||||
|
||||
int Run67(x64emu_t *emu, rex_t rex)
|
||||
{
|
||||
uint8_t opcode;
|
||||
uint8_t nextop;
|
||||
int8_t tmp8s;
|
||||
reg64_t *oped, *opgd;
|
||||
|
||||
opcode = F8;
|
||||
|
||||
// REX prefix before the F0 are ignored
|
||||
rex.rex = 0;
|
||||
while(opcode>=0x40 && opcode<=0x4f) {
|
||||
rex.rex = opcode;
|
||||
opcode = F8;
|
||||
}
|
||||
|
||||
switch(opcode) {
|
||||
|
||||
case 0x8D: /* LEA Gd,M */
|
||||
nextop = F8;
|
||||
GETED32(0);
|
||||
GETGD;
|
||||
if(rex.w)
|
||||
GD->q[0] = (uint64_t)ED;
|
||||
else
|
||||
GD->q[0] = (uint32_t)(uintptr_t)ED;
|
||||
break;
|
||||
|
||||
case 0xE0: /* LOOPNZ */
|
||||
CHECK_FLAGS(emu);
|
||||
tmp8s = F8S;
|
||||
--R_ECX; // don't update flags
|
||||
if(R_ECX && !ACCESS_FLAG(F_ZF))
|
||||
R_RIP += tmp8s;
|
||||
break;
|
||||
case 0xE1: /* LOOPZ */
|
||||
CHECK_FLAGS(emu);
|
||||
tmp8s = F8S;
|
||||
--R_ECX; // don't update flags
|
||||
if(R_ECX && ACCESS_FLAG(F_ZF))
|
||||
R_RIP += tmp8s;
|
||||
break;
|
||||
case 0xE2: /* LOOP */
|
||||
tmp8s = F8S;
|
||||
--R_ECX; // don't update flags
|
||||
if(R_ECX)
|
||||
R_RIP += tmp8s;
|
||||
break;
|
||||
case 0xE3: /* JECXZ Ib */
|
||||
tmp8s = F8S;
|
||||
if(!R_ECX)
|
||||
R_RIP += tmp8s;
|
||||
break;
|
||||
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
+69
-29
@@ -23,6 +23,7 @@
|
||||
#include "x64trace.h"
|
||||
#endif
|
||||
#include "x64tls.h"
|
||||
#include "bridge.h"
|
||||
|
||||
#define PARITY(x) (((emu->x64emu_parity_tab[(x) / 32] >> ((x) % 32)) & 1) == 0)
|
||||
#define XOR2(x) (((x) ^ ((x)>>1)) & 0x1)
|
||||
@@ -57,6 +58,13 @@ int32_t EXPORT my___libc_start_main(x64emu_t* emu, int *(main) (int, char * *, c
|
||||
const char* GetNativeName(void* p)
|
||||
{
|
||||
static char buff[500] = {0};
|
||||
#ifdef HAVE_TRACE
|
||||
{
|
||||
const char* n = getBridgeName(p);
|
||||
if(n)
|
||||
return n;
|
||||
}
|
||||
#endif
|
||||
Dl_info info;
|
||||
if(dladdr(p, &info)==0) {
|
||||
const char *ret = GetNameOffset(my_context->maplib, p);
|
||||
@@ -107,7 +115,7 @@ void UpdateFlags(x64emu_t *emu)
|
||||
CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
|
||||
break;
|
||||
case d_add32:
|
||||
CONDITIONAL_SET_FLAG(emu->res & 0x100000000, F_CF);
|
||||
CONDITIONAL_SET_FLAG(emu->res & 0x100000000LL, F_CF);
|
||||
CONDITIONAL_SET_FLAG((emu->res & 0xffffffff) == 0, F_ZF);
|
||||
CONDITIONAL_SET_FLAG(emu->res & 0x80000000, F_SF);
|
||||
CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF);
|
||||
@@ -120,7 +128,7 @@ void UpdateFlags(x64emu_t *emu)
|
||||
hi = (lo >> 32) + (emu->op2 >> 32) + (emu->op1 >> 32);
|
||||
CONDITIONAL_SET_FLAG(hi & 0x100000000, F_CF);
|
||||
CONDITIONAL_SET_FLAG(!emu->res, F_ZF);
|
||||
CONDITIONAL_SET_FLAG(emu->res & 0x8000000000000000L, F_SF);
|
||||
CONDITIONAL_SET_FLAG(emu->res & 0x8000000000000000LL, F_SF);
|
||||
CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF);
|
||||
cc = (emu->op1 & emu->op2) | ((~emu->res) & (emu->op1 | emu->op2));
|
||||
CONDITIONAL_SET_FLAG(XOR2(cc >> 62), F_OF);
|
||||
@@ -154,7 +162,7 @@ void UpdateFlags(x64emu_t *emu)
|
||||
CLEAR_FLAG(F_OF);
|
||||
CLEAR_FLAG(F_CF);
|
||||
CLEAR_FLAG(F_AF);
|
||||
CONDITIONAL_SET_FLAG(emu->res & 0x8000000000000000L, F_SF);
|
||||
CONDITIONAL_SET_FLAG(emu->res & 0x8000000000000000LL, F_SF);
|
||||
CONDITIONAL_SET_FLAG(emu->res == 0, F_ZF);
|
||||
CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF);
|
||||
break;
|
||||
@@ -183,7 +191,7 @@ void UpdateFlags(x64emu_t *emu)
|
||||
CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
|
||||
break;
|
||||
case d_dec64:
|
||||
CONDITIONAL_SET_FLAG(emu->res & 0x8000000000000000L, F_SF);
|
||||
CONDITIONAL_SET_FLAG(emu->res & 0x8000000000000000LL, F_SF);
|
||||
CONDITIONAL_SET_FLAG(!emu->res, F_ZF);
|
||||
CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF);
|
||||
bc = (emu->res & (~emu->op1 | 1)) | (~emu->op1 & 1);
|
||||
@@ -216,7 +224,7 @@ void UpdateFlags(x64emu_t *emu)
|
||||
break;
|
||||
case d_inc64:
|
||||
CONDITIONAL_SET_FLAG(!emu->res, F_ZF);
|
||||
CONDITIONAL_SET_FLAG(emu->res & 0x8000000000000000L, F_SF);
|
||||
CONDITIONAL_SET_FLAG(emu->res & 0x8000000000000000LL, F_SF);
|
||||
CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF);
|
||||
cc = (1 & emu->op1) | ((~emu->res) & (1 | emu->op1));
|
||||
CONDITIONAL_SET_FLAG(XOR2(cc >> 62), F_OF);
|
||||
@@ -260,8 +268,8 @@ void UpdateFlags(x64emu_t *emu)
|
||||
CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF);
|
||||
break;
|
||||
case d_imul64:
|
||||
if (((emu->res & 0x8000000000000000L) == 0 && emu->op1 == 0x00) ||
|
||||
((emu->res & 0x8000000000000000L) != 0 && emu->op1 == 0xFFFFFFFFFFFFFFFFL)) {
|
||||
if (((emu->res & 0x8000000000000000LL) == 0 && emu->op1 == 0x00) ||
|
||||
((emu->res & 0x8000000000000000LL) != 0 && emu->op1 == 0xFFFFFFFFFFFFFFFFLL)) {
|
||||
CLEAR_FLAG(F_CF);
|
||||
CLEAR_FLAG(F_OF);
|
||||
} else {
|
||||
@@ -295,9 +303,7 @@ void UpdateFlags(x64emu_t *emu)
|
||||
CONDITIONAL_SET_FLAG(PARITY(lo & 0xff), F_PF);
|
||||
break;
|
||||
case d_mul32:
|
||||
lo = (uint32_t)emu->res;
|
||||
hi = (uint32_t)(emu->res >> 32);
|
||||
if (hi == 0) {
|
||||
if (emu->op1 == 0) {
|
||||
CLEAR_FLAG(F_CF);
|
||||
CLEAR_FLAG(F_OF);
|
||||
} else {
|
||||
@@ -344,7 +350,7 @@ void UpdateFlags(x64emu_t *emu)
|
||||
CLEAR_FLAG(F_OF);
|
||||
CLEAR_FLAG(F_CF);
|
||||
CLEAR_FLAG(F_AF);
|
||||
CONDITIONAL_SET_FLAG(emu->res & 0x8000000000000000L, F_SF);
|
||||
CONDITIONAL_SET_FLAG(emu->res & 0x8000000000000000LL, F_SF);
|
||||
CONDITIONAL_SET_FLAG(emu->res == 0, F_ZF);
|
||||
CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF);
|
||||
break;
|
||||
@@ -378,7 +384,7 @@ void UpdateFlags(x64emu_t *emu)
|
||||
case d_neg64:
|
||||
CONDITIONAL_SET_FLAG(emu->op1 != 0, F_CF);
|
||||
CONDITIONAL_SET_FLAG(!emu->res, F_ZF);
|
||||
CONDITIONAL_SET_FLAG(emu->res & 0x8000000000000000L, F_SF);
|
||||
CONDITIONAL_SET_FLAG(emu->res & 0x8000000000000000LL, F_SF);
|
||||
CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF);
|
||||
bc = emu->res | emu->op1;
|
||||
CONDITIONAL_SET_FLAG(XOR2(bc >> 62), F_OF);
|
||||
@@ -456,14 +462,14 @@ void UpdateFlags(x64emu_t *emu)
|
||||
break;
|
||||
case d_shl64:
|
||||
if (emu->op2 > 0) {
|
||||
cc = emu->op1 & (1 << (64 - emu->op2));
|
||||
cc = emu->op1 & (1LL << (64 - emu->op2));
|
||||
CONDITIONAL_SET_FLAG(cc, F_CF);
|
||||
CONDITIONAL_SET_FLAG(!emu->res, F_ZF);
|
||||
CONDITIONAL_SET_FLAG(emu->res & 0x8000000000000000L, F_SF);
|
||||
CONDITIONAL_SET_FLAG(emu->res & 0x8000000000000000LL, F_SF);
|
||||
CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF);
|
||||
}
|
||||
if (emu->op2 == 1) {
|
||||
CONDITIONAL_SET_FLAG(((!!(emu->res & 0x8000000000000000L)) ^
|
||||
CONDITIONAL_SET_FLAG(((!!(emu->res & 0x8000000000000000LL)) ^
|
||||
(ACCESS_FLAG(F_CF) != 0)), F_OF);
|
||||
} else {
|
||||
CLEAR_FLAG(F_OF);
|
||||
@@ -540,10 +546,10 @@ void UpdateFlags(x64emu_t *emu)
|
||||
break;
|
||||
case d_sar64:
|
||||
if(emu->op2) {
|
||||
cc = emu->op1 & (1 << (emu->op2 - 1));
|
||||
cc = emu->op1 & (1LL << (emu->op2 - 1));
|
||||
CONDITIONAL_SET_FLAG(cc, F_CF);
|
||||
CONDITIONAL_SET_FLAG(emu->res == 0, F_ZF);
|
||||
CONDITIONAL_SET_FLAG(emu->res & 0x8000000000000000L, F_SF);
|
||||
CONDITIONAL_SET_FLAG(emu->res & 0x8000000000000000LL, F_SF);
|
||||
CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF);
|
||||
}
|
||||
break;
|
||||
@@ -610,10 +616,10 @@ void UpdateFlags(x64emu_t *emu)
|
||||
case d_shr64:
|
||||
cnt = emu->op2;
|
||||
if (cnt > 0) {
|
||||
cc = emu->op1 & (1 << (cnt - 1));
|
||||
cc = emu->op1 & (1LL << (cnt - 1));
|
||||
CONDITIONAL_SET_FLAG(cc, F_CF);
|
||||
CONDITIONAL_SET_FLAG(!emu->res, F_ZF);
|
||||
CONDITIONAL_SET_FLAG(emu->res & 0x8000000000000000L, F_SF);
|
||||
CONDITIONAL_SET_FLAG(emu->res & 0x8000000000000000LL, F_SF);
|
||||
CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF);
|
||||
}
|
||||
if (cnt == 1) {
|
||||
@@ -648,11 +654,11 @@ void UpdateFlags(x64emu_t *emu)
|
||||
CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
|
||||
break;
|
||||
case d_sub64:
|
||||
CONDITIONAL_SET_FLAG(emu->res & 0x8000000000000000L, F_SF);
|
||||
CONDITIONAL_SET_FLAG(emu->res & 0x8000000000000000LL, F_SF);
|
||||
CONDITIONAL_SET_FLAG(!emu->res, F_ZF);
|
||||
CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF);
|
||||
bc = (emu->res & (~emu->op1 | emu->op2)) | (~emu->op1 & emu->op2);
|
||||
CONDITIONAL_SET_FLAG(bc & 0x8000000000000000L, F_CF);
|
||||
CONDITIONAL_SET_FLAG(bc & 0x8000000000000000LL, F_CF);
|
||||
CONDITIONAL_SET_FLAG(XOR2(bc >> 62), F_OF);
|
||||
CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
|
||||
break;
|
||||
@@ -682,7 +688,7 @@ void UpdateFlags(x64emu_t *emu)
|
||||
break;
|
||||
case d_xor64:
|
||||
CLEAR_FLAG(F_OF);
|
||||
CONDITIONAL_SET_FLAG(emu->res & 0x8000000000000000L, F_SF);
|
||||
CONDITIONAL_SET_FLAG(emu->res & 0x8000000000000000LL, F_SF);
|
||||
CONDITIONAL_SET_FLAG(emu->res == 0, F_ZF);
|
||||
CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF);
|
||||
CLEAR_FLAG(F_CF);
|
||||
@@ -717,11 +723,11 @@ void UpdateFlags(x64emu_t *emu)
|
||||
CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
|
||||
break;
|
||||
case d_cmp64:
|
||||
CONDITIONAL_SET_FLAG(emu->res & 0x8000000000000000L, F_SF);
|
||||
CONDITIONAL_SET_FLAG(emu->res & 0x8000000000000000LL, F_SF);
|
||||
CONDITIONAL_SET_FLAG(!emu->res, F_ZF);
|
||||
CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF);
|
||||
bc = (emu->res & (~emu->op1 | emu->op2)) | (~emu->op1 & emu->op2);
|
||||
CONDITIONAL_SET_FLAG(bc & 0x8000000000000000L, F_CF);
|
||||
CONDITIONAL_SET_FLAG(bc & 0x8000000000000000LL, F_CF);
|
||||
CONDITIONAL_SET_FLAG(XOR2(bc >> 62), F_OF);
|
||||
CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
|
||||
break;
|
||||
@@ -748,7 +754,7 @@ void UpdateFlags(x64emu_t *emu)
|
||||
break;
|
||||
case d_tst64:
|
||||
CLEAR_FLAG(F_OF);
|
||||
CONDITIONAL_SET_FLAG(emu->res & 0x8000000000000000L, F_SF);
|
||||
CONDITIONAL_SET_FLAG(emu->res & 0x8000000000000000LL, F_SF);
|
||||
CONDITIONAL_SET_FLAG(emu->res == 0, F_ZF);
|
||||
CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF);
|
||||
CLEAR_FLAG(F_CF);
|
||||
@@ -789,7 +795,7 @@ void UpdateFlags(x64emu_t *emu)
|
||||
hi = (lo >> 32) + (emu->op1 >> 32) + (emu->op2 >> 32);
|
||||
CONDITIONAL_SET_FLAG(hi & 0x1000000000000L, F_CF);
|
||||
CONDITIONAL_SET_FLAG(!emu->res, F_ZF);
|
||||
CONDITIONAL_SET_FLAG(emu->res & 0x8000000000000000L, F_SF);
|
||||
CONDITIONAL_SET_FLAG(emu->res & 0x8000000000000000LL, F_SF);
|
||||
CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF);
|
||||
cc = (emu->op2 & emu->op1) | ((~emu->res) & (emu->op2 | emu->op1));
|
||||
CONDITIONAL_SET_FLAG(XOR2(cc >> 62), F_OF);
|
||||
@@ -823,11 +829,11 @@ void UpdateFlags(x64emu_t *emu)
|
||||
CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
|
||||
break;
|
||||
case d_sbb64:
|
||||
CONDITIONAL_SET_FLAG(emu->res & 0x8000000000000000L, F_SF);
|
||||
CONDITIONAL_SET_FLAG(emu->res & 0x8000000000000000LL, F_SF);
|
||||
CONDITIONAL_SET_FLAG(!emu->res, F_ZF);
|
||||
CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF);
|
||||
bc = (emu->res & (~emu->op1 | emu->op2)) | (~emu->op1 & emu->op2);
|
||||
CONDITIONAL_SET_FLAG(bc & 0x8000000000000000L, F_CF);
|
||||
CONDITIONAL_SET_FLAG(bc & 0x8000000000000000LL, F_CF);
|
||||
CONDITIONAL_SET_FLAG(XOR2(bc >> 62), F_OF);
|
||||
CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
|
||||
break;
|
||||
@@ -1047,6 +1053,32 @@ reg64_t* GetECommonO(x64emu_t* emu, rex_t rex, uint8_t m, uint8_t delta, uintptr
|
||||
}
|
||||
}
|
||||
|
||||
reg64_t* GetECommon32O(x64emu_t* emu, rex_t rex, uint8_t m, uint8_t delta, uintptr_t base)
|
||||
{
|
||||
if (m<=7) {
|
||||
if(m==0x4) {
|
||||
uint8_t sib = Fetch8(emu);
|
||||
base += ((sib&0x7)==5)?((uint64_t)(int64_t)Fetch32s(emu)):(emu->regs[(sib&0x7)+(rex.b<<3)].dword[0]); // base
|
||||
base += (emu->sbiidx[((sib>>3)&7)+(rex.x<<3)]->sdword[0] << (sib>>6));
|
||||
return (reg64_t*)base;
|
||||
} else if (m==0x5) { //disp32
|
||||
base += Fetch32s(emu);
|
||||
return (reg64_t*)(base+R_RIP+delta);
|
||||
}
|
||||
return (reg64_t*)(uintptr_t)(emu->regs[m+(rex.b<<3)].dword[0]);
|
||||
} else {
|
||||
if((m&7)==4) {
|
||||
uint8_t sib = Fetch8(emu);
|
||||
base += emu->regs[(sib&0x7)+(rex.b<<3)].dword[0]; // base
|
||||
base += (emu->sbiidx[((sib>>3)&7)+(rex.x<<3)]->sdword[0] << (sib>>6));
|
||||
} else {
|
||||
base += emu->regs[(m&0x7)+(rex.b<<3)].dword[0];
|
||||
}
|
||||
base+=(m&0x80)?Fetch32s(emu):Fetch8s(emu);
|
||||
return (reg64_t*)base;
|
||||
}
|
||||
}
|
||||
|
||||
reg64_t* GetEb(x64emu_t *emu, rex_t rex, uint8_t v, uint8_t delta)
|
||||
{
|
||||
// rex ignored here
|
||||
@@ -1091,6 +1123,14 @@ reg64_t* GetEdO(x64emu_t *emu, rex_t rex, uint8_t v, uint8_t delta, uintptr_t of
|
||||
} else return GetECommonO(emu, rex, m, delta, offset);
|
||||
}
|
||||
|
||||
reg64_t* GetEd32O(x64emu_t *emu, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset)
|
||||
{
|
||||
uint8_t m = v&0xC7; // filter Ed
|
||||
if(m>=0xC0) {
|
||||
return &emu->regs[(m&0x07)+(rex.b<<3)];
|
||||
} else return GetECommon32O(emu, rex, m, delta, offset);
|
||||
}
|
||||
|
||||
#define GetEw GetEd
|
||||
|
||||
reg64_t* GetEw16(x64emu_t *emu, rex_t rex, uint8_t v)
|
||||
@@ -1159,7 +1199,7 @@ sse_regs_t* GetEx(x64emu_t *emu, rex_t rex, uint8_t v, uint8_t delta)
|
||||
{
|
||||
uint8_t m = v&0xC7; // filter Ed
|
||||
if(m>=0xC0) {
|
||||
return &emu->xmm[(m&0x07)+(rex.b<<4)];
|
||||
return &emu->xmm[(m&0x07)+(rex.b<<3)];
|
||||
} else return (sse_regs_t*)GetECommon(emu, rex, m, delta);
|
||||
}
|
||||
|
||||
|
||||
@@ -75,10 +75,12 @@ static inline void Push(x64emu_t *emu, uint64_t v)
|
||||
|
||||
reg64_t* GetECommon(x64emu_t* emu, rex_t rex, uint8_t m, uint8_t delta);
|
||||
reg64_t* GetECommonO(x64emu_t* emu, rex_t rex, uint8_t m, uint8_t delta, uintptr_t offset);
|
||||
reg64_t* GetECommon32O(x64emu_t* emu, rex_t rex, uint8_t m, uint8_t delta, uintptr_t offset);
|
||||
reg64_t* GetEb(x64emu_t *emu, rex_t rex, uint8_t v, uint8_t delta);
|
||||
reg64_t* GetEbO(x64emu_t *emu, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset);
|
||||
reg64_t* GetEd(x64emu_t *emu, rex_t rex, uint8_t v, uint8_t delta);
|
||||
reg64_t* GetEdO(x64emu_t *emu, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset);
|
||||
reg64_t* GetEd32O(x64emu_t *emu, rex_t rex, uint8_t v, uint8_t delta, uintptr_t offset);
|
||||
#define GetEw GetEd
|
||||
reg64_t* GetEw16(x64emu_t *emu, rex_t rex, uint8_t v);
|
||||
reg64_t* GetEw16off(x64emu_t *emu, rex_t rex, uint8_t v, uintptr_t offset);
|
||||
@@ -97,11 +99,17 @@ void UpdateFlags(x64emu_t *emu);
|
||||
|
||||
int Run0F(x64emu_t *emu, rex_t rex);
|
||||
int Run64(x64emu_t *emu, rex_t rex);
|
||||
int Run66(x64emu_t *emu, rex_t rex);
|
||||
int Run66(x64emu_t *emu, rex_t rex, int rep);
|
||||
int Run660F(x64emu_t *emu, rex_t rex);
|
||||
//int Run67(x64emu_t *emu, rex_t rex);
|
||||
int Run6664(x64emu_t *emu, rex_t rex);
|
||||
int Run66D9(x64emu_t *emu, rex_t rex);
|
||||
int Run66DD(x64emu_t *emu, rex_t rex);
|
||||
int Run67(x64emu_t *emu, rex_t rex);
|
||||
int RunD8(x64emu_t *emu, rex_t rex);
|
||||
int RunD9(x64emu_t *emu, rex_t rex);
|
||||
int RunDA(x64emu_t *emu, rex_t rex);
|
||||
int RunDB(x64emu_t *emu, rex_t rex);
|
||||
int RunDD(x64emu_t *emu, rex_t rex);
|
||||
int RunDF(x64emu_t *emu, rex_t rex);
|
||||
int RunF0(x64emu_t *emu, rex_t rex);
|
||||
int RunF20F(x64emu_t *emu, rex_t rex);
|
||||
|
||||
@@ -0,0 +1,198 @@
|
||||
#define _GNU_SOURCE
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "debug.h"
|
||||
#include "box64stack.h"
|
||||
#include "x64emu.h"
|
||||
#include "x64run.h"
|
||||
#include "x64emu_private.h"
|
||||
#include "x64run_private.h"
|
||||
#include "x64primop.h"
|
||||
#include "x64trace.h"
|
||||
#include "x87emu_private.h"
|
||||
#include "box64context.h"
|
||||
#include "bridge.h"
|
||||
#ifdef DYNAREC
|
||||
#include "../dynarec/arm_lock_helper.h"
|
||||
#endif
|
||||
|
||||
#include "modrm.h"
|
||||
|
||||
int RunD8(x64emu_t *emu, rex_t rex)
|
||||
{
|
||||
uint8_t nextop;
|
||||
float f;
|
||||
reg64_t *oped;
|
||||
|
||||
nextop = F8;
|
||||
switch (nextop) {
|
||||
|
||||
case 0xC0:
|
||||
case 0xC1:
|
||||
case 0xC2:
|
||||
case 0xC3:
|
||||
case 0xC4:
|
||||
case 0xC5:
|
||||
case 0xC6:
|
||||
case 0xC7: /* FADD */
|
||||
ST0.d += ST(nextop&7).d;
|
||||
break;
|
||||
case 0xC8:
|
||||
case 0xC9:
|
||||
case 0xCA:
|
||||
case 0xCB:
|
||||
case 0xCC:
|
||||
case 0xCD:
|
||||
case 0xCE:
|
||||
case 0xCF: /* FMUL */
|
||||
ST0.d *= ST(nextop&7).d;
|
||||
break;
|
||||
case 0xD0:
|
||||
case 0xD1:
|
||||
case 0xD2:
|
||||
case 0xD3:
|
||||
case 0xD4:
|
||||
case 0xD5:
|
||||
case 0xD6:
|
||||
case 0xD7: /* FCOM */
|
||||
fpu_fcom(emu, ST(nextop&7).d);
|
||||
break;
|
||||
case 0xD8:
|
||||
case 0xD9:
|
||||
case 0xDA:
|
||||
case 0xDB:
|
||||
case 0xDC:
|
||||
case 0xDD:
|
||||
case 0xDE:
|
||||
case 0xDF: /* FCOMP */
|
||||
fpu_fcom(emu, ST(nextop&7).d);
|
||||
fpu_do_pop(emu);
|
||||
break;
|
||||
case 0xE0:
|
||||
case 0xE1:
|
||||
case 0xE2:
|
||||
case 0xE3:
|
||||
case 0xE4:
|
||||
case 0xE5:
|
||||
case 0xE6:
|
||||
case 0xE7: /* FSUB */
|
||||
ST0.d -= ST(nextop&7).d;
|
||||
break;
|
||||
case 0xE8:
|
||||
case 0xE9:
|
||||
case 0xEA:
|
||||
case 0xEB:
|
||||
case 0xEC:
|
||||
case 0xED:
|
||||
case 0xEE:
|
||||
case 0xEF: /* FSUBR */
|
||||
ST0.d = ST(nextop&7).d - ST0.d;
|
||||
break;
|
||||
case 0xF0:
|
||||
case 0xF1:
|
||||
case 0xF2:
|
||||
case 0xF3:
|
||||
case 0xF4:
|
||||
case 0xF5:
|
||||
case 0xF6:
|
||||
case 0xF7: /* FDIV */
|
||||
ST0.d /= ST(nextop&7).d;
|
||||
break;
|
||||
case 0xF8:
|
||||
case 0xF9:
|
||||
case 0xFA:
|
||||
case 0xFB:
|
||||
case 0xFC:
|
||||
case 0xFD:
|
||||
case 0xFE:
|
||||
case 0xFF: /* FDIVR */
|
||||
ST0.d = ST(nextop&7).d / ST0.d;
|
||||
break;
|
||||
default:
|
||||
switch((nextop>>3)&7) {
|
||||
case 0: /* FADD ST0, float */
|
||||
GETED(0);
|
||||
if(!(((uintptr_t)ED)&3))
|
||||
ST0.d += *(float*)ED;
|
||||
else {
|
||||
memcpy(&f, ED, sizeof(float));
|
||||
ST0.d += f;
|
||||
}
|
||||
break;
|
||||
case 1: /* FMUL ST0, float */
|
||||
GETED(0);
|
||||
if(!(((uintptr_t)ED)&3))
|
||||
ST0.d *= *(float*)ED;
|
||||
else {
|
||||
memcpy(&f, ED, sizeof(float));
|
||||
ST0.d *= f;
|
||||
}
|
||||
break;
|
||||
case 2: /* FCOM ST0, float */
|
||||
GETED(0);
|
||||
if(!(((uintptr_t)ED)&3))
|
||||
fpu_fcom(emu, *(float*)ED);
|
||||
else {
|
||||
memcpy(&f, ED, sizeof(float));
|
||||
fpu_fcom(emu, f);
|
||||
}
|
||||
break;
|
||||
case 3: /* FCOMP */
|
||||
GETED(0);
|
||||
if(!(((uintptr_t)ED)&3))
|
||||
fpu_fcom(emu, *(float*)ED);
|
||||
else {
|
||||
memcpy(&f, ED, sizeof(float));
|
||||
fpu_fcom(emu, f);
|
||||
}
|
||||
fpu_do_pop(emu);
|
||||
break;
|
||||
case 4: /* FSUB ST0, float */
|
||||
GETED(0);
|
||||
if(!(((uintptr_t)ED)&3))
|
||||
ST0.d -= *(float*)ED;
|
||||
else {
|
||||
memcpy(&f, ED, sizeof(float));
|
||||
ST0.d -= f;
|
||||
}
|
||||
break;
|
||||
case 5: /* FSUBR ST0, float */
|
||||
GETED(0);
|
||||
if(!(((uintptr_t)ED)&3))
|
||||
ST0.d = *(float*)ED - ST0.d;
|
||||
else {
|
||||
memcpy(&f, ED, sizeof(float));
|
||||
ST0.d = f - ST0.d;
|
||||
}
|
||||
break;
|
||||
case 6: /* FDIV ST0, float */
|
||||
GETED(0);
|
||||
if(!(((uintptr_t)ED)&3))
|
||||
ST0.d /= *(float*)ED;
|
||||
else {
|
||||
memcpy(&f, ED, sizeof(float));
|
||||
ST0.d /= f;
|
||||
}
|
||||
break;
|
||||
case 7: /* FDIVR ST0, float */
|
||||
GETED(0);
|
||||
if(!(((uintptr_t)ED)&3))
|
||||
ST0.d = *(float*)ED / ST0.d;
|
||||
else {
|
||||
memcpy(&f, ED, sizeof(float));
|
||||
ST0.d = f / ST0.d;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
+1
-3
@@ -267,16 +267,14 @@ int RunD9(x64emu_t *emu, rex_t rex)
|
||||
// do something with cw?
|
||||
emu->round = (fpu_round_t)((emu->cw >> 10) & 3);
|
||||
break;
|
||||
#if 0
|
||||
case 6: /* FNSTENV m */
|
||||
// warning, incomplete
|
||||
GETED;
|
||||
GETED(0);
|
||||
fpu_savenv(emu, (char*)ED, 0);
|
||||
// intruction pointer: 48bits
|
||||
// data (operand) pointer: 48bits
|
||||
// last opcode: 11bits save: 16bits restaured (1st and 2nd opcode only)
|
||||
break;
|
||||
#endif
|
||||
case 7: /* FNSTCW Ew */
|
||||
GETEW(0);
|
||||
EW->word[0] = emu->cw;
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
#define _GNU_SOURCE
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "debug.h"
|
||||
#include "box64stack.h"
|
||||
#include "x64emu.h"
|
||||
#include "x64run.h"
|
||||
#include "x64emu_private.h"
|
||||
#include "x64run_private.h"
|
||||
#include "x64primop.h"
|
||||
#include "x64trace.h"
|
||||
#include "x87emu_private.h"
|
||||
#include "box64context.h"
|
||||
#include "bridge.h"
|
||||
#ifdef DYNAREC
|
||||
#include "../dynarec/arm_lock_helper.h"
|
||||
#endif
|
||||
|
||||
#include "modrm.h"
|
||||
|
||||
int RunDA(x64emu_t *emu, rex_t rex)
|
||||
{
|
||||
uint8_t nextop;
|
||||
reg64_t *oped;
|
||||
|
||||
nextop = F8;
|
||||
switch (nextop) {
|
||||
case 0xC0: /* FCMOVB ST(0), ST(i) */
|
||||
case 0xC1:
|
||||
case 0xC2:
|
||||
case 0xC3:
|
||||
case 0xC4:
|
||||
case 0xC5:
|
||||
case 0xC6:
|
||||
case 0xC7:
|
||||
CHECK_FLAGS(emu);
|
||||
if(ACCESS_FLAG(F_CF))
|
||||
ST0.q = ST(nextop&7).q;
|
||||
break;
|
||||
case 0xC8: /* FCMOVE ST(0), ST(i) */
|
||||
case 0xC9:
|
||||
case 0xCA:
|
||||
case 0xCB:
|
||||
case 0xCC:
|
||||
case 0xCD:
|
||||
case 0xCE:
|
||||
case 0xCF:
|
||||
CHECK_FLAGS(emu);
|
||||
if(ACCESS_FLAG(F_ZF))
|
||||
ST0.q = ST(nextop&7).q;
|
||||
break;
|
||||
case 0xD0: /* FCMOVBE ST(0), ST(i) */
|
||||
case 0xD1:
|
||||
case 0xD2:
|
||||
case 0xD3:
|
||||
case 0xD4:
|
||||
case 0xD5:
|
||||
case 0xD6:
|
||||
case 0xD7:
|
||||
CHECK_FLAGS(emu);
|
||||
if(ACCESS_FLAG(F_CF) || ACCESS_FLAG(F_ZF))
|
||||
ST0.q = ST(nextop&7).q;
|
||||
break;
|
||||
case 0xD8: /* FCMOVU ST(0), ST(i) */
|
||||
case 0xD9:
|
||||
case 0xDA:
|
||||
case 0xDB:
|
||||
case 0xDC:
|
||||
case 0xDD:
|
||||
case 0xDE:
|
||||
case 0xDF:
|
||||
CHECK_FLAGS(emu);
|
||||
if(ACCESS_FLAG(F_PF))
|
||||
ST0.q = ST(nextop&7).q;
|
||||
break;
|
||||
|
||||
case 0xE9: /* FUCOMPP */
|
||||
fpu_fcom(emu, ST1.d); // bad, should handle QNaN and IA interrupt
|
||||
fpu_do_pop(emu);
|
||||
fpu_do_pop(emu);
|
||||
break;
|
||||
|
||||
case 0xE4:
|
||||
case 0xF0:
|
||||
case 0xF1:
|
||||
case 0xF4:
|
||||
case 0xF5:
|
||||
case 0xF6:
|
||||
case 0xF7:
|
||||
case 0xF8:
|
||||
case 0xF9:
|
||||
case 0xFD:
|
||||
return 1;
|
||||
default:
|
||||
switch((nextop>>3)&7) {
|
||||
case 0: /* FIADD ST0, Ed int */
|
||||
GETED(0);
|
||||
ST0.d += ED->sdword[0];
|
||||
break;
|
||||
case 1: /* FIMUL ST0, Ed int */
|
||||
GETED(0);
|
||||
ST0.d *= ED->sdword[0];
|
||||
break;
|
||||
case 2: /* FICOM ST0, Ed int */
|
||||
GETED(0);
|
||||
fpu_fcom(emu, ED->sdword[0]);
|
||||
break;
|
||||
case 3: /* FICOMP ST0, Ed int */
|
||||
GETED(0);
|
||||
fpu_fcom(emu, ED->sdword[0]);
|
||||
fpu_do_pop(emu);
|
||||
break;
|
||||
case 4: /* FISUB ST0, Ed int */
|
||||
GETED(0);
|
||||
ST0.d -= ED->sdword[0];
|
||||
break;
|
||||
case 5: /* FISUBR ST0, Ed int */
|
||||
GETED(0);
|
||||
ST0.d = (double)ED->sdword[0] - ST0.d;
|
||||
break;
|
||||
case 6: /* FIDIV ST0, Ed int */
|
||||
GETED(0);
|
||||
ST0.d /= ED->sdword[0];
|
||||
break;
|
||||
case 7: /* FIDIVR ST0, Ed int */
|
||||
GETED(0);
|
||||
ST0.d = (double)ED->sdword[0] / ST0.d;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,192 @@
|
||||
#define _GNU_SOURCE
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "debug.h"
|
||||
#include "box64stack.h"
|
||||
#include "x64emu.h"
|
||||
#include "x64run.h"
|
||||
#include "x64emu_private.h"
|
||||
#include "x64run_private.h"
|
||||
#include "x64primop.h"
|
||||
#include "x64trace.h"
|
||||
#include "x87emu_private.h"
|
||||
#include "box64context.h"
|
||||
#include "bridge.h"
|
||||
#ifdef DYNAREC
|
||||
#include "../dynarec/arm_lock_helper.h"
|
||||
#endif
|
||||
|
||||
#include "modrm.h"
|
||||
|
||||
int RunDD(x64emu_t *emu, rex_t rex)
|
||||
{
|
||||
uint8_t nextop;
|
||||
reg64_t *oped;
|
||||
|
||||
nextop = F8;
|
||||
switch (nextop) {
|
||||
case 0xC0: /* FFREE STx */
|
||||
case 0xC1:
|
||||
case 0xC2:
|
||||
case 0xC3:
|
||||
case 0xC4:
|
||||
case 0xC5:
|
||||
case 0xC6:
|
||||
case 0xC7:
|
||||
fpu_do_free(emu, nextop-0xC0);
|
||||
break;
|
||||
|
||||
case 0xD0: /* FST ST0, STx */
|
||||
case 0xD1:
|
||||
case 0xD2:
|
||||
case 0xD3:
|
||||
case 0xD4:
|
||||
case 0xD5:
|
||||
case 0xD6:
|
||||
case 0xD7:
|
||||
ST(nextop&7).q = ST0.q;
|
||||
break;
|
||||
case 0xD8: /* FSTP ST0, STx */
|
||||
case 0xD9:
|
||||
case 0xDA:
|
||||
case 0xDB:
|
||||
case 0xDC:
|
||||
case 0xDD:
|
||||
case 0xDE:
|
||||
case 0xDF:
|
||||
ST(nextop&7).q = ST0.q;
|
||||
fpu_do_pop(emu);
|
||||
break;
|
||||
case 0xE0: /* FUCOM ST0, STx */
|
||||
case 0xE1:
|
||||
case 0xE2:
|
||||
case 0xE3:
|
||||
case 0xE4:
|
||||
case 0xE5:
|
||||
case 0xE6:
|
||||
case 0xE7:
|
||||
fpu_fcom(emu, ST(nextop&7).d); // bad, should handle QNaN and IA interrupt
|
||||
break;
|
||||
case 0xE8: /* FUCOMP ST0, STx */
|
||||
case 0xE9:
|
||||
case 0xEA:
|
||||
case 0xEB:
|
||||
case 0xEC:
|
||||
case 0xED:
|
||||
case 0xEE:
|
||||
case 0xEF:
|
||||
fpu_fcom(emu, ST(nextop&7).d); // bad, should handle QNaN and IA interrupt
|
||||
fpu_do_pop(emu);
|
||||
break;
|
||||
|
||||
case 0xC8:
|
||||
case 0xC9:
|
||||
case 0xCA:
|
||||
case 0xCB:
|
||||
case 0xCC:
|
||||
case 0xCD:
|
||||
case 0xCE:
|
||||
case 0xCF:
|
||||
case 0xF0:
|
||||
case 0xF1:
|
||||
case 0xF2:
|
||||
case 0xF3:
|
||||
case 0xF4:
|
||||
case 0xF5:
|
||||
case 0xF6:
|
||||
case 0xF7:
|
||||
case 0xF8:
|
||||
case 0xF9:
|
||||
case 0xFA:
|
||||
case 0xFB:
|
||||
case 0xFC:
|
||||
case 0xFD:
|
||||
case 0xFE:
|
||||
case 0xFF:
|
||||
return 1;
|
||||
|
||||
default:
|
||||
switch((nextop>>3)&7) {
|
||||
case 0: /* FLD double */
|
||||
GETED(0);
|
||||
fpu_do_push(emu);
|
||||
if(!(((uintptr_t)ED)&7))
|
||||
ST0.d = *(double*)ED;
|
||||
else {
|
||||
memcpy(&ST0.d, ED, sizeof(double));
|
||||
}
|
||||
break;
|
||||
case 1: /* FISTTP ED qword */
|
||||
GETED(0);
|
||||
if(!(((uintptr_t)ED)&7))
|
||||
*(int64_t*)ED = ST0.d;
|
||||
else {
|
||||
int64_t i64 = ST0.d;
|
||||
memcpy(ED, &i64, sizeof(int64_t));
|
||||
}
|
||||
fpu_do_pop(emu);
|
||||
break;
|
||||
case 2: /* FST double */
|
||||
GETED(0);
|
||||
if(!(((uintptr_t)ED)&7))
|
||||
*(double*)ED = ST0.d;
|
||||
else {
|
||||
memcpy(ED, &ST0.d, sizeof(double));
|
||||
}
|
||||
break;
|
||||
case 3: /* FSTP double */
|
||||
GETED(0);
|
||||
if(!(((uintptr_t)ED)&7))
|
||||
*(double*)ED = ST0.d;
|
||||
else {
|
||||
memcpy(ED, &ST0.d, sizeof(double));
|
||||
}
|
||||
fpu_do_pop(emu);
|
||||
break;
|
||||
case 4: /* FRSTOR m108byte */
|
||||
GETED(0);
|
||||
fpu_loadenv(emu, (char*)ED, 0);
|
||||
// get the STx
|
||||
{
|
||||
char* p =(char*)ED;
|
||||
p += 28;
|
||||
for (int i=0; i<8; ++i) {
|
||||
LD2D(p, &ST(i).d);
|
||||
p+=10;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 6: /* FNSAVE m108byte */
|
||||
GETED(0);
|
||||
// ENV first...
|
||||
// warning, incomplete
|
||||
fpu_savenv(emu, (char*)ED, 0);
|
||||
// save the STx
|
||||
{
|
||||
char* p =(char*)ED;
|
||||
p += 28;
|
||||
for (int i=0; i<8; ++i) {
|
||||
D2LD(&ST(i).d, p);
|
||||
p+=10;
|
||||
}
|
||||
}
|
||||
reset_fpu(emu);
|
||||
break;
|
||||
case 7: /* FNSTSW m2byte */
|
||||
GETED(0);
|
||||
emu->sw.f.F87_TOP = emu->top&7;
|
||||
*(uint16_t*)ED = emu->sw.x16;
|
||||
break;
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
+10
-25
@@ -31,6 +31,7 @@ int RunDF(x64emu_t *emu, rex_t rex)
|
||||
{
|
||||
uint8_t nextop;
|
||||
int16_t tmp16s;
|
||||
int64_t tmp64s;
|
||||
reg64_t *oped;
|
||||
|
||||
nextop = F8;
|
||||
@@ -146,7 +147,6 @@ int RunDF(x64emu_t *emu, rex_t rex)
|
||||
EW->sword[0] = fpu_round(emu, ST0.d);
|
||||
fpu_do_pop(emu);
|
||||
break;
|
||||
#if 0
|
||||
case 4: /* FBLD ST0, tbytes */
|
||||
GETED(0);
|
||||
fpu_do_push(emu);
|
||||
@@ -154,11 +154,11 @@ int RunDF(x64emu_t *emu, rex_t rex)
|
||||
break;
|
||||
case 5: /* FILD ST0, Gq */
|
||||
GETED(0);
|
||||
tmp64s = *(int64_t*)ED;
|
||||
tmp64s = ED->sq[0];
|
||||
fpu_do_push(emu);
|
||||
ST0.d = tmp64s;
|
||||
STll(0).ll = tmp64s;
|
||||
STll(0).ref = ST0.ll;
|
||||
STll(0).ref = ST0.q;
|
||||
break;
|
||||
case 6: /* FBSTP tbytes, ST0 */
|
||||
GETED(0);
|
||||
@@ -167,31 +167,16 @@ int RunDF(x64emu_t *emu, rex_t rex)
|
||||
break;
|
||||
case 7: /* FISTP i64 */
|
||||
GETED(0);
|
||||
if((uintptr_t)ED & 0x7) {
|
||||
// un-aligned!
|
||||
if(STll(0).ref==ST(0).ll)
|
||||
memcpy(ED, &STll(0).ll, sizeof(int64_t));
|
||||
else {
|
||||
int64_t i64;
|
||||
if(isgreater(ST0.d, (double)(int64_t)0x7fffffffffffffffLL) || isless(ST0.d, -(double)(int64_t)0x7fffffffffffffffLL) || !isfinite(ST0.d))
|
||||
i64 = 0x8000000000000000LL;
|
||||
else
|
||||
i64 = fpu_round(emu, ST0.d);
|
||||
memcpy(ED, &i64, sizeof(int64_t));
|
||||
}
|
||||
} else {
|
||||
if(STll(0).ref==ST(0).ll)
|
||||
*(int64_t*)ED = STll(0).ll;
|
||||
else {
|
||||
if(isgreater(ST0.d, (double)(int64_t)0x7fffffffffffffffLL) || isless(ST0.d, -(double)(int64_t)0x7fffffffffffffffLL) || !isfinite(ST0.d))
|
||||
*(int64_t*)ED = 0x8000000000000000LL;
|
||||
else
|
||||
*(int64_t*)ED = fpu_round(emu, ST0.d);
|
||||
}
|
||||
if(STll(0).ref==ST(0).q)
|
||||
ED->sq[0] = STll(0).ll;
|
||||
else {
|
||||
if(isgreater(ST0.d, (double)(int64_t)0x7fffffffffffffffLL) || isless(ST0.d, -(double)(int64_t)0x7fffffffffffffffLL) || !isfinite(ST0.d))
|
||||
ED->sq[0] = 0x8000000000000000LL;
|
||||
else
|
||||
ED->sq[0] = fpu_round(emu, ST0.d);
|
||||
}
|
||||
fpu_do_pop(emu);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
|
||||
+103
-1
@@ -45,7 +45,109 @@ int RunF0(x64emu_t *emu, rex_t rex)
|
||||
}
|
||||
|
||||
switch(opcode) {
|
||||
|
||||
#ifdef DYNAREC
|
||||
#define GO(B, OP) \
|
||||
case B+0: \
|
||||
nextop = F8; \
|
||||
GETEB(0); \
|
||||
GETGB; \
|
||||
do { \
|
||||
tmp8u = arm_lock_read_b(EB); \
|
||||
tmp8u = OP##8(emu, tmp8u, GB); \
|
||||
} while (arm_lock_write_b(EB, tmp8u)); \
|
||||
break; \
|
||||
case B+1: \
|
||||
nextop = F8; \
|
||||
GETED(0); \
|
||||
GETGD; \
|
||||
do { \
|
||||
tmp32u = arm_lock_read_d(ED); \
|
||||
tmp32u = OP##32(emu, tmp32u, GD.dword[0]); \
|
||||
} while (arm_lock_write_d(ED, tmp32u)); \
|
||||
break; \
|
||||
case B+2: \
|
||||
nextop = F8; \
|
||||
GETEB(0); \
|
||||
GETGB; \
|
||||
GB = OP##8(emu, GB, EB->byte[0]); \
|
||||
break; \
|
||||
case B+3: \
|
||||
nextop = F8; \
|
||||
GETED(0); \
|
||||
GETGD; \
|
||||
GD.dword[0] = OP##32(emu, GD.dword[0], ED->dword[0]); \
|
||||
break; \
|
||||
case B+4: \
|
||||
R_AL = OP##8(emu, R_AL, F8); \
|
||||
break; \
|
||||
case B+5: \
|
||||
R_EAX = OP##32(emu, R_EAX, F32); \
|
||||
break;
|
||||
#else
|
||||
#define GO(B, OP) \
|
||||
case B+0: \
|
||||
nextop = F8; \
|
||||
GETEB(0); \
|
||||
GETGB; \
|
||||
pthread_mutex_lock(&emu->context->mutex_lock); \
|
||||
EB->byte[0] = OP##8(emu, EB->byte[0], GB); \
|
||||
pthread_mutex_unlock(&emu->context->mutex_lock); \
|
||||
break; \
|
||||
case B+1: \
|
||||
nextop = F8; \
|
||||
GETED(0); \
|
||||
GETGD; \
|
||||
pthread_mutex_lock(&emu->context->mutex_lock); \
|
||||
if(rex.w) \
|
||||
ED->q[0] = OP##64(emu, ED->q[0], GD->q[0]); \
|
||||
else \
|
||||
if(MODREG) \
|
||||
ED->q[0] = OP##32(emu, ED->dword[0], GD->dword[0]); \
|
||||
else \
|
||||
ED->dword[0] = OP##32(emu, ED->dword[0], GD->dword[0]); \
|
||||
pthread_mutex_unlock(&emu->context->mutex_lock); \
|
||||
break; \
|
||||
case B+2: \
|
||||
nextop = F8; \
|
||||
GETEB(0); \
|
||||
GETGB; \
|
||||
pthread_mutex_lock(&emu->context->mutex_lock); \
|
||||
GB = OP##8(emu, GB, EB->byte[0]); \
|
||||
pthread_mutex_unlock(&emu->context->mutex_lock); \
|
||||
break; \
|
||||
case B+3: \
|
||||
nextop = F8; \
|
||||
GETED(0); \
|
||||
GETGD; \
|
||||
pthread_mutex_lock(&emu->context->mutex_lock); \
|
||||
if(rex.w) \
|
||||
GD->q[0] = OP##64(emu, GD->q[0], ED->q[0]); \
|
||||
else \
|
||||
GD->q[0] = OP##32(emu, GD->dword[0], ED->dword[0]); \
|
||||
pthread_mutex_unlock(&emu->context->mutex_lock); \
|
||||
break; \
|
||||
case B+4: \
|
||||
pthread_mutex_lock(&emu->context->mutex_lock); \
|
||||
R_AL = OP##8(emu, R_AL, F8); \
|
||||
pthread_mutex_unlock(&emu->context->mutex_lock); \
|
||||
break; \
|
||||
case B+5: \
|
||||
pthread_mutex_lock(&emu->context->mutex_lock); \
|
||||
if(rex.w) \
|
||||
R_RAX = OP##64(emu, R_RAX, F32S64); \
|
||||
else \
|
||||
R_RAX = OP##32(emu, R_EAX, F32); \
|
||||
pthread_mutex_unlock(&emu->context->mutex_lock); \
|
||||
break;
|
||||
#endif
|
||||
GO(0x00, add) /* ADD 0x00 -> 0x05 */
|
||||
GO(0x08, or) /* OR 0x08 -> 0x0D */
|
||||
GO(0x10, adc) /* ADC 0x10 -> 0x15 */
|
||||
GO(0x18, sbb) /* SBB 0x18 -> 0x1D */
|
||||
GO(0x20, and) /* AND 0x20 -> 0x25 */
|
||||
GO(0x28, sub) /* SUB 0x28 -> 0x2D */
|
||||
GO(0x30, xor) /* XOR 0x30 -> 0x35 */
|
||||
#undef GO
|
||||
case 0x0f:
|
||||
opcode = F8;
|
||||
switch (opcode) {
|
||||
|
||||
+174
-4
@@ -30,8 +30,12 @@ int RunF20F(x64emu_t *emu, rex_t rex)
|
||||
{
|
||||
uint8_t opcode;
|
||||
uint8_t nextop;
|
||||
int8_t tmp8s;
|
||||
uint8_t tmp8u;
|
||||
int32_t tmp32s;
|
||||
reg64_t *oped, *opgd;
|
||||
sse_regs_t *opex, *opgx;
|
||||
sse_regs_t *opex, *opgx, eax1;
|
||||
mmx87_regs_t *opgm;
|
||||
|
||||
opcode = F8;
|
||||
|
||||
@@ -58,10 +62,11 @@ int RunF20F(x64emu_t *emu, rex_t rex)
|
||||
nextop = F8;
|
||||
GETED(0);
|
||||
GETGX;
|
||||
if(rex.w)
|
||||
if(rex.w) {
|
||||
GX->d[0] = ED->sq[0];
|
||||
else
|
||||
} else {
|
||||
GX->d[0] = ED->sdword[0];
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x2C: /* CVTTSD2SI Gd, Ex */
|
||||
@@ -70,23 +75,188 @@ int RunF20F(x64emu_t *emu, rex_t rex)
|
||||
GETGD;
|
||||
if(rex.w)
|
||||
GD->sq[0] = EX->d[0];
|
||||
else
|
||||
else {
|
||||
GD->sdword[0] = EX->d[0];
|
||||
GD->dword[1] = 0;
|
||||
}
|
||||
break;
|
||||
case 0x2D: /* CVTSD2SI Gd, Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGD;
|
||||
if(rex.w) {
|
||||
switch((emu->mxcsr>>13)&3) {
|
||||
case ROUND_Nearest:
|
||||
GD->q[0] = floor(EX->d[0]+0.5);
|
||||
break;
|
||||
case ROUND_Down:
|
||||
GD->q[0] = floor(EX->d[0]);
|
||||
break;
|
||||
case ROUND_Up:
|
||||
GD->q[0] = ceil(EX->d[0]);
|
||||
break;
|
||||
case ROUND_Chop:
|
||||
GD->q[0] = EX->d[0];
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
switch((emu->mxcsr>>13)&3) {
|
||||
case ROUND_Nearest:
|
||||
GD->sdword[0] = floor(EX->d[0]+0.5);
|
||||
break;
|
||||
case ROUND_Down:
|
||||
GD->sdword[0] = floor(EX->d[0]);
|
||||
break;
|
||||
case ROUND_Up:
|
||||
GD->sdword[0] = ceil(EX->d[0]);
|
||||
break;
|
||||
case ROUND_Chop:
|
||||
GD->sdword[0] = EX->d[0];
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x51: /* SQRTSD Gx, Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
GX->d[0] = sqrt(EX->d[0]);
|
||||
break;
|
||||
|
||||
case 0x58: /* ADDSD Gx, Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
GX->d[0] += EX->d[0];
|
||||
break;
|
||||
case 0x59: /* MULSD Gx, Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
GX->d[0] *= EX->d[0];
|
||||
break;
|
||||
case 0x5A: /* CVTSD2SS Gx, Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
GX->f[0] = EX->d[0];
|
||||
break;
|
||||
|
||||
case 0x5C: /* SUBSD Gx, Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
GX->d[0] -= EX->d[0];
|
||||
break;
|
||||
case 0x5D: /* MINSD Gx, Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
if (isnan(GX->d[0]) || isnan(EX->d[0]) || isless(EX->d[0], GX->d[0]))
|
||||
GX->d[0] = EX->d[0];
|
||||
break;
|
||||
case 0x5E: /* DIVSD Gx, Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
GX->d[0] /= EX->d[0];
|
||||
break;
|
||||
case 0x5F: /* MAXSD Gx, Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
if (isnan(GX->d[0]) || isnan(EX->d[0]) || isgreater(EX->d[0], GX->d[0]))
|
||||
GX->d[0] = EX->d[0];
|
||||
break;
|
||||
|
||||
case 0x70: /* PSHUFLW Gx, Ex, Ib */
|
||||
nextop = F8;
|
||||
GETEX(1);
|
||||
GETGX;
|
||||
tmp8u = F8;
|
||||
if(GX==EX) {
|
||||
for (int i=0; i<4; ++i)
|
||||
eax1.uw[i] = EX->uw[(tmp8u>>(i*2))&3];
|
||||
GX->q[0] = eax1.q[0];
|
||||
} else {
|
||||
for (int i=0; i<4; ++i)
|
||||
GX->uw[i] = EX->uw[(tmp8u>>(i*2))&3];
|
||||
GX->q[1] = EX->q[1];
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x7C: /* HADDPS Gx, Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
GX->f[0] += GX->f[1];
|
||||
GX->f[1] = GX->f[2] + GX->f[3];
|
||||
if(EX==GX) {
|
||||
GX->f[2] = GX->f[0];
|
||||
GX->f[3] = GX->f[1];
|
||||
} else {
|
||||
GX->f[2] = EX->f[0] + EX->f[1];
|
||||
GX->f[3] = EX->f[2] + EX->f[3];
|
||||
}
|
||||
break;
|
||||
|
||||
GOCOND(0x80
|
||||
, tmp32s = F32S; CHECK_FLAGS(emu);
|
||||
, R_RIP += tmp32s;
|
||||
,
|
||||
) /* 0x80 -> 0x8F Jxx */
|
||||
|
||||
case 0xC2: /* CMPSD Gx, Ex, Ib */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
tmp8u = F8;
|
||||
tmp8s = 0;
|
||||
switch(tmp8u&7) {
|
||||
case 0: tmp8s=(GX->d[0] == EX->d[0]); break;
|
||||
case 1: tmp8s=isless(GX->d[0], EX->d[0]); break;
|
||||
case 2: tmp8s=islessequal(GX->d[0], EX->d[0]); break;
|
||||
case 3: tmp8s=isnan(GX->d[0]) || isnan(EX->d[0]); break;
|
||||
case 4: tmp8s=(GX->d[0] != EX->d[0]); break;
|
||||
case 5: tmp8s=isnan(GX->d[0]) || isnan(EX->d[0]) || isgreaterequal(GX->d[0], EX->d[0]); break;
|
||||
case 6: tmp8s=isnan(GX->d[0]) || isnan(EX->d[0]) || isgreater(GX->d[0], EX->d[0]); break;
|
||||
case 7: tmp8s=!isnan(GX->d[0]) && !isnan(EX->d[0]); break;
|
||||
}
|
||||
GX->q[0]=(tmp8s)?0xffffffffffffffffLL:0LL;
|
||||
break;
|
||||
|
||||
case 0xD6: /* MOVDQ2Q Gm, Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGM;
|
||||
GM->q = EX->q[0];
|
||||
break;
|
||||
|
||||
case 0xE6: /* CVTPD2DQ Gx, Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
switch((emu->mxcsr>>13)&3) {
|
||||
case ROUND_Nearest:
|
||||
GX->sd[0] = floor(EX->d[0]+0.5);
|
||||
GX->sd[1] = floor(EX->d[1]+0.5);
|
||||
break;
|
||||
case ROUND_Down:
|
||||
GX->sd[0] = floor(EX->d[0]);
|
||||
GX->sd[1] = floor(EX->d[1]);
|
||||
break;
|
||||
case ROUND_Up:
|
||||
GX->sd[0] = ceil(EX->d[0]);
|
||||
GX->sd[1] = ceil(EX->d[1]);
|
||||
break;
|
||||
case ROUND_Chop:
|
||||
GX->sd[0] = EX->d[0];
|
||||
GX->sd[1] = EX->d[1];
|
||||
break;
|
||||
}
|
||||
GX->q[1] = 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
return 1;
|
||||
|
||||
+184
-2
@@ -31,9 +31,11 @@ int RunF30F(x64emu_t *emu, rex_t rex)
|
||||
{
|
||||
uint8_t opcode;
|
||||
uint8_t nextop;
|
||||
int32_t tmp32s;
|
||||
int8_t tmp8s;
|
||||
uint8_t tmp8u;
|
||||
reg64_t *oped, *opgd;
|
||||
sse_regs_t *opex, *opgx;
|
||||
sse_regs_t *opex, *opgx, eax1;
|
||||
mmx87_regs_t *opem;
|
||||
|
||||
opcode = F8;
|
||||
|
||||
@@ -55,6 +57,21 @@ int RunF30F(x64emu_t *emu, rex_t rex)
|
||||
GETGX;
|
||||
EX->ud[0] = GX->ud[0];
|
||||
break;
|
||||
case 0x12: /* MOVSLDUP Gx, Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
GX->ud[1] = GX->ud[0] = EX->ud[0];
|
||||
GX->ud[3] = GX->ud[2] = EX->ud[2];
|
||||
break;
|
||||
|
||||
case 0x16: /* MOVSHDUP Gx, Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
GX->ud[1] = GX->ud[0] = EX->ud[1];
|
||||
GX->ud[3] = GX->ud[2] = EX->ud[3];
|
||||
break;
|
||||
|
||||
case 0x2A: /* CVTSI2SS Gx, Ed */
|
||||
nextop = F8;
|
||||
@@ -66,6 +83,80 @@ int RunF30F(x64emu_t *emu, rex_t rex)
|
||||
GX->f[0] = ED->sdword[0];
|
||||
break;
|
||||
|
||||
case 0x2C: /* CVTTSS2SI Gd, Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGD;
|
||||
if (rex.w)
|
||||
GD->sq[0] = EX->f[0];
|
||||
else {
|
||||
GD->sdword[0] = EX->f[0];
|
||||
GD->dword[1] = 0;
|
||||
}
|
||||
break;
|
||||
case 0x2D: /* CVTSS2SI Gd, Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGD;
|
||||
if(rex.w) {
|
||||
switch((emu->mxcsr>>13)&3) {
|
||||
case ROUND_Nearest:
|
||||
GD->sq[0] = floorf(EX->f[0]+0.5f);
|
||||
break;
|
||||
case ROUND_Down:
|
||||
GD->sq[0] = floorf(EX->f[0]);
|
||||
break;
|
||||
case ROUND_Up:
|
||||
GD->sq[0] = ceilf(EX->f[0]);
|
||||
break;
|
||||
case ROUND_Chop:
|
||||
GD->sq[0] = EX->f[0];
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
switch((emu->mxcsr>>13)&3) {
|
||||
case ROUND_Nearest:
|
||||
GD->sdword[0] = floorf(EX->f[0]+0.5f);
|
||||
break;
|
||||
case ROUND_Down:
|
||||
GD->sdword[0] = floorf(EX->f[0]);
|
||||
break;
|
||||
case ROUND_Up:
|
||||
GD->sdword[0] = ceilf(EX->f[0]);
|
||||
break;
|
||||
case ROUND_Chop:
|
||||
GD->sdword[0] = EX->f[0];
|
||||
break;
|
||||
}
|
||||
GD->dword[1] = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x51: /* SQRTSS Gx, Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
GX->f[0] = sqrtf(EX->f[0]);
|
||||
break;
|
||||
case 0x52: /* RSQRTSS Gx, Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
GX->f[0] = 1.0f/sqrtf(EX->f[0]);
|
||||
break;
|
||||
case 0x53: /* RCPSS Gx, Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
GX->f[0] = 1.0f/EX->f[0];
|
||||
break;
|
||||
|
||||
case 0x58: /* ADDSS Gx, Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
GX->f[0] += EX->f[0];
|
||||
break;
|
||||
case 0x59: /* MULSS Gx, Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
@@ -78,6 +169,41 @@ int RunF30F(x64emu_t *emu, rex_t rex)
|
||||
GETGX;
|
||||
GX->d[0] = EX->f[0];
|
||||
break;
|
||||
case 0x5B: /* CVTTPS2DQ Gx, Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
GX->sd[0] = EX->f[0];
|
||||
GX->sd[1] = EX->f[1];
|
||||
GX->sd[2] = EX->f[2];
|
||||
GX->sd[3] = EX->f[3];
|
||||
break;
|
||||
case 0x5C: /* SUBSS Gx, Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
GX->f[0] -= EX->f[0];
|
||||
break;
|
||||
case 0x5D: /* MINSS Gx, Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
if(isnan(GX->f[0]) || isnan(EX->f[0]) || isless(EX->f[0], GX->f[0]))
|
||||
GX->f[0] = EX->f[0];
|
||||
break;
|
||||
case 0x5E: /* DIVSS Gx, Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
GX->f[0] /= EX->f[0];
|
||||
break;
|
||||
case 0x5F: /* MAXSS Gx, Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
if (isnan(GX->f[0]) || isnan(EX->f[0]) || isgreater(EX->f[0], GX->f[0]))
|
||||
GX->f[0] = EX->f[0];
|
||||
break;
|
||||
|
||||
case 0x6F: /* MOVDQU Gx, Ex */
|
||||
nextop = F8;
|
||||
@@ -85,6 +211,21 @@ int RunF30F(x64emu_t *emu, rex_t rex)
|
||||
GETGX;
|
||||
memcpy(GX, EX, 16); // unaligned...
|
||||
break;
|
||||
case 0x70: /* PSHUFHW Gx, Ex, Ib */
|
||||
nextop = F8;
|
||||
GETEX(1);
|
||||
GETGX;
|
||||
tmp8u = F8;
|
||||
if(GX==EX) {
|
||||
for (int i=0; i<4; ++i)
|
||||
eax1.uw[4+i] = EX->uw[4+((tmp8u>>(i*2))&3)];
|
||||
GX->q[1] = eax1.q[1];
|
||||
} else {
|
||||
for (int i=0; i<4; ++i)
|
||||
GX->uw[4+i] = EX->uw[4+((tmp8u>>(i*2))&3)];
|
||||
GX->q[0] = EX->q[0];
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x7E: /* MOVQ Gx, Ex */
|
||||
nextop = F8;
|
||||
@@ -93,6 +234,47 @@ int RunF30F(x64emu_t *emu, rex_t rex)
|
||||
GX->q[0] = EX->q[0];
|
||||
GX->q[1] = 0;
|
||||
break;
|
||||
case 0x7F: /* MOVDQU Ex, Gx */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
memcpy(EX, GX, 16); // unaligned...
|
||||
break;
|
||||
|
||||
case 0xC2: /* CMPSS Gx, Ex, Ib */
|
||||
nextop = F8;
|
||||
GETEX(1);
|
||||
GETGX;
|
||||
tmp8u = F8;
|
||||
tmp8s = 0;
|
||||
switch(tmp8u&7) {
|
||||
case 0: tmp8s=(GX->f[0] == EX->f[0]); break;
|
||||
case 1: tmp8s=isless(GX->f[0], EX->f[0]); break;
|
||||
case 2: tmp8s=islessequal(GX->f[0], EX->f[0]); break;
|
||||
case 3: tmp8s=isnan(GX->f[0]) || isnan(EX->f[0]); break;
|
||||
case 4: tmp8s=(GX->f[0] != EX->f[0]); break;
|
||||
case 5: tmp8s=isnan(GX->f[0]) || isnan(EX->f[0]) || isgreaterequal(GX->f[0], EX->f[0]); break;
|
||||
case 6: tmp8s=isnan(GX->f[0]) || isnan(EX->f[0]) || isgreater(GX->f[0], EX->f[0]); break;
|
||||
case 7: tmp8s=!isnan(GX->f[0]) && !isnan(EX->f[0]); break;
|
||||
}
|
||||
GX->ud[0]=(tmp8s)?0xffffffff:0;
|
||||
break;
|
||||
|
||||
case 0xD6: /* MOVQ2DQ Gx, Em */
|
||||
nextop = F8;
|
||||
GETEM(0);
|
||||
GETGX;
|
||||
GX->q[0] = EM->q;
|
||||
GX->q[1] = 0;
|
||||
break;
|
||||
|
||||
case 0xE6: /* CVTDQ2PD Gx, Ex */
|
||||
nextop = F8;
|
||||
GETEX(0);
|
||||
GETGX;
|
||||
GX->d[1] = EX->sd[1];
|
||||
GX->d[0] = EX->sd[0];
|
||||
break;
|
||||
|
||||
default:
|
||||
return 1;
|
||||
|
||||
@@ -68,6 +68,7 @@ scwrap_t syscallwrap[] = {
|
||||
//{ 3, __NR_close, 1 }, // wrapped so SA_RESTART can be handled by libc
|
||||
|
||||
{ 5, __NR_fstat, 2},
|
||||
{ 186, __NR_gettid, 0 },
|
||||
};
|
||||
|
||||
struct mmap_arg_struct {
|
||||
|
||||
@@ -102,7 +102,13 @@ const char* DecodeX64Trace(zydis_dec_t *dec, uintptr_t p)
|
||||
sprintf(tmp, "%02X ", *((unsigned char*)p+i));
|
||||
strcat(buff, tmp);
|
||||
}
|
||||
#if 0
|
||||
const /*ZydisFormatterToken*/void* token;
|
||||
dec->ZydisFormatterTokenizeInstruction(&dec->formatter, &dec->instruction, tmp, sizeof(tmp), p, &token);
|
||||
dec->PrintTokenizedInstruction(token);
|
||||
#else
|
||||
dec->ZydisFormatterFormatInstruction(&dec->formatter, &dec->instruction, tmp, sizeof(tmp),p);
|
||||
#endif
|
||||
strcat(buff, tmp);
|
||||
} else {
|
||||
sprintf(buff, "Decoder failed @%p", (void*)p);
|
||||
|
||||
@@ -10,9 +10,9 @@ typedef void (*wrapper_t)(x64emu_t* emu, uintptr_t fnc);
|
||||
bridge_t *NewBridge();
|
||||
void FreeBridge(bridge_t** bridge);
|
||||
|
||||
uintptr_t AddBridge(bridge_t* bridge, wrapper_t w, void* fnc, int N);
|
||||
uintptr_t AddBridge(bridge_t* bridge, wrapper_t w, void* fnc, int N, const char* name);
|
||||
uintptr_t CheckBridged(bridge_t* bridge, void* fnc);
|
||||
uintptr_t AddCheckBridge(bridge_t* bridge, wrapper_t w, void* fnc, int N);
|
||||
uintptr_t AddCheckBridge(bridge_t* bridge, wrapper_t w, void* fnc, int N, const char* name);
|
||||
uintptr_t AddAutomaticBridge(x64emu_t* emu, bridge_t* bridge, wrapper_t w, void* fnc, int N);
|
||||
void* GetNativeFnc(uintptr_t fnc);
|
||||
void* GetNativeFncOrFnc(uintptr_t fnc);
|
||||
@@ -22,4 +22,11 @@ void* getAlternate(void* addr);
|
||||
void addAlternate(void* addr, void* alt);
|
||||
void cleanAlternate();
|
||||
|
||||
#ifdef HAVE_TRACE
|
||||
const char* getBridgeName(void* addr);
|
||||
#endif
|
||||
|
||||
void init_bridge_helper();
|
||||
void fini_bridge_helper();
|
||||
|
||||
#endif //__BRIDGE_H_
|
||||
+36
-2
@@ -1,5 +1,15 @@
|
||||
#include <stdint.h>
|
||||
|
||||
typedef struct x64_va_list_s {
|
||||
unsigned int gp_offset;
|
||||
unsigned int fp_offset;
|
||||
void *overflow_arg_area;
|
||||
void *reg_save_area;
|
||||
} x64_va_list_t[1];
|
||||
|
||||
#define X64_VA_MAX_REG (6*8)
|
||||
#define X64_VA_MAX_XMM ((6*8)+(8*16))
|
||||
|
||||
#ifdef __x86_64__
|
||||
// x86_64, 6 64bits general regs and 16 or 8? 128bits float regs
|
||||
/*
|
||||
@@ -13,10 +23,19 @@ typedef struct {
|
||||
*/
|
||||
#define CREATE_SYSV_VALIST(A) \
|
||||
va_list sysv_varargs; \
|
||||
sysv_varargs->gp_offset=(6*8); \
|
||||
sysv_varargs->fp_offset=(6*8)+(16*16); \
|
||||
sysv_varargs->gp_offset=X64_VA_MAX_REG; \
|
||||
sysv_varargs->fp_offset=X64_VA_MAX_XMM; \
|
||||
sysv_varargs->reg_save_area=A; \
|
||||
sysv_varargs->overflow_arg_area=A;
|
||||
|
||||
#define CONVERT_VALIST(A) \
|
||||
va_list sysv_varargs; \
|
||||
sysv_varargs->gp_offset=A->gp_offset; \
|
||||
sysv_varargs->fp_offset=A->fp_offset; \
|
||||
sysv_varargs->reg_save_area=A->reg_save_area; \
|
||||
sysv_varargs->overflow_arg_area=A->overflow_arg_area;
|
||||
|
||||
|
||||
#elif defined(__aarch64__)
|
||||
// aarch64: 8 64bits general regs and 8 128bits float regs
|
||||
/*
|
||||
@@ -34,6 +53,15 @@ typedef struct va_list {
|
||||
sysv_varargs.__gr_offs=(8*8); \
|
||||
sysv_varargs.__vr_offs=(8*16); \
|
||||
sysv_varargs.__stack=A;
|
||||
|
||||
#define CONVERT_VALIST(A) \
|
||||
va_list sysv_varargs; \
|
||||
sysv_varargs.__gr_offs=-(6*8)+A->gp_offset; \
|
||||
sysv_varargs.__vr_offs=-(8*16)+(A->fp_offset-X64_VA_MAX_REG); \
|
||||
sysv_varargs.__stack=A->overflow_arg_area; \
|
||||
sysv_varargs.__gr_top=A->reg_save_area + X64_VA_MAX_REG; \
|
||||
sysv_varargs.__vr_top=A->reg_save_area + X64_VA_MAX_XMM;
|
||||
|
||||
#elif defined(__powerpc64__)
|
||||
// TODO, is this correct?
|
||||
#define CREATE_SYSV_VALIST(A) \
|
||||
@@ -41,6 +69,9 @@ typedef struct va_list {
|
||||
sysv_varargs->gpr=8; \
|
||||
sysv_varargs->fpr=8; \
|
||||
sysv_varargs->overflow_arg_area=A;
|
||||
|
||||
#define CONVERT_VALIST(A) \
|
||||
#error TODO!
|
||||
#else
|
||||
#error Unknown architecture!
|
||||
#endif
|
||||
@@ -55,9 +86,12 @@ typedef struct x64emu_s x64emu_t;
|
||||
|
||||
// 1st pos is of vaarg is 0, not 1!
|
||||
void myStackAlign(x64emu_t* emu, const char* fmt, uint64_t* st, uint64_t* mystack, int xmm, int pos);
|
||||
void myStackAlignScanf(x64emu_t* emu, const char* fmt, uint64_t* st, uint64_t* mystack, int pos);
|
||||
void myStackAlignGVariantNew(x64emu_t* emu, const char* fmt, uint64_t* st, uint64_t* mystack, int xmm, int pos);
|
||||
void myStackAlignW(x64emu_t* emu, const char* fmt, uint64_t* st, uint64_t* mystack, int xmm, int pos);
|
||||
|
||||
void UnalignStat64(const void* source, void* dest);
|
||||
|
||||
// defined in wrapperlibc.c
|
||||
int of_convert(int); // x86->arm
|
||||
int of_unconvert(int); // arm->x86
|
||||
+2
-1
@@ -173,7 +173,8 @@ typedef union {
|
||||
unsigned int _F_ID:1;
|
||||
} f;
|
||||
uint32_t x32;
|
||||
} x86flags_t;
|
||||
uint64_t x64;
|
||||
} x64flags_t;
|
||||
|
||||
typedef enum {
|
||||
F_CF = 0,
|
||||
|
||||
Executable
+21
@@ -0,0 +1,21 @@
|
||||
#ifndef __SDL1RWOPS_H__
|
||||
#define __SDL1RWOPS_H__
|
||||
|
||||
typedef struct SDL1_RWops_s SDL1_RWops_t; // the actual SDL1 SDL_RWops
|
||||
typedef struct x64emu_s x64emu_t;
|
||||
|
||||
typedef SDL1_RWops_t* (*sdl1_allocrw)();
|
||||
typedef void (*sdl1_freerw)(SDL1_RWops_t*);
|
||||
|
||||
// each function will be added to dictionary, and each native functions will be wrapped so they run in emulated world
|
||||
SDL1_RWops_t* AddNativeRW(x64emu_t* emu, SDL1_RWops_t* ops);
|
||||
SDL1_RWops_t* RWNativeStart(x64emu_t* emu, SDL1_RWops_t* ops); // put Native RW function, wrapping emulated (callback style) ones if needed
|
||||
void RWNativeEnd(SDL1_RWops_t* ops); // put back emulated function back in place
|
||||
|
||||
int32_t RWNativeSeek(SDL1_RWops_t *ops, int32_t offset, int32_t whence);
|
||||
uint32_t RWNativeRead(SDL1_RWops_t* ops, void* ptr, uint32_t size, uint32_t maxnum);
|
||||
int32_t RWNativeWrite(SDL1_RWops_t *ops, const void *ptr, int32_t size, int32_t num);
|
||||
int32_t RWNativeClose(SDL1_RWops_t* ops);
|
||||
void RWSetType(SDL1_RWops_t* r, int t);
|
||||
|
||||
#endif
|
||||
Executable
+31
@@ -0,0 +1,31 @@
|
||||
#ifndef __SDL2RWOPS_H__
|
||||
#define __SDL2RWOPS_H__
|
||||
|
||||
typedef struct SDL2_RWops_s SDL2_RWops_t; // the actual SDL1 SDL_RWops
|
||||
typedef struct x64emu_s x64emu_t;
|
||||
|
||||
typedef SDL2_RWops_t* (*sdl2_allocrw)();
|
||||
typedef void (*sdl2_freerw)(SDL2_RWops_t*);
|
||||
|
||||
typedef struct SDL2RWSave_s {
|
||||
int anyEmu;
|
||||
void* size;
|
||||
void* seek;
|
||||
void* read;
|
||||
void* write;
|
||||
void* close;
|
||||
void* s1;
|
||||
void* s2;
|
||||
} SDL2RWSave_t;
|
||||
|
||||
// each function will be added to dictionary, and each native functions will be wrapped so they run in emulated world
|
||||
SDL2_RWops_t* AddNativeRW2(x64emu_t* emu, SDL2_RWops_t* ops);
|
||||
SDL2_RWops_t* RWNativeStart2(x64emu_t* emu, SDL2_RWops_t* ops); // put Native RW function, wrapping emulated (callback style) ones if needed
|
||||
void RWNativeEnd2(SDL2_RWops_t* ops); // put back emulated function back in place
|
||||
|
||||
int64_t RWNativeSeek2(SDL2_RWops_t *ops, int64_t offset, int32_t whence);
|
||||
uint32_t RWNativeRead2(SDL2_RWops_t* ops, void* ptr, uint32_t size, uint32_t maxnum);
|
||||
int32_t RWNativeWrite2(SDL2_RWops_t *ops, const void *ptr, int32_t size, int32_t num);
|
||||
int32_t RWNativeClose2(SDL2_RWops_t* ops);
|
||||
|
||||
#endif
|
||||
@@ -587,7 +587,7 @@ int getSymbolInMaps(library_t*lib, const char* name, int noweak, uintptr_t *addr
|
||||
printf_log(LOG_NONE, "Warning, function %s not found\n", buff);
|
||||
} else
|
||||
AddOffsetSymbol(lib->context->maplib, symbol, name);
|
||||
*addr = AddBridge(lib->priv.w.bridge, kh_value(lib->mysymbolmap, k), symbol, 0);
|
||||
*addr = AddBridge(lib->priv.w.bridge, kh_value(lib->mysymbolmap, k), symbol, 0, name);
|
||||
*size = sizeof(void*);
|
||||
return 1;
|
||||
}
|
||||
@@ -605,7 +605,7 @@ int getSymbolInMaps(library_t*lib, const char* name, int noweak, uintptr_t *addr
|
||||
printf_log(LOG_NONE, "Warning, function %s not found\n", buff);
|
||||
} else
|
||||
AddOffsetSymbol(lib->context->maplib, symbol, name);
|
||||
*addr = AddBridge(lib->priv.w.bridge, kh_value(lib->stsymbolmap, k), symbol, 4); // all of this for this little "4"
|
||||
*addr = AddBridge(lib->priv.w.bridge, kh_value(lib->stsymbolmap, k), symbol, sizeof(void*), name);
|
||||
*size = sizeof(void*);
|
||||
return 1;
|
||||
}
|
||||
@@ -624,7 +624,7 @@ int getSymbolInMaps(library_t*lib, const char* name, int noweak, uintptr_t *addr
|
||||
return 0;
|
||||
} else
|
||||
AddOffsetSymbol(lib->context->maplib, symbol, name);
|
||||
*addr = AddBridge(lib->priv.w.bridge, kh_value(lib->symbolmap, k), symbol, 0);
|
||||
*addr = AddBridge(lib->priv.w.bridge, kh_value(lib->symbolmap, k), symbol, 0, name);
|
||||
*size = sizeof(void*);
|
||||
return 1;
|
||||
}
|
||||
@@ -643,7 +643,7 @@ int getSymbolInMaps(library_t*lib, const char* name, int noweak, uintptr_t *addr
|
||||
return 0;
|
||||
} else
|
||||
AddOffsetSymbol(lib->context->maplib, symbol, name);
|
||||
*addr = AddBridge(lib->priv.w.bridge, kh_value(lib->wsymbolmap, k), symbol, 0);
|
||||
*addr = AddBridge(lib->priv.w.bridge, kh_value(lib->wsymbolmap, k), symbol, 0, name);
|
||||
*size = sizeof(void*);
|
||||
return 1;
|
||||
}
|
||||
@@ -661,7 +661,7 @@ int getSymbolInMaps(library_t*lib, const char* name, int noweak, uintptr_t *addr
|
||||
return 0;
|
||||
} else
|
||||
AddOffsetSymbol(lib->context->maplib, symbol, name);
|
||||
*addr = AddBridge(lib->priv.w.bridge, kh_value(lib->symbol2map, k).w, symbol, 0);
|
||||
*addr = AddBridge(lib->priv.w.bridge, kh_value(lib->symbol2map, k).w, symbol, 0, name);
|
||||
*size = sizeof(void*);
|
||||
return 1;
|
||||
}
|
||||
|
||||
+36
-36
@@ -5,46 +5,45 @@
|
||||
GO("libc.so.6", libc)
|
||||
GO("libpthread.so.0", libpthread)
|
||||
GO("librt.so.1", librt)
|
||||
//GO("libGL.so.1", libgl)
|
||||
//GO("libGL.so", libgl)
|
||||
//GO("libGLU.so.1", libglu)
|
||||
//GO("libX11.so.6", libx11)
|
||||
//GO("libasound.so.2", libasound)
|
||||
GO("libGL.so.1", libgl)
|
||||
GO("libGL.so", libgl)
|
||||
GO("libGLU.so.1", libglu)
|
||||
GO("libX11.so.6", libx11)
|
||||
GO("libasound.so.2", libasound)
|
||||
GO("libdl.so.2", libdl)
|
||||
GO("libm.so.6", libm)
|
||||
//GO("libSDL2-2.0.so.0", sdl2)
|
||||
//GO("libSDL2-2.0.so.1", sdl2)
|
||||
//GO("libSDL2.so", sdl2)
|
||||
//GO("libsdl2-2.0.so.0", sdl2)
|
||||
//GO("libSDL2_mixer-2.0.so.0", sdl2mixer)
|
||||
//GO("libSDL2_image-2.0.so.0", sdl2image)
|
||||
//GO("libSDL2_ttf-2.0.so.0", sdl2ttf)
|
||||
//GO("libSDL-1.2.so.0", sdl1)
|
||||
//GO("libSDL-1.1.so.0", sdl1)
|
||||
//GO("libSDL_mixer-1.2.so.0", sdl1mixer)
|
||||
//GO("libSDL_image-1.2.so.0", sdl1image)
|
||||
//GO("libSDL_ttf-2.0.so.0", sdl1ttf)
|
||||
//GO("libsmpeg-0.4.so.0", smpeg)
|
||||
//GO("libsmpeg2-2.0.so.0", smpeg2)
|
||||
GO("libSDL2-2.0.so.0", sdl2)
|
||||
GO("libSDL2-2.0.so.1", sdl2)
|
||||
GO("libSDL2.so", sdl2)
|
||||
GO("libsdl2-2.0.so.0", sdl2)
|
||||
GO("libSDL2_mixer-2.0.so.0", sdl2mixer)
|
||||
GO("libSDL2_image-2.0.so.0", sdl2image)
|
||||
GO("libSDL2_ttf-2.0.so.0", sdl2ttf)
|
||||
GO("libSDL-1.2.so.0", sdl1)
|
||||
GO("libSDL_mixer-1.2.so.0", sdl1mixer)
|
||||
GO("libSDL_image-1.2.so.0", sdl1image)
|
||||
GO("libSDL_ttf-2.0.so.0", sdl1ttf)
|
||||
GO("libsmpeg-0.4.so.0", smpeg)
|
||||
GO("libsmpeg2-2.0.so.0", smpeg2)
|
||||
//GO("libvorbisfile.so.3", vorbisfile)
|
||||
//GO("libvorbis.so.0", libvorbis)
|
||||
//GO("libogg.so.0", libogg)
|
||||
//GO("libpng12.so.0", png12)
|
||||
//GO("libpng16.so.16", png16)
|
||||
//GO("libXxf86vm.so.1", libxxf86vm)
|
||||
//GO("libXinerama.so.1", xinerama)
|
||||
//GO("libXrandr.so.2", libxrandr)
|
||||
//GO("libXext.so.6", libxext)
|
||||
GO("libXxf86vm.so.1", libxxf86vm)
|
||||
GO("libXinerama.so.1", xinerama)
|
||||
GO("libXrandr.so.2", libxrandr)
|
||||
GO("libXext.so.6", libxext)
|
||||
//GO("libXfixes.so.3", libxfixes)
|
||||
//GO("libXcursor.so.1", libxcursor)
|
||||
//GO("libXrender.so.1", libxrender)
|
||||
//GO("libXi.so.6", libxi)
|
||||
GO("libXrender.so.1", libxrender)
|
||||
GO("libXi.so.6", libxi)
|
||||
//GO("libXss.so.1", libxss)
|
||||
//GO("libXpm.so.4", libxpm)
|
||||
//GO("libXau.so.6", libxau)
|
||||
//GO("libXdmcp.so.6", libxdmcp)
|
||||
GO("libXau.so.6", libxau)
|
||||
GO("libXdmcp.so.6", libxdmcp)
|
||||
//GO("libX11-xcb.so.1", libx11xcb)
|
||||
//GO("libxcb.so.1", libxcb)
|
||||
GO("libxcb.so.1", libxcb)
|
||||
//GO("libxcb-xfixes.so.0", libxcbxfixes)
|
||||
//GO("libxcb-shape.so.0", libxcbshape)
|
||||
//GO("libxcb-shm.so.0", libxcbshm)
|
||||
@@ -60,12 +59,13 @@ GO("libm.so.6", libm)
|
||||
//GO("libXcomposite.so.1", libxcomposite)
|
||||
//GO("libXdamage.so.1", libxdamage)
|
||||
//GO("libXmu.so.6", libxmu)
|
||||
//GO("libz.so.1", libz)
|
||||
//GO("libopenal.so.1", openal)
|
||||
//GO("libopenal.so.0", openal)
|
||||
//GO("libopenal.so", openal)
|
||||
//GO("openal.so", openal)
|
||||
//GO("libalut.so.0", alut)
|
||||
GO("libz.so.1", libz)
|
||||
GO("libopenal.so.1", openal)
|
||||
GO("libopenal.so.0", openal)
|
||||
GO("libopenal.so", openal)
|
||||
GO("openal.so", openal)
|
||||
GO("libalut.so.0", alut)
|
||||
GO("libalure.so.1", alure)
|
||||
//GO("libjpeg.so.8", libjpeg)
|
||||
//GO("libjpeg.so.62", libjpeg62)
|
||||
//GO("libturbojpeg.so.0", turbojpeg)
|
||||
@@ -82,8 +82,8 @@ GO("libm.so.6", libm)
|
||||
//GO("libutil.so.1", util)
|
||||
//GO("libuuid.so.1", libuuid)
|
||||
//GO("libresolv.so.2", libresolv)
|
||||
//GO("libpulse-simple.so.0", pulsesimple)
|
||||
//GO("libpulse.so.0", pulse)
|
||||
GO("libpulse-simple.so.0", pulsesimple)
|
||||
GO("libpulse.so.0", pulse)
|
||||
//GO("libsndfile.so.1", libsndfile)
|
||||
//GO("libgtk-x11-2.0.so.0", gtkx112)
|
||||
//GO("libgdk-x11-2.0.so.0", gdkx112)
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <wchar.h>
|
||||
#include <sys/epoll.h>
|
||||
#include <fts.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "x64emu.h"
|
||||
#include "emu/x64emu_private.h"
|
||||
@@ -99,7 +100,11 @@ void myStackAlign(x64emu_t* emu, const char* fmt, uint64_t* st, uint64_t* mystac
|
||||
++p;
|
||||
break;
|
||||
case 14: //%LG long double
|
||||
if((((uintptr_t)(st+1))&0xf)!=0)
|
||||
st++;
|
||||
#ifdef HAVE_LD80BITS
|
||||
if((((uintptr_t)mystack)&0xf)!=0)
|
||||
mystack++;
|
||||
memcpy(mystack, st, 16);
|
||||
st+=2; mystack+=2;
|
||||
#else
|
||||
@@ -136,6 +141,100 @@ void myStackAlign(x64emu_t* emu, const char* fmt, uint64_t* st, uint64_t* mystac
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void myStackAlignScanf(x64emu_t* emu, const char* fmt, uint64_t* st, uint64_t* mystack, int pos)
|
||||
{
|
||||
|
||||
if(!fmt)
|
||||
return;
|
||||
// loop...
|
||||
const char* p = fmt;
|
||||
int state = 0;
|
||||
while(*p)
|
||||
{
|
||||
switch(state) {
|
||||
case 0:
|
||||
switch(*p) {
|
||||
case '%': state = 1; ++p; break;
|
||||
default:
|
||||
++p;
|
||||
}
|
||||
break;
|
||||
case 1: // normal
|
||||
case 2: // l
|
||||
case 3: // ll
|
||||
case 4: // L
|
||||
switch(*p) {
|
||||
case '%': state = 0; ++p; break; //%% = back to 0
|
||||
case 'l': ++state; if (state>3) state=3; ++p; break;
|
||||
case 'L': state = 4; ++p; break;
|
||||
case 'a':
|
||||
case 'A':
|
||||
case 'e':
|
||||
case 'E':
|
||||
case 'g':
|
||||
case 'G':
|
||||
case 'F':
|
||||
case 'f': state += 10; break; // float
|
||||
case 'd':
|
||||
case 'i':
|
||||
case 'o':
|
||||
case 'u':
|
||||
case 'x':
|
||||
case 'X': state += 20; break; // int
|
||||
case 'h': ++p; break; // ignored...
|
||||
case '\'':
|
||||
case '0':
|
||||
case '1':
|
||||
case '2':
|
||||
case '3':
|
||||
case '4':
|
||||
case '5':
|
||||
case '6':
|
||||
case '7':
|
||||
case '8':
|
||||
case '9':
|
||||
case '.':
|
||||
case '+':
|
||||
case '-': ++p; break; // formating, ignored
|
||||
case 'm': state = 0; ++p; break; // no argument
|
||||
case 'n':
|
||||
case 'p':
|
||||
case 'S':
|
||||
case 's': state = 30; break; // pointers
|
||||
case '$': ++p; break; // should issue a warning, it's not handled...
|
||||
case '*': *(mystack++) = *(st++); ++p; break; // fetch an int in the stack....
|
||||
case ' ': state=0; ++p; break;
|
||||
default:
|
||||
state=20; // other stuff, put an int...
|
||||
}
|
||||
break;
|
||||
case 11: //double
|
||||
case 12: //%lg, still double
|
||||
case 13: //%llg, still double
|
||||
case 14: //%LG long double
|
||||
case 20: // fallback
|
||||
case 21:
|
||||
case 22:
|
||||
case 23: // 64bits int
|
||||
case 24: // normal int / pointer
|
||||
case 30:
|
||||
if(pos<6)
|
||||
*mystack = emu->regs[regs_abi[pos++]].q[0];
|
||||
else {
|
||||
*mystack = *st;
|
||||
++st;
|
||||
}
|
||||
++mystack;
|
||||
state = 0;
|
||||
++p;
|
||||
break;
|
||||
default:
|
||||
// whattt?
|
||||
state = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
#if 0
|
||||
void myStackAlignGVariantNew(const char* fmt, uint32_t* st, uint32_t* mystack)
|
||||
{
|
||||
@@ -430,3 +529,47 @@ void myStackAlignW(const char* fmt, uint32_t* st, uint32_t* mystack)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#undef st_atime
|
||||
#undef st_mtime
|
||||
#undef st_ctime
|
||||
|
||||
struct x64_stat64 { /* x86_64 arm64 */
|
||||
uint64_t st_dev; /* 0 */ /* 0 */
|
||||
uint64_t st_ino; /* 8 */ /* 8 */
|
||||
uint64_t st_nlink; /* 16 */ /* 20 */
|
||||
uint32_t st_mode; /* 24 */ /* 16 */
|
||||
uint32_t st_uid; /* 28 */ /* 24 */
|
||||
uint32_t st_gid; /* 32 */ /* 28 */
|
||||
int __pad0; /* 36 */ /* --- */
|
||||
uint64_t st_rdev; /* 40 */ /* 32 */
|
||||
int64_t st_size; /* 48 */ /* 48 */
|
||||
int64_t st_blksize; /* 56 */ /* 56 */
|
||||
uint64_t st_blocks; /* 64 */ /* 64 */
|
||||
struct timespec st_atim; /* 72 */ /* 72 */
|
||||
struct timespec st_mtim; /* 88 */ /* 88 */
|
||||
struct timespec st_ctim; /* 104 */ /* 104 */
|
||||
uint64_t __glibc_reserved[3]; /* 120 */ /* 120 */
|
||||
} __attribute__((packed)); /* 144 */ /* 128 */
|
||||
|
||||
void UnalignStat64(const void* source, void* dest)
|
||||
{
|
||||
struct x64_stat64 *x64st = (struct x64_stat64*)dest;
|
||||
struct stat *st = (struct stat*) source;
|
||||
|
||||
x64st->__pad0 = 0;
|
||||
memset(x64st->__glibc_reserved, 0, sizeof(x64st->__glibc_reserved));
|
||||
x64st->st_dev = st->st_dev;
|
||||
x64st->st_ino = st->st_ino;
|
||||
x64st->st_mode = st->st_mode;
|
||||
x64st->st_nlink = st->st_nlink;
|
||||
x64st->st_uid = st->st_uid;
|
||||
x64st->st_gid = st->st_gid;
|
||||
x64st->st_rdev = st->st_rdev;
|
||||
x64st->st_size = st->st_size;
|
||||
x64st->st_blksize = st->st_blksize;
|
||||
x64st->st_blocks = st->st_blocks;
|
||||
x64st->st_atim = st->st_atim;
|
||||
x64st->st_mtim = st->st_mtim;
|
||||
x64st->st_ctim = st->st_ctim;
|
||||
}
|
||||
Executable
+182
@@ -0,0 +1,182 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "sdl1rwops.h"
|
||||
#include "debug.h"
|
||||
#include "wrapper.h"
|
||||
#include "box64context.h"
|
||||
#include "x64run.h"
|
||||
#include "x64emu.h"
|
||||
#include "emu/x64emu_private.h"
|
||||
#include "librarian/library_private.h"
|
||||
#include "bridge.h"
|
||||
#include "callback.h"
|
||||
|
||||
typedef struct SDL1_RWops_s SDL1_RWops_t;
|
||||
|
||||
typedef int32_t (*sdl1_seek)(SDL1_RWops_t *context, int32_t offset, int32_t whence);
|
||||
typedef int32_t (*sdl1_read)(SDL1_RWops_t *context, void *ptr, int32_t size, int32_t maxnum);
|
||||
typedef int32_t (*sdl1_write)(SDL1_RWops_t *context, const void *ptr, int32_t size, int32_t num);
|
||||
typedef int32_t (*sdl1_close)(SDL1_RWops_t *context);
|
||||
|
||||
#define BOX64RW 0xBECF4572 // random signature value
|
||||
|
||||
typedef struct SDL1_RWops_s {
|
||||
sdl1_seek seek;
|
||||
sdl1_read read;
|
||||
sdl1_write write;
|
||||
|
||||
sdl1_close close;
|
||||
|
||||
uint32_t type;
|
||||
union {
|
||||
struct {
|
||||
int autoclose;
|
||||
FILE *fp;
|
||||
} stdio;
|
||||
struct {
|
||||
uint8_t *base;
|
||||
uint8_t *here;
|
||||
uint8_t *stop;
|
||||
} mem;
|
||||
struct {
|
||||
void *data1;
|
||||
} unknown;
|
||||
struct {
|
||||
SDL1_RWops_t *orig;
|
||||
sdl1_freerw custom_free;
|
||||
} my;
|
||||
} hidden;
|
||||
} SDL1_RWops_t;
|
||||
|
||||
|
||||
EXPORT int32_t my_native_seek(SDL1_RWops_t *context, int32_t offset, int32_t whence)
|
||||
{
|
||||
return context->hidden.my.orig->seek(context->hidden.my.orig, offset, whence);
|
||||
}
|
||||
EXPORT int32_t my_native_read(SDL1_RWops_t *context, void *ptr, int32_t size, int32_t maxnum)
|
||||
{
|
||||
return context->hidden.my.orig->read(context->hidden.my.orig, ptr, size, maxnum);
|
||||
}
|
||||
EXPORT int32_t my_native_write(SDL1_RWops_t *context, const void *ptr, int32_t size, int32_t num)
|
||||
{
|
||||
return context->hidden.my.orig->write(context->hidden.my.orig, ptr, size, num);
|
||||
}
|
||||
EXPORT int32_t my_native_close(SDL1_RWops_t *context)
|
||||
{
|
||||
int32_t ret = context->hidden.my.orig->close(context->hidden.my.orig);
|
||||
context->hidden.my.custom_free(context);
|
||||
return ret;
|
||||
}
|
||||
EXPORT int32_t my_emulated_seek(SDL1_RWops_t *context, int32_t offset, int32_t whence)
|
||||
{
|
||||
return (int32_t)RunFunction(my_context, (uintptr_t)context->hidden.my.orig->seek, 3, context->hidden.my.orig, offset, whence);
|
||||
}
|
||||
EXPORT int32_t my_emulated_read(SDL1_RWops_t *context, void *ptr, int32_t size, int32_t maxnum)
|
||||
{
|
||||
return (int32_t)RunFunction(my_context, (uintptr_t)context->hidden.my.orig->read, 4, context->hidden.my.orig, ptr, size, maxnum);
|
||||
}
|
||||
|
||||
EXPORT int32_t my_emulated_write(SDL1_RWops_t *context, const void *ptr, int32_t size, int32_t num)
|
||||
{
|
||||
return (int32_t)RunFunction(my_context, (uintptr_t)context->hidden.my.orig->write, 4, context->hidden.my.orig, ptr, size, num);
|
||||
}
|
||||
EXPORT int32_t my_emulated_close(SDL1_RWops_t *context)
|
||||
{
|
||||
return (int32_t)RunFunction(my_context, (uintptr_t)context->hidden.my.orig->close, 1, context->hidden.my.orig);
|
||||
}
|
||||
|
||||
SDL1_RWops_t* AddNativeRW(x64emu_t* emu, SDL1_RWops_t* ops)
|
||||
{
|
||||
if(!ops)
|
||||
return NULL;
|
||||
|
||||
uintptr_t fnc;
|
||||
bridge_t* system = emu->context->system;
|
||||
|
||||
sdl1_allocrw Alloc = (sdl1_allocrw)emu->context->sdl1allocrw;
|
||||
sdl1_freerw Free = (sdl1_freerw)emu->context->sdl1freerw;
|
||||
|
||||
SDL1_RWops_t* newrw = Alloc();
|
||||
newrw->type = BOX64RW;
|
||||
newrw->hidden.my.orig = ops;
|
||||
newrw->hidden.my.custom_free = Free;
|
||||
|
||||
// get or create wrapper, add it to map and change to the emulated one if rw
|
||||
#define GO(A, W) \
|
||||
fnc = AddCheckBridge(system, W, my_native_##A, 0, NULL); \
|
||||
newrw->A = (sdl1_##A)fnc;
|
||||
|
||||
GO(seek, iFpii)
|
||||
GO(read, iFppii)
|
||||
GO(write, iFppii)
|
||||
GO(close, iFp)
|
||||
|
||||
#undef GO
|
||||
|
||||
return newrw;
|
||||
}
|
||||
|
||||
// put Native RW function, wrapping emulated (callback style) ones if needed
|
||||
SDL1_RWops_t* RWNativeStart(x64emu_t* emu, SDL1_RWops_t* ops)
|
||||
{
|
||||
if(!ops)
|
||||
return NULL;
|
||||
if(ops->type == BOX64RW)
|
||||
return ops->hidden.my.orig;
|
||||
|
||||
sdl1_allocrw Alloc = (sdl1_allocrw)emu->context->sdl1allocrw;
|
||||
|
||||
SDL1_RWops_t* newrw = Alloc();
|
||||
newrw->type = BOX64RW;
|
||||
newrw->hidden.my.orig = ops;
|
||||
// create wrapper
|
||||
#define GO(A, W) \
|
||||
newrw->A = my_emulated_##A;
|
||||
|
||||
GO(seek, iFpii)
|
||||
GO(read, iFppii)
|
||||
GO(write, iFppii)
|
||||
GO(close, iFp)
|
||||
|
||||
#undef GO
|
||||
|
||||
return newrw;
|
||||
}
|
||||
|
||||
// put back emulated function back in place
|
||||
void RWNativeEnd(SDL1_RWops_t* ops)
|
||||
{
|
||||
if(!ops)
|
||||
return;
|
||||
|
||||
if(ops->type != BOX64RW)
|
||||
return; // do nothing
|
||||
|
||||
ops->hidden.my.custom_free(ops);
|
||||
}
|
||||
|
||||
int32_t RWNativeSeek(SDL1_RWops_t *ops, int32_t offset, int32_t whence)
|
||||
{
|
||||
return ops->seek(ops, offset, whence);
|
||||
}
|
||||
uint32_t RWNativeRead(SDL1_RWops_t* ops, void* ptr, uint32_t size, uint32_t maxnum)
|
||||
{
|
||||
return ops->read(ops, ptr, size, maxnum);
|
||||
}
|
||||
int32_t RWNativeWrite(SDL1_RWops_t *ops, const void *ptr, int32_t size, int32_t num)
|
||||
{
|
||||
return ops->write(ops, ptr, size, num);
|
||||
}
|
||||
int32_t RWNativeClose(SDL1_RWops_t* ops)
|
||||
{
|
||||
return ops->close(ops);
|
||||
}
|
||||
|
||||
void RWSetType(SDL1_RWops_t* r, int awesome)
|
||||
{
|
||||
if(r)
|
||||
r->type = awesome; // I like shoot'em up :D
|
||||
}
|
||||
Executable
+185
@@ -0,0 +1,185 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "sdl2rwops.h"
|
||||
#include "debug.h"
|
||||
#include "wrapper.h"
|
||||
#include "box64context.h"
|
||||
#include "x64run.h"
|
||||
#include "x64emu.h"
|
||||
#include "emu/x64emu_private.h"
|
||||
#include "librarian/library_private.h"
|
||||
#include "bridge.h"
|
||||
#include "callback.h"
|
||||
|
||||
typedef struct SDL2_RWops_s SDL2_RWops_t;
|
||||
|
||||
typedef int64_t (*sdl2_size)(SDL2_RWops_t *context);
|
||||
typedef int64_t (*sdl2_seek)(SDL2_RWops_t *context, int64_t offset, int32_t whence);
|
||||
typedef int32_t (*sdl2_read)(SDL2_RWops_t *context, void *ptr, int32_t size, int32_t maxnum);
|
||||
typedef int32_t (*sdl2_write)(SDL2_RWops_t *context, const void *ptr, int32_t size, int32_t num);
|
||||
typedef int32_t (*sdl2_close)(SDL2_RWops_t *context);
|
||||
|
||||
#define BOX64RW 0x79 // random signature value
|
||||
|
||||
typedef struct SDL2_RWops_s {
|
||||
sdl2_size size;
|
||||
sdl2_seek seek;
|
||||
sdl2_read read;
|
||||
sdl2_write write;
|
||||
|
||||
sdl2_close close;
|
||||
|
||||
uint32_t type;
|
||||
union {
|
||||
struct {
|
||||
int autoclose;
|
||||
FILE *fp;
|
||||
} stdio;
|
||||
struct {
|
||||
uint8_t *base;
|
||||
uint8_t *here;
|
||||
uint8_t *stop;
|
||||
} mem;
|
||||
struct {
|
||||
void *data1;
|
||||
} unknown;
|
||||
struct {
|
||||
SDL2_RWops_t *orig;
|
||||
sdl2_freerw custom_free;
|
||||
} my;
|
||||
} hidden;
|
||||
} SDL2_RWops_t;
|
||||
|
||||
EXPORT int64_t my2_native_size(SDL2_RWops_t *context)
|
||||
{
|
||||
return context->hidden.my.orig->size(context->hidden.my.orig);
|
||||
}
|
||||
EXPORT int64_t my2_native_seek(SDL2_RWops_t *context, int64_t offset, int32_t whence)
|
||||
{
|
||||
return context->hidden.my.orig->seek(context->hidden.my.orig, offset, whence);
|
||||
}
|
||||
EXPORT int32_t my2_native_read(SDL2_RWops_t *context, void *ptr, int32_t size, int32_t maxnum)
|
||||
{
|
||||
return context->hidden.my.orig->read(context->hidden.my.orig, ptr, size, maxnum);
|
||||
}
|
||||
EXPORT int32_t my2_native_write(SDL2_RWops_t *context, const void *ptr, int32_t size, int32_t num)
|
||||
{
|
||||
return context->hidden.my.orig->write(context->hidden.my.orig, ptr, size, num);
|
||||
}
|
||||
EXPORT int32_t my2_native_close(SDL2_RWops_t *context)
|
||||
{
|
||||
int32_t ret = context->hidden.my.orig->close(context->hidden.my.orig);
|
||||
context->hidden.my.custom_free(context);
|
||||
return ret;
|
||||
}
|
||||
EXPORT int64_t my2_emulated_size(SDL2_RWops_t *context)
|
||||
{
|
||||
return (int64_t)RunFunction(my_context, (uintptr_t)context->hidden.my.orig->size, 1, context->hidden.my.orig);
|
||||
}
|
||||
EXPORT int64_t my2_emulated_seek(SDL2_RWops_t *context, int64_t offset, int32_t whence)
|
||||
{
|
||||
return (int64_t)RunFunction(my_context, (uintptr_t)context->hidden.my.orig->seek, 3, context->hidden.my.orig, offset, whence);
|
||||
}
|
||||
EXPORT int32_t my2_emulated_read(SDL2_RWops_t *context, void *ptr, int32_t size, int32_t maxnum)
|
||||
{
|
||||
return (int32_t)RunFunction(my_context, (uintptr_t)context->hidden.my.orig->read, 4, context->hidden.my.orig, ptr, size, maxnum);
|
||||
}
|
||||
EXPORT int32_t my2_emulated_write(SDL2_RWops_t *context, const void *ptr, int32_t size, int32_t num)
|
||||
{
|
||||
return (int32_t)RunFunction(my_context, (uintptr_t)context->hidden.my.orig->write, 4, context->hidden.my.orig, ptr, size, num);
|
||||
}
|
||||
EXPORT int32_t my2_emulated_close(SDL2_RWops_t *context)
|
||||
{
|
||||
return (int32_t)RunFunction(my_context, (uintptr_t)context->hidden.my.orig->close, 1, context->hidden.my.orig);
|
||||
}
|
||||
|
||||
SDL2_RWops_t* AddNativeRW2(x64emu_t* emu, SDL2_RWops_t* ops)
|
||||
{
|
||||
if(!ops)
|
||||
return NULL;
|
||||
uintptr_t fnc;
|
||||
bridge_t* system = emu->context->system;
|
||||
|
||||
sdl2_allocrw Alloc = (sdl2_allocrw)emu->context->sdl2allocrw;
|
||||
sdl2_freerw Free = (sdl2_freerw)emu->context->sdl2freerw;
|
||||
|
||||
SDL2_RWops_t* newrw = Alloc();
|
||||
newrw->type = BOX64RW;
|
||||
newrw->hidden.my.orig = ops;
|
||||
newrw->hidden.my.custom_free = Free;
|
||||
|
||||
// get or create wrapper, add it to map and change to the emulated one if rw
|
||||
#define GO(A, W) \
|
||||
fnc = AddCheckBridge(system, W, my2_native_##A, 0, NULL); \
|
||||
newrw->A = (sdl2_##A)fnc;
|
||||
|
||||
GO(size, IFp)
|
||||
GO(seek, IFpIi)
|
||||
GO(read, iFppii)
|
||||
GO(write, iFppii)
|
||||
GO(close, iFp)
|
||||
|
||||
#undef GO
|
||||
|
||||
return newrw;
|
||||
}
|
||||
|
||||
// put Native RW function, wrapping emulated (callback style) ones if needed
|
||||
SDL2_RWops_t* RWNativeStart2(x64emu_t* emu, SDL2_RWops_t* ops)
|
||||
{
|
||||
if(!ops)
|
||||
return NULL;
|
||||
|
||||
if(ops->type == BOX64RW)
|
||||
return ops->hidden.my.orig;
|
||||
|
||||
sdl2_allocrw Alloc = (sdl2_allocrw)emu->context->sdl2allocrw;
|
||||
|
||||
SDL2_RWops_t* newrw = Alloc();
|
||||
newrw->type = BOX64RW;
|
||||
newrw->hidden.my.orig = ops;
|
||||
newrw->hidden.my.custom_free = (sdl2_freerw)emu->context->sdl2freerw;
|
||||
|
||||
// create wrapper
|
||||
#define GO(A, W) \
|
||||
newrw->A = my2_emulated_##A;
|
||||
|
||||
GO(size, IFp)
|
||||
GO(seek, IFpIi)
|
||||
GO(read, iFppii)
|
||||
GO(write, iFppii)
|
||||
GO(close, iFp)
|
||||
|
||||
#undef GO
|
||||
|
||||
return newrw;
|
||||
}
|
||||
|
||||
void RWNativeEnd2(SDL2_RWops_t* ops)
|
||||
{
|
||||
|
||||
if(!ops || ops->type != BOX64RW)
|
||||
return; // do nothing
|
||||
|
||||
ops->hidden.my.custom_free(ops);
|
||||
}
|
||||
|
||||
int64_t RWNativeSeek2(SDL2_RWops_t *ops, int64_t offset, int32_t whence)
|
||||
{
|
||||
return ops->seek(ops, offset, whence);
|
||||
}
|
||||
uint32_t RWNativeRead2(SDL2_RWops_t* ops, void* ptr, uint32_t size, uint32_t maxnum)
|
||||
{
|
||||
return ops->read(ops, ptr, size, maxnum);
|
||||
}
|
||||
int32_t RWNativeWrite2(SDL2_RWops_t *ops, const void *ptr, int32_t size, int32_t num)
|
||||
{
|
||||
return ops->write(ops, ptr, size, num);
|
||||
}
|
||||
int32_t RWNativeClose2(SDL2_RWops_t* ops)
|
||||
{
|
||||
return ops->close(ops);
|
||||
}
|
||||
@@ -445,7 +445,7 @@ void my_sigactionhandler_oldcode(int32_t sig, siginfo_t* info, void * ucntx, int
|
||||
uintptr_t restorer = my_context->restorer[sig];
|
||||
// get that actual ESP first!
|
||||
x64emu_t *emu = thread_get_emu();
|
||||
uint64_t *frame = (uint64_t*)R_RSP;
|
||||
uintptr_t *frame = (uintptr_t*)R_RSP;
|
||||
#if defined(DYNAREC) && defined(__arm__)
|
||||
ucontext_t *p = (ucontext_t *)ucntx;
|
||||
void * pc = (void*)p->uc_mcontext.arm_pc;
|
||||
@@ -460,9 +460,9 @@ void my_sigactionhandler_oldcode(int32_t sig, siginfo_t* info, void * ucntx, int
|
||||
int used_stack = 0;
|
||||
if(new_ss) {
|
||||
if(new_ss->ss_flags == SS_ONSTACK) { // already using it!
|
||||
frame = (uint64_t*)sigemu->regs[_SP].q[0];
|
||||
frame = (uintptr_t*)sigemu->regs[_SP].q[0];
|
||||
} else {
|
||||
frame = (uint64_t*)(((uintptr_t)new_ss->ss_sp + new_ss->ss_size - 16) & ~0x0f);
|
||||
frame = (uintptr_t*)(((uintptr_t)new_ss->ss_sp + new_ss->ss_size - 16) & ~0x0f);
|
||||
used_stack = 1;
|
||||
new_ss->ss_flags = SS_ONSTACK;
|
||||
}
|
||||
@@ -471,7 +471,7 @@ void my_sigactionhandler_oldcode(int32_t sig, siginfo_t* info, void * ucntx, int
|
||||
// TODO: do I need to really setup 2 stack frame? That doesn't seems right!
|
||||
// setup stack frame
|
||||
// try to fill some sigcontext....
|
||||
frame -= sizeof(x64_ucontext_t);
|
||||
frame -= sizeof(x64_ucontext_t)/sizeof(uintptr_t);
|
||||
x64_ucontext_t *sigcontext = (x64_ucontext_t*)frame;
|
||||
// get general register
|
||||
sigcontext->uc_mcontext.gregs[X64_R8] = R_R8;
|
||||
@@ -898,7 +898,7 @@ int EXPORT my_syscall_rt_sigaction(x64emu_t* emu, int signum, const x64_sigactio
|
||||
struct kernel_sigaction newact = {0};
|
||||
struct kernel_sigaction old = {0};
|
||||
if(act) {
|
||||
printf_log(LOG_DEBUG, " New (kernel) action flags=0x%x mask=0x%x\n", act->sa_flags, *(uint32_t*)&act->sa_mask);
|
||||
printf_log(LOG_DEBUG, " New (kernel) action flags=0x%x mask=0x%lx\n", act->sa_flags, *(uint64_t*)&act->sa_mask);
|
||||
memcpy(&newact.sa_mask, &act->sa_mask, (sigsetsize>16)?16:sigsetsize);
|
||||
newact.sa_flags = act->sa_flags&~0x04000000; // No sa_restorer...
|
||||
if(act->sa_flags&0x04) {
|
||||
|
||||
@@ -258,6 +258,14 @@ EXPORT int my_pthread_attr_setstack(x64emu_t* emu, void* attr, void* stackaddr,
|
||||
return pthread_attr_setstacksize(attr, stacksize);
|
||||
}
|
||||
|
||||
EXPORT int my_pthread_attr_setstacksize(x64emu_t* emu, void* attr, size_t stacksize)
|
||||
{
|
||||
//aarch64 have an PTHREAD_STACK_MIN of 131072 instead of 16384 on x86_64!
|
||||
if(stacksize<PTHREAD_STACK_MIN)
|
||||
stacksize = PTHREAD_STACK_MIN;
|
||||
return pthread_attr_setstacksize(attr, stacksize);
|
||||
}
|
||||
|
||||
EXPORT int my_pthread_create(x64emu_t *emu, void* t, void* attr, void* start_routine, void* arg)
|
||||
{
|
||||
int stacksize = 2*1024*1024; //default stack size is 2Mo
|
||||
@@ -667,8 +675,6 @@ static kh_mutex_t* unaligned_mutex = NULL;
|
||||
|
||||
pthread_mutex_t* getAlignedMutex(pthread_mutex_t* m)
|
||||
{
|
||||
if(!(((uintptr_t)m)&3))
|
||||
return m;
|
||||
khint_t k = kh_get(mutex, unaligned_mutex, (uintptr_t)m);
|
||||
if(k!=kh_end(unaligned_mutex))
|
||||
return kh_value(unaligned_mutex, k);
|
||||
@@ -680,8 +686,6 @@ pthread_mutex_t* getAlignedMutex(pthread_mutex_t* m)
|
||||
}
|
||||
EXPORT int my_pthread_mutex_destroy(pthread_mutex_t *m)
|
||||
{
|
||||
if(!(((uintptr_t)m)&3))
|
||||
return pthread_mutex_destroy(m);
|
||||
khint_t k = kh_get(mutex, unaligned_mutex, (uintptr_t)m);
|
||||
if(k!=kh_end(unaligned_mutex)) {
|
||||
pthread_mutex_t *n = kh_value(unaligned_mutex, k);
|
||||
|
||||
+2
-2
@@ -25,9 +25,9 @@
|
||||
#include "x64run.h"
|
||||
|
||||
box64context_t *my_context = NULL;
|
||||
int box64_log = LOG_NONE;
|
||||
int box64_log = LOG_INFO; //LOG_NONE;
|
||||
int box64_nobanner = 0;
|
||||
int box64_dynarec_log = LOG_INFO; //LOG_NONE;
|
||||
int box64_dynarec_log = LOG_NONE;
|
||||
int box64_pagesize;
|
||||
int box64_dynarec = 0;
|
||||
int dlsym_error = 0;
|
||||
|
||||
+57
-4
@@ -70,7 +70,11 @@ void FreeBridge(bridge_t** bridge)
|
||||
*bridge = NULL;
|
||||
}
|
||||
|
||||
uintptr_t AddBridge(bridge_t* bridge, wrapper_t w, void* fnc, int N)
|
||||
#ifdef HAVE_TRACE
|
||||
void addBridgeName(void* addr, const char* name);
|
||||
#endif
|
||||
|
||||
uintptr_t AddBridge(bridge_t* bridge, wrapper_t w, void* fnc, int N, const char* name)
|
||||
{
|
||||
pthread_mutex_lock(&bridge->mutex);
|
||||
brick_t *b = bridge->last;
|
||||
@@ -103,6 +107,10 @@ uintptr_t AddBridge(bridge_t* bridge, wrapper_t w, void* fnc, int N)
|
||||
khint_t k = kh_put(bridgemap, bridge->bridgemap, (uintptr_t)fnc, &ret);
|
||||
kh_value(bridge->bridgemap, k) = (uintptr_t)&b->b[b->sz].CC;
|
||||
pthread_mutex_unlock(&bridge->mutex);
|
||||
#ifdef HAVE_TRACE
|
||||
if(name)
|
||||
addBridgeName(fnc, name);
|
||||
#endif
|
||||
|
||||
return (uintptr_t)&b->b[b->sz++].CC;
|
||||
}
|
||||
@@ -116,13 +124,13 @@ uintptr_t CheckBridged(bridge_t* bridge, void* fnc)
|
||||
return kh_value(bridge->bridgemap, k);
|
||||
}
|
||||
|
||||
uintptr_t AddCheckBridge(bridge_t* bridge, wrapper_t w, void* fnc, int N)
|
||||
uintptr_t AddCheckBridge(bridge_t* bridge, wrapper_t w, void* fnc, int N, const char* name)
|
||||
{
|
||||
if(!fnc && w)
|
||||
return 0;
|
||||
uintptr_t ret = CheckBridged(bridge, fnc);
|
||||
if(!ret)
|
||||
ret = AddBridge(bridge, w, fnc, N);
|
||||
ret = AddBridge(bridge, w, fnc, N, name);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -132,7 +140,7 @@ uintptr_t AddAutomaticBridge(x64emu_t* emu, bridge_t* bridge, wrapper_t w, void*
|
||||
return 0;
|
||||
uintptr_t ret = CheckBridged(bridge, fnc);
|
||||
if(!ret)
|
||||
ret = AddBridge(bridge, w, fnc, N);
|
||||
ret = AddBridge(bridge, w, fnc, N, NULL);
|
||||
if(!hasAlternate(fnc)) {
|
||||
printf_log(LOG_DEBUG, "Adding AutomaticBridge for %p to %p\n", fnc, (void*)ret);
|
||||
addAlternate(fnc, (void*)ret);
|
||||
@@ -180,6 +188,36 @@ void* GetNativeFncOrFnc(uintptr_t fnc)
|
||||
return (void*)b->f;
|
||||
}
|
||||
|
||||
#ifdef HAVE_TRACE
|
||||
KHASH_MAP_INIT_INT64(bridgename, const char*)
|
||||
static kh_bridgename_t *bridgename;
|
||||
void initBridgeName()
|
||||
{
|
||||
bridgename = kh_init(bridgename);
|
||||
}
|
||||
void finiBridgeName()
|
||||
{
|
||||
kh_destroy(bridgename, bridgename);
|
||||
bridgename = NULL;
|
||||
}
|
||||
void addBridgeName(void* addr, const char* name)
|
||||
{
|
||||
int ret;
|
||||
khint_t k = kh_put(bridgename, bridgename, (uintptr_t)addr, &ret);
|
||||
if(!ret) // already there
|
||||
return;
|
||||
kh_value(bridgename, k) = name;
|
||||
}
|
||||
const char* getBridgeName(void* addr)
|
||||
{
|
||||
khint_t k = kh_get(bridgename, bridgename, (uintptr_t)addr);
|
||||
if(k!=kh_end(bridgename))
|
||||
return kh_value(bridgename, k);
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
// Alternate address handling
|
||||
KHASH_MAP_INIT_INT64(alternate, void*)
|
||||
static kh_alternate_t *my_alternates = NULL;
|
||||
@@ -218,3 +256,18 @@ void cleanAlternate() {
|
||||
my_alternates = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void init_bridge_helper()
|
||||
{
|
||||
#ifdef HAVE_TRACE
|
||||
initBridgeName();
|
||||
#endif
|
||||
}
|
||||
|
||||
void fini_bridge_helper()
|
||||
{
|
||||
cleanAlternate();
|
||||
#ifdef HAVE_TRACE
|
||||
finiBridgeName();
|
||||
#endif
|
||||
}
|
||||
@@ -1,7 +1,17 @@
|
||||
#() vFE
|
||||
#() vFv
|
||||
#() vFi
|
||||
#() vFu
|
||||
#() vFf
|
||||
#() vFd
|
||||
#() vFp
|
||||
#() vFS
|
||||
#() cFv
|
||||
#() cFi
|
||||
#() cFu
|
||||
#() cFf
|
||||
#() cFp
|
||||
#() wFp
|
||||
#() iFE
|
||||
#() iFv
|
||||
#() iFi
|
||||
@@ -10,77 +20,919 @@
|
||||
#() iFd
|
||||
#() iFL
|
||||
#() iFp
|
||||
#() iFS
|
||||
#() IFf
|
||||
#() IFd
|
||||
#() IFp
|
||||
#() WFi
|
||||
#() WFp
|
||||
#() uFv
|
||||
#() uFi
|
||||
#() uFu
|
||||
#() uFd
|
||||
#() uFp
|
||||
#() UFv
|
||||
#() UFp
|
||||
#() UFV
|
||||
#() fFi
|
||||
#() fFf
|
||||
#() fFp
|
||||
#() dFi
|
||||
#() dFu
|
||||
#() dFd
|
||||
#() dFp
|
||||
#() lFE
|
||||
#() lFi
|
||||
#() lFp
|
||||
#() LFv
|
||||
#() LFL
|
||||
#() LFp
|
||||
#() pFE
|
||||
#() pFv
|
||||
#() pFi
|
||||
#() pFu
|
||||
#() pFL
|
||||
#() pFp
|
||||
#() HFi
|
||||
#() HFp
|
||||
#() vFEp
|
||||
#() vFii
|
||||
#() vFiu
|
||||
#() vFif
|
||||
#() vFid
|
||||
#() vFip
|
||||
#() vFWW
|
||||
#() vFui
|
||||
#() vFuu
|
||||
#() vFuf
|
||||
#() vFud
|
||||
#() vFup
|
||||
#() vFfi
|
||||
#() vFff
|
||||
#() vFfp
|
||||
#() vFdd
|
||||
#() vFpi
|
||||
#() vFpu
|
||||
#() vFpf
|
||||
#() vFpL
|
||||
#() vFpp
|
||||
#() vFpS
|
||||
#() vFSi
|
||||
#() cFpp
|
||||
#() iFEp
|
||||
#() iFii
|
||||
#() iFiu
|
||||
#() iFip
|
||||
#() iFIi
|
||||
#() iFui
|
||||
#() iFuu
|
||||
#() iFup
|
||||
#() iFUU
|
||||
#() iFli
|
||||
#() iFLL
|
||||
#() iFLp
|
||||
#() iFpw
|
||||
#() iFpi
|
||||
#() iFpI
|
||||
#() iFpC
|
||||
#() iFpu
|
||||
#() iFpf
|
||||
#() iFpd
|
||||
#() iFpl
|
||||
#() iFpL
|
||||
#() iFpp
|
||||
#() iFpO
|
||||
#() iFSi
|
||||
#() IFEp
|
||||
#() IFpu
|
||||
#() CFui
|
||||
#() CFpi
|
||||
#() CFpu
|
||||
#() uFEp
|
||||
#() uFiu
|
||||
#() uFui
|
||||
#() uFuu
|
||||
#() uFup
|
||||
#() uFUp
|
||||
#() uFpi
|
||||
#() uFpu
|
||||
#() uFpU
|
||||
#() uFpp
|
||||
#() UFEp
|
||||
#() UFUp
|
||||
#() UFpp
|
||||
#() fFif
|
||||
#() fFfi
|
||||
#() fFff
|
||||
#() fFfp
|
||||
#() fFpp
|
||||
#() dFid
|
||||
#() dFdi
|
||||
#() dFdd
|
||||
#() dFdp
|
||||
#() dFpp
|
||||
#() LFpi
|
||||
#() LFpL
|
||||
#() LFpp
|
||||
#() pFEp
|
||||
#() pFii
|
||||
#() pFip
|
||||
#() pFui
|
||||
#() pFuu
|
||||
#() pFup
|
||||
#() pFlp
|
||||
#() pFLL
|
||||
#() pFpi
|
||||
#() pFpC
|
||||
#() pFpu
|
||||
#() pFpU
|
||||
#() pFpL
|
||||
#() pFpp
|
||||
#() pFpV
|
||||
#() pFSi
|
||||
#() HFpi
|
||||
#() vFEpi
|
||||
#() vFEpu
|
||||
#() vFEpp
|
||||
#() vFEpV
|
||||
#() vFiii
|
||||
#() vFiip
|
||||
#() vFiui
|
||||
#() vFiuu
|
||||
#() vFiup
|
||||
#() vFiff
|
||||
#() vFidd
|
||||
#() vFipi
|
||||
#() vFipu
|
||||
#() vFipp
|
||||
#() vFuii
|
||||
#() vFuiI
|
||||
#() vFuiu
|
||||
#() vFuif
|
||||
#() vFuid
|
||||
#() vFuip
|
||||
#() vFuui
|
||||
#() vFuuu
|
||||
#() vFuuf
|
||||
#() vFuud
|
||||
#() vFuup
|
||||
#() vFuff
|
||||
#() vFudd
|
||||
#() vFupi
|
||||
#() vFfff
|
||||
#() vFfpp
|
||||
#() vFddd
|
||||
#() vFdpp
|
||||
#() vFLpp
|
||||
#() vFpii
|
||||
#() vFpiu
|
||||
#() vFpif
|
||||
#() vFpid
|
||||
#() vFpip
|
||||
#() vFpui
|
||||
#() vFpuI
|
||||
#() vFpuu
|
||||
#() vFpup
|
||||
#() vFppi
|
||||
#() vFppu
|
||||
#() vFppp
|
||||
#() iFEiw
|
||||
#() iFEip
|
||||
#() iFEWW
|
||||
#() iFEup
|
||||
#() iFEpi
|
||||
#() iFEpL
|
||||
#() iFEpp
|
||||
#() iFEpV
|
||||
#() iFESp
|
||||
#() iFiwC
|
||||
#() iFiii
|
||||
#() iFiiu
|
||||
#() iFiip
|
||||
#() iFiuu
|
||||
#() iFiLN
|
||||
#() iFipu
|
||||
#() iFipp
|
||||
#() iFuuu
|
||||
#() iFuup
|
||||
#() iFuff
|
||||
#() iFfff
|
||||
#() iFLip
|
||||
#() iFLpp
|
||||
#() iFpii
|
||||
#() iFpiu
|
||||
#() iFpiL
|
||||
#() iFpip
|
||||
#() iFpIi
|
||||
#() iFpui
|
||||
#() iFpuu
|
||||
#() iFpuU
|
||||
#() iFpuL
|
||||
#() iFpup
|
||||
#() iFpfu
|
||||
#() iFpff
|
||||
#() iFpli
|
||||
#() iFplp
|
||||
#() iFpLp
|
||||
#() iFppi
|
||||
#() iFppI
|
||||
#() iFppu
|
||||
#() iFppd
|
||||
#() iFppL
|
||||
#() iFppp
|
||||
#() iFppV
|
||||
#() iFSpL
|
||||
#() IFiIi
|
||||
#() IFpIi
|
||||
#() IFppi
|
||||
#() IFSIi
|
||||
#() uFEpW
|
||||
#() uFEpu
|
||||
#() uFEpU
|
||||
#() uFipu
|
||||
#() uFuip
|
||||
#() uFuui
|
||||
#() uFuuu
|
||||
#() uFuup
|
||||
#() uFupu
|
||||
#() uFupp
|
||||
#() uFpiu
|
||||
#() uFpip
|
||||
#() uFpLp
|
||||
#() uFppi
|
||||
#() uFppu
|
||||
#() UFppi
|
||||
#() fFuii
|
||||
#() fFfff
|
||||
#() fFffp
|
||||
#() dFddd
|
||||
#() dFddp
|
||||
#() dFppi
|
||||
#() dFppp
|
||||
#() lFipi
|
||||
#() lFipL
|
||||
#() lFlpi
|
||||
#() lFppi
|
||||
#() lFSpl
|
||||
#() LFLLi
|
||||
#() LFLLI
|
||||
#() LFLpu
|
||||
#() LFLpL
|
||||
#() LFpii
|
||||
#() LFppi
|
||||
#() LFSpL
|
||||
#() pFEip
|
||||
#() pFEpi
|
||||
#() pFEpp
|
||||
#() pFipi
|
||||
#() pFipp
|
||||
#() pFIpi
|
||||
#() pFuii
|
||||
#() pFupi
|
||||
#() pFUpi
|
||||
#() pFpii
|
||||
#() pFpiu
|
||||
#() pFpiL
|
||||
#() pFpip
|
||||
#() pFpCC
|
||||
#() pFpui
|
||||
#() pFpuu
|
||||
#() pFpuL
|
||||
#() pFpup
|
||||
#() pFpUp
|
||||
#() pFplp
|
||||
#() pFpLu
|
||||
#() pFpLL
|
||||
#() pFpLp
|
||||
#() pFppi
|
||||
#() pFppu
|
||||
#() pFppf
|
||||
#() pFppL
|
||||
#() pFppp
|
||||
#() pFpOM
|
||||
#() pFSpl
|
||||
#() vFEipV
|
||||
#() vFEpip
|
||||
#() vFEpup
|
||||
#() vFEppp
|
||||
#() vFiiii
|
||||
#() vFiiip
|
||||
#() vFiuip
|
||||
#() vFiuuu
|
||||
#() vFiupu
|
||||
#() vFiupV
|
||||
#() vFifff
|
||||
#() vFiddd
|
||||
#() vFipii
|
||||
#() vFipup
|
||||
#() vFippp
|
||||
#() vFuiii
|
||||
#() vFuiip
|
||||
#() vFuiui
|
||||
#() vFuiuu
|
||||
#() vFuiup
|
||||
#() vFuifi
|
||||
#() vFuiff
|
||||
#() vFuidd
|
||||
#() vFuipi
|
||||
#() vFuipu
|
||||
#() vFuipp
|
||||
#() vFuuii
|
||||
#() vFuuiu
|
||||
#() vFuuip
|
||||
#() vFuuui
|
||||
#() vFuuuu
|
||||
#() vFuuuf
|
||||
#() vFuuud
|
||||
#() vFuuup
|
||||
#() vFuupi
|
||||
#() vFuupp
|
||||
#() vFufff
|
||||
#() vFuddd
|
||||
#() vFupii
|
||||
#() vFuppi
|
||||
#() vFffff
|
||||
#() vFdddd
|
||||
#() vFpiii
|
||||
#() vFpiip
|
||||
#() vFpipp
|
||||
#() vFpupp
|
||||
#() vFpdii
|
||||
#() vFpddd
|
||||
#() vFppii
|
||||
#() vFppip
|
||||
#() vFppui
|
||||
#() vFppup
|
||||
#() vFpppi
|
||||
#() vFpppu
|
||||
#() vFpppp
|
||||
#() cFpiii
|
||||
#() iFEiip
|
||||
#() iFEiiN
|
||||
#() iFEipp
|
||||
#() iFEipV
|
||||
#() iFEupp
|
||||
#() iFEpip
|
||||
#() iFEppi
|
||||
#() iFEppL
|
||||
#() iFEppp
|
||||
#() iFEppV
|
||||
#() iFEpOu
|
||||
#() iFiiii
|
||||
#() iFiiiu
|
||||
#() iFiuii
|
||||
#() iFipii
|
||||
#() iFippi
|
||||
#() iFippp
|
||||
#() iFuipp
|
||||
#() iFuuff
|
||||
#() iFuppp
|
||||
#() iFpiii
|
||||
#() iFpiiu
|
||||
#() iFpiid
|
||||
#() iFpiiL
|
||||
#() iFpiip
|
||||
#() iFpiup
|
||||
#() iFpipi
|
||||
#() iFpipp
|
||||
#() iFpCCC
|
||||
#() iFpWWu
|
||||
#() iFpuip
|
||||
#() iFpuui
|
||||
#() iFpuuu
|
||||
#() iFpuup
|
||||
#() iFpuLL
|
||||
#() iFpuLp
|
||||
#() iFpupV
|
||||
#() iFppii
|
||||
#() iFppiu
|
||||
#() iFppiL
|
||||
#() iFppip
|
||||
#() iFppuw
|
||||
#() iFppui
|
||||
#() iFppuu
|
||||
#() iFppup
|
||||
#() iFpplp
|
||||
#() iFppLp
|
||||
#() iFpppi
|
||||
#() iFpppu
|
||||
#() iFpppL
|
||||
#() iFpppp
|
||||
#() IFEpIi
|
||||
#() IFSIii
|
||||
#() uFifff
|
||||
#() uFuuuu
|
||||
#() uFpipp
|
||||
#() uFpCCC
|
||||
#() uFpuip
|
||||
#() uFpuuu
|
||||
#() uFpppi
|
||||
#() UFpipp
|
||||
#() lFipiI
|
||||
#() lFipLI
|
||||
#() lFipLl
|
||||
#() LFpuuu
|
||||
#() LFpLLp
|
||||
#() LFpLpp
|
||||
#() LFppii
|
||||
#() pFEipp
|
||||
#() pFEupp
|
||||
#() pFEpii
|
||||
#() pFEpip
|
||||
#() pFEppi
|
||||
#() pFEppL
|
||||
#() pFEppp
|
||||
#() pFiiiu
|
||||
#() pFiiup
|
||||
#() pFippL
|
||||
#() pFuiii
|
||||
#() pFpiii
|
||||
#() pFpiip
|
||||
#() pFpiLL
|
||||
#() pFpipi
|
||||
#() pFpipp
|
||||
#() pFpCWp
|
||||
#() pFpCuW
|
||||
#() pFpCuu
|
||||
#() pFpuii
|
||||
#() pFpuWp
|
||||
#() pFpuuu
|
||||
#() pFpuup
|
||||
#() pFpupi
|
||||
#() pFplpp
|
||||
#() pFppii
|
||||
#() pFppiL
|
||||
#() pFppip
|
||||
#() pFppuu
|
||||
#() pFppuL
|
||||
#() pFppup
|
||||
#() pFppLL
|
||||
#() pFpppi
|
||||
#() pFpppu
|
||||
#() pFpppL
|
||||
#() pFpppp
|
||||
#() pFSppi
|
||||
#() vFEpuup
|
||||
#() vFEpLLp
|
||||
#() vFEpppp
|
||||
#() vFiiiii
|
||||
#() vFiiiiu
|
||||
#() vFiiuup
|
||||
#() vFiipii
|
||||
#() vFiuiip
|
||||
#() vFiuipi
|
||||
#() vFiuuuu
|
||||
#() vFiffff
|
||||
#() vFidddd
|
||||
#() vFilill
|
||||
#() vFipipu
|
||||
#() vFipipp
|
||||
#() vFipupi
|
||||
#() vFuiiii
|
||||
#() vFuiiiu
|
||||
#() vFuiiip
|
||||
#() vFuiiup
|
||||
#() vFuiIII
|
||||
#() vFuiuii
|
||||
#() vFuiuiu
|
||||
#() vFuiuip
|
||||
#() vFuiuuu
|
||||
#() vFuiuup
|
||||
#() vFuiupi
|
||||
#() vFuiupu
|
||||
#() vFuifff
|
||||
#() vFuiddd
|
||||
#() vFuipii
|
||||
#() vFuipip
|
||||
#() vFuipup
|
||||
#() vFuippp
|
||||
#() vFuuiii
|
||||
#() vFuuiui
|
||||
#() vFuuiuu
|
||||
#() vFuuiup
|
||||
#() vFuuipi
|
||||
#() vFuuipu
|
||||
#() vFuuipp
|
||||
#() vFuuuii
|
||||
#() vFuuuiu
|
||||
#() vFuuuip
|
||||
#() vFuuuui
|
||||
#() vFuuuuu
|
||||
#() vFuuuup
|
||||
#() vFuupii
|
||||
#() vFuffff
|
||||
#() vFudddd
|
||||
#() vFupupi
|
||||
#() vFuppip
|
||||
#() vFupppp
|
||||
#() vFfffff
|
||||
#() vFddddp
|
||||
#() vFpiiii
|
||||
#() vFpipii
|
||||
#() vFpuipp
|
||||
#() vFpddii
|
||||
#() vFppiii
|
||||
#() vFppiip
|
||||
#() vFppWui
|
||||
#() vFpppii
|
||||
#() vFppppi
|
||||
#() vFppppp
|
||||
#() iFEippp
|
||||
#() iFEpipi
|
||||
#() iFEpipp
|
||||
#() iFEpipV
|
||||
#() iFEpLpp
|
||||
#() iFEpLpV
|
||||
#() iFEppip
|
||||
#() iFEppiV
|
||||
#() iFEpppp
|
||||
#() iFEpppV
|
||||
#() iFiiupp
|
||||
#() iFipiii
|
||||
#() iFipppi
|
||||
#() iFipppp
|
||||
#() iFpiiii
|
||||
#() iFpiiip
|
||||
#() iFpiiuu
|
||||
#() iFpiipi
|
||||
#() iFpiipp
|
||||
#() iFpipii
|
||||
#() iFpippi
|
||||
#() iFpippp
|
||||
#() iFpCCCC
|
||||
#() iFpuuui
|
||||
#() iFpuuLL
|
||||
#() iFpuupp
|
||||
#() iFppiip
|
||||
#() iFppiup
|
||||
#() iFppipi
|
||||
#() iFppipp
|
||||
#() iFppupi
|
||||
#() iFpppii
|
||||
#() iFpppiL
|
||||
#() iFpppip
|
||||
#() iFpppLi
|
||||
#() iFppppi
|
||||
#() iFppppp
|
||||
#() IFppIII
|
||||
#() uFEppuu
|
||||
#() uFiuuuu
|
||||
#() uFuiiiu
|
||||
#() uFpCCCC
|
||||
#() uFpuuuu
|
||||
#() uFppiip
|
||||
#() uFppppp
|
||||
#() LFLpppp
|
||||
#() LFpLLLp
|
||||
#() LFpLppL
|
||||
#() LFppppp
|
||||
#() pFEpiii
|
||||
#() pFEpipL
|
||||
#() pFEpipp
|
||||
#() pFEpupp
|
||||
#() pFEppii
|
||||
#() pFEppip
|
||||
#() pFEpppp
|
||||
#() pFuiiiu
|
||||
#() pFuiipp
|
||||
#() pFpiiuu
|
||||
#() pFpiipp
|
||||
#() pFpippp
|
||||
#() pFpCuup
|
||||
#() pFpCppp
|
||||
#() pFpuiii
|
||||
#() pFpuiip
|
||||
#() pFpuWWW
|
||||
#() pFpuuWW
|
||||
#() pFpuuup
|
||||
#() pFppipi
|
||||
#() pFppipp
|
||||
#() pFppuuu
|
||||
#() pFppuup
|
||||
#() pFppLLp
|
||||
#() pFpppip
|
||||
#() pFpppuu
|
||||
#() pFpppup
|
||||
#() pFppppi
|
||||
#() pFppppp
|
||||
#() vFEiiipp
|
||||
#() vFEpLLpp
|
||||
#() vFiiiiii
|
||||
#() vFiiiuil
|
||||
#() vFiuippp
|
||||
#() vFiffiff
|
||||
#() vFiddidd
|
||||
#() vFuiiiii
|
||||
#() vFuiiiip
|
||||
#() vFuiiuii
|
||||
#() vFuiiuup
|
||||
#() vFuiuiii
|
||||
#() vFuiuiip
|
||||
#() vFuiuiuu
|
||||
#() vFuiuuip
|
||||
#() vFuiuuuu
|
||||
#() vFuiupii
|
||||
#() vFuiupiu
|
||||
#() vFuiffff
|
||||
#() vFuidddd
|
||||
#() vFuipiup
|
||||
#() vFuuiiii
|
||||
#() vFuuiuii
|
||||
#() vFuuiuiu
|
||||
#() vFuuiuup
|
||||
#() vFuuippp
|
||||
#() vFuuuiup
|
||||
#() vFuuuipi
|
||||
#() vFuuuipp
|
||||
#() vFuuuuii
|
||||
#() vFuuuuip
|
||||
#() vFuuuuuu
|
||||
#() vFuuuuff
|
||||
#() vFuuuppi
|
||||
#() vFuuuppp
|
||||
#() vFuuffff
|
||||
#() vFuudddd
|
||||
#() vFuffiip
|
||||
#() vFufffff
|
||||
#() vFuddiip
|
||||
#() vFupupip
|
||||
#() vFuppppp
|
||||
#() vFffffff
|
||||
#() vFdddddd
|
||||
#() vFpipipV
|
||||
#() vFpipppi
|
||||
#() vFpdddii
|
||||
#() vFppiiii
|
||||
#() vFppiipi
|
||||
#() vFppupii
|
||||
#() vFpppppp
|
||||
#() iFEiippi
|
||||
#() iFEpilpV
|
||||
#() iFEpippi
|
||||
#() iFEpuppp
|
||||
#() iFEppppp
|
||||
#() iFiiiiii
|
||||
#() iFiiiiip
|
||||
#() iFiuiipi
|
||||
#() iFuppipp
|
||||
#() iFuppppp
|
||||
#() iFpiiiii
|
||||
#() iFpiiipp
|
||||
#() iFpiippp
|
||||
#() iFpipppp
|
||||
#() iFpupuui
|
||||
#() iFppiiuu
|
||||
#() iFppIppp
|
||||
#() iFppuiii
|
||||
#() iFppuiiL
|
||||
#() iFppuIII
|
||||
#() iFppuupp
|
||||
#() iFppupip
|
||||
#() iFpppiuu
|
||||
#() iFpppipi
|
||||
#() iFpppipp
|
||||
#() iFppppii
|
||||
#() iFpppppi
|
||||
#() iFpppppL
|
||||
#() iFpppppp
|
||||
#() uFpippup
|
||||
#() UFpippup
|
||||
#() LFSpLiip
|
||||
#() pFEpippp
|
||||
#() pFEpuipp
|
||||
#() pFEpuupp
|
||||
#() pFEpuppp
|
||||
#() pFEppppp
|
||||
#() pFiCiiCi
|
||||
#() pFpiiiiu
|
||||
#() pFpippip
|
||||
#() pFpCuuCC
|
||||
#() pFpCuuWW
|
||||
#() pFpCuuup
|
||||
#() pFpuuuuu
|
||||
#() pFppiiii
|
||||
#() pFpppppp
|
||||
#() pFSpiiii
|
||||
#() vFiiiiiip
|
||||
#() vFiiiiuup
|
||||
#() vFiiupuip
|
||||
#() vFiiffffp
|
||||
#() vFiupuuup
|
||||
#() vFuiiiiii
|
||||
#() vFuiiiuip
|
||||
#() vFuiiiuup
|
||||
#() vFuiuiiii
|
||||
#() vFuiuiiip
|
||||
#() vFuiuiiuu
|
||||
#() vFuiupiiu
|
||||
#() vFuipiiii
|
||||
#() vFuipffff
|
||||
#() vFuipdddd
|
||||
#() vFuuiiiii
|
||||
#() vFuuiiiip
|
||||
#() vFuuiiiui
|
||||
#() vFuuiiiuu
|
||||
#() vFuuiiuup
|
||||
#() vFuuiuiii
|
||||
#() vFuuipppp
|
||||
#() vFuuuiiii
|
||||
#() vFuuuiiip
|
||||
#() vFuuuiuii
|
||||
#() vFuuuiupi
|
||||
#() vFuuuuiip
|
||||
#() vFuuuuuuu
|
||||
#() vFuuuufff
|
||||
#() vFuuuffff
|
||||
#() vFuuudddd
|
||||
#() vFuuffiip
|
||||
#() vFuuddiip
|
||||
#() vFuffffff
|
||||
#() vFudddddd
|
||||
#() vFpipipii
|
||||
#() vFpddiidd
|
||||
#() vFppiiipi
|
||||
#() vFpppiiii
|
||||
#() vFppppipi
|
||||
#() iFEpLiLpV
|
||||
#() iFEppLpIi
|
||||
#() iFEpppiiu
|
||||
#() iFEpppppp
|
||||
#() iFiiiiiip
|
||||
#() iFpiiuuiu
|
||||
#() iFpiupiii
|
||||
#() iFpuuiuui
|
||||
#() iFpupuuui
|
||||
#() iFpuppppp
|
||||
#() iFppiiuui
|
||||
#() iFppiipii
|
||||
#() iFppipipi
|
||||
#() iFppipppp
|
||||
#() iFpppiiii
|
||||
#() iFpppiiuu
|
||||
#() iFpppiipi
|
||||
#() iFpppiuwu
|
||||
#() iFppppiii
|
||||
#() iFppppdpi
|
||||
#() iFppppppp
|
||||
#() uFuippppp
|
||||
#() pFEppppip
|
||||
#() pFifffppp
|
||||
#() pFuupupup
|
||||
#() pFpCuwwWW
|
||||
#() pFpCuWCCC
|
||||
#() pFpCuuwwp
|
||||
#() pFpCuuuuu
|
||||
#() pFppuuppp
|
||||
#() pFppppuuu
|
||||
#() pFpppppuu
|
||||
#() pFppppppp
|
||||
#() vFiiiiuuip
|
||||
#() vFiupuiuup
|
||||
#() vFiupuuuup
|
||||
#() vFuiiiiiii
|
||||
#() vFuiiiiuup
|
||||
#() vFuiiipiup
|
||||
#() vFuiuiiiii
|
||||
#() vFuiuiiiip
|
||||
#() vFuuiiiiii
|
||||
#() vFuuiiiuip
|
||||
#() vFuuiiiuup
|
||||
#() vFuuiiuupp
|
||||
#() vFuuiuiiii
|
||||
#() vFuuiuiiip
|
||||
#() vFuuuiiiii
|
||||
#() vFuuuiuiii
|
||||
#() vFuuuipipp
|
||||
#() vFuuuuuuuu
|
||||
#() vFuuuuufff
|
||||
#() vFffffffff
|
||||
#() vFpippiiuu
|
||||
#() vFpippiipi
|
||||
#() vFppiiipii
|
||||
#() vFppppiipi
|
||||
#() iFEpippppp
|
||||
#() iFiiiiiiip
|
||||
#() iFiiupiupi
|
||||
#() iFuiifpppp
|
||||
#() iFpiiiiipi
|
||||
#() iFpuuiiiii
|
||||
#() iFpupppppp
|
||||
#() iFppIIIppp
|
||||
#() iFpppiippp
|
||||
#() iFpppipipi
|
||||
#() iFpppipppp
|
||||
#() iFppppiipi
|
||||
#() iFpppppppp
|
||||
#() uFuipppppp
|
||||
#() pFuiiiuuuu
|
||||
#() pFuupupipp
|
||||
#() pFpCuwwWWu
|
||||
#() pFpCuuuCup
|
||||
#() pFpppuuLLu
|
||||
#() vFuiiiiiiii
|
||||
#() vFuiiiiiuip
|
||||
#() vFuiiiiiuup
|
||||
#() vFuiuiiiiip
|
||||
#() vFuiupuffup
|
||||
#() vFuuiiiiiii
|
||||
#() vFuuiuiiiii
|
||||
#() vFuuiuiiiip
|
||||
#() vFuuiuiiuup
|
||||
#() vFuuuiiiiip
|
||||
#() vFuuuuuuuuu
|
||||
#() vFuupiuiuuf
|
||||
#() vFuffffffff
|
||||
#() vFffuuuufff
|
||||
#() vFddddddddd
|
||||
#() vFpipppiipi
|
||||
#() vFppiiipiii
|
||||
#() vFpppppippp
|
||||
#() iFEpiiiiipi
|
||||
#() iFiiiiiiiip
|
||||
#() iFiiiipiiip
|
||||
#() iFdddpppppp
|
||||
#() iFpipLpiiip
|
||||
#() iFppiuiippL
|
||||
#() iFpppiiuuii
|
||||
#() iFpppiipiiu
|
||||
#() iFppppppppp
|
||||
#() pFEppiiuuLi
|
||||
#() pFEppuippuu
|
||||
#() pFpiiiiuuuu
|
||||
#() pFpCuWCCuuu
|
||||
#() pFpuuwwWWww
|
||||
#() pFppiiuuuLL
|
||||
#() pFppipppppp
|
||||
#() vFiiiiiiiiiu
|
||||
#() vFuiiiiiiiii
|
||||
#() vFuiiiiiiuup
|
||||
#() vFuiuiiiiuup
|
||||
#() vFuuiiiiiiii
|
||||
#() vFuuiiiiiuip
|
||||
#() vFuuiiiiiuup
|
||||
#() vFuuiuiiiiip
|
||||
#() vFuuiuiiiuup
|
||||
#() vFuuuuuuuiii
|
||||
#() vFuuuuuuuuuu
|
||||
#() vFuupiiupuuf
|
||||
#() vFuffiiffiip
|
||||
#() vFuddiiddiip
|
||||
#() vFffffffffff
|
||||
#() iFiiiiiiiiip
|
||||
#() iFpuupiuiipp
|
||||
#() iFppuuiiiiii
|
||||
#() iFppuuiiuupi
|
||||
#() iFppppiiuuii
|
||||
#() pFpCuWCCuuCW
|
||||
#() pFpuuuwwwwWW
|
||||
#() pFppuiipuuii
|
||||
#() pFpppppppppp
|
||||
#() vFuiiiiiiiiip
|
||||
#() vFuiiiiiiiuip
|
||||
#() vFuiiiiiiiuup
|
||||
#() vFuiuiiiiiuup
|
||||
#() vFuuiuiiiiuup
|
||||
#() vFuuuuuuuuuuu
|
||||
#() vFuuffiiffiip
|
||||
#() vFuufffffffff
|
||||
#() vFuuddiiddiip
|
||||
#() vFuffffffffff
|
||||
#() vFpipipiipiii
|
||||
#() vFpipppiiiipi
|
||||
#() iFEppppiiiiuu
|
||||
#() iFiiiiiiiiiip
|
||||
#() iFpipllippppp
|
||||
#() iFppppiiuuiiL
|
||||
#() pFEppuiipuuii
|
||||
#() vFuuiiiiiiiuip
|
||||
#() vFuuiiiiiiiuup
|
||||
#() vFuuuuuuuuuuuu
|
||||
#() vFffffffffffff
|
||||
#() vFpipppiiiipii
|
||||
#() vFpippppiiiipi
|
||||
#() iFEppppiiiiuui
|
||||
#() iFpipppppppppp
|
||||
#() iFpppllipppppp
|
||||
#() iFpppppppppppp
|
||||
#() pFEppiiuuuipii
|
||||
#() pFpCuuWWwwCCup
|
||||
#() pFpuuuWWWWWWWW
|
||||
#() pFppiiuuuiupLp
|
||||
#() vFuiiiiiiiiiuup
|
||||
#() vFuuuuuuuuuuuuu
|
||||
#() vFuffffffffffff
|
||||
#() iFddddpppddpppp
|
||||
#() iFpippuuuiipppp
|
||||
#() iFpupiiiipppppp
|
||||
#() pFpCuuwwWWWWuup
|
||||
#() pFppppppppppppp
|
||||
#() vFuffiiffiiffiip
|
||||
#() vFuddiiddiiddiip
|
||||
#() vFuuiiiiuuiiiiiii
|
||||
#() vFfffffffffffffff
|
||||
#() pFpppppppppppppppp
|
||||
#() vFppuiiiiipuiiiiiiii
|
||||
#() pFipppppppppppppppppppppp
|
||||
#defined(HAVE_LD80BITS) DFD
|
||||
#defined(HAVE_LD80BITS) DFDD
|
||||
#defined(HAVE_LD80BITS) DFDp
|
||||
@@ -88,4 +940,11 @@
|
||||
#!defined(HAVE_LD80BITS) KFKK
|
||||
#!defined(HAVE_LD80BITS) KFKp
|
||||
#() iFEv -> iFE
|
||||
#() lFEv -> lFE
|
||||
#() pFEv -> pFE
|
||||
#() pFppv -> pFpp
|
||||
#() iFEvpp -> iFEpp
|
||||
#() iFEpvpp -> iFEppp
|
||||
#() iFEpvvppp -> iFEpppp
|
||||
#() iFEpLvvpp -> iFEpLpp
|
||||
#() iFEpuvvppp -> iFEpuppp
|
||||
+1711
-38
File diff suppressed because it is too large.
Load diff
@@ -24,16 +24,24 @@ typedef void (*wrapper_t)(x64emu_t* emu, uintptr_t fnc);
|
||||
// O = libc O_ flags bitfield
|
||||
// S = _IO_2_1_stdXXX_ pointer (or FILE*)
|
||||
// Q = ...
|
||||
// 2 = struct of 2 uint
|
||||
// P = Vulkan struture pointer
|
||||
// G = a single GValue pointer
|
||||
// N = ... automatically sending 1 arg
|
||||
// M = ... automatically sending 2 args
|
||||
// H = Huge 128bits value/struct
|
||||
|
||||
void vFE(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFv(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFi(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFf(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFd(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFp(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFS(x64emu_t *emu, uintptr_t fnc);
|
||||
void cFv(x64emu_t *emu, uintptr_t fnc);
|
||||
void cFi(x64emu_t *emu, uintptr_t fnc);
|
||||
void cFu(x64emu_t *emu, uintptr_t fnc);
|
||||
void cFf(x64emu_t *emu, uintptr_t fnc);
|
||||
void cFp(x64emu_t *emu, uintptr_t fnc);
|
||||
void wFp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFE(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFv(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFi(x64emu_t *emu, uintptr_t fnc);
|
||||
@@ -42,77 +50,919 @@ void iFf(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFd(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFL(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFS(x64emu_t *emu, uintptr_t fnc);
|
||||
void IFf(x64emu_t *emu, uintptr_t fnc);
|
||||
void IFd(x64emu_t *emu, uintptr_t fnc);
|
||||
void IFp(x64emu_t *emu, uintptr_t fnc);
|
||||
void WFi(x64emu_t *emu, uintptr_t fnc);
|
||||
void WFp(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFv(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFi(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFu(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFd(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFp(x64emu_t *emu, uintptr_t fnc);
|
||||
void UFv(x64emu_t *emu, uintptr_t fnc);
|
||||
void UFp(x64emu_t *emu, uintptr_t fnc);
|
||||
void UFV(x64emu_t *emu, uintptr_t fnc);
|
||||
void fFi(x64emu_t *emu, uintptr_t fnc);
|
||||
void fFf(x64emu_t *emu, uintptr_t fnc);
|
||||
void fFp(x64emu_t *emu, uintptr_t fnc);
|
||||
void dFi(x64emu_t *emu, uintptr_t fnc);
|
||||
void dFu(x64emu_t *emu, uintptr_t fnc);
|
||||
void dFd(x64emu_t *emu, uintptr_t fnc);
|
||||
void dFp(x64emu_t *emu, uintptr_t fnc);
|
||||
void lFE(x64emu_t *emu, uintptr_t fnc);
|
||||
void lFi(x64emu_t *emu, uintptr_t fnc);
|
||||
void lFp(x64emu_t *emu, uintptr_t fnc);
|
||||
void LFv(x64emu_t *emu, uintptr_t fnc);
|
||||
void LFL(x64emu_t *emu, uintptr_t fnc);
|
||||
void LFp(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFE(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFv(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFi(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFu(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFL(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFp(x64emu_t *emu, uintptr_t fnc);
|
||||
void HFi(x64emu_t *emu, uintptr_t fnc);
|
||||
void HFp(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFEp(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFiu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFif(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFid(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFWW(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFui(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuf(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFud(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFup(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFfi(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFff(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFfp(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFdd(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFpi(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFpu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFpf(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFpL(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFpp(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFpS(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFSi(x64emu_t *emu, uintptr_t fnc);
|
||||
void cFpp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFii(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFiu(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFip(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFIi(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFui(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFup(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFUU(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFli(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFLL(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFLp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpw(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpi(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpI(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpC(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpu(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpf(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpd(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpl(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpL(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpO(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFSi(x64emu_t *emu, uintptr_t fnc);
|
||||
void IFEp(x64emu_t *emu, uintptr_t fnc);
|
||||
void IFpu(x64emu_t *emu, uintptr_t fnc);
|
||||
void CFui(x64emu_t *emu, uintptr_t fnc);
|
||||
void CFpi(x64emu_t *emu, uintptr_t fnc);
|
||||
void CFpu(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFEp(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFiu(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFui(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFup(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFUp(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFpi(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFpu(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFpU(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFpp(x64emu_t *emu, uintptr_t fnc);
|
||||
void UFEp(x64emu_t *emu, uintptr_t fnc);
|
||||
void UFUp(x64emu_t *emu, uintptr_t fnc);
|
||||
void UFpp(x64emu_t *emu, uintptr_t fnc);
|
||||
void fFif(x64emu_t *emu, uintptr_t fnc);
|
||||
void fFfi(x64emu_t *emu, uintptr_t fnc);
|
||||
void fFff(x64emu_t *emu, uintptr_t fnc);
|
||||
void fFfp(x64emu_t *emu, uintptr_t fnc);
|
||||
void fFpp(x64emu_t *emu, uintptr_t fnc);
|
||||
void dFid(x64emu_t *emu, uintptr_t fnc);
|
||||
void dFdi(x64emu_t *emu, uintptr_t fnc);
|
||||
void dFdd(x64emu_t *emu, uintptr_t fnc);
|
||||
void dFdp(x64emu_t *emu, uintptr_t fnc);
|
||||
void dFpp(x64emu_t *emu, uintptr_t fnc);
|
||||
void LFpi(x64emu_t *emu, uintptr_t fnc);
|
||||
void LFpL(x64emu_t *emu, uintptr_t fnc);
|
||||
void LFpp(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFEp(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFii(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFip(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFui(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFup(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFlp(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFLL(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpi(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpC(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpu(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpU(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpL(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpp(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpV(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFSi(x64emu_t *emu, uintptr_t fnc);
|
||||
void HFpi(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFEpi(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFEpu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFEpp(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFEpV(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFiui(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFiuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFiup(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFiff(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFidd(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFipi(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFipu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFipp(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiI(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuif(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuid(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuui(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuf(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuud(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuup(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuff(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFudd(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFupi(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFfff(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFfpp(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFddd(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFdpp(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFLpp(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFpii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFpiu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFpif(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFpid(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFpip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFpui(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFpuI(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFpuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFpup(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFppi(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFppu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEiw(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEip(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEWW(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEup(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEpi(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEpL(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEpp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEpV(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFESp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFiwC(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFiiu(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFiuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFiLN(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFipu(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFipp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFuuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFuup(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFuff(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFfff(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFLip(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFLpp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpii(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpiu(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpiL(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpip(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpIi(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpui(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpuU(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpuL(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpup(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpfu(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpff(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpli(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFplp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpLp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFppi(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFppI(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFppu(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFppd(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFppL(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFppV(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFSpL(x64emu_t *emu, uintptr_t fnc);
|
||||
void IFiIi(x64emu_t *emu, uintptr_t fnc);
|
||||
void IFpIi(x64emu_t *emu, uintptr_t fnc);
|
||||
void IFppi(x64emu_t *emu, uintptr_t fnc);
|
||||
void IFSIi(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFEpW(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFEpu(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFEpU(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFipu(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFuip(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFuui(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFuuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFuup(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFupu(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFupp(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFpiu(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFpip(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFpLp(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFppi(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFppu(x64emu_t *emu, uintptr_t fnc);
|
||||
void UFppi(x64emu_t *emu, uintptr_t fnc);
|
||||
void fFuii(x64emu_t *emu, uintptr_t fnc);
|
||||
void fFfff(x64emu_t *emu, uintptr_t fnc);
|
||||
void fFffp(x64emu_t *emu, uintptr_t fnc);
|
||||
void dFddd(x64emu_t *emu, uintptr_t fnc);
|
||||
void dFddp(x64emu_t *emu, uintptr_t fnc);
|
||||
void dFppi(x64emu_t *emu, uintptr_t fnc);
|
||||
void dFppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void lFipi(x64emu_t *emu, uintptr_t fnc);
|
||||
void lFipL(x64emu_t *emu, uintptr_t fnc);
|
||||
void lFlpi(x64emu_t *emu, uintptr_t fnc);
|
||||
void lFppi(x64emu_t *emu, uintptr_t fnc);
|
||||
void lFSpl(x64emu_t *emu, uintptr_t fnc);
|
||||
void LFLLi(x64emu_t *emu, uintptr_t fnc);
|
||||
void LFLLI(x64emu_t *emu, uintptr_t fnc);
|
||||
void LFLpu(x64emu_t *emu, uintptr_t fnc);
|
||||
void LFLpL(x64emu_t *emu, uintptr_t fnc);
|
||||
void LFpii(x64emu_t *emu, uintptr_t fnc);
|
||||
void LFppi(x64emu_t *emu, uintptr_t fnc);
|
||||
void LFSpL(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFEip(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFEpi(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFEpp(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFipi(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFipp(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFIpi(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFuii(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFupi(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFUpi(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpii(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpiu(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpiL(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpip(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpCC(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpui(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpuL(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpup(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpUp(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFplp(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpLu(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpLL(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpLp(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFppi(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFppu(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFppf(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFppL(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpOM(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFSpl(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFEipV(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFEpip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFEpup(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFEppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFiiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFiiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFiuip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFiuuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFiupu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFiupV(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFifff(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFiddd(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFipii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFipup(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFippp(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiui(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiup(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuifi(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiff(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuidd(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuipi(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuipu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuipp(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuiu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuui(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuuf(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuud(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuup(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuupi(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuupp(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFufff(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuddd(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFupii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuppi(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFffff(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFdddd(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFpiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFpiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFpipp(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFpupp(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFpdii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFpddd(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFppii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFppip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFppui(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFppup(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFpppi(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFpppu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFpppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void cFpiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEiiN(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEipp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEipV(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEupp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEpip(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEppi(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEppL(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEppV(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEpOu(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFiiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFiiiu(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFiuii(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFipii(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFippi(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFippp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFuipp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFuuff(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFuppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpiiu(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpiid(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpiiL(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpiup(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpipi(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpipp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpCCC(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpWWu(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpuip(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpuui(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpuuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpuup(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpuLL(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpuLp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpupV(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFppii(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFppiu(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFppiL(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFppip(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFppuw(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFppui(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFppuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFppup(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpplp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFppLp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpppi(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpppu(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpppL(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void IFEpIi(x64emu_t *emu, uintptr_t fnc);
|
||||
void IFSIii(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFifff(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFuuuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFpipp(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFpCCC(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFpuip(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFpuuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFpppi(x64emu_t *emu, uintptr_t fnc);
|
||||
void UFpipp(x64emu_t *emu, uintptr_t fnc);
|
||||
void lFipiI(x64emu_t *emu, uintptr_t fnc);
|
||||
void lFipLI(x64emu_t *emu, uintptr_t fnc);
|
||||
void lFipLl(x64emu_t *emu, uintptr_t fnc);
|
||||
void LFpuuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void LFpLLp(x64emu_t *emu, uintptr_t fnc);
|
||||
void LFpLpp(x64emu_t *emu, uintptr_t fnc);
|
||||
void LFppii(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFEipp(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFEupp(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFEpii(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFEpip(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFEppi(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFEppL(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFEppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFiiiu(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFiiup(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFippL(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFuiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpiLL(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpipi(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpipp(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpCWp(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpCuW(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpCuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpuii(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpuWp(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpuuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpuup(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpupi(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFplpp(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFppii(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFppiL(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFppip(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFppuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFppuL(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFppup(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFppLL(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpppi(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpppu(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpppL(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFSppi(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFEpuup(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFEpLLp(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFEpppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFiiiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFiiiiu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFiiuup(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFiipii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFiuiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFiuipi(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFiuuuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFiffff(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFidddd(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFilill(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFipipu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFipipp(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFipupi(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiiiu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiiup(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiIII(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiuii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiuiu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiuip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiuuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiuup(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiupi(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiupu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuifff(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiddd(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuipii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuipip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuipup(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuippp(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuiui(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuiuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuiup(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuipi(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuipu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuipp(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuuii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuuiu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuuip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuuui(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuuuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuuup(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuupii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuffff(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFudddd(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFupupi(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuppip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFupppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFfffff(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFddddp(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFpiiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFpipii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFpuipp(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFpddii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFppiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFppiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFppWui(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFpppii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFppppi(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFppppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEippp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEpipi(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEpipp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEpipV(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEpLpp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEpLpV(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEppip(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEppiV(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEpppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEpppV(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFiiupp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFipiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFipppi(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFipppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpiiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpiiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpiiuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpiipi(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpiipp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpipii(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpippi(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpippp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpCCCC(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpuuui(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpuuLL(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpuupp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFppiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFppiup(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFppipi(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFppipp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFppupi(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpppii(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpppiL(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpppip(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpppLi(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFppppi(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFppppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void IFppIII(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFEppuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFiuuuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFuiiiu(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFpCCCC(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFpuuuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFppiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFppppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void LFLpppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void LFpLLLp(x64emu_t *emu, uintptr_t fnc);
|
||||
void LFpLppL(x64emu_t *emu, uintptr_t fnc);
|
||||
void LFppppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFEpiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFEpipL(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFEpipp(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFEpupp(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFEppii(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFEppip(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFEpppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFuiiiu(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFuiipp(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpiiuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpiipp(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpippp(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpCuup(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpCppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpuiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpuiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpuWWW(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpuuWW(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpuuup(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFppipi(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFppipp(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFppuuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFppuup(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFppLLp(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpppip(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpppuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpppup(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFppppi(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFppppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFEiiipp(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFEpLLpp(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFiiiiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFiiiuil(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFiuippp(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFiffiff(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFiddidd(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiiiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiiiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiiuii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiiuup(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiuiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiuiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiuiuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiuuip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiuuuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiupii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiupiu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiffff(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuidddd(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuipiup(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuiiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuiuii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuiuiu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuiuup(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuippp(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuuiup(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuuipi(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuuipp(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuuuii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuuuip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuuuuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuuuff(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuuppi(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuuppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuffff(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuudddd(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuffiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFufffff(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuddiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFupupip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuppppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFffffff(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFdddddd(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFpipipV(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFpipppi(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFpdddii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFppiiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFppiipi(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFppupii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFpppppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEiippi(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEpilpV(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEpippi(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEpuppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEppppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFiiiiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFiiiiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFiuiipi(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFuppipp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFuppppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpiiiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpiiipp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpiippp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpipppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpupuui(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFppiiuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFppIppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFppuiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFppuiiL(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFppuIII(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFppuupp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFppupip(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpppiuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpppipi(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpppipp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFppppii(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpppppi(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpppppL(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpppppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFpippup(x64emu_t *emu, uintptr_t fnc);
|
||||
void UFpippup(x64emu_t *emu, uintptr_t fnc);
|
||||
void LFSpLiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFEpippp(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFEpuipp(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFEpuupp(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFEpuppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFEppppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFiCiiCi(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpiiiiu(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpippip(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpCuuCC(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpCuuWW(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpCuuup(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpuuuuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFppiiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpppppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFSpiiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFiiiiiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFiiiiuup(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFiiupuip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFiiffffp(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFiupuuup(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiiiiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiiiuip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiiiuup(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiuiiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiuiiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiuiiuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiupiiu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuipiiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuipffff(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuipdddd(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuiiiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuiiiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuiiiui(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuiiiuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuiiuup(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuiuiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuipppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuuiiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuuiiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuuiuii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuuiupi(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuuuiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuuuuuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuuufff(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuuffff(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuudddd(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuffiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuddiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuffffff(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFudddddd(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFpipipii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFpddiidd(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFppiiipi(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFpppiiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFppppipi(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEpLiLpV(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEppLpIi(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEpppiiu(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEpppppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFiiiiiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpiiuuiu(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpiupiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpuuiuui(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpupuuui(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpuppppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFppiiuui(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFppiipii(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFppipipi(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFppipppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpppiiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpppiiuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpppiipi(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpppiuwu(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFppppiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFppppdpi(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFppppppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFuippppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFEppppip(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFifffppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFuupupup(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpCuwwWW(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpCuWCCC(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpCuuwwp(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpCuuuuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFppuuppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFppppuuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpppppuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFppppppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFiiiiuuip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFiupuiuup(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFiupuuuup(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiiiiiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiiiiuup(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiiipiup(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiuiiiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiuiiiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuiiiiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuiiiuip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuiiiuup(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuiiuupp(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuiuiiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuiuiiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuuiiiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuuiuiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuuipipp(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuuuuuuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuuuufff(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFffffffff(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFpippiiuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFpippiipi(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFppiiipii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFppppiipi(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEpippppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFiiiiiiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFiiupiupi(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFuiifpppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpiiiiipi(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpuuiiiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpupppppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFppIIIppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpppiippp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpppipipi(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpppipppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFppppiipi(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpppppppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void uFuipppppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFuiiiuuuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFuupupipp(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpCuwwWWu(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpCuuuCup(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpppuuLLu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiiiiiiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiiiiiuip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiiiiiuup(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiuiiiiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiupuffup(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuiiiiiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuiuiiiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuiuiiiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuiuiiuup(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuuiiiiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuuuuuuuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuupiuiuuf(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuffffffff(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFffuuuufff(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFddddddddd(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFpipppiipi(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFppiiipiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFpppppippp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEpiiiiipi(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFiiiiiiiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFiiiipiiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFdddpppppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpipLpiiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFppiuiippL(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpppiiuuii(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpppiipiiu(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFppppppppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFEppiiuuLi(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFEppuippuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpiiiiuuuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpCuWCCuuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpuuwwWWww(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFppiiuuuLL(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFppipppppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFiiiiiiiiiu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiiiiiiiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiiiiiiuup(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiuiiiiuup(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuiiiiiiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuiiiiiuip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuiiiiiuup(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuiuiiiiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuiuiiiuup(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuuuuuuiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuuuuuuuuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuupiiupuuf(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuffiiffiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuddiiddiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFffffffffff(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFiiiiiiiiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpuupiuiipp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFppuuiiiiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFppuuiiuupi(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFppppiiuuii(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpCuWCCuuCW(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpuuuwwwwWW(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFppuiipuuii(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpppppppppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiiiiiiiiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiiiiiiiuip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiiiiiiiuup(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiuiiiiiuup(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuiuiiiiuup(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuuuuuuuuuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuffiiffiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuufffffffff(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuddiiddiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuffffffffff(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFpipipiipiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFpipppiiiipi(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEppppiiiiuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFiiiiiiiiiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpipllippppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFppppiiuuiiL(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFEppuiipuuii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuiiiiiiiuip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuiiiiiiiuup(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuuuuuuuuuuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFffffffffffff(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFpipppiiiipii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFpippppiiiipi(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEppppiiiiuui(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpipppppppppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpppllipppppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpppppppppppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFEppiiuuuipii(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpCuuWWwwCCup(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpuuuWWWWWWWW(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFppiiuuuiupLp(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuiiiiiiiiiuup(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuuuuuuuuuuuu(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuffffffffffff(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFddddpppddpppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpippuuuiipppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFpupiiiipppppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpCuuwwWWWWuup(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFppppppppppppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuffiiffiiffiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuddiiddiiddiip(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFuuiiiiuuiiiiiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFfffffffffffffff(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFpppppppppppppppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void vFppuiiiiipuiiiiiiii(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFipppppppppppppppppppppp(x64emu_t *emu, uintptr_t fnc);
|
||||
|
||||
#if defined(HAVE_LD80BITS)
|
||||
void DFD(x64emu_t *emu, uintptr_t fnc);
|
||||
@@ -127,6 +977,13 @@ void KFKp(x64emu_t *emu, uintptr_t fnc);
|
||||
#endif
|
||||
|
||||
void iFEv(x64emu_t *emu, uintptr_t fnc);
|
||||
void lFEv(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFEv(x64emu_t *emu, uintptr_t fnc);
|
||||
void pFppv(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEvpp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEpvpp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEpvvppp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEpLvvpp(x64emu_t *emu, uintptr_t fnc);
|
||||
void iFEpuvvppp(x64emu_t *emu, uintptr_t fnc);
|
||||
|
||||
#endif //__WRAPPER_H_
|
||||
Executable
+23
@@ -0,0 +1,23 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#define _GNU_SOURCE /* See feature_test_macros(7) */
|
||||
#include <dlfcn.h>
|
||||
|
||||
#include "wrappedlibs.h"
|
||||
|
||||
#include "wrapper.h"
|
||||
#include "bridge.h"
|
||||
#include "librarian/library_private.h"
|
||||
#include "x64emu.h"
|
||||
|
||||
const char* alureName = "libalure.so.1";
|
||||
#define LIBNAME alure
|
||||
|
||||
#define CUSTOM_INIT \
|
||||
lib->priv.w.needed = 1; \
|
||||
lib->priv.w.neededlibs = (char**)calloc(lib->priv.w.needed, sizeof(char*)); \
|
||||
lib->priv.w.neededlibs[0] = strdup("libopenal.so.1");
|
||||
|
||||
#include "wrappedlib_init.h"
|
||||
|
||||
Executable
+39
@@ -0,0 +1,39 @@
|
||||
#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA))
|
||||
error Meh...
|
||||
#endif
|
||||
|
||||
GO(alureGetVersion,vFpp)
|
||||
GO(alureGetErrorString,pFv)
|
||||
GO(alureGetDeviceNames,pFip)
|
||||
GO(alureFreeDeviceNames,vFp)
|
||||
GO(alureInitDevice,iFpp)
|
||||
GO(alureShutdownDevice,iFv)
|
||||
GO(alureGetSampleFormat,iFuuu)
|
||||
GO(alureSleep,iFf)
|
||||
GO(alureStreamSizeIsMicroSec,iFi)
|
||||
GO(alureCreateBufferFromFile,uFp)
|
||||
GO(alureCreateBufferFromMemory,uFpi)
|
||||
GO(alureBufferDataFromFile,iFpu)
|
||||
GO(alureBufferDataFromMemory,iFpiu)
|
||||
GO(alureCreateStreamFromFile,pFpiip)
|
||||
GO(alureCreateStreamFromMemory,pFpuiip)
|
||||
GO(alureCreateStreamFromStaticMemory,pFpuiip)
|
||||
//GOM(alureCreateStreamFromCallback,pFEBpiuiip)
|
||||
GO(alureGetStreamLength,IFp)
|
||||
GO(alureGetStreamFrequency,iFp)
|
||||
GO(alureGetStreamOrder,uFp)
|
||||
GO(alureBufferDataFromStream,iFpip)
|
||||
GO(alureRewindStream,iFp)
|
||||
GO(alureSetStreamOrder,iFpu)
|
||||
GO(alureSetStreamPatchset,iFpp)
|
||||
GO(alureDestroyStream,iFpip)
|
||||
GO(alureUpdate,vFv)
|
||||
GO(alureUpdateInterval,iFf)
|
||||
//GOM(alurePlaySourceStream,iFEupiiBp)
|
||||
//GOM(alurePlaySource,iFEuBp)
|
||||
GO(alureStopSource,iFui)
|
||||
GO(alurePauseSource,iFu)
|
||||
GO(alureResumeSource,iFu)
|
||||
//GOM(alureInstallDecodeCallbacks,iFEiBBBBBB)
|
||||
//GOM(alureSetIOCallbacks,iFEBBBBB)
|
||||
//GOM(alureGetProcAddress,pFEp)
|
||||
Executable
+23
@@ -0,0 +1,23 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#define _GNU_SOURCE /* See feature_test_macros(7) */
|
||||
#include <dlfcn.h>
|
||||
|
||||
#include "wrappedlibs.h"
|
||||
|
||||
#include "wrapper.h"
|
||||
#include "bridge.h"
|
||||
#include "librarian/library_private.h"
|
||||
#include "x64emu.h"
|
||||
|
||||
const char* alutName = "libalut.so.0";
|
||||
#define LIBNAME alut
|
||||
|
||||
#define CUSTOM_INIT \
|
||||
lib->priv.w.needed = 1; \
|
||||
lib->priv.w.neededlibs = (char**)calloc(lib->priv.w.needed, sizeof(char*)); \
|
||||
lib->priv.w.neededlibs[0] = strdup("libopenal.so.1");
|
||||
|
||||
#include "wrappedlib_init.h"
|
||||
|
||||
Executable
+24
@@ -0,0 +1,24 @@
|
||||
#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA))
|
||||
#error Meh...
|
||||
#endif
|
||||
|
||||
GO(alutInit,cFpp)
|
||||
GO(alutInitWithoutContext,cFpp)
|
||||
GO(alutExit,cFv)
|
||||
GO(alutGetError,iFv)
|
||||
GO(alutGetErrorString,pFi)
|
||||
GO(alutCreateBufferFromFile,uFp)
|
||||
GO(alutCreateBufferFromFileImage,uFpi)
|
||||
GO(alutCreateBufferHelloWorld,uFv)
|
||||
GO(alutCreateBufferWaveform,uFifff)
|
||||
GO(alutLoadMemoryFromFile,pFpppp)
|
||||
GO(alutLoadMemoryFromFileImage,pFpippp)
|
||||
GO(alutLoadMemoryHelloWorld,pFppp)
|
||||
GO(alutLoadMemoryWaveform,pFifffppp)
|
||||
GO(alutGetMIMETypes,pFi)
|
||||
GO(alutGetMajorVersion,iFv)
|
||||
GO(alutGetMinorVersion,iFv)
|
||||
GO(alutSleep,cFf)
|
||||
GO(alutLoadWAVFile,vFpppppp)
|
||||
GO(alutLoadWAVMemory,vFpppppp)
|
||||
GO(alutUnloadWAV,vFipii)
|
||||
Executable
+178
@@ -0,0 +1,178 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#define _GNU_SOURCE /* See feature_test_macros(7) */
|
||||
#include <dlfcn.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "wrappedlibs.h"
|
||||
|
||||
#include "debug.h"
|
||||
#include "wrapper.h"
|
||||
#include "bridge.h"
|
||||
#include "librarian/library_private.h"
|
||||
#include "x64emu.h"
|
||||
#include "emu/x64emu_private.h"
|
||||
#include "callback.h"
|
||||
#include "librarian.h"
|
||||
#include "box64context.h"
|
||||
#include "emu/x64emu_private.h"
|
||||
#include "bridge.h"
|
||||
|
||||
#define LIBNAME libasound
|
||||
const char* libasoundName = "libasound.so.2";
|
||||
|
||||
typedef int (*iFp_t) (void*);
|
||||
typedef void* (*pFp_t) (void*);
|
||||
typedef int (*iFpipp_t) (void*, int, void*, void*);
|
||||
typedef int (*iFpppp_t) (void*, void*, void*, void*);
|
||||
|
||||
EXPORT uintptr_t my_snd_lib_error = 0;
|
||||
static void default_error_handler(const char *file, int line, const char *function, int err, const char *fmt, va_list ap)
|
||||
{
|
||||
vprintf(fmt, ap);
|
||||
}
|
||||
|
||||
#define SUPER() \
|
||||
GO(snd_async_add_handler, iFpipp_t) \
|
||||
GO(snd_async_add_pcm_handler, iFpppp_t) \
|
||||
GO(snd_lib_error_set_handler, iFp_t)
|
||||
|
||||
typedef struct asound_my_s {
|
||||
// functions
|
||||
#define GO(A, B) B A;
|
||||
SUPER()
|
||||
#undef GO
|
||||
} asound_my_t;
|
||||
|
||||
void* getAsoundMy(library_t* lib)
|
||||
{
|
||||
asound_my_t* my = (asound_my_t*)calloc(1, sizeof(asound_my_t));
|
||||
#define GO(A, W) my->A = (W)dlsym(lib->priv.w.lib, #A);
|
||||
SUPER()
|
||||
#undef GO
|
||||
// setup custom error handler
|
||||
my_snd_lib_error = AddCheckBridge(my_context->system, vFpipipV, default_error_handler, 0, "ASoundCustomErrorHandler");
|
||||
//all done
|
||||
return my;
|
||||
}
|
||||
#undef SUPER
|
||||
|
||||
void freeAsoundMy(void* lib)
|
||||
{
|
||||
// asound_my_t *my = (asound_my_t *)lib;
|
||||
my_snd_lib_error = 0; // no removing of bridge
|
||||
}
|
||||
|
||||
#define SUPER() \
|
||||
GO(0) \
|
||||
GO(1) \
|
||||
GO(2) \
|
||||
GO(3)
|
||||
|
||||
// snd_async_callback_t
|
||||
#define GO(A) \
|
||||
static uintptr_t my_async_fct_##A = 0; \
|
||||
static void* my_async_##A(void* handler) \
|
||||
{ \
|
||||
return (void*)RunFunction(my_context, my_async_fct_##A, 1, handler);\
|
||||
}
|
||||
SUPER()
|
||||
#undef GO
|
||||
static void* findAsyncFct(void* fct)
|
||||
{
|
||||
if(!fct) return fct;
|
||||
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
|
||||
#define GO(A) if(my_async_fct_##A == (uintptr_t)fct) return my_async_##A;
|
||||
SUPER()
|
||||
#undef GO
|
||||
#define GO(A) if(my_async_fct_##A == 0) {my_async_fct_##A = (uintptr_t)fct; return my_async_##A; }
|
||||
SUPER()
|
||||
#undef GO
|
||||
printf_log(LOG_NONE, "Warning, no more slot for Asound Async callback\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
EXPORT int my_snd_async_add_handler(x64emu_t *emu, void *handler, int fd, void* callback, void *private_data)
|
||||
{
|
||||
asound_my_t* my = (asound_my_t*)emu->context->asound->priv.w.p2;
|
||||
|
||||
return my->snd_async_add_handler(handler, fd, findAsyncFct(callback), private_data);
|
||||
}
|
||||
|
||||
EXPORT int my_snd_async_add_pcm_handler(x64emu_t *emu, void *handler, void* pcm, void* callback, void *private_data)
|
||||
{
|
||||
asound_my_t* my = (asound_my_t*)emu->context->asound->priv.w.p2;
|
||||
|
||||
return my->snd_async_add_pcm_handler(handler, pcm, findAsyncFct(callback), private_data);
|
||||
}
|
||||
|
||||
static void* current_error_handler = NULL;
|
||||
static void dummy_error_handler(const char *file, int line, const char *function, int err, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
fprintf(ftrace, "Warning: this is a dummy snd_lib error handler\n");
|
||||
fprintf(ftrace, "Error in file %s on line %i: ", file, line);
|
||||
va_start(ap, fmt);
|
||||
vfprintf(ftrace, fmt, ap);
|
||||
va_end(ap);
|
||||
fflush(ftrace);
|
||||
}
|
||||
|
||||
static void empty_error_handler(const char *file, int line, const char *function, int err, const char *fmt, ...)
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
EXPORT int my_snd_lib_error_set_handler(x64emu_t* emu, void* handler)
|
||||
{
|
||||
asound_my_t* my = (asound_my_t*)emu->context->asound->priv.w.p2;
|
||||
current_error_handler = handler;
|
||||
void *error_handler;
|
||||
uint8_t *code = (uint8_t *)handler;
|
||||
if (code) {
|
||||
if (code && ((code[0] == 0xC3) || ((code[0] == 0xF3) && (code[1] == 0xC3)))) {
|
||||
error_handler = &empty_error_handler;
|
||||
} else {
|
||||
error_handler = &dummy_error_handler;
|
||||
printf_log(LOG_NONE, "Warning: snd_lib_error_set_handler: using dummy error handler\n");
|
||||
}
|
||||
} else error_handler = NULL;
|
||||
|
||||
return my->snd_lib_error_set_handler(error_handler);
|
||||
}
|
||||
|
||||
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);
|
||||
void* my_dlvsym(x64emu_t* emu, void *handle, void *symbol, void *version);
|
||||
EXPORT void * my_snd_dlopen(x64emu_t* emu, void* name, int mode, void* errbuf, size_t errbuflen)
|
||||
{
|
||||
void* ret = my_dlopen(emu, name, mode); // Does NULL name (so dlopen libasound) need special treatment?
|
||||
if(!ret && errbuf) {
|
||||
strncpy(errbuf, my_dlerror(emu), errbuflen);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
EXPORT int my_snd_dlclose(x64emu_t* emu, void* handle)
|
||||
{
|
||||
return my_dlclose(emu, handle);
|
||||
}
|
||||
EXPORT void* my_snd_dlsym(x64emu_t* emu, void* handle, void* name, void* version)
|
||||
{
|
||||
return my_dlvsym(emu, handle, name, version);
|
||||
}
|
||||
|
||||
#define CUSTOM_INIT \
|
||||
box64->asound = lib; \
|
||||
lib->priv.w.p2 = getAsoundMy(lib);
|
||||
|
||||
#define CUSTOM_FINI \
|
||||
lib->context->asound = NULL; \
|
||||
freeAsoundMy(lib->priv.w.p2); \
|
||||
free(lib->priv.w.p2);
|
||||
|
||||
#include "wrappedlib_init.h"
|
||||
|
||||
Executable
+1275
File diff suppressed because it is too large.
Load diff
+173
-360
@@ -48,7 +48,7 @@
|
||||
#include "emu/x64emu_private.h"
|
||||
#include "box64context.h"
|
||||
#include "myalign.h"
|
||||
//#include "signals.h"
|
||||
#include "signals.h"
|
||||
#include "fileutils.h"
|
||||
#include "auxval.h"
|
||||
#include "elfloader.h"
|
||||
@@ -108,6 +108,15 @@ void freeLIBCMy(void* lib)
|
||||
{
|
||||
// empty for now
|
||||
}
|
||||
|
||||
static int regs_abi[] = {_DI, _SI, _DX, _CX, _R8, _R9};
|
||||
void* getVargN(x64emu_t *emu, int n)
|
||||
{
|
||||
if(n<6)
|
||||
return (void*)emu->regs[regs_abi[n]].q[0];
|
||||
return ((void**)R_RSP)[1+n-6];
|
||||
}
|
||||
|
||||
#if 0
|
||||
// utility functions
|
||||
#define SUPER() \
|
||||
@@ -574,53 +583,38 @@ EXPORT int my_printf(x64emu_t *emu, void* fmt, void* b) {
|
||||
PREPARE_VALIST;
|
||||
return vprintf((const char*)fmt, VARARGS);
|
||||
}
|
||||
EXPORT int my___printf_chk(x64emu_t *emu, void* fmt, void* b) __attribute__((alias("my_printf")));
|
||||
EXPORT int my___printf_chk(x64emu_t *emu, int chk, void* fmt, void* b)
|
||||
{
|
||||
myStackAlign(emu, (const char*)fmt, b, emu->scratch, R_EAX, 2);
|
||||
PREPARE_VALIST;
|
||||
return vprintf((const char*)fmt, VARARGS);
|
||||
}
|
||||
|
||||
EXPORT int my_vprintf(x64emu_t *emu, void* fmt, x64_va_list_t b) {
|
||||
CONVERT_VALIST(b);
|
||||
return vprintf(fmt, VARARGS);
|
||||
}
|
||||
EXPORT int my___vprintf_chk(x64emu_t *emu, void* fmt, x64_va_list_t b) __attribute__((alias("my_vprintf")));
|
||||
|
||||
EXPORT int my_vfprintf(x64emu_t *emu, void* F, void* fmt, x64_va_list_t b) {
|
||||
CONVERT_VALIST(b);
|
||||
return vfprintf(F, fmt, VARARGS);
|
||||
}
|
||||
EXPORT int my___vfprintf_chk(x64emu_t *emu, void* F, void* fmt, x64_va_list_t b) __attribute__((alias("my_vfprintf")));
|
||||
EXPORT int my__IO_vfprintf(x64emu_t *emu, void* F, void* fmt, x64_va_list_t b) __attribute__((alias("my_vfprintf")));
|
||||
|
||||
EXPORT int my_fprintf(x64emu_t *emu, void* F, void* fmt, void* b) {
|
||||
myStackAlign(emu, (const char*)fmt, b, emu->scratch, R_EAX, 2);
|
||||
PREPARE_VALIST;
|
||||
return vfprintf(F, fmt, VARARGS);
|
||||
}
|
||||
EXPORT int my___fprintf_chk(x64emu_t *emu, void* F, int flag, void* fmt, void* b) {
|
||||
myStackAlign(emu, (const char*)fmt, b, emu->scratch, R_EAX, 3);
|
||||
PREPARE_VALIST;
|
||||
return vfprintf(F, fmt, VARARGS);
|
||||
}
|
||||
|
||||
#if 0
|
||||
EXPORT int my_vprintf(x64emu_t *emu, void* fmt, void* b, va_list V) {
|
||||
#ifndef NOALIGN
|
||||
// need to align on arm
|
||||
myStackAlign((const char*)fmt, (uint32_t*)b, emu->scratch);
|
||||
PREPARE_VALIST;
|
||||
void* f = vprintf;
|
||||
return ((iFpp_t)f)(fmt, VARARGS);
|
||||
#else
|
||||
// other platform don't need that
|
||||
void* f = vprintf;
|
||||
return ((iFpp_t)f)(fmt, (uint32_t*)b);
|
||||
#endif
|
||||
}
|
||||
EXPORT int my___vprintf_chk(x64emu_t *emu, void* fmt, void* b, va_list V) __attribute__((alias("my_vprintf")));
|
||||
|
||||
EXPORT int my_vfprintf(x64emu_t *emu, void* F, void* fmt, void* b) {
|
||||
#ifndef NOALIGN
|
||||
// need to align on arm
|
||||
myStackAlign((const char*)fmt, (uint32_t*)b, emu->scratch);
|
||||
PREPARE_VALIST;
|
||||
void* f = vfprintf;
|
||||
return ((iFppp_t)f)(F, fmt, VARARGS);
|
||||
#else
|
||||
// other platform don't need that
|
||||
void* f = vfprintf;
|
||||
return ((iFppp_t)f)(F, fmt, (uint32_t*)b);
|
||||
#endif
|
||||
}
|
||||
EXPORT int my___vfprintf_chk(x64emu_t *emu, void* F, void* fmt, void* b) __attribute__((alias("my_vfprintf")));
|
||||
EXPORT int my__IO_vfprintf(x64emu_t *emu, void* F, void* fmt, void* b) __attribute__((alias("my_vfprintf")));
|
||||
|
||||
EXPORT int my_fprintf(x64emu_t *emu, void* F, void* fmt, void* b, va_list V) {
|
||||
#ifndef NOALIGN
|
||||
// need to align on arm
|
||||
myStackAlign((const char*)fmt, b, emu->scratch);
|
||||
PREPARE_VALIST;
|
||||
void* f = vfprintf;
|
||||
return ((iFppp_t)f)(F, fmt, VARARGS);
|
||||
#else
|
||||
// other platform don't need that
|
||||
return vfprintf((FILE*)F, (const char*)fmt, V);
|
||||
#endif
|
||||
}
|
||||
EXPORT int my___fprintf_chk(x64emu_t *emu, void* F, void* fmt, void* b, va_list V) __attribute__((alias("my_fprintf")));
|
||||
|
||||
EXPORT int my_wprintf(x64emu_t *emu, void* fmt, void* b, va_list V) {
|
||||
#ifndef NOALIGN
|
||||
// need to align on arm
|
||||
@@ -687,35 +681,33 @@ EXPORT void *my_div(void *result, int numerator, int denominator) {
|
||||
*(div_t *)result = div(numerator, denominator);
|
||||
return result;
|
||||
}
|
||||
|
||||
EXPORT int my_snprintf(x64emu_t* emu, void* buff, uint32_t s, void * fmt, void * b, va_list V) {
|
||||
#ifndef NOALIGN
|
||||
// need to align on arm
|
||||
myStackAlign((const char*)fmt, b, emu->scratch);
|
||||
#endif
|
||||
EXPORT int my_snprintf(x64emu_t* emu, void* buff, size_t s, void * fmt, uint64_t * b) {
|
||||
myStackAlign(emu, (const char*)fmt, b, emu->scratch, R_EAX, 3);
|
||||
PREPARE_VALIST;
|
||||
void* f = vsnprintf;
|
||||
int r = ((iFpupp_t)f)(buff, s, fmt, VARARGS);
|
||||
int r = vsnprintf(buff, s, fmt, VARARGS);
|
||||
return r;
|
||||
#else
|
||||
return vsnprintf((char*)buff, s, (char*)fmt, V);
|
||||
#endif
|
||||
}
|
||||
EXPORT int my___snprintf_chk(x64emu_t* emu, void* buff, uint32_t s, void * fmt, void * b, va_list V) __attribute__((alias("my_snprintf")));
|
||||
EXPORT int my___snprintf(x64emu_t* emu, void* buff, uint32_t s, void * fmt, void * b, va_list V) __attribute__((alias("my_snprintf")));
|
||||
|
||||
EXPORT int my_sprintf(x64emu_t* emu, void* buff, void * fmt, void * b, va_list V) {
|
||||
#ifndef NOALIGN
|
||||
// need to align on arm
|
||||
myStackAlign((const char*)fmt, b, emu->scratch);
|
||||
EXPORT int my___snprintf(x64emu_t* emu, void* buff, size_t s, void * fmt, uint64_t * b) __attribute__((alias("my_snprintf")));
|
||||
EXPORT int my___snprintf_chk(x64emu_t* emu, void* buff, size_t s, int flags, size_t maxlen, void * fmt, uint64_t * b)
|
||||
{
|
||||
myStackAlign(emu, (const char*)fmt, b, emu->scratch, R_EAX, 5);
|
||||
PREPARE_VALIST;
|
||||
void* f = vsprintf;
|
||||
return ((iFppp_t)f)(buff, fmt, VARARGS);
|
||||
#else
|
||||
return vsprintf((char*)buff, (char*)fmt, V);
|
||||
#endif
|
||||
int r = vsnprintf(buff, s, fmt, VARARGS);
|
||||
return r;
|
||||
}
|
||||
EXPORT int my___sprintf_chk(x64emu_t* emu, void* buff, void * fmt, void * b, va_list V) __attribute__((alias("my_sprintf")));
|
||||
|
||||
EXPORT int my_sprintf(x64emu_t* emu, void* buff, void * fmt, void * b) {
|
||||
myStackAlign(emu, (const char*)fmt, b, emu->scratch, R_EAX, 2);
|
||||
PREPARE_VALIST;
|
||||
return vsprintf(buff, (const char*)fmt, VARARGS);
|
||||
}
|
||||
EXPORT int my___sprintf_chk(x64emu_t* emu, void* buff, int flag, size_t l, void * fmt, void * b) {
|
||||
myStackAlign(emu, (const char*)fmt, b, emu->scratch, R_EAX, 4);
|
||||
PREPARE_VALIST;
|
||||
return vsprintf(buff, (const char*)fmt, VARARGS);
|
||||
}
|
||||
#if 0
|
||||
EXPORT int my_asprintf(x64emu_t* emu, void** buff, void * fmt, void * b, va_list V) {
|
||||
#ifndef NOALIGN
|
||||
// need to align on arm
|
||||
@@ -728,80 +720,63 @@ EXPORT int my_asprintf(x64emu_t* emu, void** buff, void * fmt, void * b, va_list
|
||||
#endif
|
||||
}
|
||||
EXPORT int my___asprintf(x64emu_t* emu, void** buff, void * fmt, void * b, va_list V) __attribute__((alias("my_asprintf")));
|
||||
#endif
|
||||
|
||||
EXPORT int my_vsprintf(x64emu_t* emu, void* buff, void * fmt, x64_va_list_t b) {
|
||||
CONVERT_VALIST(b);
|
||||
|
||||
EXPORT int my_vsprintf(x64emu_t* emu, void* buff, void * fmt, void * b, va_list V) {
|
||||
#ifndef NOALIGN
|
||||
// need to align on arm
|
||||
myStackAlign((const char*)fmt, (uint32_t*)b, emu->scratch);
|
||||
PREPARE_VALIST;
|
||||
void* f = vsprintf;
|
||||
int r = ((iFppp_t)f)(buff, fmt, VARARGS);
|
||||
return r;
|
||||
#else
|
||||
void* f = vsprintf;
|
||||
int r = ((iFppp_t)f)(buff, fmt, (uint32_t*)b);
|
||||
return r;
|
||||
#endif
|
||||
return vsprintf(buff, fmt, VARARGS);
|
||||
}
|
||||
EXPORT int my___vsprintf_chk(x64emu_t* emu, void* buff, void * fmt, void * b, va_list V) __attribute__((alias("my_vsprintf")));
|
||||
EXPORT int my___vsprintf_chk(x64emu_t* emu, void* buff, void * fmt, x64_va_list_t b) __attribute__((alias("my_vsprintf")));
|
||||
|
||||
#ifdef POWERPCLE
|
||||
EXPORT int my_vfscanf(x64emu_t* emu, void* stream, void* fmt, void* b) // probably uneeded to do a GOM, a simple wrap should enough
|
||||
EXPORT int my_vfscanf(x64emu_t* emu, void* stream, void* fmt, x64_va_list_t b)
|
||||
{
|
||||
//myStackAlign((const char*)fmt, (uint32_t*)b, emu->scratch);
|
||||
PREPARE_VALIST_(b);
|
||||
void* f = vfscanf;
|
||||
CONVERT_VALIST(b);
|
||||
|
||||
return ((iFppp_t)f)(stream, fmt, VARARGS_(b));
|
||||
return vfscanf(stream, fmt, VARARGS);
|
||||
}
|
||||
|
||||
|
||||
|
||||
EXPORT int my_vsscanf(x64emu_t* emu, void* stream, void* fmt, void* b)
|
||||
EXPORT int my_vsscanf(x64emu_t* emu, void* stream, void* fmt, x64_va_list_t b)
|
||||
{
|
||||
//myStackAlign((const char*)fmt, (uint32_t*)b, emu->scratch);
|
||||
PREPARE_VALIST_(b);
|
||||
void* f = vsscanf;
|
||||
CONVERT_VALIST(b);
|
||||
|
||||
return ((iFppp_t)f)(stream, fmt, VARARGS_(b));
|
||||
return vsscanf(stream, fmt, VARARGS);
|
||||
}
|
||||
|
||||
EXPORT int my__vsscanf(x64emu_t* emu, void* stream, void* fmt, void* b) __attribute__((alias("my_vsscanf")));
|
||||
EXPORT int my_sscanf(x64emu_t* emu, void* stream, void* fmt, void* b) __attribute__((alias("my_vsscanf")));
|
||||
EXPORT int my_sscanf(x64emu_t* emu, void* stream, void* fmt, uint64_t* b)
|
||||
{
|
||||
myStackAlignScanf(emu, (const char*)fmt, b, emu->scratch, 2);
|
||||
PREPARE_VALIST;
|
||||
|
||||
return vsscanf(stream, fmt, VARARGS);
|
||||
}
|
||||
#if 0
|
||||
EXPORT int my__IO_vfscanf(x64emu_t* emu, void* stream, void* fmt, void* b) __attribute__((alias("my_vfscanf")));
|
||||
EXPORT int my___isoc99_vsscanf(x64emu_t* emu, void* stream, void* fmt, void* b) __attribute__((alias("my_vsscanf")));
|
||||
|
||||
EXPORT int my___isoc99_vfscanf(x64emu_t* emu, void* stream, void* fmt, void* b) __attribute__((alias("my_vfscanf")));
|
||||
EXPORT int my___isoc99_fscanf(x64emu_t* emu, void* stream, void* fmt, void* b) __attribute__((alias("my_vfscanf")));
|
||||
|
||||
EXPORT int my___isoc99_sscanf(x64emu_t* emu, void* stream, void* fmt, void* b)
|
||||
#endif
|
||||
EXPORT int my___isoc99_sscanf(x64emu_t* emu, void* stream, void* fmt, uint64_t* b)
|
||||
{
|
||||
void* f = sscanf;
|
||||
myStackAlignScanf(emu, (const char*)fmt, b, emu->scratch, 2);
|
||||
PREPARE_VALIST;
|
||||
|
||||
return ((iFppp_t)f)(stream, fmt, VARARGS);
|
||||
return vsscanf(stream, fmt, VARARGS);
|
||||
}
|
||||
#endif
|
||||
|
||||
EXPORT int my_vsnprintf(x64emu_t* emu, void* buff, uint32_t s, void * fmt, void * b, va_list V) {
|
||||
#ifndef NOALIGN
|
||||
EXPORT int my_vsnprintf(x64emu_t* emu, void* buff, size_t s, void * fmt, x64_va_list_t b) {
|
||||
// need to align on arm
|
||||
myStackAlign((const char*)fmt, (uint32_t*)b, emu->scratch);
|
||||
PREPARE_VALIST;
|
||||
void* f = vsnprintf;
|
||||
int r = ((iFpupp_t)f)(buff, s, fmt, VARARGS);
|
||||
CONVERT_VALIST(b);
|
||||
int r = vsnprintf(buff, s, fmt, VARARGS);
|
||||
return r;
|
||||
#else
|
||||
void* f = vsnprintf;
|
||||
int r = ((iFpupp_t)f)(buff, s, fmt, (uint32_t*)b);
|
||||
return r;
|
||||
#endif
|
||||
}
|
||||
EXPORT int my___vsnprintf(x64emu_t* emu, void* buff, uint32_t s, void * fmt, void * b, va_list V) __attribute__((alias("my_vsnprintf")));
|
||||
EXPORT int my___vsnprintf_chk(x64emu_t* emu, void* buff, uint32_t s, void * fmt, void * b, va_list V) __attribute__((alias("my_vsnprintf")));
|
||||
|
||||
EXPORT int my___vsnprintf(x64emu_t* emu, void* buff, size_t s, void * fmt, x64_va_list_t b) __attribute__((alias("my_vsnprintf")));
|
||||
EXPORT int my___vsnprintf_chk(x64emu_t* emu, void* buff, size_t s, void * fmt, x64_va_list_t b) __attribute__((alias("my_vsnprintf")));
|
||||
#if 0
|
||||
EXPORT int my_vasprintf(x64emu_t* emu, void* strp, void* fmt, void* b, va_list V)
|
||||
{
|
||||
#ifndef NOALIGN
|
||||
@@ -844,24 +819,15 @@ EXPORT int my___asprintf_chk(x64emu_t* emu, void* result_ptr, int flags, void* f
|
||||
return vasprintf((char**)result_ptr, (char*)fmt, V);
|
||||
#endif
|
||||
}
|
||||
|
||||
EXPORT int my_vswprintf(x64emu_t* emu, void* buff, uint32_t s, void * fmt, void * b, va_list V) {
|
||||
#ifndef NOALIGN
|
||||
// need to align on arm
|
||||
myStackAlignW((const char*)fmt, (uint32_t*)b, emu->scratch);
|
||||
PREPARE_VALIST;
|
||||
void* f = vswprintf;
|
||||
int r = ((iFpupp_t)f)(buff, s, fmt, VARARGS);
|
||||
#endif
|
||||
EXPORT int my_vswprintf(x64emu_t* emu, void* buff, size_t s, void * fmt, x64_va_list_t b) {
|
||||
CONVERT_VALIST(b);
|
||||
int r = vswprintf(buff, s, fmt, VARARGS);
|
||||
return r;
|
||||
#else
|
||||
void* f = vswprintf;
|
||||
int r = ((iFpupp_t)f)(buff, s, fmt, (uint32_t*)b);
|
||||
return r;
|
||||
#endif
|
||||
}
|
||||
EXPORT int my___vswprintf(x64emu_t* emu, void* buff, uint32_t s, void * fmt, void * b, va_list V) __attribute__((alias("my_vswprintf")));
|
||||
EXPORT int my___vswprintf_chk(x64emu_t* emu, void* buff, uint32_t s, void * fmt, void * b, va_list V) __attribute__((alias("my_vswprintf")));
|
||||
|
||||
EXPORT int my___vswprintf(x64emu_t* emu, void* buff, size_t s, void * fmt, x64_va_list_t b) __attribute__((alias("my_vswprintf")));
|
||||
EXPORT int my___vswprintf_chk(x64emu_t* emu, void* buff, size_t s, void * fmt, x64_va_list_t b) __attribute__((alias("my_vswprintf")));
|
||||
#if 0
|
||||
EXPORT void my_verr(x64emu_t* emu, int eval, void* fmt, void* b) {
|
||||
#ifndef NOALIGN
|
||||
myStackAlignW((const char*)fmt, (uint32_t*)b, emu->scratch);
|
||||
@@ -931,106 +897,12 @@ EXPORT void my__ITM_addUserCommitAction(x64emu_t* emu, void* cb, uint32_t b, voi
|
||||
EXPORT void my__ITM_registerTMCloneTable(x64emu_t* emu, void* p, uint32_t s) {}
|
||||
EXPORT void my__ITM_deregisterTMCloneTable(x64emu_t* emu, void* p) {}
|
||||
|
||||
#if 0
|
||||
struct i386_stat {
|
||||
uint64_t st_dev;
|
||||
uint32_t __pad1;
|
||||
uint32_t st_ino;
|
||||
uint32_t st_mode;
|
||||
uint32_t st_nlink;
|
||||
uint32_t st_uid;
|
||||
uint32_t st_gid;
|
||||
uint64_t st_rdev;
|
||||
uint32_t __pad2;
|
||||
int32_t st_size;
|
||||
int32_t st_blksize;
|
||||
int32_t st_blocks;
|
||||
int32_t st_atime_sec;
|
||||
uint32_t st_atime_nsec;
|
||||
int32_t st_mtime_sec;
|
||||
uint32_t st_mtime_nsec;
|
||||
int32_t st_ctime_sec;
|
||||
uint32_t st_ctime_nsec;
|
||||
uint32_t __unused4;
|
||||
uint32_t __unused5;
|
||||
} __attribute__((packed));
|
||||
|
||||
static int FillStatFromStat64(int vers, const struct stat64 *st64, void *st32)
|
||||
{
|
||||
struct i386_stat *i386st = (struct i386_stat *)st32;
|
||||
|
||||
if (vers != 3)
|
||||
{
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
i386st->st_dev = st64->st_dev;
|
||||
i386st->__pad1 = 0;
|
||||
if (fix_64bit_inodes)
|
||||
{
|
||||
i386st->st_ino = st64->st_ino ^ (st64->st_ino >> 32);
|
||||
}
|
||||
else
|
||||
{
|
||||
i386st->st_ino = st64->st_ino;
|
||||
if ((st64->st_ino >> 32) != 0)
|
||||
{
|
||||
errno = EOVERFLOW;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
i386st->st_mode = st64->st_mode;
|
||||
i386st->st_nlink = st64->st_nlink;
|
||||
i386st->st_uid = st64->st_uid;
|
||||
i386st->st_gid = st64->st_gid;
|
||||
i386st->st_rdev = st64->st_rdev;
|
||||
i386st->__pad2 = 0;
|
||||
i386st->st_size = st64->st_size;
|
||||
if ((i386st->st_size >> 31) != (int32_t)(st64->st_size >> 32))
|
||||
{
|
||||
errno = EOVERFLOW;
|
||||
return -1;
|
||||
}
|
||||
i386st->st_blksize = st64->st_blksize;
|
||||
i386st->st_blocks = st64->st_blocks;
|
||||
if ((i386st->st_blocks >> 31) != (int32_t)(st64->st_blocks >> 32))
|
||||
{
|
||||
errno = EOVERFLOW;
|
||||
return -1;
|
||||
}
|
||||
i386st->st_atime_sec = st64->st_atim.tv_sec;
|
||||
i386st->st_atime_nsec = st64->st_atim.tv_nsec;
|
||||
i386st->st_mtime_sec = st64->st_mtim.tv_sec;
|
||||
i386st->st_mtime_nsec = st64->st_mtim.tv_nsec;
|
||||
i386st->st_ctime_sec = st64->st_ctim.tv_sec;
|
||||
i386st->st_ctime_nsec = st64->st_ctim.tv_nsec;
|
||||
i386st->__unused4 = 0;
|
||||
i386st->__unused5 = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
EXPORT int my___fxstat(x64emu_t *emu, int vers, int fd, void* buf)
|
||||
{
|
||||
if (vers == 1)
|
||||
{
|
||||
static iFiip_t f = NULL;
|
||||
if(!f) {
|
||||
library_t* lib = my_lib;
|
||||
if(!lib)
|
||||
{
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
f = (iFiip_t)dlsym(lib->priv.w.lib, "__fxstat");
|
||||
}
|
||||
|
||||
return f(vers, fd, buf);
|
||||
}
|
||||
struct stat64 st;
|
||||
int r = fstat64(fd, &st);
|
||||
if (r) return r;
|
||||
r = FillStatFromStat64(vers, &st, buf);
|
||||
UnalignStat64(&st, buf);
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -1045,25 +917,9 @@ EXPORT int my___fxstat64(x64emu_t *emu, int vers, int fd, void* buf)
|
||||
|
||||
EXPORT int my___xstat(x64emu_t* emu, int v, void* path, void* buf)
|
||||
{
|
||||
if (v == 1)
|
||||
{
|
||||
static iFipp_t f = NULL;
|
||||
if(!f) {
|
||||
library_t* lib = my_lib;
|
||||
if(!lib)
|
||||
{
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
f = (iFipp_t)dlsym(lib->priv.w.lib, "__xstat");
|
||||
}
|
||||
|
||||
return f(v, path, buf);
|
||||
}
|
||||
struct stat64 st;
|
||||
int r = stat64((const char*)path, &st);
|
||||
if (r) return r;
|
||||
r = FillStatFromStat64(v, &st, buf);
|
||||
UnalignStat64(&st, buf);
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -1077,25 +933,9 @@ EXPORT int my___xstat64(x64emu_t* emu, int v, void* path, void* buf)
|
||||
|
||||
EXPORT int my___lxstat(x64emu_t* emu, int v, void* name, void* buf)
|
||||
{
|
||||
if (v == 1)
|
||||
{
|
||||
static iFipp_t f = NULL;
|
||||
if(!f) {
|
||||
library_t* lib = my_lib;
|
||||
if(!lib)
|
||||
{
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
f = (iFipp_t)dlsym(lib->priv.w.lib, "__lxstat");
|
||||
}
|
||||
|
||||
return f(v, name, buf);
|
||||
}
|
||||
struct stat64 st;
|
||||
int r = lstat64((const char*)name, &st);
|
||||
if (r) return r;
|
||||
r = FillStatFromStat64(v, &st, buf);
|
||||
UnalignStat64(&st, buf);
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -1111,8 +951,7 @@ EXPORT int my___fxstatat(x64emu_t* emu, int v, int d, void* path, void* buf, int
|
||||
{
|
||||
struct stat64 st;
|
||||
int r = fstatat64(d, path, &st, flags);
|
||||
if (r) return r;
|
||||
r = FillStatFromStat64(v, &st, buf);
|
||||
UnalignStat64(&st, buf);
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -1132,7 +971,7 @@ EXPORT int my__IO_file_stat(x64emu_t* emu, void* f, void* buf)
|
||||
UnalignStat64(&st, buf);
|
||||
return r;
|
||||
}
|
||||
|
||||
#if 0
|
||||
EXPORT int my_fstatfs64(int fd, void* buf)
|
||||
{
|
||||
struct statfs64 st;
|
||||
@@ -1148,7 +987,7 @@ EXPORT int my_statfs64(const char* path, void* buf)
|
||||
UnalignStatFS64(&st, buf);
|
||||
return r;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
typedef struct compare_r_s {
|
||||
x64emu_t* emu;
|
||||
@@ -1173,7 +1012,7 @@ EXPORT void my_qsort_r(x64emu_t* emu, void* base, size_t nmemb, size_t size, voi
|
||||
args.emu = emu; args.f = (uintptr_t)fnc; args.r = 1; args.data = data;
|
||||
qsort_r(base, nmemb, size, (__compar_d_fn_t)my_compare_r_cb, &args);
|
||||
}
|
||||
|
||||
#if 0
|
||||
EXPORT void* my_bsearch(x64emu_t* emu, void* key, void* base, size_t nmemb, size_t size, void* fnc)
|
||||
{
|
||||
return bsearch(key, base, nmemb, size, findcompareFct(fnc));
|
||||
@@ -1437,7 +1276,7 @@ EXPORT int32_t my_open(x64emu_t* emu, void* pathname, int32_t flags, uint32_t mo
|
||||
return ret;
|
||||
}
|
||||
EXPORT int32_t my___open(x64emu_t* emu, void* pathname, int32_t flags, uint32_t mode) __attribute__((alias("my_open")));
|
||||
#if 0
|
||||
|
||||
#ifdef DYNAREC
|
||||
static int hasDBFromAddress(uintptr_t addr)
|
||||
{
|
||||
@@ -1446,28 +1285,28 @@ static int hasDBFromAddress(uintptr_t addr)
|
||||
}
|
||||
#endif
|
||||
|
||||
EXPORT int32_t my_read(int fd, void* buf, uint32_t count)
|
||||
{
|
||||
int ret = read(fd, buf, count);
|
||||
#ifdef DYNAREC
|
||||
if(ret!=count && ret>0) {
|
||||
// continue reading...
|
||||
void* p = buf+ret;
|
||||
if(hasDBFromAddress((uintptr_t)p)) {
|
||||
// allow writing the whole block (this happens with HalfLife, libMiles load code directly from .mix and other file like that)
|
||||
unprotectDB((uintptr_t)p, count-ret);
|
||||
int l;
|
||||
do {
|
||||
l = read(fd, p, count-ret);
|
||||
if(l>0) {
|
||||
p+=l; ret+=l;
|
||||
}
|
||||
} while(l>0);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
//EXPORT int32_t my_read(int fd, void* buf, uint32_t count)
|
||||
//{
|
||||
// int ret = read(fd, buf, count);
|
||||
//#ifdef DYNAREC
|
||||
// if(ret!=count && ret>0) {
|
||||
// // continue reading...
|
||||
// void* p = buf+ret;
|
||||
// if(hasDBFromAddress((uintptr_t)p)) {
|
||||
// // allow writing the whole block (this happens with HalfLife, libMiles load code directly from .mix and other file like that)
|
||||
// unprotectDB((uintptr_t)p, count-ret);
|
||||
// int l;
|
||||
// do {
|
||||
// l = read(fd, p, count-ret);
|
||||
// if(l>0) {
|
||||
// p+=l; ret+=l;
|
||||
// }
|
||||
// } while(l>0);
|
||||
// }
|
||||
// }
|
||||
//#endif
|
||||
// return ret;
|
||||
//}
|
||||
|
||||
EXPORT int32_t my_open64(x64emu_t* emu, void* pathname, int32_t flags, uint32_t mode)
|
||||
{
|
||||
@@ -1509,17 +1348,6 @@ EXPORT int32_t my_open64(x64emu_t* emu, void* pathname, int32_t flags, uint32_t
|
||||
lseek(tmp, 0, SEEK_SET);
|
||||
return tmp;
|
||||
}
|
||||
if(isCpuTopology((const char*)pathname)!=-1) {
|
||||
int n = isCpuTopology((const char*)pathname);
|
||||
char buf[512];
|
||||
snprintf(buf, 512, TMP_CPUTOPO, n);
|
||||
int tmp = shm_open(buf, O_RDWR | O_CREAT, S_IRWXU);
|
||||
if(tmp<0) return open64(pathname, flags, mode); // error fallback
|
||||
shm_unlink(buf); // remove the shm file, but it will still exist because it's currently in use
|
||||
CreateCPUTopologyCoreID(tmp, n);
|
||||
lseek(tmp, 0, SEEK_SET);
|
||||
return tmp;
|
||||
}
|
||||
#endif
|
||||
return open64(pathname, flags, mode);
|
||||
}
|
||||
@@ -1545,17 +1373,6 @@ EXPORT FILE* my_fopen(x64emu_t* emu, const char* path, const char* mode)
|
||||
lseek(tmp, 0, SEEK_SET);
|
||||
return fdopen(tmp, mode);
|
||||
}
|
||||
if(isCpuTopology(path)!=-1) {
|
||||
int n = isCpuTopology(path);
|
||||
char buf[512];
|
||||
snprintf(buf, 512, TMP_CPUTOPO, n);
|
||||
int tmp = shm_open(buf, O_RDWR | O_CREAT, S_IRWXU);
|
||||
if(tmp<0) return fopen(path, mode); // error fallback
|
||||
shm_unlink(buf); // remove the shm file, but it will still exist because it's currently in use
|
||||
CreateCPUTopologyCoreID(tmp, n);
|
||||
lseek(tmp, 0, SEEK_SET);
|
||||
return fdopen(tmp, mode);;
|
||||
}
|
||||
#endif
|
||||
if(isProcSelf(path, "exe")) {
|
||||
return fopen(emu->context->fullpath, mode);
|
||||
@@ -1584,17 +1401,6 @@ EXPORT FILE* my_fopen64(x64emu_t* emu, const char* path, const char* mode)
|
||||
lseek(tmp, 0, SEEK_SET);
|
||||
return fdopen(tmp, mode);
|
||||
}
|
||||
if(isCpuTopology(path)!=-1) {
|
||||
int n = isCpuTopology(path);
|
||||
char buf[512];
|
||||
snprintf(buf, 512, TMP_CPUTOPO, n);
|
||||
int tmp = shm_open(buf, O_RDWR | O_CREAT, S_IRWXU);
|
||||
if(tmp<0) return fopen(path, mode); // error fallback
|
||||
shm_unlink(buf); // remove the shm file, but it will still exist because it's currently in use
|
||||
CreateCPUTopologyCoreID(tmp, n);
|
||||
lseek(tmp, 0, SEEK_SET);
|
||||
return fdopen(tmp, mode);;
|
||||
}
|
||||
#endif
|
||||
if(isProcSelf(path, "exe")) {
|
||||
return fopen64(emu->context->fullpath, mode);
|
||||
@@ -1603,27 +1409,7 @@ EXPORT FILE* my_fopen64(x64emu_t* emu, const char* path, const char* mode)
|
||||
}
|
||||
|
||||
|
||||
EXPORT int my_mkstemps64(x64emu_t* emu, char* template, int suffixlen)
|
||||
{
|
||||
library_t* lib = my_lib;
|
||||
if(!lib) return 0;
|
||||
void* f = dlsym(lib->priv.w.lib, "mkstemps64");
|
||||
if(f)
|
||||
return ((iFpi_t)f)(template, suffixlen);
|
||||
// implement own version...
|
||||
// TODO: check size of template, and if really XXXXXX is there
|
||||
char* fname = strdup(template);
|
||||
do {
|
||||
strcpy(fname, template);
|
||||
char num[8];
|
||||
sprintf(num, "%06d", rand()%999999);
|
||||
memcpy(fname+strlen(fname)-suffixlen-6, num, 6);
|
||||
} while(!FileExist(fname, -1));
|
||||
int ret = open64(fname, O_EXCL);
|
||||
free(fname);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if 0
|
||||
EXPORT int32_t my_ftw(x64emu_t* emu, void* pathname, void* B, int32_t nopenfd)
|
||||
{
|
||||
static iFppi_t f = NULL;
|
||||
@@ -1724,14 +1510,14 @@ EXPORT int32_t my_nftw64(x64emu_t* emu, void* pathname, void* B, int32_t nopenfd
|
||||
{
|
||||
return nftw64(pathname, findnftw64Fct(B), nopenfd, flags);
|
||||
}
|
||||
|
||||
#endif
|
||||
EXPORT int32_t my_execv(x64emu_t* emu, const char* path, char* const argv[])
|
||||
{
|
||||
int self = isProcSelf(path, "exe");
|
||||
int x86 = FileIsX86ELF(path);
|
||||
int x86 = FileIsX64ELF(path);
|
||||
printf_log(LOG_DEBUG, "execv(\"%s\", %p) is x86=%d\n", path, argv, x86);
|
||||
#if 1
|
||||
if ((x86 || self) && argv) {
|
||||
if (x86 || self) {
|
||||
int skip_first = 0;
|
||||
if(strlen(path)>=strlen("wine-preloader") && strcmp(path+strlen(path)-strlen("wine-preloader"), "wine-preloader")==0)
|
||||
skip_first++;
|
||||
@@ -1748,18 +1534,16 @@ EXPORT int32_t my_execv(x64emu_t* emu, const char* path, char* const argv[])
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
if(self && !argv)
|
||||
return execv(emu->context->box64path, argv);
|
||||
return execv(path, argv);
|
||||
}
|
||||
|
||||
EXPORT int32_t my_execve(x64emu_t* emu, const char* path, char* const argv[], char* const envp[])
|
||||
{
|
||||
int self = isProcSelf(path, "exe");
|
||||
int x86 = FileIsX86ELF(path);
|
||||
int x86 = FileIsX64ELF(path);
|
||||
printf_log(LOG_DEBUG, "execv(\"%s\", %p) is x86=%d\n", path, argv, x86);
|
||||
#if 1
|
||||
if ((x86 || self) && argv) {
|
||||
if (x86 || self) {
|
||||
int skip_first = 0;
|
||||
if(strlen(path)>=strlen("wine-preloader") && strcmp(path+strlen(path)-strlen("wine-preloader"), "wine-preloader")==0)
|
||||
skip_first++;
|
||||
@@ -1776,8 +1560,6 @@ EXPORT int32_t my_execve(x64emu_t* emu, const char* path, char* const argv[], ch
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
if(self && !argv)
|
||||
return execve(emu->context->box64path, argv, envp);
|
||||
return execve(path, argv, envp);
|
||||
}
|
||||
|
||||
@@ -1786,12 +1568,14 @@ EXPORT int32_t my_execvp(x64emu_t* emu, const char* path, char* const argv[])
|
||||
{
|
||||
// need to use BOX86_PATH / PATH here...
|
||||
char* fullpath = ResolveFile(path, &my_context->box64_path);
|
||||
if(!fullpath)
|
||||
fullpath = strdup(path);
|
||||
// use fullpath...
|
||||
int self = isProcSelf(fullpath, "exe");
|
||||
int x86 = FileIsX86ELF(fullpath);
|
||||
int x86 = FileIsX64ELF(fullpath);
|
||||
printf_log(LOG_DEBUG, "execvp(\"%s\", %p), IsX86=%d / fullpath=\"%s\"\n", path, argv, x86, fullpath);
|
||||
free(fullpath);
|
||||
if ((x86 || self) && argv) {
|
||||
if (x86 || self) {
|
||||
// count argv...
|
||||
int i=0;
|
||||
while(argv[i]) ++i;
|
||||
@@ -1805,12 +1589,37 @@ EXPORT int32_t my_execvp(x64emu_t* emu, const char* path, char* const argv[])
|
||||
free(newargv);
|
||||
return ret;
|
||||
}
|
||||
if(self && !argv)
|
||||
return execvp(emu->context->box64path, argv);
|
||||
// fullpath is gone, so the search will only be on PATH, not on BOX86_PATH (is that an issue?)
|
||||
return execvp(path, argv);
|
||||
}
|
||||
|
||||
EXPORT int32_t my_execlp(x64emu_t* emu, const char* path)
|
||||
{
|
||||
// need to use BOX86_PATH / PATH here...
|
||||
char* fullpath = ResolveFile(path, &my_context->box64_path);
|
||||
if(!fullpath)
|
||||
fullpath = strdup(path);
|
||||
// use fullpath...
|
||||
int self = isProcSelf(fullpath, "exe");
|
||||
int x86 = FileIsX64ELF(fullpath);
|
||||
printf_log(LOG_DEBUG, "execvp(\"%s\", ...), IsX86=%d / fullpath=\"%s\"\n", path, x86, fullpath);
|
||||
free(fullpath);
|
||||
// count argv...
|
||||
int i=0;
|
||||
while(getVargN(emu, i+1)) ++i;
|
||||
char** newargv = (char**)calloc(i+((x86 || self)?2:1), sizeof(char*));
|
||||
int j=0;
|
||||
if ((x86 || self))
|
||||
newargv[j++] = emu->context->box64path;
|
||||
for (int k=0; k<i; ++k)
|
||||
newargv[j++] = getVargN(emu, k+1);
|
||||
if(self) newargv[1] = emu->context->fullpath;
|
||||
printf_log(LOG_DEBUG, " => execlp(\"%s\", %p [\"%s\", \"%s\"...:%d])\n", newargv[0], newargv, newargv[1], i?newargv[2]:"", i);
|
||||
int ret = execvp(newargv[0], newargv);
|
||||
free(newargv);
|
||||
return ret;
|
||||
}
|
||||
#if 0
|
||||
// execvp should use PATH to search for the program first
|
||||
EXPORT int32_t my_posix_spawnp(x64emu_t* emu, pid_t* pid, const char* path,
|
||||
const posix_spawn_file_actions_t *actions, const posix_spawnattr_t* attrp, char* const argv[], char* const envp[])
|
||||
@@ -1819,7 +1628,7 @@ EXPORT int32_t my_posix_spawnp(x64emu_t* emu, pid_t* pid, const char* path,
|
||||
char* fullpath = ResolveFile(path, &my_context->box64_path);
|
||||
// use fullpath...
|
||||
int self = isProcSelf(fullpath, "exe");
|
||||
int x86 = FileIsX86ELF(fullpath);
|
||||
int x86 = FileIsX64ELF(fullpath);
|
||||
printf_log(LOG_DEBUG, "posix_spawnp(%p, \"%s\", %p, %p, %p, %p), IsX86=%d / fullpath=\"%s\"\n", pid, path, actions, attrp, argv, envp, x86, fullpath);
|
||||
free(fullpath);
|
||||
if ((x86 || self)) {
|
||||
@@ -1840,7 +1649,7 @@ EXPORT int32_t my_posix_spawnp(x64emu_t* emu, pid_t* pid, const char* path,
|
||||
// fullpath is gone, so the search will only be on PATH, not on BOX86_PATH (is that an issue?)
|
||||
return posix_spawnp(pid, path, actions, attrp, argv, envp);
|
||||
}
|
||||
|
||||
#endif
|
||||
EXPORT void my__Jv_RegisterClasses() {}
|
||||
|
||||
EXPORT int32_t my___cxa_thread_atexit_impl(x64emu_t* emu, void* dtor, void* obj, void* dso)
|
||||
@@ -1857,7 +1666,7 @@ EXPORT unsigned long int my___fdelt_chk (unsigned long int d)
|
||||
|
||||
return d / __NFDBITS;
|
||||
}
|
||||
|
||||
#if 0
|
||||
EXPORT int32_t my_getrandom(x64emu_t* emu, void* buf, uint32_t buflen, uint32_t flags)
|
||||
{
|
||||
// not always implemented on old linux version...
|
||||
@@ -1928,7 +1737,7 @@ EXPORT int32_t my___poll_chk(void* a, uint32_t b, int c, int l)
|
||||
{
|
||||
return poll(a, b, c); // no check...
|
||||
}
|
||||
|
||||
#endif
|
||||
EXPORT int32_t my_fcntl64(x64emu_t* emu, int32_t a, int32_t b, uint32_t d1, uint32_t d2, uint32_t d3, uint32_t d4, uint32_t d5, uint32_t d6)
|
||||
{
|
||||
// Implemented starting glibc 2.14+
|
||||
@@ -1937,6 +1746,7 @@ EXPORT int32_t my_fcntl64(x64emu_t* emu, int32_t a, int32_t b, uint32_t d1, uint
|
||||
iFiiV_t f = dlsym(lib->priv.w.lib, "fcntl64");
|
||||
if(b==F_SETFL)
|
||||
d1 = of_convert(d1);
|
||||
#if 0
|
||||
if(b==F_GETLK64 || b==F_SETLK64 || b==F_SETLKW64)
|
||||
{
|
||||
my_flock64_t fl;
|
||||
@@ -1945,6 +1755,7 @@ EXPORT int32_t my_fcntl64(x64emu_t* emu, int32_t a, int32_t b, uint32_t d1, uint
|
||||
UnalignFlock64((void*)d1, &fl);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
//TODO: check if better to use the syscall or regular fcntl?
|
||||
//return syscall(__NR_fcntl64, a, b, d1); // should be enough
|
||||
int ret = f?f(a, b, d1):fcntl(a, b, d1);
|
||||
@@ -1968,6 +1779,7 @@ EXPORT int32_t my_fcntl(x64emu_t* emu, int32_t a, int32_t b, uint32_t d1, uint32
|
||||
}
|
||||
if(b==F_SETFL)
|
||||
d1 = of_convert(d1);
|
||||
#if 0
|
||||
if(b==F_GETLK64 || b==F_SETLK64 || b==F_SETLKW64)
|
||||
{
|
||||
my_flock64_t fl;
|
||||
@@ -1976,6 +1788,7 @@ EXPORT int32_t my_fcntl(x64emu_t* emu, int32_t a, int32_t b, uint32_t d1, uint32
|
||||
UnalignFlock64((void*)d1, &fl);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
int ret = fcntl(a, b, d1);
|
||||
if(b==F_GETFL && ret!=-1)
|
||||
ret = of_unconvert(ret);
|
||||
@@ -1983,7 +1796,7 @@ EXPORT int32_t my_fcntl(x64emu_t* emu, int32_t a, int32_t b, uint32_t d1, uint32
|
||||
return ret;
|
||||
}
|
||||
EXPORT int32_t my___fcntl(x64emu_t* emu, int32_t a, int32_t b, uint32_t d1, uint32_t d2, uint32_t d3, uint32_t d4, uint32_t d5, uint32_t d6) __attribute__((alias("my_fcntl")));
|
||||
|
||||
#if 0
|
||||
EXPORT int32_t my_preadv64(x64emu_t* emu, int32_t fd, void* v, int32_t c, int64_t o)
|
||||
{
|
||||
library_t* lib = my_lib;
|
||||
|
||||
+429
-435
File diff suppressed because it is too large.
Load diff
@@ -186,7 +186,7 @@ int my_dlsym_lib(library_t* lib, const char* rsymbol, uintptr_t *start, uintptr_
|
||||
void* my_dlsym(x64emu_t* emu, void *handle, void *symbol)
|
||||
{
|
||||
dlprivate_t *dl = emu->context->dlprivate;
|
||||
uintptr_t start, end;
|
||||
uintptr_t start = 0, end = 0;
|
||||
char* rsymbol = (char*)symbol;
|
||||
CLEARERR
|
||||
if(dlsym_error && box64_log<LOG_DEBUG) {
|
||||
|
||||
Executable
+194
@@ -0,0 +1,194 @@
|
||||
#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 "wrapper.h"
|
||||
#include "bridge.h"
|
||||
#include "librarian/library_private.h"
|
||||
#include "x64emu.h"
|
||||
#include "emu/x64emu_private.h"
|
||||
#include "box64context.h"
|
||||
#include "librarian.h"
|
||||
#include "callback.h"
|
||||
|
||||
extern char* libGL;
|
||||
|
||||
const char* libglName = "libGL.so.1";
|
||||
#define LIBNAME libgl
|
||||
|
||||
void fillGLProcWrapper(box64context_t*);
|
||||
void freeProcWrapper(kh_symbolmap_t** symbolmap);
|
||||
|
||||
EXPORT void* my_glXGetProcAddress(x64emu_t* emu, void* name)
|
||||
{
|
||||
khint_t k;
|
||||
const char* rname = (const char*)name;
|
||||
if(dlsym_error && box64_log<LOG_DEBUG) printf_log(LOG_NONE, "Calling glXGetProcAddress(\"%s\") => ", rname);
|
||||
if(!emu->context->glwrappers)
|
||||
fillGLProcWrapper(emu->context);
|
||||
// check if glxprocaddress is filled, and search for lib and fill it if needed
|
||||
// get proc adress using actual glXGetProcAddress
|
||||
k = kh_get(symbolmap, emu->context->glmymap, rname);
|
||||
int is_my = (k==kh_end(emu->context->glmymap))?0:1;
|
||||
void* symbol;
|
||||
if(is_my) {
|
||||
// try again, by using custom "my_" now...
|
||||
char tmp[200];
|
||||
strcpy(tmp, "my_");
|
||||
strcat(tmp, rname);
|
||||
symbol = dlsym(emu->context->box64lib, tmp);
|
||||
} else
|
||||
symbol = emu->context->glxprocaddress(rname);
|
||||
if(!symbol) {
|
||||
if(dlsym_error && box64_log<LOG_DEBUG) printf_log(LOG_NONE, "%p\n", NULL);
|
||||
return NULL; // easy
|
||||
}
|
||||
// check if alread bridged
|
||||
uintptr_t ret = CheckBridged(emu->context->system, symbol);
|
||||
if(ret) {
|
||||
if(dlsym_error && box64_log<LOG_DEBUG) printf_log(LOG_NONE, "%p\n", (void*)ret);
|
||||
return (void*)ret; // already bridged
|
||||
}
|
||||
// get wrapper
|
||||
k = kh_get(symbolmap, emu->context->glwrappers, rname);
|
||||
if(k==kh_end(emu->context->glwrappers) && strstr(rname, "ARB")==NULL) {
|
||||
// try again, adding ARB at the end if not present
|
||||
char tmp[200];
|
||||
strcpy(tmp, rname);
|
||||
strcat(tmp, "ARB");
|
||||
k = kh_get(symbolmap, emu->context->glwrappers, tmp);
|
||||
}
|
||||
if(k==kh_end(emu->context->glwrappers) && strstr(rname, "EXT")==NULL) {
|
||||
// try again, adding EXT at the end if not present
|
||||
char tmp[200];
|
||||
strcpy(tmp, rname);
|
||||
strcat(tmp, "EXT");
|
||||
k = kh_get(symbolmap, emu->context->glwrappers, tmp);
|
||||
}
|
||||
if(k==kh_end(emu->context->glwrappers)) {
|
||||
if(dlsym_error && box64_log<LOG_DEBUG) printf_log(LOG_NONE, "%p\n", NULL);
|
||||
if(dlsym_error && box64_log<LOG_INFO) printf_log(LOG_NONE, "Warning, no wrapper for %s\n", rname);
|
||||
return NULL;
|
||||
}
|
||||
const char* constname = kh_key(emu->context->glwrappers, k);
|
||||
AddOffsetSymbol(emu->context->maplib, symbol, rname);
|
||||
ret = AddBridge(emu->context->system, kh_value(emu->context->glwrappers, k), symbol, 0, constname);
|
||||
if(dlsym_error && box64_log<LOG_DEBUG) printf_log(LOG_NONE, "%p\n", (void*)ret);
|
||||
return (void*)ret;
|
||||
|
||||
}
|
||||
EXPORT void* my_glXGetProcAddressARB(x64emu_t* emu, void* name) __attribute__((alias("my_glXGetProcAddress")));
|
||||
|
||||
typedef int (*iFi_t)(int);
|
||||
typedef void (*vFpp_t)(void*, void*);
|
||||
typedef void (*debugProc_t)(int32_t, int32_t, uint32_t, int32_t, int32_t, void*, void*);
|
||||
|
||||
#define SUPER() \
|
||||
GO(0) \
|
||||
GO(1) \
|
||||
GO(2) \
|
||||
GO(3) \
|
||||
GO(4)
|
||||
|
||||
// debug_callback ...
|
||||
#define GO(A) \
|
||||
static uintptr_t my_debug_callback_fct_##A = 0; \
|
||||
static void my_debug_callback_##A(int32_t a, int32_t b, uint32_t c, int32_t d, int32_t e, const char* f, const void* g) \
|
||||
{ \
|
||||
RunFunction(my_context, my_debug_callback_fct_##A, 7, a, b, c, d, e, f, g); \
|
||||
}
|
||||
SUPER()
|
||||
#undef GO
|
||||
static void* find_debug_callback_Fct(void* fct)
|
||||
{
|
||||
if(!fct) return fct;
|
||||
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
|
||||
#define GO(A) if(my_debug_callback_fct_##A == (uintptr_t)fct) return my_debug_callback_##A;
|
||||
SUPER()
|
||||
#undef GO
|
||||
#define GO(A) if(my_debug_callback_fct_##A == 0) {my_debug_callback_fct_##A = (uintptr_t)fct; return my_debug_callback_##A; }
|
||||
SUPER()
|
||||
#undef GO
|
||||
printf_log(LOG_NONE, "Warning, no more slot for libGL debug_callback callback\n");
|
||||
return NULL;
|
||||
}
|
||||
#undef SUPER
|
||||
|
||||
EXPORT void my_glDebugMessageCallback(x64emu_t* emu, void* prod, void* param)
|
||||
{
|
||||
static vFpp_t DebugMessageCallback = NULL;
|
||||
static int init = 1;
|
||||
if(init) {
|
||||
DebugMessageCallback = emu->context->glxprocaddress("glDebugMessageCallback");
|
||||
init = 0;
|
||||
}
|
||||
if(!DebugMessageCallback)
|
||||
return;
|
||||
DebugMessageCallback(find_debug_callback_Fct(prod), param);
|
||||
}
|
||||
EXPORT void my_glDebugMessageCallbackARB(x64emu_t* emu, void* prod, void* param) __attribute__((alias("my_glDebugMessageCallback")));
|
||||
|
||||
EXPORT int my_glXSwapIntervalMESA(int interval)
|
||||
{
|
||||
static iFi_t SwapIntervalMESA = NULL;
|
||||
static int init = 1;
|
||||
if(init) {
|
||||
SwapIntervalMESA = my_context->glxprocaddress("glXSwapIntervalMESA");
|
||||
init = 0;
|
||||
}
|
||||
if(!SwapIntervalMESA)
|
||||
return 0;
|
||||
return SwapIntervalMESA(interval);
|
||||
}
|
||||
|
||||
#define PRE_INIT if(libGL) {lib->priv.w.lib = dlopen(libGL, RTLD_LAZY | RTLD_GLOBAL); lib->path = strdup(libGL);} else
|
||||
#define CUSTOM_INIT \
|
||||
lib->priv.w.priv = dlsym(lib->priv.w.lib, "glXGetProcAddress"); \
|
||||
box64->glxprocaddress = lib->priv.w.priv;
|
||||
|
||||
|
||||
#include "wrappedlib_init.h"
|
||||
|
||||
void fillGLProcWrapper(box64context_t* context)
|
||||
{
|
||||
int cnt, ret;
|
||||
khint_t k;
|
||||
kh_symbolmap_t * symbolmap = kh_init(symbolmap);
|
||||
// populates maps...
|
||||
cnt = sizeof(libglsymbolmap)/sizeof(map_onesymbol_t);
|
||||
for (int i=0; i<cnt; ++i) {
|
||||
k = kh_put(symbolmap, symbolmap, libglsymbolmap[i].name, &ret);
|
||||
kh_value(symbolmap, k) = libglsymbolmap[i].w;
|
||||
}
|
||||
// and the my_ symbols map
|
||||
cnt = sizeof(MAPNAME(mysymbolmap))/sizeof(map_onesymbol_t);
|
||||
for (int i=0; i<cnt; ++i) {
|
||||
k = kh_put(symbolmap, symbolmap, libglmysymbolmap[i].name, &ret);
|
||||
kh_value(symbolmap, k) = libglmysymbolmap[i].w;
|
||||
}
|
||||
context->glwrappers = symbolmap;
|
||||
// my_* map
|
||||
symbolmap = kh_init(symbolmap);
|
||||
cnt = sizeof(MAPNAME(mysymbolmap))/sizeof(map_onesymbol_t);
|
||||
for (int i=0; i<cnt; ++i) {
|
||||
k = kh_put(symbolmap, symbolmap, libglmysymbolmap[i].name, &ret);
|
||||
kh_value(symbolmap, k) = libglmysymbolmap[i].w;
|
||||
}
|
||||
context->glmymap = symbolmap;
|
||||
}
|
||||
void freeGLProcWrapper(box64context_t* context)
|
||||
{
|
||||
if(!context)
|
||||
return;
|
||||
if(context->glwrappers)
|
||||
kh_destroy(symbolmap, context->glwrappers);
|
||||
if(context->glmymap)
|
||||
kh_destroy(symbolmap, context->glmymap);
|
||||
context->glwrappers = NULL;
|
||||
context->glmymap = NULL;
|
||||
}
|
||||
Executable
+3005
File diff suppressed because it is too large.
Load diff
Executable
+174
@@ -0,0 +1,174 @@
|
||||
#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 "wrapper.h"
|
||||
#include "bridge.h"
|
||||
#include "librarian/library_private.h"
|
||||
#include "x64emu.h"
|
||||
#include "emu/x64emu_private.h"
|
||||
#include "callback.h"
|
||||
#include "librarian.h"
|
||||
#include "box64context.h"
|
||||
#include "emu/x64emu_private.h"
|
||||
#include "myalign.h"
|
||||
|
||||
typedef void (*vFpip_t)(void*, int32_t, void*);
|
||||
|
||||
static library_t* my_lib = NULL;
|
||||
|
||||
#define SUPER() \
|
||||
GO(gluQuadricCallback, vFpip_t) \
|
||||
GO(gluTessCallback, vFpip_t) \
|
||||
GO(gluNurbsCallback, vFpip_t)
|
||||
|
||||
typedef struct libglu_my_s {
|
||||
// functions
|
||||
#define GO(A, B) B A;
|
||||
SUPER()
|
||||
#undef GO
|
||||
} libglu_my_t;
|
||||
|
||||
void* getGLUMy(library_t* lib)
|
||||
{
|
||||
libglu_my_t* my = (libglu_my_t*)calloc(1, sizeof(libglu_my_t));
|
||||
#define GO(A, W) my->A = (W)dlsym(lib->priv.w.lib, #A);
|
||||
SUPER()
|
||||
#undef GO
|
||||
return my;
|
||||
}
|
||||
|
||||
void freeGLUMy(void* lib)
|
||||
{
|
||||
//libglu_my_t *my = (libglu_my_t *)lib;
|
||||
}
|
||||
#undef SUPER
|
||||
|
||||
#define SUPER() \
|
||||
GO(0) \
|
||||
GO(1) \
|
||||
GO(2) \
|
||||
GO(3) \
|
||||
GO(4) \
|
||||
GO(5) \
|
||||
GO(6) \
|
||||
GO(7) \
|
||||
GO(8) \
|
||||
GO(9) \
|
||||
|
||||
// glu_callback
|
||||
#define GO(A) \
|
||||
static uintptr_t my_glu_callback_fct_##A = 0; \
|
||||
static void my_glu_callback_##A(void* a, void* b) \
|
||||
{ \
|
||||
RunFunction(my_context, my_glu_callback_fct_##A, 2, a, b); \
|
||||
}
|
||||
SUPER()
|
||||
#undef GO
|
||||
static void* findglu_callbackFct(void* fct)
|
||||
{
|
||||
if(!fct) return fct;
|
||||
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
|
||||
#define GO(A) if(my_glu_callback_fct_##A == (uintptr_t)fct) return my_glu_callback_##A;
|
||||
SUPER()
|
||||
#undef GO
|
||||
#define GO(A) if(my_glu_callback_fct_##A == 0) {my_glu_callback_fct_##A = (uintptr_t)fct; return my_glu_callback_##A; }
|
||||
SUPER()
|
||||
#undef GO
|
||||
printf_log(LOG_NONE, "Warning, no more slot for Jpeg glu_callback callback\n");
|
||||
return NULL;
|
||||
}
|
||||
// glu_callback4
|
||||
#define GO(A) \
|
||||
static uintptr_t my_glu_callback4_fct_##A = 0; \
|
||||
static void my_glu_callback4_##A(void* a, void* b, void* c, void* d) \
|
||||
{ \
|
||||
RunFunction(my_context, my_glu_callback4_fct_##A, 4, a, b, c, d); \
|
||||
}
|
||||
SUPER()
|
||||
#undef GO
|
||||
static void* findglu_callback4Fct(void* fct)
|
||||
{
|
||||
if(!fct) return fct;
|
||||
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
|
||||
#define GO(A) if(my_glu_callback4_fct_##A == (uintptr_t)fct) return my_glu_callback4_##A;
|
||||
SUPER()
|
||||
#undef GO
|
||||
#define GO(A) if(my_glu_callback4_fct_##A == 0) {my_glu_callback4_fct_##A = (uintptr_t)fct; return my_glu_callback4_##A; }
|
||||
SUPER()
|
||||
#undef GO
|
||||
printf_log(LOG_NONE, "Warning, no more slot for Jpeg glu_callback4 callback\n");
|
||||
return NULL;
|
||||
}
|
||||
// glu_callback5
|
||||
#define GO(A) \
|
||||
static uintptr_t my_glu_callback5_fct_##A = 0; \
|
||||
static void my_glu_callback5_##A(void* a, void* b, void* c, void* d, void* e) \
|
||||
{ \
|
||||
RunFunction(my_context, my_glu_callback5_fct_##A, 5, a, b, c, d, e); \
|
||||
}
|
||||
SUPER()
|
||||
#undef GO
|
||||
static void* findglu_callback5Fct(void* fct)
|
||||
{
|
||||
if(!fct) return fct;
|
||||
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
|
||||
#define GO(A) if(my_glu_callback5_fct_##A == (uintptr_t)fct) return my_glu_callback5_##A;
|
||||
SUPER()
|
||||
#undef GO
|
||||
#define GO(A) if(my_glu_callback5_fct_##A == 0) {my_glu_callback5_fct_##A = (uintptr_t)fct; return my_glu_callback5_##A; }
|
||||
SUPER()
|
||||
#undef GO
|
||||
printf_log(LOG_NONE, "Warning, no more slot for Jpeg glu_callback5 callback\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#undef SUPER
|
||||
|
||||
// There are many callback signatures: vFv, vFi, vFp, vFip and vFpp... so a generic wrapping to vFpp works
|
||||
// except for GLU_TESS_COMBINE and GLU_TESS_COMBINE_DATA
|
||||
#define GLU_TESS_COMBINE 100105
|
||||
#define GLU_TESS_COMBINE_DATA 100111
|
||||
void EXPORT my_gluQuadricCallback(x64emu_t* emu, void* a, int32_t b, void* cb)
|
||||
{
|
||||
libglu_my_t *my = (libglu_my_t*)my_lib->priv.w.p2;
|
||||
my->gluQuadricCallback(a, b, findglu_callbackFct(cb));
|
||||
}
|
||||
void EXPORT my_gluTessCallback(x64emu_t* emu, void* a, int32_t b, void* cb)
|
||||
{
|
||||
libglu_my_t *my = (libglu_my_t*)my_lib->priv.w.p2;
|
||||
if(b==GLU_TESS_COMBINE)
|
||||
my->gluTessCallback(a, b, findglu_callback4Fct(cb));
|
||||
else if(b==GLU_TESS_COMBINE_DATA)
|
||||
my->gluTessCallback(a, b, findglu_callback5Fct(cb));
|
||||
else
|
||||
my->gluTessCallback(a, b, findglu_callbackFct(cb));
|
||||
}
|
||||
void EXPORT my_gluNurbsCallback(x64emu_t* emu, void* a, int32_t b, void* cb)
|
||||
{
|
||||
libglu_my_t *my = (libglu_my_t*)my_lib->priv.w.p2;
|
||||
my->gluNurbsCallback(a, b, findglu_callbackFct(cb));
|
||||
}
|
||||
|
||||
const char* libgluName = "libGLU.so.1";
|
||||
#define LIBNAME libglu
|
||||
|
||||
#define CUSTOM_INIT \
|
||||
my_lib = lib; \
|
||||
lib->priv.w.p2 = getGLUMy(lib); \
|
||||
lib->priv.w.needed = 1; \
|
||||
lib->priv.w.neededlibs = (char**)calloc(lib->priv.w.needed, sizeof(char*)); \
|
||||
lib->priv.w.neededlibs[0] = strdup("libGL.so.1"); \
|
||||
|
||||
#define CUSTOM_FINI \
|
||||
freeGLUMy(lib->priv.w.p2); \
|
||||
free(lib->priv.w.p2); \
|
||||
my_lib = NULL;
|
||||
|
||||
|
||||
#include "wrappedlib_init.h"
|
||||
Executable
+63
@@ -0,0 +1,63 @@
|
||||
#if defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)
|
||||
|
||||
GO(gluBeginCurve,vFp)
|
||||
GO(gluBeginPolygon,vFp)
|
||||
GO(gluBeginSurface,vFp)
|
||||
GO(gluBeginTrim,vFp)
|
||||
GO(gluBuild1DMipmapLevels,iFiiiiiiiip)
|
||||
GO(gluBuild1DMipmaps,iFiiiiip)
|
||||
GO(gluBuild2DMipmapLevels,iFiiiiiiiiip)
|
||||
GO(gluBuild2DMipmaps,iFiiiiiip)
|
||||
GO(gluBuild3DMipmapLevels,iFiiiiiiiiiip)
|
||||
GO(gluBuild3DMipmaps,iFiiiiiiip)
|
||||
GO(gluCheckExtension,iFpp)
|
||||
GO(gluCylinder,vFpdddii)
|
||||
GO(gluDeleteNurbsRenderer,vFp)
|
||||
GO(gluDeleteQuadric,vFp)
|
||||
GO(gluDeleteTess,vFp)
|
||||
GO(gluDisk,vFpddii)
|
||||
GO(gluEndCurve,vFp)
|
||||
GO(gluEndPolygon,vFp)
|
||||
GO(gluEndSurface,vFp)
|
||||
GO(gluEndTrim,vFp)
|
||||
GO(gluErrorString,pFi)
|
||||
GO(gluGetNurbsProperty,vFpip)
|
||||
GO(gluGetString,pFi)
|
||||
GO(gluGetTessProperty,vFpip)
|
||||
GO(gluLoadSamplingMatrices,vFpppp)
|
||||
GO(gluLookAt,vFddddddddd)
|
||||
GO(gluNewNurbsRenderer,pFv)
|
||||
GO(gluNewQuadric,pFv)
|
||||
GO(gluNewTess,pFv)
|
||||
GO(gluNextContour,vFpi)
|
||||
GOM(gluNurbsCallback,vFEpip)
|
||||
GO(gluNurbsCallbackData,vFpp) // to check
|
||||
GO(gluNurbsCallbackDataEXT,vFpp) // to check
|
||||
GO(gluNurbsCurve,vFpipipii)
|
||||
GO(gluNurbsProperty,vFpif)
|
||||
GO(gluNurbsSurface,vFpipipiipiii)
|
||||
GO(gluOrtho2D,vFdddd)
|
||||
GO(gluPartialDisk,vFpddiidd)
|
||||
GO(gluPerspective,vFdddd)
|
||||
GO(gluPickMatrix,vFddddp)
|
||||
GO(gluProject,iFdddpppppp)
|
||||
GO(gluPwlCurve,vFpipii)
|
||||
GOM(gluQuadricCallback,vFEpip)
|
||||
GO(gluQuadricDrawStyle,vFpi)
|
||||
GO(gluQuadricNormals,vFpi)
|
||||
GO(gluQuadricOrientation,vFpi)
|
||||
GO(gluQuadricTexture,vFpi)
|
||||
GO(gluScaleImage,iFiiiipiiip)
|
||||
GO(gluSphere,vFpdii)
|
||||
GO(gluTessBeginContour,vFp)
|
||||
GO(gluTessBeginPolygon,vFpp)
|
||||
GOM(gluTessCallback,vFEpip)
|
||||
GO(gluTessEndContour,vFp)
|
||||
GO(gluTessEndPolygon,vFp)
|
||||
GO(gluTessNormal,vFpddd)
|
||||
GO(gluTessProperty,vFpid)
|
||||
GO(gluTessVertex,vFppp)
|
||||
GO(gluUnProject,iFdddpppppp)
|
||||
GO(gluUnProject4,iFddddpppddpppp)
|
||||
|
||||
#endif
|
||||
@@ -90,8 +90,8 @@ GO2(cbrtl, KFK, cbrt)
|
||||
//GOM(ccoshf, UFV) // Weak, return complex
|
||||
// ccoshl // Weak
|
||||
// ccosl // Weak
|
||||
//GOW(ceil, dFd)
|
||||
//GOW(ceilf, fFf)
|
||||
GOW(ceil, dFd)
|
||||
GOW(ceilf, fFf)
|
||||
// ceill // Weak
|
||||
//GOS(cexp, pFpV) // Weak, return complex
|
||||
//GOM(cexpf, UFV) // Weak, return complex
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#endif
|
||||
// General note: pthread_t is unsigned long int
|
||||
// cpu_set_t is a struct with an array, default size is fixed for all architecture
|
||||
// pthread_t is like unsigned long
|
||||
|
||||
// __errno_location
|
||||
// fork
|
||||
@@ -18,38 +19,38 @@ GOM(pthread_atfork, iFEppp)
|
||||
GOM(__pthread_atfork, iFEppp)
|
||||
GOM(pthread_attr_destroy, iFEp)
|
||||
// pthread_attr_getaffinity_np
|
||||
//GO(pthread_attr_getdetachstate, iFpp)
|
||||
//GO(pthread_attr_getguardsize, iFpp)
|
||||
//GO(pthread_attr_getinheritsched, iFpp)
|
||||
//GO(pthread_attr_getschedparam, iFpp)
|
||||
//GO(pthread_attr_getschedpolicy, iFpp)
|
||||
GO(pthread_attr_getdetachstate, iFpp)
|
||||
GO(pthread_attr_getguardsize, iFpp)
|
||||
GO(pthread_attr_getinheritsched, iFpp)
|
||||
GO(pthread_attr_getschedparam, iFpp)
|
||||
GO(pthread_attr_getschedpolicy, iFpp)
|
||||
GO(pthread_attr_getscope, iFpp)
|
||||
//GOM(pthread_attr_getstack, iFEppp)
|
||||
//GO(pthread_attr_getstackaddr, iFpp)
|
||||
//GO(pthread_attr_getstacksize, iFpp)
|
||||
GOM(pthread_attr_getstack, iFEppp)
|
||||
GO(pthread_attr_getstackaddr, iFpp)
|
||||
GO(pthread_attr_getstacksize, iFpp)
|
||||
GO(pthread_attr_init, iFp)
|
||||
//GOM(pthread_attr_setaffinity_np, iFEpup)
|
||||
//GO(pthread_attr_setdetachstate, iFpi)
|
||||
//GO(pthread_attr_setguardsize, iFpL)
|
||||
//GO(pthread_attr_setinheritsched, iFpi)
|
||||
//GO(pthread_attr_setschedparam, iFpp)
|
||||
//GO(pthread_attr_setschedpolicy, iFpi)
|
||||
//GO(pthread_attr_setscope, iFpi)
|
||||
//GOM(pthread_attr_setstack, iFEppL)
|
||||
//GO(pthread_attr_setstackaddr, iFpp)
|
||||
//GO(pthread_attr_setstacksize, iFpL)
|
||||
//GO(pthread_barrierattr_destroy, iFp)
|
||||
//GO(pthread_barrierattr_getpshared, iFpp)
|
||||
//GO(pthread_barrierattr_init, iFp)
|
||||
//GO(pthread_barrierattr_setpshared, iFpi)
|
||||
//GO(pthread_barrier_destroy, iFp)
|
||||
//GO(pthread_barrier_init, iFppu)
|
||||
//GO(pthread_barrier_wait, iFp)
|
||||
GO(pthread_attr_setaffinity_np, iFpLp)
|
||||
GO(pthread_attr_setdetachstate, iFpi)
|
||||
GO(pthread_attr_setguardsize, iFpL)
|
||||
GO(pthread_attr_setinheritsched, iFpi)
|
||||
GO(pthread_attr_setschedparam, iFpp)
|
||||
GO(pthread_attr_setschedpolicy, iFpi)
|
||||
GO(pthread_attr_setscope, iFpi)
|
||||
GOM(pthread_attr_setstack, iFEppL)
|
||||
GO(pthread_attr_setstackaddr, iFpp)
|
||||
GOM(pthread_attr_setstacksize, iFEpL)
|
||||
GO(pthread_barrierattr_destroy, iFp)
|
||||
GO(pthread_barrierattr_getpshared, iFpp)
|
||||
GO(pthread_barrierattr_init, iFp)
|
||||
GO(pthread_barrierattr_setpshared, iFpi)
|
||||
GO(pthread_barrier_destroy, iFp)
|
||||
GO(pthread_barrier_init, iFppu)
|
||||
GO(pthread_barrier_wait, iFp)
|
||||
GO(pthread_cancel, iFL)
|
||||
//GOM(_pthread_cleanup_pop, vFEpi)
|
||||
//GOM(_pthread_cleanup_pop_restore, vFEpi)
|
||||
//GOM(_pthread_cleanup_push, vFEppp)
|
||||
//GOM(_pthread_cleanup_push_defer, vFEppp)
|
||||
GOM(_pthread_cleanup_pop, vFEpi)
|
||||
GOM(_pthread_cleanup_pop_restore, vFEpi)
|
||||
GOM(_pthread_cleanup_push, vFEppp)
|
||||
GOM(_pthread_cleanup_push_defer, vFEppp)
|
||||
// __pthread_cleanup_routine
|
||||
GO(pthread_condattr_destroy, iFp)
|
||||
GO(pthread_condattr_getclock, iFpp)
|
||||
@@ -64,18 +65,17 @@ GOM(pthread_cond_signal, iFEp)
|
||||
GOM(pthread_cond_timedwait, iFEppp)
|
||||
GOM(pthread_cond_wait, iFEpp)
|
||||
GOM(pthread_create, iFEpppp)
|
||||
//GO(pthread_detach, iFu)
|
||||
GO(pthread_detach, iFL)
|
||||
GO(pthread_equal, iFLL)
|
||||
//GOM(pthread_exit, vFEp)
|
||||
//GOM(pthread_getaffinity_np, iFEpup)
|
||||
//GO(pthread_getattr_np, iFup)
|
||||
//GO(pthread_getconcurrency, iFv)
|
||||
//GO(pthread_getcpuclockid, iFup)
|
||||
//GO(pthread_getschedparam, iFupp)
|
||||
//GO(__pthread_getspecific, pFu)
|
||||
//GO(pthread_getspecific, pFu)
|
||||
GO(pthread_getschedparam, iFLpp)
|
||||
GO(__pthread_getspecific, pFL)
|
||||
GO(pthread_getspecific, pFL)
|
||||
//GOM(pthread_getname_np, iFEppu) //not present on Pandora
|
||||
//GOM(__pthread_initialize, vFv) // doesn't exist anymore...
|
||||
// __pthread_initialize_minimal
|
||||
GO(pthread_join, iFLp)
|
||||
GOM(__pthread_key_create, iFEpp)
|
||||
@@ -99,6 +99,7 @@ GO(pthread_mutexattr_setpshared, iFpi)
|
||||
GO(__pthread_mutexattr_settype, iFpi)
|
||||
GO(pthread_mutexattr_settype, iFpi)
|
||||
// pthread_mutex_consistent_np
|
||||
#ifdef NOALIGN
|
||||
GO(__pthread_mutex_destroy, iFp)
|
||||
GO(pthread_mutex_destroy, iFp)
|
||||
// pthread_mutex_getprioceiling
|
||||
@@ -112,6 +113,22 @@ GO(__pthread_mutex_trylock, iFp)
|
||||
GO(pthread_mutex_trylock, iFp)
|
||||
GO(__pthread_mutex_unlock, iFp)
|
||||
GO(pthread_mutex_unlock, iFp)
|
||||
#else
|
||||
// phtread_mutex_t is 40 bytes on x86_64, but 48bytes on ARM64
|
||||
GOM(__pthread_mutex_destroy, iFp)
|
||||
GOM(pthread_mutex_destroy, iFp)
|
||||
// pthread_mutex_getprioceiling
|
||||
GOM(__pthread_mutex_init, iFpp)
|
||||
GOM(pthread_mutex_init, iFpp)
|
||||
GOM(__pthread_mutex_lock, iFp)
|
||||
GOM(pthread_mutex_lock, iFp)
|
||||
// pthread_mutex_setprioceiling
|
||||
GOM(pthread_mutex_timedlock, iFpp)
|
||||
GOM(__pthread_mutex_trylock, iFp)
|
||||
GOM(pthread_mutex_trylock, iFp)
|
||||
GOM(__pthread_mutex_unlock, iFp)
|
||||
GOM(pthread_mutex_unlock, iFp)
|
||||
#endif
|
||||
GOM(pthread_once, iFEpp)
|
||||
GOM(__pthread_once, iFEpp)
|
||||
GOM(__pthread_register_cancel, vFEp)
|
||||
@@ -140,23 +157,23 @@ GO(pthread_rwlock_rdlock, iFp)
|
||||
//GO2(pthread_rwlock_wrlock, iFp, __pthread_rwlock_wrlock) // not always defined
|
||||
GO(pthread_self, LFv)
|
||||
//GOM(pthread_setaffinity_np, iFELup)
|
||||
//GO(pthread_setcancelstate, iFip)
|
||||
//GO(pthread_setcanceltype, iFip)
|
||||
//GO(pthread_setconcurrency, iFi)
|
||||
//GOM(pthread_setname_np, iFEpp) // not present on the Pandora
|
||||
//GO(pthread_setschedparam, iFuip)
|
||||
//GO(pthread_setschedprio, iFpi)
|
||||
//GO(__pthread_setspecific, iFup)
|
||||
//GO(pthread_setspecific, iFup)
|
||||
//GO(pthread_sigmask, iFipp)
|
||||
//GO(pthread_spin_destroy, iFp)
|
||||
//GO(pthread_spin_init, iFpi)
|
||||
//GO(pthread_spin_lock, iFp)
|
||||
//GO(pthread_spin_trylock, iFp)
|
||||
//GO(pthread_spin_unlock, iFp)
|
||||
//GO(pthread_testcancel, vFv)
|
||||
//GO(pthread_timedjoin_np, iFppp)
|
||||
//GO(pthread_tryjoin_np, iFpp)
|
||||
GO(pthread_setcancelstate, iFip)
|
||||
GO(pthread_setcanceltype, iFip)
|
||||
GO(pthread_setconcurrency, iFi)
|
||||
GO(pthread_setname_np, iFpp)
|
||||
GO(pthread_setschedparam, iFLip)
|
||||
GO(pthread_setschedprio, iFpi)
|
||||
GO(__pthread_setspecific, iFLp)
|
||||
GO(pthread_setspecific, iFLp)
|
||||
GO(pthread_sigmask, iFipp)
|
||||
GO(pthread_spin_destroy, iFp)
|
||||
GO(pthread_spin_init, iFpi)
|
||||
GO(pthread_spin_lock, iFp)
|
||||
GO(pthread_spin_trylock, iFp)
|
||||
GO(pthread_spin_unlock, iFp)
|
||||
GO(pthread_testcancel, vFv)
|
||||
GO(pthread_timedjoin_np, iFppp)
|
||||
GO(pthread_tryjoin_np, iFpp)
|
||||
GOM(__pthread_unregister_cancel, vFEp)
|
||||
// __pthread_unregister_cancel_restore
|
||||
// __pthread_unwind
|
||||
@@ -164,16 +181,16 @@ GOM(__pthread_unwind_next, vFEp)
|
||||
GO(pthread_yield, iFv)
|
||||
// raise
|
||||
// __res_state
|
||||
//GO(sem_close, iFp)
|
||||
//GO(sem_destroy, iFp)
|
||||
//GO(sem_getvalue, iFpp)
|
||||
//GO(sem_init, iFpiu)
|
||||
//GO(sem_open, pFpiuuuuuuu) // use a vararg at 3rd arg, so putting lots of args to be sure, even if only 2 are needed
|
||||
//GO(sem_post, iFp)
|
||||
//GO(sem_timedwait, iFpp)
|
||||
//GO(sem_trywait, iFp)
|
||||
//GO(sem_unlink, iFp)
|
||||
//GO(sem_wait, iFp)
|
||||
GO(sem_close, iFp)
|
||||
GO(sem_destroy, iFp)
|
||||
GO(sem_getvalue, iFpp)
|
||||
GO(sem_init, iFpiu)
|
||||
GO(sem_open, pFpOM)
|
||||
GO(sem_post, iFp)
|
||||
GO(sem_timedwait, iFpp)
|
||||
GO(sem_trywait, iFp)
|
||||
GO(sem_unlink, iFp)
|
||||
GO(sem_wait, iFp)
|
||||
// __sigaction
|
||||
// system
|
||||
// __vfork
|
||||
Executable
+856
@@ -0,0 +1,856 @@
|
||||
#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 "wrapper.h"
|
||||
#include "bridge.h"
|
||||
#include "librarian/library_private.h"
|
||||
#include "x64emu.h"
|
||||
#include "callback.h"
|
||||
#include "librarian.h"
|
||||
#include "box64context.h"
|
||||
#include "emu/x64emu_private.h"
|
||||
|
||||
const char* libx11Name = "libX11.so.6";
|
||||
#define LIBNAME libx11
|
||||
|
||||
extern int x11threads;
|
||||
extern int x11glx;
|
||||
|
||||
typedef int (*XErrorHandler)(void *, void *);
|
||||
void* my_XSetErrorHandler(x64emu_t* t, XErrorHandler handler);
|
||||
typedef int (*XIOErrorHandler)(void *);
|
||||
void* my_XSetIOErrorHandler(x64emu_t* t, XIOErrorHandler handler);
|
||||
void* my_XESetCloseDisplay(x64emu_t* emu, void* display, int32_t extension, void* handler);
|
||||
typedef int (*WireToEventProc)(void*, void*, void*);
|
||||
typedef int(*EventHandler) (void*,void*,void*);
|
||||
int32_t my_XIfEvent(x64emu_t* emu, void* d,void* ev, EventHandler h, void* arg);
|
||||
|
||||
typedef struct XImageSave_s {
|
||||
int anyEmu;
|
||||
void* create;
|
||||
void* destroy;
|
||||
void* get;
|
||||
void* put;
|
||||
void* sub;
|
||||
void* add;
|
||||
} XImageSave_t;
|
||||
|
||||
typedef struct ximage_s {
|
||||
void*(*create_image)(
|
||||
void* /* display */,
|
||||
void* /* visual */,
|
||||
uint32_t /* depth */,
|
||||
int32_t /* format */,
|
||||
int32_t /* offset */,
|
||||
void* /* data */,
|
||||
uint32_t /* width */,
|
||||
uint32_t /* height */,
|
||||
int32_t /* bitmap_pad */,
|
||||
int32_t /* bytes_per_line */);
|
||||
int32_t (*destroy_image) (void*);
|
||||
uintptr_t (*get_pixel) (void*, int32_t, int32_t);
|
||||
int32_t (*put_pixel) (void*, int32_t, int32_t, uintptr_t);
|
||||
void*(*sub_image) (void*, int32_t, int32_t, uint32_t, uint32_t); //sub_image return a new XImage that need bridging => custom wrapper
|
||||
int32_t (*add_pixel) (void*, intptr_t);
|
||||
} ximage_t;
|
||||
|
||||
typedef struct _XImage {
|
||||
int32_t width, height; /* size of image */
|
||||
int32_t xoffset; /* number of pixels offset in X direction */
|
||||
int32_t format; /* XYBitmap, XYPixmap, ZPixmap */
|
||||
void* data; /* pointer to image data */
|
||||
int32_t byte_order; /* data byte order, LSBFirst, MSBFirst */
|
||||
int32_t bitmap_unit; /* quant. of scanline 8, 16, 32 */
|
||||
int32_t bitmap_bit_order; /* LSBFirst, MSBFirst */
|
||||
int32_t bitmap_pad; /* 8, 16, 32 either XY or ZPixmap */
|
||||
int32_t depth; /* depth of image */
|
||||
int32_t bytes_per_line; /* accelarator to next line */
|
||||
int32_t bits_per_pixel; /* bits per pixel (ZPixmap) */
|
||||
uintptr_t red_mask; /* bits in z arrangment */
|
||||
uintptr_t green_mask;
|
||||
uintptr_t blue_mask;
|
||||
void* obdata; /* hook for the object routines to hang on */
|
||||
ximage_t f;
|
||||
} XImage;
|
||||
|
||||
typedef uint32_t (*uFv_t)(void);
|
||||
typedef void (*vFp_t)(void*);
|
||||
typedef void* (*pFp_t)(void*);
|
||||
typedef void (*vFpp_t)(void*, void*);
|
||||
typedef void* (*pFpp_t)(void*, void*);
|
||||
typedef void* (*pFpi_t)(void*, int32_t);
|
||||
typedef void* (*pFpip_t)(void*, int32_t, void*);
|
||||
typedef int32_t (*iFp_t)(void*);
|
||||
typedef int32_t (*iFpi_t)(void*, int32_t);
|
||||
typedef int32_t (*iFpl_t)(void*, intptr_t);
|
||||
typedef int32_t (*iFppp_t)(void*, void*, void*);
|
||||
typedef int32_t (*iFppu_t)(void*, void*, uint32_t);
|
||||
typedef int32_t (*iFpppp_t)(void*, void*, void*, void*);
|
||||
typedef uint32_t (*uFpii_t)(void*, int32_t, int32_t);
|
||||
typedef uintptr_t (*LFpii_t)(void*, int32_t, int32_t);
|
||||
typedef int32_t (*iFpiiu_t)(void*, int32_t, int32_t, uint32_t);
|
||||
typedef int32_t (*iFpiiL_t)(void*, int32_t, int32_t, uintptr_t);
|
||||
typedef void* (*pFppup_t)(void*, void*, uint32_t, void*);
|
||||
typedef void* (*pFpiiuu_t)(void*, int32_t, int32_t, uint32_t, uint32_t);
|
||||
typedef void* (*pFppiiuuui_t)(void*, void*, int32_t, int32_t, uint32_t, uint32_t, uint32_t, int32_t);
|
||||
typedef void* (*pFppuiipuuii_t)(void*, void*, uint32_t, int32_t, int32_t, void*, uint32_t, uint32_t, int32_t, int32_t);
|
||||
typedef void* (*pFppiiuuuipii_t)(void*, void*, int32_t, int32_t, uint32_t, uint32_t, uint32_t, int32_t, void*, int32_t, int32_t);
|
||||
typedef int32_t (*iFppppiiiiuu_t)(void*, void*, void*, void*, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t);
|
||||
typedef int (*iFppppp_t)(void*, void*, void*, void*, void*);
|
||||
typedef int (*iFpppppp_t)(void*, void*, void*, void*, void*, void*);
|
||||
|
||||
#define SUPER() \
|
||||
GO(XSetErrorHandler, pFp_t) \
|
||||
GO(XSetIOErrorHandler, pFp_t) \
|
||||
GO(XESetError, pFpip_t) \
|
||||
GO(XESetCloseDisplay, pFpip_t) \
|
||||
GO(XIfEvent, iFpppp_t) \
|
||||
GO(XCheckIfEvent, iFpppp_t) \
|
||||
GO(XPeekIfEvent, iFpppp_t) \
|
||||
GO(XCreateImage, pFppuiipuuii_t) \
|
||||
GO(XInitImage, iFp_t) \
|
||||
GO(XGetImage, pFppiiuuui_t) \
|
||||
GO(XPutImage, iFppppiiiiuu_t) \
|
||||
GO(XGetSubImage, pFppiiuuuipii_t) \
|
||||
GO(XDestroyImage, vFp_t) \
|
||||
GO(_XDeqAsyncHandler, vFpp_t) \
|
||||
GO(XLoadQueryFont, pFpp_t) \
|
||||
GO(XCreateGC, pFppup_t) \
|
||||
GO(XSetBackground, iFppu_t) \
|
||||
GO(XSetForeground, iFppu_t) \
|
||||
GO(XESetWireToEvent, pFpip_t) \
|
||||
GO(XESetEventToWire, pFpip_t) \
|
||||
GO(XCloseDisplay, iFp_t) \
|
||||
GO(XOpenDisplay, pFp_t) \
|
||||
GO(XInitThreads, uFv_t) \
|
||||
GO(XRegisterIMInstantiateCallback, iFpppppp_t) \
|
||||
GO(XUnregisterIMInstantiateCallback, iFpppppp_t) \
|
||||
GO(XQueryExtension, iFppppp_t) \
|
||||
GO(XAddConnectionWatch, iFppp_t) \
|
||||
GO(XRemoveConnectionWatch, iFppp_t) \
|
||||
GO(XSetAfterFunction, pFpp_t) \
|
||||
GO(XSynchronize, pFpi_t) \
|
||||
|
||||
typedef struct x11_my_s {
|
||||
// functions
|
||||
#define GO(A, B) B A;
|
||||
SUPER()
|
||||
#undef GO
|
||||
} x11_my_t;
|
||||
|
||||
void* getX11My(library_t* lib)
|
||||
{
|
||||
x11_my_t* my = (x11_my_t*)calloc(1, sizeof(x11_my_t));
|
||||
#define GO(A, W) my->A = (W)dlsym(lib->priv.w.lib, #A);
|
||||
SUPER()
|
||||
#undef GO
|
||||
return my;
|
||||
}
|
||||
|
||||
void freeX11My(void* lib)
|
||||
{
|
||||
// x11_my_t *my = (x11_my_t *)lib;
|
||||
}
|
||||
#undef SUPER
|
||||
|
||||
#define SUPER() \
|
||||
GO(0) \
|
||||
GO(1) \
|
||||
GO(2) \
|
||||
GO(3) \
|
||||
GO(4) \
|
||||
GO(5) \
|
||||
GO(6) \
|
||||
GO(7) \
|
||||
GO(8) \
|
||||
GO(9) \
|
||||
GO(10) \
|
||||
GO(11) \
|
||||
GO(12) \
|
||||
GO(13) \
|
||||
GO(14) \
|
||||
GO(15)
|
||||
|
||||
// wire_to_event
|
||||
#define GO(A) \
|
||||
static uintptr_t my_wire_to_event_fct_##A = 0; \
|
||||
static int my_wire_to_event_##A(void* dpy, void* re, void* event) \
|
||||
{ \
|
||||
return (int)RunFunction(my_context, my_wire_to_event_fct_##A, 3, dpy, re, event);\
|
||||
}
|
||||
SUPER()
|
||||
#undef GO
|
||||
static void* findwire_to_eventFct(void* fct)
|
||||
{
|
||||
if(!fct) return fct;
|
||||
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
|
||||
#define GO(A) if(my_wire_to_event_fct_##A == (uintptr_t)fct) return my_wire_to_event_##A;
|
||||
SUPER()
|
||||
#undef GO
|
||||
#define GO(A) if(my_wire_to_event_fct_##A == 0) {my_wire_to_event_fct_##A = (uintptr_t)fct; return my_wire_to_event_##A; }
|
||||
SUPER()
|
||||
#undef GO
|
||||
printf_log(LOG_NONE, "Warning, no more slot for libX11 wire_to_event callback\n");
|
||||
return NULL;
|
||||
}
|
||||
static void* reverse_wire_to_eventFct(library_t* lib, void* fct)
|
||||
{
|
||||
if(!fct) return fct;
|
||||
if(CheckBridged(lib->priv.w.bridge, fct))
|
||||
return (void*)CheckBridged(lib->priv.w.bridge, fct);
|
||||
#define GO(A) if(my_wire_to_event_##A == fct) return (void*)my_wire_to_event_fct_##A;
|
||||
SUPER()
|
||||
#undef GO
|
||||
return (void*)AddBridge(lib->priv.w.bridge, iFppp, fct, 0, NULL);
|
||||
}
|
||||
|
||||
// event_to_wire
|
||||
#define GO(A) \
|
||||
static uintptr_t my_event_to_wire_fct_##A = 0; \
|
||||
static int my_event_to_wire_##A(void* dpy, void* re, void* event) \
|
||||
{ \
|
||||
return (int)RunFunction(my_context, my_event_to_wire_fct_##A, 3, dpy, re, event);\
|
||||
}
|
||||
SUPER()
|
||||
#undef GO
|
||||
static void* findevent_to_wireFct(void* fct)
|
||||
{
|
||||
if(!fct) return fct;
|
||||
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
|
||||
#define GO(A) if(my_event_to_wire_fct_##A == (uintptr_t)fct) return my_event_to_wire_##A;
|
||||
SUPER()
|
||||
#undef GO
|
||||
#define GO(A) if(my_event_to_wire_fct_##A == 0) {my_event_to_wire_fct_##A = (uintptr_t)fct; return my_event_to_wire_##A; }
|
||||
SUPER()
|
||||
#undef GO
|
||||
printf_log(LOG_NONE, "Warning, no more slot for libX11 event_to_wire callback\n");
|
||||
return NULL;
|
||||
}
|
||||
static void* reverse_event_to_wireFct(library_t* lib, void* fct)
|
||||
{
|
||||
if(!fct) return fct;
|
||||
if(CheckBridged(lib->priv.w.bridge, fct))
|
||||
return (void*)CheckBridged(lib->priv.w.bridge, fct);
|
||||
#define GO(A) if(my_event_to_wire_##A == fct) return (void*)my_event_to_wire_fct_##A;
|
||||
SUPER()
|
||||
#undef GO
|
||||
return (void*)AddBridge(lib->priv.w.bridge, iFppp, fct, 0, NULL);
|
||||
}
|
||||
|
||||
// error_handler
|
||||
#define GO(A) \
|
||||
static uintptr_t my_error_handler_fct_##A = 0; \
|
||||
static int my_error_handler_##A(void* dpy, void* error) \
|
||||
{ \
|
||||
return (int)RunFunction(my_context, my_error_handler_fct_##A, 2, dpy, error);\
|
||||
}
|
||||
SUPER()
|
||||
#undef GO
|
||||
static void* finderror_handlerFct(void* fct)
|
||||
{
|
||||
if(!fct) return fct;
|
||||
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
|
||||
#define GO(A) if(my_error_handler_fct_##A == (uintptr_t)fct) return my_error_handler_##A;
|
||||
SUPER()
|
||||
#undef GO
|
||||
#define GO(A) if(my_error_handler_fct_##A == 0) {my_error_handler_fct_##A = (uintptr_t)fct; return my_error_handler_##A; }
|
||||
SUPER()
|
||||
#undef GO
|
||||
printf_log(LOG_NONE, "Warning, no more slot for libX11 error_handler callback\n");
|
||||
return NULL;
|
||||
}
|
||||
static void* reverse_error_handlerFct(library_t* lib, void* fct)
|
||||
{
|
||||
if(!fct) return fct;
|
||||
if(CheckBridged(lib->priv.w.bridge, fct))
|
||||
return (void*)CheckBridged(lib->priv.w.bridge, fct);
|
||||
#define GO(A) if(my_error_handler_##A == fct) return (void*)my_error_handler_fct_##A;
|
||||
SUPER()
|
||||
#undef GO
|
||||
return (void*)AddBridge(lib->priv.w.bridge, iFpp, fct, 0, NULL);
|
||||
}
|
||||
|
||||
// ioerror_handler
|
||||
#define GO(A) \
|
||||
static uintptr_t my_ioerror_handler_fct_##A = 0; \
|
||||
static int my_ioerror_handler_##A(void* dpy) \
|
||||
{ \
|
||||
return (int)RunFunction(my_context, my_ioerror_handler_fct_##A, 1, dpy);\
|
||||
}
|
||||
SUPER()
|
||||
#undef GO
|
||||
static void* findioerror_handlerFct(void* fct)
|
||||
{
|
||||
if(!fct) return fct;
|
||||
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
|
||||
#define GO(A) if(my_ioerror_handler_fct_##A == (uintptr_t)fct) return my_ioerror_handler_##A;
|
||||
SUPER()
|
||||
#undef GO
|
||||
#define GO(A) if(my_ioerror_handler_fct_##A == 0) {my_ioerror_handler_fct_##A = (uintptr_t)fct; return my_ioerror_handler_##A; }
|
||||
SUPER()
|
||||
#undef GO
|
||||
printf_log(LOG_NONE, "Warning, no more slot for libX11 ioerror_handler callback\n");
|
||||
return NULL;
|
||||
}
|
||||
static void* reverse_ioerror_handlerFct(library_t* lib, void* fct)
|
||||
{
|
||||
if(!fct) return fct;
|
||||
if(CheckBridged(lib->priv.w.bridge, fct))
|
||||
return (void*)CheckBridged(lib->priv.w.bridge, fct);
|
||||
#define GO(A) if(my_ioerror_handler_##A == fct) return (void*)my_ioerror_handler_fct_##A;
|
||||
SUPER()
|
||||
#undef GO
|
||||
return (void*)AddBridge(lib->priv.w.bridge, iFp, fct, 0, NULL);
|
||||
}
|
||||
|
||||
// exterror_handler
|
||||
#define GO(A) \
|
||||
static uintptr_t my_exterror_handler_fct_##A = 0; \
|
||||
static int my_exterror_handler_##A(void* dpy, void* err, void* codes, int* ret_code) \
|
||||
{ \
|
||||
return (int)RunFunction(my_context, my_exterror_handler_fct_##A, 4, dpy, err, codes, ret_code);\
|
||||
}
|
||||
SUPER()
|
||||
#undef GO
|
||||
static void* findexterror_handlerFct(void* fct)
|
||||
{
|
||||
if(!fct) return fct;
|
||||
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
|
||||
#define GO(A) if(my_exterror_handler_fct_##A == (uintptr_t)fct) return my_exterror_handler_##A;
|
||||
SUPER()
|
||||
#undef GO
|
||||
#define GO(A) if(my_exterror_handler_fct_##A == 0) {my_exterror_handler_fct_##A = (uintptr_t)fct; return my_exterror_handler_##A; }
|
||||
SUPER()
|
||||
#undef GO
|
||||
printf_log(LOG_NONE, "Warning, no more slot for libX11 exterror_handler callback\n");
|
||||
return NULL;
|
||||
}
|
||||
static void* reverse_exterror_handlerFct(library_t* lib, void* fct)
|
||||
{
|
||||
if(!fct) return fct;
|
||||
if(CheckBridged(lib->priv.w.bridge, fct))
|
||||
return (void*)CheckBridged(lib->priv.w.bridge, fct);
|
||||
#define GO(A) if(my_exterror_handler_##A == fct) return (void*)my_exterror_handler_fct_##A;
|
||||
SUPER()
|
||||
#undef GO
|
||||
return (void*)AddBridge(lib->priv.w.bridge, iFpppp, fct, 0, NULL);
|
||||
}
|
||||
|
||||
// close_display
|
||||
#define GO(A) \
|
||||
static uintptr_t my_close_display_fct_##A = 0; \
|
||||
static int my_close_display_##A(void* dpy, void* codes) \
|
||||
{ \
|
||||
return (int)RunFunction(my_context, my_close_display_fct_##A, 2, dpy, codes);\
|
||||
}
|
||||
SUPER()
|
||||
#undef GO
|
||||
static void* findclose_displayFct(void* fct)
|
||||
{
|
||||
if(!fct) return fct;
|
||||
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
|
||||
#define GO(A) if(my_close_display_fct_##A == (uintptr_t)fct) return my_close_display_##A;
|
||||
SUPER()
|
||||
#undef GO
|
||||
#define GO(A) if(my_close_display_fct_##A == 0) {my_close_display_fct_##A = (uintptr_t)fct; return my_close_display_##A; }
|
||||
SUPER()
|
||||
#undef GO
|
||||
printf_log(LOG_NONE, "Warning, no more slot for libX11 close_display callback\n");
|
||||
return NULL;
|
||||
}
|
||||
static void* reverse_close_displayFct(library_t* lib, void* fct)
|
||||
{
|
||||
if(!fct) return fct;
|
||||
if(CheckBridged(lib->priv.w.bridge, fct))
|
||||
return (void*)CheckBridged(lib->priv.w.bridge, fct);
|
||||
#define GO(A) if(my_close_display_##A == fct) return (void*)my_close_display_fct_##A;
|
||||
SUPER()
|
||||
#undef GO
|
||||
return (void*)AddBridge(lib->priv.w.bridge, iFpp, fct, 0, NULL);
|
||||
}
|
||||
|
||||
// register_im
|
||||
#define GO(A) \
|
||||
static uintptr_t my_register_im_fct_##A = 0; \
|
||||
static void my_register_im_##A(void* dpy, void* u, void* d) \
|
||||
{ \
|
||||
RunFunction(my_context, my_register_im_fct_##A, 3, dpy, u, d); \
|
||||
}
|
||||
SUPER()
|
||||
#undef GO
|
||||
static void* findregister_imFct(void* fct)
|
||||
{
|
||||
if(!fct) return fct;
|
||||
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
|
||||
#define GO(A) if(my_register_im_fct_##A == (uintptr_t)fct) return my_register_im_##A;
|
||||
SUPER()
|
||||
#undef GO
|
||||
#define GO(A) if(my_register_im_fct_##A == 0) {my_register_im_fct_##A = (uintptr_t)fct; return my_register_im_##A; }
|
||||
SUPER()
|
||||
#undef GO
|
||||
printf_log(LOG_NONE, "Warning, no more slot for libX11 register_im callback\n");
|
||||
return NULL;
|
||||
}
|
||||
static void* reverse_register_imFct(library_t* lib, void* fct)
|
||||
{
|
||||
if(!fct) return fct;
|
||||
if(CheckBridged(lib->priv.w.bridge, fct))
|
||||
return (void*)CheckBridged(lib->priv.w.bridge, fct);
|
||||
#define GO(A) if(my_register_im_##A == fct) return (void*)my_register_im_fct_##A;
|
||||
SUPER()
|
||||
#undef GO
|
||||
return (void*)AddBridge(lib->priv.w.bridge, iFppp, fct, 0, NULL);
|
||||
}
|
||||
|
||||
// XConnectionWatchProc
|
||||
#define GO(A) \
|
||||
static uintptr_t my_XConnectionWatchProc_fct_##A = 0; \
|
||||
static void my_XConnectionWatchProc_##A(void* dpy, void* data, int op, void* d) \
|
||||
{ \
|
||||
RunFunction(my_context, my_XConnectionWatchProc_fct_##A, 4, dpy, data, op, d); \
|
||||
}
|
||||
SUPER()
|
||||
#undef GO
|
||||
static void* findXConnectionWatchProcFct(void* fct)
|
||||
{
|
||||
if(!fct) return fct;
|
||||
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
|
||||
#define GO(A) if(my_XConnectionWatchProc_fct_##A == (uintptr_t)fct) return my_XConnectionWatchProc_##A;
|
||||
SUPER()
|
||||
#undef GO
|
||||
#define GO(A) if(my_XConnectionWatchProc_fct_##A == 0) {my_XConnectionWatchProc_fct_##A = (uintptr_t)fct; return my_XConnectionWatchProc_##A; }
|
||||
SUPER()
|
||||
#undef GO
|
||||
printf_log(LOG_NONE, "Warning, no more slot for libX11 XConnectionWatchProc callback\n");
|
||||
return NULL;
|
||||
}
|
||||
// xifevent
|
||||
#define GO(A) \
|
||||
static uintptr_t my_xifevent_fct_##A = 0; \
|
||||
static int my_xifevent_##A(void* dpy, void* event, void* d) \
|
||||
{ \
|
||||
return RunFunction(my_context, my_xifevent_fct_##A, 3, dpy, event, d); \
|
||||
}
|
||||
SUPER()
|
||||
#undef GO
|
||||
static void* findxifeventFct(void* fct)
|
||||
{
|
||||
if(!fct) return fct;
|
||||
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
|
||||
#define GO(A) if(my_xifevent_fct_##A == (uintptr_t)fct) return my_xifevent_##A;
|
||||
SUPER()
|
||||
#undef GO
|
||||
#define GO(A) if(my_xifevent_fct_##A == 0) {my_xifevent_fct_##A = (uintptr_t)fct; return my_xifevent_##A; }
|
||||
SUPER()
|
||||
#undef GO
|
||||
printf_log(LOG_NONE, "Warning, no more slot for libX11 xifevent callback\n");
|
||||
return NULL;
|
||||
}
|
||||
// XInternalAsyncHandler
|
||||
#define GO(A) \
|
||||
static uintptr_t my_XInternalAsyncHandler_fct_##A = 0; \
|
||||
static int my_XInternalAsyncHandler_##A(void* dpy, void* rep, void* buf, int len, void* data) \
|
||||
{ \
|
||||
return RunFunction(my_context, my_XInternalAsyncHandler_fct_##A, 5, dpy, rep, buf, len, data); \
|
||||
}
|
||||
SUPER()
|
||||
#undef GO
|
||||
static void* findXInternalAsyncHandlerFct(void* fct)
|
||||
{
|
||||
if(!fct) return fct;
|
||||
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
|
||||
#define GO(A) if(my_XInternalAsyncHandler_fct_##A == (uintptr_t)fct) return my_XInternalAsyncHandler_##A;
|
||||
SUPER()
|
||||
#undef GO
|
||||
#define GO(A) if(my_XInternalAsyncHandler_fct_##A == 0) {my_XInternalAsyncHandler_fct_##A = (uintptr_t)fct; return my_XInternalAsyncHandler_##A; }
|
||||
SUPER()
|
||||
#undef GO
|
||||
printf_log(LOG_NONE, "Warning, no more slot for libX11 XInternalAsyncHandler callback\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// XSynchronizeProc
|
||||
#define GO(A) \
|
||||
static uintptr_t my_XSynchronizeProc_fct_##A = 0; \
|
||||
static int my_XSynchronizeProc_##A() \
|
||||
{ \
|
||||
return (int)RunFunction(my_context, my_XSynchronizeProc_fct_##A, 0);\
|
||||
}
|
||||
SUPER()
|
||||
#undef GO
|
||||
static void* findXSynchronizeProcFct(void* fct)
|
||||
{
|
||||
if(!fct) return fct;
|
||||
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
|
||||
#define GO(A) if(my_XSynchronizeProc_fct_##A == (uintptr_t)fct) return my_XSynchronizeProc_##A;
|
||||
SUPER()
|
||||
#undef GO
|
||||
#define GO(A) if(my_XSynchronizeProc_fct_##A == 0) {my_XSynchronizeProc_fct_##A = (uintptr_t)fct; return my_XSynchronizeProc_##A; }
|
||||
SUPER()
|
||||
#undef GO
|
||||
printf_log(LOG_NONE, "Warning, no more slot for libX11 XSynchronizeProc callback\n");
|
||||
return NULL;
|
||||
}
|
||||
static void* reverse_XSynchronizeProcFct(library_t* lib, void* fct)
|
||||
{
|
||||
if(!fct) return fct;
|
||||
if(CheckBridged(lib->priv.w.bridge, fct))
|
||||
return (void*)CheckBridged(lib->priv.w.bridge, fct);
|
||||
#define GO(A) if(my_XSynchronizeProc_##A == fct) return (void*)my_XSynchronizeProc_fct_##A;
|
||||
SUPER()
|
||||
#undef GO
|
||||
return (void*)AddBridge(lib->priv.w.bridge, iFppp, fct, 0, NULL);
|
||||
}
|
||||
|
||||
#undef SUPER
|
||||
|
||||
void* my_XCreateImage(x64emu_t* emu, void* disp, void* vis, uint32_t depth, int32_t fmt, int32_t off
|
||||
, void* data, uint32_t w, uint32_t h, int32_t pad, int32_t bpl);
|
||||
|
||||
int32_t my_XInitImage(x64emu_t* emu, void* img);
|
||||
|
||||
void* my_XGetImage(x64emu_t* emu, void* disp, void* drawable, int32_t x, int32_t y
|
||||
, uint32_t w, uint32_t h, uint32_t plane, int32_t fmt);
|
||||
|
||||
int32_t my_XPutImage(x64emu_t* emu, void* disp, void* drawable, void* gc, void* image
|
||||
, int32_t src_x, int32_t src_y, int32_t dst_x, int32_t dst_y
|
||||
, uint32_t w, uint32_t h);
|
||||
|
||||
void* my_XGetSubImage(x64emu_t* emu, void* disp, void* drawable
|
||||
, int32_t x, int32_t y
|
||||
, uint32_t w, uint32_t h, uint32_t plane, int32_t fmt
|
||||
, void* image, int32_t dst_x, int32_t dst_y);
|
||||
|
||||
void my_XDestroyImage(x64emu_t* emu, void* image);
|
||||
|
||||
#ifdef PANDORA
|
||||
void* my_XLoadQueryFont(x64emu_t* emu, void* d, void* name);
|
||||
#endif
|
||||
|
||||
void* my_XVaCreateNestedList(int dummy, void* p);
|
||||
|
||||
EXPORT void* my_XSetErrorHandler(x64emu_t* emu, XErrorHandler handler)
|
||||
{
|
||||
library_t* lib = emu->context->x11lib;
|
||||
x11_my_t *my = (x11_my_t *)lib->priv.w.p2;
|
||||
void* ret = my->XSetErrorHandler(finderror_handlerFct(handler));
|
||||
return reverse_error_handlerFct(lib, ret);
|
||||
}
|
||||
|
||||
EXPORT void* my_XSetIOErrorHandler(x64emu_t* emu, XIOErrorHandler handler)
|
||||
{
|
||||
library_t* lib = emu->context->x11lib;
|
||||
x11_my_t *my = (x11_my_t *)lib->priv.w.p2;
|
||||
void* ret = my->XSetIOErrorHandler(findioerror_handlerFct(handler));
|
||||
return reverse_ioerror_handlerFct(lib, ret);
|
||||
}
|
||||
|
||||
EXPORT void* my_XESetError(x64emu_t* emu, void* display, int32_t extension, void* handler)
|
||||
{
|
||||
library_t* lib = emu->context->x11lib;
|
||||
x11_my_t *my = (x11_my_t *)lib->priv.w.p2;
|
||||
void* ret = my->XESetError(display, extension, findexterror_handlerFct(handler));
|
||||
return reverse_exterror_handlerFct(lib, ret);
|
||||
}
|
||||
|
||||
EXPORT void* my_XESetCloseDisplay(x64emu_t* emu, void* display, int32_t extension, void* handler)
|
||||
{
|
||||
library_t* lib = emu->context->x11lib;
|
||||
x11_my_t *my = (x11_my_t *)lib->priv.w.p2;
|
||||
void* ret = my->XESetCloseDisplay(display, extension, findclose_displayFct(handler));
|
||||
return reverse_close_displayFct(lib, ret);
|
||||
}
|
||||
|
||||
EXPORT int32_t my_XIfEvent(x64emu_t* emu, void* d,void* ev, EventHandler h, void* arg)
|
||||
{
|
||||
library_t* lib = emu->context->x11lib;
|
||||
x11_my_t *my = (x11_my_t *)lib->priv.w.p2;
|
||||
int32_t ret = my->XIfEvent(d, ev, findxifeventFct(h), arg);
|
||||
return ret;
|
||||
}
|
||||
|
||||
EXPORT int32_t my_XCheckIfEvent(x64emu_t* emu, void* d,void* ev, EventHandler h, void* arg)
|
||||
{
|
||||
library_t* lib = emu->context->x11lib;
|
||||
x11_my_t *my = (x11_my_t *)lib->priv.w.p2;
|
||||
int32_t ret = my->XCheckIfEvent(d, ev, findxifeventFct(h), arg);
|
||||
return ret;
|
||||
}
|
||||
|
||||
EXPORT int32_t my_XPeekIfEvent(x64emu_t* emu, void* d,void* ev, EventHandler h, void* arg)
|
||||
{
|
||||
library_t* lib = emu->context->x11lib;
|
||||
x11_my_t *my = (x11_my_t *)lib->priv.w.p2;
|
||||
int32_t ret = my->XPeekIfEvent(d, ev, findxifeventFct(h), arg);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void sub_image_wrapper(x64emu_t *emu, uintptr_t fnc);
|
||||
typedef void* (*sub_image_wrapper_t)(void*, int32_t, int32_t, uint32_t, uint32_t);
|
||||
|
||||
|
||||
void BridgeImageFunc(x64emu_t *emu, XImage *img)
|
||||
{
|
||||
bridge_t* system = emu->context->system;
|
||||
|
||||
#define GO(A, W) \
|
||||
fnc = CheckBridged(system, img->f.A); \
|
||||
if(!fnc) fnc = AddAutomaticBridge(emu, system, W, img->f.A, 0); \
|
||||
img->f.A = (W##_t)fnc;
|
||||
|
||||
uintptr_t fnc;
|
||||
|
||||
GO(create_image, pFppuiipuuii)
|
||||
GO(destroy_image, iFp)
|
||||
GO(get_pixel, LFpii)
|
||||
GO(put_pixel, iFpiiL)
|
||||
GO(sub_image, sub_image_wrapper)
|
||||
GO(add_pixel, iFpl)
|
||||
#undef GO
|
||||
}
|
||||
|
||||
void UnbridgeImageFunc(x64emu_t *emu, XImage *img)
|
||||
{
|
||||
#define GO(A, W) \
|
||||
fnc = GetNativeFnc((uintptr_t)img->f.A); \
|
||||
if(fnc) \
|
||||
img->f.A = (W##_t)fnc;
|
||||
|
||||
void* fnc;
|
||||
|
||||
GO(create_image, pFppuiipuuii)
|
||||
GO(destroy_image, iFp)
|
||||
GO(get_pixel, LFpii)
|
||||
GO(put_pixel, iFpiiL)
|
||||
GO(sub_image, sub_image_wrapper)
|
||||
GO(add_pixel, iFpl)
|
||||
#undef GO
|
||||
}
|
||||
|
||||
void sub_image_wrapper(x64emu_t *emu, uintptr_t fnc)
|
||||
{
|
||||
pFpiiuu_t fn = (pFpiiuu_t)fnc;
|
||||
void* img = fn(*(void**)(R_RDI), *(int32_t*)(R_RSI), *(int32_t*)(R_RDX), *(uint32_t*)(R_RCX), *(uint32_t*)(R_R8));
|
||||
BridgeImageFunc(emu, (XImage*)img);
|
||||
R_EAX=(uintptr_t)img;
|
||||
}
|
||||
|
||||
|
||||
EXPORT void* my_XCreateImage(x64emu_t* emu, void* disp, void* vis, uint32_t depth, int32_t fmt, int32_t off
|
||||
, void* data, uint32_t w, uint32_t h, int32_t pad, int32_t bpl)
|
||||
{
|
||||
library_t* lib = emu->context->x11lib;
|
||||
x11_my_t *my = (x11_my_t *)lib->priv.w.p2;
|
||||
|
||||
XImage *img = my->XCreateImage(disp, vis, depth, fmt, off, data, w, h, pad, bpl);
|
||||
if(!img)
|
||||
return img;
|
||||
// bridge all access functions...
|
||||
BridgeImageFunc(emu, img);
|
||||
return img;
|
||||
}
|
||||
|
||||
EXPORT int32_t my_XInitImage(x64emu_t* emu, void* img)
|
||||
{
|
||||
library_t* lib = emu->context->x11lib;
|
||||
x11_my_t *my = (x11_my_t *)lib->priv.w.p2;
|
||||
|
||||
int ret = my->XInitImage(img);
|
||||
// bridge all access functions...
|
||||
BridgeImageFunc(emu, img);
|
||||
return ret;
|
||||
}
|
||||
|
||||
EXPORT void* my_XGetImage(x64emu_t* emu, void* disp, void* drawable, int32_t x, int32_t y
|
||||
, uint32_t w, uint32_t h, uint32_t plane, int32_t fmt)
|
||||
{
|
||||
library_t* lib = emu->context->x11lib;
|
||||
x11_my_t *my = (x11_my_t *)lib->priv.w.p2;
|
||||
|
||||
XImage *img = my->XGetImage(disp, drawable, x, y, w, h, plane, fmt);
|
||||
if(!img)
|
||||
return img;
|
||||
// bridge all access functions...
|
||||
BridgeImageFunc(emu, img);
|
||||
return img;
|
||||
}
|
||||
|
||||
EXPORT int32_t my_XPutImage(x64emu_t* emu, void* disp, void* drawable, void* gc, void* image
|
||||
, int32_t src_x, int32_t src_y, int32_t dst_x, int32_t dst_y
|
||||
, uint32_t w, uint32_t h)
|
||||
{
|
||||
library_t* lib = emu->context->x11lib;
|
||||
x11_my_t *my = (x11_my_t *)lib->priv.w.p2;
|
||||
UnbridgeImageFunc(emu, (XImage*)image);
|
||||
int32_t r = my->XPutImage(disp, drawable, gc, image, src_x, src_y, dst_x, dst_y, w, h);
|
||||
// bridge all access functions...
|
||||
BridgeImageFunc(emu, (XImage*)image);
|
||||
return r;
|
||||
}
|
||||
|
||||
EXPORT void* my_XGetSubImage(x64emu_t* emu, void* disp, void* drawable
|
||||
, int32_t x, int32_t y
|
||||
, uint32_t w, uint32_t h, uint32_t plane, int32_t fmt
|
||||
, void* image, int32_t dst_x, int32_t dst_y)
|
||||
{
|
||||
library_t* lib = emu->context->x11lib;
|
||||
x11_my_t *my = (x11_my_t *)lib->priv.w.p2;
|
||||
|
||||
UnbridgeImageFunc(emu, (XImage*)image);
|
||||
XImage *img = my->XGetSubImage(disp, drawable, x, y, w, h, plane, fmt, image, dst_x, dst_y);
|
||||
if(img)
|
||||
BridgeImageFunc(emu, img);
|
||||
|
||||
BridgeImageFunc(emu, (XImage*)image);
|
||||
return img;
|
||||
}
|
||||
|
||||
EXPORT void my_XDestroyImage(x64emu_t* emu, void* image)
|
||||
{
|
||||
library_t* lib = emu->context->x11lib;
|
||||
x11_my_t *my = (x11_my_t *)lib->priv.w.p2;
|
||||
|
||||
UnbridgeImageFunc(emu, (XImage*)image);
|
||||
my->XDestroyImage(image);
|
||||
}
|
||||
|
||||
typedef struct xintasync_s {
|
||||
struct xintasync_s *next;
|
||||
int (*handler)(
|
||||
void*,
|
||||
void*,
|
||||
void*,
|
||||
int,
|
||||
void*
|
||||
);
|
||||
void* data;
|
||||
} xintasync_t;
|
||||
|
||||
EXPORT void my__XDeqAsyncHandler(x64emu_t* emu, void* cb, void* data)
|
||||
{
|
||||
library_t* lib = emu->context->x11lib;
|
||||
x11_my_t *my = (x11_my_t *)lib->priv.w.p2;
|
||||
my->_XDeqAsyncHandler(findXInternalAsyncHandlerFct(cb), data);
|
||||
}
|
||||
#if 0
|
||||
typedef struct my_XIMArg_s {
|
||||
char *name;
|
||||
void *value;
|
||||
} my_XIMArg_t;
|
||||
#define my_XNVaNestedList "XNVaNestedList"
|
||||
|
||||
EXPORT void* my_XVaCreateNestedList(int dummy, void* b)
|
||||
{
|
||||
// need to create a similar function here...
|
||||
void* p = b;
|
||||
int n = 0;
|
||||
while(p++) ++n;
|
||||
void** ret = (void**)malloc(sizeof(void*)*n);
|
||||
p = b;
|
||||
n = 0;
|
||||
while(p++)
|
||||
ret[n++] = p;
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
EXPORT void* my_XESetWireToEvent(x64emu_t* emu, void* display, int32_t event_number, void* proc)
|
||||
{
|
||||
library_t* lib = emu->context->x11lib;
|
||||
x11_my_t *my = (x11_my_t *)lib->priv.w.p2;
|
||||
void* ret = NULL;
|
||||
|
||||
ret = my->XESetWireToEvent(display, event_number, findwire_to_eventFct(proc));
|
||||
|
||||
return reverse_wire_to_eventFct(lib, ret);
|
||||
}
|
||||
EXPORT void* my_XESetEventToWire(x64emu_t* emu, void* display, int32_t event_number, void* proc)
|
||||
{
|
||||
library_t* lib = emu->context->x11lib;
|
||||
x11_my_t *my = (x11_my_t *)lib->priv.w.p2;
|
||||
void* ret = NULL;
|
||||
|
||||
ret = my->XESetEventToWire(display, event_number, findevent_to_wireFct(proc));
|
||||
|
||||
return reverse_event_to_wireFct(lib, ret);
|
||||
}
|
||||
|
||||
EXPORT int my_XRegisterIMInstantiateCallback(x64emu_t* emu, void* d, void* db, void* res_name, void* res_class, void* cb, void* data)
|
||||
{
|
||||
library_t* lib = emu->context->x11lib;
|
||||
x11_my_t *my = (x11_my_t *)lib->priv.w.p2;
|
||||
|
||||
return my->XRegisterIMInstantiateCallback(d, db, res_name, res_class, findregister_imFct(cb), data);
|
||||
}
|
||||
|
||||
EXPORT int my_XUnregisterIMInstantiateCallback(x64emu_t* emu, void* d, void* db, void* res_name, void* res_class, void* cb, void* data)
|
||||
{
|
||||
library_t* lib = emu->context->x11lib;
|
||||
x11_my_t *my = (x11_my_t *)lib->priv.w.p2;
|
||||
|
||||
return my->XUnregisterIMInstantiateCallback(d, db, res_name, res_class, reverse_register_imFct(lib, cb), data);
|
||||
}
|
||||
|
||||
EXPORT int my_XQueryExtension(x64emu_t* emu, void* display, char* name, int* major, int* first_event, int* first_error)
|
||||
{
|
||||
library_t* lib = emu->context->x11lib;
|
||||
x11_my_t *my = (x11_my_t *)lib->priv.w.p2;
|
||||
|
||||
int ret = my->XQueryExtension(display, name, major, first_event, first_error);
|
||||
if(!ret && name && !strcmp(name, "GLX") && x11glx) {
|
||||
// hack to force GLX to be accepted, even if not present
|
||||
// left major and first_XXX to default...
|
||||
ret = 1;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
EXPORT int my_XAddConnectionWatch(x64emu_t* emu, void* display, char* f, void* data)
|
||||
{
|
||||
library_t* lib = emu->context->x11lib;
|
||||
x11_my_t *my = (x11_my_t *)lib->priv.w.p2;
|
||||
|
||||
return my->XAddConnectionWatch(display, findXConnectionWatchProcFct(f), data);
|
||||
}
|
||||
|
||||
EXPORT int my_XRemoveConnectionWatch(x64emu_t* emu, void* display, char* f, void* data)
|
||||
{
|
||||
library_t* lib = emu->context->x11lib;
|
||||
x11_my_t *my = (x11_my_t *)lib->priv.w.p2;
|
||||
|
||||
return my->XRemoveConnectionWatch(display, findXConnectionWatchProcFct(f), data);
|
||||
}
|
||||
|
||||
EXPORT void* my_XSetAfterFunction(x64emu_t* emu, void* display, void* f)
|
||||
{
|
||||
library_t* lib = emu->context->x11lib;
|
||||
x11_my_t *my = (x11_my_t *)lib->priv.w.p2;
|
||||
|
||||
return reverse_XSynchronizeProcFct(lib, my->XSetAfterFunction(display, findXSynchronizeProcFct(f)));
|
||||
}
|
||||
|
||||
EXPORT void* my_XSynchronize(x64emu_t* emu, void* display, int onoff)
|
||||
{
|
||||
library_t* lib = emu->context->x11lib;
|
||||
x11_my_t *my = (x11_my_t *)lib->priv.w.p2;
|
||||
|
||||
return reverse_XSynchronizeProcFct(lib, my->XSynchronize(display, onoff));
|
||||
}
|
||||
|
||||
#define CUSTOM_INIT \
|
||||
box64->x11lib = lib; \
|
||||
lib->priv.w.p2 = getX11My(lib); \
|
||||
if(x11threads) ((x11_my_t*)lib->priv.w.p2)->XInitThreads();
|
||||
|
||||
#define CUSTOM_FINI \
|
||||
freeX11My(lib->priv.w.p2); \
|
||||
free(lib->priv.w.p2); \
|
||||
((box64context_t*)(lib->context))->x11lib = NULL; \
|
||||
|
||||
#include "wrappedlib_init.h"
|
||||
Executable
+1096
File diff suppressed because it is too large.
Load diff
Executable
+17
@@ -0,0 +1,17 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#define _GNU_SOURCE /* See feature_test_macros(7) */
|
||||
#include <dlfcn.h>
|
||||
|
||||
#include "wrappedlibs.h"
|
||||
|
||||
#include "wrapper.h"
|
||||
#include "bridge.h"
|
||||
#include "librarian/library_private.h"
|
||||
#include "x64emu.h"
|
||||
|
||||
const char* libxauName = "libXau.so.6";
|
||||
#define LIBNAME libxau
|
||||
|
||||
#include "wrappedlib_init.h"
|
||||
Executable
+12
@@ -0,0 +1,12 @@
|
||||
#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA))
|
||||
#error Meh...
|
||||
#endif
|
||||
|
||||
GO(XauDisposeAuth, iFp)
|
||||
GO(XauFileName, pFv)
|
||||
GO(XauGetAuthByAddr, pFuupupup)
|
||||
GO(XauGetBestAuthByAddr, pFuupupipp)
|
||||
GO(XauLockAuth, iFpiii)
|
||||
GO(XauReadAuth, pFp)
|
||||
GO(XauUnlockAuth, iFp)
|
||||
GO(XauWriteAuth, iFpp)
|
||||
Executable
+23
@@ -0,0 +1,23 @@
|
||||
#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 "wrapper.h"
|
||||
#include "bridge.h"
|
||||
#include "librarian/library_private.h"
|
||||
#include "x64emu.h"
|
||||
#include "emu/x64emu_private.h"
|
||||
#include "callback.h"
|
||||
#include "librarian.h"
|
||||
#include "box64context.h"
|
||||
#include "emu/x64emu_private.h"
|
||||
|
||||
const char* libxcbName = "libxcb.so.1";
|
||||
#define LIBNAME libxcb
|
||||
|
||||
#include "wrappedlib_init.h"
|
||||
Executable
+678
@@ -0,0 +1,678 @@
|
||||
#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA))
|
||||
#error meh!
|
||||
#endif
|
||||
|
||||
GO(xcb_alloc_color, pFpuWWW)
|
||||
//GO(xcb_alloc_color_cells,
|
||||
//GO(xcb_alloc_color_cells_masks,
|
||||
//GO(xcb_alloc_color_cells_masks_end,
|
||||
//GO(xcb_alloc_color_cells_masks_length,
|
||||
//GO(xcb_alloc_color_cells_pixels,
|
||||
//GO(xcb_alloc_color_cells_pixels_end,
|
||||
//GO(xcb_alloc_color_cells_pixels_length,
|
||||
//GO(xcb_alloc_color_cells_reply,
|
||||
//GO(xcb_alloc_color_cells_sizeof,
|
||||
//GO(xcb_alloc_color_cells_unchecked,
|
||||
//GO(xcb_alloc_color_planes,
|
||||
//GO(xcb_alloc_color_planes_pixels,
|
||||
//GO(xcb_alloc_color_planes_pixels_end,
|
||||
//GO(xcb_alloc_color_planes_pixels_length,
|
||||
//GO(xcb_alloc_color_planes_reply,
|
||||
//GO(xcb_alloc_color_planes_sizeof,
|
||||
//GO(xcb_alloc_color_planes_unchecked,
|
||||
GO(xcb_alloc_color_reply, pFpup)
|
||||
//GO(xcb_alloc_color_unchecked,
|
||||
//GO(xcb_alloc_named_color,
|
||||
//GO(xcb_alloc_named_color_reply,
|
||||
//GO(xcb_alloc_named_color_sizeof,
|
||||
//GO(xcb_alloc_named_color_unchecked,
|
||||
//GO(xcb_allow_events,
|
||||
//GO(xcb_allow_events_checked,
|
||||
//GO(xcb_arc_end,
|
||||
//GO(xcb_arc_next,
|
||||
//GO(xcb_atom_end,
|
||||
//GO(xcb_atom_next,
|
||||
GO(xcb_bell, pFpC)
|
||||
//GO(xcb_bell_checked,
|
||||
//GO(xcb_big_requests_enable,
|
||||
//GO(xcb_big_requests_enable_reply,
|
||||
//GO(xcb_big_requests_enable_unchecked,
|
||||
DATA(xcb_big_requests_id, sizeof(void*))
|
||||
//GO(xcb_bool32_end,
|
||||
//GO(xcb_bool32_next,
|
||||
//GO(xcb_button_end,
|
||||
//GO(xcb_button_next,
|
||||
//GO(xcb_change_active_pointer_grab,
|
||||
//GO(xcb_change_active_pointer_grab_checked,
|
||||
GO(xcb_change_gc, pFpuup)
|
||||
//GO(xcb_change_gc_aux,
|
||||
//GO(xcb_change_gc_aux_checked,
|
||||
GO(xcb_change_gc_checked, pFpuup)
|
||||
//GO(xcb_change_gc_sizeof,
|
||||
//GO(xcb_change_gc_value_list,
|
||||
//GO(xcb_change_gc_value_list_serialize,
|
||||
//GO(xcb_change_gc_value_list_sizeof,
|
||||
//GO(xcb_change_gc_value_list_unpack,
|
||||
//GO(xcb_change_hosts,
|
||||
//GO(xcb_change_hosts_address,
|
||||
//GO(xcb_change_hosts_address_end,
|
||||
//GO(xcb_change_hosts_address_length,
|
||||
//GO(xcb_change_hosts_checked,
|
||||
//GO(xcb_change_hosts_sizeof,
|
||||
GO(xcb_change_keyboard_control, pFpup)
|
||||
//GO(xcb_change_keyboard_control_aux,
|
||||
//GO(xcb_change_keyboard_control_aux_checked,
|
||||
//GO(xcb_change_keyboard_control_checked,
|
||||
//GO(xcb_change_keyboard_control_sizeof,
|
||||
//GO(xcb_change_keyboard_control_value_list,
|
||||
//GO(xcb_change_keyboard_control_value_list_serialize,
|
||||
//GO(xcb_change_keyboard_control_value_list_sizeof,
|
||||
//GO(xcb_change_keyboard_control_value_list_unpack,
|
||||
//GO(xcb_change_keyboard_mapping,
|
||||
//GO(xcb_change_keyboard_mapping_checked,
|
||||
//GO(xcb_change_keyboard_mapping_keysyms,
|
||||
//GO(xcb_change_keyboard_mapping_keysyms_end,
|
||||
//GO(xcb_change_keyboard_mapping_keysyms_length,
|
||||
//GO(xcb_change_keyboard_mapping_sizeof,
|
||||
//GO(xcb_change_pointer_control,
|
||||
//GO(xcb_change_pointer_control_checked,
|
||||
GO(xcb_change_property, pFpCuuuCup)
|
||||
GO(xcb_change_property_checked, pFpCuuuCup)
|
||||
//GO(xcb_change_property_data,
|
||||
//GO(xcb_change_property_data_end,
|
||||
//GO(xcb_change_property_data_length,
|
||||
//GO(xcb_change_property_sizeof,
|
||||
//GO(xcb_change_save_set,
|
||||
//GO(xcb_change_save_set_checked,
|
||||
GO(xcb_change_window_attributes, pFpuup)
|
||||
//GO(xcb_change_window_attributes_aux,
|
||||
//GO(xcb_change_window_attributes_aux_checked,
|
||||
GO(xcb_change_window_attributes_checked, pFpuup)
|
||||
//GO(xcb_change_window_attributes_sizeof,
|
||||
//GO(xcb_change_window_attributes_value_list,
|
||||
//GO(xcb_change_window_attributes_value_list_serialize,
|
||||
//GO(xcb_change_window_attributes_value_list_sizeof,
|
||||
//GO(xcb_change_window_attributes_value_list_unpack,
|
||||
//GO(xcb_char2b_end,
|
||||
//GO(xcb_char2b_next,
|
||||
//GO(xcb_charinfo_end,
|
||||
//GO(xcb_charinfo_next,
|
||||
//GO(xcb_circulate_window,
|
||||
//GO(xcb_circulate_window_checked,
|
||||
GO(xcb_clear_area, pFpCuwwWW)
|
||||
//GO(xcb_clear_area_checked,
|
||||
//GO(xcb_client_message_data_end,
|
||||
//GO(xcb_client_message_data_next,
|
||||
GO(xcb_close_font, pFpu)
|
||||
GO(xcb_close_font_checked, pFpu)
|
||||
//GO(xcb_coloritem_end,
|
||||
//GO(xcb_coloritem_next,
|
||||
//GO(xcb_colormap_end,
|
||||
//GO(xcb_colormap_next,
|
||||
GO(xcb_configure_window, pFpuWp)
|
||||
//GO(xcb_configure_window_aux,
|
||||
//GO(xcb_configure_window_aux_checked,
|
||||
//GO(xcb_configure_window_checked,
|
||||
//GO(xcb_configure_window_sizeof,
|
||||
//GO(xcb_configure_window_value_list,
|
||||
//GO(xcb_configure_window_value_list_serialize,
|
||||
//GO(xcb_configure_window_value_list_sizeof,
|
||||
//GO(xcb_configure_window_value_list_unpack,
|
||||
GO(xcb_connect, pFpp)
|
||||
GO(xcb_connection_has_error, iFp)
|
||||
//GO(xcb_connect_to_display_with_auth_info,
|
||||
//GO(xcb_connect_to_fd,
|
||||
GO(xcb_convert_selection, pFpuuuuu)
|
||||
//GO(xcb_convert_selection_checked,
|
||||
GO(xcb_copy_area, pFpuuuwwwwWW)
|
||||
//GO(xcb_copy_area_checked,
|
||||
//GO(xcb_copy_colormap_and_free,
|
||||
//GO(xcb_copy_colormap_and_free_checked,
|
||||
//GO(xcb_copy_gc,
|
||||
//GO(xcb_copy_gc_checked,
|
||||
//GO(xcb_copy_plane,
|
||||
//GO(xcb_copy_plane_checked,
|
||||
GO(xcb_create_colormap, pFpCppp)
|
||||
//GO(xcb_create_colormap_checked,
|
||||
GO(xcb_create_cursor, pFpuuuWWWWWWWW)
|
||||
//GO(xcb_create_cursor_checked,
|
||||
GO(xcb_create_gc, pFpuuup)
|
||||
//GO(xcb_create_gc_aux,
|
||||
//GO(xcb_create_gc_aux_checked,
|
||||
GO(xcb_create_gc_checked, pFpuuup)
|
||||
//GO(xcb_create_gc_sizeof,
|
||||
//GO(xcb_create_gc_value_list,
|
||||
//GO(xcb_create_gc_value_list_serialize,
|
||||
//GO(xcb_create_gc_value_list_sizeof,
|
||||
//GO(xcb_create_gc_value_list_unpack,
|
||||
GO(xcb_create_glyph_cursor, pFpuuuWWWWWWWW)
|
||||
//GO(xcb_create_glyph_cursor_checked,
|
||||
GO(xcb_create_pixmap, pFpCuuWW)
|
||||
//GO(xcb_create_pixmap_checked,
|
||||
GO(xcb_create_window, pFpCuuwwWWWWuup)
|
||||
//GO(xcb_create_window_aux,
|
||||
//GO(xcb_create_window_aux_checked,
|
||||
GO(xcb_create_window_checked, pFpCuuwwWWWWuup)
|
||||
//GO(xcb_create_window_sizeof,
|
||||
//GO(xcb_create_window_value_list,
|
||||
//GO(xcb_create_window_value_list_serialize,
|
||||
//GO(xcb_create_window_value_list_sizeof,
|
||||
//GO(xcb_create_window_value_list_unpack,
|
||||
//GO(xcb_cursor_end,
|
||||
//GO(xcb_cursor_next,
|
||||
GO(xcb_delete_property, pFppp)
|
||||
//GO(xcb_delete_property_checked,
|
||||
//GO(xcb_depth_end,
|
||||
GO(xcb_depth_next, vFp)
|
||||
GO(xcb_depth_sizeof, iFp)
|
||||
GO(xcb_depth_visuals, pFp)
|
||||
GO(xcb_depth_visuals_iterator, HFp) //xcb_visualtype_iterator_t is a structure
|
||||
//GO(xcb_depth_visuals_length,
|
||||
//GO(xcb_destroy_subwindows,
|
||||
//GO(xcb_destroy_subwindows_checked,
|
||||
GO(xcb_destroy_window, pFpu)
|
||||
//GO(xcb_destroy_window_checked,
|
||||
//GO(xcb_discard_reply,
|
||||
//GO(xcb_discard_reply64,
|
||||
GO(xcb_disconnect, vFp)
|
||||
//GO(xcb_drawable_end,
|
||||
//GO(xcb_drawable_next,
|
||||
//GO(xcb_fill_poly,
|
||||
//GO(xcb_fill_poly_checked,
|
||||
//GO(xcb_fill_poly_points,
|
||||
//GO(xcb_fill_poly_points_iterator,
|
||||
//GO(xcb_fill_poly_points_length,
|
||||
//GO(xcb_fill_poly_sizeof,
|
||||
GO(xcb_flush, iFp)
|
||||
//GO(xcb_fontable_end,
|
||||
//GO(xcb_fontable_next,
|
||||
//GO(xcb_font_end,
|
||||
//GO(xcb_font_next,
|
||||
//GO(xcb_fontprop_end,
|
||||
//GO(xcb_fontprop_next,
|
||||
//GO(xcb_force_screen_saver,
|
||||
//GO(xcb_force_screen_saver_checked,
|
||||
//GO(xcb_format_end,
|
||||
GO(xcb_format_next, vFp)
|
||||
GO(xcb_free_colormap, pFpu)
|
||||
GO(xcb_free_colormap_checked, pFpu)
|
||||
//GO(xcb_free_colors,
|
||||
//GO(xcb_free_colors_checked,
|
||||
//GO(xcb_free_colors_pixels,
|
||||
//GO(xcb_free_colors_pixels_end,
|
||||
//GO(xcb_free_colors_pixels_length,
|
||||
//GO(xcb_free_colors_sizeof,
|
||||
GO(xcb_free_cursor, pFpp)
|
||||
//GO(xcb_free_cursor_checked,
|
||||
GO(xcb_free_gc, pFpu)
|
||||
//GO(xcb_free_gc_checked,
|
||||
GO(xcb_free_pixmap, pFpu)
|
||||
//GO(xcb_free_pixmap_checked,
|
||||
//GO(xcb_gcontext_end,
|
||||
//GO(xcb_gcontext_next,
|
||||
GO(xcb_generate_id, uFp)
|
||||
GO(xcb_get_atom_name, pFpu)
|
||||
GO(xcb_get_atom_name_name, pFp)
|
||||
//GO(xcb_get_atom_name_name_end,
|
||||
GO(xcb_get_atom_name_name_length, iFp)
|
||||
GO(xcb_get_atom_name_reply, pFpup)
|
||||
//GO(xcb_get_atom_name_sizeof,
|
||||
//GO(xcb_get_atom_name_unchecked,
|
||||
GO(xcb_get_extension_data, pFpp)
|
||||
GO(xcb_get_file_descriptor, iFp)
|
||||
//GO(xcb_get_font_path,
|
||||
//GO(xcb_get_font_path_path_iterator,
|
||||
//GO(xcb_get_font_path_path_length,
|
||||
//GO(xcb_get_font_path_reply,
|
||||
//GO(xcb_get_font_path_sizeof,
|
||||
//GO(xcb_get_font_path_unchecked,
|
||||
GO(xcb_get_geometry, pFpu)
|
||||
GO(xcb_get_geometry_reply, pFpup)
|
||||
GO(xcb_get_geometry_unchecked, pFpu)
|
||||
GO(xcb_get_image, pFpCuwwWWu)
|
||||
GO(xcb_get_image_data, pFp)
|
||||
//GO(xcb_get_image_data_end,
|
||||
GO(xcb_get_image_data_length, iFp)
|
||||
GO(xcb_get_image_reply, pFpup)
|
||||
//GO(xcb_get_image_sizeof,
|
||||
GO(xcb_get_image_unchecked, pFpCuwwWWu)
|
||||
GO(xcb_get_input_focus, pFp)
|
||||
GO(xcb_get_input_focus_reply, pFpup)
|
||||
//GO(xcb_get_input_focus_unchecked,
|
||||
//GO(xcb_get_keyboard_control,
|
||||
//GO(xcb_get_keyboard_control_reply,
|
||||
//GO(xcb_get_keyboard_control_unchecked,
|
||||
GO(xcb_get_keyboard_mapping, pFpCC)
|
||||
GO(xcb_get_keyboard_mapping_keysyms, pFp)
|
||||
//GO(xcb_get_keyboard_mapping_keysyms_end,
|
||||
GO(xcb_get_keyboard_mapping_keysyms_length, iFp)
|
||||
GO(xcb_get_keyboard_mapping_reply, pFpup)
|
||||
//GO(xcb_get_keyboard_mapping_sizeof,
|
||||
//GO(xcb_get_keyboard_mapping_unchecked,
|
||||
GO(xcb_get_maximum_request_length, uFp)
|
||||
GO(xcb_get_modifier_mapping, pFp)
|
||||
GO(xcb_get_modifier_mapping_keycodes, pFp)
|
||||
//GO(xcb_get_modifier_mapping_keycodes_end,
|
||||
GO(xcb_get_modifier_mapping_keycodes_length, iFp)
|
||||
GO(xcb_get_modifier_mapping_reply, pFpup)
|
||||
//GO(xcb_get_modifier_mapping_sizeof, pFp)
|
||||
//GO(xcb_get_modifier_mapping_unchecked,
|
||||
//GO(xcb_get_motion_events,
|
||||
//GO(xcb_get_motion_events_events,
|
||||
//GO(xcb_get_motion_events_events_iterator,
|
||||
//GO(xcb_get_motion_events_events_length,
|
||||
//GO(xcb_get_motion_events_reply,
|
||||
//GO(xcb_get_motion_events_sizeof,
|
||||
//GO(xcb_get_motion_events_unchecked,
|
||||
//GO(xcb_get_pointer_control,
|
||||
//GO(xcb_get_pointer_control_reply,
|
||||
//GO(xcb_get_pointer_control_unchecked,
|
||||
//GO(xcb_get_pointer_mapping,
|
||||
//GO(xcb_get_pointer_mapping_map,
|
||||
//GO(xcb_get_pointer_mapping_map_end,
|
||||
//GO(xcb_get_pointer_mapping_map_length,
|
||||
//GO(xcb_get_pointer_mapping_reply,
|
||||
//GO(xcb_get_pointer_mapping_sizeof,
|
||||
//GO(xcb_get_pointer_mapping_unchecked,
|
||||
GO(xcb_get_property, pFpCuuuuu)
|
||||
GO(xcb_get_property_reply, pFpup)
|
||||
//GO(xcb_get_property_sizeof,
|
||||
GO(xcb_get_property_unchecked, pFpCuuuuu)
|
||||
GO(xcb_get_property_value, pFp)
|
||||
//GO(xcb_get_property_value_end,
|
||||
GO(xcb_get_property_value_length, iFp)
|
||||
GO(xcb_get_reply_fds, pFppu)
|
||||
//GO(xcb_get_screen_saver,
|
||||
//GO(xcb_get_screen_saver_reply,
|
||||
//GO(xcb_get_screen_saver_unchecked,
|
||||
GO(xcb_get_selection_owner, pFpu)
|
||||
GO(xcb_get_selection_owner_reply, pFpup)
|
||||
GO(xcb_get_selection_owner_unchecked, pFpu)
|
||||
GO(xcb_get_setup, pFp)
|
||||
GO(xcb_get_window_attributes, pFpu)
|
||||
GO(xcb_get_window_attributes_reply, pFpup)
|
||||
GO(xcb_get_window_attributes_unchecked, pFpu)
|
||||
GO(xcb_grab_button, pFpCuWCCuuCW)
|
||||
GO(xcb_grab_button_checked, pFpCuWCCuuCW)
|
||||
GO(xcb_grab_key, pFpCuWCCC)
|
||||
GO(xcb_grab_keyboard, pFpCuuCC)
|
||||
GO(xcb_grab_keyboard_reply, pFpup)
|
||||
//GO(xcb_grab_keyboard_unchecked,
|
||||
GO(xcb_grab_key_checked, pFpCuWCCC)
|
||||
GO(xcb_grab_pointer, pFpCuWCCuuu)
|
||||
GO(xcb_grab_pointer_reply, pFpup)
|
||||
//GO(xcb_grab_pointer_unchecked,
|
||||
GO(xcb_grab_server, pFp)
|
||||
//GO(xcb_grab_server_checked,
|
||||
//GO(xcb_host_address,
|
||||
//GO(xcb_host_address_end,
|
||||
//GO(xcb_host_address_length,
|
||||
//GO(xcb_host_end,
|
||||
//GO(xcb_host_next,
|
||||
//GO(xcb_host_sizeof,
|
||||
//GO(xcb_image_text_16,
|
||||
//GO(xcb_image_text_16_checked,
|
||||
//GO(xcb_image_text_16_sizeof,
|
||||
//GO(xcb_image_text_16_string,
|
||||
//GO(xcb_image_text_16_string_iterator,
|
||||
//GO(xcb_image_text_16_string_length,
|
||||
GO(xcb_image_text_8, pFpCuuwwp)
|
||||
GO(xcb_image_text_8_checked, pFpCuuwwp)
|
||||
//GO(xcb_image_text_8_sizeof,
|
||||
//GO(xcb_image_text_8_string,
|
||||
//GO(xcb_image_text_8_string_end,
|
||||
//GO(xcb_image_text_8_string_length,
|
||||
//GO(xcb_install_colormap,
|
||||
//GO(xcb_install_colormap_checked,
|
||||
GO(xcb_intern_atom, pFpCWp)
|
||||
GO(xcb_intern_atom_reply, pFpup)
|
||||
//GO(xcb_intern_atom_sizeof,
|
||||
GO(xcb_intern_atom_unchecked, pFpCWp)
|
||||
//GO(xcb_keycode32_end,
|
||||
//GO(xcb_keycode32_next,
|
||||
//GO(xcb_keycode_end,
|
||||
//GO(xcb_keycode_next,
|
||||
//GO(xcb_keysym_end,
|
||||
//GO(xcb_keysym_next,
|
||||
//GO(xcb_kill_client,
|
||||
//GO(xcb_kill_client_checked,
|
||||
//GO(xcb_list_extensions,
|
||||
//GO(xcb_list_extensions_names_iterator,
|
||||
//GO(xcb_list_extensions_names_length,
|
||||
//GO(xcb_list_extensions_reply,
|
||||
//GO(xcb_list_extensions_sizeof,
|
||||
//GO(xcb_list_extensions_unchecked,
|
||||
//GO(xcb_list_fonts,
|
||||
//GO(xcb_list_fonts_names_iterator,
|
||||
//GO(xcb_list_fonts_names_length,
|
||||
//GO(xcb_list_fonts_reply,
|
||||
//GO(xcb_list_fonts_sizeof,
|
||||
//GO(xcb_list_fonts_unchecked,
|
||||
//GO(xcb_list_fonts_with_info,
|
||||
//GO(xcb_list_fonts_with_info_name,
|
||||
//GO(xcb_list_fonts_with_info_name_end,
|
||||
//GO(xcb_list_fonts_with_info_name_length,
|
||||
//GO(xcb_list_fonts_with_info_properties,
|
||||
//GO(xcb_list_fonts_with_info_properties_iterator,
|
||||
//GO(xcb_list_fonts_with_info_properties_length,
|
||||
//GO(xcb_list_fonts_with_info_reply,
|
||||
//GO(xcb_list_fonts_with_info_sizeof,
|
||||
//GO(xcb_list_fonts_with_info_unchecked,
|
||||
//GO(xcb_list_hosts,
|
||||
//GO(xcb_list_hosts_hosts_iterator,
|
||||
//GO(xcb_list_hosts_hosts_length,
|
||||
//GO(xcb_list_hosts_reply,
|
||||
//GO(xcb_list_hosts_sizeof,
|
||||
//GO(xcb_list_hosts_unchecked,
|
||||
//GO(xcb_list_installed_colormaps,
|
||||
//GO(xcb_list_installed_colormaps_cmaps,
|
||||
//GO(xcb_list_installed_colormaps_cmaps_end,
|
||||
//GO(xcb_list_installed_colormaps_cmaps_length,
|
||||
//GO(xcb_list_installed_colormaps_reply,
|
||||
//GO(xcb_list_installed_colormaps_sizeof,
|
||||
//GO(xcb_list_installed_colormaps_unchecked,
|
||||
//GO(xcb_list_properties,
|
||||
//GO(xcb_list_properties_atoms,
|
||||
//GO(xcb_list_properties_atoms_end,
|
||||
//GO(xcb_list_properties_atoms_length,
|
||||
//GO(xcb_list_properties_reply,
|
||||
//GO(xcb_list_properties_sizeof,
|
||||
//GO(xcb_list_properties_unchecked,
|
||||
//GO(xcb_lookup_color,
|
||||
//GO(xcb_lookup_color_reply,
|
||||
//GO(xcb_lookup_color_sizeof,
|
||||
//GO(xcb_lookup_color_unchecked,
|
||||
GO(xcb_map_subwindows, pFpu)
|
||||
//GO(xcb_map_subwindows_checked,
|
||||
GO(xcb_map_window, pFpu)
|
||||
GO(xcb_map_window_checked, pFpu)
|
||||
//GO(xcb_no_operation,
|
||||
//GO(xcb_no_operation_checked,
|
||||
GO(xcb_open_font, pFpuWp)
|
||||
GO(xcb_open_font_checked, pFpuWp)
|
||||
//GO(xcb_open_font_name,
|
||||
//GO(xcb_open_font_name_end,
|
||||
//GO(xcb_open_font_name_length,
|
||||
//GO(xcb_open_font_sizeof,
|
||||
//GO(xcb_parse_display,
|
||||
//GO(xcb_pixmap_end,
|
||||
//GO(xcb_pixmap_next,
|
||||
//GO(xcb_point_end,
|
||||
//GO(xcb_point_next,
|
||||
GO(xcb_poll_for_event, pFp)
|
||||
GO(xcb_poll_for_queued_event, pFp)
|
||||
//GO(xcb_poll_for_reply,
|
||||
//GO(xcb_poll_for_reply64,
|
||||
GO(xcb_poll_for_special_event, pFpp)
|
||||
GO(xcb_poly_arc, pFpuuup)
|
||||
//GO(xcb_poly_arc_arcs,
|
||||
//GO(xcb_poly_arc_arcs_iterator,
|
||||
//GO(xcb_poly_arc_arcs_length,
|
||||
//GO(xcb_poly_arc_checked,
|
||||
//GO(xcb_poly_arc_sizeof,
|
||||
//GO(xcb_poly_fill_arc,
|
||||
//GO(xcb_poly_fill_arc_arcs,
|
||||
//GO(xcb_poly_fill_arc_arcs_iterator,
|
||||
//GO(xcb_poly_fill_arc_arcs_length,
|
||||
//GO(xcb_poly_fill_arc_checked,
|
||||
//GO(xcb_poly_fill_arc_sizeof,
|
||||
GO(xcb_poly_fill_rectangle, pFpuuup)
|
||||
//GO(xcb_poly_fill_rectangle_checked,
|
||||
//GO(xcb_poly_fill_rectangle_rectangles,
|
||||
//GO(xcb_poly_fill_rectangle_rectangles_iterator,
|
||||
//GO(xcb_poly_fill_rectangle_rectangles_length,
|
||||
//GO(xcb_poly_fill_rectangle_sizeof,
|
||||
GO(xcb_poly_line, pFpCuuup)
|
||||
GO(xcb_poly_line_checked, pFpCuuup)
|
||||
//GO(xcb_poly_line_points,
|
||||
//GO(xcb_poly_line_points_iterator,
|
||||
//GO(xcb_poly_line_points_length,
|
||||
//GO(xcb_poly_line_sizeof,
|
||||
GO(xcb_poly_point, pFpCuuup)
|
||||
//GO(xcb_poly_point_checked,
|
||||
//GO(xcb_poly_point_points,
|
||||
//GO(xcb_poly_point_points_iterator,
|
||||
//GO(xcb_poly_point_points_length,
|
||||
//GO(xcb_poly_point_sizeof,
|
||||
GO(xcb_poly_rectangle, pFpuuup)
|
||||
//GO(xcb_poly_rectangle_checked,
|
||||
//GO(xcb_poly_rectangle_rectangles,
|
||||
//GO(xcb_poly_rectangle_rectangles_iterator,
|
||||
//GO(xcb_poly_rectangle_rectangles_length,
|
||||
//GO(xcb_poly_rectangle_sizeof,
|
||||
GO(xcb_poly_segment, pFpuuup)
|
||||
//GO(xcb_poly_segment_checked,
|
||||
//GO(xcb_poly_segment_segments,
|
||||
//GO(xcb_poly_segment_segments_iterator,
|
||||
//GO(xcb_poly_segment_segments_length,
|
||||
//GO(xcb_poly_segment_sizeof,
|
||||
//GO(xcb_poly_text_16,
|
||||
//GO(xcb_poly_text_16_checked,
|
||||
//GO(xcb_poly_text_16_items,
|
||||
//GO(xcb_poly_text_16_items_end,
|
||||
//GO(xcb_poly_text_16_items_length,
|
||||
//GO(xcb_poly_text_16_sizeof,
|
||||
//GO(xcb_poly_text_8,
|
||||
//GO(xcb_poly_text_8_checked,
|
||||
//GO(xcb_poly_text_8_items,
|
||||
//GO(xcb_poly_text_8_items_end,
|
||||
//GO(xcb_poly_text_8_items_length,
|
||||
//GO(xcb_poly_text_8_sizeof,
|
||||
GO(xcb_popcount, iFu)
|
||||
GO(xcb_prefetch_extension_data, vFpp)
|
||||
//GO(xcb_prefetch_maximum_request_length,
|
||||
GO(xcb_put_image, pFpCuuWWwwCCup)
|
||||
//GO(xcb_put_image_checked,
|
||||
//GO(xcb_put_image_data,
|
||||
//GO(xcb_put_image_data_end,
|
||||
//GO(xcb_put_image_data_length,
|
||||
//GO(xcb_put_image_sizeof,
|
||||
//GO(xcb_query_best_size,
|
||||
//GO(xcb_query_best_size_reply,
|
||||
//GO(xcb_query_best_size_unchecked,
|
||||
//GO(xcb_query_colors,
|
||||
//GO(xcb_query_colors_colors,
|
||||
//GO(xcb_query_colors_colors_iterator,
|
||||
//GO(xcb_query_colors_colors_length,
|
||||
//GO(xcb_query_colors_reply,
|
||||
//GO(xcb_query_colors_sizeof,
|
||||
//GO(xcb_query_colors_unchecked,
|
||||
//GO(xcb_query_extension,
|
||||
//GO(xcb_query_extension_reply,
|
||||
//GO(xcb_query_extension_sizeof,
|
||||
//GO(xcb_query_extension_unchecked,
|
||||
//GO(xcb_query_font,
|
||||
//GO(xcb_query_font_char_infos,
|
||||
//GO(xcb_query_font_char_infos_iterator,
|
||||
//GO(xcb_query_font_char_infos_length,
|
||||
//GO(xcb_query_font_properties,
|
||||
//GO(xcb_query_font_properties_iterator,
|
||||
//GO(xcb_query_font_properties_length,
|
||||
//GO(xcb_query_font_reply,
|
||||
//GO(xcb_query_font_sizeof,
|
||||
//GO(xcb_query_font_unchecked,
|
||||
//GO(xcb_query_keymap,
|
||||
//GO(xcb_query_keymap_reply,
|
||||
//GO(xcb_query_keymap_unchecked,
|
||||
GO(xcb_query_pointer, pFpu)
|
||||
GO(xcb_query_pointer_reply, pFpup)
|
||||
//GO(xcb_query_pointer_unchecked,
|
||||
GO(xcb_query_text_extents, pFpuup)
|
||||
GO(xcb_query_text_extents_reply, pFpup)
|
||||
//GO(xcb_query_text_extents_sizeof,
|
||||
//GO(xcb_query_text_extents_unchecked,
|
||||
GO(xcb_query_tree, pFpu)
|
||||
GO(xcb_query_tree_children, pFp)
|
||||
//GO(xcb_query_tree_children_end,
|
||||
GO(xcb_query_tree_children_length, iFp)
|
||||
GO(xcb_query_tree_reply, pFpup)
|
||||
//GO(xcb_query_tree_sizeof,
|
||||
GO(xcb_query_tree_unchecked, pFpu)
|
||||
//GO(xcb_recolor_cursor,
|
||||
//GO(xcb_recolor_cursor_checked,
|
||||
//GO(xcb_rectangle_end,
|
||||
//GO(xcb_rectangle_next,
|
||||
GO(xcb_register_for_special_xge, pFppup)
|
||||
GO(xcb_reparent_window, pFpuuWW)
|
||||
//GO(xcb_reparent_window_checked,
|
||||
GO(xcb_request_check, pFpu)
|
||||
//GO(xcb_rgb_end,
|
||||
//GO(xcb_rgb_next,
|
||||
//GO(xcb_rotate_properties,
|
||||
//GO(xcb_rotate_properties_atoms,
|
||||
//GO(xcb_rotate_properties_atoms_end,
|
||||
//GO(xcb_rotate_properties_atoms_length,
|
||||
//GO(xcb_rotate_properties_checked,
|
||||
//GO(xcb_rotate_properties_sizeof,
|
||||
GO(xcb_screen_allowed_depths_iterator, HFp) //xcb_depth_iterator_t is a structure
|
||||
//GO(xcb_screen_allowed_depths_length,
|
||||
//GO(xcb_screen_end,
|
||||
GO(xcb_screen_next, vFp)
|
||||
//GO(xcb_screen_sizeof,
|
||||
//GO(xcb_segment_end,
|
||||
//GO(xcb_segment_next,
|
||||
GO(xcb_send_event, pFpCuup)
|
||||
//GO(xcb_send_event_checked,
|
||||
//GO(xcb_send_fd,
|
||||
GO(xcb_send_request, uFpipp)
|
||||
GO(xcb_send_request64, UFpipp)
|
||||
GO(xcb_send_request_with_fds, uFpippup)
|
||||
GO(xcb_send_request_with_fds64, UFpippup)
|
||||
//GO(xcb_set_access_control,
|
||||
//GO(xcb_set_access_control_checked,
|
||||
//GO(xcb_set_clip_rectangles,
|
||||
//GO(xcb_set_clip_rectangles_checked,
|
||||
//GO(xcb_set_clip_rectangles_rectangles,
|
||||
//GO(xcb_set_clip_rectangles_rectangles_iterator,
|
||||
//GO(xcb_set_clip_rectangles_rectangles_length,
|
||||
//GO(xcb_set_clip_rectangles_sizeof,
|
||||
//GO(xcb_set_close_down_mode,
|
||||
//GO(xcb_set_close_down_mode_checked,
|
||||
//GO(xcb_set_dashes,
|
||||
//GO(xcb_set_dashes_checked,
|
||||
//GO(xcb_set_dashes_dashes,
|
||||
//GO(xcb_set_dashes_dashes_end,
|
||||
//GO(xcb_set_dashes_dashes_length,
|
||||
//GO(xcb_set_dashes_sizeof,
|
||||
//GO(xcb_set_font_path,
|
||||
//GO(xcb_set_font_path_checked,
|
||||
//GO(xcb_set_font_path_font_iterator,
|
||||
//GO(xcb_set_font_path_font_length,
|
||||
//GO(xcb_set_font_path_sizeof,
|
||||
GO(xcb_set_input_focus, pFpCuu) // xcb_void_cookie_t is a struct with only 1 uint inside
|
||||
//GO(xcb_set_input_focus_checked,
|
||||
//GO(xcb_set_modifier_mapping,
|
||||
//GO(xcb_set_modifier_mapping_reply,
|
||||
//GO(xcb_set_modifier_mapping_sizeof,
|
||||
//GO(xcb_set_modifier_mapping_unchecked,
|
||||
//GO(xcb_set_pointer_mapping,
|
||||
//GO(xcb_set_pointer_mapping_reply,
|
||||
//GO(xcb_set_pointer_mapping_sizeof,
|
||||
//GO(xcb_set_pointer_mapping_unchecked,
|
||||
//GO(xcb_set_screen_saver,
|
||||
//GO(xcb_set_screen_saver_checked,
|
||||
GO(xcb_set_selection_owner, pFpuuu)
|
||||
//GO(xcb_set_selection_owner_checked,
|
||||
//GO(xcb_setup_authenticate_end,
|
||||
//GO(xcb_setup_authenticate_next,
|
||||
//GO(xcb_setup_authenticate_reason,
|
||||
//GO(xcb_setup_authenticate_reason_end,
|
||||
//GO(xcb_setup_authenticate_reason_length,
|
||||
//GO(xcb_setup_authenticate_sizeof,
|
||||
//GO(xcb_setup_end,
|
||||
//GO(xcb_setup_failed_end,
|
||||
//GO(xcb_setup_failed_next,
|
||||
//GO(xcb_setup_failed_reason,
|
||||
//GO(xcb_setup_failed_reason_end,
|
||||
//GO(xcb_setup_failed_reason_length,
|
||||
//GO(xcb_setup_failed_sizeof,
|
||||
//GO(xcb_setup_next,
|
||||
GO(xcb_setup_pixmap_formats, pFp)
|
||||
GO(xcb_setup_pixmap_formats_iterator, HFp)
|
||||
GO(xcb_setup_pixmap_formats_length, iFp)
|
||||
//GO(xcb_setup_request_authorization_protocol_data,
|
||||
//GO(xcb_setup_request_authorization_protocol_data_end,
|
||||
//GO(xcb_setup_request_authorization_protocol_data_length,
|
||||
//GO(xcb_setup_request_authorization_protocol_name,
|
||||
//GO(xcb_setup_request_authorization_protocol_name_end,
|
||||
//GO(xcb_setup_request_authorization_protocol_name_length,
|
||||
//GO(xcb_setup_request_end,
|
||||
//GO(xcb_setup_request_next,
|
||||
//GO(xcb_setup_request_sizeof,
|
||||
GO(xcb_setup_roots_iterator, HFp)
|
||||
GO(xcb_setup_roots_length, iFp)
|
||||
//GO(xcb_setup_sizeof,
|
||||
//GO(xcb_setup_vendor,
|
||||
//GO(xcb_setup_vendor_end,
|
||||
//GO(xcb_setup_vendor_length,
|
||||
//GO(xcb_store_colors,
|
||||
//GO(xcb_store_colors_checked,
|
||||
//GO(xcb_store_colors_items,
|
||||
//GO(xcb_store_colors_items_iterator,
|
||||
//GO(xcb_store_colors_items_length,
|
||||
//GO(xcb_store_colors_sizeof,
|
||||
//GO(xcb_store_named_color,
|
||||
//GO(xcb_store_named_color_checked,
|
||||
//GO(xcb_store_named_color_name,
|
||||
//GO(xcb_store_named_color_name_end,
|
||||
//GO(xcb_store_named_color_name_length,
|
||||
//GO(xcb_store_named_color_sizeof,
|
||||
//GO(xcb_str_end,
|
||||
//GO(xcb_str_name,
|
||||
//GO(xcb_str_name_end,
|
||||
//GO(xcb_str_name_length,
|
||||
//GO(xcb_str_next,
|
||||
//GO(xcb_str_sizeof,
|
||||
//GO(xcb_sumof,
|
||||
//GO(xcb_take_socket,
|
||||
//GO(xcb_timecoord_end,
|
||||
//GO(xcb_timecoord_next,
|
||||
//GO(xcb_timestamp_end,
|
||||
//GO(xcb_timestamp_next,
|
||||
GO(xcb_translate_coordinates, pFpuuWW)
|
||||
GO(xcb_translate_coordinates_reply, pFpup)
|
||||
GO(xcb_translate_coordinates_unchecked, pFpuuWW)
|
||||
GO(xcb_ungrab_button, pFpCuW)
|
||||
GO(xcb_ungrab_button_checked, pFpCuW)
|
||||
GO(xcb_ungrab_key, pFpCuW)
|
||||
GO(xcb_ungrab_keyboard, pFpu)
|
||||
GO(xcb_ungrab_keyboard_checked, pFpu)
|
||||
GO(xcb_ungrab_key_checked, pFpCuW)
|
||||
GO(xcb_ungrab_pointer, pFpu)
|
||||
//GO(xcb_ungrab_pointer_checked,
|
||||
GO(xcb_ungrab_server, pFp)
|
||||
//GO(xcb_ungrab_server_checked,
|
||||
//GO(xcb_uninstall_colormap,
|
||||
//GO(xcb_uninstall_colormap_checked,
|
||||
//GO(xcb_unmap_subwindows,
|
||||
//GO(xcb_unmap_subwindows_checked,
|
||||
GO(xcb_unmap_window, pFpu)
|
||||
//GO(xcb_unmap_window_checked,
|
||||
GO(xcb_unregister_for_special_event, vFpp)
|
||||
//GO(xcb_visualid_end,
|
||||
//GO(xcb_visualid_next,
|
||||
//GO(xcb_visualtype_end,
|
||||
GO(xcb_visualtype_next, vFp)
|
||||
GO(xcb_wait_for_event, pFp)
|
||||
GO(xcb_wait_for_reply, pFpup)
|
||||
GO(xcb_wait_for_reply64, pFpUp)
|
||||
//GO(xcb_wait_for_special_event,
|
||||
GO(xcb_warp_pointer, pFpuuwwWWww)
|
||||
//GO(xcb_warp_pointer_checked,
|
||||
//GO(xcb_window_end,
|
||||
//GO(xcb_window_next,
|
||||
//GO(xcb_writev,
|
||||
//GO(xcb_xc_misc_get_version,
|
||||
//GO(xcb_xc_misc_get_version_reply,
|
||||
//GO(xcb_xc_misc_get_version_unchecked,
|
||||
//GO(xcb_xc_misc_get_xid_list,
|
||||
//GO(xcb_xc_misc_get_xid_list_ids,
|
||||
//GO(xcb_xc_misc_get_xid_list_ids_end,
|
||||
//GO(xcb_xc_misc_get_xid_list_ids_length,
|
||||
//GO(xcb_xc_misc_get_xid_list_reply,
|
||||
//GO(xcb_xc_misc_get_xid_list_sizeof,
|
||||
//GO(xcb_xc_misc_get_xid_list_unchecked,
|
||||
//GO(xcb_xc_misc_get_xid_range,
|
||||
//GO(xcb_xc_misc_get_xid_range_reply,
|
||||
//GO(xcb_xc_misc_get_xid_range_unchecked,
|
||||
DATA(xcb_xc_misc_id, 4)
|
||||
Executable
+17
@@ -0,0 +1,17 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#define _GNU_SOURCE /* See feature_test_macros(7) */
|
||||
#include <dlfcn.h>
|
||||
|
||||
#include "wrappedlibs.h"
|
||||
|
||||
#include "wrapper.h"
|
||||
#include "bridge.h"
|
||||
#include "librarian/library_private.h"
|
||||
#include "x64emu.h"
|
||||
|
||||
const char* libxdmcpName = "libXdmcp.so.6";
|
||||
#define LIBNAME libxdmcp
|
||||
|
||||
#include "wrappedlib_init.h"
|
||||
Executable
+47
@@ -0,0 +1,47 @@
|
||||
#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA))
|
||||
#error Meh...
|
||||
#endif
|
||||
|
||||
GO(XdmcpWriteARRAY16, iFpp)
|
||||
GO(XdmcpWriteARRAY32, iFpp)
|
||||
GO(XdmcpWriteARRAY8, iFpp)
|
||||
GO(XdmcpWriteARRAYofARRAY8, iFpp)
|
||||
GO(XdmcpWriteCARD16, iFpu)
|
||||
GO(XdmcpWriteCARD32, iFpu)
|
||||
GO(XdmcpWriteCARD8, iFpu)
|
||||
GO(XdmcpWriteHeader, iFpp)
|
||||
GO(XdmcpFlush, iFippi)
|
||||
GO(XdmcpReadARRAY16, iFpp)
|
||||
GO(XdmcpReadARRAY32, iFpp)
|
||||
GO(XdmcpReadARRAY8, iFpp)
|
||||
GO(XdmcpReadARRAYofARRAY8, iFpp)
|
||||
GO(XdmcpReadCARD16, iFpp)
|
||||
GO(XdmcpReadCARD32, iFpp)
|
||||
GO(XdmcpReadCARD8, iFpp)
|
||||
GO(XdmcpReadHeader, iFpp)
|
||||
GO(XdmcpFill, iFippp)
|
||||
GO(XdmcpReadRemaining, iFp)
|
||||
GO(XdmcpDisposeARRAY8, vFp)
|
||||
GO(XdmcpDisposeARRAY16, vFp)
|
||||
GO(XdmcpDisposeARRAY32, vFp)
|
||||
GO(XdmcpDisposeARRAYofARRAY8, vFp)
|
||||
GO(XdmcpCopyARRAY8, iFpp)
|
||||
GO(XdmcpARRAY8Equal, iFpp)
|
||||
GO(XdmcpGenerateKey, vFp)
|
||||
GO(XdmcpIncrementKey, vFp)
|
||||
GO(XdmcpDecrementKey, vFp)
|
||||
GO(XdmcpWrap, vFpppi)
|
||||
GO(XdmcpUnwrap, vFpppi)
|
||||
GO(XdmcpCompareKeys, iFpp)
|
||||
GO(XdmcpAllocARRAY16, iFpi)
|
||||
GO(XdmcpAllocARRAY32, iFpi)
|
||||
GO(XdmcpAllocARRAY8, iFpi)
|
||||
GO(XdmcpAllocARRAYofARRAY8, iFpi)
|
||||
GO(XdmcpReallocARRAY16, iFpi)
|
||||
GO(XdmcpReallocARRAY32, iFpi)
|
||||
GO(XdmcpReallocARRAY8, iFpi)
|
||||
GO(XdmcpReallocARRAYofARRAY8, iFpi)
|
||||
|
||||
GO(_XdmcpAuthDoIt, vFpppi)
|
||||
GO(_XdmcpAuthSetup, vFpp)
|
||||
GO(_XdmcpWrapperToOddParity, vFpp)
|
||||
Executable
+271
@@ -0,0 +1,271 @@
|
||||
#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 "wrapper.h"
|
||||
#include "bridge.h"
|
||||
#include "librarian/library_private.h"
|
||||
#include "x64emu.h"
|
||||
#include "emu/x64emu_private.h"
|
||||
#include "callback.h"
|
||||
#include "librarian.h"
|
||||
#include "box64context.h"
|
||||
#include "emu/x64emu_private.h"
|
||||
|
||||
const char* libxextName = "libXext.so.6";
|
||||
#define LIBNAME libxext
|
||||
static library_t* my_lib = NULL;
|
||||
|
||||
typedef struct _XImage XImage;
|
||||
void BridgeImageFunc(x64emu_t *emu, XImage *img);
|
||||
void UnbridgeImageFunc(x64emu_t *emu, XImage *img);
|
||||
typedef int (*XextErrorHandler)(void *, void *, void*);
|
||||
|
||||
typedef struct my_XExtensionHooks {
|
||||
int (*create_gc)(void*, uint32_t, void*);
|
||||
int (*copy_gc)(void*, uint32_t, void*);
|
||||
int (*flush_gc)(void*, uint32_t, void*);
|
||||
int (*free_gc)(void*, uint32_t, void*);
|
||||
int (*create_font)(void*, void*, void*);
|
||||
int (*free_font)(void*, void*, void*);
|
||||
int (*close_display)(void*, void*);
|
||||
int (*wire_to_event)(void*, void*, void*);
|
||||
int (*event_to_wire)(void*, void*, void*);
|
||||
int (*error)(void*, void*, void*, int*);
|
||||
char *(*error_string)(void*, int, void*, void*, int);
|
||||
} my_XExtensionHooks;
|
||||
|
||||
|
||||
typedef void* (*pFp_t)(void*);
|
||||
typedef int32_t (*iFpppiiu_t)(void*, void*, void*, int32_t, int32_t, uint32_t);
|
||||
typedef int32_t (*pFppppip_t)(void*, void*, void*, void*, int32_t, void*);
|
||||
typedef void* (*pFppuippuu_t)(void*, void*, uint32_t, int32_t, void*, void*, uint32_t, uint32_t);
|
||||
typedef int32_t (*iFppppiiiiuui_t)(void*, void*, void*, void*, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, int32_t);
|
||||
|
||||
typedef struct xext_my_s {
|
||||
// functions
|
||||
pFppuippuu_t XShmCreateImage;
|
||||
iFpppiiu_t XShmGetImage;
|
||||
iFppppiiiiuui_t XShmPutImage;
|
||||
pFp_t XSetExtensionErrorHandler;
|
||||
pFppppip_t XextAddDisplay;
|
||||
} xext_my_t;
|
||||
|
||||
void* getXextMy(library_t* lib)
|
||||
{
|
||||
xext_my_t* my = (xext_my_t*)calloc(1, sizeof(xext_my_t));
|
||||
#define GO(A, W) my->A = (W)dlsym(lib->priv.w.lib, #A);
|
||||
GO(XShmCreateImage, pFppuippuu_t)
|
||||
GO(XShmGetImage, iFpppiiu_t)
|
||||
GO(XShmPutImage, iFppppiiiiuui_t)
|
||||
GO(XSetExtensionErrorHandler, pFp_t)
|
||||
GO(XextAddDisplay, pFppppip_t)
|
||||
#undef GO
|
||||
return my;
|
||||
}
|
||||
|
||||
void freeXextMy(void* lib)
|
||||
{
|
||||
//xext_my_t *my = (xext_my_t *)lib;
|
||||
}
|
||||
|
||||
#define SUPER() \
|
||||
GO(0) \
|
||||
GO(1) \
|
||||
GO(2) \
|
||||
GO(3) \
|
||||
GO(4)
|
||||
|
||||
// exterrorhandle ...
|
||||
#define GO(A) \
|
||||
static uintptr_t my_exterrorhandle_fct_##A = 0; \
|
||||
static int my_exterrorhandle_##A(void* display, void* ext_name, void* reason) \
|
||||
{ \
|
||||
return RunFunction(my_context, my_exterrorhandle_fct_##A, 3, display, ext_name, reason); \
|
||||
}
|
||||
SUPER()
|
||||
#undef GO
|
||||
static void* find_exterrorhandle_Fct(void* fct)
|
||||
{
|
||||
if(!fct) return fct;
|
||||
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
|
||||
#define GO(A) if(my_exterrorhandle_fct_##A == (uintptr_t)fct) return my_exterrorhandle_##A;
|
||||
SUPER()
|
||||
#undef GO
|
||||
#define GO(A) if(my_exterrorhandle_fct_##A == 0) {my_exterrorhandle_fct_##A = (uintptr_t)fct; return my_exterrorhandle_##A; }
|
||||
SUPER()
|
||||
#undef GO
|
||||
printf_log(LOG_NONE, "Warning, no more slot for libXext exterrorhandle callback\n");
|
||||
return NULL;
|
||||
}
|
||||
static void* reverse_exterrorhandleFct(void* fct)
|
||||
{
|
||||
if(!fct) return fct;
|
||||
if(CheckBridged(my_lib->priv.w.bridge, fct))
|
||||
return (void*)CheckBridged(my_lib->priv.w.bridge, fct);
|
||||
#define GO(A) if(my_exterrorhandle_##A == fct) return (void*)my_exterrorhandle_fct_##A;
|
||||
SUPER()
|
||||
#undef GO
|
||||
return (void*)AddBridge(my_lib->priv.w.bridge, iFppp, fct, 0, NULL);
|
||||
}
|
||||
|
||||
#undef SUPER
|
||||
|
||||
EXPORT void* my_XShmCreateImage(x64emu_t* emu, void* disp, void* vis, uint32_t depth, int32_t fmt
|
||||
, void* data, void* shminfo, uint32_t w, uint32_t h)
|
||||
{
|
||||
xext_my_t *my = (xext_my_t*)my_lib->priv.w.p2;
|
||||
|
||||
XImage *img = my->XShmCreateImage(disp, vis, depth, fmt, data, shminfo, w, h);
|
||||
if(!img)
|
||||
return img;
|
||||
// bridge all access functions...
|
||||
BridgeImageFunc(emu, img);
|
||||
return img;
|
||||
}
|
||||
|
||||
EXPORT int32_t my_XShmPutImage(x64emu_t* emu, void* disp, void* drawable, void* gc, void* image
|
||||
, int32_t src_x, int32_t src_y, int32_t dst_x, int32_t dst_y
|
||||
, uint32_t w, uint32_t h, int32_t sendevt)
|
||||
{
|
||||
xext_my_t *my = (xext_my_t*)my_lib->priv.w.p2;
|
||||
|
||||
UnbridgeImageFunc(emu, (XImage*)image);
|
||||
int32_t r = my->XShmPutImage(disp, drawable, gc, image, src_x, src_y, dst_x, dst_y, w, h, sendevt);
|
||||
// bridge all access functions...
|
||||
BridgeImageFunc(emu, (XImage*)image);
|
||||
return r;
|
||||
}
|
||||
|
||||
EXPORT int32_t my_XShmGetImage(x64emu_t* emu, void* disp, void* drawable, void* image, int32_t x, int32_t y, uint32_t plane)
|
||||
{
|
||||
xext_my_t *my = (xext_my_t*)my_lib->priv.w.p2;
|
||||
|
||||
UnbridgeImageFunc(emu, (XImage*)image);
|
||||
int32_t r = my->XShmGetImage(disp, drawable, image, x, y, plane);
|
||||
// bridge all access functions...
|
||||
BridgeImageFunc(emu, (XImage*)image);
|
||||
return r;
|
||||
}
|
||||
|
||||
EXPORT void* my_XSetExtensionErrorHandler(x64emu_t* emu, void* handler)
|
||||
{
|
||||
xext_my_t *my = (xext_my_t*)my_lib->priv.w.p2;
|
||||
return reverse_exterrorhandleFct(my->XSetExtensionErrorHandler(find_exterrorhandle_Fct(handler)));
|
||||
}
|
||||
|
||||
static box64context_t *context = NULL;
|
||||
static uintptr_t my_hook_create_gc_fnc = 0;
|
||||
static uintptr_t my_hook_copy_gc_fnc = 0;
|
||||
static uintptr_t my_hook_flush_gc_fnc = 0;
|
||||
static uintptr_t my_hook_free_gc_fnc = 0;
|
||||
static uintptr_t my_hook_create_font_fnc = 0;
|
||||
static uintptr_t my_hook_free_font_fnc = 0;
|
||||
static uintptr_t my_hook_close_display_fnc = 0;
|
||||
static uintptr_t my_hook_wire_to_event_fnc = 0;
|
||||
static uintptr_t my_hook_event_to_wire_fnc = 0;
|
||||
static uintptr_t my_hook_error_fnc = 0;
|
||||
static uintptr_t my_hook_error_string_fnc = 0;
|
||||
static int my_hook_create_gc(void* a, uint32_t b, void* c) {
|
||||
if(my_hook_create_gc_fnc)
|
||||
return (int)RunFunction(context, my_hook_create_gc_fnc, 3, a, b, c);
|
||||
return 0;
|
||||
}
|
||||
static int my_hook_copy_gc(void* a, uint32_t b, void* c) {
|
||||
if(my_hook_copy_gc_fnc)
|
||||
return (int)RunFunction(context, my_hook_copy_gc_fnc, 3, a, b, c);
|
||||
return 0;
|
||||
}
|
||||
static int my_hook_flush_gc(void* a, uint32_t b, void* c) {
|
||||
if(my_hook_flush_gc_fnc)
|
||||
return (int)RunFunction(context, my_hook_flush_gc_fnc, 3, a, b, c);
|
||||
return 0;
|
||||
}
|
||||
static int my_hook_free_gc(void* a, uint32_t b, void* c) {
|
||||
if(my_hook_free_gc_fnc)
|
||||
return (int)RunFunction(context, my_hook_free_gc_fnc, 3, a, b, c);
|
||||
return 0;
|
||||
}
|
||||
static int my_hook_create_font(void* a, void* b, void* c) {
|
||||
if(my_hook_create_font_fnc)
|
||||
return (int)RunFunction(context, my_hook_create_font_fnc, 3, a, b, c);
|
||||
return 0;
|
||||
}
|
||||
static int my_hook_free_font(void* a, void* b, void* c) {
|
||||
if(my_hook_free_font_fnc)
|
||||
return (int)RunFunction(context, my_hook_free_font_fnc, 3, a, b, c);
|
||||
return 0;
|
||||
}
|
||||
static int my_hook_close_display(void* a, void* b) {
|
||||
if(my_hook_close_display_fnc)
|
||||
return (int)RunFunction(context, my_hook_close_display_fnc, 2, a, b);
|
||||
return 0;
|
||||
}
|
||||
static int my_hook_wire_to_event(void* a, void* b, void* c) {
|
||||
if(my_hook_wire_to_event_fnc)
|
||||
return (int)RunFunction(context, my_hook_wire_to_event_fnc, 3, a, b, c);
|
||||
return 0;
|
||||
}
|
||||
static int my_hook_event_to_wire(void* a, void* b, void* c) {
|
||||
if(my_hook_event_to_wire_fnc)
|
||||
return (int)RunFunction(context, my_hook_event_to_wire_fnc, 3, a, b, c);
|
||||
return 0;
|
||||
}
|
||||
static int my_hook_error(void* a, void* b, void* c, int* d) {
|
||||
if(my_hook_error_fnc)
|
||||
return (int)RunFunction(context, my_hook_error_fnc, 4, a, b, c, d);
|
||||
return 0;
|
||||
}
|
||||
static char* my_hook_error_string(void* a, int b, void* c, void* d, int e) {
|
||||
if(my_hook_error_string_fnc)
|
||||
return (char*)RunFunction(context, my_hook_error_string_fnc, 5, a, b, c, d, e);
|
||||
return 0;
|
||||
}
|
||||
|
||||
EXPORT int32_t my_XextAddDisplay(x64emu_t* emu, void* extinfo, void* dpy, void* extname, my_XExtensionHooks* hooks, int nevents, void* data)
|
||||
{
|
||||
xext_my_t *my = (xext_my_t*)my_lib->priv.w.p2;
|
||||
|
||||
if(!context)
|
||||
context = emu->context;
|
||||
|
||||
my_XExtensionHooks natives = {0};
|
||||
#define GO(A) if(hooks->A) {my_hook_##A##_fnc = (uintptr_t)hooks->A; natives.A = my_hook_##A;}
|
||||
GO(create_gc)
|
||||
GO(copy_gc)
|
||||
GO(flush_gc)
|
||||
GO(free_gc)
|
||||
GO(create_font)
|
||||
GO(free_font)
|
||||
GO(close_display)
|
||||
GO(wire_to_event)
|
||||
GO(event_to_wire)
|
||||
GO(error)
|
||||
GO(error_string)
|
||||
#undef GO
|
||||
int32_t ret = my->XextAddDisplay(extinfo, dpy, extname, &natives, nevents, data);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#define CUSTOM_INIT \
|
||||
lib->priv.w.p2 = getXextMy(lib); \
|
||||
my_lib = lib; \
|
||||
lib->priv.w.needed = 4; \
|
||||
lib->priv.w.neededlibs = (char**)calloc(lib->priv.w.needed, sizeof(char*)); \
|
||||
lib->priv.w.neededlibs[0] = strdup("libX11.so.6"); \
|
||||
lib->priv.w.neededlibs[1] = strdup("libxcb.so.1"); \
|
||||
lib->priv.w.neededlibs[2] = strdup("libXau.so.6"); \
|
||||
lib->priv.w.neededlibs[3] = strdup("libXdmcp.so.6");
|
||||
|
||||
#define CUSTOM_FINI \
|
||||
freeXextMy(lib->priv.w.p2); \
|
||||
free(lib->priv.w.p2); \
|
||||
my_lib = NULL;
|
||||
|
||||
#include "wrappedlib_init.h"
|
||||
|
||||
Executable
+139
@@ -0,0 +1,139 @@
|
||||
#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA))
|
||||
#error Meh....
|
||||
#endif
|
||||
|
||||
GO(DPMSCapable, iFp)
|
||||
GO(DPMSDisable, iFp)
|
||||
GO(DPMSEnable, iFp)
|
||||
GO(DPMSForceLevel, iFpu)
|
||||
GO(DPMSGetTimeouts, iFpppp)
|
||||
GO(DPMSGetVersion, iFppp)
|
||||
GO(DPMSInfo, iFppp)
|
||||
GO(DPMSQueryExtension, iFppp)
|
||||
GO(DPMSSetTimeouts, iFpuuu)
|
||||
//GO(XagCreateAssociation,
|
||||
//GO(XagCreateEmbeddedApplicationGroup,
|
||||
//GO(XagCreateNonembeddedApplicationGroup,
|
||||
//GO(XagDestroyApplicationGroup,
|
||||
//GO(XagDestroyAssociation,
|
||||
//GO(XagGetApplicationGroupAttributes,
|
||||
//GO(XagQueryApplicationGroup,
|
||||
//GO(XagQueryVersion,
|
||||
//GO(XcupGetReservedColormapEntries,
|
||||
//GO(XcupQueryVersion,
|
||||
//GO(XcupStoreColors,
|
||||
GO(XdbeAllocateBackBufferName, pFppu)
|
||||
GO(XdbeBeginIdiom, iFp)
|
||||
GO(XdbeDeallocateBackBufferName, iFpp)
|
||||
GO(XdbeEndIdiom, iFp)
|
||||
GO(XdbeFreeVisualInfo, vFp)
|
||||
GO(XdbeGetBackBufferAttributes, pFpp)
|
||||
GO(XdbeGetVisualInfo, pFppp)
|
||||
GO(XdbeQueryExtension, iFppp)
|
||||
GO(XdbeSwapBuffers, iFppi)
|
||||
//GO(XeviGetVisualInfo,
|
||||
//GO(XeviQueryExtension,
|
||||
//GO(XeviQueryVersion,
|
||||
GOM(XextAddDisplay, pFEppppip)
|
||||
GO(XextCreateExtension, pFv)
|
||||
GO(XextDestroyExtension, vFp)
|
||||
DATAB(_XExtensionErrorFunction, 4)
|
||||
GO(XextFindDisplay, pFpp)
|
||||
GO(XextRemoveDisplay, iFpp)
|
||||
//GO(XGEQueryExtension,
|
||||
//GO(XGEQueryVersion,
|
||||
//GO(XLbxGetEventBase,
|
||||
//GO(XLbxQueryExtension,
|
||||
//GO(XLbxQueryVersion,
|
||||
//GO(XmbufChangeBufferAttributes,
|
||||
//GO(XmbufChangeWindowAttributes,
|
||||
//GO(XmbufClearBufferArea,
|
||||
//GO(XmbufCreateBuffers,
|
||||
//GO(XmbufCreateStereoWindow,
|
||||
//GO(XmbufDestroyBuffers,
|
||||
//GO(XmbufDisplayBuffers,
|
||||
//GO(XmbufGetBufferAttributes,
|
||||
//GO(XmbufGetScreenInfo,
|
||||
//GO(XmbufGetVersion,
|
||||
//GO(XmbufGetWindowAttributes,
|
||||
//GO(XmbufQueryExtension,
|
||||
GO(XMissingExtension, iFpp)
|
||||
//GO(XMITMiscGetBugMode,
|
||||
//GO(XMITMiscQueryExtension,
|
||||
//GO(XMITMiscSetBugMode,
|
||||
//GO(XSecurityAllocXauth,
|
||||
//GO(XSecurityFreeXauth,
|
||||
//GO(XSecurityGenerateAuthorization,
|
||||
//GO(XSecurityQueryExtension,
|
||||
//GO(XSecurityRevokeAuthorization,
|
||||
GOM(XSetExtensionErrorHandler, pFEp)
|
||||
GO(XShapeCombineMask, vFppiiipi)
|
||||
GO(XShapeCombineRectangles, vFppiiipiii)
|
||||
GO(XShapeCombineRegion, vFppiiipi)
|
||||
GO(XShapeCombineShape, vFppiiipii)
|
||||
GO(XShapeGetRectangles, pFppipp)
|
||||
GO(XShapeInputSelected, uFpp)
|
||||
GO(XShapeOffsetShape, vFppiii)
|
||||
GO(XShapeQueryExtension, iFppp)
|
||||
GO(XShapeQueryExtents, iFpppppppppppp)
|
||||
GO(XShapeQueryVersion, iFppp)
|
||||
GO(XShapeSelectInput, vFppu)
|
||||
GO(XShmAttach, iFpp)
|
||||
GOM(XShmCreateImage, pFEppuippuu) //need brige/unbridge...
|
||||
GO(XShmCreatePixmap, pFppppuuu)
|
||||
GO(XShmDetach, iFpp)
|
||||
GO(XShmGetEventBase, iFp)
|
||||
GOM(XShmGetImage, iFEpppiiu) //need brige/unbridge...
|
||||
GO(XShmPixmapFormat, iFp)
|
||||
GOM(XShmPutImage, iFEppppiiiiuui) //need brige/unbridge...
|
||||
GO(XShmQueryExtension, iFp)
|
||||
GO(XShmQueryVersion, iFpppp)
|
||||
GO(XSyncAwait, iFppi)
|
||||
//GO(XSyncAwaitFence,
|
||||
GO(XSyncChangeAlarm, iFpuLp)
|
||||
GO(XSyncChangeCounter, iFpuU)
|
||||
GO(XSyncCreateAlarm, uFpLp) // XSyncAlarm is an XID
|
||||
GO(XSyncCreateCounter, uFpU) // XSyncValue is a struct of 2 int
|
||||
//GO(XSyncCreateFence,
|
||||
GO(XSyncDestroyAlarm, iFpu)
|
||||
GO(XSyncDestroyCounter, iFpu)
|
||||
//GO(XSyncDestroyFence,
|
||||
GO(XSyncFreeSystemCounterList, vFp)
|
||||
GO(XSyncGetPriority, iFpup)
|
||||
GO(XSyncInitialize, iFppp)
|
||||
GO(XSyncIntsToValue, vFpui)
|
||||
GO(XSyncIntToValue, vFpi)
|
||||
GO(XSyncListSystemCounters, pFpp)
|
||||
//GO(XSyncMaxValue,
|
||||
//GO(XSyncMinValue,
|
||||
GO(XSyncQueryAlarm, iFpup)
|
||||
GO(XSyncQueryCounter, iFpup)
|
||||
GO(XSyncQueryExtension, iFppp)
|
||||
//GO(XSyncQueryFence,
|
||||
//GO(XSyncResetFence,
|
||||
GO(XSyncSetCounter, iFpuU) // XSyncCounter is an XID
|
||||
GO(XSyncSetPriority, iFpui)
|
||||
//GO(XSyncTriggerFence,
|
||||
//GO(XSyncValueAdd,
|
||||
//GO(XSyncValueEqual,
|
||||
//GO(XSyncValueGreaterOrEqual,
|
||||
//GO(XSyncValueGreaterThan,
|
||||
//GO(XSyncValueHigh32,
|
||||
//GO(XSyncValueIsNegative,
|
||||
//GO(XSyncValueIsPositive,
|
||||
//GO(XSyncValueIsZero,
|
||||
//GO(XSyncValueLessOrEqual,
|
||||
//GO(XSyncValueLessThan,
|
||||
//GO(XSyncValueLow32,
|
||||
//GO(XSyncValueSubtract,
|
||||
DATA(XTestFakeAckType, sizeof(void*))
|
||||
//GO(XTestFakeInput,
|
||||
//GO(XTestFlush,
|
||||
//GO(XTestGetInput,
|
||||
DATAB(XTestInputActionType, sizeof(void*))
|
||||
//GO(XTestMovePointer,
|
||||
//GO(XTestPressButton,
|
||||
//GO(XTestPressKey,
|
||||
//GO(XTestQueryInputSize,
|
||||
//GO(XTestReset,
|
||||
//GO(XTestStopInput,
|
||||
Executable
+24
@@ -0,0 +1,24 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#define _GNU_SOURCE /* See feature_test_macros(7) */
|
||||
#include <dlfcn.h>
|
||||
|
||||
#include "wrappedlibs.h"
|
||||
|
||||
#include "wrapper.h"
|
||||
#include "bridge.h"
|
||||
#include "librarian/library_private.h"
|
||||
#include "x64emu.h"
|
||||
|
||||
const char* libxiName = "libXi.so.6";
|
||||
#define LIBNAME libxi
|
||||
|
||||
#define CUSTOM_INIT \
|
||||
lib->priv.w.needed = 2; \
|
||||
lib->priv.w.neededlibs = (char**)calloc(lib->priv.w.needed, sizeof(char*)); \
|
||||
lib->priv.w.neededlibs[0] = strdup("libX11.so.6"); \
|
||||
lib->priv.w.neededlibs[1] = strdup("libXext.so.6");
|
||||
|
||||
#include "wrappedlib_init.h"
|
||||
|
||||
Executable
+88
@@ -0,0 +1,88 @@
|
||||
#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA))
|
||||
#error Meh....
|
||||
#endif
|
||||
|
||||
//GO(XAllowDeviceEvents,
|
||||
//GO(XChangeDeviceControl,
|
||||
//GO(XChangeDeviceDontPropagateList,
|
||||
//GO(XChangeDeviceKeyMapping,
|
||||
GO(XChangeDeviceProperty, vFppppiipi)
|
||||
//GO(XChangeFeedbackControl,
|
||||
//GO(XChangeKeyboardDevice,
|
||||
//GO(XChangePointerDevice,
|
||||
GO(XCloseDevice, iFpp)
|
||||
GO(XDeleteDeviceProperty, vFppp)
|
||||
//GO(XDeviceBell,
|
||||
//GO(XFreeDeviceControl,
|
||||
GO(XFreeDeviceList, iFp)
|
||||
GO(XFreeDeviceMotionEvents, iFv)
|
||||
GO(XFreeDeviceState, vFp)
|
||||
//GO(XFreeFeedbackList,
|
||||
GO(XGetDeviceButtonMapping, iFpppi)
|
||||
//GO(XGetDeviceControl,
|
||||
//GO(XGetDeviceDontPropagateList,
|
||||
//GO(XGetDeviceFocus,
|
||||
//GO(XGetDeviceKeyMapping,
|
||||
//GO(XGetDeviceModifierMapping,
|
||||
GO(XGetDeviceMotionEvents, pFppuuppp)
|
||||
GO(XGetDeviceProperty, iFpppllipppppp)
|
||||
//GO(XGetExtensionVersion,
|
||||
//GO(XGetFeedbackControl,
|
||||
//GO(XGetSelectedExtensionEvents,
|
||||
GO(XGrabDevice, iFpppiipiiu)
|
||||
//GO(XGrabDeviceButton,
|
||||
//GO(XGrabDeviceKey,
|
||||
//GO(XIAllowEvents,
|
||||
//GO(XIAllowTouchEvents,
|
||||
//GO(XIBarrierReleasePointer,
|
||||
//GO(XIBarrierReleasePointers,
|
||||
//GO(XIChangeHierarchy,
|
||||
GO(XIChangeProperty, vFpippiipi)
|
||||
//GO(XIDefineCursor,
|
||||
GO(XIDeleteProperty, vFpip)
|
||||
GO(XIFreeDeviceInfo, vFp)
|
||||
GO(XIGetClientPointer, iFppp)
|
||||
//GO(XIGetFocus,
|
||||
GO(XIGetProperty, iFpipllippppp)
|
||||
GO(XIGetSelectedEvents, iFpppi)
|
||||
//GO(XIGrabButton,
|
||||
GO(XIGrabDevice, iFpipLpiiip)
|
||||
//GO(XIGrabEnter,
|
||||
//GO(XIGrabFocusIn,
|
||||
//GO(XIGrabKeycode,
|
||||
//GO(XIGrabTouchBegin,
|
||||
//GO(XIListProperties,
|
||||
GO(XIQueryDevice, pFpip)
|
||||
GO(XIQueryPointer, iFpipppppppppp)
|
||||
GO(XIQueryVersion, iFppp)
|
||||
GO(XISelectEvents, iFpppi)
|
||||
GO(XISetClientPointer, iFppi)
|
||||
//GO(XISetFocus,
|
||||
//GO(XIUndefineCursor,
|
||||
//GO(XIUngrabButton,
|
||||
GO(XIUngrabDevice, iFpiL)
|
||||
//GO(XIUngrabEnter,
|
||||
//GO(XIUngrabFocusIn,
|
||||
//GO(XIUngrabKeycode,
|
||||
//GO(XIUngrabTouchBegin,
|
||||
//GO(XIWarpPointer,
|
||||
//GO(XListDeviceProperties,
|
||||
GO(XListInputDevices, pFpp)
|
||||
GO(XOpenDevice, pFpp)
|
||||
GO(XQueryDeviceState, pFpp)
|
||||
GO(XSelectExtensionEvent, iFpppi)
|
||||
//GO(XSendExtensionEvent,
|
||||
GO(XSetDeviceButtonMapping, iFpppi)
|
||||
//GO(XSetDeviceFocus,
|
||||
//GO(XSetDeviceMode,
|
||||
//GO(XSetDeviceModifierMapping,
|
||||
//GO(XSetDeviceValuators,
|
||||
GO(XUngrabDevice, iFppu)
|
||||
//GO(XUngrabDeviceButton,
|
||||
//GO(XUngrabDeviceKey,
|
||||
//GO(_XiGetDevicePresenceNotifyEvent,
|
||||
//GO(_xibadclass,
|
||||
//GO(_xibaddevice,
|
||||
//GO(_xibadevent,
|
||||
//GO(_xibadmode,
|
||||
//GO(_xidevicebusy,
|
||||
Executable
+30
@@ -0,0 +1,30 @@
|
||||
#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 "wrapper.h"
|
||||
#include "bridge.h"
|
||||
#include "librarian/library_private.h"
|
||||
#include "x64emu.h"
|
||||
#include "emu/x64emu_private.h"
|
||||
#include "callback.h"
|
||||
#include "librarian.h"
|
||||
#include "box64context.h"
|
||||
#include "emu/x64emu_private.h"
|
||||
|
||||
const char* libxrandrName = "libXrandr.so.2";
|
||||
#define LIBNAME libxrandr
|
||||
|
||||
#define CUSTOM_INIT \
|
||||
lib->priv.w.needed = 3; \
|
||||
lib->priv.w.neededlibs = (char**)calloc(lib->priv.w.needed, sizeof(char*)); \
|
||||
lib->priv.w.neededlibs[0] = strdup("libX11.so.6"); \
|
||||
lib->priv.w.neededlibs[1] = strdup("libXext.so.6"); \
|
||||
lib->priv.w.neededlibs[2] = strdup("libXrender.so.1");
|
||||
|
||||
#include "wrappedlib_init.h"
|
||||
Executable
+73
@@ -0,0 +1,73 @@
|
||||
#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA))
|
||||
#error meh!
|
||||
#endif
|
||||
|
||||
GO(XRRQueryVersion,iFppp)
|
||||
GO(XRRFreeScreenConfigInfo,vFp)
|
||||
GO(XRRGetCrtcInfo, pFppu)
|
||||
GO(XRRListOutputProperties, pFpup)
|
||||
GO(XRRQueryExtension, iFppp)
|
||||
//GO(XRRAllocModeInfo
|
||||
//GO(XRRGetProviderProperty
|
||||
//GO(XRRListProviderProperties
|
||||
GO(XRRRotations,uFpip)
|
||||
//GO(XRRSetCrtcTransform
|
||||
GO(XRRGetCrtcGammaSize, iFpu)
|
||||
GO(XRRConfigRotations,uFpp)
|
||||
GO(XRRGetProviderInfo, pFppp)
|
||||
//GO(XRRConfigureOutputProperty
|
||||
//GO(XRRSetOutputPrimary
|
||||
GO(XRRFreeOutputInfo, vFp)
|
||||
GO(XRRUpdateConfiguration,iFp)
|
||||
GO(XRRGetScreenResources, pFpp)
|
||||
GO(XRRConfigSizes,pFpp)
|
||||
//GO(XRRQueryProviderProperty
|
||||
//GO(XRRDeleteOutputProperty
|
||||
//GO(XRRDeleteProviderProperty
|
||||
GO(XRRSetScreenConfig,iFpppiuu)
|
||||
GO(XRRAllocGamma, pFi)
|
||||
GO(XRRSetScreenSize, vFppiiii)
|
||||
GO(XRRSetScreenConfigAndRate,iFpppiuwu)
|
||||
GO(XRRFreeScreenResources, vFp)
|
||||
GO(XRRGetOutputPrimary, uFpp)
|
||||
//GO(XRRCreateMode
|
||||
GO(XRRConfigCurrentRate,wFp)
|
||||
//GO(XRRDestroyMode
|
||||
GO(XRRSetCrtcConfig, iFppuuiiuupi)
|
||||
GO(XRRConfigCurrentConfiguration,uFpp)
|
||||
GO(XRRSizes,pFpip)
|
||||
//GO(XRRAddOutputMode
|
||||
GO(XRRFreePanning, vFp)
|
||||
GO(XRRFreeProviderResources, vFp)
|
||||
//GO(XRRChangeProviderProperty
|
||||
GO(XRRGetPanning, pFppu)
|
||||
//GO(XRRSetProviderOffloadSink
|
||||
GO(XRRGetScreenResourcesCurrent, pFpp)
|
||||
GO(XRRConfigTimes,uFpp)
|
||||
GO(XRRSetCrtcGamma, vFppp)
|
||||
//GO(XRRSetProviderOutputSource
|
||||
GO(XRRGetScreenSizeRange, iFpppppp)
|
||||
GO(XRRRates,pFpiip)
|
||||
GO(XRRFreeProviderInfo, vFp)
|
||||
GO(XRRConfigRates,pFpip)
|
||||
GO(XRRQueryOutputProperty, pFpup)
|
||||
GO(XRRGetOutputProperty, iFpupiiiipppppp)
|
||||
GO(XRRFreeGamma, vFp)
|
||||
GO(XRRRootToScreen,iFpp)
|
||||
GO(XRRGetScreenInfo,pFpp)
|
||||
GO(XRRFreeCrtcInfo, vFp)
|
||||
GO(XRRGetProviderResources, pFpp)
|
||||
//GO(XRRFreeModeInfo
|
||||
//GO(XRRChangeOutputProperty
|
||||
GO(XRRGetCrtcGamma, pFpu)
|
||||
GO(XRRSetPanning, pFppu)
|
||||
GO(XRRSelectInput,vFppi)
|
||||
//GO(XRRGetCrtcTransform
|
||||
GO(XRRTimes,uFpip)
|
||||
//GO(XRRDeleteOutputMode
|
||||
GO(XRRGetOutputInfo, pFppu)
|
||||
//GO(XRRConfigureProviderProperty
|
||||
GO(XRRAllocateMonitor, pFpi)
|
||||
GO(XRRGetMonitors, pFppip)
|
||||
GO(XRRSetMonitor, vFppp)
|
||||
GO(XRRFreeMonitors, vFp)
|
||||
Executable
+26
@@ -0,0 +1,26 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#define _GNU_SOURCE /* See feature_test_macros(7) */
|
||||
#include <dlfcn.h>
|
||||
|
||||
#include "wrappedlibs.h"
|
||||
|
||||
#include "wrapper.h"
|
||||
#include "bridge.h"
|
||||
#include "librarian/library_private.h"
|
||||
#include "x64emu.h"
|
||||
|
||||
const char* libxrenderName = "libXrender.so.1";
|
||||
#define LIBNAME libxrender
|
||||
|
||||
#define CUSTOM_INIT \
|
||||
lib->priv.w.needed = 4; \
|
||||
lib->priv.w.neededlibs = (char**)calloc(lib->priv.w.needed, sizeof(char*)); \
|
||||
lib->priv.w.neededlibs[0] = strdup("libX11.so.6"); \
|
||||
lib->priv.w.neededlibs[1] = strdup("libxcb.so.1"); \
|
||||
lib->priv.w.neededlibs[2] = strdup("libXau.so.6"); \
|
||||
lib->priv.w.neededlibs[3] = strdup("libXdmcp.so.6");
|
||||
|
||||
#include "wrappedlib_init.h"
|
||||
|
||||
Executable
+51
@@ -0,0 +1,51 @@
|
||||
#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA))
|
||||
#error Meh....
|
||||
#endif
|
||||
|
||||
GO(XRenderAddGlyphs, vFppppipi)
|
||||
GO(XRenderAddTraps, vFppiipi)
|
||||
GO(XRenderChangePicture, vFppup)
|
||||
GO(XRenderComposite, vFppup)
|
||||
GO(XRenderCompositeDoublePoly, vFpipppiiiipii)
|
||||
GO(XRenderCompositeString16, vFpippppiiiipi)
|
||||
GO(XRenderCompositeString32, vFpippppiiiipi)
|
||||
GO(XRenderCompositeString8, vFpippppiiiipi)
|
||||
GO(XRenderCompositeText16, vFpipppiiiipi)
|
||||
GO(XRenderCompositeText32, vFpipppiiiipi)
|
||||
GO(XRenderCompositeText8, vFpipppiiiipi)
|
||||
GO(XRenderCompositeTrapezoids, vFpipppiipi)
|
||||
GO(XRenderCompositeTriangles, vFpipppiipi)
|
||||
GO(XRenderCompositeTriFan, vFpipppiipi)
|
||||
GO(XRenderCompositeTriStrip, vFpipppiipi)
|
||||
GO(XRenderCreateAnimCursor, pFpip)
|
||||
GO(XRenderCreateConicalGradient, pFppppi)
|
||||
GO(XRenderCreateCursor, pFppii)
|
||||
GO(XRenderCreateGlyphSet, pFpp)
|
||||
GO(XRenderCreateLinearGradient, pFppppi)
|
||||
GO(XRenderCreatePicture, pFpppup)
|
||||
GO(XRenderCreateRadialGradient, pFppppi)
|
||||
GO(XRenderCreateSolidFill, pFpp)
|
||||
DATAB(XRenderExtensionInfo, sizeof(void*))
|
||||
DATA(XRenderExtensionName, sizeof(void*)) //D
|
||||
GO(XRenderFillRectangle, vFpippiiuu)
|
||||
GO(XRenderFillRectangles, vFpipppi)
|
||||
GO(XRenderFindDisplay, pFp)
|
||||
GO(XRenderFindFormat, pFpupi)
|
||||
GO(XRenderFindStandardFormat, pFpi)
|
||||
GO(XRenderFindVisualFormat, pFpp)
|
||||
GO(XRenderFreeGlyphs, vFpppi)
|
||||
GO(XRenderFreeGlyphSet, vFpp)
|
||||
GO(XRenderFreePicture, vFpp)
|
||||
GO(XRenderParseColor, iFppp)
|
||||
GO(XRenderQueryExtension, iFppp)
|
||||
GO(XRenderQueryFilters, pFpp)
|
||||
GO(XRenderQueryFormats, iFp)
|
||||
GO(XRenderQueryPictIndexValues, pFppp)
|
||||
GO(XRenderQuerySubpixelOrder, iFpi)
|
||||
GO(XRenderQueryVersion, iFppp)
|
||||
GO(XRenderReferenceGlyphSet, pFpp)
|
||||
GO(XRenderSetPictureClipRectangles, vFppiipi)
|
||||
GO(XRenderSetPictureClipRegion, vFppp)
|
||||
GO(XRenderSetPictureFilter, vFppppi)
|
||||
GO(XRenderSetPictureTransform, vFppp)
|
||||
GO(XRenderSetSubpixelOrder, iFpii)
|
||||
Executable
+30
@@ -0,0 +1,30 @@
|
||||
#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 "wrapper.h"
|
||||
#include "bridge.h"
|
||||
#include "librarian/library_private.h"
|
||||
#include "x64emu.h"
|
||||
#include "emu/x64emu_private.h"
|
||||
#include "callback.h"
|
||||
#include "librarian.h"
|
||||
#include "box64context.h"
|
||||
#include "emu/x64emu_private.h"
|
||||
|
||||
const char* libxxf86vmName = "libXxf86vm.so.1";
|
||||
#define LIBNAME libxxf86vm
|
||||
|
||||
|
||||
#define CUSTOM_INIT \
|
||||
lib->priv.w.needed = 2; \
|
||||
lib->priv.w.neededlibs = (char**)calloc(lib->priv.w.needed, sizeof(char*)); \
|
||||
lib->priv.w.neededlibs[0] = strdup("libX11.so.6"); \
|
||||
lib->priv.w.neededlibs[1] = strdup("libXext.so.6");
|
||||
|
||||
#include "wrappedlib_init.h"
|
||||
Executable
+26
@@ -0,0 +1,26 @@
|
||||
#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA))
|
||||
#error meh!
|
||||
#endif
|
||||
|
||||
GO(XF86VidModeGetViewPort, iFpipp)
|
||||
GO(XF86VidModeValidateModeLine, iFpip)
|
||||
GO(XF86VidModeGetGamma, iFpip)
|
||||
GO(XF86VidModeSetGamma, iFpip)
|
||||
GO(XF86VidModeSetClientVersion, iFp)
|
||||
GO(XF86VidModeGetGammaRamp, iFpiippp)
|
||||
GO(XF86VidModeGetMonitor, iFpip)
|
||||
GO(XF86VidModeQueryVersion, iFppp)
|
||||
GO(XF86VidModeDeleteModeLine, iFpip)
|
||||
GO(XF86VidModeGetModeLine, iFpipp)
|
||||
GO(XF86VidModeGetAllModeLines, iFpipp)
|
||||
GO(XF86VidModeSetGammaRamp, iFpiippp)
|
||||
GO(XF86VidModeGetPermissions, iFpip)
|
||||
GO(XF86VidModeModModeLine, iFpip)
|
||||
GO(XF86VidModeSetViewPort, iFpiii)
|
||||
GO(XF86VidModeSwitchMode, iFpip)
|
||||
GO(XF86VidModeAddModeLine, iFpipp)
|
||||
GO(XF86VidModeSwitchToMode, iFpip)
|
||||
GO(XF86VidModeQueryExtension, iFppp)
|
||||
GO(XF86VidModeGetGammaRampSize, iFpip)
|
||||
GO(XF86VidModeGetDotClocks, iFpipppp)
|
||||
GO(XF86VidModeLockModeSwitch, iFpii)
|
||||
Executable
+210
@@ -0,0 +1,210 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#define _GNU_SOURCE /* See feature_test_macros(7) */
|
||||
#include <dlfcn.h>
|
||||
|
||||
#include "wrappedlibs.h"
|
||||
|
||||
#include "wrapper.h"
|
||||
#include "bridge.h"
|
||||
#include "librarian/library_private.h"
|
||||
#include "x64emu.h"
|
||||
#include "debug.h"
|
||||
#include "callback.h"
|
||||
#include "emu/x64emu_private.h"
|
||||
#include "box64context.h"
|
||||
|
||||
const char* libzName = "libz.so.1";
|
||||
#define LIBNAME libz
|
||||
|
||||
// TODO: put the wrapper type in a dedicate include
|
||||
typedef void* (*pFpi_t)(void*, int32_t);
|
||||
typedef void* (*pFp_t)(void*);
|
||||
typedef void* (*pFpp_t)(void*, void*);
|
||||
typedef int32_t (*iFp_t)(void*);
|
||||
typedef int32_t (*iFppi_t)(void*, void*, int32_t);
|
||||
typedef int32_t (*iFpipi_t)(void*, int, void*, int);
|
||||
typedef void* (*pFpippp_t)(void*, int32_t, void*, void*, void*);
|
||||
typedef void (*vFp_t)(void*);
|
||||
typedef void* (*pFpp_t)(void*, void*);
|
||||
typedef uint32_t (*uFp_t)(void*);
|
||||
typedef uint64_t (*UFp_t)(void*);
|
||||
typedef uint32_t (*uFu_t)(uint32_t);
|
||||
typedef int32_t (*iFpp_t)(void*, void*);
|
||||
typedef uint32_t (*uFpW_t)(void*, uint16_t);
|
||||
typedef uint32_t (*uFpu_t)(void*, uint32_t);
|
||||
typedef uint32_t (*uFpU_t)(void*, uint64_t);
|
||||
typedef uint32_t (*uFupp_t)(uint32_t, void*, void*);
|
||||
typedef int (*iFpiiiiipi_t)(void*, int, int, int, int, int, void*, int);
|
||||
|
||||
#define SUPER() \
|
||||
GO(inflateInit_, iFppi_t) \
|
||||
GO(inflateInit, iFp_t) \
|
||||
GO(inflateEnd, iFp_t) \
|
||||
GO(deflateEnd, iFp_t) \
|
||||
GO(inflateInit2_, iFpipi_t) \
|
||||
GO(deflateInit_, iFpipi_t) \
|
||||
GO(deflateInit2_, iFpiiiiipi_t)
|
||||
|
||||
typedef struct libz_my_s {
|
||||
// functions
|
||||
#define GO(A, B) B A;
|
||||
SUPER()
|
||||
#undef GO
|
||||
} libz_my_t;
|
||||
|
||||
|
||||
void* getZMy(library_t* lib)
|
||||
{
|
||||
libz_my_t* my = (libz_my_t*)calloc(1, sizeof(libz_my_t));
|
||||
#define GO(A, W) my->A = (W)dlsym(lib->priv.w.lib, #A);
|
||||
SUPER()
|
||||
#undef GO
|
||||
return my;
|
||||
}
|
||||
#undef SUPER
|
||||
|
||||
void freeZMy(void* lib)
|
||||
{
|
||||
//libz_my_t *my = (libz_my_t *)lib;
|
||||
}
|
||||
|
||||
#define SUPER() \
|
||||
GO(0) \
|
||||
GO(1) \
|
||||
GO(2) \
|
||||
GO(3) \
|
||||
GO(4)
|
||||
|
||||
// alloc ...
|
||||
#define GO(A) \
|
||||
static uintptr_t my_alloc_fct_##A = 0; \
|
||||
static void* my_alloc_##A(void* opaque, uint32_t items, uint32_t size) \
|
||||
{ \
|
||||
return (void*)RunFunction(my_context, my_alloc_fct_##A, 3, opaque, items, size); \
|
||||
}
|
||||
SUPER()
|
||||
#undef GO
|
||||
static void* find_alloc_Fct(void* fct)
|
||||
{
|
||||
if(!fct) return fct;
|
||||
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
|
||||
#define GO(A) if(my_alloc_fct_##A == (uintptr_t)fct) return my_alloc_##A;
|
||||
SUPER()
|
||||
#undef GO
|
||||
#define GO(A) if(my_alloc_fct_##A == 0) {my_alloc_fct_##A = (uintptr_t)fct; return my_alloc_##A; }
|
||||
SUPER()
|
||||
#undef GO
|
||||
printf_log(LOG_NONE, "Warning, no more slot for zlib alloc callback\n");
|
||||
return NULL;
|
||||
}
|
||||
// free ...
|
||||
#define GO(A) \
|
||||
static uintptr_t my_free_fct_##A = 0; \
|
||||
static void my_free_##A(void* opaque, void* address) \
|
||||
{ \
|
||||
RunFunction(my_context, my_free_fct_##A, 2, opaque, address); \
|
||||
}
|
||||
SUPER()
|
||||
#undef GO
|
||||
static void* find_free_Fct(void* fct)
|
||||
{
|
||||
if(!fct) return fct;
|
||||
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
|
||||
#define GO(A) if(my_free_fct_##A == (uintptr_t)fct) return my_free_##A;
|
||||
SUPER()
|
||||
#undef GO
|
||||
#define GO(A) if(my_free_fct_##A == 0) {my_free_fct_##A = (uintptr_t)fct; return my_free_##A; }
|
||||
SUPER()
|
||||
#undef GO
|
||||
printf_log(LOG_NONE, "Warning, no more slot for zlib free callback\n");
|
||||
return NULL;
|
||||
}
|
||||
#undef SUPER
|
||||
|
||||
typedef struct z_stream_s {
|
||||
void *next_in;
|
||||
uint32_t avail_in;
|
||||
uintptr_t total_in;
|
||||
void *next_out;
|
||||
uint32_t avail_out;
|
||||
uintptr_t total_out;
|
||||
char *msg;
|
||||
void *state;
|
||||
void* zalloc;
|
||||
void* zfree;
|
||||
void* opaque;
|
||||
int32_t data_type;
|
||||
uintptr_t adler;
|
||||
uintptr_t reserved;
|
||||
} z_stream;
|
||||
|
||||
static void wrapper_stream_z(x64emu_t* emu, void* str)
|
||||
{
|
||||
z_stream *stream = (z_stream*)str;
|
||||
stream->zalloc = find_alloc_Fct(stream->zalloc);
|
||||
stream->zfree = find_free_Fct(stream->zfree);
|
||||
}
|
||||
|
||||
EXPORT int32_t my_inflateInit_(x64emu_t* emu, void* str, void* version, int32_t size)
|
||||
{
|
||||
libz_my_t *my = (libz_my_t *)emu->context->zlib->priv.w.p2;
|
||||
wrapper_stream_z(emu, str);
|
||||
return my->inflateInit_(str, version, size);
|
||||
}
|
||||
|
||||
EXPORT int32_t my_inflateInit(x64emu_t* emu, void* str)
|
||||
{
|
||||
libz_my_t *my = (libz_my_t *)emu->context->zlib->priv.w.p2;
|
||||
wrapper_stream_z(emu, str);
|
||||
return my->inflateInit(str);
|
||||
}
|
||||
|
||||
EXPORT int32_t my_inflateInit2_(x64emu_t* emu, void* str, int windowBits, void* version, int stream_size)
|
||||
{
|
||||
libz_my_t *my = (libz_my_t *)emu->context->zlib->priv.w.p2;
|
||||
wrapper_stream_z(emu, str);
|
||||
return my->inflateInit2_(str, windowBits, version, stream_size);
|
||||
}
|
||||
|
||||
EXPORT int32_t my_inflateEnd(x64emu_t* emu, void* str)
|
||||
{
|
||||
libz_my_t *my = (libz_my_t *)emu->context->zlib->priv.w.p2;
|
||||
int32_t r = my->inflateEnd(str);
|
||||
return r;
|
||||
}
|
||||
|
||||
EXPORT int32_t my_deflateInit_(x64emu_t* emu, void* str, int level, void* version, int stream_size)
|
||||
{
|
||||
libz_my_t *my = (libz_my_t *)emu->context->zlib->priv.w.p2;
|
||||
wrapper_stream_z(emu, str);
|
||||
return my->deflateInit_(str, level, version, stream_size);
|
||||
}
|
||||
|
||||
EXPORT int32_t my_deflateInit2_(x64emu_t* emu, void* str, int level, int method, int windowBits, int memLevel, int strategy, void* version, int stream_size)
|
||||
{
|
||||
libz_my_t *my = (libz_my_t *)emu->context->zlib->priv.w.p2;
|
||||
wrapper_stream_z(emu, str);
|
||||
return my->deflateInit2_(str, level, method, windowBits, memLevel, strategy, version, stream_size);
|
||||
}
|
||||
|
||||
EXPORT int32_t my_deflateEnd(x64emu_t* emu, void* str)
|
||||
{
|
||||
libz_my_t *my = (libz_my_t *)emu->context->zlib->priv.w.p2;
|
||||
int32_t r = my->deflateEnd(str);
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
#define CUSTOM_INIT \
|
||||
box64->zlib = lib; \
|
||||
lib->priv.w.p2 = getZMy(lib);
|
||||
|
||||
#define CUSTOM_FINI \
|
||||
freeZMy(lib->priv.w.p2); \
|
||||
free(lib->priv.w.p2); \
|
||||
((box64context_t*)(lib->context))->zlib = NULL;
|
||||
|
||||
#include "wrappedlib_init.h"
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA))
|
||||
#error Meh
|
||||
#endif
|
||||
|
||||
GO(zlibVersion, pFv)
|
||||
GO(deflateInit, iFpi)
|
||||
GO(deflate, iFpi)
|
||||
GO(deflateEnd, iFp)
|
||||
GOM(inflateInit, iFEp)
|
||||
GO(inflate, iFpi)
|
||||
GOM(inflateEnd, iFEp)
|
||||
GO(deflateInit2, iFpiiiiipi)
|
||||
GO(deflateSetDictionary, iFppu)
|
||||
GO(deflateGetDictionary, iFppp)
|
||||
GO(deflateCopy, iFpp)
|
||||
GO(deflateReset, iFp)
|
||||
GO(deflateParams, iFpii)
|
||||
GO(deflateTune, iFpiiii)
|
||||
GO(deflateBound, LFpL)
|
||||
GO(deflatePending, iFppp)
|
||||
GO(deflatePrime, iFpii)
|
||||
GO(deflateSetHeader, iFpp)
|
||||
GO(inflateInit2, iFpi)
|
||||
GO(inflateSetDictionary, iFppu)
|
||||
GO(inflateGetDictionary, iFppp)
|
||||
GO(inflateSync, iFp)
|
||||
GO(inflateCopy, iFpp)
|
||||
GO(inflateReset, iFp)
|
||||
GO(inflateReset2, iFpi)
|
||||
GO(inflatePrime, iFpii)
|
||||
GO(inflateMark, iFp)
|
||||
GO(inflateGetHeader, iFpp)
|
||||
GO(inflateBackInit, iFpip)
|
||||
//GOM(inflateBack, iFpBpBp) // callbacks...
|
||||
GO(inflateBackEnd, iFp)
|
||||
GO(zlibCompileFlags, LFv)
|
||||
GO(compress, iFpppL)
|
||||
GO(compress2, iFpppLi)
|
||||
GO(compressBound, LFL)
|
||||
GO(uncompress, iFpppL)
|
||||
GO(uncompress2, iFpppp)
|
||||
GO(gzopen, pFpp)
|
||||
GO(gzdopen, pFip)
|
||||
GO(gzbuffer, iFpu)
|
||||
GO(gzsetparams, iFpii)
|
||||
GO(gzread, iFppu)
|
||||
GO(gzfread, LFpLLp)
|
||||
GO(gzwrite, iFppu)
|
||||
GO(gzfwrite, LFpLLp)
|
||||
//GOM(gzprintf, iFEppVV)
|
||||
GO(gzputs, iFpp)
|
||||
GO(gzgets, pFppi)
|
||||
GO(gzputc, iFpi)
|
||||
GO(gzgetc, iFp)
|
||||
GO(gzungetc, iFip)
|
||||
GO(gzflush, iFpi)
|
||||
GO(gzseek, iFpii)
|
||||
GO(gzrewind, iFp)
|
||||
GO(gztell, iFp)
|
||||
GO(gzoffset, iFp)
|
||||
GO(gzeof, iFp)
|
||||
GO(gzdirect, iFp)
|
||||
GO(gzclose, iFp)
|
||||
GO(gzclose_r, iFp)
|
||||
GO(gzclose_w, iFp)
|
||||
GO(gzerror, pFpp)
|
||||
GO(gzclearerr, vFp)
|
||||
GO(adler32, LFLpu)
|
||||
GO(adler32_z, LFLpL)
|
||||
GO(adler32_combine, uFuui)
|
||||
GO(crc32, LFLpu)
|
||||
GO(crc32_z, LFLpL)
|
||||
GO(crc32_combine, uFuui)
|
||||
GOM(deflateInit_, iFEpipi)
|
||||
GOM(inflateInit_, iFEppi)
|
||||
GOM(deflateInit2_, iFEpiiiiipi)
|
||||
GOM(inflateInit2_, iFEpipi)
|
||||
GO(inflateBackInit_, iFpippi)
|
||||
GO(gzgetc_, iFp)
|
||||
GO(gzopen64, pFpp)
|
||||
GO(gzseek64, IFpIi)
|
||||
GO(gztell64, IFp)
|
||||
GO(gzoffset64, IFp)
|
||||
GO(adler32_combine64, LFLLI)
|
||||
GO(crc32_combine64, LFLLI)
|
||||
GO(gzopen64, pFpp)
|
||||
GO(gzseek64, iFpii)
|
||||
GO(gztell64, iFp)
|
||||
GO(gzoffset64, iFp)
|
||||
GO(gzopen, pFpp)
|
||||
GO(gzseek, iFpii)
|
||||
GO(gztell, iFp)
|
||||
GO(gzoffset, iFp)
|
||||
GO(adler32_combine, LFLLi)
|
||||
GO(crc32_combine, LFLLi)
|
||||
GO(zError, pFi)
|
||||
GO(inflateSyncPoint, iFp)
|
||||
GO(get_crc_table, pFv)
|
||||
GO(inflateUndermine, iFpi)
|
||||
GO(inflateValidate, iFpi)
|
||||
GO(inflateCodesUsed, uFp)
|
||||
GO(inflateResetKeep, iFp)
|
||||
GO(deflateResetKeep, iFp)
|
||||
GO(gzopen_w, pFpp) // Win32 only?
|
||||
//GOM(gzvprintf iFEppVV);
|
||||
Executable
+226
@@ -0,0 +1,226 @@
|
||||
#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 "wrapper.h"
|
||||
#include "bridge.h"
|
||||
#include "librarian/library_private.h"
|
||||
#include "x64emu.h"
|
||||
#include "emu/x64emu_private.h"
|
||||
#include "callback.h"
|
||||
#include "box64context.h"
|
||||
#include "librarian.h"
|
||||
#include "myalign.h"
|
||||
|
||||
static char* libname = NULL;
|
||||
|
||||
typedef void* (*pFp_t)(void*);
|
||||
typedef void* (*pFpp_t)(void*, void*);
|
||||
typedef void (*vFv_t)();
|
||||
typedef void (*vFiiipp_t)(int32_t, int32_t, int32_t, void*, void*);
|
||||
|
||||
typedef struct openal_my_s {
|
||||
// functions
|
||||
pFp_t alGetProcAddress;
|
||||
pFpp_t alcGetProcAddress;
|
||||
vFiiipp_t alRequestFoldbackStart;
|
||||
vFv_t alRequestFoldbackStop;
|
||||
} openal_my_t;
|
||||
|
||||
void* getOpenALMy(library_t* lib)
|
||||
{
|
||||
openal_my_t* my = (openal_my_t*)calloc(1, sizeof(openal_my_t));
|
||||
#define GO(A, W) my->A = (W)dlsym(lib->priv.w.lib, #A);
|
||||
GO(alGetProcAddress, pFp_t)
|
||||
GO(alcGetProcAddress, pFpp_t)
|
||||
GO(alRequestFoldbackStart, vFiiipp_t)
|
||||
GO(alRequestFoldbackStop, vFv_t)
|
||||
#undef GO
|
||||
return my;
|
||||
}
|
||||
|
||||
void freeOpenALMy(void* lib)
|
||||
{
|
||||
//openal_my_t *my = (openal_my_t *)lib;
|
||||
}
|
||||
#define SUPER() \
|
||||
GO(0) \
|
||||
GO(1) \
|
||||
GO(2) \
|
||||
GO(3) \
|
||||
GO(4)
|
||||
|
||||
// Request ...
|
||||
#define GO(A) \
|
||||
static uintptr_t my_Request_fct_##A = 0; \
|
||||
static void my_Request_##A(int32_t a, int32_t b) \
|
||||
{ \
|
||||
RunFunction(my_context, my_Request_fct_##A, 2, a, b); \
|
||||
}
|
||||
SUPER()
|
||||
#undef GO
|
||||
static void* find_Request_Fct(void* fct)
|
||||
{
|
||||
if(!fct) return fct;
|
||||
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
|
||||
#define GO(A) if(my_Request_fct_##A == (uintptr_t)fct) return my_Request_##A;
|
||||
SUPER()
|
||||
#undef GO
|
||||
#define GO(A) if(my_Request_fct_##A == 0) {my_Request_fct_##A = (uintptr_t)fct; return my_Request_##A; }
|
||||
SUPER()
|
||||
#undef GO
|
||||
printf_log(LOG_NONE, "Warning, no more slot for zlib Request callback\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#undef SUPER
|
||||
|
||||
void* my_alGetProcAddress(x64emu_t* emu, void* name);
|
||||
void* my_alcGetProcAddress(x64emu_t* emu, void* device, void* name);
|
||||
void my_alRequestFoldbackStart(x64emu_t *emu, int32_t mode, int32_t count, int32_t length, void* mem, void* cb);
|
||||
void my_alRequestFoldbackStop(x64emu_t* emu);
|
||||
|
||||
const char* openalName = "libopenal.so.1";
|
||||
#define LIBNAME openal
|
||||
|
||||
#define CUSTOM_INIT \
|
||||
libname = lib->name; \
|
||||
lib->priv.w.p2 = getOpenALMy(lib);
|
||||
|
||||
#define CUSTOM_FINI \
|
||||
freeOpenALMy(lib->priv.w.p2); \
|
||||
free(lib->priv.w.p2);
|
||||
|
||||
#include "wrappedlib_init.h"
|
||||
|
||||
|
||||
|
||||
void fillALProcWrapper(box64context_t* context)
|
||||
{
|
||||
int cnt, ret;
|
||||
khint_t k;
|
||||
kh_symbolmap_t * symbolmap = kh_init(symbolmap);
|
||||
// populates maps...
|
||||
cnt = sizeof(openalsymbolmap)/sizeof(map_onesymbol_t);
|
||||
for (int i=0; i<cnt; ++i) {
|
||||
k = kh_put(symbolmap, symbolmap, openalsymbolmap[i].name, &ret);
|
||||
kh_value(symbolmap, k) = openalsymbolmap[i].w;
|
||||
}
|
||||
// and the my_ symbols map
|
||||
cnt = sizeof(MAPNAME(mysymbolmap))/sizeof(map_onesymbol_t);
|
||||
for (int i=0; i<cnt; ++i) {
|
||||
k = kh_put(symbolmap, symbolmap, openalmysymbolmap[i].name, &ret);
|
||||
kh_value(symbolmap, k) = openalmysymbolmap[i].w;
|
||||
}
|
||||
context->alwrappers = symbolmap;
|
||||
// fill my_* map
|
||||
symbolmap = kh_init(symbolmap);
|
||||
cnt = sizeof(MAPNAME(mysymbolmap))/sizeof(map_onesymbol_t);
|
||||
for (int i=0; i<cnt; ++i) {
|
||||
k = kh_put(symbolmap, symbolmap, openalmysymbolmap[i].name, &ret);
|
||||
kh_value(symbolmap, k) = openalmysymbolmap[i].w;
|
||||
}
|
||||
context->almymap = symbolmap;
|
||||
}
|
||||
void freeALProcWrapper(box64context_t* context)
|
||||
{
|
||||
if(!context)
|
||||
return;
|
||||
if(context->alwrappers)
|
||||
kh_destroy(symbolmap, context->alwrappers);
|
||||
if(context->almymap)
|
||||
kh_destroy(symbolmap, context->almymap);
|
||||
context->alwrappers = NULL;
|
||||
context->almymap = NULL;
|
||||
}
|
||||
|
||||
EXPORT void* my_alGetProcAddress(x64emu_t* emu, void* name)
|
||||
{
|
||||
khint_t k;
|
||||
openal_my_t* my = (openal_my_t*)GetLibInternal(libname)->priv.w.p2;
|
||||
const char* rname = (const char*)name;
|
||||
printf_log(LOG_DEBUG, "Calling alGetProcAddress(%s)\n", rname);
|
||||
if(!emu->context->alwrappers) // could be moved in "my" structure...
|
||||
fillALProcWrapper(emu->context);
|
||||
// get proc adress using actual alGetProcAddress
|
||||
k = kh_get(symbolmap, emu->context->almymap, rname);
|
||||
int is_my = (k==kh_end(emu->context->almymap))?0:1;
|
||||
void* symbol;
|
||||
if(is_my) {
|
||||
// try again, by using custom "my_" now...
|
||||
char tmp[200];
|
||||
strcpy(tmp, "my_");
|
||||
strcat(tmp, rname);
|
||||
symbol = dlsym(emu->context->box64lib, tmp);
|
||||
} else
|
||||
symbol = my->alGetProcAddress(name);
|
||||
if(!symbol)
|
||||
return NULL; // easy
|
||||
// check if alread bridged
|
||||
uintptr_t ret = CheckBridged(emu->context->system, symbol);
|
||||
if(ret)
|
||||
return (void*)ret; // already bridged
|
||||
// get wrapper
|
||||
k = kh_get(symbolmap, emu->context->alwrappers, rname);
|
||||
if(k==kh_end(emu->context->alwrappers)) {
|
||||
printf_log(LOG_INFO, "Warning, no wrapper for %s\n", rname);
|
||||
return NULL;
|
||||
}
|
||||
const char* constname = kh_key(emu->context->alwrappers, k);
|
||||
AddOffsetSymbol(emu->context->maplib, symbol, rname);
|
||||
return (void*)AddBridge(emu->context->system, kh_value(emu->context->alwrappers, k), symbol, 0, constname);
|
||||
}
|
||||
|
||||
EXPORT void* my_alcGetProcAddress(x64emu_t* emu, void* device, void* name)
|
||||
{
|
||||
khint_t k;
|
||||
openal_my_t* my = (openal_my_t*)GetLibInternal(libname)->priv.w.p2;
|
||||
const char* rname = (const char*)name;
|
||||
printf_log(LOG_DEBUG, "Calling alcGetProcAddress(%p, %s)\n", device, rname);
|
||||
if(!emu->context->alwrappers) // could be moved in "my" structure...
|
||||
fillALProcWrapper(emu->context);
|
||||
// get proc adress using actual alGetProcAddress
|
||||
k = kh_get(symbolmap, emu->context->almymap, rname);
|
||||
int is_my = (k==kh_end(emu->context->almymap))?0:1;
|
||||
void* symbol;
|
||||
if(is_my) {
|
||||
// try again, by using custom "my_" now...
|
||||
char tmp[200];
|
||||
strcpy(tmp, "my_");
|
||||
strcat(tmp, rname);
|
||||
symbol = dlsym(emu->context->box64lib, tmp);
|
||||
} else
|
||||
symbol = my->alcGetProcAddress(device, name);
|
||||
if(!symbol)
|
||||
return NULL; // easy
|
||||
uintptr_t ret = CheckBridged(emu->context->system, symbol);
|
||||
if(ret)
|
||||
return (void*)ret; // already bridged
|
||||
// get wrapper
|
||||
k = kh_get(symbolmap, emu->context->alwrappers, rname);
|
||||
if(k==kh_end(emu->context->alwrappers)) {
|
||||
printf_log(LOG_INFO, "Warning, no wrapper for %s\n", rname);
|
||||
return NULL;
|
||||
}
|
||||
const char* constname = kh_key(emu->context->alwrappers, k);
|
||||
AddOffsetSymbol(emu->context->maplib, symbol, rname);
|
||||
return (void*)AddBridge(emu->context->system, kh_value(emu->context->alwrappers, k), symbol, 0, constname);
|
||||
}
|
||||
|
||||
EXPORT void my_alRequestFoldbackStart(x64emu_t *emu, int32_t mode, int32_t count, int32_t length, void* mem, void* cb)
|
||||
{
|
||||
openal_my_t* my = (openal_my_t*)GetLibInternal(libname)->priv.w.p2;
|
||||
my->alRequestFoldbackStart(mode, count, length, mem, find_Request_Fct(cb));
|
||||
}
|
||||
|
||||
EXPORT void my_alRequestFoldbackStop(x64emu_t* emu)
|
||||
{
|
||||
openal_my_t* my = (openal_my_t*)GetLibInternal(libname)->priv.w.p2;
|
||||
my->alRequestFoldbackStop();
|
||||
}
|
||||
|
||||
Executable
+167
@@ -0,0 +1,167 @@
|
||||
#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA))
|
||||
#error Meh...
|
||||
#endif
|
||||
|
||||
GO(alDopplerFactor,vFf)
|
||||
GO(alDopplerVelocity,vFf)
|
||||
GO(alSpeedOfSound,vFf)
|
||||
GO(alDistanceModel,vFi)
|
||||
GO(alEnable,vFi)
|
||||
GO(alDisable,vFi)
|
||||
GO(alIsEnabled,cFi)
|
||||
GO(alGetString,pFi)
|
||||
GO(alGetBooleanv,vFip)
|
||||
GO(alGetIntegerv,vFip)
|
||||
GO(alGetFloatv,vFip)
|
||||
GO(alGetDoublev,vFip)
|
||||
GO(alGetBoolean,iFi)
|
||||
GO(alGetInteger,iFi)
|
||||
GO(alGetFloat,fFi)
|
||||
GO(alGetDouble,dFi)
|
||||
GO(alGetError,iFv)
|
||||
GO(alIsExtensionPresent,cFp)
|
||||
GOM(alGetProcAddress,pFEp)
|
||||
GO(alGetEnumValue,iFp)
|
||||
GO(alListenerf,vFif)
|
||||
GO(alListener3f,vFifff)
|
||||
GO(alListenerfv,vFip)
|
||||
GO(alListeneri,vFii)
|
||||
GO(alListener3i,vFiiii)
|
||||
GO(alListeneriv,vFip)
|
||||
GO(alGetListenerf,vFip)
|
||||
GO(alGetListener3f,vFippp)
|
||||
GO(alGetListenerfv,vFip)
|
||||
GO(alGetListeneri,vFip)
|
||||
GO(alGetListener3i,vFippp)
|
||||
GO(alGetListeneriv,vFip)
|
||||
GO(alGenSources,vFip)
|
||||
GO(alDeleteSources,vFip)
|
||||
GO(alIsSource,cFu)
|
||||
GO(alSourcef,vFuif)
|
||||
GO(alSource3f,vFuifff)
|
||||
GO(alSourcefv,vFuip)
|
||||
GO(alSourcei,vFuii)
|
||||
GO(alSource3i,vFuiiii)
|
||||
GO(alSourceiv,vFuip)
|
||||
GO(alGetSourcef,vFuip)
|
||||
GO(alGetSource3f,vFuippp)
|
||||
GO(alGetSourcefv,vFuip)
|
||||
GO(alGetSourcei,vFuip)
|
||||
GO(alGetSource3i,vFuippp)
|
||||
GO(alGetSourceiv,vFuip)
|
||||
GO(alSourcePlayv,vFip)
|
||||
GO(alSourceStopv,vFip)
|
||||
GO(alSourceRewindv,vFip)
|
||||
GO(alSourcePausev,vFip)
|
||||
GO(alSourcePlay,vFu)
|
||||
GO(alSourceStop,vFu)
|
||||
GO(alSourceRewind,vFu)
|
||||
GO(alSourcePause,vFu)
|
||||
GO(alSourceQueueBuffers,vFuip)
|
||||
GO(alSourceUnqueueBuffers,vFuip)
|
||||
GO(alGenBuffers,vFip)
|
||||
GO(alDeleteBuffers,vFip)
|
||||
GO(alIsBuffer,cFu)
|
||||
GO(alBufferData,vFuipii)
|
||||
GO(alBufferf,vFuif)
|
||||
GO(alBuffer3f,vFuifff)
|
||||
GO(alBufferfv,vFuip)
|
||||
GO(alBufferi,vFuii)
|
||||
GO(alBuffer3i,vFuiiii)
|
||||
GO(alBufferiv,vFuip)
|
||||
GO(alGetBufferf,vFuip)
|
||||
GO(alGetBuffer3f,vFuippp)
|
||||
GO(alGetBufferfv,vFuip)
|
||||
GO(alGetBufferi,vFuip)
|
||||
GO(alGetBuffer3i,vFuippp)
|
||||
GO(alGetBufferiv,vFuip)
|
||||
|
||||
GO(alcCreateContext,pFpp)
|
||||
GO(alcMakeContextCurrent,iFp)
|
||||
GO(alcProcessContext,vFp)
|
||||
GO(alcSuspendContext,vFp)
|
||||
GO(alcDestroyContext,vFp)
|
||||
GO(alcGetCurrentContext,pFv)
|
||||
GO(alcGetContextsDevice,pFp)
|
||||
GO(alcOpenDevice,pFp)
|
||||
GO(alcCloseDevice,iFp)
|
||||
GO(alcGetError,iFp)
|
||||
GO(alcIsExtensionPresent,cFpp)
|
||||
GOM(alcGetProcAddress,pFEpp)
|
||||
GO(alcGetEnumValue,iFpp)
|
||||
GO(alcGetString,pFpi)
|
||||
GO(alcGetIntegerv,vFpiip)
|
||||
GO(alcCaptureOpenDevice,pFpuii)
|
||||
GO(alcCaptureCloseDevice,iFp)
|
||||
GO(alcCaptureStart,vFp)
|
||||
GO(alcCaptureStop,vFp)
|
||||
GO(alcCaptureSamples,vFppi)
|
||||
|
||||
GO(alcGetThreadContext, pFv)
|
||||
GO(alcSetThreadContext, iFp)
|
||||
GO(alcLoopbackOpenDeviceSOFT, pFp)
|
||||
GO(alcIsRenderFormatSupportedSOFT, cFpiii)
|
||||
GO(alcRenderSamplesSOFT, vFppi)
|
||||
GO(alcDevicePauseSOFT, vFp)
|
||||
GO(alcDeviceResumeSOFT, vFp)
|
||||
GO(alcGetStringiSOFT, pFpii)
|
||||
GO(alcResetDeviceSOFT, iFpp)
|
||||
GO(alcGetInteger64vSOFT, vFpiip)
|
||||
|
||||
GO(alBufferDataStatic,vFiipii)
|
||||
GO(alBufferSubDataSOFT,vFuipii)
|
||||
GOM(alRequestFoldbackStart,vFEiiipp)
|
||||
GOM(alRequestFoldbackStop,vFE)
|
||||
GO(alBufferSamplesSOFT,vFuuiiiip)
|
||||
GO(alBufferSubSamplesSOFT,vFuiiiip)
|
||||
GO(alGetBufferSamplesSOFT,vFuiiiip)
|
||||
GO(alIsBufferFormatSupportedSOFT,cFi)
|
||||
GO(alSourcedSOFT,vFuid)
|
||||
GO(alSource3dSOFT,vFuiddd)
|
||||
GO(alSourcedvSOFT,vFuip)
|
||||
GO(alGetSourcedSOFT,vFuip)
|
||||
GO(alGetSource3dSOFT,vFuippp)
|
||||
GO(alGetSourcedvSOFT,vFuip)
|
||||
GO(alSourcei64SOFT,vFuiI)
|
||||
GO(alSource3i64SOFT,vFuiIII)
|
||||
GO(alSourcei64vSOFT,vFuip)
|
||||
GO(alGetSourcei64SOFT,vFuip)
|
||||
GO(alGetSource3i64SOFT,vFuippp)
|
||||
GO(alGetSourcei64vSOFT,vFuip)
|
||||
GO(alDeferUpdatesSOFT,vFv)
|
||||
GO(alProcessUpdatesSOFT,vFv)
|
||||
GO(alGetStringiSOFT,pFii)
|
||||
|
||||
GO(alGenEffects,vFip)
|
||||
GO(alDeleteEffects,vFip)
|
||||
GO(alIsEffect,cFu)
|
||||
GO(alEffecti,vFuii)
|
||||
GO(alEffectiv,vFuip)
|
||||
GO(alEffectf,vFuif)
|
||||
GO(alEffectfv,vFuip)
|
||||
GO(alGetEffecti,vFuip)
|
||||
GO(alGetEffectiv,vFuip)
|
||||
GO(alGetEffectf,vFuip)
|
||||
GO(alGetEffectfv,vFuip)
|
||||
GO(alGenFilters,vFip)
|
||||
GO(alDeleteFilters,vFip)
|
||||
GO(alIsFilter,cFu)
|
||||
GO(alFilteri,vFuii)
|
||||
GO(alFilteriv,vFuip)
|
||||
GO(alFilterf,vFuif)
|
||||
GO(alFilterfv,vFuip)
|
||||
GO(alGetFilteri,vFuip)
|
||||
GO(alGetFilteriv,vFuip)
|
||||
GO(alGetFilterf,vFuip)
|
||||
GO(alGetFilterfv,vFuip)
|
||||
GO(alGenAuxiliaryEffectSlots,vFip)
|
||||
GO(alDeleteAuxiliaryEffectSlots,vFip)
|
||||
GO(alIsAuxiliaryEffectSlot,cFu)
|
||||
GO(alAuxiliaryEffectSloti,vFuii)
|
||||
GO(alAuxiliaryEffectSlotiv,vFuip)
|
||||
GO(alAuxiliaryEffectSlotf,vFuif)
|
||||
GO(alAuxiliaryEffectSlotfv,vFuip)
|
||||
GO(alGetAuxiliaryEffectSloti,vFuip)
|
||||
GO(alGetAuxiliaryEffectSlotiv,vFuip)
|
||||
GO(alGetAuxiliaryEffectSlotf,vFuip)
|
||||
GO(alGetAuxiliaryEffectSlotfv,vFuip)
|
||||
Executable
+1511
File diff suppressed because it is too large.
Load diff
Executable
+288
@@ -0,0 +1,288 @@
|
||||
#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA))
|
||||
#error Meh...
|
||||
#endif
|
||||
|
||||
GO(pa_ascii_filter, pFp)
|
||||
GO(pa_ascii_valid, pFp)
|
||||
GO(pa_bytes_per_second, LFp)
|
||||
GO(pa_bytes_snprint, pFpLu)
|
||||
GO(pa_bytes_to_usec, UFUp)
|
||||
GO(pa_channel_map_can_balance, iFp)
|
||||
GO(pa_channel_map_can_fade, iFp)
|
||||
GO(pa_channel_map_compatible, iFpp)
|
||||
GO(pa_channel_map_equal, iFpp)
|
||||
GO(pa_channel_map_init, pFp)
|
||||
GO(pa_channel_map_init_auto, pFpui)
|
||||
GO(pa_channel_map_init_extend, pFpui)
|
||||
GO(pa_channel_map_init_mono, pFp)
|
||||
GO(pa_channel_map_init_stereo, pFp)
|
||||
GO(pa_channel_map_parse, pFpp)
|
||||
GO(pa_channel_map_snprint, pFpup)
|
||||
GO(pa_channel_map_superset, iFpp)
|
||||
GO(pa_channel_map_to_name, pFp)
|
||||
GO(pa_channel_map_to_pretty_name, pFp)
|
||||
GO(pa_channel_map_valid, iFp)
|
||||
GO(pa_channel_position_to_pretty_string, pFi)
|
||||
GO(pa_channel_position_to_string, pFi)
|
||||
//GO(pa_context_add_autoload,
|
||||
GOM(pa_context_connect, iFEppip)
|
||||
GO(pa_context_disconnect, vFp)
|
||||
GOM(pa_context_drain, pFEppp)
|
||||
GO(pa_context_errno, iFp)
|
||||
GOM(pa_context_exit_daemon, pFEppp)
|
||||
//GO(pa_context_get_autoload_info_by_index,
|
||||
//GO(pa_context_get_autoload_info_by_name,
|
||||
//GO(pa_context_get_autoload_info_list,
|
||||
//GO(pa_context_get_card_info_by_index,
|
||||
//GO(pa_context_get_card_info_by_name,
|
||||
//GO(pa_context_get_card_info_list,
|
||||
//GO(pa_context_get_client_info,
|
||||
GOM(pa_context_get_client_info_list, pFEppp)
|
||||
GO(pa_context_get_index, uFp)
|
||||
//GO(pa_context_get_module_info,
|
||||
GOM(pa_context_get_module_info_list, pFEppp)
|
||||
GO(pa_context_get_protocol_version, uFp)
|
||||
//GO(pa_context_get_sample_info_by_index,
|
||||
//GO(pa_context_get_sample_info_by_name,
|
||||
//GO(pa_context_get_sample_info_list,
|
||||
GO(pa_context_get_server, pFp)
|
||||
GOM(pa_context_get_server_info, pFEppp)
|
||||
GO(pa_context_get_server_protocol_version, uFp)
|
||||
GOM(pa_context_get_sink_info_by_index, pFEpupp)
|
||||
GOM(pa_context_get_sink_info_by_name, pFEpppp)
|
||||
GOM(pa_context_get_sink_info_list, pFEppp)
|
||||
GOM(pa_context_get_sink_input_info, pFEpupp)
|
||||
GOM(pa_context_get_sink_input_info_list, pFEppp)
|
||||
GOM(pa_context_get_source_info_by_index, pFEpupp)
|
||||
GOM(pa_context_get_source_info_by_name, pFEpppp)
|
||||
GOM(pa_context_get_source_info_list, pFEppp)
|
||||
//GO(pa_context_get_source_output_info,
|
||||
//GO(pa_context_get_source_output_info_list,
|
||||
GO(pa_context_get_state, iFp)
|
||||
GO(pa_context_is_local, iFp)
|
||||
GO(pa_context_is_pending, iFp)
|
||||
//GO(pa_context_kill_client,
|
||||
//GO(pa_context_kill_sink_input,
|
||||
//GO(pa_context_kill_source_output,
|
||||
GOM(pa_context_load_module, pFEppppp)
|
||||
GOM(pa_context_move_sink_input_by_index, pFEpuupp)
|
||||
//GO(pa_context_move_sink_input_by_name,
|
||||
//GO(pa_context_move_source_output_by_index,
|
||||
//GO(pa_context_move_source_output_by_name,
|
||||
GOM(pa_context_new, pFEpp)
|
||||
GOM(pa_context_new_with_proplist, pFEppp)
|
||||
//GO(pa_context_play_sample,
|
||||
//GO(pa_context_play_sample_with_proplist,
|
||||
GOM(pa_context_proplist_remove, pFEpppp)
|
||||
GOM(pa_context_proplist_update, pFEpippp)
|
||||
GO(pa_context_ref, pFp)
|
||||
//GO(pa_context_remove_autoload_by_index,
|
||||
//GO(pa_context_remove_autoload_by_name,
|
||||
//GO(pa_context_remove_sample,
|
||||
//GO(pa_context_set_card_profile_by_index,
|
||||
//GO(pa_context_set_card_profile_by_name,
|
||||
GOM(pa_context_set_default_sink, pFEpppp)
|
||||
GOM(pa_context_set_default_source, pFEpppp)
|
||||
GOM(pa_context_set_event_callback, vFEppp)
|
||||
GOM(pa_context_set_name, pFEpppp)
|
||||
GOM(pa_context_set_sink_input_mute, pFEpuipp)
|
||||
GOM(pa_context_set_sink_input_volume, pFEpuppp)
|
||||
//GO(pa_context_set_sink_mute_by_index,
|
||||
//GO(pa_context_set_sink_mute_by_name,
|
||||
GOM(pa_context_set_sink_volume_by_index, pFEpuppp)
|
||||
//GO(pa_context_set_sink_volume_by_name,
|
||||
GOM(pa_context_set_source_mute_by_index, pFEpuipp)
|
||||
//GO(pa_context_set_source_mute_by_name,
|
||||
GOM(pa_context_set_source_volume_by_index, pFEpuppp)
|
||||
GOM(pa_context_set_source_volume_by_name, pFEppppp)
|
||||
GOM(pa_context_set_state_callback, vFEppp)
|
||||
GOM(pa_context_set_subscribe_callback, vFEppp)
|
||||
//GO(pa_context_stat,
|
||||
GOM(pa_context_subscribe, pFEpupp)
|
||||
//GO(pa_context_suspend_sink_by_index,
|
||||
//GO(pa_context_suspend_sink_by_name,
|
||||
//GO(pa_context_suspend_source_by_index,
|
||||
//GO(pa_context_suspend_source_by_name,
|
||||
GOM(pa_context_unload_module, pFEpupp)
|
||||
GO(pa_context_unref, vFp)
|
||||
GO(pa_cvolume_avg, uFp)
|
||||
GO(pa_cvolume_channels_equal_to, iFpu)
|
||||
GO(pa_cvolume_compatible, iFpp)
|
||||
GO(pa_cvolume_compatible_with_channel_map, iFpp)
|
||||
GO(pa_cvolume_equal, iFpp)
|
||||
GO(pa_cvolume_get_balance, fFpp)
|
||||
GO(pa_cvolume_get_fade, fFpp)
|
||||
GO(pa_cvolume_init, pFp)
|
||||
GO(pa_cvolume_max, uFp)
|
||||
GO(pa_cvolume_remap, pFppp)
|
||||
GO(pa_cvolume_scale, pFpu)
|
||||
GO(pa_cvolume_set, pFpuu)
|
||||
GO(pa_cvolume_set_balance, pFppf)
|
||||
GO(pa_cvolume_set_fade, pFppf)
|
||||
GO(pa_cvolume_snprint, pFplp)
|
||||
GO(pa_cvolume_valid, iFp)
|
||||
//GO(pa_ext_stream_restore_delete,
|
||||
//GO(pa_ext_stream_restore_read,
|
||||
//GO(pa_ext_stream_restore_set_subscribe_cb,
|
||||
//GO(pa_ext_stream_restore_subscribe,
|
||||
//GO(pa_ext_stream_restore_test,
|
||||
//GO(pa_ext_stream_restore_write,
|
||||
GO(pa_frame_size, LFp)
|
||||
GO(pa_get_binary_name, pFpL)
|
||||
GO(pa_get_fqdn, pFpL)
|
||||
GO(pa_get_home_dir, pFpL)
|
||||
GO(pa_get_host_name, pFpL)
|
||||
GO(pa_get_library_version, pFv)
|
||||
GO(pa_gettimeofday, pFp)
|
||||
GO(pa_get_user_name, pFpL)
|
||||
//GO(pa_locale_to_utf8,
|
||||
//GO(pa_mainloop_api_once,
|
||||
GO(pa_mainloop_dispatch, iFp)
|
||||
GOM(pa_mainloop_free, vFEp)
|
||||
GOM(pa_mainloop_get_api, pFEp)
|
||||
GO(pa_mainloop_get_retval, iFp)
|
||||
GO(pa_mainloop_iterate, iFpip)
|
||||
GO(pa_mainloop_new, pFv)
|
||||
GO(pa_mainloop_poll, iFp)
|
||||
GO(pa_mainloop_prepare, iFpi)
|
||||
GO(pa_mainloop_quit, vFpi)
|
||||
GO(pa_mainloop_run, iFpp)
|
||||
GOM(pa_mainloop_set_poll_func, vFEppp) //B is typedef int(*pa_poll_func) (struct pollfd *ufds, unsigned long nfds, int timeout, void *userdata)
|
||||
GO(pa_mainloop_wakeup, vFp)
|
||||
//GO(pa_msleep,
|
||||
GO(pa_operation_cancel, vFp)
|
||||
GO(pa_operation_get_state, iFp)
|
||||
GO(pa_operation_ref, pFp)
|
||||
GO(pa_operation_unref, vFp)
|
||||
GO(pa_parse_sample_format, iFp)
|
||||
GO(pa_path_get_filename, pFp)
|
||||
//GO(pa_proplist_clear,
|
||||
//GO(pa_proplist_contains,
|
||||
//GO(pa_proplist_copy,
|
||||
GO(pa_proplist_free, vFp)
|
||||
//GO(pa_proplist_from_string,
|
||||
//GO(pa_proplist_get,
|
||||
GO(pa_proplist_gets, pFpp)
|
||||
//GO(pa_proplist_isempty,
|
||||
//GO(pa_proplist_iterate,
|
||||
GO(pa_proplist_new, pFv)
|
||||
GO(pa_proplist_set, iFpppL)
|
||||
GOM(pa_proplist_setf, iFEpppV)
|
||||
GO(pa_proplist_sets, iFppp)
|
||||
GO(pa_proplist_size, uFp)
|
||||
GO(pa_proplist_to_string, pFp)
|
||||
GO(pa_proplist_to_string_sep, pFpp)
|
||||
GO(pa_proplist_unset, iFpp)
|
||||
GO(pa_proplist_unset_many, iFpp)
|
||||
GO(pa_proplist_update, vFpip)
|
||||
GO(pa_sample_format_to_string, pFi)
|
||||
GO(pa_sample_size, LFp)
|
||||
GO(pa_sample_size_of_format, LFp)
|
||||
GO(pa_sample_spec_equal, iFpp)
|
||||
GO(pa_sample_spec_init, pFp)
|
||||
GO(pa_sample_spec_snprint, pFpLp)
|
||||
GO(pa_sample_spec_valid, iFp)
|
||||
GO(pa_signal_done, vFv)
|
||||
GO(pa_signal_free, vFp)
|
||||
GOM(pa_signal_init, iFEp)
|
||||
GOM(pa_signal_new, pFEipp)
|
||||
GOM(pa_signal_set_destroy, vFEpp)
|
||||
GO(pa_stream_connect_playback, iFpppipp)
|
||||
GO(pa_stream_connect_record, iFpppi)
|
||||
GO(pa_stream_connect_upload, iFpL)
|
||||
GOM(pa_stream_cork, pFEpipp)
|
||||
GO(pa_stream_disconnect, iFp)
|
||||
GOM(pa_stream_drain, pFEppp)
|
||||
GO(pa_stream_drop, iFp)
|
||||
GO(pa_stream_finish_upload, iFp)
|
||||
GOM(pa_stream_flush, pFEppp)
|
||||
GO(pa_stream_get_buffer_attr, pFp)
|
||||
GO(pa_stream_get_channel_map, pFp)
|
||||
GO(pa_stream_get_context, pFp)
|
||||
GO(pa_stream_get_device_index, uFp)
|
||||
GO(pa_stream_get_device_name, pFp)
|
||||
GO(pa_stream_get_index, uFp)
|
||||
GO(pa_stream_get_latency, iFppp)
|
||||
GO(pa_stream_get_monitor_stream, uFp)
|
||||
GO(pa_stream_get_sample_spec, pFp)
|
||||
GO(pa_stream_get_state, iFp)
|
||||
GO(pa_stream_get_time, iFpp)
|
||||
GO(pa_stream_get_timing_info, pFp)
|
||||
GO(pa_stream_is_corked, iFp)
|
||||
GO(pa_stream_is_suspended, iFp)
|
||||
GO(pa_stream_new, pFpppp)
|
||||
GO(pa_stream_new_with_proplist, pFppppp)
|
||||
GO(pa_stream_peek, iFppp)
|
||||
GOM(pa_stream_prebuf, pFEppp)
|
||||
GOM(pa_stream_proplist_remove, pFEpppp)
|
||||
GOM(pa_stream_proplist_update, pFEpippp)
|
||||
GO(pa_stream_readable_size, LFp)
|
||||
GO(pa_stream_ref, pFp)
|
||||
GOM(pa_stream_set_buffer_attr, pFEpppp)
|
||||
GOM(pa_stream_set_buffer_attr_callback, vFEppp)
|
||||
GOM(pa_stream_set_event_callback, vFEppp)
|
||||
GOM(pa_stream_set_latency_update_callback, vFEppp)
|
||||
GO(pa_stream_set_monitor_stream, iFpu)
|
||||
GOM(pa_stream_set_moved_callback, vFEppp)
|
||||
GOM(pa_stream_set_name, pFEpppp)
|
||||
GOM(pa_stream_set_overflow_callback, vFEppp)
|
||||
GOM(pa_stream_set_read_callback, vFEppp)
|
||||
GOM(pa_stream_set_started_callback, vFEppp)
|
||||
GOM(pa_stream_set_state_callback, vFEppp)
|
||||
GOM(pa_stream_set_suspended_callback, vFEppp)
|
||||
GOM(pa_stream_set_underflow_callback, vFEppp)
|
||||
GOM(pa_stream_set_write_callback, vFEppp)
|
||||
GOM(pa_stream_trigger, pFEppp)
|
||||
GO(pa_stream_unref, vFp)
|
||||
GOM(pa_stream_update_sample_rate, pFEpupp)
|
||||
GOM(pa_stream_update_timing_info, pFEppp)
|
||||
GO(pa_stream_writable_size, LFp)
|
||||
GOM(pa_stream_write, iFEppLpIi)
|
||||
GO(pa_strerror, pFi)
|
||||
GO(pa_sw_cvolume_divide, pFppp)
|
||||
GO(pa_sw_cvolume_multiply, pFppp)
|
||||
GO(pa_sw_cvolume_snprint_dB, pFpLp)
|
||||
GO(pa_sw_volume_divide, uFuu)
|
||||
GO(pa_sw_volume_from_dB, uFd)
|
||||
GO(pa_sw_volume_from_linear, uFd)
|
||||
GO(pa_sw_volume_multiply, uFuu)
|
||||
GO(pa_sw_volume_snprint_dB, pFpuu)
|
||||
GO(pa_sw_volume_to_dB, dFu)
|
||||
GO(pa_sw_volume_to_linear, dFu)
|
||||
GO(pa_threaded_mainloop_accept, vFp)
|
||||
GOM(pa_threaded_mainloop_free, vFEp)
|
||||
GOM(pa_threaded_mainloop_get_api, pFEp)
|
||||
GO(pa_threaded_mainloop_get_retval, iFp)
|
||||
GO(pa_threaded_mainloop_in_thread, iFp)
|
||||
GO(pa_threaded_mainloop_lock, vFp)
|
||||
GO(pa_threaded_mainloop_new, pFv)
|
||||
GO(pa_threaded_mainloop_signal, vFpi)
|
||||
GO(pa_threaded_mainloop_start, iFp)
|
||||
GO(pa_threaded_mainloop_stop, vFp)
|
||||
GO(pa_threaded_mainloop_unlock, vFp)
|
||||
GO(pa_threaded_mainloop_wait, vFp)
|
||||
GO(pa_timeval_add, pFpU)
|
||||
GO(pa_timeval_age, UFp)
|
||||
GO(pa_timeval_cmp, iFpp)
|
||||
GO(pa_timeval_diff, UFpp)
|
||||
GO(pa_timeval_load, UFp)
|
||||
GO(pa_timeval_store, pFpU)
|
||||
GO(pa_timeval_sub, pFpU)
|
||||
GO(pa_usec_to_bytes, uFUp)
|
||||
GO(pa_utf8_filter, pFp)
|
||||
GO(pa_utf8_to_locale, pFp)
|
||||
GO(pa_utf8_valid, pFp)
|
||||
GO(pa_volume_snprint, pFpLu)
|
||||
GO(pa_xfree, vFp)
|
||||
GO(pa_xmalloc, pFL)
|
||||
GO(pa_xmalloc0, pFL)
|
||||
GO(pa_xmemdup, pFpL)
|
||||
GO(pa_xrealloc, pFpL)
|
||||
GO(pa_xstrdup, pFp)
|
||||
GO(pa_xstrndup, pFpL)
|
||||
|
||||
GO(pa_stream_begin_write, iFppp) // 0.9.16+
|
||||
GO(pa_stream_cancel_write, iFp) // 0.9.16+
|
||||
|
||||
GO(dummy_io_new, pFpiipp) // dumy function to create Wrapper
|
||||
GO(dummy_io_new2, vFppiip) // and another one
|
||||
Executable
+33
@@ -0,0 +1,33 @@
|
||||
#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 "wrapper.h"
|
||||
#include "bridge.h"
|
||||
#include "librarian/library_private.h"
|
||||
#include "x64emu.h"
|
||||
#include "emu/x64emu_private.h"
|
||||
#include "callback.h"
|
||||
#include "box64context.h"
|
||||
#include "librarian.h"
|
||||
#include "myalign.h"
|
||||
|
||||
const char* pulsesimpleName = "libpulse-simple.so.0";
|
||||
#define LIBNAME pulsesimple
|
||||
|
||||
#define PRE_INIT \
|
||||
if(box64_nopulse) \
|
||||
return -1;
|
||||
|
||||
#define CUSTOM_INIT \
|
||||
lib->priv.w.needed = 1; \
|
||||
lib->priv.w.neededlibs = (char**)calloc(lib->priv.w.needed, sizeof(char*)); \
|
||||
lib->priv.w.neededlibs[0] = strdup("libpulse.so.0"); \
|
||||
|
||||
#include "wrappedlib_init.h"
|
||||
|
||||
Executable
+11
@@ -0,0 +1,11 @@
|
||||
#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA))
|
||||
#error Meh...
|
||||
#endif
|
||||
|
||||
GO(pa_simple_drain, iFpp)
|
||||
GO(pa_simple_flush, iFpp)
|
||||
GO(pa_simple_free, vFp)
|
||||
GO(pa_simple_get_latency, UFpp)
|
||||
GO(pa_simple_new, pFppipppppp)
|
||||
GO(pa_simple_read, iFppLp)
|
||||
GO(pa_simple_write, iFppLp)
|
||||
Executable
+576
@@ -0,0 +1,576 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#define _GNU_SOURCE /* See feature_test_macros(7) */
|
||||
#include <dlfcn.h>
|
||||
|
||||
#include "wrappedlibs.h"
|
||||
|
||||
#include "wrapper.h"
|
||||
#include "debug.h"
|
||||
#include "bridge.h"
|
||||
#include "librarian/library_private.h"
|
||||
#include "x64emu.h"
|
||||
#include "callback.h"
|
||||
#include "librarian.h"
|
||||
#include "emu/x64emu_private.h"
|
||||
#include "box64context.h"
|
||||
#include "sdl1rwops.h"
|
||||
|
||||
#include "x64trace.h"
|
||||
#include "threads.h"
|
||||
|
||||
const char* sdl1Name = "libSDL-1.2.so.0";
|
||||
#define LIBNAME sdl1
|
||||
|
||||
int sdl_Yes() { return 1; }
|
||||
int sdl_No() { return 0; }
|
||||
int EXPORT my_SDL_Has3DNow() __attribute__((alias("sdl_No")));
|
||||
int EXPORT my_SDL_Has3DNowExt() __attribute__((alias("sdl_No")));
|
||||
int EXPORT my_SDL_HasAltiVec() __attribute__((alias("sdl_No")));
|
||||
int EXPORT my_SDL_HasMMX() __attribute__((alias("sdl_Yes")));
|
||||
int EXPORT my_SDL_HasMMXExt() __attribute__((alias("sdl_Yes")));
|
||||
int EXPORT my_SDL_HasRDTSC() __attribute__((alias("sdl_Yes")));
|
||||
int EXPORT my_SDL_HasSSE() __attribute__((alias("sdl_Yes")));
|
||||
int EXPORT my_SDL_HasSSE2() __attribute__((alias("sdl_Yes")));
|
||||
|
||||
typedef struct {
|
||||
int32_t freq;
|
||||
uint16_t format;
|
||||
uint8_t channels;
|
||||
uint8_t silence;
|
||||
uint16_t samples;
|
||||
uint32_t size;
|
||||
void (*callback)(void *userdata, uint8_t *stream, int32_t len);
|
||||
void *userdata;
|
||||
} SDL_AudioSpec;
|
||||
|
||||
// TODO: put the wrapper type in a dedicate include
|
||||
typedef void (*vFv_t)();
|
||||
typedef void* (*pFv_t)();
|
||||
typedef void* (*pFpi_t)(void*, int32_t);
|
||||
typedef void* (*pFp_t)(void*);
|
||||
typedef void* (*pFpp_t)(void*, void*);
|
||||
typedef int (*iFup_t)(uint32_t, void*);
|
||||
typedef int32_t (*iFp_t)(void*);
|
||||
typedef int32_t (*iFppi_t)(void*, void*, int32_t);
|
||||
typedef void* (*pFpippp_t)(void*, int32_t, void*, void*, void*);
|
||||
typedef void (*vFp_t)(void*);
|
||||
typedef void* (*pFpp_t)(void*, void*);
|
||||
typedef uint32_t (*uFp_t)(void*);
|
||||
typedef uint64_t (*UFp_t)(void*);
|
||||
typedef uint32_t (*uFu_t)(uint32_t);
|
||||
typedef int32_t (*iFpp_t)(void*, void*);
|
||||
typedef uint32_t (*uFpW_t)(void*, uint16_t);
|
||||
typedef uint32_t (*uFpu_t)(void*, uint32_t);
|
||||
typedef uint32_t (*uFpU_t)(void*, uint64_t);
|
||||
typedef uint32_t (*uFupp_t)(uint32_t, void*, void*);
|
||||
|
||||
#define SUPER() \
|
||||
GO(SDL_Quit, vFv_t) \
|
||||
GO(SDL_AllocRW, sdl1_allocrw) \
|
||||
GO(SDL_FreeRW, sdl1_freerw) \
|
||||
GO(SDL_OpenAudio, iFpp_t) \
|
||||
GO(SDL_LoadBMP_RW, pFpi_t) \
|
||||
GO(SDL_RWFromConstMem, pFpi_t) \
|
||||
GO(SDL_RWFromFP, pFpi_t) \
|
||||
GO(SDL_RWFromFile, pFpp_t) \
|
||||
GO(SDL_RWFromMem, pFpi_t) \
|
||||
GO(SDL_SaveBMP_RW, iFppi_t) \
|
||||
GO(SDL_LoadWAV_RW, pFpippp_t) \
|
||||
GO(SDL_ReadBE16, uFp_t) \
|
||||
GO(SDL_ReadBE32, uFp_t) \
|
||||
GO(SDL_ReadBE64, UFp_t) \
|
||||
GO(SDL_ReadLE16, uFp_t) \
|
||||
GO(SDL_ReadLE32, uFp_t) \
|
||||
GO(SDL_ReadLE64, UFp_t) \
|
||||
GO(SDL_WriteBE16, uFpW_t) \
|
||||
GO(SDL_WriteBE32, uFpu_t) \
|
||||
GO(SDL_WriteBE64, uFpU_t) \
|
||||
GO(SDL_WriteLE16, uFpW_t) \
|
||||
GO(SDL_WriteLE32, uFpu_t) \
|
||||
GO(SDL_WriteLE64, uFpU_t) \
|
||||
GO(SDL_AddTimer, uFupp_t) \
|
||||
GO(SDL_RemoveTimer, uFu_t) \
|
||||
GO(SDL_CreateThread, pFpp_t) \
|
||||
GO(SDL_KillThread, vFp_t) \
|
||||
GO(SDL_SetEventFilter, vFp_t) \
|
||||
GO(SDL_GL_GetProcAddress, pFp_t) \
|
||||
GO(SDL_GetWMInfo, iFp_t) \
|
||||
GO(SDL_SetTimer, iFup_t) \
|
||||
GO(SDL_GetEventFilter, pFv_t) \
|
||||
|
||||
typedef struct sdl1_my_s {
|
||||
// functions
|
||||
#define GO(A, B) B A;
|
||||
#define GO(A, B) B A;
|
||||
SUPER()
|
||||
#undef GO
|
||||
} sdl1_my_t;
|
||||
|
||||
// event filter. Needs to be global, but there is only one, so that's should be fine
|
||||
x64emu_t *sdl1_evtfilter = NULL;
|
||||
void* sdl1_evtfnc = NULL;
|
||||
int sdl1_evtautofree = 0;
|
||||
int sdl1_evtinside = 0;
|
||||
|
||||
|
||||
void* getSDL1My(library_t* lib)
|
||||
{
|
||||
sdl1_my_t* my = (sdl1_my_t*)calloc(1, sizeof(sdl1_my_t));
|
||||
#define GO(A, W) my->A = (W)dlsym(lib->priv.w.lib, #A);
|
||||
SUPER()
|
||||
#undef GO
|
||||
|
||||
return my;
|
||||
}
|
||||
#undef SUPER
|
||||
|
||||
void freeSDL1My(void* lib)
|
||||
{
|
||||
//sdl1_my_t *my = (sdl1_my_t *)lib;
|
||||
}
|
||||
|
||||
#define SUPER() \
|
||||
GO(0) \
|
||||
GO(1) \
|
||||
GO(2) \
|
||||
GO(3) \
|
||||
GO(4)
|
||||
|
||||
// AudioCallback ...
|
||||
#define GO(A) \
|
||||
static uintptr_t my_AudioCallback_fct_##A = 0; \
|
||||
static void my_AudioCallback_##A(void *userdata, uint8_t *stream, int32_t len) \
|
||||
{ \
|
||||
RunFunction(my_context, my_AudioCallback_fct_##A, 3, userdata, stream, len); \
|
||||
}
|
||||
SUPER()
|
||||
#undef GO
|
||||
static void* find_AudioCallback_Fct(void* fct)
|
||||
{
|
||||
if(!fct) return fct;
|
||||
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
|
||||
#define GO(A) if(my_AudioCallback_fct_##A == (uintptr_t)fct) return my_AudioCallback_##A;
|
||||
SUPER()
|
||||
#undef GO
|
||||
#define GO(A) if(my_AudioCallback_fct_##A == 0) {my_AudioCallback_fct_##A = (uintptr_t)fct; return my_AudioCallback_##A; }
|
||||
SUPER()
|
||||
#undef GO
|
||||
printf_log(LOG_NONE, "Warning, no more slot for SDL1 AudioCallback callback\n");
|
||||
return NULL;
|
||||
}
|
||||
// TimerCallback ...
|
||||
#define GO(A) \
|
||||
static uintptr_t my_TimerCallback_fct_##A = 0; \
|
||||
static uint32_t my_TimerCallback_##A(uint32_t interval, void *userdata) \
|
||||
{ \
|
||||
return (uint32_t)RunFunction(my_context, my_TimerCallback_fct_##A, 2, interval, userdata); \
|
||||
}
|
||||
SUPER()
|
||||
#undef GO
|
||||
static void* find_TimerCallback_Fct(void* fct)
|
||||
{
|
||||
if(!fct) return fct;
|
||||
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
|
||||
#define GO(A) if(my_TimerCallback_fct_##A == (uintptr_t)fct) return my_TimerCallback_##A;
|
||||
SUPER()
|
||||
#undef GO
|
||||
#define GO(A) if(my_TimerCallback_fct_##A == 0) {my_TimerCallback_fct_##A = (uintptr_t)fct; return my_TimerCallback_##A; }
|
||||
SUPER()
|
||||
#undef GO
|
||||
printf_log(LOG_NONE, "Warning, no more slot for SDL1 TimerCallback callback\n");
|
||||
return NULL;
|
||||
}
|
||||
// EvtFilter ...
|
||||
#define GO(A) \
|
||||
static uintptr_t my_EvtFilter_fct_##A = 0; \
|
||||
static int my_EvtFilter_##A(void* p) \
|
||||
{ \
|
||||
return RunFunction(my_context, my_EvtFilter_fct_##A, 1, p); \
|
||||
}
|
||||
SUPER()
|
||||
#undef GO
|
||||
static void* find_EvtFilter_Fct(void* fct)
|
||||
{
|
||||
if(!fct) return fct;
|
||||
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
|
||||
#define GO(A) if(my_EvtFilter_fct_##A == (uintptr_t)fct) return my_EvtFilter_##A;
|
||||
SUPER()
|
||||
#undef GO
|
||||
#define GO(A) if(my_EvtFilter_fct_##A == 0) {my_EvtFilter_fct_##A = (uintptr_t)fct; return my_EvtFilter_##A; }
|
||||
SUPER()
|
||||
#undef GO
|
||||
printf_log(LOG_NONE, "Warning, no more slot for SDL1 EvtFilter callback\n");
|
||||
return NULL;
|
||||
}
|
||||
static void* reverse_EvtFilterFct(void* fct)
|
||||
{
|
||||
if(!fct) return fct;
|
||||
library_t* my_lib = my_context->sdl1lib;
|
||||
if(CheckBridged(my_lib->priv.w.bridge, fct))
|
||||
return (void*)CheckBridged(my_lib->priv.w.bridge, fct);
|
||||
#define GO(A) if(my_EvtFilter_##A == fct) return (void*)my_EvtFilter_fct_##A;
|
||||
SUPER()
|
||||
#undef GO
|
||||
return (void*)AddBridge(my_lib->priv.w.bridge, iFp, fct, 0, NULL);
|
||||
}
|
||||
#undef SUPER
|
||||
|
||||
// TODO: track the memory for those callback
|
||||
int EXPORT my_SDL_OpenAudio(x64emu_t* emu, void* d, void* o)
|
||||
{
|
||||
SDL_AudioSpec *desired = (SDL_AudioSpec*)d;
|
||||
sdl1_my_t *my = (sdl1_my_t *)emu->context->sdl1lib->priv.w.p2;
|
||||
// create a callback
|
||||
void *fnc = (void*)desired->callback;
|
||||
desired->callback = find_AudioCallback_Fct(desired->callback);
|
||||
int ret = my->SDL_OpenAudio(desired, (SDL_AudioSpec*)o);
|
||||
if (ret!=0) {
|
||||
// error, clean the callback...
|
||||
desired->callback = fnc;
|
||||
return ret;
|
||||
}
|
||||
// put back stuff in place?
|
||||
desired->callback = fnc;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void EXPORT *my_SDL_LoadBMP_RW(x64emu_t* emu, void* a, int b)
|
||||
{
|
||||
sdl1_my_t *my = (sdl1_my_t *)emu->context->sdl1lib->priv.w.p2;
|
||||
SDL1_RWops_t* rw = RWNativeStart(emu, (SDL1_RWops_t*)a);
|
||||
void* r = my->SDL_LoadBMP_RW(rw, b);
|
||||
if(b==0)
|
||||
RWNativeEnd(rw);
|
||||
return r;
|
||||
}
|
||||
int32_t EXPORT my_SDL_SaveBMP_RW(x64emu_t* emu, void* a, void* b, int c)
|
||||
{
|
||||
sdl1_my_t *my = (sdl1_my_t *)emu->context->sdl1lib->priv.w.p2;
|
||||
SDL1_RWops_t* rw = RWNativeStart(emu, (SDL1_RWops_t*)a);
|
||||
int32_t r = my->SDL_SaveBMP_RW(rw, b, c);
|
||||
if(c==0)
|
||||
RWNativeEnd(rw);
|
||||
return r;
|
||||
}
|
||||
void EXPORT *my_SDL_LoadWAV_RW(x64emu_t* emu, void* a, int b, void* c, void* d, void* e)
|
||||
{
|
||||
sdl1_my_t *my = (sdl1_my_t *)emu->context->sdl1lib->priv.w.p2;
|
||||
SDL1_RWops_t* rw = RWNativeStart(emu, (SDL1_RWops_t*)a);
|
||||
void* r = my->SDL_LoadWAV_RW(rw, b, c, d, e);
|
||||
if(b==0)
|
||||
RWNativeEnd(rw);
|
||||
return r;
|
||||
}
|
||||
uint32_t EXPORT my_SDL_ReadBE16(x64emu_t* emu, void* a)
|
||||
{
|
||||
sdl1_my_t *my = (sdl1_my_t *)emu->context->sdl1lib->priv.w.p2;
|
||||
SDL1_RWops_t* rw = RWNativeStart(emu, (SDL1_RWops_t*)a);
|
||||
uint32_t r = my->SDL_ReadBE16(rw);
|
||||
RWNativeEnd(rw);
|
||||
return r;
|
||||
}
|
||||
uint32_t EXPORT my_SDL_ReadBE32(x64emu_t* emu, void* a)
|
||||
{
|
||||
sdl1_my_t *my = (sdl1_my_t *)emu->context->sdl1lib->priv.w.p2;
|
||||
SDL1_RWops_t* rw = RWNativeStart(emu, (SDL1_RWops_t*)a);
|
||||
uint32_t r = my->SDL_ReadBE32(rw);
|
||||
RWNativeEnd(rw);
|
||||
return r;
|
||||
}
|
||||
uint64_t EXPORT my_SDL_ReadBE64(x64emu_t* emu, void* a)
|
||||
{
|
||||
sdl1_my_t *my = (sdl1_my_t *)emu->context->sdl1lib->priv.w.p2;
|
||||
SDL1_RWops_t* rw = RWNativeStart(emu, (SDL1_RWops_t*)a);
|
||||
uint64_t r = my->SDL_ReadBE64(rw);
|
||||
RWNativeEnd(rw);
|
||||
return r;
|
||||
}
|
||||
uint32_t EXPORT my_SDL_ReadLE16(x64emu_t* emu, void* a)
|
||||
{
|
||||
sdl1_my_t *my = (sdl1_my_t *)emu->context->sdl1lib->priv.w.p2;
|
||||
SDL1_RWops_t* rw = RWNativeStart(emu, (SDL1_RWops_t*)a);
|
||||
uint32_t r = my->SDL_ReadLE16(rw);
|
||||
RWNativeEnd(rw);
|
||||
return r;
|
||||
}
|
||||
uint32_t EXPORT my_SDL_ReadLE32(x64emu_t* emu, void* a)
|
||||
{
|
||||
sdl1_my_t *my = (sdl1_my_t *)emu->context->sdl1lib->priv.w.p2;
|
||||
SDL1_RWops_t* rw = RWNativeStart(emu, (SDL1_RWops_t*)a);
|
||||
uint32_t r = my->SDL_ReadLE32(rw);
|
||||
RWNativeEnd(rw);
|
||||
return r;
|
||||
}
|
||||
uint64_t EXPORT my_SDL_ReadLE64(x64emu_t* emu, void* a)
|
||||
{
|
||||
sdl1_my_t *my = (sdl1_my_t *)emu->context->sdl1lib->priv.w.p2;
|
||||
SDL1_RWops_t* rw = RWNativeStart(emu, (SDL1_RWops_t*)a);
|
||||
uint64_t r = my->SDL_ReadLE64(rw);
|
||||
RWNativeEnd(rw);
|
||||
return r;
|
||||
}
|
||||
uint32_t EXPORT my_SDL_WriteBE16(x64emu_t* emu, void* a, uint16_t v)
|
||||
{
|
||||
sdl1_my_t *my = (sdl1_my_t *)emu->context->sdl1lib->priv.w.p2;
|
||||
SDL1_RWops_t* rw = RWNativeStart(emu, (SDL1_RWops_t*)a);
|
||||
uint32_t r = my->SDL_WriteBE16(rw, v);
|
||||
RWNativeEnd(rw);
|
||||
return r;
|
||||
}
|
||||
uint32_t EXPORT my_SDL_WriteBE32(x64emu_t* emu, void* a, uint32_t v)
|
||||
{
|
||||
sdl1_my_t *my = (sdl1_my_t *)emu->context->sdl1lib->priv.w.p2;
|
||||
SDL1_RWops_t* rw = RWNativeStart(emu, (SDL1_RWops_t*)a);
|
||||
uint32_t r = my->SDL_WriteBE32(rw, v);
|
||||
RWNativeEnd(rw);
|
||||
return r;
|
||||
}
|
||||
uint32_t EXPORT my_SDL_WriteBE64(x64emu_t* emu, void* a, uint64_t v)
|
||||
{
|
||||
sdl1_my_t *my = (sdl1_my_t *)emu->context->sdl1lib->priv.w.p2;
|
||||
SDL1_RWops_t* rw = RWNativeStart(emu, (SDL1_RWops_t*)a);
|
||||
uint32_t r = my->SDL_WriteBE64(rw, v);
|
||||
RWNativeEnd(rw);
|
||||
return r;
|
||||
}
|
||||
uint32_t EXPORT my_SDL_WriteLE16(x64emu_t* emu, void* a, uint16_t v)
|
||||
{
|
||||
sdl1_my_t *my = (sdl1_my_t *)emu->context->sdl1lib->priv.w.p2;
|
||||
SDL1_RWops_t* rw = RWNativeStart(emu, (SDL1_RWops_t*)a);
|
||||
uint32_t r = my->SDL_WriteLE16(rw, v);
|
||||
RWNativeEnd(rw);
|
||||
return r;
|
||||
}
|
||||
uint32_t EXPORT my_SDL_WriteLE32(x64emu_t* emu, void* a, uint32_t v)
|
||||
{
|
||||
sdl1_my_t *my = (sdl1_my_t *)emu->context->sdl1lib->priv.w.p2;
|
||||
SDL1_RWops_t* rw = RWNativeStart(emu, (SDL1_RWops_t*)a);
|
||||
uint32_t r = my->SDL_WriteLE32(rw, v);
|
||||
RWNativeEnd(rw);
|
||||
return r;
|
||||
}
|
||||
uint32_t EXPORT my_SDL_WriteLE64(x64emu_t* emu, void* a, uint64_t v)
|
||||
{
|
||||
sdl1_my_t *my = (sdl1_my_t *)emu->context->sdl1lib->priv.w.p2;
|
||||
SDL1_RWops_t* rw = RWNativeStart(emu, (SDL1_RWops_t*)a);
|
||||
uint32_t r = my->SDL_WriteLE64(rw, v);
|
||||
RWNativeEnd(rw);
|
||||
return r;
|
||||
}
|
||||
|
||||
// SDL1 doesn't really used rw_ops->type, but box64 does, so set sensible value (from SDL2)....
|
||||
void EXPORT *my_SDL_RWFromConstMem(x64emu_t* emu, void* a, int b)
|
||||
{
|
||||
sdl1_my_t *my = (sdl1_my_t *)emu->context->sdl1lib->priv.w.p2;
|
||||
SDL1_RWops_t* r = (SDL1_RWops_t*)my->SDL_RWFromConstMem(a, b);
|
||||
RWSetType(r, 5);
|
||||
return AddNativeRW(emu, r);
|
||||
}
|
||||
void EXPORT *my_SDL_RWFromFP(x64emu_t* emu, void* a, int b)
|
||||
{
|
||||
sdl1_my_t *my = (sdl1_my_t *)emu->context->sdl1lib->priv.w.p2;
|
||||
SDL1_RWops_t* r = (SDL1_RWops_t*)my->SDL_RWFromFP(a, b);
|
||||
RWSetType(r, 2);
|
||||
return AddNativeRW(emu, r);
|
||||
}
|
||||
void EXPORT *my_SDL_RWFromFile(x64emu_t* emu, void* a, void* b)
|
||||
{
|
||||
sdl1_my_t *my = (sdl1_my_t *)emu->context->sdl1lib->priv.w.p2;
|
||||
SDL1_RWops_t* r = (SDL1_RWops_t*)my->SDL_RWFromFile(a, b);
|
||||
RWSetType(r, 2);
|
||||
return AddNativeRW(emu, r);
|
||||
}
|
||||
void EXPORT *my_SDL_RWFromMem(x64emu_t* emu, void* a, int b)
|
||||
{
|
||||
sdl1_my_t *my = (sdl1_my_t *)emu->context->sdl1lib->priv.w.p2;
|
||||
SDL1_RWops_t* r = (SDL1_RWops_t*)my->SDL_RWFromMem(a, b);
|
||||
RWSetType(r, 4);
|
||||
return AddNativeRW(emu, r);
|
||||
}
|
||||
|
||||
uint32_t EXPORT my_SDL_AddTimer(x64emu_t* emu, uint32_t a, void* cb, void* p)
|
||||
{
|
||||
sdl1_my_t *my = (sdl1_my_t *)emu->context->sdl1lib->priv.w.p2;
|
||||
return my->SDL_AddTimer(a, find_TimerCallback_Fct(cb), p);
|
||||
}
|
||||
|
||||
void EXPORT my_SDL_RemoveTimer(x64emu_t* emu, uint32_t t)
|
||||
{
|
||||
sdl1_my_t *my = (sdl1_my_t *)emu->context->sdl1lib->priv.w.p2;
|
||||
my->SDL_RemoveTimer(t);
|
||||
}
|
||||
|
||||
int32_t EXPORT my_SDL_SetTimer(x64emu_t* emu, uint32_t t, void* p)
|
||||
{
|
||||
sdl1_my_t *my = (sdl1_my_t *)emu->context->sdl1lib->priv.w.p2;
|
||||
return my->SDL_SetTimer(t, find_TimerCallback_Fct(p));
|
||||
}
|
||||
#if 0
|
||||
int32_t EXPORT my_SDL_BuildAudioCVT(x64emu_t* emu, void* a, uint32_t b, uint32_t c, int32_t d, uint32_t e, uint32_t f, int32_t g)
|
||||
{
|
||||
printf_log(LOG_NONE, "Error, using Unimplemented SDL1 SDL_BuildAudioCVT\n");
|
||||
emu->quit = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t EXPORT my_SDL_ConvertAudio(x64emu_t* emu, void* a)
|
||||
{
|
||||
printf_log(LOG_NONE, "Error, using Unimplemented SDL1 SDL_ConvertAudio\n");
|
||||
emu->quit = 1;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
void EXPORT my_SDL_SetEventFilter(x64emu_t* emu, void* a)
|
||||
{
|
||||
sdl1_my_t *my = (sdl1_my_t *)emu->context->sdl1lib->priv.w.p2;
|
||||
my->SDL_SetEventFilter(find_EvtFilter_Fct(a));
|
||||
}
|
||||
void EXPORT *my_SDL_GetEventFilter(x64emu_t* emu)
|
||||
{
|
||||
sdl1_my_t *my = (sdl1_my_t *)emu->context->sdl1lib->priv.w.p2;
|
||||
return reverse_EvtFilterFct(my->SDL_GetEventFilter());
|
||||
}
|
||||
|
||||
void EXPORT *my_SDL_CreateThread(x64emu_t* emu, void* cb, void* p)
|
||||
{
|
||||
sdl1_my_t *my = (sdl1_my_t *)emu->context->sdl1lib->priv.w.p2;
|
||||
void* et = NULL;
|
||||
void* fnc = my_prepare_thread(emu, cb, p, 0, &et);
|
||||
return my->SDL_CreateThread(fnc, et);
|
||||
}
|
||||
|
||||
void EXPORT my_SDL_KillThread(x64emu_t* emu, void* p)
|
||||
{
|
||||
sdl1_my_t *my = (sdl1_my_t *)emu->context->sdl1lib->priv.w.p2;
|
||||
my->SDL_KillThread(p);
|
||||
}
|
||||
|
||||
void fillGLProcWrapper(box64context_t* context);
|
||||
EXPORT void* my_SDL_GL_GetProcAddress(x64emu_t* emu, void* name)
|
||||
{
|
||||
khint_t k;
|
||||
const char* rname = (const char*)name;
|
||||
printf_log(LOG_DEBUG, "Calling SDL_GL_GetProcAddress(%s)\n", rname);
|
||||
sdl1_my_t *my = (sdl1_my_t *)emu->context->sdl1lib->priv.w.p2;
|
||||
// check if glxprocaddress is filled, and search for lib and fill it if needed
|
||||
if(!emu->context->glwrappers)
|
||||
fillGLProcWrapper(emu->context);
|
||||
// get proc adress using actual glXGetProcAddress
|
||||
k = kh_get(symbolmap, emu->context->glmymap, rname);
|
||||
int is_my = (k==kh_end(emu->context->glmymap))?0:1;
|
||||
void* symbol;
|
||||
if(is_my) {
|
||||
// try again, by using custom "my_" now...
|
||||
char tmp[200];
|
||||
strcpy(tmp, "my_");
|
||||
strcat(tmp, rname);
|
||||
symbol = dlsym(emu->context->box64lib, tmp);
|
||||
} else
|
||||
symbol = my->SDL_GL_GetProcAddress(name);
|
||||
if(!symbol)
|
||||
return NULL; // easy
|
||||
// check if alread bridged
|
||||
uintptr_t ret = CheckBridged(emu->context->system, symbol);
|
||||
if(ret)
|
||||
return (void*)ret; // already bridged
|
||||
// get wrapper
|
||||
k = kh_get(symbolmap, emu->context->glwrappers, rname);
|
||||
if(k==kh_end(emu->context->glwrappers) && strstr(rname, "ARB")==NULL) {
|
||||
// try again, adding ARB at the end if not present
|
||||
char tmp[200];
|
||||
strcpy(tmp, rname);
|
||||
strcat(tmp, "ARB");
|
||||
k = kh_get(symbolmap, emu->context->glwrappers, tmp);
|
||||
}
|
||||
if(k==kh_end(emu->context->glwrappers) && strstr(rname, "EXT")==NULL) {
|
||||
// try again, adding EXT at the end if not present
|
||||
char tmp[200];
|
||||
strcpy(tmp, rname);
|
||||
strcat(tmp, "EXT");
|
||||
k = kh_get(symbolmap, emu->context->glwrappers, tmp);
|
||||
}
|
||||
if(k==kh_end(emu->context->glwrappers)) {
|
||||
printf_log(LOG_INFO, "Warning, no wrapper for %s\n", rname);
|
||||
return NULL;
|
||||
}
|
||||
AddOffsetSymbol(emu->context->maplib, symbol, rname);
|
||||
const char* constname = kh_key(emu->context->glwrappers, k);
|
||||
return (void*)AddBridge(emu->context->system, kh_value(emu->context->glwrappers, k), symbol, 0, constname);
|
||||
}
|
||||
|
||||
// DL functions from wrappedlibdl.c
|
||||
void* my_dlopen(x64emu_t* emu, void *filename, int flag);
|
||||
int my_dlclose(x64emu_t* emu, void *handle);
|
||||
void* my_dlsym(x64emu_t* emu, void *handle, void *symbol);
|
||||
EXPORT void* my_SDL_LoadObject(x64emu_t* emu, void* sofile)
|
||||
{
|
||||
return my_dlopen(emu, sofile, 0); // TODO: check correct flag value...
|
||||
}
|
||||
EXPORT void my_SDL_UnloadObject(x64emu_t* emu, void* handle)
|
||||
{
|
||||
my_dlclose(emu, handle);
|
||||
}
|
||||
EXPORT void* my_SDL_LoadFunction(x64emu_t* emu, void* handle, void* name)
|
||||
{
|
||||
return my_dlsym(emu, handle, name);
|
||||
}
|
||||
|
||||
typedef struct my_SDL_version {
|
||||
uint8_t major;
|
||||
uint8_t minor;
|
||||
uint8_t patch;
|
||||
} my_SDL_version;
|
||||
|
||||
typedef struct {
|
||||
my_SDL_version version;
|
||||
int subsystem;
|
||||
union {
|
||||
struct {
|
||||
void* display;
|
||||
void* window;
|
||||
void (*lock_func)(void);
|
||||
void (*unlock_func)(void);
|
||||
void* fswindow;
|
||||
void* wmwindow;
|
||||
void* gfxdisplay;
|
||||
} x11;
|
||||
} info;
|
||||
} my_SDL_SysWMinfo;
|
||||
|
||||
EXPORT int32_t my_SDL_GetWMInfo(x64emu_t* emu, void* p)
|
||||
{
|
||||
// does SDL_SysWMinfo needs alignment?
|
||||
sdl1_my_t *my = (sdl1_my_t *)emu->context->sdl1lib->priv.w.p2;
|
||||
int ret = my->SDL_GetWMInfo(p);
|
||||
my_SDL_SysWMinfo *info = (my_SDL_SysWMinfo*)p;
|
||||
if(info->info.x11.lock_func)
|
||||
info->info.x11.lock_func = (void*)AddBridge(emu->context->system, vFv, info->info.x11.lock_func, 0, NULL);
|
||||
if(info->info.x11.unlock_func)
|
||||
info->info.x11.unlock_func = (void*)AddBridge(emu->context->system, vFv, info->info.x11.unlock_func, 0, NULL);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#define CUSTOM_INIT \
|
||||
box64->sdl1lib = lib; \
|
||||
lib->priv.w.p2 = getSDL1My(lib); \
|
||||
box64->sdl1allocrw = ((sdl1_my_t*)lib->priv.w.p2)->SDL_AllocRW; \
|
||||
box64->sdl1freerw = ((sdl1_my_t*)lib->priv.w.p2)->SDL_FreeRW; \
|
||||
lib->priv.w.needed = 3; \
|
||||
lib->priv.w.neededlibs = (char**)calloc(lib->priv.w.needed, sizeof(char*)); \
|
||||
lib->priv.w.neededlibs[0] = strdup("libm.so.6"); \
|
||||
lib->priv.w.neededlibs[1] = strdup("libdl.so.2"); \
|
||||
lib->priv.w.neededlibs[2] = strdup("librt.so.1");
|
||||
|
||||
#define CUSTOM_FINI \
|
||||
((sdl1_my_t *)lib->priv.w.p2)->SDL_Quit(); \
|
||||
freeSDL1My(lib->priv.w.p2); \
|
||||
free(lib->priv.w.p2); \
|
||||
((box64context_t*)(lib->context))->sdl1lib = NULL; \
|
||||
((box64context_t*)(lib->context))->sdl1allocrw = NULL; \
|
||||
((box64context_t*)(lib->context))->sdl1freerw = NULL;
|
||||
|
||||
#include "wrappedlib_init.h"
|
||||
|
||||
Executable
+238
@@ -0,0 +1,238 @@
|
||||
#if defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)
|
||||
|
||||
// _fini
|
||||
// _init
|
||||
GOM(SDL_AddTimer, pFEupp)
|
||||
GO(SDL_AllocRW, pFv) // no need to use a my_ version here
|
||||
GO(SDL_CDClose, vFp)
|
||||
GO(SDL_CDEject, iFp)
|
||||
GO(SDL_CDName, pFi)
|
||||
GO(SDL_CDNumDrives, iFv)
|
||||
GO(SDL_CDOpen, pFi)
|
||||
GO(SDL_CDPause, iFp)
|
||||
GO(SDL_CDPlay, iFpii)
|
||||
GO(SDL_CDPlayTracks, iFpiiii)
|
||||
GO(SDL_CDResume, iFp)
|
||||
GO(SDL_CDStatus, iFp)
|
||||
GO(SDL_CDStop, iFp)
|
||||
GO(SDL_ClearError, vFv)
|
||||
GO(SDL_CondBroadcast, iFp)
|
||||
GO(SDL_CondSignal, iFp)
|
||||
GO(SDL_CondWait, iFpp)
|
||||
GO(SDL_CondWaitTimeout, iFppu)
|
||||
GO(SDL_ConvertSurface, pFppu)
|
||||
GO(SDL_CreateCond, pFv)
|
||||
GO(SDL_CreateCursor, pFppiiii)
|
||||
GO(SDL_CreateMutex, pFv)
|
||||
GO(SDL_CreateRGBSurface, pFuiiiuuuu)
|
||||
GO(SDL_CreateRGBSurfaceFrom, pFpiiiiuuuu)
|
||||
GO(SDL_CreateSemaphore, pFu)
|
||||
GOM(SDL_CreateThread, pFEpp)
|
||||
GO(SDL_CreateYUVOverlay, pFiiup)
|
||||
GO(SDL_Delay, vFu)
|
||||
GO(SDL_DestroyCond, vFp)
|
||||
GO(SDL_DestroyMutex, vFp)
|
||||
GO(SDL_DestroySemaphore, vFp)
|
||||
GO(SDL_DisplayFormat, pFp)
|
||||
GO(SDL_DisplayFormatAlpha, pFp)
|
||||
GO(SDL_DisplayYUVOverlay, iFpp)
|
||||
GO(SDL_EnableKeyRepeat, iFii)
|
||||
GO(SDL_EnableUNICODE, iFi)
|
||||
GO(SDL_Error, vFi)
|
||||
GO(SDL_EventState, uFui)
|
||||
GO(SDL_FillRect, iFppu)
|
||||
GO(SDL_Flip, iFp)
|
||||
GO(SDL_FreeCursor, vFp)
|
||||
GO(SDL_FreeRW, vFp)
|
||||
GO(SDL_FreeSurface, vFp)
|
||||
GO(SDL_FreeYUVOverlay, vFp)
|
||||
GO(SDL_GL_GetAttribute, iFup)
|
||||
GOM(SDL_GL_GetProcAddress, pFEp)
|
||||
GO(SDL_GL_LoadLibrary, iFp)
|
||||
GO(SDL_GL_Lock, vFv)
|
||||
GO(SDL_GL_SetAttribute, iFui)
|
||||
GO(SDL_GL_SwapBuffers, vFv)
|
||||
GO(SDL_GL_Unlock, vFv)
|
||||
GO(SDL_GL_UpdateRects, vFip)
|
||||
GO(SDL_GetAppState, uFv)
|
||||
GO(SDL_GetClipRect, vFpp)
|
||||
GO(SDL_GetCursor, pFv)
|
||||
GO(SDL_GetError, pFv)
|
||||
GOM(SDL_GetEventFilter, pFEv)
|
||||
GO(SDL_GetGammaRamp, iFppp)
|
||||
GO(SDL_GetKeyName, pFi)
|
||||
GO(SDL_GetKeyRepeat, vFpp)
|
||||
GO(SDL_GetKeyState, pFp)
|
||||
GO(SDL_GetModState, iFv)
|
||||
GO(SDL_GetMouseState, uFpp)
|
||||
GO(SDL_GetRGB, vFupppp)
|
||||
GO(SDL_GetRGBA, vFuppppp)
|
||||
GO(SDL_GetRelativeMouseState, uFpp)
|
||||
GO(SDL_GetThreadID, uFp)
|
||||
GO(SDL_GetTicks, uFv)
|
||||
GO(SDL_GetVideoInfo, pFv)
|
||||
GO(SDL_GetVideoSurface, pFv)
|
||||
GOM(SDL_GetWMInfo, iFEp)
|
||||
GOM(SDL_Has3DNow, iFv)
|
||||
GOM(SDL_Has3DNowExt, iFv)
|
||||
GOM(SDL_HasAltiVec, iFv)
|
||||
GOM(SDL_HasMMX, iFv)
|
||||
GOM(SDL_HasMMXExt, iFv)
|
||||
GOM(SDL_HasRDTSC, iFv)
|
||||
GOM(SDL_HasSSE, iFv)
|
||||
GOM(SDL_HasSSE2, iFv)
|
||||
GO(SDL_Init, iFu)
|
||||
GO(SDL_InitQuickDraw, vFp)
|
||||
GO(SDL_InitSubSystem, iFu)
|
||||
GO(SDL_JoystickClose, vFp)
|
||||
GO(SDL_JoystickEventState, iFi)
|
||||
GO(SDL_JoystickGetAxis, iFpi)
|
||||
GO(SDL_JoystickGetBall, iFpipp)
|
||||
GO(SDL_JoystickGetButton, uFpi)
|
||||
GO(SDL_JoystickGetHat, uFpi)
|
||||
GO(SDL_JoystickIndex, iFp)
|
||||
GO(SDL_JoystickName, pFi)
|
||||
GO(SDL_JoystickNumAxes, iFp)
|
||||
GO(SDL_JoystickNumBalls, iFp)
|
||||
GO(SDL_JoystickNumButtons, iFp)
|
||||
GO(SDL_JoystickNumHats, iFp)
|
||||
GO(SDL_JoystickOpen, pFi)
|
||||
GO(SDL_JoystickOpened, iFi)
|
||||
GO(SDL_JoystickUpdate, vFv)
|
||||
GOM(SDL_KillThread, vFEp)
|
||||
GO(SDL_Linked_Version, pFv)
|
||||
GO(SDL_ListModes, pFpu)
|
||||
GOM(SDL_LoadBMP_RW, pFEpi)
|
||||
GOM(SDL_LoadFunction, pFEpp)
|
||||
GOM(SDL_LoadObject, pFEp)
|
||||
GO(SDL_LockSurface, iFp)
|
||||
GO(SDL_LockYUVOverlay, iFp)
|
||||
GO(SDL_LowerBlit, iFpppp)
|
||||
GO(SDL_MapRGB, uFpuuu)
|
||||
GO(SDL_MapRGBA, uFpuuuu)
|
||||
GO(SDL_NumJoysticks, iFv)
|
||||
GO(SDL_PeepEvents, iFpiiu)
|
||||
GO(SDL_PollEvent, iFp)
|
||||
GO(SDL_PumpEvents, vFv)
|
||||
GO(SDL_PushEvent, iFp)
|
||||
GO(SDL_Quit, vFv)
|
||||
GO(SDL_QuitSubSystem, vFu)
|
||||
GOM(SDL_RWFromConstMem, pFEpi)
|
||||
GOM(SDL_RWFromFP, pFEpi)
|
||||
GOM(SDL_RWFromFile, pFEpp)
|
||||
GOM(SDL_RWFromMem, pFEpi)
|
||||
GOM(SDL_ReadBE16, uFEp)
|
||||
GOM(SDL_ReadBE32, uFEp)
|
||||
GOM(SDL_ReadBE64, UFEp)
|
||||
GOM(SDL_ReadLE16, uFEp)
|
||||
GOM(SDL_ReadLE32, uFEp)
|
||||
GOM(SDL_ReadLE64, UFEp)
|
||||
GO(SDL_RegisterApp, iFpup)
|
||||
GOM(SDL_RemoveTimer, iFEp)
|
||||
GOM(SDL_SaveBMP_RW, iFEppi)
|
||||
GO(SDL_SemPost, iFp)
|
||||
GO(SDL_SemTryWait, iFp)
|
||||
GO(SDL_SemValue, uFp)
|
||||
GO(SDL_SemWait, iFp)
|
||||
GO(SDL_SemWaitTimeout, iFpu)
|
||||
GO(SDL_SetAlpha, iFpuu)
|
||||
GO(SDL_SetClipRect, iFpp)
|
||||
GO(SDL_SetColorKey, iFpuu)
|
||||
GO(SDL_SetColors, iFppii)
|
||||
GO(SDL_SetCursor, vFp)
|
||||
GO(SDL_SetError, vFpppppp) // use ..., so putting arbitrary number of arguments...
|
||||
GOM(SDL_SetEventFilter, vFEp)
|
||||
GO(SDL_SetGamma, iFfff)
|
||||
GO(SDL_SetGammaRamp, iFppp)
|
||||
GO(SDL_SetModState, vFi)
|
||||
GO(SDL_SetModuleHandle, vFp)
|
||||
GO(SDL_SetPalette, iFpipii)
|
||||
GOM(SDL_SetTimer, iFEup)
|
||||
GO(SDL_SetVideoMode, pFiiiu)
|
||||
GO(SDL_ShowCursor, iFi)
|
||||
GO(SDL_SoftStretch, iFpppp)
|
||||
GO(SDL_ThreadID, uFv)
|
||||
GOM(SDL_UnloadObject, vFEp)
|
||||
GO(SDL_UnlockSurface, vFp)
|
||||
GO(SDL_UnlockYUVOverlay, vFp)
|
||||
GO(SDL_UnregisterApp, vFv)
|
||||
GO(SDL_UpdateRect, vFpiiii)
|
||||
GO(SDL_UpdateRects, vFpip)
|
||||
GO(SDL_UpperBlit, iFpppp)
|
||||
GO(SDL_VideoDriverName, pFpi)
|
||||
GO(SDL_VideoInit, iFpu)
|
||||
GO(SDL_VideoModeOK, iFiiiu)
|
||||
GO(SDL_VideoQuit, vFv)
|
||||
GO(SDL_WM_GetCaption, vFpp)
|
||||
GO(SDL_WM_GrabInput, iFi)
|
||||
GO(SDL_WM_IconifyWindow, iFv)
|
||||
GO(SDL_WM_SetCaption, vFpp)
|
||||
GO(SDL_WM_SetIcon, vFpp)
|
||||
GO(SDL_WM_ToggleFullScreen, iFp)
|
||||
GO(SDL_WaitEvent, iFp)
|
||||
GO(SDL_WaitThread, vFpp)
|
||||
GO(SDL_WarpMouse, vFWW)
|
||||
GO(SDL_WasInit, uFu)
|
||||
GOM(SDL_WriteBE16, uFEpW)
|
||||
GOM(SDL_WriteBE32, uFEpu)
|
||||
GOM(SDL_WriteBE64, uFEpU)
|
||||
GOM(SDL_WriteLE16, uFEpW)
|
||||
GOM(SDL_WriteLE32, uFEpu)
|
||||
GOM(SDL_WriteLE64, uFEpU)
|
||||
GO(SDL_framerateDelay, uFp)
|
||||
GO(SDL_getFramecount, iFp)
|
||||
GO(SDL_getFramerate, iFp)
|
||||
GO(SDL_iconv, uFppppp)
|
||||
GO(SDL_iconv_close, iFp)
|
||||
GO(SDL_iconv_open, pFpp)
|
||||
GO(SDL_iconv_string, pFpppu)
|
||||
GO(SDL_initFramerate, vFp)
|
||||
GO(SDL_lltoa, pFIpi)
|
||||
GO(SDL_ltoa, pFipi)
|
||||
GO(SDL_main, iFip)
|
||||
GO(SDL_memcmp, iFppu)
|
||||
GO(SDL_mutexP, iFp)
|
||||
GO(SDL_mutexV, iFp)
|
||||
GO(SDL_revcpy, pFppu)
|
||||
GO(SDL_setFramerate, iFpu)
|
||||
GO(SDL_snprintf, iFpupppppp) // use ...
|
||||
GO(SDL_sscanf, iFppppppp) // use ...
|
||||
GO(SDL_strcasecmp, iFpp)
|
||||
GO(SDL_strchr, pFpi)
|
||||
GO(SDL_strcmp, iFpp)
|
||||
GO(SDL_strdup, pFp)
|
||||
GO(SDL_strlcat, uFppu)
|
||||
GO(SDL_strlcpy, uFppu)
|
||||
GO(SDL_strlen, uFp)
|
||||
GO(SDL_strlwr, pFp)
|
||||
GO(SDL_strncasecmp, iFppu)
|
||||
GO(SDL_strncmp, iFppu)
|
||||
GO(SDL_strrchr, pFpi)
|
||||
GO(SDL_strrev, pFp)
|
||||
GO(SDL_strstr, pFpp)
|
||||
GO(SDL_strtod, dFpp)
|
||||
GO(SDL_strtol, iFppi)
|
||||
GO(SDL_strtoll, IFppi)
|
||||
GO(SDL_strtoul, uFppi)
|
||||
GO(SDL_strtoull, UFppi)
|
||||
GO(SDL_strupr, pFp)
|
||||
GO(SDL_ulltoa, pFUpi)
|
||||
GO(SDL_ultoa, pFupi)
|
||||
GO(SDL_vsnprintf, iFpupV)
|
||||
GOM(SDL_OpenAudio, iFEpp)
|
||||
GO(SDL_LockAudio, vFv)
|
||||
GO(SDL_UnlockAudio, vFv)
|
||||
GO(SDL_PauseAudio, vFi)
|
||||
GO(SDL_GetAudioStatus, iFv)
|
||||
GO(SDL_LoadWAV, pFpppp)
|
||||
GO(SDL_FreeWAV, vFp)
|
||||
GOM(SDL_LoadWAV_RW, pFEpippp)
|
||||
GO(SDL_BuildAudioCVT, iFpuuiuui)
|
||||
GO(SDL_ConvertAudio, iFp)
|
||||
GO(SDL_AudioInit, iFp)
|
||||
GO(SDL_AudioQuit, vFv) // should free callback
|
||||
GO(SDL_MixAudio, vFppui)
|
||||
GO(SDL_CloseAudio, vFv) // should free callback
|
||||
GO(SDL_AudioDriverName, pFpi)
|
||||
|
||||
#endif
|
||||
Executable
+130
@@ -0,0 +1,130 @@
|
||||
#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 "wrapper.h"
|
||||
#include "bridge.h"
|
||||
#include "librarian/library_private.h"
|
||||
#include "x64emu.h"
|
||||
#include "emu/x64emu_private.h"
|
||||
#include "box64context.h"
|
||||
#include "sdl1rwops.h"
|
||||
|
||||
typedef void* (*pFpi_t)(void*, int32_t);
|
||||
typedef void* (*pFp_t)(void*);
|
||||
typedef void* (*pFpip_t)(void*, int32_t, void*);
|
||||
|
||||
typedef struct sdl1image_my_s {
|
||||
pFp_t IMG_LoadBMP_RW;
|
||||
pFp_t IMG_LoadCUR_RW;
|
||||
pFp_t IMG_LoadGIF_RW;
|
||||
pFp_t IMG_LoadICO_RW;
|
||||
pFp_t IMG_LoadJPG_RW;
|
||||
pFp_t IMG_LoadLBM_RW;
|
||||
pFp_t IMG_LoadPCX_RW;
|
||||
pFp_t IMG_LoadPNG_RW;
|
||||
pFp_t IMG_LoadPNM_RW;
|
||||
pFp_t IMG_LoadTGA_RW;
|
||||
pFp_t IMG_LoadTIF_RW;
|
||||
pFpip_t IMG_LoadTyped_RW;
|
||||
pFp_t IMG_LoadWEBP_RW;
|
||||
pFp_t IMG_LoadXCF_RW;
|
||||
pFp_t IMG_LoadXPM_RW;
|
||||
pFp_t IMG_LoadXV_RW;
|
||||
pFpi_t IMG_Load_RW;
|
||||
} sdl1image_my_t;
|
||||
|
||||
static library_t* my_lib = NULL;
|
||||
|
||||
static void* getSDL1ImageMy(library_t* lib)
|
||||
{
|
||||
sdl1image_my_t* my = (sdl1image_my_t*)calloc(1, sizeof(sdl1image_my_t));
|
||||
#define GO(A, W) my->A = (W)dlsym(lib->priv.w.lib, #A);
|
||||
GO(IMG_LoadBMP_RW,pFp_t)
|
||||
GO(IMG_LoadCUR_RW,pFp_t)
|
||||
GO(IMG_LoadGIF_RW,pFp_t)
|
||||
GO(IMG_LoadICO_RW,pFp_t)
|
||||
GO(IMG_LoadJPG_RW,pFp_t)
|
||||
GO(IMG_LoadLBM_RW,pFp_t)
|
||||
GO(IMG_LoadPCX_RW,pFp_t)
|
||||
GO(IMG_LoadPNG_RW,pFp_t)
|
||||
GO(IMG_LoadPNM_RW,pFp_t)
|
||||
GO(IMG_LoadTGA_RW,pFp_t)
|
||||
GO(IMG_LoadTIF_RW,pFp_t)
|
||||
GO(IMG_LoadTyped_RW,pFpip_t)
|
||||
GO(IMG_LoadWEBP_RW,pFp_t)
|
||||
GO(IMG_LoadXCF_RW,pFp_t)
|
||||
GO(IMG_LoadXPM_RW,pFp_t)
|
||||
GO(IMG_LoadXV_RW,pFp_t)
|
||||
GO(IMG_Load_RW,pFpi_t)
|
||||
#undef GO
|
||||
return my;
|
||||
}
|
||||
|
||||
#define GO(A) \
|
||||
void EXPORT *my_##A(x64emu_t* emu, void* a) \
|
||||
{ \
|
||||
sdl1image_my_t *my = (sdl1image_my_t *)my_lib->priv.w.p2; \
|
||||
SDL1_RWops_t* rw = RWNativeStart(emu, (SDL1_RWops_t*)a); \
|
||||
void* r = my->A(rw); \
|
||||
RWNativeEnd(rw); \
|
||||
return r; \
|
||||
}
|
||||
GO(IMG_LoadBMP_RW)
|
||||
GO(IMG_LoadCUR_RW)
|
||||
GO(IMG_LoadGIF_RW)
|
||||
GO(IMG_LoadICO_RW)
|
||||
GO(IMG_LoadJPG_RW)
|
||||
GO(IMG_LoadLBM_RW)
|
||||
GO(IMG_LoadPCX_RW)
|
||||
GO(IMG_LoadPNG_RW)
|
||||
GO(IMG_LoadPNM_RW)
|
||||
GO(IMG_LoadTGA_RW)
|
||||
GO(IMG_LoadTIF_RW)
|
||||
GO(IMG_LoadWEBP_RW)
|
||||
GO(IMG_LoadXCF_RW)
|
||||
GO(IMG_LoadXPM_RW)
|
||||
GO(IMG_LoadXV_RW)
|
||||
#undef GO
|
||||
|
||||
void EXPORT *my_IMG_LoadTyped_RW(x64emu_t* emu, void* a, int32_t b, void* c)
|
||||
{
|
||||
sdl1image_my_t *my = (sdl1image_my_t *)my_lib->priv.w.p2;
|
||||
SDL1_RWops_t* rw = RWNativeStart(emu, (SDL1_RWops_t*)a);
|
||||
void* r = my->IMG_LoadTyped_RW(rw, b, c);
|
||||
if(b==0)
|
||||
RWNativeEnd(rw);
|
||||
return r;
|
||||
}
|
||||
void EXPORT *my_IMG_Load_RW(x64emu_t* emu, void* a, int32_t b)
|
||||
{
|
||||
sdl1image_my_t *my = (sdl1image_my_t *)my_lib->priv.w.p2;
|
||||
SDL1_RWops_t* rw = RWNativeStart(emu, (SDL1_RWops_t*)a);
|
||||
void* r = my->IMG_Load_RW(rw, b);
|
||||
if(b==0)
|
||||
RWNativeEnd(rw);
|
||||
return r;
|
||||
}
|
||||
|
||||
const char* sdl1imageName = "libSDL_image-1.2.so.0";
|
||||
#define LIBNAME sdl1image
|
||||
|
||||
#define CUSTOM_INIT \
|
||||
my_lib = lib; \
|
||||
lib->priv.w.p2 = getSDL1ImageMy(lib); \
|
||||
lib->priv.w.needed = 2; \
|
||||
lib->priv.w.neededlibs = (char**)calloc(lib->priv.w.needed, sizeof(char*)); \
|
||||
lib->priv.w.neededlibs[0] = strdup("libSDL-1.2.so.0"); \
|
||||
lib->priv.w.neededlibs[1] = strdup("libz.so.1");
|
||||
|
||||
#define CUSTOM_FINI \
|
||||
free(lib->priv.w.p2); \
|
||||
my_lib = NULL;
|
||||
|
||||
#include "wrappedlib_init.h"
|
||||
|
||||
Executable
+41
@@ -0,0 +1,41 @@
|
||||
#if defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)
|
||||
|
||||
GO(IMG_Init,iFi)
|
||||
GO(IMG_InvertAlpha,iFi)
|
||||
GO(IMG_Linked_Version,pFv)
|
||||
GO(IMG_Load,pFp)
|
||||
GOM(IMG_LoadBMP_RW,pFEp)
|
||||
GOM(IMG_LoadCUR_RW,pFEp)
|
||||
GOM(IMG_LoadGIF_RW,pFEp)
|
||||
GOM(IMG_LoadICO_RW,pFEp)
|
||||
GOM(IMG_LoadJPG_RW,pFEp)
|
||||
GOM(IMG_LoadLBM_RW,pFEp)
|
||||
GOM(IMG_LoadPCX_RW,pFEp)
|
||||
GOM(IMG_LoadPNG_RW,pFEp)
|
||||
GOM(IMG_LoadPNM_RW,pFEp)
|
||||
GOM(IMG_LoadTGA_RW,pFEp)
|
||||
GOM(IMG_LoadTIF_RW,pFEp)
|
||||
GOM(IMG_LoadTyped_RW,pFEpip)
|
||||
GOM(IMG_LoadWEBP_RW,pFEp)
|
||||
GOM(IMG_LoadXCF_RW,pFEp)
|
||||
GOM(IMG_LoadXPM_RW,pFEp)
|
||||
GOM(IMG_LoadXV_RW,pFEp)
|
||||
GOM(IMG_Load_RW,pFEpi)
|
||||
GO(IMG_Quit,vFv)
|
||||
GO(IMG_ReadXPMFromArray,pFp)
|
||||
GO(IMG_isBMP,iFp)
|
||||
GO(IMG_isCUR,iFp)
|
||||
GO(IMG_isGIF,iFp)
|
||||
GO(IMG_isICO,iFp)
|
||||
GO(IMG_isJPG,iFp)
|
||||
GO(IMG_isLBM,iFp)
|
||||
GO(IMG_isPCX,iFp)
|
||||
GO(IMG_isPNG,iFp)
|
||||
GO(IMG_isPNM,iFp)
|
||||
GO(IMG_isTIF,iFp)
|
||||
GO(IMG_isWEBP,iFp)
|
||||
GO(IMG_isXCF,iFp)
|
||||
GO(IMG_isXPM,iFp)
|
||||
GO(IMG_isXV,iFp)
|
||||
|
||||
#endif
|
||||
Executable
+264
@@ -0,0 +1,264 @@
|
||||
#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 "wrapper.h"
|
||||
#include "bridge.h"
|
||||
#include "librarian/library_private.h"
|
||||
#include "x64emu.h"
|
||||
#include "emu/x64emu_private.h"
|
||||
#include "box64context.h"
|
||||
#include "sdl1rwops.h"
|
||||
#include "callback.h"
|
||||
|
||||
typedef void* (*pFpi_t)(void*, int32_t);
|
||||
typedef void* (*pFp_t)(void*);
|
||||
typedef int (*iFip_t)(int, void*);
|
||||
typedef void* (*pFpii_t)(void*, int32_t, int32_t);
|
||||
typedef void (*vFp_t)(void*);
|
||||
typedef void (*vFpp_t)(void*, void*);
|
||||
typedef int (*iFippp_t)(int, void*, void*, void*);
|
||||
|
||||
#define SUPER() \
|
||||
GO(Mix_LoadMUSType_RW,pFpii_t) \
|
||||
GO(Mix_LoadMUS_RW,pFp_t) \
|
||||
GO(Mix_LoadWAV_RW,pFpi_t) \
|
||||
GO(Mix_SetPostMix,vFpp_t) \
|
||||
GO(Mix_ChannelFinished,vFp_t) \
|
||||
GO(Mix_HookMusic, vFpp_t) \
|
||||
GO(Mix_HookMusicFinished, vFp_t) \
|
||||
GO(Mix_RegisterEffect, iFippp_t) \
|
||||
GO(Mix_UnregisterEffect, iFip_t) \
|
||||
|
||||
typedef struct sdl1mixer_my_s {
|
||||
#define GO(A, B) B A;
|
||||
SUPER()
|
||||
#undef GO
|
||||
} sdl1mixer_my_t;
|
||||
|
||||
static void* getSDL1MixerMy(library_t* lib)
|
||||
{
|
||||
sdl1mixer_my_t* my = (sdl1mixer_my_t*)calloc(1, sizeof(sdl1mixer_my_t));
|
||||
#define GO(A, W) my->A = (W)dlsym(lib->priv.w.lib, #A);
|
||||
SUPER()
|
||||
#undef GO
|
||||
return my;
|
||||
}
|
||||
#undef SUPER
|
||||
|
||||
#define SUPER() \
|
||||
GO(0) \
|
||||
GO(1) \
|
||||
GO(2) \
|
||||
GO(3) \
|
||||
GO(4)
|
||||
|
||||
// EffectFunc
|
||||
#define GO(A) \
|
||||
static uintptr_t my_EffectFunc_fct_##A = 0; \
|
||||
static void my_EffectFunc_##A(int chan, void *stream, int len, void *udata) \
|
||||
{ \
|
||||
RunFunction(my_context, my_EffectFunc_fct_##A, 4, chan, stream, len, udata); \
|
||||
}
|
||||
SUPER()
|
||||
#undef GO
|
||||
static void* find_EffectFunc_Fct(void* fct)
|
||||
{
|
||||
if(!fct) return NULL;
|
||||
void* p;
|
||||
if((p = GetNativeFnc((uintptr_t)fct))) return p;
|
||||
#define GO(A) if(my_EffectFunc_fct_##A == (uintptr_t)fct) return my_EffectFunc_##A;
|
||||
SUPER()
|
||||
#undef GO
|
||||
#define GO(A) if(my_EffectFunc_fct_##A == 0) {my_EffectFunc_fct_##A = (uintptr_t)fct; return my_EffectFunc_##A; }
|
||||
SUPER()
|
||||
#undef GO
|
||||
printf_log(LOG_NONE, "Warning, no more slot for SDL1Mixer EffectFunc callback\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// EffectDone
|
||||
#define GO(A) \
|
||||
static uintptr_t my_EffectDone_fct_##A = 0; \
|
||||
static void my_EffectDone_##A(int chan, void *udata) \
|
||||
{ \
|
||||
RunFunction(my_context, my_EffectDone_fct_##A, 2, chan, udata); \
|
||||
}
|
||||
SUPER()
|
||||
#undef GO
|
||||
static void* find_EffectDone_Fct(void* fct)
|
||||
{
|
||||
if(!fct) return NULL;
|
||||
void* p;
|
||||
if((p = GetNativeFnc((uintptr_t)fct))) return p;
|
||||
#define GO(A) if(my_EffectDone_fct_##A == (uintptr_t)fct) return my_EffectDone_##A;
|
||||
SUPER()
|
||||
#undef GO
|
||||
#define GO(A) if(my_EffectDone_fct_##A == 0) {my_EffectDone_fct_##A = (uintptr_t)fct; return my_EffectDone_##A; }
|
||||
SUPER()
|
||||
#undef GO
|
||||
printf_log(LOG_NONE, "Warning, no more slot for SDL1Mixer EffectDone callback\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// MixFunc
|
||||
#define GO(A) \
|
||||
static uintptr_t my_MixFunc_fct_##A = 0; \
|
||||
static void my_MixFunc_##A(void *udata, uint8_t *stream, int len) \
|
||||
{ \
|
||||
RunFunction(my_context, my_MixFunc_fct_##A, 3, udata, stream, len); \
|
||||
}
|
||||
SUPER()
|
||||
#undef GO
|
||||
static void* find_MixFunc_Fct(void* fct)
|
||||
{
|
||||
if(!fct) return NULL;
|
||||
void* p;
|
||||
if((p = GetNativeFnc((uintptr_t)fct))) return p;
|
||||
#define GO(A) if(my_MixFunc_fct_##A == (uintptr_t)fct) return my_MixFunc_##A;
|
||||
SUPER()
|
||||
#undef GO
|
||||
#define GO(A) if(my_MixFunc_fct_##A == 0) {my_MixFunc_fct_##A = (uintptr_t)fct; return my_MixFunc_##A; }
|
||||
SUPER()
|
||||
#undef GO
|
||||
printf_log(LOG_NONE, "Warning, no more slot for SDL1Mixer MixFunc callback\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// ChannelFinished
|
||||
#define GO(A) \
|
||||
static uintptr_t my_ChannelFinished_fct_##A = 0; \
|
||||
static void my_ChannelFinished_##A(int channel) \
|
||||
{ \
|
||||
RunFunction(my_context, my_ChannelFinished_fct_##A, 1, channel); \
|
||||
}
|
||||
SUPER()
|
||||
#undef GO
|
||||
static void* find_ChannelFinished_Fct(void* fct)
|
||||
{
|
||||
if(!fct) return NULL;
|
||||
void* p;
|
||||
if((p = GetNativeFnc((uintptr_t)fct))) return p;
|
||||
#define GO(A) if(my_ChannelFinished_fct_##A == (uintptr_t)fct) return my_ChannelFinished_##A;
|
||||
SUPER()
|
||||
#undef GO
|
||||
#define GO(A) if(my_ChannelFinished_fct_##A == 0) {my_ChannelFinished_fct_##A = (uintptr_t)fct; return my_ChannelFinished_##A; }
|
||||
SUPER()
|
||||
#undef GO
|
||||
printf_log(LOG_NONE, "Warning, no more slot for SDL1Mixer ChannelFinished callback\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// MusicFinished
|
||||
#define GO(A) \
|
||||
static uintptr_t my_MusicFinished_fct_##A = 0; \
|
||||
static void my_MusicFinished_##A() \
|
||||
{ \
|
||||
RunFunction(my_context, my_MusicFinished_fct_##A, 0); \
|
||||
}
|
||||
SUPER()
|
||||
#undef GO
|
||||
static void* find_MusicFinished_Fct(void* fct)
|
||||
{
|
||||
if(!fct) return NULL;
|
||||
void* p;
|
||||
if((p = GetNativeFnc((uintptr_t)fct))) return p;
|
||||
#define GO(A) if(my_MusicFinished_fct_##A == (uintptr_t)fct) return my_MusicFinished_##A;
|
||||
SUPER()
|
||||
#undef GO
|
||||
#define GO(A) if(my_MusicFinished_fct_##A == 0) {my_MusicFinished_fct_##A = (uintptr_t)fct; return my_MusicFinished_##A; }
|
||||
SUPER()
|
||||
#undef GO
|
||||
printf_log(LOG_NONE, "Warning, no more slot for SDL1Mixer MusicFinished callback\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#undef SUPER
|
||||
|
||||
static void freeSDL1MixerMy(library_t* lib)
|
||||
{
|
||||
//sdl1mixer_my_t *my = lib->priv.w.p2;
|
||||
}
|
||||
|
||||
EXPORT void* my_Mix_LoadMUSType_RW(x64emu_t* emu, void* a, int32_t b, int32_t c)
|
||||
{
|
||||
sdl1mixer_my_t *my = (sdl1mixer_my_t *)emu->context->sdl1mixerlib->priv.w.p2;
|
||||
SDL1_RWops_t* rw = RWNativeStart(emu, (SDL1_RWops_t*)a);
|
||||
void* r = my->Mix_LoadMUSType_RW(rw, b, c);
|
||||
if(c==0)
|
||||
RWNativeEnd(rw);
|
||||
return r;
|
||||
}
|
||||
EXPORT void* my_Mix_LoadMUS_RW(x64emu_t* emu, void* a)
|
||||
{
|
||||
sdl1mixer_my_t *my = (sdl1mixer_my_t *)emu->context->sdl1mixerlib->priv.w.p2;
|
||||
SDL1_RWops_t* rw = RWNativeStart(emu, (SDL1_RWops_t*)a);
|
||||
void* r = my->Mix_LoadMUS_RW(rw);
|
||||
RWNativeEnd(rw); // this one never free the RWops
|
||||
return r;
|
||||
}
|
||||
EXPORT void* my_Mix_LoadWAV_RW(x64emu_t* emu, void* a, int32_t b)
|
||||
{
|
||||
sdl1mixer_my_t *my = (sdl1mixer_my_t *)emu->context->sdl1mixerlib->priv.w.p2;
|
||||
SDL1_RWops_t* rw = RWNativeStart(emu, (SDL1_RWops_t*)a);
|
||||
void* r = my->Mix_LoadWAV_RW(rw, b);
|
||||
if(b==0)
|
||||
RWNativeEnd(rw);
|
||||
return r;
|
||||
}
|
||||
|
||||
EXPORT void my_Mix_SetPostMix(x64emu_t* emu, void* a, void* b)
|
||||
{
|
||||
sdl1mixer_my_t *my = (sdl1mixer_my_t *)emu->context->sdl1mixerlib->priv.w.p2;
|
||||
my->Mix_SetPostMix(find_MixFunc_Fct(a), b);
|
||||
}
|
||||
|
||||
EXPORT void my_Mix_ChannelFinished(x64emu_t* emu, void* cb)
|
||||
{
|
||||
sdl1mixer_my_t *my = (sdl1mixer_my_t *)emu->context->sdl1mixerlib->priv.w.p2;
|
||||
my->Mix_ChannelFinished(find_ChannelFinished_Fct(cb));
|
||||
}
|
||||
|
||||
EXPORT void my_Mix_HookMusic(x64emu_t* emu, void* f, void* arg)
|
||||
{
|
||||
sdl1mixer_my_t *my = (sdl1mixer_my_t *)emu->context->sdl1mixerlib->priv.w.p2;
|
||||
my->Mix_HookMusic(find_MixFunc_Fct(f), arg);
|
||||
}
|
||||
|
||||
EXPORT void my_Mix_HookMusicFinished(x64emu_t* emu, void* f)
|
||||
{
|
||||
sdl1mixer_my_t *my = (sdl1mixer_my_t *)emu->context->sdl1mixerlib->priv.w.p2;
|
||||
my->Mix_HookMusicFinished(find_MusicFinished_Fct(f));
|
||||
}
|
||||
|
||||
EXPORT int my_Mix_RegisterEffect(x64emu_t* emu, int chan, void* f, void* d, void *arg)
|
||||
{
|
||||
sdl1mixer_my_t *my = (sdl1mixer_my_t *)emu->context->sdl1mixerlib->priv.w.p2;
|
||||
return my->Mix_RegisterEffect(chan, find_EffectFunc_Fct(f), find_EffectDone_Fct(d), arg);
|
||||
}
|
||||
|
||||
EXPORT int my_Mix_UnregisterEffect(x64emu_t* emu, int channel, void* f)
|
||||
{
|
||||
sdl1mixer_my_t *my = (sdl1mixer_my_t *)emu->context->sdl1mixerlib->priv.w.p2;
|
||||
return my->Mix_UnregisterEffect(channel, find_EffectFunc_Fct(f));
|
||||
}
|
||||
|
||||
const char* sdl1mixerName = "libSDL_mixer-1.2.so.0";
|
||||
#define LIBNAME sdl1mixer
|
||||
|
||||
#define CUSTOM_INIT \
|
||||
box64->sdl1mixerlib = lib; \
|
||||
lib->priv.w.p2 = getSDL1MixerMy(lib);
|
||||
|
||||
#define CUSTOM_FINI \
|
||||
freeSDL1MixerMy(lib); \
|
||||
free(lib->priv.w.p2); \
|
||||
((box64context_t*)(lib->context))->sdl1mixerlib = NULL;
|
||||
|
||||
#include "wrappedlib_init.h"
|
||||
|
||||
Executable
+77
@@ -0,0 +1,77 @@
|
||||
#if defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)
|
||||
|
||||
GO(Mix_AllocateChannels,iFi)
|
||||
GOM(Mix_ChannelFinished,vFEp)
|
||||
GO(Mix_CloseAudio,vFv)
|
||||
//GO(Mix_EachSoundFont,iFBp)
|
||||
GO(Mix_ExpireChannel,iFii)
|
||||
GO(Mix_FadeInChannelTimed,iFipiii)
|
||||
GO(Mix_FadeInMusic,iFpii)
|
||||
GO(Mix_FadeInMusicPos,iFpiid)
|
||||
GO(Mix_FadeOutChannel,iFii)
|
||||
GO(Mix_FadeOutGroup,iFii)
|
||||
GO(Mix_FadeOutMusic,iFi)
|
||||
GO(Mix_FadingChannel,iFi)
|
||||
GO(Mix_FadingMusic,iFv)
|
||||
GO(Mix_FreeChunk,vFp)
|
||||
GO(Mix_FreeMusic,vFp)
|
||||
GO(Mix_GetChunk,pFi)
|
||||
GO(Mix_GetChunkDecoder,pFi)
|
||||
GO(Mix_GetMusicDecoder,pFi)
|
||||
GO(Mix_GetMusicHookData,pFv)
|
||||
GO(Mix_GetMusicType,iFp)
|
||||
GO(Mix_GetNumChunkDecoders,iFv)
|
||||
GO(Mix_GetNumMusicDecoders,iFv)
|
||||
GO(Mix_GetSoundFonts,pFv)
|
||||
GO(Mix_GetSynchroValue,iFv)
|
||||
GO(Mix_GroupAvailable,iFi)
|
||||
GO(Mix_GroupChannel,iFii)
|
||||
GO(Mix_GroupChannels,iFiii)
|
||||
GO(Mix_GroupCount,iFi)
|
||||
GO(Mix_GroupNewer,iFi)
|
||||
GO(Mix_GroupOldest,iFi)
|
||||
GO(Mix_HaltChannel,iFi)
|
||||
GO(Mix_HaltGroup,iFi)
|
||||
GO(Mix_HaltMusic,iFv)
|
||||
GOM(Mix_HookMusic,vFEpp)
|
||||
GOM(Mix_HookMusicFinished,vFEp)
|
||||
GO(Mix_Init,iFi)
|
||||
GO(Mix_Linked_Version,pFv)
|
||||
GO(Mix_LoadMUS,pFp)
|
||||
GOM(Mix_LoadMUSType_RW,pFEpii)
|
||||
GOM(Mix_LoadMUS_RW,pFEp)
|
||||
GOM(Mix_LoadWAV_RW,pFEpi)
|
||||
GO(Mix_OpenAudio,iFiuii)
|
||||
GO(Mix_Pause,vFi)
|
||||
GO(Mix_PauseMusic,vFv)
|
||||
GO(Mix_Paused,iFi)
|
||||
GO(Mix_PausedMusic,iFv)
|
||||
GO(Mix_PlayChannelTimed,iFipii)
|
||||
GO(Mix_PlayMusic,iFpi)
|
||||
GO(Mix_Playing,iFi)
|
||||
GO(Mix_PlayingMusic,iFv)
|
||||
GO(Mix_QuerySpec,iFppp)
|
||||
GO(Mix_QuickLoad_RAW,pFpu)
|
||||
GO(Mix_QuickLoad_WAV,pFp)
|
||||
GO(Mix_Quit,vFv)
|
||||
GOM(Mix_RegisterEffect,iFEippp)
|
||||
GO(Mix_ReserveChannels,iFi)
|
||||
GO(Mix_Resume,vFi)
|
||||
GO(Mix_ResumeMusic,vFv)
|
||||
GO(Mix_RewindMusic,vFv)
|
||||
GO(Mix_SetDistance,iFiu)
|
||||
GO(Mix_SetMusicCMD,iFp)
|
||||
GO(Mix_SetMusicPosition,iFd)
|
||||
GO(Mix_SetPanning,iFiuu)
|
||||
GO(Mix_SetPosition,iFiiu)
|
||||
GOM(Mix_SetPostMix,vFEpp)
|
||||
GO(Mix_SetReverseStereo,iFii)
|
||||
GO(Mix_SetSoundFonts,iFp)
|
||||
GO(Mix_SetSynchroValue,iFi)
|
||||
GO(Mix_UnregisterAllEffects,iFi)
|
||||
GOM(Mix_UnregisterEffect,iFEip)
|
||||
GO(Mix_Volume,iFii)
|
||||
GO(Mix_VolumeChunk,iFpi)
|
||||
GO(Mix_VolumeMusic,iFi)
|
||||
|
||||
#endif
|
||||
Executable
+70
@@ -0,0 +1,70 @@
|
||||
#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 "wrapper.h"
|
||||
#include "bridge.h"
|
||||
#include "librarian/library_private.h"
|
||||
#include "x64emu.h"
|
||||
#include "emu/x64emu_private.h"
|
||||
#include "box64context.h"
|
||||
#include "sdl1rwops.h"
|
||||
|
||||
typedef void* (*pFpii_t)(void*, int32_t, int32_t);
|
||||
typedef void* (*pFpiii_t)(void*, int32_t, int32_t, int32_t);
|
||||
|
||||
typedef struct sdl1ttf_my_s {
|
||||
pFpii_t TTF_OpenFontRW;
|
||||
pFpiii_t TTF_OpenFontIndexRW;
|
||||
} sdl1ttf_my_t;
|
||||
|
||||
static library_t* my_lib = NULL;
|
||||
|
||||
static void* getSDL1TTFMy(library_t* lib)
|
||||
{
|
||||
sdl1ttf_my_t* my = (sdl1ttf_my_t*)calloc(1, sizeof(sdl1ttf_my_t));
|
||||
#define GO(A, W) my->A = (W)dlsym(lib->priv.w.lib, #A);
|
||||
GO(TTF_OpenFontIndexRW,pFpiii_t)
|
||||
GO(TTF_OpenFontRW, pFpii_t)
|
||||
#undef GO
|
||||
return my;
|
||||
}
|
||||
|
||||
void EXPORT *my_TTF_OpenFontIndexRW(x64emu_t* emu, void* a, int32_t b, int32_t c, int32_t d)
|
||||
{
|
||||
sdl1ttf_my_t *my = (sdl1ttf_my_t *)my_lib->priv.w.p2;
|
||||
SDL1_RWops_t* rw = RWNativeStart(emu, (SDL1_RWops_t*)a);
|
||||
void* r = my->TTF_OpenFontIndexRW(rw, b, c, d);
|
||||
if(b==0)
|
||||
RWNativeEnd(rw);
|
||||
return r;
|
||||
}
|
||||
|
||||
void EXPORT *my_TTF_OpenFontRW(x64emu_t* emu, void* a, int32_t b, int32_t c)
|
||||
{
|
||||
sdl1ttf_my_t *my = (sdl1ttf_my_t *)my_lib->priv.w.p2;
|
||||
SDL1_RWops_t* rw = RWNativeStart(emu, (SDL1_RWops_t*)a);
|
||||
void* r = my->TTF_OpenFontRW(rw, b, c);
|
||||
if(b==0)
|
||||
RWNativeEnd(rw);
|
||||
return r;
|
||||
}
|
||||
|
||||
const char* sdl1ttfName = "libSDL_ttf-2.0.so.0";
|
||||
#define LIBNAME sdl1ttf
|
||||
|
||||
#define CUSTOM_INIT \
|
||||
my_lib = lib; \
|
||||
lib->priv.w.p2 = getSDL1TTFMy(lib);
|
||||
|
||||
#define CUSTOM_FINI \
|
||||
free(lib->priv.w.p2); \
|
||||
my_lib = NULL;
|
||||
|
||||
#include "wrappedlib_init.h"
|
||||
|
||||
Executable
+49
@@ -0,0 +1,49 @@
|
||||
#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA))
|
||||
#error Meh!
|
||||
#endif
|
||||
|
||||
GO(TTF_ByteSwappedUNICODE, vFi)
|
||||
GO(TTF_CloseFont, vFp)
|
||||
GO(TTF_FontAscent, iFp)
|
||||
GO(TTF_FontDescent, iFp)
|
||||
GO(TTF_FontFaceFamilyName, pFp)
|
||||
GO(TTF_FontFaceIsFixedWidth, iFp)
|
||||
GO(TTF_FontFaces, iFp)
|
||||
GO(TTF_FontFaceStyleName, pFp)
|
||||
GO(TTF_FontHeight, iFp)
|
||||
GO(TTF_FontLineSkip, iFp)
|
||||
GO(TTF_GetFontHinting, iFp)
|
||||
GO(TTF_GetFontKerning, iFp)
|
||||
GO(TTF_GetFontKerningSize, iFp)
|
||||
GO(TTF_GetFontOutline, iFp)
|
||||
GO(TTF_GetFontStyle, iFp)
|
||||
GO(TTF_GlyphIsProvided, iFpu)
|
||||
GO(TTF_GlyphMetrics, iFpuppppp)
|
||||
GO(TTF_Init, iFv)
|
||||
GO(TTF_Linked_Version, pFv)
|
||||
GO(TTF_OpenFont, pFpi)
|
||||
GO(TTF_OpenFontIndex, pFpii)
|
||||
GOM(TTF_OpenFontIndexRW, pFEpiii)
|
||||
GOM(TTF_OpenFontRW, pFEpii)
|
||||
GO(TTF_Quit, vFv)
|
||||
GO(TTF_RenderGlyph_Blended, pFpuu)
|
||||
GO(TTF_RenderGlyph_Shaded, pFpuuu)
|
||||
GO(TTF_RenderGlyph_Solid, pFpuu)
|
||||
GO(TTF_RenderText_Blended, pFppu)
|
||||
GO(TTF_RenderText_Shaded, pFppuu)
|
||||
GO(TTF_RenderText_Solid, pFppu)
|
||||
GO(TTF_RenderUNICODE_Blended, pFppu)
|
||||
GO(TTF_RenderUNICODE_Shaded, pFppuu)
|
||||
GO(TTF_RenderUNICODE_Solid, pFppu)
|
||||
GO(TTF_RenderUTF8_Blended, pFppu)
|
||||
GO(TTF_RenderUTF8_Shaded, pFppuu)
|
||||
GO(TTF_RenderUTF8_Solid, pFppu)
|
||||
GO(TTF_SetFontHinting, vFpi)
|
||||
GO(TTF_SetFontKerning, vFpi)
|
||||
GO(TTF_SetFontOutline, vFpi)
|
||||
GO(TTF_SetFontStyle, vFpi)
|
||||
GO(TTF_SizeText, iFpppp)
|
||||
GO(TTF_SizeUNICODE, iFpppp)
|
||||
GO(TTF_SizeUTF8, iFpppp)
|
||||
GO(TTF_WasInit, iFv)
|
||||
|
||||
Loaded 100 of 117 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user