about summary refs log tree commit diff stats
path: root/src/wrapped/wrappedlibncursesw.c
diff options
context:
space:
mode:
authorrajdakin <rajdakin@gmail.com>2021-07-31 13:38:01 +0200
committerrajdakin <rajdakin@gmail.com>2021-07-31 13:38:22 +0200
commite1d8f1d7e55ea83a8c30680560c22b200cdeb9cd (patch)
treeb9efa9e0ba1331bbe4d3ccf100cf465b720e3faf /src/wrapped/wrappedlibncursesw.c
parentc8640caba352bed19d7289cf9761c0d14d3d2b19 (diff)
downloadbox64-e1d8f1d7e55ea83a8c30680560c22b200cdeb9cd.tar.gz
box64-e1d8f1d7e55ea83a8c30680560c22b200cdeb9cd.zip
Fixed some wrapped functions, upgraded the rebuild_wrapper script [SDL2 DOESN'T WORK, FIX UNDERWAY]
Diffstat (limited to 'src/wrapped/wrappedlibncursesw.c')
-rwxr-xr-xsrc/wrapped/wrappedlibncursesw.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/src/wrapped/wrappedlibncursesw.c b/src/wrapped/wrappedlibncursesw.c
index 402239c1..f602086a 100755
--- a/src/wrapped/wrappedlibncursesw.c
+++ b/src/wrapped/wrappedlibncursesw.c
@@ -24,15 +24,8 @@ const char* libncurseswName = "libncursesw.so.5";
 
 static library_t* my_lib = NULL;
 
-typedef void*       (*pFv_t)();
-typedef int         (*iFppV_t)(void*, void*, va_list);
-typedef int         (*iFpiip_t)(void*, int32_t, int32_t, void*);
-
-#define SUPER()             \
-    GO(initscr, pFv_t)      \
-    GO(mvwprintw, iFpiip_t) \
-    GO(vwprintw, iFppV_t)   \
-    GO(stdscr, void*)
+#define ADDED_FUNCTIONS() GO(stdscr, void*)
+#include "generated/wrappedlibncurseswtypes.h"
 
 typedef struct libncursesw_my_s {
     // functions
@@ -88,6 +81,21 @@ EXPORT int myw_vwprintw(x64emu_t* emu, void* p, void* fmt, x64_va_list_t b)
     return my->vwprintw(p, fmt, VARARGS);
 }
 
+EXPORT int myw_mvprintw(x64emu_t* emu, int x, int y, void* fmt, void* b)
+{
+    libncursesw_my_t *my = (libncursesw_my_t*)my_lib->priv.w.p2;
+
+    char* buf = NULL;
+    myStackAlign(emu, (const char*)fmt, b, emu->scratch, R_EAX, 3);
+    PREPARE_VALIST;
+    int ret = vasprintf(&buf, (const char*)fmt, VARARGS);
+    (void)ret;
+    // pre-bake the fmt/vaarg, because there is no "va_list" version of this function
+    ret = my->mvprintw(x, y, buf);
+    free(buf);
+    return ret;
+}
+
 EXPORT void* myw_initscr()
 {
     libncursesw_my_t *my = (libncursesw_my_t*)my_lib->priv.w.p2;