about summary refs log tree commit diff stats
path: root/src/include
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2021-03-07 20:19:58 +0100
committerptitSeb <sebastien.chev@gmail.com>2021-03-07 20:19:58 +0100
commit4c7cbe412835ee6a11df44eb2a324d32452047b7 (patch)
tree26ba351c1aa89de78f390ccfb4be9ca9206de0d1 /src/include
parent343174fd476dee93e9c29878c6398d5c9f72e265 (diff)
downloadbox64-4c7cbe412835ee6a11df44eb2a324d32452047b7.tar.gz
box64-4c7cbe412835ee6a11df44eb2a324d32452047b7.zip
Added wrapped libSDL1.2, libSDL2.0, libGL, libGLU and libopenal
Diffstat (limited to 'src/include')
-rwxr-xr-xsrc/include/sdl1rwops.h21
-rwxr-xr-xsrc/include/sdl2rwops.h31
2 files changed, 52 insertions, 0 deletions
diff --git a/src/include/sdl1rwops.h b/src/include/sdl1rwops.h
new file mode 100755
index 00000000..46b73519
--- /dev/null
+++ b/src/include/sdl1rwops.h
@@ -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
\ No newline at end of file
diff --git a/src/include/sdl2rwops.h b/src/include/sdl2rwops.h
new file mode 100755
index 00000000..968a3c58
--- /dev/null
+++ b/src/include/sdl2rwops.h
@@ -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
\ No newline at end of file