diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/include/sdl2align32.h | 770 | ||||
| -rw-r--r-- | src/library_list_32.h | 1 | ||||
| -rw-r--r-- | src/libtools/sdl2align32.c | 132 | ||||
| -rw-r--r-- | src/wrapped32/generated/functions_list.txt | 12 | ||||
| -rw-r--r-- | src/wrapped32/generated/wrappedsdl2defs32.h | 8 | ||||
| -rw-r--r-- | src/wrapped32/generated/wrappedsdl2types32.h | 23 | ||||
| -rw-r--r-- | src/wrapped32/generated/wrappedsdl2undefs32.h | 8 | ||||
| -rw-r--r-- | src/wrapped32/generated/wrapper32.c | 8 | ||||
| -rw-r--r-- | src/wrapped32/generated/wrapper32.h | 4 | ||||
| -rw-r--r-- | src/wrapped32/wrappedsdl1.c | 18 | ||||
| -rw-r--r-- | src/wrapped32/wrappedsdl2.c | 150 | ||||
| -rw-r--r-- | src/wrapped32/wrappedsdl2_private.h | 749 |
12 files changed, 1875 insertions, 8 deletions
diff --git a/src/include/sdl2align32.h b/src/include/sdl2align32.h new file mode 100644 index 00000000..2920da60 --- /dev/null +++ b/src/include/sdl2align32.h @@ -0,0 +1,770 @@ +#ifndef __MY_SDL2ALIGN32_H_ +#define __MY_SDL2ALIGN32_H_ +#include <stdint.h> +#include "box32.h" + +typedef struct my_SDL2_DisplayMode_s { + uint32_t format; + int w; + int h; + int refresh_rate; + void* driverdata; +} my_SDL2_DisplayMode_t; + +typedef struct __attribute__((packed)) my_SDL2_DisplayMode_32_s { + uint32_t format; + int w; + int h; + int refresh_rate; + ptr_t driverdata; +} my_SDL2_DisplayMode_32_t; + +typedef struct SDL2_CommonEvent_s { + uint32_t type; + uint32_t timestamp; +} my_SDL2_CommonEvent_t; + +typedef struct SDL2_DisplayEvent_s { + uint32_t type; + uint32_t timestamp; + uint32_t display; + uint8_t event; + uint8_t padding1; + uint8_t padding2; + uint8_t padding3; + int32_t data1; +} my_SDL2_DisplayEvent_t; + +typedef struct SDL2_WindowEvent_s { + uint32_t type; + uint32_t timestamp; + uint32_t windowID; + uint8_t event; + uint8_t padding1; + uint8_t padding2; + uint8_t padding3; + int32_t data1; + int32_t data2; +} my_SDL2_WindowEvent_t; + +typedef struct SDL2_Keysym_s { + int32_t scancode; + int32_t sym; + uint16_t mod; + uint32_t unused; +} my_SDL2_Keysym_t; + +typedef struct SDL2_KeyboardEvent_s { + uint32_t type; + uint32_t timestamp; + uint32_t windowID; + uint8_t state; + uint8_t repeat; + uint8_t padding2; + uint8_t padding3; + my_SDL2_Keysym_t keysym; +} my_SDL2_KeyboardEvent_t; + +typedef struct SDL2_TextEditingEvent_s { + uint32_t type; + uint32_t timestamp; + uint32_t windowID; + char text[32]; + int32_t start; + int32_t length; +} my_SDL2_TextEditingEvent_t; + + +typedef struct SDL2_TextEditingExtEvent_s { + uint32_t type; + uint32_t timestamp; + uint32_t windowID; + char* text; + int32_t start; + int32_t length; +} my_SDL2_TextEditingExtEvent_t; + +typedef struct SDL2_TextInputEvent_s { + uint32_t type; + uint32_t timestamp; + uint32_t windowID; + char text[32]; +} my_SDL2_TextInputEvent_t; + +typedef struct SDL2_MouseMotionEvent_s { + uint32_t type; + uint32_t timestamp; + uint32_t windowID; + uint32_t which; + uint32_t state; + int32_t x; + int32_t y; + int32_t xrel; + int32_t yrel; +} my_SDL2_MouseMotionEvent_t; + +typedef struct SDL2_MouseButtonEvent_s { + uint32_t type; + uint32_t timestamp; + uint32_t windowID; + uint32_t which; + uint8_t button; + uint8_t state; + uint8_t clicks; + uint8_t padding1; + int32_t x; + int32_t y; +} my_SDL2_MouseButtonEvent_t; + +typedef struct SDL2_MouseWheelEvent_s { + uint32_t type; + uint32_t timestamp; + uint32_t windowID; + uint32_t which; + int32_t x; + int32_t y; + uint32_t direction; + float preciseX; + float preciseY; + int32_t mouseX; + int32_t mouseY; +} my_SDL2_MouseWheelEvent_t; + +typedef struct SDL2_JoyAxisEvent_s { + uint32_t type; + uint32_t timestamp; + int32_t which; + uint8_t axis; + uint8_t padding1; + uint8_t padding2; + uint8_t padding3; + int16_t value; + uint16_t padding4; +} my_SDL2_JoyAxisEvent_t; + + +typedef struct SDL2_JoyBallEvent_s { + uint32_t type; + uint32_t timestamp; + int32_t which; + uint8_t ball; + uint8_t padding1; + uint8_t padding2; + uint8_t padding3; + int16_t xrel; + int16_t yrel; +} my_SDL2_JoyBallEvent_t; + +typedef struct SDL2_JoyHatEvent_s { + uint32_t type; + uint32_t timestamp; + int32_t which; + uint8_t hat; + uint8_t value; + uint8_t padding1; + uint8_t padding2; +} my_SDL2_JoyHatEvent_t; + +typedef struct SDL2_JoyButtonEvent_s { + uint32_t type; + uint32_t timestamp; + int32_t which; + uint8_t button; + uint8_t state; + uint8_t padding1; + uint8_t padding2; +} my_SDL2_JoyButtonEvent_t; + +typedef struct SDL2_JoyDeviceEvent_s { + uint32_t type; + uint32_t timestamp; + int32_t which; +} my_SDL2_JoyDeviceEvent_t; + + +typedef struct SDL2_JoyBatteryEvent_s { + uint32_t type; + uint32_t timestamp; + int32_t which; + int32_t level; +} my_SDL2_JoyBatteryEvent_t; + +typedef struct SDL2_ControllerAxisEvent_s { + uint32_t type; + uint32_t timestamp; + int32_t which; + uint8_t axis; + uint8_t padding1; + uint8_t padding2; + uint8_t padding3; + int16_t value; + uint16_t padding4; +} my_SDL2_ControllerAxisEvent_t; + + +typedef struct SDL2_ControllerButtonEvent_s { + uint32_t type; + uint32_t timestamp; + int32_t which; + uint8_t button; + uint8_t state; + uint8_t padding1; + uint8_t padding2; +} my_SDL2_ControllerButtonEvent_t; + + +typedef struct SDL2_ControllerDeviceEvent_s { + uint32_t type; + uint32_t timestamp; + int32_t which; +} my_SDL2_ControllerDeviceEvent_t; + +typedef struct SDL2_ControllerTouchpadEvent_s { + uint32_t type; + uint32_t timestamp; + int32_t which; + int32_t touchpad; + int32_t finger; + float x; + float y; + float pressure; +} my_SDL2_ControllerTouchpadEvent_t; + +typedef struct SDL2_ControllerSensorEvent_s { + uint32_t type; + uint32_t timestamp; + int32_t which; + int32_t sensor; + float data[3]; + uint64_t timestamp_us; +} my_SDL2_ControllerSensorEvent_t; + +typedef struct SDL2_AudioDeviceEvent_s { + uint32_t type; + uint32_t timestamp; + uint32_t which; + uint8_t iscapture; + uint8_t padding1; + uint8_t padding2; + uint8_t padding3; +} my_SDL2_AudioDeviceEvent_t; + +typedef struct SDL2_TouchFingerEvent_s { + uint32_t type; + uint32_t timestamp; + int64_t touchId; + int64_t fingerId; + float x; + float y; + float dx; + float dy; + float pressure; + uint32_t windowID; +} my_SDL2_TouchFingerEvent_t; + +typedef struct SDL2_MultiGestureEvent_s { + uint32_t type; + uint32_t timestamp; + int64_t touchId; + float dTheta; + float dDist; + float x; + float y; + uint16_t numFingers; + uint16_t padding; +} my_SDL2_MultiGestureEvent_t; + + +typedef struct SDL2_DollarGestureEvent_s { + uint32_t type; + uint32_t timestamp; + int64_t touchId; + int64_t gestureId; + uint32_t numFingers; + float error; + float x; + float y; +} my_SDL2_DollarGestureEvent_t; + +typedef struct SDL2_DropEvent_s { + uint32_t type; + uint32_t timestamp; + char* file; + uint32_t windowID; +} my_SDL2_DropEvent_t; + +typedef struct SDL2_SensorEvent_s { + uint32_t type; + uint32_t timestamp; + int32_t which; + float data[6]; + uint64_t timestamp_us; +} my_SDL2_SensorEvent_t; + + +typedef struct SDL2_QuitEvent_s { + uint32_t type; + uint32_t timestamp; +} my_SDL2_QuitEvent_t; + + +typedef struct SDL2_UserEvent_s { + uint32_t type; + uint32_t timestamp; + uint32_t windowID; + int32_t code; + void* data1; + void* data2; +} my_SDL2_UserEvent_t; + +typedef struct SDL2_SysWMEvent_s { + uint32_t type; + uint32_t timestamp; + void* msg; +} my_SDL2_SysWMEvent_t; + + +typedef union my_SDL2_Event_s { + uint32_t type; + my_SDL2_CommonEvent_t common; + my_SDL2_DisplayEvent_t display; + my_SDL2_WindowEvent_t window; + my_SDL2_KeyboardEvent_t key; + my_SDL2_TextEditingEvent_t edit; + my_SDL2_TextEditingExtEvent_t editExt; + my_SDL2_TextInputEvent_t text; + my_SDL2_MouseMotionEvent_t motion; + my_SDL2_MouseButtonEvent_t button; + my_SDL2_MouseWheelEvent_t wheel; + my_SDL2_JoyAxisEvent_t jaxis; + my_SDL2_JoyBallEvent_t jball; + my_SDL2_JoyHatEvent_t jhat; + my_SDL2_JoyButtonEvent_t jbutton; + my_SDL2_JoyDeviceEvent_t jdevice; + my_SDL2_JoyBatteryEvent_t jbattery; + my_SDL2_ControllerAxisEvent_t caxis; + my_SDL2_ControllerButtonEvent_t cbutton; + my_SDL2_ControllerDeviceEvent_t cdevice; + my_SDL2_ControllerTouchpadEvent_t ctouchpad; + my_SDL2_ControllerSensorEvent_t csensor; + my_SDL2_AudioDeviceEvent_t adevice; + my_SDL2_SensorEvent_t sensor; + my_SDL2_QuitEvent_t quit; + my_SDL2_UserEvent_t user; + my_SDL2_SysWMEvent_t syswm; + my_SDL2_TouchFingerEvent_t tfinger; + my_SDL2_MultiGestureEvent_t mgesture; + my_SDL2_DollarGestureEvent_t dgesture; + my_SDL2_DropEvent_t drop; +} my_SDL2_Event_t; + +typedef struct SDL2_CommonEvent_32_s { + uint32_t type; + uint32_t timestamp; +} my_SDL2_CommonEvent_32_t; + +typedef struct SDL2_DisplayEvent_32_s { + uint32_t type; + uint32_t timestamp; + uint32_t display; + uint8_t event; + uint8_t padding1; + uint8_t padding2; + uint8_t padding3; + int32_t data1; +} my_SDL2_DisplayEvent_32_t; + +typedef struct SDL2_WindowEvent_32_s { + uint32_t type; + uint32_t timestamp; + uint32_t windowID; + uint8_t event; + uint8_t padding1; + uint8_t padding2; + uint8_t padding3; + int32_t data1; + int32_t data2; +} my_SDL2_WindowEvent_32_t; + +typedef struct SDL2_Keysym_32_s { + int32_t scancode; + int32_t sym; + uint16_t mod; + uint32_t unused; +} my_SDL2_Keysym_32_t; + +typedef struct SDL2_KeyboardEvent_32_s { + uint32_t type; + uint32_t timestamp; + uint32_t windowID; + uint8_t state; + uint8_t repeat; + uint8_t padding2; + uint8_t padding3; + my_SDL2_Keysym_32_t keysym; +} my_SDL2_KeyboardEvent_32_t; + +typedef struct SDL2_TextEditingEvent_32_s { + uint32_t type; + uint32_t timestamp; + uint32_t windowID; + char text[32]; + int32_t start; + int32_t length; +} my_SDL2_TextEditingEvent_32_t; + + +typedef struct SDL2_TextEditingExtEvent_32_s { + uint32_t type; + uint32_t timestamp; + uint32_t windowID; + char* text; + int32_t start; + int32_t length; +} my_SDL2_TextEditingExtEvent_32_t; + +typedef struct SDL2_TextInputEvent_32_s { + uint32_t type; + uint32_t timestamp; + uint32_t windowID; + char text[32]; +} my_SDL2_TextInputEvent_32_t; + +typedef struct SDL2_MouseMotionEvent_32_s { + uint32_t type; + uint32_t timestamp; + uint32_t windowID; + uint32_t which; + uint32_t state; + int32_t x; + int32_t y; + int32_t xrel; + int32_t yrel; +} my_SDL2_MouseMotionEvent_32_t; + +typedef struct SDL2_MouseButtonEvent_32_s { + uint32_t type; + uint32_t timestamp; + uint32_t windowID; + uint32_t which; + uint8_t button; + uint8_t state; + uint8_t clicks; + uint8_t padding1; + int32_t x; + int32_t y; +} my_SDL2_MouseButtonEvent_32_t; + +typedef struct SDL2_MouseWheelEvent_32_s { + uint32_t type; + uint32_t timestamp; + uint32_t windowID; + uint32_t which; + int32_t x; + int32_t y; + uint32_t direction; + float preciseX; + float preciseY; + int32_t mouseX; + int32_t mouseY; +} my_SDL2_MouseWheelEvent_32_t; + +typedef struct SDL2_JoyAxisEvent_32_s { + uint32_t type; + uint32_t timestamp; + int32_t which; + uint8_t axis; + uint8_t padding1; + uint8_t padding2; + uint8_t padding3; + int16_t value; + uint16_t padding4; +} my_SDL2_JoyAxisEvent_32_t; + + +typedef struct SDL2_JoyBallEvent_32_s { + uint32_t type; + uint32_t timestamp; + int32_t which; + uint8_t ball; + uint8_t padding1; + uint8_t padding2; + uint8_t padding3; + int16_t xrel; + int16_t yrel; +} my_SDL2_JoyBallEvent_32_t; + +typedef struct SDL2_JoyHatEvent_32_s { + uint32_t type; + uint32_t timestamp; + int32_t which; + uint8_t hat; + uint8_t value; + uint8_t padding1; + uint8_t padding2; +} my_SDL2_JoyHatEvent_32_t; + +typedef struct SDL2_JoyButtonEvent_32_s { + uint32_t type; + uint32_t timestamp; + int32_t which; + uint8_t button; + uint8_t state; + uint8_t padding1; + uint8_t padding2; +} my_SDL2_JoyButtonEvent_32_t; + +typedef struct SDL2_JoyDeviceEvent_32_s { + uint32_t type; + uint32_t timestamp; + int32_t which; +} my_SDL2_JoyDeviceEvent_32_t; + + +typedef struct SDL2_JoyBatteryEvent_32_s { + uint32_t type; + uint32_t timestamp; + int32_t which; + int32_t level; +} my_SDL2_JoyBatteryEvent_32_t; + +typedef struct SDL2_ControllerAxisEvent_32_s { + uint32_t type; + uint32_t timestamp; + int32_t which; + uint8_t axis; + uint8_t padding1; + uint8_t padding2; + uint8_t padding3; + int16_t value; + uint16_t padding4; +} my_SDL2_ControllerAxisEvent_32_t; + + +typedef struct SDL2_ControllerButtonEvent_32_s { + uint32_t type; + uint32_t timestamp; + int32_t which; + uint8_t button; + uint8_t state; + uint8_t padding1; + uint8_t padding2; +} my_SDL2_ControllerButtonEvent_32_t; + + +typedef struct SDL2_ControllerDeviceEvent_32_s { + uint32_t type; + uint32_t timestamp; + int32_t which; +} my_SDL2_ControllerDeviceEvent_32_t; + +typedef struct SDL2_ControllerTouchpadEvent_32_s { + uint32_t type; + uint32_t timestamp; + int32_t which; + int32_t touchpad; + int32_t finger; + float x; + float y; + float pressure; +} my_SDL2_ControllerTouchpadEvent_32_t; + +typedef struct SDL2_ControllerSensorEvent_32_s { + uint32_t type; + uint32_t timestamp; + int32_t which; + int32_t sensor; + float data[3]; + uint64_t timestamp_us; +} my_SDL2_ControllerSensorEvent_32_t; + +typedef struct SDL2_AudioDeviceEvent_32_s { + uint32_t type; + uint32_t timestamp; + uint32_t which; + uint8_t iscapture; + uint8_t padding1; + uint8_t padding2; + uint8_t padding3; +} my_SDL2_AudioDeviceEvent_32_t; + +typedef struct SDL2_TouchFingerEvent_32_s { + uint32_t type; + uint32_t timestamp; + int64_t touchId; + int64_t fingerId; + float x; + float y; + float dx; + float dy; + float pressure; + uint32_t windowID; +} my_SDL2_TouchFingerEvent_32_t; + +typedef struct SDL2_MultiGestureEvent_32_s { + uint32_t type; + uint32_t timestamp; + int64_t touchId; + float dTheta; + float dDist; + float x; + float y; + uint16_t numFingers; + uint16_t padding; +} my_SDL2_MultiGestureEvent_32_t; + + +typedef struct SDL2_DollarGestureEvent_32_s { + uint32_t type; + uint32_t timestamp; + int64_t touchId; + int64_t gestureId; + uint32_t numFingers; + float error; + float x; + float y; +} my_SDL2_DollarGestureEvent_32_t; + +typedef struct SDL2_DropEvent_32_s { + uint32_t type; + uint32_t timestamp; + ptr_t file; + uint32_t windowID; +} my_SDL2_DropEvent_32_t; + +typedef struct SDL2_SensorEvent_32_s { + uint32_t type; + uint32_t timestamp; + int32_t which; + float data[6]; + uint64_t timestamp_us; +} my_SDL2_SensorEvent_32_t; + + +typedef struct SDL2_QuitEvent_32_s { + uint32_t type; + uint32_t timestamp; +} my_SDL2_QuitEvent_32_t; + + +typedef struct SDL2_UserEvent_32_s { + uint32_t type; + uint32_t timestamp; + uint32_t windowID; + int32_t code; + ptr_t data1; + ptr_t data2; +} my_SDL2_UserEvent_32_t; + +typedef struct SDL2_SysWMEvent_32_s { + uint32_t type; + uint32_t timestamp; + ptr_t msg; +} my_SDL2_SysWMEvent_32_t; + + +typedef union my_SDL2_Event_32_s { + uint32_t type; + my_SDL2_CommonEvent_32_t common; + my_SDL2_DisplayEvent_32_t display; + my_SDL2_WindowEvent_32_t window; + my_SDL2_KeyboardEvent_32_t key; + my_SDL2_TextEditingEvent_32_t edit; + my_SDL2_TextEditingExtEvent_32_t editExt; + my_SDL2_TextInputEvent_32_t text; + my_SDL2_MouseMotionEvent_32_t motion; + my_SDL2_MouseButtonEvent_32_t button; + my_SDL2_MouseWheelEvent_32_t wheel; + my_SDL2_JoyAxisEvent_32_t jaxis; + my_SDL2_JoyBallEvent_32_t jball; + my_SDL2_JoyHatEvent_32_t jhat; + my_SDL2_JoyButtonEvent_32_t jbutton; + my_SDL2_JoyDeviceEvent_32_t jdevice; + my_SDL2_JoyBatteryEvent_32_t jbattery; + my_SDL2_ControllerAxisEvent_32_t caxis; + my_SDL2_ControllerButtonEvent_32_t cbutton; + my_SDL2_ControllerDeviceEvent_32_t cdevice; + my_SDL2_ControllerTouchpadEvent_32_t ctouchpad; + my_SDL2_ControllerSensorEvent_32_t csensor; + my_SDL2_AudioDeviceEvent_32_t adevice; + my_SDL2_SensorEvent_32_t sensor; + my_SDL2_QuitEvent_32_t quit; + my_SDL2_UserEvent_32_t user; + my_SDL2_SysWMEvent_32_t syswm; + my_SDL2_TouchFingerEvent_32_t tfinger; + my_SDL2_MultiGestureEvent_32_t mgesture; + my_SDL2_DollarGestureEvent_32_t dgesture; + my_SDL2_DropEvent_32_t drop; +} my_SDL2_Event_32_t; + +typedef enum SDL2_EventType { + SDL2_FIRSTEVENT = 0, + SDL2_QUIT = 0x100, + SDL2_APP_TERMINATING, + SDL2_APP_LOWMEMORY, + SDL2_APP_WILLENTERBACKGROUND, + SDL2_APP_DIDENTERBACKGROUND, + SDL2_APP_WILLENTERFOREGROUND, + SDL2_APP_DIDENTERFOREGROUND, + SDL2_LOCALECHANGED, + SDL2_DISPLAYEVENT = 0x150, + SDL2_WINDOWEVENT = 0x200, + SDL2_SYSWMEVENT, + SDL2_KEYDOWN = 0x300, + SDL2_KEYUP, + SDL2_TEXTEDITING, + SDL2_TEXTINPUT, + SDL2_KEYMAPCHANGED, + SDL2_TEXTEDITING_EXT, + SDL2_MOUSEMOTION = 0x400, + SDL2_MOUSEBUTTONDOWN, + SDL2_MOUSEBUTTONUP, + SDL2_MOUSEWHEEL, + SDL2_JOYAXISMOTION = 0x600, + SDL2_JOYBALLMOTION, + SDL2_JOYHATMOTION, + SDL2_JOYBUTTONDOWN, + SDL2_JOYBUTTONUP, + SDL2_JOYDEVICEADDED, + SDL2_JOYDEVICEREMOVED, + SDL2_JOYBATTERYUPDATED, + SDL2_CONTROLLERAXISMOTION = 0x650, + SDL2_CONTROLLERBUTTONDOWN, + SDL2_CONTROLLERBUTTONUP, + SDL2_CONTROLLERDEVICEADDED, + SDL2_CONTROLLERDEVICEREMOVED, + SDL2_CONTROLLERDEVICEREMAPPED, + SDL2_CONTROLLERTOUCHPADDOWN, + SDL2_CONTROLLERTOUCHPADMOTION, + SDL2_CONTROLLERTOUCHPADUP, + SDL2_CONTROLLERSENSORUPDATE, + SDL2_CONTROLLERUPDATECOMPLETE_RESERVED_FOR_SDL3, + SDL2_CONTROLLERSTEAMHANDLEUPDATED, + SDL2_FINGERDOWN = 0x700, + SDL2_FINGERUP, + SDL2_FINGERMOTION, + SDL2_DOLLARGESTURE = 0x800, + SDL2_DOLLARRECORD, + SDL2_MULTIGESTURE, + SDL2_CLIPBOARDUPDATE = 0x900, + SDL2_DROPFILE = 0x1000, + SDL2_DROPTEXT, + SDL2_DROPBEGIN, + SDL2_DROPCOMPLETE, + SDL2_AUDIODEVICEADDED = 0x1100, + SDL2_AUDIODEVICEREMOVED, + SDL2_SENSORUPDATE = 0x1200, + SDL2_RENDER_TARGETS_RESET = 0x2000, + SDL2_RENDER_DEVICE_RESET, + SDL2_POLLSENTINEL = 0x7F00, + SDL2_USEREVENT = 0x8000, + SDL2_LASTEVENT = 0xFFFF +} SDL2_EventType; + +void inplace_SDL2_DisplayMode_to_64(void* a); +void inplace_SDL2_DisplayMode_to_32(void* a); + +void convert_SDL2_Event_to_32(void* dst_, const void* src_); +void convert_SDL2_Event_to_64(void* dst_, const void* src_); + +#endif // __MY_SDL2ALIGN32_H_ \ No newline at end of file diff --git a/src/library_list_32.h b/src/library_list_32.h index 8b2cf590..96b33f3b 100644 --- a/src/library_list_32.h +++ b/src/library_list_32.h @@ -13,6 +13,7 @@ GO("libGL.so", libgl) GO("libGL.so.1", libgl) GO("libGLU.so.1", libglu) GO("libSDL-1.2.so.0", sdl1) +GO("libSDL2-2.0.so.0", sdl2) GO("libasound.so.2", libasound) GO("libasound.so", libasound) GO("libfreetype.so.6", freetype) diff --git a/src/libtools/sdl2align32.c b/src/libtools/sdl2align32.c new file mode 100644 index 00000000..83386b9b --- /dev/null +++ b/src/libtools/sdl2align32.c @@ -0,0 +1,132 @@ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <stdint.h> +#include <stddef.h> +#include <wchar.h> +#include <sys/epoll.h> +#include <fts.h> +#include <sys/socket.h> + +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "myalign32.h" +#include "debug.h" +#include "box32.h" +#include "sdl2align32.h" + +void inplace_SDL2_DisplayMode_to_64(void* a) +{ + if (!a) return; + my_SDL2_DisplayMode_32_t* src = a; + my_SDL2_DisplayMode_t* dst = a; + dst->driverdata = from_ptrv(src->driverdata); +} + +void inplace_SDL2_DisplayMode_to_32(void* a) +{ + if (!a) return; + my_SDL2_DisplayMode_t* src = a; + my_SDL2_DisplayMode_32_t* dst = a; + dst->driverdata = to_ptrv(src->driverdata); +} + + +void convert_SDL2_Event_to_32(void* dst_, const void* src_) +{ + if (!src_ || !dst_) return; + const my_SDL2_Event_t* src = src_; + my_SDL2_Event_32_t* dst = dst_; + dst->type = src->type; + switch (src->type) { + case SDL2_WINDOWEVENT: + dst->window.type = src->window.type; + dst->window.timestamp = src->window.timestamp; + dst->window.windowID = src->window.windowID; + dst->window.event = src->window.event; + dst->window.padding1 = src->window.padding1; + dst->window.padding2 = src->window.padding2; + dst->window.padding3 = src->window.padding3; + dst->window.data1 = src->window.data1; + dst->window.data2 = src->window.data2; + break; + case SDL2_MOUSEMOTION: + dst->motion.type = src->motion.type; + dst->motion.timestamp = src->motion.timestamp; + dst->motion.windowID = src->motion.windowID; + dst->motion.which = src->motion.which; + dst->motion.state = src->motion.state; + dst->motion.x = src->motion.x; + dst->motion.y = src->motion.y; + dst->motion.xrel = src->motion.xrel; + dst->motion.yrel = src->motion.yrel; + break; + case SDL2_MOUSEBUTTONDOWN: + case SDL2_MOUSEBUTTONUP: + dst->button.type = src->button.type; + dst->button.timestamp = src->button.timestamp; + dst->button.windowID = src->button.windowID; + dst->button.which = src->button.which; + dst->button.button = src->button.button; + dst->button.state = src->button.state; + dst->button.clicks = src->button.clicks; + dst->button.padding1 = src->button.padding1; + dst->button.x = src->button.x; + dst->button.y = src->button.y; + break; + case SDL2_AUDIODEVICEADDED: + case SDL2_AUDIODEVICEREMOVED: + dst->adevice.type = src->adevice.type; + dst->adevice.timestamp = src->adevice.timestamp; + dst->adevice.which = src->adevice.which; + dst->adevice.iscapture = src->adevice.iscapture; + dst->adevice.padding1 = src->adevice.padding1; + dst->adevice.padding2 = src->adevice.padding2; + dst->adevice.padding3 = src->adevice.padding3; + break; + case SDL2_KEYDOWN: + case SDL2_KEYUP: + dst->key.type = src->key.type; + dst->key.timestamp = src->key.timestamp; + dst->key.windowID = src->key.windowID; + dst->key.state = src->key.state; + dst->key.repeat = src->key.repeat; + dst->key.padding2 = src->key.padding2; + dst->key.padding3 = src->key.padding3; + dst->key.keysym.scancode = src->key.keysym.scancode; + dst->key.keysym.sym = src->key.keysym.sym; + dst->key.keysym.mod = src->key.keysym.mod; + dst->key.keysym.unused = src->key.keysym.unused; + break; + case SDL2_TEXTEDITING: + dst->edit.type = src->edit.type; + dst->edit.timestamp = src->edit.timestamp; + dst->edit.windowID = src->edit.windowID; + memcpy(dst->edit.text, src->edit.text, 32); + dst->edit.start = src->edit.start; + dst->edit.length = src->edit.length; + break; + case SDL2_TEXTINPUT: + dst->text.type = src->text.type; + dst->text.timestamp = src->text.timestamp; + dst->text.windowID = src->text.windowID; + memcpy(dst->text.text, src->text.text, 32); + break; + case SDL2_MOUSEWHEEL: + dst->wheel.type = src->wheel.type; + dst->wheel.timestamp = src->wheel.timestamp; + dst->wheel.windowID = src->wheel.windowID; + dst->wheel.which = src->wheel.which; + dst->wheel.x = src->wheel.x; + dst->wheel.y = src->wheel.y; + dst->wheel.direction = src->wheel.direction; + dst->wheel.preciseX = src->wheel.preciseX; + dst->wheel.preciseY = src->wheel.preciseY; + dst->wheel.mouseX = src->wheel.mouseX; + dst->wheel.mouseY = src->wheel.mouseY; + break; + default: + printf_log(LOG_INFO, "Warning, unsuported SDL2 event %d\n", src->type); + memcpy(dst, src, sizeof(my_SDL2_Event_32_t)); + } +} \ No newline at end of file diff --git a/src/wrapped32/generated/functions_list.txt b/src/wrapped32/generated/functions_list.txt index bad10ad2..a87df0f7 100644 --- a/src/wrapped32/generated/functions_list.txt +++ b/src/wrapped32/generated/functions_list.txt @@ -380,6 +380,7 @@ #() pFulu -> pFulu #() pFupp -> pFupp #() pFpii -> pFpii +#() pFpiu -> pFpiu #() pFpiL -> pFpiL #() pFpiS -> pFpiS #() pFpuL -> pFpuL @@ -698,6 +699,7 @@ #() iFiLLLL -> iFiLLLL #() iFipLLi -> iFipLLi #() iFuiuup -> iFuiuup +#() iFpCCCC -> iFpCCCC #() iFpLuLi -> iFpLuLi #() iFpppip -> iFpppip #() iFpppup -> iFpppup @@ -715,6 +717,7 @@ #() pFuiupp -> pFuiupp #() pFpiiuu -> pFpiiuu #() pFpippp -> pFpippp +#() pFpuiii -> pFpuiii #() pFppuup -> pFppuup #() pFppupp -> pFppupp #() pFXpipi -> pFXpipi @@ -812,6 +815,7 @@ #() pFEpiiuu -> pFEpiiuu #() pFEpLLiN -> pFEpLLiN #() pFEppLLp -> pFEppLLp +#() pFpiiiiu -> pFpiiiiu #() vFiiiiiip -> vFiiiiiip #() vFiiiiuup -> vFiiiiuup #() vFiiuilil -> vFiiuilil @@ -1559,3 +1563,11 @@ wrappedsdl1: - SDL_GetRGB - iFpWCiWCi: - SDL_BuildAudioCVT +wrappedsdl2: +% G SDL_JoystickGUID UU +- iFp: + - SDL_PollEvent +- iFip: + - SDL_GetDesktopDisplayMode +- iFpp: + - SDL_OpenAudio diff --git a/src/wrapped32/generated/wrappedsdl2defs32.h b/src/wrapped32/generated/wrappedsdl2defs32.h new file mode 100644 index 00000000..239a09b9 --- /dev/null +++ b/src/wrapped32/generated/wrappedsdl2defs32.h @@ -0,0 +1,8 @@ +/****************************************************************** + * File automatically generated by rebuild_wrappers_32.py (v0.0.1.1) * + ******************************************************************/ +#ifndef __wrappedsdl2DEFS32_H_ +#define __wrappedsdl2DEFS32_H_ + + +#endif // __wrappedsdl2DEFS32_H_ diff --git a/src/wrapped32/generated/wrappedsdl2types32.h b/src/wrapped32/generated/wrappedsdl2types32.h new file mode 100644 index 00000000..e6ad5bc7 --- /dev/null +++ b/src/wrapped32/generated/wrappedsdl2types32.h @@ -0,0 +1,23 @@ +/****************************************************************** + * File automatically generated by rebuild_wrappers_32.py (v0.0.1.1) * + ******************************************************************/ +#ifndef __wrappedsdl2TYPES32_H_ +#define __wrappedsdl2TYPES32_H_ + +#ifndef LIBNAME +#error You should only #include this file inside a wrapped*.c file +#endif +#ifndef ADDED_FUNCTIONS +#define ADDED_FUNCTIONS() +#endif + +typedef int32_t (*iFp_t)(void*); +typedef int32_t (*iFip_t)(int32_t, void*); +typedef int32_t (*iFpp_t)(void*, void*); + +#define SUPER() ADDED_FUNCTIONS() \ + GO(SDL_PollEvent, iFp_t) \ + GO(SDL_GetDesktopDisplayMode, iFip_t) \ + GO(SDL_OpenAudio, iFpp_t) + +#endif // __wrappedsdl2TYPES32_H_ diff --git a/src/wrapped32/generated/wrappedsdl2undefs32.h b/src/wrapped32/generated/wrappedsdl2undefs32.h new file mode 100644 index 00000000..71be2e55 --- /dev/null +++ b/src/wrapped32/generated/wrappedsdl2undefs32.h @@ -0,0 +1,8 @@ +/****************************************************************** + * File automatically generated by rebuild_wrappers_32.py (v0.0.1.1) * + ******************************************************************/ +#ifndef __wrappedsdl2UNDEFS32_H_ +#define __wrappedsdl2UNDEFS32_H_ + + +#endif // __wrappedsdl2UNDEFS32_H_ diff --git a/src/wrapped32/generated/wrapper32.c b/src/wrapped32/generated/wrapper32.c index 19035415..3af71f8c 100644 --- a/src/wrapped32/generated/wrapper32.c +++ b/src/wrapped32/generated/wrapper32.c @@ -470,6 +470,7 @@ typedef void* (*pFipL_t)(int32_t, void*, uintptr_t); typedef void* (*pFulu_t)(uint32_t, intptr_t, uint32_t); typedef void* (*pFupp_t)(uint32_t, void*, void*); typedef void* (*pFpii_t)(void*, int32_t, int32_t); +typedef void* (*pFpiu_t)(void*, int32_t, uint32_t); typedef void* (*pFpiL_t)(void*, int32_t, uintptr_t); typedef void* (*pFpiS_t)(void*, int32_t, void*); typedef void* (*pFpuL_t)(void*, uint32_t, uintptr_t); @@ -788,6 +789,7 @@ typedef int32_t (*iFiiipp_t)(int32_t, int32_t, int32_t, void*, void*); typedef int32_t (*iFiLLLL_t)(int32_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); typedef int32_t (*iFipLLi_t)(int32_t, void*, uintptr_t, uintptr_t, int32_t); typedef int32_t (*iFuiuup_t)(uint32_t, int32_t, uint32_t, uint32_t, void*); +typedef int32_t (*iFpCCCC_t)(void*, uint8_t, uint8_t, uint8_t, uint8_t); typedef int32_t (*iFpLuLi_t)(void*, uintptr_t, uint32_t, uintptr_t, int32_t); typedef int32_t (*iFpppip_t)(void*, void*, void*, int32_t, void*); typedef int32_t (*iFpppup_t)(void*, void*, void*, uint32_t, void*); @@ -805,6 +807,7 @@ typedef void* (*pFEXipp_t)(x64emu_t*, void*, int32_t, void*, void*); typedef void* (*pFuiupp_t)(uint32_t, int32_t, uint32_t, void*, void*); typedef void* (*pFpiiuu_t)(void*, int32_t, int32_t, uint32_t, uint32_t); typedef void* (*pFpippp_t)(void*, int32_t, void*, void*, void*); +typedef void* (*pFpuiii_t)(void*, uint32_t, int32_t, int32_t, int32_t); typedef void* (*pFppuup_t)(void*, void*, uint32_t, uint32_t, void*); typedef void* (*pFppupp_t)(void*, void*, uint32_t, void*, void*); typedef void* (*pFXpipi_t)(void*, void*, int32_t, void*, int32_t); @@ -902,6 +905,7 @@ typedef intptr_t (*lFipLipp_t)(int32_t, void*, uintptr_t, int32_t, void*, void*) typedef void* (*pFEpiiuu_t)(x64emu_t*, void*, int32_t, int32_t, uint32_t, uint32_t); typedef void* (*pFEpLLiN_t)(x64emu_t*, void*, uintptr_t, uintptr_t, int32_t, ...); typedef void* (*pFEppLLp_t)(x64emu_t*, void*, void*, uintptr_t, uintptr_t, void*); +typedef void* (*pFpiiiiu_t)(void*, int32_t, int32_t, int32_t, int32_t, uint32_t); typedef void (*vFiiiiiip_t)(int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, void*); typedef void (*vFiiiiuup_t)(int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, void*); typedef void (*vFiiuilil_t)(int32_t, int32_t, uint32_t, int32_t, intptr_t, int32_t, intptr_t); @@ -1499,6 +1503,7 @@ void pFipL_32(x64emu_t *emu, uintptr_t fcn) { pFipL_t fn = (pFipL_t)fcn; R_EAX = void pFulu_32(x64emu_t *emu, uintptr_t fcn) { pFulu_t fn = (pFulu_t)fcn; R_EAX = to_ptrv(fn(from_ptri(uint32_t, R_ESP + 4), to_long(from_ptri(long_t, R_ESP + 8)), from_ptri(uint32_t, R_ESP + 12))); } void pFupp_32(x64emu_t *emu, uintptr_t fcn) { pFupp_t fn = (pFupp_t)fcn; R_EAX = to_ptrv(fn(from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12))); } void pFpii_32(x64emu_t *emu, uintptr_t fcn) { pFpii_t fn = (pFpii_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12))); } +void pFpiu_32(x64emu_t *emu, uintptr_t fcn) { pFpiu_t fn = (pFpiu_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12))); } void pFpiL_32(x64emu_t *emu, uintptr_t fcn) { pFpiL_t fn = (pFpiL_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), to_ulong(from_ptri(ulong_t, R_ESP + 12)))); } void pFpiS_32(x64emu_t *emu, uintptr_t fcn) { pFpiS_t fn = (pFpiS_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), io_convert32(from_ptriv(R_ESP + 12)))); } void pFpuL_32(x64emu_t *emu, uintptr_t fcn) { pFpuL_t fn = (pFpuL_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), to_ulong(from_ptri(ulong_t, R_ESP + 12)))); } @@ -1817,6 +1822,7 @@ void iFiiipp_32(x64emu_t *emu, uintptr_t fcn) { iFiiipp_t fn = (iFiiipp_t)fcn; R void iFiLLLL_32(x64emu_t *emu, uintptr_t fcn) { iFiLLLL_t fn = (iFiLLLL_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), to_ulong(from_ptri(ulong_t, R_ESP + 8)), to_ulong(from_ptri(ulong_t, R_ESP + 12)), to_ulong(from_ptri(ulong_t, R_ESP + 16)), to_ulong(from_ptri(ulong_t, R_ESP + 20))); } void iFipLLi_32(x64emu_t *emu, uintptr_t fcn) { iFipLLi_t fn = (iFipLLi_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), to_ulong(from_ptri(ulong_t, R_ESP + 12)), to_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptri(int32_t, R_ESP + 20)); } void iFuiuup_32(x64emu_t *emu, uintptr_t fcn) { iFuiuup_t fn = (iFuiuup_t)fcn; R_EAX = fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); } +void iFpCCCC_32(x64emu_t *emu, uintptr_t fcn) { iFpCCCC_t fn = (iFpCCCC_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptri(uint8_t, R_ESP + 8), from_ptri(uint8_t, R_ESP + 12), from_ptri(uint8_t, R_ESP + 16), from_ptri(uint8_t, R_ESP + 20)); } void iFpLuLi_32(x64emu_t *emu, uintptr_t fcn) { iFpLuLi_t fn = (iFpLuLi_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), to_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(uint32_t, R_ESP + 12), to_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptri(int32_t, R_ESP + 20)); } void iFpppip_32(x64emu_t *emu, uintptr_t fcn) { iFpppip_t fn = (iFpppip_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); } void iFpppup_32(x64emu_t *emu, uintptr_t fcn) { iFpppup_t fn = (iFpppup_t)fcn; R_EAX = fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptriv(R_ESP + 20)); } @@ -1834,6 +1840,7 @@ void pFEXipp_32(x64emu_t *emu, uintptr_t fcn) { pFEXipp_t fn = (pFEXipp_t)fcn; R void pFuiupp_32(x64emu_t *emu, uintptr_t fcn) { pFuiupp_t fn = (pFuiupp_t)fcn; R_EAX = to_ptrv(fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20))); } void pFpiiuu_32(x64emu_t *emu, uintptr_t fcn) { pFpiiuu_t fn = (pFpiiuu_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20))); } void pFpippp_32(x64emu_t *emu, uintptr_t fcn) { pFpippp_t fn = (pFpippp_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20))); } +void pFpuiii_32(x64emu_t *emu, uintptr_t fcn) { pFpuiii_t fn = (pFpuiii_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20))); } void pFppuup_32(x64emu_t *emu, uintptr_t fcn) { pFppuup_t fn = (pFppuup_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptriv(R_ESP + 20))); } void pFppupp_32(x64emu_t *emu, uintptr_t fcn) { pFppupp_t fn = (pFppupp_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20))); } void pFXpipi_32(x64emu_t *emu, uintptr_t fcn) { pFXpipi_t fn = (pFXpipi_t)fcn; R_EAX = to_ptrv(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(int32_t, R_ESP + 20))); } @@ -1931,6 +1938,7 @@ void lFipLipp_32(x64emu_t *emu, uintptr_t fcn) { lFipLipp_t fn = (lFipLipp_t)fcn void pFEpiiuu_32(x64emu_t *emu, uintptr_t fcn) { pFEpiiuu_t fn = (pFEpiiuu_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20))); } void pFEpLLiN_32(x64emu_t *emu, uintptr_t fcn) { pFEpLLiN_t fn = (pFEpLLiN_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), to_ulong(from_ptri(ulong_t, R_ESP + 8)), to_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20))); } void pFEppLLp_32(x64emu_t *emu, uintptr_t fcn) { pFEppLLp_t fn = (pFEppLLp_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), to_ulong(from_ptri(ulong_t, R_ESP + 12)), to_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ptriv(R_ESP + 20))); } +void pFpiiiiu_32(x64emu_t *emu, uintptr_t fcn) { pFpiiiiu_t fn = (pFpiiiiu_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24))); } void vFiiiiiip_32(x64emu_t *emu, uintptr_t fcn) { vFiiiiiip_t fn = (vFiiiiiip_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptriv(R_ESP + 28)); } void vFiiiiuup_32(x64emu_t *emu, uintptr_t fcn) { vFiiiiuup_t fn = (vFiiiiuup_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptriv(R_ESP + 28)); } void vFiiuilil_32(x64emu_t *emu, uintptr_t fcn) { vFiiuilil_t fn = (vFiiuilil_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), to_long(from_ptri(long_t, R_ESP + 20)), from_ptri(int32_t, R_ESP + 24), to_long(from_ptri(long_t, R_ESP + 28))); } diff --git a/src/wrapped32/generated/wrapper32.h b/src/wrapped32/generated/wrapper32.h index dc1b4880..aa1c8e53 100644 --- a/src/wrapped32/generated/wrapper32.h +++ b/src/wrapped32/generated/wrapper32.h @@ -421,6 +421,7 @@ void pFipL_32(x64emu_t *emu, uintptr_t fnc); void pFulu_32(x64emu_t *emu, uintptr_t fnc); void pFupp_32(x64emu_t *emu, uintptr_t fnc); void pFpii_32(x64emu_t *emu, uintptr_t fnc); +void pFpiu_32(x64emu_t *emu, uintptr_t fnc); void pFpiL_32(x64emu_t *emu, uintptr_t fnc); void pFpiS_32(x64emu_t *emu, uintptr_t fnc); void pFpuL_32(x64emu_t *emu, uintptr_t fnc); @@ -739,6 +740,7 @@ void iFiiipp_32(x64emu_t *emu, uintptr_t fnc); void iFiLLLL_32(x64emu_t *emu, uintptr_t fnc); void iFipLLi_32(x64emu_t *emu, uintptr_t fnc); void iFuiuup_32(x64emu_t *emu, uintptr_t fnc); +void iFpCCCC_32(x64emu_t *emu, uintptr_t fnc); void iFpLuLi_32(x64emu_t *emu, uintptr_t fnc); void iFpppip_32(x64emu_t *emu, uintptr_t fnc); void iFpppup_32(x64emu_t *emu, uintptr_t fnc); @@ -756,6 +758,7 @@ void pFEXipp_32(x64emu_t *emu, uintptr_t fnc); void pFuiupp_32(x64emu_t *emu, uintptr_t fnc); void pFpiiuu_32(x64emu_t *emu, uintptr_t fnc); void pFpippp_32(x64emu_t *emu, uintptr_t fnc); +void pFpuiii_32(x64emu_t *emu, uintptr_t fnc); void pFppuup_32(x64emu_t *emu, uintptr_t fnc); void pFppupp_32(x64emu_t *emu, uintptr_t fnc); void pFXpipi_32(x64emu_t *emu, uintptr_t fnc); @@ -853,6 +856,7 @@ void lFipLipp_32(x64emu_t *emu, uintptr_t fnc); void pFEpiiuu_32(x64emu_t *emu, uintptr_t fnc); void pFEpLLiN_32(x64emu_t *emu, uintptr_t fnc); void pFEppLLp_32(x64emu_t *emu, uintptr_t fnc); +void pFpiiiiu_32(x64emu_t *emu, uintptr_t fnc); void vFiiiiiip_32(x64emu_t *emu, uintptr_t fnc); void vFiiiiuup_32(x64emu_t *emu, uintptr_t fnc); void vFiiuilil_32(x64emu_t *emu, uintptr_t fnc); diff --git a/src/wrapped32/wrappedsdl1.c b/src/wrapped32/wrappedsdl1.c index e4c1b3d7..a3a727c8 100644 --- a/src/wrapped32/wrappedsdl1.c +++ b/src/wrapped32/wrappedsdl1.c @@ -182,14 +182,16 @@ EXPORT int my32_SDL_OpenAudio(x64emu_t* emu, void* d, void* o) return ret; } // put back stuff in place? - SDL_AudioSpec32* o_ = o; - o_->channels = output.channels; - o_->format = output.format; - o_->freq = output.freq; - o_->samples = output.samples; - o_->silence = output.silence; - o_->size = output.size; - o_->userdata = o_->callback = 0; + if (o) { + SDL_AudioSpec32* o_ = o; + o_->channels = output.channels; + o_->format = output.format; + o_->freq = output.freq; + o_->samples = output.samples; + o_->silence = output.silence; + o_->size = output.size; + o_->userdata = o_->callback = 0; + } return ret; } diff --git a/src/wrapped32/wrappedsdl2.c b/src/wrapped32/wrappedsdl2.c new file mode 100644 index 00000000..7e2e6f26 --- /dev/null +++ b/src/wrapped32/wrappedsdl2.c @@ -0,0 +1,150 @@ +#include "sdl2align32.h" +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include <dlfcn.h> + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper32.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "librarian.h" +#include "box32context.h" +#include "emu/x64emu_private.h" + +#include "x64trace.h" +#include "threads.h" + +#include "sdl2align32.h" + +extern const char* sdl2Name; +#define LIBNAME sdl2 + +typedef struct { + int32_t freq; + uint16_t format; + uint8_t channels; + uint8_t silence; + uint16_t samples; + uint16_t padding; + uint32_t size; + void (*callback)(void* userdata, uint8_t* stream, int32_t len); + void* userdata; +} SDL2_AudioSpec; + +typedef struct { + int32_t freq; + uint16_t format; + uint8_t channels; + uint8_t silence; + uint16_t samples; + uint16_t padding; + uint32_t size; + ptr_t callback; // void (*callback)(void *userdata, uint8_t *stream, int32_t len); + ptr_t userdata; // void *userdata; +} SDL2_AudioSpec32; + +#define ADDED_FUNCTIONS() + +#define ADDED_FINI() + +#include "generated/wrappedsdl2types32.h" +#include "wrappercallback32.h" + +#define SUPER() \ + GO(0) \ + GO(1) \ + GO(2) \ + GO(3) \ + GO(4) + + +// AudioCallback +#define GO(A) \ + static uintptr_t my32_2_AudioCallback_fct_##A = 0; \ + static void my32_2_AudioCallback_##A(void* a, void* b, int c) \ + { \ + RunFunctionFmt(my32_2_AudioCallback_fct_##A, "ppi", a, b, c); \ + } +SUPER() +#undef GO +static void* find_AudioCallback_Fct(void* fct) +{ + if (!fct) return NULL; + void* p; + if ((p = GetNativeFnc((uintptr_t)fct))) return p; +#define GO(A) \ + if (my32_2_AudioCallback_fct_##A == (uintptr_t)fct) return my32_2_AudioCallback_##A; + SUPER() +#undef GO +#define GO(A) \ + if (my32_2_AudioCallback_fct_##A == 0) { \ + my32_2_AudioCallback_fct_##A = (uintptr_t)fct; \ + return my32_2_AudioCallback_##A; \ + } + SUPER() +#undef GO + printf_log(LOG_NONE, "Warning, no more slot for 32bit SDL2 AudioCallback callback\n"); + return NULL; +} + +EXPORT int my32_2_SDL_GetDesktopDisplayMode(int displayIndex, void* mode) +{ + inplace_SDL2_DisplayMode_to_64(mode); + int ret = my->SDL_GetDesktopDisplayMode(displayIndex, mode); + inplace_SDL2_DisplayMode_to_32(mode); + return ret; +} + +EXPORT int my32_2_SDL_OpenAudio(x64emu_t* emu, void* d, void* o) +{ + SDL2_AudioSpec desired = { 0 }; + SDL2_AudioSpec output = { 0 }; + SDL2_AudioSpec32* d_ = d; + desired.channels = d_->channels; + desired.format = d_->format; + desired.freq = d_->freq; + desired.samples = d_->samples; + desired.padding = d_->padding; + desired.silence = d_->silence; + desired.size = d_->size; + desired.userdata = from_ptrv(d_->userdata); + desired.callback = find_AudioCallback_Fct(from_ptrv(d_->callback)); + int ret = my->SDL_OpenAudio(&desired, &output); + if (ret != 0) { + return ret; + } + // put back stuff in place? + if (o) { + SDL2_AudioSpec32* o_ = o; + o_->channels = output.channels; + o_->format = output.format; + o_->freq = output.freq; + o_->samples = output.samples; + o_->padding = output.padding; + o_->silence = output.silence; + o_->size = output.size; + o_->userdata = o_->callback = 0; + } + return ret; +} + +EXPORT int my32_2_SDL_PollEvent(my_SDL2_Event_32_t* evt) +{ + my_SDL2_Event_t event; + int ret = my->SDL_PollEvent(evt ? (&event) : NULL); + if (ret && evt) { + convert_SDL2_Event_to_32(evt, &event); + } + return ret; +} + +#define ALTMY my32_2_ + +#include "wrappedlib_init32.h" \ No newline at end of file diff --git a/src/wrapped32/wrappedsdl2_private.h b/src/wrapped32/wrappedsdl2_private.h new file mode 100644 index 00000000..cb423016 --- /dev/null +++ b/src/wrapped32/wrappedsdl2_private.h @@ -0,0 +1,749 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) +#error Meh! +#endif + +//%S G SDL_JoystickGUID UU +// SDL_GUID is struct uin8_t data[16] => UU when in args, H when is return + +// _fini +// _init +// GO(SDL_abs, iFi) +// GO(SDL_acos, dFd) +// GO(SDL_acosf, fFf) +// GOM(SDL_AddEventWatch, vFEpp) +// SDL_AddHintCallback +// GOM(SDL_AddTimer, pFEupp) +// GO(SDL_AllocFormat, pFu) +// GO(SDL_AllocPalette, pFi) +// GO(SDL_AllocRW, pFv) // no need to create a "my_" probably +// GO(SDL_asin, dFd) +// GO(SDL_asinf, fFf) +// GO(SDL_atan, dFd) +// GO(SDL_atan2, dFdd) +// GO(SDL_atan2f, fFff) +// GO(SDL_atanf, fFf) +// GO(SDL_atof, dFp) +// GO(SDL_atoi, iFp) +// GO(SDL_AtomicAdd, iFpi) +// GO(SDL_AtomicCAS, uFpii) +// GO(SDL_AtomicCASPtr, uFppp) +// GO(SDL_AtomicGet, iFp) +// GO(SDL_AtomicGetPtr, pFp) +// GO(SDL_AtomicLock, vFp) +// GO(SDL_AtomicSet, iFpi) +// GO(SDL_AtomicSetPtr, pFpp) +// GO(SDL_AtomicTryLock, uFp) +// GO(SDL_AtomicUnlock, vFp) +// GO(SDL_AudioInit, iFp) +GO(SDL_AudioQuit, vFv) +// GO(SDL_AudioStreamAvailable, iFp) +// GO(SDL_AudioStreamClear, vFp) +// GO(SDL_AudioStreamFlush, iFp) +// GO(SDL_AudioStreamGet, iFppi) +// GO(SDL_AudioStreamPut, iFppi) +// GO(SDL_BuildAudioCVT, iFpWCiWCi) +// GO(SDL_CalculateGammaRamp, vFfp) +// GO(SDL_calloc, pFLL) +// GO(SDL_CaptureMouse, iFu) +// GO(SDL_ceil, dFd) +// GO(SDL_ceilf, fFf) +// GO(SDL_ClearError, vFv) +// GO(SDL_ClearHints, vFv) +// GO(SDL_ClearQueuedAudio, vFu) +GO(SDL_CloseAudio, vFv) +// GO(SDL_CloseAudioDevice, vFu) +// GO(SDL_ComposeCustomBlendMode, uFuuuuuu) +// GO(SDL_CondBroadcast, iFp) +// GO(SDL_CondSignal, iFp) +// GO(SDL_CondWait, iFpp) +// GO(SDL_CondWaitTimeout, iFppu) +// GO(SDL_ConvertAudio, iFp) +// GO(SDL_ConvertPixels, iFiiupiupi) +// GO(SDL_ConvertSurface, pFppu) +// GO(SDL_ConvertSurfaceFormat, pFpuu) +// GO(SDL_copysign, dFdd) +// GO(SDL_copysignf, fFff) +// GO(SDL_cos, dFd) +// GO(SDL_cosf, fFf) +// GO(SDL_CreateColorCursor, pFpii) +// GO(SDL_CreateCond, pFv) +// GO(SDL_CreateCursor, pFppiiii) +// GO(SDL_CreateMutex, pFv) +GO(SDL_CreateRenderer, pFpiu) +// GO(SDL_CreateRGBSurface, pFuiiiuuuu) +// GO(SDL_CreateRGBSurfaceFrom, pFpiiiiuuuu) +// GO(SDL_CreateRGBSurfaceWithFormat, pFuiiiu) +// GO(SDL_CreateRGBSurfaceWithFormatFrom, pFpiiiiu) +// GO(SDL_CreateSemaphore, pFu) +// GO(SDL_CreateShapedWindow, pFpuuuuu) +// GO(SDL_CreateSoftwareRenderer, pFp) +// GO(SDL_CreateSystemCursor, pFu) +GO(SDL_CreateTexture, pFpuiii) +// GO(SDL_CreateTextureFromSurface, pFpp) +// GOM(SDL_CreateThread, pFEppp) +// SDL_CreateThreadWithStackSize +GO(SDL_CreateWindow, pFpiiiiu) +// GO(SDL_CreateWindowAndRenderer, iFiiupp) +// GO(SDL_CreateWindowFrom, pFp) +GO(SDL_Delay, vFu) +// GOM(SDL_DelEventWatch, vFEpp) +// SDL_DelHintCallback +// GO(SDL_DequeueAudio, uFupu) +// GO(SDL_DestroyCond, vFp) +// GO(SDL_DestroyMutex, vFp) +// GO(SDL_DestroyRenderer, vFp) +// GO(SDL_DestroySemaphore, vFp) +// GO(SDL_DestroyTexture, vFp) +// GO(SDL_DestroyWindow, vFp) +// GO(SDL_DestroyWindowSurface, iFp) +// GO(SDL_DetachThread, vFp) +// GO(SDL_DisableScreenSaver, vFv) +// GO(SDL_DuplicateSurface, pFp) +// GOM(SDL_DYNAPI_entry, iFEupu) +// GO(SDL_EnableScreenSaver, vFv) +// GO(SDL_EnclosePoints, uFpipp) +// GO(SDL_Error, iFu) +// GO(SDL_EventState, CFui) +// GO(SDL_exp, dFd) +// GO(SDL_expf, fFf) +// GO(SDL_fabs, dFd) +// GO(SDL_fabsf, fFf) +// GO(SDL_FillRect, iFppu) +// GO(SDL_FillRects, iFppiu) +// SDL_FilterEvents +// GO(SDL_floor, dFd) +// GO(SDL_floorf,fFf) +// GO(SDL_FlushEvent, vFu) +// GO(SDL_FlushEvents, vFuu) +// GO(SDL_fmod, dFdd) +// GO(SDL_fmodf, fFff) +GO(SDL_free, vFp) +// GO(SDL_FreeAudioStream, vFp) +// GO(SDL_FreeCursor, vFp) +// GO(SDL_FreeFormat, vFp) +// GO(SDL_FreePalette, vFp) +// GO(SDL_FreeRW, vFp) +// GO(SDL_FreeSurface, vFp) +// GO(SDL_FreeWAV, vFp) +// GO(SDL_GameControllerAddMapping, iFp) +// GOM(SDL_GameControllerAddMappingsFromRW, iFEpi) +// GO(SDL_GameControllerClose, vFp) +GO(SDL_GameControllerEventState, iFi) +// GO(SDL_GameControllerFromInstanceID, pFi) +// GO(SDL_GameControllerFromPlayerIndex, pFi) +// GO(SDL_GameControllerGetAttached, iFp) +// GO(SDL_GameControllerGetAxis, wFpi) +// GO(SDL_GameControllerGetAxisFromString, iFp) +// GO(SDL_GameControllerGetBindForAxis, HFpi) +// GO(SDL_GameControllerGetBindForButton, HFpi) +// GO(SDL_GameControllerGetButton, CFpi) +// GO(SDL_GameControllerGetButtonFromString, iFp) +// GO(SDL_GameControllerGetFirmwareVersion, WFp) +// GO(SDL_GameControllerGetJoystick, pFp) +// GO(SDL_GameControllerGetNumTouchpads, iFp) +// GO(SDL_GameControllerGetNumTouchpadFingers, iFpi) +// GO(SDL_GameControllerGetPlayerIndex, iFp) +// GO(SDL_GameControllerGetProduct, WFp) +// GO(SDL_GameControllerGetProductVersion, WFp) +// GO(SDL_GameControllerGetSensorData, iFpipi) +// GO(SDL_GameControllerGetSensorDataWithTimestamp, iFpippi) +// GO(SDL_GameControllerGetSerial, pFp) +// GO(SDL_GameControllerGetStringForAxis, pFi) +// GO(SDL_GameControllerGetStringForButton, pFi) +// GO(SDL_GameControllerGetTouchpadFinger, iFpiipppp) +// GO(SDL_GameControllerGetType, uFp) +// GO(SDL_GameControllerGetVendor, WFp) +// GO(SDL_GameControllerHasButton, uFpi) +// GO(SDL_GameControllerHasLED, iFp) +// GO(SDL_GameControllerHasRumble, iFp) +// GO(SDL_GameControllerHasSensor, iFpi) +// GO(SDL_GameControllerIsSensorEnabled, uFpi) +// GO(SDL_GameControllerMapping, pFp) +// GO(SDL_GameControllerMappingForDeviceIndex, pFi) +// GO(SDL_GameControllerMappingForGUID, pFpp) +// GO(SDL_GameControllerMappingForIndex, pFi) +// GO(SDL_GameControllerName, pFp) +// GO(SDL_GameControllerNameForIndex, pFi) +// GO(SDL_GameControllerNumMappings, iFv) +// GO(SDL_GameControllerOpen, pFi) +// GO(SDL_GameControllerPath, pFp) +// GO(SDL_GameControllerPathForIndex, pFi) +// GO(SDL_GameControllerRumble, iFpWWu) +// GO(SDL_GameControllerRumbleTriggers, iFpWWu) +// GO(SDL_GameControllerSetLED, iFpCCC) +// GO(SDL_GameControllerSetPlayerIndex, vFpi) +// GO(SDL_GameControllerSetSensorEnabled, iFpiu) +// GO(SDL_GameControllerTypeForIndex, uFi) +// GO(SDL_GameControllerUpdate, vFv) +// SDL_GetAssertionHandler +// GO(SDL_GetAssertionReport, pFv) +// GO(SDL_GetAudioDeviceName, pFii) +// GO(SDL_GetAudioDeviceStatus, uFu) +// GO(SDL_GetAudioDriver, pFi) +// GO(SDL_GetAudioDeviceSpec, iFiip) +// GO(SDL_GetAudioStatus, uFv) +// GOM(SDL_GetBasePath, pFEv) +// GO(SDL_GetClipboardText, pFv) +// GO(SDL_GetClipRect, vFpp) +// GO(SDL_GetClosestDisplayMode, pFipp) +// GO(SDL_GetColorKey, iFpp) +// GO(SDL_GetCPUCacheLineSize, iFv) +// GO(SDL_GetCPUCount, iFv) +// GO(SDL_GetCurrentAudioDriver, pFv) +// GO(SDL_GetCurrentDisplayMode, iFip) +// GO(SDL_GetCurrentVideoDriver, pFv) +// GO(SDL_GetCursor, pFv) +// SDL_GetDefaultAssertionHandler +// GO(SDL_GetDefaultAudioInfo, iFppi) +// GO(SDL_GetDefaultCursor, pFv) +GOM(SDL_GetDesktopDisplayMode, iFEip) +// GO(SDL_GetDisplayBounds, iFip) +// GO(SDL_GetDisplayDPI, iFippp) +// GO(SDL_GetDisplayMode, iFiip) +// GO(SDL_GetDisplayName, pFi) +// GO(SDL_GetDisplayOrientation, uFi) +// GO(SDL_GetDisplayUsableBounds, iFip) +// GO(SDL_getenv, pFp) +// GO(SDL_GetError, pFv) +// GOM(SDL_GetEventFilter, iFEpp) +// GO(SDL_GetGlobalMouseState, uFpp) +// GO(SDL_GetGrabbedWindow, pFv) +// GO(SDL_GetHint, pFp) +// GO(SDL_GetHintBoolean, uFpu) +// GOM(SDL_GetJoystickGUIDInfo, vFGpppp) +// GO(SDL_GetKeyboardFocus, pFv) +// GO(SDL_GetKeyboardState, pFp) +// GO(SDL_GetKeyFromName, iFp) +// GO(SDL_GetKeyFromScancode, iFu) +// GO(SDL_GetKeyName, pFi) +// GO(SDL_GetMemoryFunctions, vFpppp) +// GO(SDL_GetModState, uFv) +// GO(SDL_GetMouseFocus, pFv) +GO(SDL_GetMouseState, uFpp) +// GO(SDL_GetNumAllocations, iFv) +// GO(SDL_GetNumAudioDevices, iFi) +// GO(SDL_GetNumAudioDrivers, iFv) +// GO(SDL_GetNumDisplayModes, iFi) +// GO(SDL_GetNumRenderDrivers, iFv) +// GO(SDL_GetNumTouchDevices, iFv) +// GO(SDL_GetNumTouchFingers, iFu) +// GO(SDL_GetNumVideoDisplays, iFv) +// GO(SDL_GetNumVideoDrivers, iFv) +// GOM(SDL_GetOriginalMemoryFunctions, +// GO(SDL_GetPerformanceCounter, UFv) +// GO(SDL_GetPerformanceFrequency, LFv) +// GO(SDL_GetPixelFormatName, pFu) +// GO(SDL_GetPlatform, pFv) +// GO(SDL_GetPointDisplayIndex, iFp) +// GO(SDL_GetPowerInfo, uFpp) +// GO(SDL_GetPreferredLocales, pFv) +// GO(SDL_GetPrefPath, pFpp) +// GO(SDL_GetPrimarySelectionText, pFv) +// GO(SDL_GetQueuedAudioSize, uFu) +// GO(SDL_GetRectDisplayIndex, iFp) +// GO(SDL_GetRelativeMouseMode, iFv) +// GO(SDL_GetRelativeMouseState, uFpp) +// GO(SDL_GetRenderDrawBlendMode, iFpp) +// GO(SDL_GetRenderDrawColor, iFppppp) +// GO(SDL_GetRenderDriverInfo, iFip) +// GO(SDL_GetRenderer, pFp) +// GO(SDL_GetRendererInfo, iFpp) +// GO(SDL_GetRendererOutputSize, iFppp) +// GO(SDL_GetRenderTarget, pFp) +// GO(SDL_GetRevision, pFv) +// GO(SDL_GetRevisionNumber, iFv) +// GO(SDL_GetRGB, vFupppp) +// GO(SDL_GetRGBA, vFuppppp) +// GO(SDL_GetScancodeFromKey, uFi) +// GO(SDL_GetScancodeFromName, uFp) +// GO(SDL_GetScancodeName, pFu) +// GO(SDL_GetShapedWindowMode, iFpp) +// GO(SDL_GetSurfaceAlphaMod, iFpp) +// GO(SDL_GetSurfaceBlendMode, iFpp) +// GO(SDL_GetSurfaceColorMod, iFpppp) +// GO(SDL_GetSystemRAM, iFv) +// GO(SDL_GetTextureAlphaMod, iFpp) +// GO(SDL_GetTextureBlendMode, iFpp) +// GO(SDL_GetTextureColorMod, iFpppp) +// GOM(SDL_GetThreadID, LFEp) +// GO(SDL_GetThreadName, pFp) +GO(SDL_GetTicks, uFv) +// GO(SDL_GetTicks64, UFv) +// GO(SDL_GetTouchDevice, lFi) +// GO(SDL_GetTouchDeviceType, iFl) +// GO(SDL_GetTouchFinger, pFli) +// GO(SDL_GetVersion, vFp) +// GO(SDL_GetVideoDriver, pFi) +// GO(SDL_GetWindowBordersSize, iFppppp) +// GO(SDL_GetWindowBrightness, fFp) +// GO(SDL_GetWindowData, pFpp) +// GO(SDL_GetWindowDisplayIndex, iFp) +// GO(SDL_GetWindowDisplayMode, iFpp) +// GO(SDL_GetWindowFlags, uFp) +// GO(SDL_GetWindowFromID, pFu) +// GO(SDL_GetWindowGammaRamp, iFpppp) +// GO(SDL_GetWindowGrab, iFp) +// GO(SDL_GetWindowID, uFp) +// GO(SDL_GetWindowMaximumSize, vFppp) +// GO(SDL_GetWindowMinimumSize, vFppp) +// GO(SDL_GetWindowOpacity, iFpp) +// GO(SDL_GetWindowPixelFormat, uFp) +// GO(SDL_GetWindowPosition, vFppp) +GO(SDL_GetWindowSize, vFppp) +// GO(SDL_GetWindowSizeInPixels, vFppp) +// GO(SDL_GetWindowSurface, pFp) +// GO(SDL_GetWindowTitle, pFp) +// GO(SDL_GetWindowWMInfo, iFpp) +// GO(SDL_GetYUVConversionMode, uFv) +// GO(SDL_GetYUVConversionModeForResolution, uFii) +// GO(SDL_GL_BindTexture, iFppp) +// GO(SDL_GL_CreateContext, pFp) +// GO(SDL_GL_DeleteContext, vFp) +// GO(SDL_GL_ExtensionSupported, iFp) +// GO(SDL_GL_GetAttribute, iFup) +// GO(SDL_GL_GetCurrentContext, pFv) +// GO(SDL_GL_GetCurrentWindow, pFv) +// GO(SDL_GL_GetDrawableSize, vFppp) +// GOM(SDL_GL_GetProcAddress, pFEp) +// GO(SDL_GL_GetSwapInterval, iFv) +// GO(SDL_GL_LoadLibrary, iFp) +// GO(SDL_GL_MakeCurrent, iFpp) +// GO(SDL_GL_ResetAttributes, vFv) +// GO(SDL_GL_SetAttribute, iFui) +// GO(SDL_GL_SetSwapInterval, iFi) +// GO(SDL_GL_SwapWindow, vFp) +// GO(SDL_GL_UnbindTexture, iFp) +// GO(SDL_GL_UnloadLibrary, vFv) +// GO(SDL_GUIDToString, vFUUpi) +// GO(SDL_HapticClose, vFp) +// GO(SDL_HapticDestroyEffect, vFpi) +// GO(SDL_HapticEffectSupported, iFpp) +// GO(SDL_HapticGetEffectStatus, iFpi) +// GO(SDL_HapticIndex, iFp) +// GO(SDL_HapticName, pFi) +// GO(SDL_HapticNewEffect, iFpp) +// GO(SDL_HapticNumAxes, iFp) +// GO(SDL_HapticNumEffects, iFp) +// GO(SDL_HapticNumEffectsPlaying, iFp) +// GO(SDL_HapticOpen, pFi) +// GO(SDL_HapticOpened, iFi) +// GO(SDL_HapticOpenFromJoystick, pFp) +// GO(SDL_HapticOpenFromMouse, pFv) +// GO(SDL_HapticPause, iFp) +// GO(SDL_HapticQuery, uFp) +// GO(SDL_HapticRumbleInit, iFp) +// GO(SDL_HapticRumblePlay, iFpfu) +// GO(SDL_HapticRumbleStop, iFp) +// GO(SDL_HapticRumbleSupported, iFp) +// GO(SDL_HapticRunEffect, iFpiu) +// GO(SDL_HapticSetAutocenter, iFpi) +// GO(SDL_HapticSetGain, iFpi) +// GO(SDL_HapticStopAll, iFp) +// GO(SDL_HapticStopEffect, iFpi) +// GO(SDL_HapticUnpause, iFp) +// GO(SDL_HapticUpdateEffect, iFpip) +// GOM(SDL_Has3DNow, iFv) +// GOM(SDL_HasAltiVec, iFv) +// GOM(SDL_HasAVX, iFv) +// GOM(SDL_HasAVX2, iFv) +// GOM(SDL_HasAVX512F, iFv) +// GO(SDL_HasClipboardText, iFv) +// GO(SDL_HasColorKey, uFp) +// GO(SDL_HasEvent, uFu) +// GO(SDL_HasEvents, uFuu) +// GO(SDL_HasIntersection, uFpp) +// GO(SDL_HasLASX, iFv) +// GO(SDL_HasLSX, iFv) +// GOM(SDL_HasMMX, iFv) +// GOM(SDL_HasNEON, iFv) +// GOM(SDL_HasRDTSC, iFv) +// GO(SDL_HasPrimarySelectionText, iFv) +// GO(SDL_HasScreenKeyboardSupport, iFv) +// GOM(SDL_HasSSE, iFv) +// GOM(SDL_HasSSE2, iFv) +// GOM(SDL_HasSSE3, iFv) +// GOM(SDL_HasSSE41, iFv) +// GOM(SDL_HasSSE42, iFv) +// GO(SDL_HideWindow, vFp) +// GO(SDL_HasWindowSurface, iFp) +// GO(SDL_iconv, LFppppp) +// GO(SDL_iconv_close, iFp) +// GO(SDL_iconv_open, pFpp) +// GO(SDL_iconv_string, pFpppL) +GO(SDL_Init, iFu) +// GO(SDL_InitSubSystem, iFu) +// GO(SDL_IntersectRect, uFppp) +// GO(SDL_IntersectRectAndLine, uFppppp) +// GO(SDL_isdigit, iFi) +// GO(SDL_IsGameController, uFi) +// GO(SDL_IsScreenKeyboardShown, uFp) +// GO(SDL_IsScreenSaverEnabled, iFv) +// GO(SDL_IsShapedWindow, uFp) +// GO(SDL_isspace, iFi) +// GO(SDL_IsTablet, uFv) +// GO(SDL_IsTextInputActive, iFv) +// GO(SDL_itoa, pFipi) +// GO(SDL_JoystickAttachVirtualEx, iFp) +// GO(SDL_JoystickClose, vFp) +// GO(SDL_JoystickCurrentPowerLevel, iFp) +GO(SDL_JoystickEventState, iFi) +// GO(SDL_JoystickFromInstanceID, pFi) +// GO(SDL_JoystickGetAttached, iFp) +// GO(SDL_JoystickGetAxis, wFpi) +// GO(SDL_JoystickGetAxisInitialState, uFpip) +// GO(SDL_JoystickGetBall, iFpipp) +// GO(SDL_JoystickGetButton, CFpi) +// GO(SDL_JoystickGetDeviceGUID, HFi) // return a struct that is "uint8_t data[16]" +// GO(SDL_JoystickGetDeviceInstanceID, iFi) +// GO(SDL_JoystickGetDevicePlayerIndex, iFi) +// GO(SDL_JoystickGetDeviceProduct, WFi) +// GO(SDL_JoystickGetDeviceProductVersion, WFi) +// GO(SDL_JoystickGetDeviceType, uFi) +// GO(SDL_JoystickGetDeviceVendor, WFi) +// GO(SDL_JoystickGetFirmwareVersion, WFp) +// GO(SDL_JoystickGetGUID, HFp) +// GO(SDL_JoystickGetGUIDFromString, HFp) +// GO(SDL_JoystickGetGUIDString, vFUUpi) //uint8_t data[16] passed as 1st argument... +// GO(SDL_JoystickGetHat, CFpi) +// GO(SDL_JoystickGetPlayerIndex, iFp) +// GO(SDL_JoystickGetProduct, WFp) +// GO(SDL_JoystickGetProductVersion, WFp) +// GO(SDL_JoystickGetSerial, pFp) +// GO(SDL_JoystickGetType, uFp) +// GO(SDL_JoystickGetVendor, WFp) +// GO(SDL_JoystickInstanceID, iFp) +// GO(SDL_JoystickIsHaptic, iFp) +// GO(SDL_JoystickName, pFp) +// GO(SDL_JoystickNameForIndex, pFi) +// GO(SDL_JoystickNumAxes, iFp) +// GO(SDL_JoystickNumBalls, iFp) +// GO(SDL_JoystickNumButtons, iFp) +// GO(SDL_JoystickNumHats, iFp) +// GO(SDL_JoystickOpen, pFi) +// GO(SDL_JoystickPath, pFp) +// GO(SDL_JoystickPathForIndex, pFi) +// GO(SDL_JoystickRumble, iFpWWu) +// GO(SDL_JoystickRumbleTriggers, iFpWWu) +// GO(SDL_JoystickUpdate, vFv) +// GO(SDL_LinuxSetThreadPriority, iFli) +// GO(SDL_lltoa, pFlpi) +// GOM(SDL_LoadBMP_RW, pFEpi) +// GO(SDL_LoadDollarTemplates, iFip) +// GO(SDL_LoadFile, pFpp) +// GOM(SDL_LoadFile_RW, pFEppi) +// GOM(SDL_LoadFunction, pFEpp) +// GOM(SDL_LoadObject, pFEp) +// GOM(SDL_LoadWAV_RW, pFEpippp) +GO(SDL_LockAudio, vFv) +// GO(SDL_LockAudioDevice, vFi) +// GO(SDL_LockJoysticks, vFv) +// GO(SDL_LockMutex, iFp) +// GO(SDL_LockSensors, vFv) +// GO(SDL_LockSurface, iFp) +// GO(SDL_LockTexture, iFpppp) +// GO(SDL_log, dFd) +// GOM(SDL_Log, vFEpV) +// GO(SDL_log10, dFd) +// GO(SDL_log10f, fFf) +// GOM(SDL_LogCritical, vFEipV) +// GOM(SDL_LogDebug, vFEipV) +// GOM(SDL_LogError, vFEipV) +// GO(SDL_logf, fFf) +// GOM(SDL_LogGetOutputFunction, vFEpp) +// GO(SDL_LogGetPriority, uFi) +// GOM(SDL_LogInfo, vFEipV) +// GO2(SDL_LogMessage, vFiupV, SDL_LogMessageV) +// GO(SDL_LogMessageV, vFiupV) +// GO(SDL_LogResetPriorities, vFv) +// GO(SDL_LogSetAllPriority, vFu) +// GOM(SDL_LogSetOutputFunction, vFEpp) +// GO(SDL_LogSetPriority, vFiu) +// GOM(SDL_LogVerbose, vFEipV) +// GOM(SDL_LogWarn, vFEipV) +// GO(SDL_LowerBlit, iFpppp) +// GO(SDL_LowerBlitScaled, iFpppp) +// GO(SDL_ltoa, pFlpi) +// GO(SDL_malloc, pFL) +// GO(SDL_MapRGB, uFpCCC) +// GO(SDL_MapRGBA, uFpCCCC) +// GO(SDL_MasksToPixelFormatEnum, uFiuuuu) +// GO(SDL_MaximizeWindow, vFp) +// GO(SDL_memcmp, iFppL) +// GO(SDL_memcpy, pFppu) +// GO(SDL_memmove, pFppu) +// GO(SDL_MemoryBarrierAcquireFunction, vFv) +// GO(SDL_MemoryBarrierReleaseFunction, vFv) +GO(SDL_memset, pFpiL) +// GO(SDL_MinimizeWindow, vFp) +// GO(SDL_MixAudio, vFppui) +// GO(SDL_MixAudioFormat, vFppWui) +// GO(SDL_MouseIsHaptic, iFv) +// GO(SDL_NewAudioStream, pFWCiWCi) +// GO(SDL_NumHaptics, iFv) +GO(SDL_NumJoysticks, iFv) +// GO(SDL_NumSensors, iFv) +GOM(SDL_OpenAudio, iFEpp) +// GOM(SDL_OpenAudioDevice, iFEpippi) +GO(SDL_PauseAudio, vFi) +// GO(SDL_PauseAudioDevice, vFui) +// GO(SDL_PeepEvents, iFpiuuu) +// GO(SDL_PixelFormatEnumToMasks, uFuppppp) +GOM(SDL_PollEvent, iFp) //%noE +// GO(SDL_pow, dFdd) +// GO(SDL_powf, fFff) +// GO(SDL_PumpEvents, vFv) +// GO(SDL_PushEvent, iFp) +// GO2(SDL_qsort, vFEpuup, my_qsort) +// GO(SDL_QueryTexture, iFppppp) +// GO(SDL_QueueAudio, iFupu) +GO(SDL_Quit, vFv) +// GO(SDL_QuitSubSystem, vFu) +// GO(SDL_RaiseWindow, vFp) +// GOM(SDL_ReadBE16, uFEp) +// GOM(SDL_ReadBE32, uFEp) +// GOM(SDL_ReadBE64, UFEp) +// GOM(SDL_ReadLE16, uFEp) +// GOM(SDL_ReadLE32, uFEp) +// GOM(SDL_ReadLE64, UFEp) +// GOM(SDL_ReadU8, uFEp) +// GO(SDL_realloc, pFpL) +// GO(SDL_RecordGesture, iFl) +// GO(SDL_RegisterEvents, uFi) +// GOM(SDL_RemoveTimer, iFEp) +GO(SDL_RenderClear, iFp) +GO(SDL_RenderCopy, iFpppp) +// GO(SDL_RenderCopyEx, iFppppdpu) +// SDL_RenderCopyExF +// SDL_RenderCopyF +// GO(SDL_RenderDrawLine, iFpiiii) +// SDL_RenderDrawLineF +// GO(SDL_RenderDrawLines, iFppi) +// SDL_RenderDrawLinesF +// GO(SDL_RenderDrawPoint, iFpii) +// SDL_RenderDrawPointF +// GO(SDL_RenderDrawPoints, iFppi) +// SDL_RenderDrawPointsF +// GO(SDL_RenderDrawRect, iFpp) +// SDL_RenderDrawRectF +// GO(SDL_RenderDrawRects, iFppi) +// SDL_RenderDrawRectsF +// GO(SDL_RenderFillRect, iFpp) +// SDL_RenderFillRectF +// GO(SDL_RenderFillRects, iFppi) +// SDL_RenderFillRectsF +// SDL_RenderFlush +// GO(SDL_RenderGetClipRect, vFpp) +// GO(SDL_RenderGetIntegerScale, iFp) +// GO(SDL_RenderGetLogicalSize, vFppp) +// SDL_RenderGetMetalCommandEncoder +// SDL_RenderGetMetalLayer +// GO(SDL_RenderGetScale, vFppp) +// GO(SDL_RenderGetViewport, vFpp) +// GO(SDL_RenderIsClipEnabled, uFp) +GO(SDL_RenderPresent, vFp) +// GO(SDL_RenderReadPixels, iFppupi) +// GO(SDL_RenderSetClipRect, iFpp) +// GO(SDL_RenderSetIntegerScale, iFpu) +GO(SDL_RenderSetLogicalSize, iFpii) +// GO(SDL_RenderSetScale, iFpff) +// GO(SDL_RenderSetViewport, iFpp) +// GO(SDL_RenderTargetSupported, iFp) +// GO(SDL_RenderSetVSync, iFpi) +// GO(SDL_RenderWindowToLogical, vFpiipp) +// GO(SDL_ReportAssertion, uFpppi) +// GO(SDL_ResetAssertionReport, vFv) +// GO(SDL_ResetHints, vFv) +// GO(SDL_ResetKeyboard, vFv) +// GO(SDL_RestoreWindow, vFp) +// GOM(SDL_RWFromConstMem, pFEpi) +// GOM(SDL_RWFromFP, pFEpi) +// GOM(SDL_RWFromFile, pFEpp) +// GOM(SDL_RWFromMem, pFEpi) +// GOM(SDL_SaveAllDollarTemplates, iFEp) +// GOM(SDL_SaveBMP_RW, iFEppi) +// GOM(SDL_SaveDollarTemplate, iFEip) +// GO(SDL_scalbn, dFdi) +// GO(SDL_scalbnf, fFfi) +// GO(SDL_SemPost, iFp) +// GO(SDL_SemTryWait, iFp) +// GO(SDL_SemValue, uFp) +// GO(SDL_SemWait, iFp) +// GO(SDL_SemWaitTimeout, iFpu) +// GO(SDL_SensorClose, vFp) +// GO(SDL_SensorFromInstanceID, pFi) +// GO(SDL_SensorGetData, iFppi) +// GO(SDL_SensorGetDataWithTimestamp, iFpppi) +// GO(SDL_SensorGetDeviceInstanceID, iFi) +// GO(SDL_SensorGetDeviceName, pFi) +// GO(SDL_SensorGetDeviceNonPortableType, iFi) +// GO(SDL_SensorGetDeviceType, iFi) +// GO(SDL_SensorGetInstanceID, iFp) +// GO(SDL_SensorGetName, pFp) +// GO(SDL_SensorGetNonPortableType, iFp) +// GO(SDL_SensorGetType, iFp) +// GO(SDL_SensorOpen, pFi) +// GO(SDL_SensorUpdate, vFv) +// SDL_SetAssertionHandler +// GO(SDL_SetClipboardText, iFp) +// GO(SDL_SetClipRect, uFpp) +// GO(SDL_SetColorKey, iFpiu) +// GO(SDL_SetCursor, vFp) +// GO(SDL_setenv, iFppi) +// GO(SDL_SetError, iFppppp) // it use ..., so putarbitrary 4 args +// GOM(SDL_SetEventFilter, vFEpp) +GO(SDL_SetHint, uFpp) +// GO(SDL_SetHintWithPriority, uFppu) +// GO(SDL_SetMainReady, vFv) +// GOM(SDL_SetMemoryFunctions, +// GO(SDL_SetModState, vFu) +// GO(SDL_SetPaletteColors, iFppii) +// SDL_SetPixelFormatPalette +// GO(SDL_SetPrimarySelectionText, iFp) +// GO(SDL_SetRelativeMouseMode, iFi) +// GO(SDL_SetRenderDrawBlendMode, iFpu) +GO(SDL_SetRenderDrawColor, iFpCCCC) +// GO(SDL_SetRenderTarget, iFpp) +// GO(SDL_SetSurfaceAlphaMod, iFpC) +// GO(SDL_SetSurfaceBlendMode, iFpu) +// GO(SDL_SetSurfaceColorMod, iFpCCC) +// SDL_SetSurfaceColorMod +// GO(SDL_SetSurfacePalette, iFpp) +// GO(SDL_SetSurfaceRLE, iFpi) +// GO(SDL_SetTextInputRect, vFp) +// GO(SDL_SetTextureAlphaMod, iFpC) +// GO(SDL_SetTextureBlendMode, iFpu) +// GO(SDL_SetTextureColorMod, iFpCCC) +// GO(SDL_SetTextureScaleMode, iFpu) +// GO(SDL_SetThreadPriority, iFu) +// GO(SDL_SetWindowBordered, vFpi) +// GO(SDL_SetWindowBrightness, iFpf) +// GO(SDL_SetWindowData, pFppp) +// GO(SDL_SetWindowDisplayMode, iFpp) +// GO(SDL_SetWindowFullscreen, iFpu) +// GO(SDL_SetWindowGammaRamp, iFpppp) +// GO(SDL_SetWindowGrab, vFpi) +// SDL_SetWindowHitTest +// GO(SDL_SetWindowIcon, vFpp) +// SDL_SetWindowInputFocus +// GO(SDL_SetWindowMaximumSize, vFpii) +// GO(SDL_SetWindowMinimumSize, vFpii) +// SDL_SetWindowModalFor +// SDL_SetWindowOpacity +// GO(SDL_SetWindowPosition, vFpii) +// GO(SDL_SetWindowResizable, vFpi) +// GO(SDL_SetWindowShape, iFppp) +// GO(SDL_SetWindowSize, vFpii) +// GO(SDL_SetWindowTitle, vFpp) +// SDL_SetYUVConversionMode +GO(SDL_ShowCursor, iFi) +// GO(SDL_ShowMessageBox, iFpp) +// GO(SDL_ShowSimpleMessageBox, iFuppp) +// GO(SDL_ShowWindow, vFp) +// GO(SDL_SIMDAlloc, pFL) +// GO(SDL_SIMDGetAlignment, LFv) +// GO(SDL_SIMDRealloc, pFpL) +// GO(SDL_SIMDFree, vFp) +// GO(SDL_sin, dFd) +// GO(SDL_sinf, fFf) +// GOM(SDL_snprintf, iFEpLpV) +// GO(SDL_SoftStretch, iFpppp) +// GO(SDL_sqrt, dFd) +// GO(SDL_sqrtf, fFf) +// GO2(SDL_sscanf, iFEppV, my_sscanf) +// GO(SDL_StartTextInput, vFv) +// GO(SDL_StopTextInput, vFv) +// GO(SDL_strcasecmp, iFpp) +// GO(SDL_strchr, pFpi) +// GO(SDL_strcmp, iFpp) +GO(SDL_strdup, pFp) +// GO(SDL_strlcat, LFppL) +// GO(SDL_strlcpy, uFppu) +// GO(SDL_strlen, uFp) +// GO(SDL_strlwr, pFp) +// GO(SDL_strncasecmp, iFppL) +// GO(SDL_strncmp, iFppu) +// GO(SDL_strrchr, pFpi) +// GO(SDL_strrev, pFp) +// GO(SDL_strstr, pFpp) +// GO(SDL_strtod, dFpp) +// GO(SDL_strtol, lFppi) +// GO(SDL_strtoll, lFppi) +// GO(SDL_strtoul, LFppi) +// GO(SDL_strtoull, LFppi) +// GO(SDL_strupr, pFp) +// GO(SDL_tan, dFd) +// GO(SDL_tanf, fFf) +// GO(SDL_ThreadID, LFv) +// GO(SDL_TLSCreate, uFv) +// GO(SDL_TLSGet, pFu) +// GOM(SDL_TLSSet, iFEupp) +// GO(SDL_tolower, iFi) +// GO(SDL_toupper, iFi) +// GO(SDL_TryLockMutex, iFp) +// GO(SDL_uitoa, pFupi) +// GO(SDL_ulltoa, pFLpi) +// GO(SDL_ultoa, pFLpi) +// GO(SDL_UnionRect, vFppp) +// GOM(SDL_UnloadObject, vFEp) +GO(SDL_UnlockAudio, vFv) +// GO(SDL_UnlockAudioDevice, vFi) +// GO(SDL_UnlockJoysticks, vFv) +// GO(SDL_UnlockMutex, iFp) +// GO(SDL_UnlockSensors, vFv) +// GO(SDL_UnlockSurface, vFp) +// GO(SDL_UnlockTexture, vFp) +GO(SDL_UpdateTexture, iFpppi) +// GO(SDL_UpdateWindowSurface, iFp) +// GO(SDL_UpdateWindowSurfaceRects, iFppi) +// GO(SDL_UpdateYUVTexture, iFpppipipi) +// GO(SDL_UpperBlit, iFpppp) +// GO(SDL_UpperBlitScaled, iFpppp) +// GO(SDL_utf8strlcpy, uFppu) +// SDL_utf8strlen +// GO(SDL_VideoInit, iFp) +// GO(SDL_VideoQuit, vFv) +// GOM(SDL_vsnprintf, iFEpLpp) +// SDL_vsscanf +// GO(SDL_Vulkan_CreateSurface, iFppp) +// GO(SDL_Vulkan_GetDrawableSize, vFppp) +// GO(SDL_Vulkan_GetInstanceExtensions, iFppp) +// GOM(SDL_Vulkan_GetVkGetInstanceProcAddr, pFEv) +// GO(SDL_Vulkan_LoadLibrary, iFp) //TODO: wrap to also call my_dlopen with path? +// GO(SDL_Vulkan_UnloadLibrary, vFv) +// GO(SDL_WaitEvent, iFp) +// GO(SDL_WaitEventTimeout, iFpi) +// GO(SDL_WaitThread, vFpp) +GO(SDL_WarpMouseGlobal, iFii) +GO(SDL_WarpMouseInWindow, vFpii) +GO(SDL_WasInit, uFu) +// SDL_wcscmp +// SDL_wcsdup +// SDL_wcslcat +// SDL_wcslcpy +// GO(SDL_wcslen, LFp) +// GOM(SDL_WriteBE16, uFEpW) +// GOM(SDL_WriteBE32, uFEpu) +// GOM(SDL_WriteBE64, uFEpU) +// GOM(SDL_WriteLE16, uFEpW) +// GOM(SDL_WriteLE32, uFEpu) +// GOM(SDL_WriteLE64, uFEpU) +// GOM(SDL_WriteU8, uFEpu) + +// GOM(SDL_RWseek, IFEpIi) +// GOM(SDL_RWtell, IFEp) +// GOM(SDL_RWread, uFEppuu) +// GOM(SDL_RWwrite, uFEppuu) +// GOM(SDL_RWclose, iFEp) + +// GO2(SDL_mutexP, iFp, SDL_LockMutex) +// GO2(SDL_mutexV, iFp, SDL_UnlockMutex) + +// GO(SDL_doesntexist, IFpIi) + +// GOM(SDL_IsJoystickPS4, iFEWW) +// GOM(SDL_IsJoystickNintendoSwitchPro, iFEWW) +// GOM(SDL_IsJoystickSteamController, iFEWW) +// GOM(SDL_IsJoystickXbox360, iFEWW) +// GOM(SDL_IsJoystickXboxOne, iFEWW) +// GOM(SDL_IsJoystickXInput, iFEUU) +// GOM(SDL_IsJoystickHIDAPI, iFEUU) |