YaGL: Batch calls support added.
authorStanislav Vorobiov <s.vorobiov@samsung.com>
Wed, 12 Sep 2012 17:12:27 +0000 (21:12 +0400)
committerEvgeny Voevodin <e.voevodin@samsung.com>
Fri, 14 Sep 2012 07:15:16 +0000 (11:15 +0400)
hw/yagl_apis/egl/yagl_egl_calls.c
hw/yagl_apis/gles1/yagl_gles1_calls.c
hw/yagl_apis/gles2/yagl_gles2_calls.c
hw/yagl_device.c
hw/yagl_marshal.h
hw/yagl_server.c
hw/yagl_server.h
hw/yagl_thread.c
hw/yagl_thread.h
hw/yagl_types.h
hw/yagl_version.h

index 21a09f9..0427d1d 100644 (file)
@@ -11,7 +11,7 @@
 /*
  * eglGetError dispatcher. id = 1
  */
-static void yagl_func_eglGetError(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_eglGetError(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -19,12 +19,13 @@ static void yagl_func_eglGetError(struct yagl_thread_state *ts,
     EGLint ret = yagl_host_eglGetError();
     YAGL_LOG_FUNC_EXIT_SPLIT(EGLint, ret);
     yagl_marshal_put_EGLint(&in_buff, ret);
+    return out_buff;
 }
 
 /*
  * eglGetDisplay dispatcher. id = 2
  */
-static void yagl_func_eglGetDisplay(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_eglGetDisplay(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -33,12 +34,13 @@ static void yagl_func_eglGetDisplay(struct yagl_thread_state *ts,
     yagl_host_handle ret = yagl_host_eglGetDisplay(display_id);
     YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, ret);
     yagl_marshal_put_host_handle(&in_buff, ret);
+    return out_buff;
 }
 
 /*
  * eglInitialize dispatcher. id = 3
  */
-static void yagl_func_eglInitialize(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_eglInitialize(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -49,12 +51,13 @@ static void yagl_func_eglInitialize(struct yagl_thread_state *ts,
     EGLBoolean ret = yagl_host_eglInitialize(dpy, major, minor);
     YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, ret);
     yagl_marshal_put_EGLBoolean(&in_buff, ret);
+    return out_buff;
 }
 
 /*
  * eglTerminate dispatcher. id = 4
  */
-static void yagl_func_eglTerminate(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_eglTerminate(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -63,12 +66,13 @@ static void yagl_func_eglTerminate(struct yagl_thread_state *ts,
     EGLBoolean ret = yagl_host_eglTerminate(dpy);
     YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, ret);
     yagl_marshal_put_EGLBoolean(&in_buff, ret);
+    return out_buff;
 }
 
 /*
  * eglGetConfigs dispatcher. id = 5
  */
-static void yagl_func_eglGetConfigs(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_eglGetConfigs(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -80,12 +84,13 @@ static void yagl_func_eglGetConfigs(struct yagl_thread_state *ts,
     EGLBoolean ret = yagl_host_eglGetConfigs(dpy, configs, config_size, num_config);
     YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, ret);
     yagl_marshal_put_EGLBoolean(&in_buff, ret);
+    return out_buff;
 }
 
 /*
  * eglChooseConfig dispatcher. id = 6
  */
-static void yagl_func_eglChooseConfig(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_eglChooseConfig(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -98,12 +103,13 @@ static void yagl_func_eglChooseConfig(struct yagl_thread_state *ts,
     EGLBoolean ret = yagl_host_eglChooseConfig(dpy, attrib_list, configs, config_size, num_config);
     YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, ret);
     yagl_marshal_put_EGLBoolean(&in_buff, ret);
+    return out_buff;
 }
 
 /*
  * eglGetConfigAttrib dispatcher. id = 7
  */
-static void yagl_func_eglGetConfigAttrib(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_eglGetConfigAttrib(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -115,12 +121,13 @@ static void yagl_func_eglGetConfigAttrib(struct yagl_thread_state *ts,
     EGLBoolean ret = yagl_host_eglGetConfigAttrib(dpy, config, attribute, value);
     YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, ret);
     yagl_marshal_put_EGLBoolean(&in_buff, ret);
+    return out_buff;
 }
 
 /*
  * eglDestroySurface dispatcher. id = 8
  */
-static void yagl_func_eglDestroySurface(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_eglDestroySurface(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -130,12 +137,13 @@ static void yagl_func_eglDestroySurface(struct yagl_thread_state *ts,
     EGLBoolean ret = yagl_host_eglDestroySurface(dpy, surface);
     YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, ret);
     yagl_marshal_put_EGLBoolean(&in_buff, ret);
+    return out_buff;
 }
 
 /*
  * eglQuerySurface dispatcher. id = 9
  */
-static void yagl_func_eglQuerySurface(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_eglQuerySurface(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -147,12 +155,13 @@ static void yagl_func_eglQuerySurface(struct yagl_thread_state *ts,
     EGLBoolean ret = yagl_host_eglQuerySurface(dpy, surface, attribute, value);
     YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, ret);
     yagl_marshal_put_EGLBoolean(&in_buff, ret);
+    return out_buff;
 }
 
 /*
  * eglBindAPI dispatcher. id = 10
  */
-static void yagl_func_eglBindAPI(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_eglBindAPI(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -161,12 +170,13 @@ static void yagl_func_eglBindAPI(struct yagl_thread_state *ts,
     EGLBoolean ret = yagl_host_eglBindAPI(api);
     YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, ret);
     yagl_marshal_put_EGLBoolean(&in_buff, ret);
+    return out_buff;
 }
 
 /*
  * eglQueryAPI dispatcher. id = 11
  */
-static void yagl_func_eglQueryAPI(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_eglQueryAPI(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -174,12 +184,13 @@ static void yagl_func_eglQueryAPI(struct yagl_thread_state *ts,
     EGLenum ret = yagl_host_eglQueryAPI();
     YAGL_LOG_FUNC_EXIT_SPLIT(EGLenum, ret);
     yagl_marshal_put_EGLenum(&in_buff, ret);
+    return out_buff;
 }
 
 /*
  * eglWaitClient dispatcher. id = 12
  */
-static void yagl_func_eglWaitClient(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_eglWaitClient(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -187,12 +198,13 @@ static void yagl_func_eglWaitClient(struct yagl_thread_state *ts,
     EGLBoolean ret = yagl_host_eglWaitClient();
     YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, ret);
     yagl_marshal_put_EGLBoolean(&in_buff, ret);
+    return out_buff;
 }
 
 /*
  * eglReleaseThread dispatcher. id = 13
  */
-static void yagl_func_eglReleaseThread(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_eglReleaseThread(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -200,12 +212,13 @@ static void yagl_func_eglReleaseThread(struct yagl_thread_state *ts,
     EGLBoolean ret = yagl_host_eglReleaseThread();
     YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, ret);
     yagl_marshal_put_EGLBoolean(&in_buff, ret);
+    return out_buff;
 }
 
 /*
  * eglCreatePbufferFromClientBuffer dispatcher. id = 14
  */
-static void yagl_func_eglCreatePbufferFromClientBuffer(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_eglCreatePbufferFromClientBuffer(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -218,12 +231,13 @@ static void yagl_func_eglCreatePbufferFromClientBuffer(struct yagl_thread_state
     yagl_host_handle ret = yagl_host_eglCreatePbufferFromClientBuffer(dpy, buftype, buffer, config, attrib_list);
     YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, ret);
     yagl_marshal_put_host_handle(&in_buff, ret);
+    return out_buff;
 }
 
 /*
  * eglSurfaceAttrib dispatcher. id = 15
  */
-static void yagl_func_eglSurfaceAttrib(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_eglSurfaceAttrib(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -235,12 +249,13 @@ static void yagl_func_eglSurfaceAttrib(struct yagl_thread_state *ts,
     EGLBoolean ret = yagl_host_eglSurfaceAttrib(dpy, surface, attribute, value);
     YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, ret);
     yagl_marshal_put_EGLBoolean(&in_buff, ret);
+    return out_buff;
 }
 
 /*
  * eglBindTexImage dispatcher. id = 16
  */
-static void yagl_func_eglBindTexImage(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_eglBindTexImage(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -251,12 +266,13 @@ static void yagl_func_eglBindTexImage(struct yagl_thread_state *ts,
     EGLBoolean ret = yagl_host_eglBindTexImage(dpy, surface, buffer);
     YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, ret);
     yagl_marshal_put_EGLBoolean(&in_buff, ret);
+    return out_buff;
 }
 
 /*
  * eglReleaseTexImage dispatcher. id = 17
  */
-static void yagl_func_eglReleaseTexImage(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_eglReleaseTexImage(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -267,12 +283,13 @@ static void yagl_func_eglReleaseTexImage(struct yagl_thread_state *ts,
     EGLBoolean ret = yagl_host_eglReleaseTexImage(dpy, surface, buffer);
     YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, ret);
     yagl_marshal_put_EGLBoolean(&in_buff, ret);
+    return out_buff;
 }
 
 /*
  * eglSwapInterval dispatcher. id = 18
  */
-static void yagl_func_eglSwapInterval(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_eglSwapInterval(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -282,12 +299,13 @@ static void yagl_func_eglSwapInterval(struct yagl_thread_state *ts,
     EGLBoolean ret = yagl_host_eglSwapInterval(dpy, interval);
     YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, ret);
     yagl_marshal_put_EGLBoolean(&in_buff, ret);
+    return out_buff;
 }
 
 /*
  * eglCreateContext dispatcher. id = 19
  */
-static void yagl_func_eglCreateContext(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_eglCreateContext(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -299,12 +317,13 @@ static void yagl_func_eglCreateContext(struct yagl_thread_state *ts,
     yagl_host_handle ret = yagl_host_eglCreateContext(dpy, config, share_context, attrib_list);
     YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, ret);
     yagl_marshal_put_host_handle(&in_buff, ret);
+    return out_buff;
 }
 
 /*
  * eglDestroyContext dispatcher. id = 20
  */
-static void yagl_func_eglDestroyContext(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_eglDestroyContext(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -314,12 +333,13 @@ static void yagl_func_eglDestroyContext(struct yagl_thread_state *ts,
     EGLBoolean ret = yagl_host_eglDestroyContext(dpy, ctx);
     YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, ret);
     yagl_marshal_put_EGLBoolean(&in_buff, ret);
+    return out_buff;
 }
 
 /*
  * eglMakeCurrent dispatcher. id = 21
  */
-static void yagl_func_eglMakeCurrent(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_eglMakeCurrent(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -331,12 +351,13 @@ static void yagl_func_eglMakeCurrent(struct yagl_thread_state *ts,
     EGLBoolean ret = yagl_host_eglMakeCurrent(dpy, draw, read, ctx);
     YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, ret);
     yagl_marshal_put_EGLBoolean(&in_buff, ret);
+    return out_buff;
 }
 
 /*
  * eglQueryContext dispatcher. id = 22
  */
-static void yagl_func_eglQueryContext(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_eglQueryContext(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -348,12 +369,13 @@ static void yagl_func_eglQueryContext(struct yagl_thread_state *ts,
     EGLBoolean ret = yagl_host_eglQueryContext(dpy, ctx, attribute, value);
     YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, ret);
     yagl_marshal_put_EGLBoolean(&in_buff, ret);
+    return out_buff;
 }
 
 /*
  * eglWaitGL dispatcher. id = 23
  */
-static void yagl_func_eglWaitGL(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_eglWaitGL(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -361,12 +383,13 @@ static void yagl_func_eglWaitGL(struct yagl_thread_state *ts,
     EGLBoolean ret = yagl_host_eglWaitGL();
     YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, ret);
     yagl_marshal_put_EGLBoolean(&in_buff, ret);
+    return out_buff;
 }
 
 /*
  * eglWaitNative dispatcher. id = 24
  */
-static void yagl_func_eglWaitNative(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_eglWaitNative(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -375,12 +398,13 @@ static void yagl_func_eglWaitNative(struct yagl_thread_state *ts,
     EGLBoolean ret = yagl_host_eglWaitNative(engine);
     YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, ret);
     yagl_marshal_put_EGLBoolean(&in_buff, ret);
+    return out_buff;
 }
 
 /*
  * eglSwapBuffers dispatcher. id = 25
  */
-static void yagl_func_eglSwapBuffers(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_eglSwapBuffers(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -390,12 +414,13 @@ static void yagl_func_eglSwapBuffers(struct yagl_thread_state *ts,
     EGLBoolean ret = yagl_host_eglSwapBuffers(dpy, surface);
     YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, ret);
     yagl_marshal_put_EGLBoolean(&in_buff, ret);
+    return out_buff;
 }
 
 /*
  * eglCopyBuffers dispatcher. id = 26
  */
-static void yagl_func_eglCopyBuffers(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_eglCopyBuffers(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -406,12 +431,13 @@ static void yagl_func_eglCopyBuffers(struct yagl_thread_state *ts,
     EGLBoolean ret = yagl_host_eglCopyBuffers(dpy, surface, target);
     YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, ret);
     yagl_marshal_put_EGLBoolean(&in_buff, ret);
+    return out_buff;
 }
 
 /*
  * eglCreateWindowSurfaceOffscreenYAGL dispatcher. id = 27
  */
-static void yagl_func_eglCreateWindowSurfaceOffscreenYAGL(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_eglCreateWindowSurfaceOffscreenYAGL(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -426,12 +452,13 @@ static void yagl_func_eglCreateWindowSurfaceOffscreenYAGL(struct yagl_thread_sta
     yagl_host_handle ret = yagl_host_eglCreateWindowSurfaceOffscreenYAGL(dpy, config, width, height, bpp, pixels, attrib_list);
     YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, ret);
     yagl_marshal_put_host_handle(&in_buff, ret);
+    return out_buff;
 }
 
 /*
  * eglCreatePbufferSurfaceOffscreenYAGL dispatcher. id = 28
  */
-static void yagl_func_eglCreatePbufferSurfaceOffscreenYAGL(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_eglCreatePbufferSurfaceOffscreenYAGL(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -446,12 +473,13 @@ static void yagl_func_eglCreatePbufferSurfaceOffscreenYAGL(struct yagl_thread_st
     yagl_host_handle ret = yagl_host_eglCreatePbufferSurfaceOffscreenYAGL(dpy, config, width, height, bpp, pixels, attrib_list);
     YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, ret);
     yagl_marshal_put_host_handle(&in_buff, ret);
+    return out_buff;
 }
 
 /*
  * eglCreatePixmapSurfaceOffscreenYAGL dispatcher. id = 29
  */
-static void yagl_func_eglCreatePixmapSurfaceOffscreenYAGL(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_eglCreatePixmapSurfaceOffscreenYAGL(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -466,12 +494,13 @@ static void yagl_func_eglCreatePixmapSurfaceOffscreenYAGL(struct yagl_thread_sta
     yagl_host_handle ret = yagl_host_eglCreatePixmapSurfaceOffscreenYAGL(dpy, config, width, height, bpp, pixels, attrib_list);
     YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, ret);
     yagl_marshal_put_host_handle(&in_buff, ret);
+    return out_buff;
 }
 
 /*
  * eglResizeOffscreenSurfaceYAGL dispatcher. id = 30
  */
-static void yagl_func_eglResizeOffscreenSurfaceYAGL(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_eglResizeOffscreenSurfaceYAGL(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -485,6 +514,7 @@ static void yagl_func_eglResizeOffscreenSurfaceYAGL(struct yagl_thread_state *ts
     EGLBoolean ret = yagl_host_eglResizeOffscreenSurfaceYAGL(dpy, surface, width, height, bpp, pixels);
     YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, ret);
     yagl_marshal_put_EGLBoolean(&in_buff, ret);
+    return out_buff;
 }
 
 const uint32_t yagl_egl_api_num_funcs = 30;
index 0df1e35..0fd52cc 100644 (file)
@@ -11,7 +11,7 @@
 /*
  * glAlphaFunc dispatcher. id = 1
  */
-static void yagl_func_glAlphaFunc(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glAlphaFunc(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -20,12 +20,13 @@ static void yagl_func_glAlphaFunc(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glAlphaFunc, GLenum, GLclampf, func, ref);
     yagl_host_glAlphaFunc(func, ref);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glClearColor dispatcher. id = 2
  */
-static void yagl_func_glClearColor(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glClearColor(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -36,12 +37,13 @@ static void yagl_func_glClearColor(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT4(ts->ps->id, ts->id, glClearColor, GLclampf, GLclampf, GLclampf, GLclampf, red, green, blue, alpha);
     yagl_host_glClearColor(red, green, blue, alpha);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glClearDepthf dispatcher. id = 3
  */
-static void yagl_func_glClearDepthf(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glClearDepthf(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -49,12 +51,13 @@ static void yagl_func_glClearDepthf(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glClearDepthf, GLclampf, depth);
     yagl_host_glClearDepthf(depth);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glClipPlanef dispatcher. id = 4
  */
-static void yagl_func_glClipPlanef(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glClipPlanef(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -63,12 +66,13 @@ static void yagl_func_glClipPlanef(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glClipPlanef, GLenum, target_ulong, plane, equation);
     yagl_host_glClipPlanef(plane, equation);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glColor4f dispatcher. id = 5
  */
-static void yagl_func_glColor4f(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glColor4f(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -79,12 +83,13 @@ static void yagl_func_glColor4f(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT4(ts->ps->id, ts->id, glColor4f, GLfloat, GLfloat, GLfloat, GLfloat, red, green, blue, alpha);
     yagl_host_glColor4f(red, green, blue, alpha);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glDepthRangef dispatcher. id = 6
  */
-static void yagl_func_glDepthRangef(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glDepthRangef(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -93,12 +98,13 @@ static void yagl_func_glDepthRangef(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glDepthRangef, GLclampf, GLclampf, zNear, zFar);
     yagl_host_glDepthRangef(zNear, zFar);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glFogf dispatcher. id = 7
  */
-static void yagl_func_glFogf(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glFogf(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -107,12 +113,13 @@ static void yagl_func_glFogf(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glFogf, GLenum, GLfloat, pname, param);
     yagl_host_glFogf(pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glFogfv dispatcher. id = 8
  */
-static void yagl_func_glFogfv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glFogfv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -121,12 +128,13 @@ static void yagl_func_glFogfv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glFogfv, GLenum, target_ulong, pname, params);
     yagl_host_glFogfv(pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glFrustumf dispatcher. id = 9
  */
-static void yagl_func_glFrustumf(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glFrustumf(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -139,12 +147,13 @@ static void yagl_func_glFrustumf(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT6(ts->ps->id, ts->id, glFrustumf, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, left, right, bottom, top, zNear, zFar);
     yagl_host_glFrustumf(left, right, bottom, top, zNear, zFar);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGetClipPlanef dispatcher. id = 10
  */
-static void yagl_func_glGetClipPlanef(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGetClipPlanef(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -153,12 +162,13 @@ static void yagl_func_glGetClipPlanef(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glGetClipPlanef, GLenum, target_ulong, pname, eqn);
     yagl_host_glGetClipPlanef(pname, eqn);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGetFloatv dispatcher. id = 11
  */
-static void yagl_func_glGetFloatv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGetFloatv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -167,12 +177,13 @@ static void yagl_func_glGetFloatv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glGetFloatv, GLenum, target_ulong, pname, params);
     yagl_host_glGetFloatv(pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGetLightfv dispatcher. id = 12
  */
-static void yagl_func_glGetLightfv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGetLightfv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -182,12 +193,13 @@ static void yagl_func_glGetLightfv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glGetLightfv, GLenum, GLenum, target_ulong, light, pname, params);
     yagl_host_glGetLightfv(light, pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGetMaterialfv dispatcher. id = 13
  */
-static void yagl_func_glGetMaterialfv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGetMaterialfv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -197,12 +209,13 @@ static void yagl_func_glGetMaterialfv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glGetMaterialfv, GLenum, GLenum, target_ulong, face, pname, params);
     yagl_host_glGetMaterialfv(face, pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGetTexEnvfv dispatcher. id = 14
  */
-static void yagl_func_glGetTexEnvfv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGetTexEnvfv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -212,12 +225,13 @@ static void yagl_func_glGetTexEnvfv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glGetTexEnvfv, GLenum, GLenum, target_ulong, env, pname, params);
     yagl_host_glGetTexEnvfv(env, pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGetTexParameterfv dispatcher. id = 15
  */
-static void yagl_func_glGetTexParameterfv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGetTexParameterfv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -227,12 +241,13 @@ static void yagl_func_glGetTexParameterfv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glGetTexParameterfv, GLenum, GLenum, target_ulong, target, pname, params);
     yagl_host_glGetTexParameterfv(target, pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glLightModelf dispatcher. id = 16
  */
-static void yagl_func_glLightModelf(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glLightModelf(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -241,12 +256,13 @@ static void yagl_func_glLightModelf(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glLightModelf, GLenum, GLfloat, pname, param);
     yagl_host_glLightModelf(pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glLightModelfv dispatcher. id = 17
  */
-static void yagl_func_glLightModelfv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glLightModelfv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -255,12 +271,13 @@ static void yagl_func_glLightModelfv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glLightModelfv, GLenum, target_ulong, pname, params);
     yagl_host_glLightModelfv(pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glLightf dispatcher. id = 18
  */
-static void yagl_func_glLightf(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glLightf(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -270,12 +287,13 @@ static void yagl_func_glLightf(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glLightf, GLenum, GLenum, GLfloat, light, pname, param);
     yagl_host_glLightf(light, pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glLightfv dispatcher. id = 19
  */
-static void yagl_func_glLightfv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glLightfv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -285,12 +303,13 @@ static void yagl_func_glLightfv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glLightfv, GLenum, GLenum, target_ulong, light, pname, params);
     yagl_host_glLightfv(light, pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glLineWidth dispatcher. id = 20
  */
-static void yagl_func_glLineWidth(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glLineWidth(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -298,12 +317,13 @@ static void yagl_func_glLineWidth(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glLineWidth, GLfloat, width);
     yagl_host_glLineWidth(width);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glLoadMatrixf dispatcher. id = 21
  */
-static void yagl_func_glLoadMatrixf(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glLoadMatrixf(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -311,12 +331,13 @@ static void yagl_func_glLoadMatrixf(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glLoadMatrixf, target_ulong, m);
     yagl_host_glLoadMatrixf(m);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glMaterialf dispatcher. id = 22
  */
-static void yagl_func_glMaterialf(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glMaterialf(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -326,12 +347,13 @@ static void yagl_func_glMaterialf(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glMaterialf, GLenum, GLenum, GLfloat, face, pname, param);
     yagl_host_glMaterialf(face, pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glMaterialfv dispatcher. id = 23
  */
-static void yagl_func_glMaterialfv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glMaterialfv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -341,12 +363,13 @@ static void yagl_func_glMaterialfv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glMaterialfv, GLenum, GLenum, target_ulong, face, pname, params);
     yagl_host_glMaterialfv(face, pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glMultMatrixf dispatcher. id = 24
  */
-static void yagl_func_glMultMatrixf(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glMultMatrixf(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -354,12 +377,13 @@ static void yagl_func_glMultMatrixf(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glMultMatrixf, target_ulong, m);
     yagl_host_glMultMatrixf(m);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glMultiTexCoord4f dispatcher. id = 25
  */
-static void yagl_func_glMultiTexCoord4f(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glMultiTexCoord4f(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -371,12 +395,13 @@ static void yagl_func_glMultiTexCoord4f(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT5(ts->ps->id, ts->id, glMultiTexCoord4f, GLenum, GLfloat, GLfloat, GLfloat, GLfloat, target, s, t, r, q);
     yagl_host_glMultiTexCoord4f(target, s, t, r, q);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glNormal3f dispatcher. id = 26
  */
-static void yagl_func_glNormal3f(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glNormal3f(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -386,12 +411,13 @@ static void yagl_func_glNormal3f(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glNormal3f, GLfloat, GLfloat, GLfloat, nx, ny, nz);
     yagl_host_glNormal3f(nx, ny, nz);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glOrthof dispatcher. id = 27
  */
-static void yagl_func_glOrthof(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glOrthof(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -404,12 +430,13 @@ static void yagl_func_glOrthof(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT6(ts->ps->id, ts->id, glOrthof, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, left, right, bottom, top, zNear, zFar);
     yagl_host_glOrthof(left, right, bottom, top, zNear, zFar);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glPointParameterf dispatcher. id = 28
  */
-static void yagl_func_glPointParameterf(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glPointParameterf(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -418,12 +445,13 @@ static void yagl_func_glPointParameterf(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glPointParameterf, GLenum, GLfloat, pname, param);
     yagl_host_glPointParameterf(pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glPointParameterfv dispatcher. id = 29
  */
-static void yagl_func_glPointParameterfv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glPointParameterfv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -432,12 +460,13 @@ static void yagl_func_glPointParameterfv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glPointParameterfv, GLenum, target_ulong, pname, params);
     yagl_host_glPointParameterfv(pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glPointSize dispatcher. id = 30
  */
-static void yagl_func_glPointSize(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glPointSize(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -445,12 +474,13 @@ static void yagl_func_glPointSize(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glPointSize, GLfloat, size);
     yagl_host_glPointSize(size);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glPolygonOffset dispatcher. id = 31
  */
-static void yagl_func_glPolygonOffset(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glPolygonOffset(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -459,12 +489,13 @@ static void yagl_func_glPolygonOffset(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glPolygonOffset, GLfloat, GLfloat, factor, units);
     yagl_host_glPolygonOffset(factor, units);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glRotatef dispatcher. id = 32
  */
-static void yagl_func_glRotatef(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glRotatef(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -475,12 +506,13 @@ static void yagl_func_glRotatef(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT4(ts->ps->id, ts->id, glRotatef, GLfloat, GLfloat, GLfloat, GLfloat, angle, x, y, z);
     yagl_host_glRotatef(angle, x, y, z);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glScalef dispatcher. id = 33
  */
-static void yagl_func_glScalef(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glScalef(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -490,12 +522,13 @@ static void yagl_func_glScalef(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glScalef, GLfloat, GLfloat, GLfloat, x, y, z);
     yagl_host_glScalef(x, y, z);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glTexEnvf dispatcher. id = 34
  */
-static void yagl_func_glTexEnvf(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glTexEnvf(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -505,12 +538,13 @@ static void yagl_func_glTexEnvf(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glTexEnvf, GLenum, GLenum, GLfloat, target, pname, param);
     yagl_host_glTexEnvf(target, pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glTexEnvfv dispatcher. id = 35
  */
-static void yagl_func_glTexEnvfv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glTexEnvfv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -520,12 +554,13 @@ static void yagl_func_glTexEnvfv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glTexEnvfv, GLenum, GLenum, target_ulong, target, pname, params);
     yagl_host_glTexEnvfv(target, pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glTexParameterf dispatcher. id = 36
  */
-static void yagl_func_glTexParameterf(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glTexParameterf(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -535,12 +570,13 @@ static void yagl_func_glTexParameterf(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glTexParameterf, GLenum, GLenum, GLfloat, target, pname, param);
     yagl_host_glTexParameterf(target, pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glTexParameterfv dispatcher. id = 37
  */
-static void yagl_func_glTexParameterfv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glTexParameterfv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -550,12 +586,13 @@ static void yagl_func_glTexParameterfv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glTexParameterfv, GLenum, GLenum, target_ulong, target, pname, params);
     yagl_host_glTexParameterfv(target, pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glTranslatef dispatcher. id = 38
  */
-static void yagl_func_glTranslatef(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glTranslatef(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -565,12 +602,13 @@ static void yagl_func_glTranslatef(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glTranslatef, GLfloat, GLfloat, GLfloat, x, y, z);
     yagl_host_glTranslatef(x, y, z);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glActiveTexture dispatcher. id = 39
  */
-static void yagl_func_glActiveTexture(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glActiveTexture(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -578,12 +616,13 @@ static void yagl_func_glActiveTexture(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glActiveTexture, GLenum, texture);
     yagl_host_glActiveTexture(texture);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glAlphaFuncx dispatcher. id = 40
  */
-static void yagl_func_glAlphaFuncx(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glAlphaFuncx(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -592,12 +631,13 @@ static void yagl_func_glAlphaFuncx(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glAlphaFuncx, GLenum, GLclampx, func, ref);
     yagl_host_glAlphaFuncx(func, ref);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glBindBuffer dispatcher. id = 41
  */
-static void yagl_func_glBindBuffer(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glBindBuffer(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -606,12 +646,13 @@ static void yagl_func_glBindBuffer(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glBindBuffer, GLenum, GLuint, target, buffer);
     yagl_host_glBindBuffer(target, buffer);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glBindTexture dispatcher. id = 42
  */
-static void yagl_func_glBindTexture(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glBindTexture(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -620,12 +661,13 @@ static void yagl_func_glBindTexture(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glBindTexture, GLenum, GLuint, target, texture);
     yagl_host_glBindTexture(target, texture);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glBlendFunc dispatcher. id = 43
  */
-static void yagl_func_glBlendFunc(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glBlendFunc(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -634,12 +676,13 @@ static void yagl_func_glBlendFunc(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glBlendFunc, GLenum, GLenum, sfactor, dfactor);
     yagl_host_glBlendFunc(sfactor, dfactor);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glBufferData dispatcher. id = 44
  */
-static void yagl_func_glBufferData(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glBufferData(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -650,12 +693,13 @@ static void yagl_func_glBufferData(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT4(ts->ps->id, ts->id, glBufferData, GLenum, GLsizeiptr, target_ulong, GLenum, target, size, data, usage);
     yagl_host_glBufferData(target, size, data, usage);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glBufferSubData dispatcher. id = 45
  */
-static void yagl_func_glBufferSubData(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glBufferSubData(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -666,12 +710,13 @@ static void yagl_func_glBufferSubData(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT4(ts->ps->id, ts->id, glBufferSubData, GLenum, GLintptr, GLsizeiptr, target_ulong, target, offset, size, data);
     yagl_host_glBufferSubData(target, offset, size, data);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glClear dispatcher. id = 46
  */
-static void yagl_func_glClear(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glClear(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -679,12 +724,13 @@ static void yagl_func_glClear(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glClear, GLbitfield, mask);
     yagl_host_glClear(mask);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glClearColorx dispatcher. id = 47
  */
-static void yagl_func_glClearColorx(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glClearColorx(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -695,12 +741,13 @@ static void yagl_func_glClearColorx(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT4(ts->ps->id, ts->id, glClearColorx, GLclampx, GLclampx, GLclampx, GLclampx, red, green, blue, alpha);
     yagl_host_glClearColorx(red, green, blue, alpha);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glClearDepthx dispatcher. id = 48
  */
-static void yagl_func_glClearDepthx(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glClearDepthx(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -708,12 +755,13 @@ static void yagl_func_glClearDepthx(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glClearDepthx, GLclampx, depth);
     yagl_host_glClearDepthx(depth);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glClearStencil dispatcher. id = 49
  */
-static void yagl_func_glClearStencil(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glClearStencil(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -721,12 +769,13 @@ static void yagl_func_glClearStencil(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glClearStencil, GLint, s);
     yagl_host_glClearStencil(s);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glClientActiveTexture dispatcher. id = 50
  */
-static void yagl_func_glClientActiveTexture(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glClientActiveTexture(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -734,12 +783,13 @@ static void yagl_func_glClientActiveTexture(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glClientActiveTexture, GLenum, texture);
     yagl_host_glClientActiveTexture(texture);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glClipPlanex dispatcher. id = 51
  */
-static void yagl_func_glClipPlanex(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glClipPlanex(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -748,12 +798,13 @@ static void yagl_func_glClipPlanex(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glClipPlanex, GLenum, target_ulong, plane, equation);
     yagl_host_glClipPlanex(plane, equation);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glColor4ub dispatcher. id = 52
  */
-static void yagl_func_glColor4ub(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glColor4ub(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -764,12 +815,13 @@ static void yagl_func_glColor4ub(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT4(ts->ps->id, ts->id, glColor4ub, GLubyte, GLubyte, GLubyte, GLubyte, red, green, blue, alpha);
     yagl_host_glColor4ub(red, green, blue, alpha);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glColor4x dispatcher. id = 53
  */
-static void yagl_func_glColor4x(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glColor4x(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -780,12 +832,13 @@ static void yagl_func_glColor4x(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT4(ts->ps->id, ts->id, glColor4x, GLfixed, GLfixed, GLfixed, GLfixed, red, green, blue, alpha);
     yagl_host_glColor4x(red, green, blue, alpha);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glColorMask dispatcher. id = 54
  */
-static void yagl_func_glColorMask(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glColorMask(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -796,12 +849,13 @@ static void yagl_func_glColorMask(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT4(ts->ps->id, ts->id, glColorMask, GLboolean, GLboolean, GLboolean, GLboolean, red, green, blue, alpha);
     yagl_host_glColorMask(red, green, blue, alpha);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glColorPointer dispatcher. id = 55
  */
-static void yagl_func_glColorPointer(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glColorPointer(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -812,12 +866,13 @@ static void yagl_func_glColorPointer(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT4(ts->ps->id, ts->id, glColorPointer, GLint, GLenum, GLsizei, target_ulong, size, type, stride, pointer);
     yagl_host_glColorPointer(size, type, stride, pointer);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glCompressedTexImage2D dispatcher. id = 56
  */
-static void yagl_func_glCompressedTexImage2D(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glCompressedTexImage2D(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -832,12 +887,13 @@ static void yagl_func_glCompressedTexImage2D(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT8(ts->ps->id, ts->id, glCompressedTexImage2D, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, target_ulong, target, level, internalformat, width, height, border, imageSize, data);
     yagl_host_glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glCompressedTexSubImage2D dispatcher. id = 57
  */
-static void yagl_func_glCompressedTexSubImage2D(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glCompressedTexSubImage2D(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -853,12 +909,13 @@ static void yagl_func_glCompressedTexSubImage2D(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT9(ts->ps->id, ts->id, glCompressedTexSubImage2D, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, target_ulong, target, level, xoffset, yoffset, width, height, format, imageSize, data);
     yagl_host_glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glCopyTexImage2D dispatcher. id = 58
  */
-static void yagl_func_glCopyTexImage2D(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glCopyTexImage2D(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -873,12 +930,13 @@ static void yagl_func_glCopyTexImage2D(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT8(ts->ps->id, ts->id, glCopyTexImage2D, GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint, target, level, internalformat, x, y, width, height, border);
     yagl_host_glCopyTexImage2D(target, level, internalformat, x, y, width, height, border);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glCopyTexSubImage2D dispatcher. id = 59
  */
-static void yagl_func_glCopyTexSubImage2D(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glCopyTexSubImage2D(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -893,12 +951,13 @@ static void yagl_func_glCopyTexSubImage2D(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT8(ts->ps->id, ts->id, glCopyTexSubImage2D, GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, target, level, xoffset, yoffset, x, y, width, height);
     yagl_host_glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glCullFace dispatcher. id = 60
  */
-static void yagl_func_glCullFace(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glCullFace(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -906,12 +965,13 @@ static void yagl_func_glCullFace(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glCullFace, GLenum, mode);
     yagl_host_glCullFace(mode);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glDeleteBuffers dispatcher. id = 61
  */
-static void yagl_func_glDeleteBuffers(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glDeleteBuffers(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -920,12 +980,13 @@ static void yagl_func_glDeleteBuffers(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glDeleteBuffers, GLsizei, target_ulong, n, buffers);
     yagl_host_glDeleteBuffers(n, buffers);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glDeleteTextures dispatcher. id = 62
  */
-static void yagl_func_glDeleteTextures(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glDeleteTextures(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -934,12 +995,13 @@ static void yagl_func_glDeleteTextures(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glDeleteTextures, GLsizei, target_ulong, n, textures);
     yagl_host_glDeleteTextures(n, textures);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glDepthFunc dispatcher. id = 63
  */
-static void yagl_func_glDepthFunc(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glDepthFunc(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -947,12 +1009,13 @@ static void yagl_func_glDepthFunc(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glDepthFunc, GLenum, func);
     yagl_host_glDepthFunc(func);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glDepthMask dispatcher. id = 64
  */
-static void yagl_func_glDepthMask(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glDepthMask(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -960,12 +1023,13 @@ static void yagl_func_glDepthMask(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glDepthMask, GLboolean, flag);
     yagl_host_glDepthMask(flag);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glDepthRangex dispatcher. id = 65
  */
-static void yagl_func_glDepthRangex(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glDepthRangex(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -974,12 +1038,13 @@ static void yagl_func_glDepthRangex(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glDepthRangex, GLclampx, GLclampx, zNear, zFar);
     yagl_host_glDepthRangex(zNear, zFar);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glDisable dispatcher. id = 66
  */
-static void yagl_func_glDisable(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glDisable(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -987,12 +1052,13 @@ static void yagl_func_glDisable(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glDisable, GLenum, cap);
     yagl_host_glDisable(cap);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glDisableClientState dispatcher. id = 67
  */
-static void yagl_func_glDisableClientState(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glDisableClientState(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1000,12 +1066,13 @@ static void yagl_func_glDisableClientState(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glDisableClientState, GLenum, array);
     yagl_host_glDisableClientState(array);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glDrawArrays dispatcher. id = 68
  */
-static void yagl_func_glDrawArrays(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glDrawArrays(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1015,12 +1082,13 @@ static void yagl_func_glDrawArrays(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glDrawArrays, GLenum, GLint, GLsizei, mode, first, count);
     yagl_host_glDrawArrays(mode, first, count);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glDrawElements dispatcher. id = 69
  */
-static void yagl_func_glDrawElements(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glDrawElements(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1031,12 +1099,13 @@ static void yagl_func_glDrawElements(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT4(ts->ps->id, ts->id, glDrawElements, GLenum, GLsizei, GLenum, target_ulong, mode, count, type, indices);
     yagl_host_glDrawElements(mode, count, type, indices);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glEnable dispatcher. id = 70
  */
-static void yagl_func_glEnable(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glEnable(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1044,12 +1113,13 @@ static void yagl_func_glEnable(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glEnable, GLenum, cap);
     yagl_host_glEnable(cap);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glEnableClientState dispatcher. id = 71
  */
-static void yagl_func_glEnableClientState(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glEnableClientState(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1057,36 +1127,39 @@ static void yagl_func_glEnableClientState(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glEnableClientState, GLenum, array);
     yagl_host_glEnableClientState(array);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glFinish dispatcher. id = 72
  */
-static void yagl_func_glFinish(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glFinish(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
     YAGL_LOG_FUNC_ENTER_SPLIT0(ts->ps->id, ts->id, glFinish);
     yagl_host_glFinish();
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glFlush dispatcher. id = 73
  */
-static void yagl_func_glFlush(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glFlush(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
     YAGL_LOG_FUNC_ENTER_SPLIT0(ts->ps->id, ts->id, glFlush);
     yagl_host_glFlush();
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glFogx dispatcher. id = 74
  */
-static void yagl_func_glFogx(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glFogx(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1095,12 +1168,13 @@ static void yagl_func_glFogx(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glFogx, GLenum, GLfixed, pname, param);
     yagl_host_glFogx(pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glFogxv dispatcher. id = 75
  */
-static void yagl_func_glFogxv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glFogxv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1109,12 +1183,13 @@ static void yagl_func_glFogxv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glFogxv, GLenum, target_ulong, pname, params);
     yagl_host_glFogxv(pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glFrontFace dispatcher. id = 76
  */
-static void yagl_func_glFrontFace(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glFrontFace(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1122,12 +1197,13 @@ static void yagl_func_glFrontFace(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glFrontFace, GLenum, mode);
     yagl_host_glFrontFace(mode);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glFrustumx dispatcher. id = 77
  */
-static void yagl_func_glFrustumx(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glFrustumx(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1140,12 +1216,13 @@ static void yagl_func_glFrustumx(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT6(ts->ps->id, ts->id, glFrustumx, GLfixed, GLfixed, GLfixed, GLfixed, GLfixed, GLfixed, left, right, bottom, top, zNear, zFar);
     yagl_host_glFrustumx(left, right, bottom, top, zNear, zFar);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGetBooleanv dispatcher. id = 78
  */
-static void yagl_func_glGetBooleanv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGetBooleanv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1154,12 +1231,13 @@ static void yagl_func_glGetBooleanv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glGetBooleanv, GLenum, target_ulong, pname, params);
     yagl_host_glGetBooleanv(pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGetBufferParameteriv dispatcher. id = 79
  */
-static void yagl_func_glGetBufferParameteriv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGetBufferParameteriv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1169,12 +1247,13 @@ static void yagl_func_glGetBufferParameteriv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glGetBufferParameteriv, GLenum, GLenum, target_ulong, target, pname, params);
     yagl_host_glGetBufferParameteriv(target, pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGetClipPlanex dispatcher. id = 80
  */
-static void yagl_func_glGetClipPlanex(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGetClipPlanex(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1183,12 +1262,13 @@ static void yagl_func_glGetClipPlanex(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glGetClipPlanex, GLenum, target_ulong, pname, eqn);
     yagl_host_glGetClipPlanex(pname, eqn);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGenBuffers dispatcher. id = 81
  */
-static void yagl_func_glGenBuffers(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGenBuffers(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1197,12 +1277,13 @@ static void yagl_func_glGenBuffers(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glGenBuffers, GLsizei, target_ulong, n, buffers);
     yagl_host_glGenBuffers(n, buffers);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGenTextures dispatcher. id = 82
  */
-static void yagl_func_glGenTextures(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGenTextures(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1211,12 +1292,13 @@ static void yagl_func_glGenTextures(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glGenTextures, GLsizei, target_ulong, n, textures);
     yagl_host_glGenTextures(n, textures);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGetError dispatcher. id = 83
  */
-static void yagl_func_glGetError(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGetError(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1224,12 +1306,13 @@ static void yagl_func_glGetError(struct yagl_thread_state *ts,
     GLenum ret = yagl_host_glGetError();
     YAGL_LOG_FUNC_EXIT_SPLIT(GLenum, ret);
     yagl_marshal_put_GLenum(&in_buff, ret);
+    return out_buff;
 }
 
 /*
  * glGetFixedv dispatcher. id = 84
  */
-static void yagl_func_glGetFixedv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGetFixedv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1238,12 +1321,13 @@ static void yagl_func_glGetFixedv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glGetFixedv, GLenum, target_ulong, pname, params);
     yagl_host_glGetFixedv(pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGetIntegerv dispatcher. id = 85
  */
-static void yagl_func_glGetIntegerv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGetIntegerv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1252,12 +1336,13 @@ static void yagl_func_glGetIntegerv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glGetIntegerv, GLenum, target_ulong, pname, params);
     yagl_host_glGetIntegerv(pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGetLightxv dispatcher. id = 86
  */
-static void yagl_func_glGetLightxv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGetLightxv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1267,12 +1352,13 @@ static void yagl_func_glGetLightxv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glGetLightxv, GLenum, GLenum, target_ulong, light, pname, params);
     yagl_host_glGetLightxv(light, pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGetMaterialxv dispatcher. id = 87
  */
-static void yagl_func_glGetMaterialxv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGetMaterialxv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1282,12 +1368,13 @@ static void yagl_func_glGetMaterialxv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glGetMaterialxv, GLenum, GLenum, target_ulong, face, pname, params);
     yagl_host_glGetMaterialxv(face, pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGetPointerv dispatcher. id = 88
  */
-static void yagl_func_glGetPointerv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGetPointerv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1296,12 +1383,13 @@ static void yagl_func_glGetPointerv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glGetPointerv, GLenum, target_ulong, pname, params);
     yagl_host_glGetPointerv(pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGetTexEnviv dispatcher. id = 89
  */
-static void yagl_func_glGetTexEnviv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGetTexEnviv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1311,12 +1399,13 @@ static void yagl_func_glGetTexEnviv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glGetTexEnviv, GLenum, GLenum, target_ulong, env, pname, params);
     yagl_host_glGetTexEnviv(env, pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGetTexEnvxv dispatcher. id = 90
  */
-static void yagl_func_glGetTexEnvxv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGetTexEnvxv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1326,12 +1415,13 @@ static void yagl_func_glGetTexEnvxv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glGetTexEnvxv, GLenum, GLenum, target_ulong, env, pname, params);
     yagl_host_glGetTexEnvxv(env, pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGetTexParameteriv dispatcher. id = 91
  */
-static void yagl_func_glGetTexParameteriv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGetTexParameteriv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1341,12 +1431,13 @@ static void yagl_func_glGetTexParameteriv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glGetTexParameteriv, GLenum, GLenum, target_ulong, target, pname, params);
     yagl_host_glGetTexParameteriv(target, pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGetTexParameterxv dispatcher. id = 92
  */
-static void yagl_func_glGetTexParameterxv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGetTexParameterxv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1356,12 +1447,13 @@ static void yagl_func_glGetTexParameterxv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glGetTexParameterxv, GLenum, GLenum, target_ulong, target, pname, params);
     yagl_host_glGetTexParameterxv(target, pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glHint dispatcher. id = 93
  */
-static void yagl_func_glHint(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glHint(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1370,12 +1462,13 @@ static void yagl_func_glHint(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glHint, GLenum, GLenum, target, mode);
     yagl_host_glHint(target, mode);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glIsBuffer dispatcher. id = 94
  */
-static void yagl_func_glIsBuffer(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glIsBuffer(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1384,12 +1477,13 @@ static void yagl_func_glIsBuffer(struct yagl_thread_state *ts,
     GLboolean ret = yagl_host_glIsBuffer(buffer);
     YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, ret);
     yagl_marshal_put_GLboolean(&in_buff, ret);
+    return out_buff;
 }
 
 /*
  * glIsEnabled dispatcher. id = 95
  */
-static void yagl_func_glIsEnabled(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glIsEnabled(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1398,12 +1492,13 @@ static void yagl_func_glIsEnabled(struct yagl_thread_state *ts,
     GLboolean ret = yagl_host_glIsEnabled(cap);
     YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, ret);
     yagl_marshal_put_GLboolean(&in_buff, ret);
+    return out_buff;
 }
 
 /*
  * glIsTexture dispatcher. id = 96
  */
-static void yagl_func_glIsTexture(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glIsTexture(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1412,12 +1507,13 @@ static void yagl_func_glIsTexture(struct yagl_thread_state *ts,
     GLboolean ret = yagl_host_glIsTexture(texture);
     YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, ret);
     yagl_marshal_put_GLboolean(&in_buff, ret);
+    return out_buff;
 }
 
 /*
  * glLightModelx dispatcher. id = 97
  */
-static void yagl_func_glLightModelx(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glLightModelx(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1426,12 +1522,13 @@ static void yagl_func_glLightModelx(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glLightModelx, GLenum, GLfixed, pname, param);
     yagl_host_glLightModelx(pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glLightModelxv dispatcher. id = 98
  */
-static void yagl_func_glLightModelxv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glLightModelxv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1440,12 +1537,13 @@ static void yagl_func_glLightModelxv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glLightModelxv, GLenum, target_ulong, pname, params);
     yagl_host_glLightModelxv(pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glLightx dispatcher. id = 99
  */
-static void yagl_func_glLightx(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glLightx(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1455,12 +1553,13 @@ static void yagl_func_glLightx(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glLightx, GLenum, GLenum, GLfixed, light, pname, param);
     yagl_host_glLightx(light, pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glLightxv dispatcher. id = 100
  */
-static void yagl_func_glLightxv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glLightxv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1470,12 +1569,13 @@ static void yagl_func_glLightxv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glLightxv, GLenum, GLenum, target_ulong, light, pname, params);
     yagl_host_glLightxv(light, pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glLineWidthx dispatcher. id = 101
  */
-static void yagl_func_glLineWidthx(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glLineWidthx(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1483,24 +1583,26 @@ static void yagl_func_glLineWidthx(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glLineWidthx, GLfixed, width);
     yagl_host_glLineWidthx(width);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glLoadIdentity dispatcher. id = 102
  */
-static void yagl_func_glLoadIdentity(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glLoadIdentity(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
     YAGL_LOG_FUNC_ENTER_SPLIT0(ts->ps->id, ts->id, glLoadIdentity);
     yagl_host_glLoadIdentity();
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glLoadMatrixx dispatcher. id = 103
  */
-static void yagl_func_glLoadMatrixx(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glLoadMatrixx(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1508,12 +1610,13 @@ static void yagl_func_glLoadMatrixx(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glLoadMatrixx, target_ulong, m);
     yagl_host_glLoadMatrixx(m);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glLogicOp dispatcher. id = 104
  */
-static void yagl_func_glLogicOp(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glLogicOp(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1521,12 +1624,13 @@ static void yagl_func_glLogicOp(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glLogicOp, GLenum, opcode);
     yagl_host_glLogicOp(opcode);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glMaterialx dispatcher. id = 105
  */
-static void yagl_func_glMaterialx(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glMaterialx(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1536,12 +1640,13 @@ static void yagl_func_glMaterialx(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glMaterialx, GLenum, GLenum, GLfixed, face, pname, param);
     yagl_host_glMaterialx(face, pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glMaterialxv dispatcher. id = 106
  */
-static void yagl_func_glMaterialxv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glMaterialxv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1551,12 +1656,13 @@ static void yagl_func_glMaterialxv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glMaterialxv, GLenum, GLenum, target_ulong, face, pname, params);
     yagl_host_glMaterialxv(face, pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glMatrixMode dispatcher. id = 107
  */
-static void yagl_func_glMatrixMode(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glMatrixMode(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1564,12 +1670,13 @@ static void yagl_func_glMatrixMode(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glMatrixMode, GLenum, mode);
     yagl_host_glMatrixMode(mode);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glMultMatrixx dispatcher. id = 108
  */
-static void yagl_func_glMultMatrixx(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glMultMatrixx(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1577,12 +1684,13 @@ static void yagl_func_glMultMatrixx(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glMultMatrixx, target_ulong, m);
     yagl_host_glMultMatrixx(m);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glMultiTexCoord4x dispatcher. id = 109
  */
-static void yagl_func_glMultiTexCoord4x(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glMultiTexCoord4x(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1594,12 +1702,13 @@ static void yagl_func_glMultiTexCoord4x(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT5(ts->ps->id, ts->id, glMultiTexCoord4x, GLenum, GLfixed, GLfixed, GLfixed, GLfixed, target, s, t, r, q);
     yagl_host_glMultiTexCoord4x(target, s, t, r, q);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glNormal3x dispatcher. id = 110
  */
-static void yagl_func_glNormal3x(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glNormal3x(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1609,12 +1718,13 @@ static void yagl_func_glNormal3x(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glNormal3x, GLfixed, GLfixed, GLfixed, nx, ny, nz);
     yagl_host_glNormal3x(nx, ny, nz);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glNormalPointer dispatcher. id = 111
  */
-static void yagl_func_glNormalPointer(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glNormalPointer(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1624,12 +1734,13 @@ static void yagl_func_glNormalPointer(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glNormalPointer, GLenum, GLsizei, target_ulong, type, stride, pointer);
     yagl_host_glNormalPointer(type, stride, pointer);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glOrthox dispatcher. id = 112
  */
-static void yagl_func_glOrthox(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glOrthox(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1642,12 +1753,13 @@ static void yagl_func_glOrthox(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT6(ts->ps->id, ts->id, glOrthox, GLfixed, GLfixed, GLfixed, GLfixed, GLfixed, GLfixed, left, right, bottom, top, zNear, zFar);
     yagl_host_glOrthox(left, right, bottom, top, zNear, zFar);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glPixelStorei dispatcher. id = 113
  */
-static void yagl_func_glPixelStorei(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glPixelStorei(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1656,12 +1768,13 @@ static void yagl_func_glPixelStorei(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glPixelStorei, GLenum, GLint, pname, param);
     yagl_host_glPixelStorei(pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glPointParameterx dispatcher. id = 114
  */
-static void yagl_func_glPointParameterx(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glPointParameterx(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1670,12 +1783,13 @@ static void yagl_func_glPointParameterx(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glPointParameterx, GLenum, GLfixed, pname, param);
     yagl_host_glPointParameterx(pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glPointParameterxv dispatcher. id = 115
  */
-static void yagl_func_glPointParameterxv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glPointParameterxv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1684,12 +1798,13 @@ static void yagl_func_glPointParameterxv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glPointParameterxv, GLenum, target_ulong, pname, params);
     yagl_host_glPointParameterxv(pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glPointSizex dispatcher. id = 116
  */
-static void yagl_func_glPointSizex(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glPointSizex(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1697,12 +1812,13 @@ static void yagl_func_glPointSizex(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glPointSizex, GLfixed, size);
     yagl_host_glPointSizex(size);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glPolygonOffsetx dispatcher. id = 117
  */
-static void yagl_func_glPolygonOffsetx(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glPolygonOffsetx(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1711,36 +1827,39 @@ static void yagl_func_glPolygonOffsetx(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glPolygonOffsetx, GLfixed, GLfixed, factor, units);
     yagl_host_glPolygonOffsetx(factor, units);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glPopMatrix dispatcher. id = 118
  */
-static void yagl_func_glPopMatrix(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glPopMatrix(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
     YAGL_LOG_FUNC_ENTER_SPLIT0(ts->ps->id, ts->id, glPopMatrix);
     yagl_host_glPopMatrix();
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glPushMatrix dispatcher. id = 119
  */
-static void yagl_func_glPushMatrix(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glPushMatrix(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
     YAGL_LOG_FUNC_ENTER_SPLIT0(ts->ps->id, ts->id, glPushMatrix);
     yagl_host_glPushMatrix();
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glReadPixels dispatcher. id = 120
  */
-static void yagl_func_glReadPixels(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glReadPixels(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1754,12 +1873,13 @@ static void yagl_func_glReadPixels(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT7(ts->ps->id, ts->id, glReadPixels, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, target_ulong, x, y, width, height, format, type, pixels);
     yagl_host_glReadPixels(x, y, width, height, format, type, pixels);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glRotatex dispatcher. id = 121
  */
-static void yagl_func_glRotatex(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glRotatex(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1770,12 +1890,13 @@ static void yagl_func_glRotatex(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT4(ts->ps->id, ts->id, glRotatex, GLfixed, GLfixed, GLfixed, GLfixed, angle, x, y, z);
     yagl_host_glRotatex(angle, x, y, z);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glSampleCoverage dispatcher. id = 122
  */
-static void yagl_func_glSampleCoverage(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glSampleCoverage(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1784,12 +1905,13 @@ static void yagl_func_glSampleCoverage(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glSampleCoverage, GLclampf, GLboolean, value, invert);
     yagl_host_glSampleCoverage(value, invert);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glSampleCoveragex dispatcher. id = 123
  */
-static void yagl_func_glSampleCoveragex(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glSampleCoveragex(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1798,12 +1920,13 @@ static void yagl_func_glSampleCoveragex(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glSampleCoveragex, GLclampx, GLboolean, value, invert);
     yagl_host_glSampleCoveragex(value, invert);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glScalex dispatcher. id = 124
  */
-static void yagl_func_glScalex(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glScalex(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1813,12 +1936,13 @@ static void yagl_func_glScalex(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glScalex, GLfixed, GLfixed, GLfixed, x, y, z);
     yagl_host_glScalex(x, y, z);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glScissor dispatcher. id = 125
  */
-static void yagl_func_glScissor(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glScissor(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1829,12 +1953,13 @@ static void yagl_func_glScissor(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT4(ts->ps->id, ts->id, glScissor, GLint, GLint, GLsizei, GLsizei, x, y, width, height);
     yagl_host_glScissor(x, y, width, height);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glShadeModel dispatcher. id = 126
  */
-static void yagl_func_glShadeModel(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glShadeModel(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1842,12 +1967,13 @@ static void yagl_func_glShadeModel(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glShadeModel, GLenum, mode);
     yagl_host_glShadeModel(mode);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glStencilFunc dispatcher. id = 127
  */
-static void yagl_func_glStencilFunc(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glStencilFunc(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1857,12 +1983,13 @@ static void yagl_func_glStencilFunc(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glStencilFunc, GLenum, GLint, GLuint, func, ref, mask);
     yagl_host_glStencilFunc(func, ref, mask);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glStencilMask dispatcher. id = 128
  */
-static void yagl_func_glStencilMask(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glStencilMask(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1870,12 +1997,13 @@ static void yagl_func_glStencilMask(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glStencilMask, GLuint, mask);
     yagl_host_glStencilMask(mask);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glStencilOp dispatcher. id = 129
  */
-static void yagl_func_glStencilOp(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glStencilOp(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1885,12 +2013,13 @@ static void yagl_func_glStencilOp(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glStencilOp, GLenum, GLenum, GLenum, fail, zfail, zpass);
     yagl_host_glStencilOp(fail, zfail, zpass);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glTexCoordPointer dispatcher. id = 130
  */
-static void yagl_func_glTexCoordPointer(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glTexCoordPointer(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1901,12 +2030,13 @@ static void yagl_func_glTexCoordPointer(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT4(ts->ps->id, ts->id, glTexCoordPointer, GLint, GLenum, GLsizei, target_ulong, size, type, stride, pointer);
     yagl_host_glTexCoordPointer(size, type, stride, pointer);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glTexEnvi dispatcher. id = 131
  */
-static void yagl_func_glTexEnvi(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glTexEnvi(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1916,12 +2046,13 @@ static void yagl_func_glTexEnvi(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glTexEnvi, GLenum, GLenum, GLint, target, pname, param);
     yagl_host_glTexEnvi(target, pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glTexEnvx dispatcher. id = 132
  */
-static void yagl_func_glTexEnvx(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glTexEnvx(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1931,12 +2062,13 @@ static void yagl_func_glTexEnvx(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glTexEnvx, GLenum, GLenum, GLfixed, target, pname, param);
     yagl_host_glTexEnvx(target, pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glTexEnviv dispatcher. id = 133
  */
-static void yagl_func_glTexEnviv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glTexEnviv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1946,12 +2078,13 @@ static void yagl_func_glTexEnviv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glTexEnviv, GLenum, GLenum, target_ulong, target, pname, params);
     yagl_host_glTexEnviv(target, pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glTexEnvxv dispatcher. id = 134
  */
-static void yagl_func_glTexEnvxv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glTexEnvxv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1961,12 +2094,13 @@ static void yagl_func_glTexEnvxv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glTexEnvxv, GLenum, GLenum, target_ulong, target, pname, params);
     yagl_host_glTexEnvxv(target, pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glTexImage2D dispatcher. id = 135
  */
-static void yagl_func_glTexImage2D(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glTexImage2D(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1982,12 +2116,13 @@ static void yagl_func_glTexImage2D(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT9(ts->ps->id, ts->id, glTexImage2D, GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, target_ulong, target, level, internalformat, width, height, border, format, type, pixels);
     yagl_host_glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glTexParameteri dispatcher. id = 136
  */
-static void yagl_func_glTexParameteri(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glTexParameteri(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1997,12 +2132,13 @@ static void yagl_func_glTexParameteri(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glTexParameteri, GLenum, GLenum, GLint, target, pname, param);
     yagl_host_glTexParameteri(target, pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glTexParameterx dispatcher. id = 137
  */
-static void yagl_func_glTexParameterx(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glTexParameterx(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -2012,12 +2148,13 @@ static void yagl_func_glTexParameterx(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glTexParameterx, GLenum, GLenum, GLfixed, target, pname, param);
     yagl_host_glTexParameterx(target, pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glTexParameteriv dispatcher. id = 138
  */
-static void yagl_func_glTexParameteriv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glTexParameteriv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -2027,12 +2164,13 @@ static void yagl_func_glTexParameteriv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glTexParameteriv, GLenum, GLenum, target_ulong, target, pname, params);
     yagl_host_glTexParameteriv(target, pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glTexParameterxv dispatcher. id = 139
  */
-static void yagl_func_glTexParameterxv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glTexParameterxv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -2042,12 +2180,13 @@ static void yagl_func_glTexParameterxv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glTexParameterxv, GLenum, GLenum, target_ulong, target, pname, params);
     yagl_host_glTexParameterxv(target, pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glTexSubImage2D dispatcher. id = 140
  */
-static void yagl_func_glTexSubImage2D(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glTexSubImage2D(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -2063,12 +2202,13 @@ static void yagl_func_glTexSubImage2D(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT9(ts->ps->id, ts->id, glTexSubImage2D, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, target_ulong, target, level, xoffset, yoffset, width, height, format, type, pixels);
     yagl_host_glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glTranslatex dispatcher. id = 141
  */
-static void yagl_func_glTranslatex(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glTranslatex(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -2078,12 +2218,13 @@ static void yagl_func_glTranslatex(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glTranslatex, GLfixed, GLfixed, GLfixed, x, y, z);
     yagl_host_glTranslatex(x, y, z);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glVertexPointer dispatcher. id = 142
  */
-static void yagl_func_glVertexPointer(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glVertexPointer(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -2094,12 +2235,13 @@ static void yagl_func_glVertexPointer(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT4(ts->ps->id, ts->id, glVertexPointer, GLint, GLenum, GLsizei, target_ulong, size, type, stride, pointer);
     yagl_host_glVertexPointer(size, type, stride, pointer);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glViewport dispatcher. id = 143
  */
-static void yagl_func_glViewport(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glViewport(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -2110,6 +2252,7 @@ static void yagl_func_glViewport(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT4(ts->ps->id, ts->id, glViewport, GLint, GLint, GLsizei, GLsizei, x, y, width, height);
     yagl_host_glViewport(x, y, width, height);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 const uint32_t yagl_gles1_api_num_funcs = 143;
index 10e26e1..8a1a0e6 100644 (file)
@@ -11,7 +11,7 @@
 /*
  * glActiveTexture dispatcher. id = 1
  */
-static void yagl_func_glActiveTexture(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glActiveTexture(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -19,12 +19,13 @@ static void yagl_func_glActiveTexture(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glActiveTexture, GLenum, texture);
     yagl_host_glActiveTexture(texture);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glAttachShader dispatcher. id = 2
  */
-static void yagl_func_glAttachShader(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glAttachShader(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -33,12 +34,13 @@ static void yagl_func_glAttachShader(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glAttachShader, GLuint, GLuint, program, shader);
     yagl_host_glAttachShader(program, shader);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glBindAttribLocation dispatcher. id = 3
  */
-static void yagl_func_glBindAttribLocation(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glBindAttribLocation(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -48,12 +50,13 @@ static void yagl_func_glBindAttribLocation(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glBindAttribLocation, GLuint, GLuint, target_ulong, program, index, name);
     yagl_host_glBindAttribLocation(program, index, name);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glBindBuffer dispatcher. id = 4
  */
-static void yagl_func_glBindBuffer(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glBindBuffer(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -62,12 +65,13 @@ static void yagl_func_glBindBuffer(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glBindBuffer, GLenum, GLuint, target, buffer);
     yagl_host_glBindBuffer(target, buffer);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glBindFramebuffer dispatcher. id = 5
  */
-static void yagl_func_glBindFramebuffer(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glBindFramebuffer(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -76,12 +80,13 @@ static void yagl_func_glBindFramebuffer(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glBindFramebuffer, GLenum, GLuint, target, framebuffer);
     yagl_host_glBindFramebuffer(target, framebuffer);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glBindRenderbuffer dispatcher. id = 6
  */
-static void yagl_func_glBindRenderbuffer(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glBindRenderbuffer(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -90,12 +95,13 @@ static void yagl_func_glBindRenderbuffer(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glBindRenderbuffer, GLenum, GLuint, target, renderbuffer);
     yagl_host_glBindRenderbuffer(target, renderbuffer);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glBindTexture dispatcher. id = 7
  */
-static void yagl_func_glBindTexture(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glBindTexture(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -104,12 +110,13 @@ static void yagl_func_glBindTexture(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glBindTexture, GLenum, GLuint, target, texture);
     yagl_host_glBindTexture(target, texture);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glBlendColor dispatcher. id = 8
  */
-static void yagl_func_glBlendColor(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glBlendColor(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -120,12 +127,13 @@ static void yagl_func_glBlendColor(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT4(ts->ps->id, ts->id, glBlendColor, GLclampf, GLclampf, GLclampf, GLclampf, red, green, blue, alpha);
     yagl_host_glBlendColor(red, green, blue, alpha);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glBlendEquation dispatcher. id = 9
  */
-static void yagl_func_glBlendEquation(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glBlendEquation(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -133,12 +141,13 @@ static void yagl_func_glBlendEquation(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glBlendEquation, GLenum, mode);
     yagl_host_glBlendEquation(mode);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glBlendEquationSeparate dispatcher. id = 10
  */
-static void yagl_func_glBlendEquationSeparate(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glBlendEquationSeparate(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -147,12 +156,13 @@ static void yagl_func_glBlendEquationSeparate(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glBlendEquationSeparate, GLenum, GLenum, modeRGB, modeAlpha);
     yagl_host_glBlendEquationSeparate(modeRGB, modeAlpha);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glBlendFunc dispatcher. id = 11
  */
-static void yagl_func_glBlendFunc(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glBlendFunc(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -161,12 +171,13 @@ static void yagl_func_glBlendFunc(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glBlendFunc, GLenum, GLenum, sfactor, dfactor);
     yagl_host_glBlendFunc(sfactor, dfactor);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glBlendFuncSeparate dispatcher. id = 12
  */
-static void yagl_func_glBlendFuncSeparate(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glBlendFuncSeparate(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -177,12 +188,13 @@ static void yagl_func_glBlendFuncSeparate(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT4(ts->ps->id, ts->id, glBlendFuncSeparate, GLenum, GLenum, GLenum, GLenum, srcRGB, dstRGB, srcAlpha, dstAlpha);
     yagl_host_glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glBufferData dispatcher. id = 13
  */
-static void yagl_func_glBufferData(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glBufferData(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -193,12 +205,13 @@ static void yagl_func_glBufferData(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT4(ts->ps->id, ts->id, glBufferData, GLenum, GLsizeiptr, target_ulong, GLenum, target, size, data, usage);
     yagl_host_glBufferData(target, size, data, usage);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glBufferSubData dispatcher. id = 14
  */
-static void yagl_func_glBufferSubData(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glBufferSubData(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -209,12 +222,13 @@ static void yagl_func_glBufferSubData(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT4(ts->ps->id, ts->id, glBufferSubData, GLenum, GLintptr, GLsizeiptr, target_ulong, target, offset, size, data);
     yagl_host_glBufferSubData(target, offset, size, data);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glCheckFramebufferStatus dispatcher. id = 15
  */
-static void yagl_func_glCheckFramebufferStatus(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glCheckFramebufferStatus(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -223,12 +237,13 @@ static void yagl_func_glCheckFramebufferStatus(struct yagl_thread_state *ts,
     GLenum ret = yagl_host_glCheckFramebufferStatus(target);
     YAGL_LOG_FUNC_EXIT_SPLIT(GLenum, ret);
     yagl_marshal_put_GLenum(&in_buff, ret);
+    return out_buff;
 }
 
 /*
  * glClear dispatcher. id = 16
  */
-static void yagl_func_glClear(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glClear(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -236,12 +251,13 @@ static void yagl_func_glClear(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glClear, GLbitfield, mask);
     yagl_host_glClear(mask);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glClearColor dispatcher. id = 17
  */
-static void yagl_func_glClearColor(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glClearColor(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -252,12 +268,13 @@ static void yagl_func_glClearColor(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT4(ts->ps->id, ts->id, glClearColor, GLclampf, GLclampf, GLclampf, GLclampf, red, green, blue, alpha);
     yagl_host_glClearColor(red, green, blue, alpha);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glClearDepthf dispatcher. id = 18
  */
-static void yagl_func_glClearDepthf(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glClearDepthf(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -265,12 +282,13 @@ static void yagl_func_glClearDepthf(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glClearDepthf, GLclampf, depth);
     yagl_host_glClearDepthf(depth);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glClearStencil dispatcher. id = 19
  */
-static void yagl_func_glClearStencil(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glClearStencil(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -278,12 +296,13 @@ static void yagl_func_glClearStencil(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glClearStencil, GLint, s);
     yagl_host_glClearStencil(s);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glColorMask dispatcher. id = 20
  */
-static void yagl_func_glColorMask(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glColorMask(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -294,12 +313,13 @@ static void yagl_func_glColorMask(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT4(ts->ps->id, ts->id, glColorMask, GLboolean, GLboolean, GLboolean, GLboolean, red, green, blue, alpha);
     yagl_host_glColorMask(red, green, blue, alpha);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glCompileShader dispatcher. id = 21
  */
-static void yagl_func_glCompileShader(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glCompileShader(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -307,12 +327,13 @@ static void yagl_func_glCompileShader(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glCompileShader, GLuint, shader);
     yagl_host_glCompileShader(shader);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glCompressedTexImage2D dispatcher. id = 22
  */
-static void yagl_func_glCompressedTexImage2D(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glCompressedTexImage2D(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -327,12 +348,13 @@ static void yagl_func_glCompressedTexImage2D(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT8(ts->ps->id, ts->id, glCompressedTexImage2D, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, target_ulong, target, level, internalformat, width, height, border, imageSize, data);
     yagl_host_glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glCompressedTexSubImage2D dispatcher. id = 23
  */
-static void yagl_func_glCompressedTexSubImage2D(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glCompressedTexSubImage2D(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -348,12 +370,13 @@ static void yagl_func_glCompressedTexSubImage2D(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT9(ts->ps->id, ts->id, glCompressedTexSubImage2D, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, target_ulong, target, level, xoffset, yoffset, width, height, format, imageSize, data);
     yagl_host_glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glCopyTexImage2D dispatcher. id = 24
  */
-static void yagl_func_glCopyTexImage2D(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glCopyTexImage2D(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -368,12 +391,13 @@ static void yagl_func_glCopyTexImage2D(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT8(ts->ps->id, ts->id, glCopyTexImage2D, GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint, target, level, internalformat, x, y, width, height, border);
     yagl_host_glCopyTexImage2D(target, level, internalformat, x, y, width, height, border);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glCopyTexSubImage2D dispatcher. id = 25
  */
-static void yagl_func_glCopyTexSubImage2D(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glCopyTexSubImage2D(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -388,12 +412,13 @@ static void yagl_func_glCopyTexSubImage2D(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT8(ts->ps->id, ts->id, glCopyTexSubImage2D, GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, target, level, xoffset, yoffset, x, y, width, height);
     yagl_host_glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glCreateProgram dispatcher. id = 26
  */
-static void yagl_func_glCreateProgram(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glCreateProgram(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -401,12 +426,13 @@ static void yagl_func_glCreateProgram(struct yagl_thread_state *ts,
     GLuint ret = yagl_host_glCreateProgram();
     YAGL_LOG_FUNC_EXIT_SPLIT(GLuint, ret);
     yagl_marshal_put_GLuint(&in_buff, ret);
+    return out_buff;
 }
 
 /*
  * glCreateShader dispatcher. id = 27
  */
-static void yagl_func_glCreateShader(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glCreateShader(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -415,12 +441,13 @@ static void yagl_func_glCreateShader(struct yagl_thread_state *ts,
     GLuint ret = yagl_host_glCreateShader(type);
     YAGL_LOG_FUNC_EXIT_SPLIT(GLuint, ret);
     yagl_marshal_put_GLuint(&in_buff, ret);
+    return out_buff;
 }
 
 /*
  * glCullFace dispatcher. id = 28
  */
-static void yagl_func_glCullFace(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glCullFace(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -428,12 +455,13 @@ static void yagl_func_glCullFace(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glCullFace, GLenum, mode);
     yagl_host_glCullFace(mode);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glDeleteBuffers dispatcher. id = 29
  */
-static void yagl_func_glDeleteBuffers(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glDeleteBuffers(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -442,12 +470,13 @@ static void yagl_func_glDeleteBuffers(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glDeleteBuffers, GLsizei, target_ulong, n, buffers);
     yagl_host_glDeleteBuffers(n, buffers);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glDeleteFramebuffers dispatcher. id = 30
  */
-static void yagl_func_glDeleteFramebuffers(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glDeleteFramebuffers(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -456,12 +485,13 @@ static void yagl_func_glDeleteFramebuffers(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glDeleteFramebuffers, GLsizei, target_ulong, n, framebuffers);
     yagl_host_glDeleteFramebuffers(n, framebuffers);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glDeleteProgram dispatcher. id = 31
  */
-static void yagl_func_glDeleteProgram(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glDeleteProgram(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -469,12 +499,13 @@ static void yagl_func_glDeleteProgram(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glDeleteProgram, GLuint, program);
     yagl_host_glDeleteProgram(program);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glDeleteRenderbuffers dispatcher. id = 32
  */
-static void yagl_func_glDeleteRenderbuffers(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glDeleteRenderbuffers(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -483,12 +514,13 @@ static void yagl_func_glDeleteRenderbuffers(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glDeleteRenderbuffers, GLsizei, target_ulong, n, renderbuffers);
     yagl_host_glDeleteRenderbuffers(n, renderbuffers);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glDeleteShader dispatcher. id = 33
  */
-static void yagl_func_glDeleteShader(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glDeleteShader(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -496,12 +528,13 @@ static void yagl_func_glDeleteShader(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glDeleteShader, GLuint, shader);
     yagl_host_glDeleteShader(shader);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glDeleteTextures dispatcher. id = 34
  */
-static void yagl_func_glDeleteTextures(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glDeleteTextures(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -510,12 +543,13 @@ static void yagl_func_glDeleteTextures(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glDeleteTextures, GLsizei, target_ulong, n, textures);
     yagl_host_glDeleteTextures(n, textures);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glDepthFunc dispatcher. id = 35
  */
-static void yagl_func_glDepthFunc(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glDepthFunc(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -523,12 +557,13 @@ static void yagl_func_glDepthFunc(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glDepthFunc, GLenum, func);
     yagl_host_glDepthFunc(func);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glDepthMask dispatcher. id = 36
  */
-static void yagl_func_glDepthMask(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glDepthMask(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -536,12 +571,13 @@ static void yagl_func_glDepthMask(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glDepthMask, GLboolean, flag);
     yagl_host_glDepthMask(flag);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glDepthRangef dispatcher. id = 37
  */
-static void yagl_func_glDepthRangef(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glDepthRangef(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -550,12 +586,13 @@ static void yagl_func_glDepthRangef(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glDepthRangef, GLclampf, GLclampf, zNear, zFar);
     yagl_host_glDepthRangef(zNear, zFar);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glDetachShader dispatcher. id = 38
  */
-static void yagl_func_glDetachShader(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glDetachShader(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -564,12 +601,13 @@ static void yagl_func_glDetachShader(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glDetachShader, GLuint, GLuint, program, shader);
     yagl_host_glDetachShader(program, shader);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glDisable dispatcher. id = 39
  */
-static void yagl_func_glDisable(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glDisable(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -577,12 +615,13 @@ static void yagl_func_glDisable(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glDisable, GLenum, cap);
     yagl_host_glDisable(cap);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glDisableVertexAttribArray dispatcher. id = 40
  */
-static void yagl_func_glDisableVertexAttribArray(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glDisableVertexAttribArray(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -590,12 +629,13 @@ static void yagl_func_glDisableVertexAttribArray(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glDisableVertexAttribArray, GLuint, index);
     yagl_host_glDisableVertexAttribArray(index);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glDrawArrays dispatcher. id = 41
  */
-static void yagl_func_glDrawArrays(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glDrawArrays(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -605,12 +645,13 @@ static void yagl_func_glDrawArrays(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glDrawArrays, GLenum, GLint, GLsizei, mode, first, count);
     yagl_host_glDrawArrays(mode, first, count);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glDrawElements dispatcher. id = 42
  */
-static void yagl_func_glDrawElements(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glDrawElements(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -621,12 +662,13 @@ static void yagl_func_glDrawElements(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT4(ts->ps->id, ts->id, glDrawElements, GLenum, GLsizei, GLenum, target_ulong, mode, count, type, indices);
     yagl_host_glDrawElements(mode, count, type, indices);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glEnable dispatcher. id = 43
  */
-static void yagl_func_glEnable(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glEnable(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -634,12 +676,13 @@ static void yagl_func_glEnable(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glEnable, GLenum, cap);
     yagl_host_glEnable(cap);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glEnableVertexAttribArray dispatcher. id = 44
  */
-static void yagl_func_glEnableVertexAttribArray(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glEnableVertexAttribArray(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -647,36 +690,39 @@ static void yagl_func_glEnableVertexAttribArray(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glEnableVertexAttribArray, GLuint, index);
     yagl_host_glEnableVertexAttribArray(index);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glFinish dispatcher. id = 45
  */
-static void yagl_func_glFinish(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glFinish(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
     YAGL_LOG_FUNC_ENTER_SPLIT0(ts->ps->id, ts->id, glFinish);
     yagl_host_glFinish();
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glFlush dispatcher. id = 46
  */
-static void yagl_func_glFlush(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glFlush(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
     YAGL_LOG_FUNC_ENTER_SPLIT0(ts->ps->id, ts->id, glFlush);
     yagl_host_glFlush();
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glFramebufferRenderbuffer dispatcher. id = 47
  */
-static void yagl_func_glFramebufferRenderbuffer(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glFramebufferRenderbuffer(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -687,12 +733,13 @@ static void yagl_func_glFramebufferRenderbuffer(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT4(ts->ps->id, ts->id, glFramebufferRenderbuffer, GLenum, GLenum, GLenum, GLuint, target, attachment, renderbuffertarget, renderbuffer);
     yagl_host_glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glFramebufferTexture2D dispatcher. id = 48
  */
-static void yagl_func_glFramebufferTexture2D(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glFramebufferTexture2D(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -704,12 +751,13 @@ static void yagl_func_glFramebufferTexture2D(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT5(ts->ps->id, ts->id, glFramebufferTexture2D, GLenum, GLenum, GLenum, GLuint, GLint, target, attachment, textarget, texture, level);
     yagl_host_glFramebufferTexture2D(target, attachment, textarget, texture, level);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glFrontFace dispatcher. id = 49
  */
-static void yagl_func_glFrontFace(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glFrontFace(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -717,12 +765,13 @@ static void yagl_func_glFrontFace(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glFrontFace, GLenum, mode);
     yagl_host_glFrontFace(mode);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGenBuffers dispatcher. id = 50
  */
-static void yagl_func_glGenBuffers(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGenBuffers(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -731,12 +780,13 @@ static void yagl_func_glGenBuffers(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glGenBuffers, GLsizei, target_ulong, n, buffers);
     yagl_host_glGenBuffers(n, buffers);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGenerateMipmap dispatcher. id = 51
  */
-static void yagl_func_glGenerateMipmap(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGenerateMipmap(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -744,12 +794,13 @@ static void yagl_func_glGenerateMipmap(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glGenerateMipmap, GLenum, target);
     yagl_host_glGenerateMipmap(target);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGenFramebuffers dispatcher. id = 52
  */
-static void yagl_func_glGenFramebuffers(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGenFramebuffers(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -758,12 +809,13 @@ static void yagl_func_glGenFramebuffers(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glGenFramebuffers, GLsizei, target_ulong, n, framebuffers);
     yagl_host_glGenFramebuffers(n, framebuffers);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGenRenderbuffers dispatcher. id = 53
  */
-static void yagl_func_glGenRenderbuffers(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGenRenderbuffers(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -772,12 +824,13 @@ static void yagl_func_glGenRenderbuffers(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glGenRenderbuffers, GLsizei, target_ulong, n, renderbuffers);
     yagl_host_glGenRenderbuffers(n, renderbuffers);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGenTextures dispatcher. id = 54
  */
-static void yagl_func_glGenTextures(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGenTextures(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -786,12 +839,13 @@ static void yagl_func_glGenTextures(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glGenTextures, GLsizei, target_ulong, n, textures);
     yagl_host_glGenTextures(n, textures);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGetActiveAttrib dispatcher. id = 55
  */
-static void yagl_func_glGetActiveAttrib(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGetActiveAttrib(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -805,12 +859,13 @@ static void yagl_func_glGetActiveAttrib(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT7(ts->ps->id, ts->id, glGetActiveAttrib, GLuint, GLuint, GLsizei, target_ulong, target_ulong, target_ulong, target_ulong, program, index, bufsize, length, size, type, name);
     yagl_host_glGetActiveAttrib(program, index, bufsize, length, size, type, name);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGetActiveUniform dispatcher. id = 56
  */
-static void yagl_func_glGetActiveUniform(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGetActiveUniform(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -824,12 +879,13 @@ static void yagl_func_glGetActiveUniform(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT7(ts->ps->id, ts->id, glGetActiveUniform, GLuint, GLuint, GLsizei, target_ulong, target_ulong, target_ulong, target_ulong, program, index, bufsize, length, size, type, name);
     yagl_host_glGetActiveUniform(program, index, bufsize, length, size, type, name);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGetAttachedShaders dispatcher. id = 57
  */
-static void yagl_func_glGetAttachedShaders(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGetAttachedShaders(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -840,12 +896,13 @@ static void yagl_func_glGetAttachedShaders(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT4(ts->ps->id, ts->id, glGetAttachedShaders, GLuint, GLsizei, target_ulong, target_ulong, program, maxcount, count, shaders);
     yagl_host_glGetAttachedShaders(program, maxcount, count, shaders);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGetAttribLocation dispatcher. id = 58
  */
-static void yagl_func_glGetAttribLocation(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGetAttribLocation(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -855,12 +912,13 @@ static void yagl_func_glGetAttribLocation(struct yagl_thread_state *ts,
     int ret = yagl_host_glGetAttribLocation(program, name);
     YAGL_LOG_FUNC_EXIT_SPLIT(int, ret);
     yagl_marshal_put_int(&in_buff, ret);
+    return out_buff;
 }
 
 /*
  * glGetBooleanv dispatcher. id = 59
  */
-static void yagl_func_glGetBooleanv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGetBooleanv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -869,12 +927,13 @@ static void yagl_func_glGetBooleanv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glGetBooleanv, GLenum, target_ulong, pname, params);
     yagl_host_glGetBooleanv(pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGetBufferParameteriv dispatcher. id = 60
  */
-static void yagl_func_glGetBufferParameteriv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGetBufferParameteriv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -884,12 +943,13 @@ static void yagl_func_glGetBufferParameteriv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glGetBufferParameteriv, GLenum, GLenum, target_ulong, target, pname, params);
     yagl_host_glGetBufferParameteriv(target, pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGetError dispatcher. id = 61
  */
-static void yagl_func_glGetError(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGetError(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -897,12 +957,13 @@ static void yagl_func_glGetError(struct yagl_thread_state *ts,
     GLenum ret = yagl_host_glGetError();
     YAGL_LOG_FUNC_EXIT_SPLIT(GLenum, ret);
     yagl_marshal_put_GLenum(&in_buff, ret);
+    return out_buff;
 }
 
 /*
  * glGetFloatv dispatcher. id = 62
  */
-static void yagl_func_glGetFloatv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGetFloatv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -911,12 +972,13 @@ static void yagl_func_glGetFloatv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glGetFloatv, GLenum, target_ulong, pname, params);
     yagl_host_glGetFloatv(pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGetFramebufferAttachmentParameteriv dispatcher. id = 63
  */
-static void yagl_func_glGetFramebufferAttachmentParameteriv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGetFramebufferAttachmentParameteriv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -927,12 +989,13 @@ static void yagl_func_glGetFramebufferAttachmentParameteriv(struct yagl_thread_s
     YAGL_LOG_FUNC_ENTER_SPLIT4(ts->ps->id, ts->id, glGetFramebufferAttachmentParameteriv, GLenum, GLenum, GLenum, target_ulong, target, attachment, pname, params);
     yagl_host_glGetFramebufferAttachmentParameteriv(target, attachment, pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGetIntegerv dispatcher. id = 64
  */
-static void yagl_func_glGetIntegerv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGetIntegerv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -941,12 +1004,13 @@ static void yagl_func_glGetIntegerv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glGetIntegerv, GLenum, target_ulong, pname, params);
     yagl_host_glGetIntegerv(pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGetProgramiv dispatcher. id = 65
  */
-static void yagl_func_glGetProgramiv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGetProgramiv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -956,12 +1020,13 @@ static void yagl_func_glGetProgramiv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glGetProgramiv, GLuint, GLenum, target_ulong, program, pname, params);
     yagl_host_glGetProgramiv(program, pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGetProgramInfoLog dispatcher. id = 66
  */
-static void yagl_func_glGetProgramInfoLog(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGetProgramInfoLog(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -972,12 +1037,13 @@ static void yagl_func_glGetProgramInfoLog(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT4(ts->ps->id, ts->id, glGetProgramInfoLog, GLuint, GLsizei, target_ulong, target_ulong, program, bufsize, length, infolog);
     yagl_host_glGetProgramInfoLog(program, bufsize, length, infolog);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGetRenderbufferParameteriv dispatcher. id = 67
  */
-static void yagl_func_glGetRenderbufferParameteriv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGetRenderbufferParameteriv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -987,12 +1053,13 @@ static void yagl_func_glGetRenderbufferParameteriv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glGetRenderbufferParameteriv, GLenum, GLenum, target_ulong, target, pname, params);
     yagl_host_glGetRenderbufferParameteriv(target, pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGetShaderiv dispatcher. id = 68
  */
-static void yagl_func_glGetShaderiv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGetShaderiv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1002,12 +1069,13 @@ static void yagl_func_glGetShaderiv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glGetShaderiv, GLuint, GLenum, target_ulong, shader, pname, params);
     yagl_host_glGetShaderiv(shader, pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGetShaderInfoLog dispatcher. id = 69
  */
-static void yagl_func_glGetShaderInfoLog(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGetShaderInfoLog(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1018,12 +1086,13 @@ static void yagl_func_glGetShaderInfoLog(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT4(ts->ps->id, ts->id, glGetShaderInfoLog, GLuint, GLsizei, target_ulong, target_ulong, shader, bufsize, length, infolog);
     yagl_host_glGetShaderInfoLog(shader, bufsize, length, infolog);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGetShaderPrecisionFormat dispatcher. id = 70
  */
-static void yagl_func_glGetShaderPrecisionFormat(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGetShaderPrecisionFormat(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1034,12 +1103,13 @@ static void yagl_func_glGetShaderPrecisionFormat(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT4(ts->ps->id, ts->id, glGetShaderPrecisionFormat, GLenum, GLenum, target_ulong, target_ulong, shadertype, precisiontype, range, precision);
     yagl_host_glGetShaderPrecisionFormat(shadertype, precisiontype, range, precision);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGetShaderSource dispatcher. id = 71
  */
-static void yagl_func_glGetShaderSource(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGetShaderSource(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1050,12 +1120,13 @@ static void yagl_func_glGetShaderSource(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT4(ts->ps->id, ts->id, glGetShaderSource, GLuint, GLsizei, target_ulong, target_ulong, shader, bufsize, length, source);
     yagl_host_glGetShaderSource(shader, bufsize, length, source);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGetTexParameterfv dispatcher. id = 72
  */
-static void yagl_func_glGetTexParameterfv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGetTexParameterfv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1065,12 +1136,13 @@ static void yagl_func_glGetTexParameterfv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glGetTexParameterfv, GLenum, GLenum, target_ulong, target, pname, params);
     yagl_host_glGetTexParameterfv(target, pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGetTexParameteriv dispatcher. id = 73
  */
-static void yagl_func_glGetTexParameteriv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGetTexParameteriv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1080,12 +1152,13 @@ static void yagl_func_glGetTexParameteriv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glGetTexParameteriv, GLenum, GLenum, target_ulong, target, pname, params);
     yagl_host_glGetTexParameteriv(target, pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGetUniformfv dispatcher. id = 74
  */
-static void yagl_func_glGetUniformfv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGetUniformfv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1095,12 +1168,13 @@ static void yagl_func_glGetUniformfv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glGetUniformfv, GLuint, GLint, target_ulong, program, location, params);
     yagl_host_glGetUniformfv(program, location, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGetUniformiv dispatcher. id = 75
  */
-static void yagl_func_glGetUniformiv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGetUniformiv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1110,12 +1184,13 @@ static void yagl_func_glGetUniformiv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glGetUniformiv, GLuint, GLint, target_ulong, program, location, params);
     yagl_host_glGetUniformiv(program, location, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGetUniformLocation dispatcher. id = 76
  */
-static void yagl_func_glGetUniformLocation(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGetUniformLocation(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1125,12 +1200,13 @@ static void yagl_func_glGetUniformLocation(struct yagl_thread_state *ts,
     int ret = yagl_host_glGetUniformLocation(program, name);
     YAGL_LOG_FUNC_EXIT_SPLIT(int, ret);
     yagl_marshal_put_int(&in_buff, ret);
+    return out_buff;
 }
 
 /*
  * glGetVertexAttribfv dispatcher. id = 77
  */
-static void yagl_func_glGetVertexAttribfv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGetVertexAttribfv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1140,12 +1216,13 @@ static void yagl_func_glGetVertexAttribfv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glGetVertexAttribfv, GLuint, GLenum, target_ulong, index, pname, params);
     yagl_host_glGetVertexAttribfv(index, pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGetVertexAttribiv dispatcher. id = 78
  */
-static void yagl_func_glGetVertexAttribiv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGetVertexAttribiv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1155,12 +1232,13 @@ static void yagl_func_glGetVertexAttribiv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glGetVertexAttribiv, GLuint, GLenum, target_ulong, index, pname, params);
     yagl_host_glGetVertexAttribiv(index, pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glGetVertexAttribPointerv dispatcher. id = 79
  */
-static void yagl_func_glGetVertexAttribPointerv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glGetVertexAttribPointerv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1170,12 +1248,13 @@ static void yagl_func_glGetVertexAttribPointerv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glGetVertexAttribPointerv, GLuint, GLenum, target_ulong, index, pname, pointer);
     yagl_host_glGetVertexAttribPointerv(index, pname, pointer);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glHint dispatcher. id = 80
  */
-static void yagl_func_glHint(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glHint(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1184,12 +1263,13 @@ static void yagl_func_glHint(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glHint, GLenum, GLenum, target, mode);
     yagl_host_glHint(target, mode);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glIsBuffer dispatcher. id = 81
  */
-static void yagl_func_glIsBuffer(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glIsBuffer(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1198,12 +1278,13 @@ static void yagl_func_glIsBuffer(struct yagl_thread_state *ts,
     GLboolean ret = yagl_host_glIsBuffer(buffer);
     YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, ret);
     yagl_marshal_put_GLboolean(&in_buff, ret);
+    return out_buff;
 }
 
 /*
  * glIsEnabled dispatcher. id = 82
  */
-static void yagl_func_glIsEnabled(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glIsEnabled(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1212,12 +1293,13 @@ static void yagl_func_glIsEnabled(struct yagl_thread_state *ts,
     GLboolean ret = yagl_host_glIsEnabled(cap);
     YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, ret);
     yagl_marshal_put_GLboolean(&in_buff, ret);
+    return out_buff;
 }
 
 /*
  * glIsFramebuffer dispatcher. id = 83
  */
-static void yagl_func_glIsFramebuffer(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glIsFramebuffer(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1226,12 +1308,13 @@ static void yagl_func_glIsFramebuffer(struct yagl_thread_state *ts,
     GLboolean ret = yagl_host_glIsFramebuffer(framebuffer);
     YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, ret);
     yagl_marshal_put_GLboolean(&in_buff, ret);
+    return out_buff;
 }
 
 /*
  * glIsProgram dispatcher. id = 84
  */
-static void yagl_func_glIsProgram(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glIsProgram(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1240,12 +1323,13 @@ static void yagl_func_glIsProgram(struct yagl_thread_state *ts,
     GLboolean ret = yagl_host_glIsProgram(program);
     YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, ret);
     yagl_marshal_put_GLboolean(&in_buff, ret);
+    return out_buff;
 }
 
 /*
  * glIsRenderbuffer dispatcher. id = 85
  */
-static void yagl_func_glIsRenderbuffer(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glIsRenderbuffer(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1254,12 +1338,13 @@ static void yagl_func_glIsRenderbuffer(struct yagl_thread_state *ts,
     GLboolean ret = yagl_host_glIsRenderbuffer(renderbuffer);
     YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, ret);
     yagl_marshal_put_GLboolean(&in_buff, ret);
+    return out_buff;
 }
 
 /*
  * glIsShader dispatcher. id = 86
  */
-static void yagl_func_glIsShader(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glIsShader(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1268,12 +1353,13 @@ static void yagl_func_glIsShader(struct yagl_thread_state *ts,
     GLboolean ret = yagl_host_glIsShader(shader);
     YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, ret);
     yagl_marshal_put_GLboolean(&in_buff, ret);
+    return out_buff;
 }
 
 /*
  * glIsTexture dispatcher. id = 87
  */
-static void yagl_func_glIsTexture(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glIsTexture(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1282,12 +1368,13 @@ static void yagl_func_glIsTexture(struct yagl_thread_state *ts,
     GLboolean ret = yagl_host_glIsTexture(texture);
     YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, ret);
     yagl_marshal_put_GLboolean(&in_buff, ret);
+    return out_buff;
 }
 
 /*
  * glLineWidth dispatcher. id = 88
  */
-static void yagl_func_glLineWidth(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glLineWidth(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1295,12 +1382,13 @@ static void yagl_func_glLineWidth(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glLineWidth, GLfloat, width);
     yagl_host_glLineWidth(width);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glLinkProgram dispatcher. id = 89
  */
-static void yagl_func_glLinkProgram(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glLinkProgram(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1308,12 +1396,13 @@ static void yagl_func_glLinkProgram(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glLinkProgram, GLuint, program);
     yagl_host_glLinkProgram(program);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glPixelStorei dispatcher. id = 90
  */
-static void yagl_func_glPixelStorei(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glPixelStorei(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1322,12 +1411,13 @@ static void yagl_func_glPixelStorei(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glPixelStorei, GLenum, GLint, pname, param);
     yagl_host_glPixelStorei(pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glPolygonOffset dispatcher. id = 91
  */
-static void yagl_func_glPolygonOffset(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glPolygonOffset(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1336,12 +1426,13 @@ static void yagl_func_glPolygonOffset(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glPolygonOffset, GLfloat, GLfloat, factor, units);
     yagl_host_glPolygonOffset(factor, units);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glReadPixels dispatcher. id = 92
  */
-static void yagl_func_glReadPixels(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glReadPixels(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1355,24 +1446,26 @@ static void yagl_func_glReadPixels(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT7(ts->ps->id, ts->id, glReadPixels, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, target_ulong, x, y, width, height, format, type, pixels);
     yagl_host_glReadPixels(x, y, width, height, format, type, pixels);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glReleaseShaderCompiler dispatcher. id = 93
  */
-static void yagl_func_glReleaseShaderCompiler(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glReleaseShaderCompiler(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
     YAGL_LOG_FUNC_ENTER_SPLIT0(ts->ps->id, ts->id, glReleaseShaderCompiler);
     yagl_host_glReleaseShaderCompiler();
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glRenderbufferStorage dispatcher. id = 94
  */
-static void yagl_func_glRenderbufferStorage(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glRenderbufferStorage(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1383,12 +1476,13 @@ static void yagl_func_glRenderbufferStorage(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT4(ts->ps->id, ts->id, glRenderbufferStorage, GLenum, GLenum, GLsizei, GLsizei, target, internalformat, width, height);
     yagl_host_glRenderbufferStorage(target, internalformat, width, height);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glSampleCoverage dispatcher. id = 95
  */
-static void yagl_func_glSampleCoverage(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glSampleCoverage(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1397,12 +1491,13 @@ static void yagl_func_glSampleCoverage(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glSampleCoverage, GLclampf, GLboolean, value, invert);
     yagl_host_glSampleCoverage(value, invert);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glScissor dispatcher. id = 96
  */
-static void yagl_func_glScissor(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glScissor(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1413,12 +1508,13 @@ static void yagl_func_glScissor(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT4(ts->ps->id, ts->id, glScissor, GLint, GLint, GLsizei, GLsizei, x, y, width, height);
     yagl_host_glScissor(x, y, width, height);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glShaderBinary dispatcher. id = 97
  */
-static void yagl_func_glShaderBinary(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glShaderBinary(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1430,12 +1526,13 @@ static void yagl_func_glShaderBinary(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT5(ts->ps->id, ts->id, glShaderBinary, GLsizei, target_ulong, GLenum, target_ulong, GLsizei, n, shaders, binaryformat, binary, length);
     yagl_host_glShaderBinary(n, shaders, binaryformat, binary, length);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glShaderSource dispatcher. id = 98
  */
-static void yagl_func_glShaderSource(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glShaderSource(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1446,12 +1543,13 @@ static void yagl_func_glShaderSource(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT4(ts->ps->id, ts->id, glShaderSource, GLuint, GLsizei, target_ulong, target_ulong, shader, count, string, length);
     yagl_host_glShaderSource(shader, count, string, length);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glStencilFunc dispatcher. id = 99
  */
-static void yagl_func_glStencilFunc(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glStencilFunc(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1461,12 +1559,13 @@ static void yagl_func_glStencilFunc(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glStencilFunc, GLenum, GLint, GLuint, func, ref, mask);
     yagl_host_glStencilFunc(func, ref, mask);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glStencilFuncSeparate dispatcher. id = 100
  */
-static void yagl_func_glStencilFuncSeparate(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glStencilFuncSeparate(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1477,12 +1576,13 @@ static void yagl_func_glStencilFuncSeparate(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT4(ts->ps->id, ts->id, glStencilFuncSeparate, GLenum, GLenum, GLint, GLuint, face, func, ref, mask);
     yagl_host_glStencilFuncSeparate(face, func, ref, mask);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glStencilMask dispatcher. id = 101
  */
-static void yagl_func_glStencilMask(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glStencilMask(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1490,12 +1590,13 @@ static void yagl_func_glStencilMask(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glStencilMask, GLuint, mask);
     yagl_host_glStencilMask(mask);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glStencilMaskSeparate dispatcher. id = 102
  */
-static void yagl_func_glStencilMaskSeparate(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glStencilMaskSeparate(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1504,12 +1605,13 @@ static void yagl_func_glStencilMaskSeparate(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glStencilMaskSeparate, GLenum, GLuint, face, mask);
     yagl_host_glStencilMaskSeparate(face, mask);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glStencilOp dispatcher. id = 103
  */
-static void yagl_func_glStencilOp(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glStencilOp(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1519,12 +1621,13 @@ static void yagl_func_glStencilOp(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glStencilOp, GLenum, GLenum, GLenum, fail, zfail, zpass);
     yagl_host_glStencilOp(fail, zfail, zpass);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glStencilOpSeparate dispatcher. id = 104
  */
-static void yagl_func_glStencilOpSeparate(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glStencilOpSeparate(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1535,12 +1638,13 @@ static void yagl_func_glStencilOpSeparate(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT4(ts->ps->id, ts->id, glStencilOpSeparate, GLenum, GLenum, GLenum, GLenum, face, fail, zfail, zpass);
     yagl_host_glStencilOpSeparate(face, fail, zfail, zpass);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glTexImage2D dispatcher. id = 105
  */
-static void yagl_func_glTexImage2D(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glTexImage2D(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1556,12 +1660,13 @@ static void yagl_func_glTexImage2D(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT9(ts->ps->id, ts->id, glTexImage2D, GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, target_ulong, target, level, internalformat, width, height, border, format, type, pixels);
     yagl_host_glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glTexParameterf dispatcher. id = 106
  */
-static void yagl_func_glTexParameterf(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glTexParameterf(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1571,12 +1676,13 @@ static void yagl_func_glTexParameterf(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glTexParameterf, GLenum, GLenum, GLfloat, target, pname, param);
     yagl_host_glTexParameterf(target, pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glTexParameterfv dispatcher. id = 107
  */
-static void yagl_func_glTexParameterfv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glTexParameterfv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1586,12 +1692,13 @@ static void yagl_func_glTexParameterfv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glTexParameterfv, GLenum, GLenum, target_ulong, target, pname, params);
     yagl_host_glTexParameterfv(target, pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glTexParameteri dispatcher. id = 108
  */
-static void yagl_func_glTexParameteri(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glTexParameteri(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1601,12 +1708,13 @@ static void yagl_func_glTexParameteri(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glTexParameteri, GLenum, GLenum, GLint, target, pname, param);
     yagl_host_glTexParameteri(target, pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glTexParameteriv dispatcher. id = 109
  */
-static void yagl_func_glTexParameteriv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glTexParameteriv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1616,12 +1724,13 @@ static void yagl_func_glTexParameteriv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glTexParameteriv, GLenum, GLenum, target_ulong, target, pname, params);
     yagl_host_glTexParameteriv(target, pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glTexSubImage2D dispatcher. id = 110
  */
-static void yagl_func_glTexSubImage2D(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glTexSubImage2D(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1637,12 +1746,13 @@ static void yagl_func_glTexSubImage2D(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT9(ts->ps->id, ts->id, glTexSubImage2D, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, target_ulong, target, level, xoffset, yoffset, width, height, format, type, pixels);
     yagl_host_glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glUniform1f dispatcher. id = 111
  */
-static void yagl_func_glUniform1f(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glUniform1f(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1651,12 +1761,13 @@ static void yagl_func_glUniform1f(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glUniform1f, GLint, GLfloat, location, x);
     yagl_host_glUniform1f(location, x);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glUniform1fv dispatcher. id = 112
  */
-static void yagl_func_glUniform1fv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glUniform1fv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1666,12 +1777,13 @@ static void yagl_func_glUniform1fv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glUniform1fv, GLint, GLsizei, target_ulong, location, count, v);
     yagl_host_glUniform1fv(location, count, v);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glUniform1i dispatcher. id = 113
  */
-static void yagl_func_glUniform1i(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glUniform1i(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1680,12 +1792,13 @@ static void yagl_func_glUniform1i(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glUniform1i, GLint, GLint, location, x);
     yagl_host_glUniform1i(location, x);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glUniform1iv dispatcher. id = 114
  */
-static void yagl_func_glUniform1iv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glUniform1iv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1695,12 +1808,13 @@ static void yagl_func_glUniform1iv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glUniform1iv, GLint, GLsizei, target_ulong, location, count, v);
     yagl_host_glUniform1iv(location, count, v);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glUniform2f dispatcher. id = 115
  */
-static void yagl_func_glUniform2f(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glUniform2f(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1710,12 +1824,13 @@ static void yagl_func_glUniform2f(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glUniform2f, GLint, GLfloat, GLfloat, location, x, y);
     yagl_host_glUniform2f(location, x, y);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glUniform2fv dispatcher. id = 116
  */
-static void yagl_func_glUniform2fv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glUniform2fv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1725,12 +1840,13 @@ static void yagl_func_glUniform2fv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glUniform2fv, GLint, GLsizei, target_ulong, location, count, v);
     yagl_host_glUniform2fv(location, count, v);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glUniform2i dispatcher. id = 117
  */
-static void yagl_func_glUniform2i(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glUniform2i(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1740,12 +1856,13 @@ static void yagl_func_glUniform2i(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glUniform2i, GLint, GLint, GLint, location, x, y);
     yagl_host_glUniform2i(location, x, y);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glUniform2iv dispatcher. id = 118
  */
-static void yagl_func_glUniform2iv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glUniform2iv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1755,12 +1872,13 @@ static void yagl_func_glUniform2iv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glUniform2iv, GLint, GLsizei, target_ulong, location, count, v);
     yagl_host_glUniform2iv(location, count, v);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glUniform3f dispatcher. id = 119
  */
-static void yagl_func_glUniform3f(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glUniform3f(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1771,12 +1889,13 @@ static void yagl_func_glUniform3f(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT4(ts->ps->id, ts->id, glUniform3f, GLint, GLfloat, GLfloat, GLfloat, location, x, y, z);
     yagl_host_glUniform3f(location, x, y, z);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glUniform3fv dispatcher. id = 120
  */
-static void yagl_func_glUniform3fv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glUniform3fv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1786,12 +1905,13 @@ static void yagl_func_glUniform3fv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glUniform3fv, GLint, GLsizei, target_ulong, location, count, v);
     yagl_host_glUniform3fv(location, count, v);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glUniform3i dispatcher. id = 121
  */
-static void yagl_func_glUniform3i(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glUniform3i(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1802,12 +1922,13 @@ static void yagl_func_glUniform3i(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT4(ts->ps->id, ts->id, glUniform3i, GLint, GLint, GLint, GLint, location, x, y, z);
     yagl_host_glUniform3i(location, x, y, z);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glUniform3iv dispatcher. id = 122
  */
-static void yagl_func_glUniform3iv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glUniform3iv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1817,12 +1938,13 @@ static void yagl_func_glUniform3iv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glUniform3iv, GLint, GLsizei, target_ulong, location, count, v);
     yagl_host_glUniform3iv(location, count, v);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glUniform4f dispatcher. id = 123
  */
-static void yagl_func_glUniform4f(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glUniform4f(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1834,12 +1956,13 @@ static void yagl_func_glUniform4f(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT5(ts->ps->id, ts->id, glUniform4f, GLint, GLfloat, GLfloat, GLfloat, GLfloat, location, x, y, z, w);
     yagl_host_glUniform4f(location, x, y, z, w);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glUniform4fv dispatcher. id = 124
  */
-static void yagl_func_glUniform4fv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glUniform4fv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1849,12 +1972,13 @@ static void yagl_func_glUniform4fv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glUniform4fv, GLint, GLsizei, target_ulong, location, count, v);
     yagl_host_glUniform4fv(location, count, v);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glUniform4i dispatcher. id = 125
  */
-static void yagl_func_glUniform4i(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glUniform4i(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1866,12 +1990,13 @@ static void yagl_func_glUniform4i(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT5(ts->ps->id, ts->id, glUniform4i, GLint, GLint, GLint, GLint, GLint, location, x, y, z, w);
     yagl_host_glUniform4i(location, x, y, z, w);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glUniform4iv dispatcher. id = 126
  */
-static void yagl_func_glUniform4iv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glUniform4iv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1881,12 +2006,13 @@ static void yagl_func_glUniform4iv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glUniform4iv, GLint, GLsizei, target_ulong, location, count, v);
     yagl_host_glUniform4iv(location, count, v);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glUniformMatrix2fv dispatcher. id = 127
  */
-static void yagl_func_glUniformMatrix2fv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glUniformMatrix2fv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1897,12 +2023,13 @@ static void yagl_func_glUniformMatrix2fv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT4(ts->ps->id, ts->id, glUniformMatrix2fv, GLint, GLsizei, GLboolean, target_ulong, location, count, transpose, value);
     yagl_host_glUniformMatrix2fv(location, count, transpose, value);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glUniformMatrix3fv dispatcher. id = 128
  */
-static void yagl_func_glUniformMatrix3fv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glUniformMatrix3fv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1913,12 +2040,13 @@ static void yagl_func_glUniformMatrix3fv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT4(ts->ps->id, ts->id, glUniformMatrix3fv, GLint, GLsizei, GLboolean, target_ulong, location, count, transpose, value);
     yagl_host_glUniformMatrix3fv(location, count, transpose, value);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glUniformMatrix4fv dispatcher. id = 129
  */
-static void yagl_func_glUniformMatrix4fv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glUniformMatrix4fv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1929,12 +2057,13 @@ static void yagl_func_glUniformMatrix4fv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT4(ts->ps->id, ts->id, glUniformMatrix4fv, GLint, GLsizei, GLboolean, target_ulong, location, count, transpose, value);
     yagl_host_glUniformMatrix4fv(location, count, transpose, value);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glUseProgram dispatcher. id = 130
  */
-static void yagl_func_glUseProgram(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glUseProgram(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1942,12 +2071,13 @@ static void yagl_func_glUseProgram(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glUseProgram, GLuint, program);
     yagl_host_glUseProgram(program);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glValidateProgram dispatcher. id = 131
  */
-static void yagl_func_glValidateProgram(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glValidateProgram(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1955,12 +2085,13 @@ static void yagl_func_glValidateProgram(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT1(ts->ps->id, ts->id, glValidateProgram, GLuint, program);
     yagl_host_glValidateProgram(program);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glVertexAttrib1f dispatcher. id = 132
  */
-static void yagl_func_glVertexAttrib1f(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glVertexAttrib1f(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1969,12 +2100,13 @@ static void yagl_func_glVertexAttrib1f(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glVertexAttrib1f, GLuint, GLfloat, indx, x);
     yagl_host_glVertexAttrib1f(indx, x);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glVertexAttrib1fv dispatcher. id = 133
  */
-static void yagl_func_glVertexAttrib1fv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glVertexAttrib1fv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1983,12 +2115,13 @@ static void yagl_func_glVertexAttrib1fv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glVertexAttrib1fv, GLuint, target_ulong, indx, values);
     yagl_host_glVertexAttrib1fv(indx, values);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glVertexAttrib2f dispatcher. id = 134
  */
-static void yagl_func_glVertexAttrib2f(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glVertexAttrib2f(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -1998,12 +2131,13 @@ static void yagl_func_glVertexAttrib2f(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT3(ts->ps->id, ts->id, glVertexAttrib2f, GLuint, GLfloat, GLfloat, indx, x, y);
     yagl_host_glVertexAttrib2f(indx, x, y);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glVertexAttrib2fv dispatcher. id = 135
  */
-static void yagl_func_glVertexAttrib2fv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glVertexAttrib2fv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -2012,12 +2146,13 @@ static void yagl_func_glVertexAttrib2fv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glVertexAttrib2fv, GLuint, target_ulong, indx, values);
     yagl_host_glVertexAttrib2fv(indx, values);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glVertexAttrib3f dispatcher. id = 136
  */
-static void yagl_func_glVertexAttrib3f(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glVertexAttrib3f(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -2028,12 +2163,13 @@ static void yagl_func_glVertexAttrib3f(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT4(ts->ps->id, ts->id, glVertexAttrib3f, GLuint, GLfloat, GLfloat, GLfloat, indx, x, y, z);
     yagl_host_glVertexAttrib3f(indx, x, y, z);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glVertexAttrib3fv dispatcher. id = 137
  */
-static void yagl_func_glVertexAttrib3fv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glVertexAttrib3fv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -2042,12 +2178,13 @@ static void yagl_func_glVertexAttrib3fv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glVertexAttrib3fv, GLuint, target_ulong, indx, values);
     yagl_host_glVertexAttrib3fv(indx, values);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glVertexAttrib4f dispatcher. id = 138
  */
-static void yagl_func_glVertexAttrib4f(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glVertexAttrib4f(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -2059,12 +2196,13 @@ static void yagl_func_glVertexAttrib4f(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT5(ts->ps->id, ts->id, glVertexAttrib4f, GLuint, GLfloat, GLfloat, GLfloat, GLfloat, indx, x, y, z, w);
     yagl_host_glVertexAttrib4f(indx, x, y, z, w);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glVertexAttrib4fv dispatcher. id = 139
  */
-static void yagl_func_glVertexAttrib4fv(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glVertexAttrib4fv(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -2073,12 +2211,13 @@ static void yagl_func_glVertexAttrib4fv(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT2(ts->ps->id, ts->id, glVertexAttrib4fv, GLuint, target_ulong, indx, values);
     yagl_host_glVertexAttrib4fv(indx, values);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glVertexAttribPointer dispatcher. id = 140
  */
-static void yagl_func_glVertexAttribPointer(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glVertexAttribPointer(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -2091,12 +2230,13 @@ static void yagl_func_glVertexAttribPointer(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT6(ts->ps->id, ts->id, glVertexAttribPointer, GLuint, GLint, GLenum, GLboolean, GLsizei, target_ulong, indx, size, type, normalized, stride, ptr);
     yagl_host_glVertexAttribPointer(indx, size, type, normalized, stride, ptr);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 /*
  * glViewport dispatcher. id = 141
  */
-static void yagl_func_glViewport(struct yagl_thread_state *ts,
+static uint8_t* yagl_func_glViewport(struct yagl_thread_state *ts,
     uint8_t *out_buff,
     uint8_t *in_buff)
 {
@@ -2107,6 +2247,7 @@ static void yagl_func_glViewport(struct yagl_thread_state *ts,
     YAGL_LOG_FUNC_ENTER_SPLIT4(ts->ps->id, ts->id, glViewport, GLint, GLint, GLsizei, GLsizei, x, y, width, height);
     yagl_host_glViewport(x, y, width, height);
     YAGL_LOG_FUNC_EXIT(NULL);
+    return out_buff;
 }
 
 const uint32_t yagl_gles2_api_num_funcs = 141;
index 0f6cb18..66ffa25 100644 (file)
@@ -16,6 +16,8 @@
 
 #define YAGL_MEM_SIZE 0x1000
 
+#define YAGL_BUFF_SIZE 0x1000
+
 #define YAGL_MAX_USERS (YAGL_MEM_SIZE / YAGL_REGS_SIZE)
 
 struct yagl_user
@@ -33,8 +35,7 @@ typedef struct YaGLState
     struct yagl_user users[YAGL_MAX_USERS];
 
     /*
-     * TARGET_PAGE_SIZE byte buffer to hold the response since we can't
-     * 'cpu_physical_memory_map' for both read and write.
+     * YAGL_MARSHAL_MAX_RESPONSE byte buffer to hold the response.
      */
     uint8_t *in_buff;
 } YaGLState;
@@ -47,7 +48,7 @@ static void yagl_device_operate(YaGLState *s,
 {
     yagl_pid target_pid;
     yagl_tid target_tid;
-    target_phys_addr_t buff_len = TARGET_PAGE_SIZE;
+    target_phys_addr_t buff_len = YAGL_BUFF_SIZE;
     uint8_t *buff = NULL, *tmp = NULL;
 
     YAGL_LOG_FUNC_ENTER_NPT(yagl_device_operate,
@@ -72,7 +73,7 @@ static void yagl_device_operate(YaGLState *s,
 
         buff = cpu_physical_memory_map(buff_pa, &buff_len, false);
 
-        if (!buff || (buff_len != TARGET_PAGE_SIZE)) {
+        if (!buff || (buff_len != YAGL_BUFF_SIZE)) {
             YAGL_LOG_CRITICAL("cpu_physical_memory_map(read) failed for user %d, buff_ptr = 0x%X",
                               user_index,
                               (uint32_t)buff_pa);
@@ -100,13 +101,13 @@ static void yagl_device_operate(YaGLState *s,
                                       buff,
                                       s->in_buff)) {
             cpu_physical_memory_unmap(buff,
-                                      TARGET_PAGE_SIZE,
+                                      YAGL_BUFF_SIZE,
                                       0,
-                                      TARGET_PAGE_SIZE);
+                                      YAGL_BUFF_SIZE);
 
             buff = cpu_physical_memory_map(buff_pa, &buff_len, true);
 
-            if (!buff || (buff_len != TARGET_PAGE_SIZE)) {
+            if (!buff || (buff_len != YAGL_BUFF_SIZE)) {
                 YAGL_LOG_CRITICAL("cpu_physical_memory_map(write) failed for user %d, buff_ptr = 0x%X",
                                   user_index,
                                   (uint32_t)buff_pa);
@@ -138,9 +139,9 @@ static void yagl_device_operate(YaGLState *s,
 out:
     if (buff) {
         cpu_physical_memory_unmap(buff,
-                                  TARGET_PAGE_SIZE,
+                                  YAGL_BUFF_SIZE,
                                   0,
-                                  TARGET_PAGE_SIZE);
+                                  YAGL_BUFF_SIZE);
     }
 
     YAGL_LOG_FUNC_EXIT(NULL);
@@ -148,8 +149,9 @@ out:
 
 static void yagl_device_trigger(YaGLState *s, int user_index)
 {
-    target_phys_addr_t buff_len = TARGET_PAGE_SIZE;
+    target_phys_addr_t buff_len = YAGL_BUFF_SIZE;
     uint8_t *buff = NULL;
+    uint8_t *current_buff;
 
     YAGL_LOG_FUNC_ENTER_NPT(yagl_device_trigger, "%d", user_index);
 
@@ -162,33 +164,49 @@ static void yagl_device_trigger(YaGLState *s, int user_index)
                                    &buff_len,
                                    false);
 
-    if (!buff || (buff_len != TARGET_PAGE_SIZE)) {
+    if (!buff || (buff_len != YAGL_BUFF_SIZE)) {
         YAGL_LOG_CRITICAL("cpu_physical_memory_map(read) failed for user %d, buff_ptr = 0x%X",
                           user_index,
                           (uint32_t)s->users[user_index].buff_pa);
         goto out;
     }
 
-    yagl_server_dispatch(s->ss,
-                         s->users[user_index].process_id,
-                         s->users[user_index].thread_id,
-                         buff,
-                         s->in_buff);
+    current_buff = buff;
 
-    cpu_physical_memory_unmap(buff,
-                              TARGET_PAGE_SIZE,
-                              0,
-                              TARGET_PAGE_SIZE);
+    while (true) {
+        uint8_t *tmp;
 
-    buff = cpu_physical_memory_map(s->users[user_index].buff_pa,
-                                   &buff_len,
-                                   true);
+        if (current_buff >= (buff + YAGL_BUFF_SIZE)) {
+            YAGL_LOG_CRITICAL("batch passes the end of buffer, protocol error");
 
-    if (!buff || (buff_len != TARGET_PAGE_SIZE)) {
-        YAGL_LOG_CRITICAL("cpu_physical_memory_map(write) failed for user %d, buff_ptr = 0x%X",
-                          user_index,
-                          (uint32_t)s->users[user_index].buff_pa);
-        goto out;
+            memset(s->in_buff, 0, YAGL_MARSHAL_MAX_RESPONSE);
+
+            break;
+        }
+
+        current_buff = yagl_server_dispatch(s->ss,
+                                            s->users[user_index].process_id,
+                                            s->users[user_index].thread_id,
+                                            current_buff,
+                                            s->in_buff);
+
+        if (!current_buff) {
+            /*
+             * Error occured.
+             */
+
+            break;
+        }
+
+        tmp = current_buff;
+
+        /*
+         * Take a peak to see if there's a batch terminator.
+         */
+
+        if (!yagl_marshal_get_uint32(&tmp)) {
+            break;
+        }
     }
 
     memcpy(buff, s->in_buff, YAGL_MARSHAL_MAX_RESPONSE);
@@ -196,9 +214,9 @@ static void yagl_device_trigger(YaGLState *s, int user_index)
 out:
     if (buff) {
         cpu_physical_memory_unmap(buff,
-                                  TARGET_PAGE_SIZE,
+                                  YAGL_BUFF_SIZE,
                                   0,
-                                  TARGET_PAGE_SIZE);
+                                  YAGL_BUFF_SIZE);
     }
 
     YAGL_LOG_FUNC_EXIT(NULL);
@@ -276,7 +294,7 @@ static int yagl_device_init(PCIDevice *dev)
         return -1;
     }
 
-    s->in_buff = g_malloc(TARGET_PAGE_SIZE);
+    s->in_buff = g_malloc(YAGL_MARSHAL_MAX_RESPONSE);
 
     pci_register_bar(&s->dev, 0, PCI_BASE_ADDRESS_SPACE_MEMORY, &s->iomem);
 
index 2972f31..1fe1a2f 100644 (file)
@@ -4,12 +4,6 @@
 #include "yagl_types.h"
 #include "exec-memory.h"
 
-typedef enum
-{
-    yagl_command_id_call = 1,
-    yagl_command_id_ret  = 2,
-} yagl_command_id;
-
 /*
  * All marshalling/unmarshalling must be done with 8-byte alignment,
  * since this is the maximum alignment possible. This way we can
@@ -21,9 +15,9 @@ typedef enum
 /*
  * Each marshalled value is aligned
  * at 8-byte boundary and there may be maximum
- * 3 values returned (yagl_command_id_ret response)
+ * 2 values returned (status and return value)
  */
-#define YAGL_MARSHAL_MAX_RESPONSE (8 * 3)
+#define YAGL_MARSHAL_MAX_RESPONSE (8 * 2)
 
 static __inline int yagl_marshal_skip(uint8_t** buff)
 {
@@ -102,7 +96,6 @@ static __inline yagl_host_handle yagl_marshal_get_host_handle(uint8_t** buff)
 #define yagl_marshal_get_uint32_t(buff) yagl_marshal_get_uint32(buff)
 #define yagl_marshal_put_int(buff, value) yagl_marshal_put_int32(buff, (value))
 #define yagl_marshal_get_int(buff) yagl_marshal_get_int32(buff)
-#define yagl_marshal_get_command_id(buff) yagl_marshal_get_uint32(buff)
 #define yagl_marshal_get_pid(buff) yagl_marshal_get_uint32(buff)
 #define yagl_marshal_get_tid(buff) yagl_marshal_get_uint32(buff)
 #define yagl_marshal_get_api_id(buff) yagl_marshal_get_uint32(buff)
index 039361c..96c4207 100644 (file)
@@ -29,148 +29,6 @@ static struct yagl_thread_state
     return NULL;
 }
 
-/*
- * call command out_buff is:
- *  (yagl_api_id) api_id
- *  (yagl_func_id) func_id
- *  ... api_id/func_id dependent
- * in_buff must be:
- *  (uint32_t) 0 - call error
- * or
- *  (uint32_t) 1 - call ok
- *  (uint32_t) 0 - not ready yet
- * or
- *  (uint32_t) 1 - call ok
- *  (uint32_t) 1 - ready
- *  ... api_id/func_id dependent
- */
-static void yagl_server_handle_call(struct yagl_server_state *ss,
-                                    yagl_pid target_pid,
-                                    yagl_tid target_tid,
-                                    uint8_t *out_buff,
-                                    uint8_t *in_buff)
-{
-    yagl_api_id api_id = yagl_marshal_get_api_id(&out_buff);
-    yagl_func_id func_id = yagl_marshal_get_func_id(&out_buff);
-    struct yagl_api* api;
-    struct yagl_thread_state *ts;
-    uint32_t returned = 0;
-    uint8_t *in_buff_ret;
-
-    YAGL_LOG_FUNC_ENTER(target_pid,
-                        target_tid,
-                        yagl_server_handle_call,
-                        "api_id = %u, func_id = %u",
-                        api_id,
-                        func_id);
-
-    ts = yagl_server_find_thread(ss, target_pid, target_tid);
-
-    if (!ts) {
-        YAGL_LOG_CRITICAL(
-            "process/thread %u/%u not found",
-            target_pid, target_tid);
-
-        yagl_marshal_put_uint32(&in_buff, 0);
-
-        YAGL_LOG_FUNC_EXIT(NULL);
-
-        return;
-    }
-
-    if ((api_id <= 0) || (api_id > YAGL_NUM_APIS)) {
-        YAGL_LOG_CRITICAL(
-            "target-host protocol error, bad api_id - %u", api_id);
-
-        yagl_marshal_put_uint32(&in_buff, 0);
-
-        YAGL_LOG_FUNC_EXIT(NULL);
-
-        return;
-    }
-
-    api = ss->apis[api_id - 1];
-
-    if (!api) {
-        YAGL_LOG_CRITICAL(
-            "uninitialized api - %u. host logic error", api_id);
-
-        yagl_marshal_put_uint32(&in_buff, 0);
-
-        YAGL_LOG_FUNC_EXIT(NULL);
-
-        return;
-    }
-
-    in_buff_ret = in_buff;
-
-    yagl_marshal_skip(&in_buff);
-    yagl_marshal_skip(&in_buff);
-
-    if (yagl_thread_call(ts, api_id, func_id, out_buff, in_buff, &returned)) {
-        yagl_marshal_put_uint32(&in_buff_ret, 1);
-        yagl_marshal_put_uint32(&in_buff_ret, returned);
-    } else {
-        yagl_marshal_put_uint32(&in_buff_ret, 0);
-    }
-
-    YAGL_LOG_FUNC_EXIT(NULL);
-}
-
-/*
- * in_buff must be:
- *  (uint32_t) 0 - ret error
- * or
- *  (uint32_t) 1 - ret ok
- *  (uint32_t) 0 - not ready yet
- * or
- *  (uint32_t) 1 - ret ok
- *  (uint32_t) 1 - ready
- *  ... api_id/func_id dependent
- */
-static void yagl_server_handle_ret(struct yagl_server_state *ss,
-                                   yagl_pid target_pid,
-                                   yagl_tid target_tid,
-                                   uint8_t *in_buff)
-{
-    uint8_t *in_buff_ret;
-    struct yagl_thread_state *ts;
-    uint32_t returned = 0;
-
-    YAGL_LOG_FUNC_ENTER(target_pid,
-                        target_tid,
-                        yagl_server_handle_ret,
-                        NULL);
-
-    ts = yagl_server_find_thread(ss, target_pid, target_tid);
-
-    if (!ts) {
-        YAGL_LOG_CRITICAL(
-            "process/thread %u/%u not found",
-            target_pid, target_tid);
-
-        yagl_marshal_put_uint32(&in_buff, 0);
-
-        YAGL_LOG_FUNC_EXIT(NULL);
-
-        return;
-    }
-
-    in_buff_ret = in_buff;
-
-    yagl_marshal_skip(&in_buff);
-    yagl_marshal_skip(&in_buff);
-
-    if (yagl_thread_try_return(ts, in_buff, &returned)) {
-        yagl_marshal_put_uint32(&in_buff_ret, 1);
-        yagl_marshal_put_uint32(&in_buff_ret, returned);
-    } else {
-        yagl_marshal_put_uint32(&in_buff_ret, 0);
-    }
-
-    YAGL_LOG_FUNC_EXIT("%u", returned);
-}
-
 struct yagl_server_state *yagl_server_state_create(void)
 {
     int i;
@@ -368,30 +226,83 @@ bool yagl_server_dispatch_init(struct yagl_server_state *ss,
     }
 }
 
-void yagl_server_dispatch(struct yagl_server_state *ss,
-                          yagl_pid target_pid,
-                          yagl_tid target_tid,
-                          uint8_t *out_buff,
-                          uint8_t *in_buff)
+/*
+ * out_buff is:
+ *  (yagl_api_id) api_id
+ *  (yagl_func_id) func_id
+ *  ... api_id/func_id dependent
+ * in_buff must be:
+ *  (uint32_t) 1/0 - call ok/failed
+ *  ... api_id/func_id dependent
+ */
+uint8_t *yagl_server_dispatch(struct yagl_server_state *ss,
+                              yagl_pid target_pid,
+                              yagl_tid target_tid,
+                              uint8_t *out_buff,
+                              uint8_t *in_buff)
 {
-    yagl_command_id command_id = yagl_marshal_get_command_id(&out_buff);
-
-    YAGL_LOG_FUNC_ENTER_NPT(yagl_server_dispatch, NULL);
-
-    switch (command_id) {
-    case yagl_command_id_call:
-        yagl_server_handle_call(ss, target_pid, target_tid, out_buff, in_buff);
-        break;
-    case yagl_command_id_ret:
-        yagl_server_handle_ret(ss, target_pid, target_tid, in_buff);
-        break;
-    default:
+    yagl_api_id api_id = yagl_marshal_get_api_id(&out_buff);
+    yagl_func_id func_id = yagl_marshal_get_func_id(&out_buff);
+    struct yagl_api* api;
+    struct yagl_thread_state *ts;
+    uint8_t *in_buff_ret;
+
+    YAGL_LOG_FUNC_ENTER(target_pid,
+                        target_tid,
+                        yagl_server_dispatch,
+                        "api_id = %u, func_id = %u",
+                        api_id,
+                        func_id);
+
+    ts = yagl_server_find_thread(ss, target_pid, target_tid);
+
+    if (!ts) {
+        YAGL_LOG_CRITICAL(
+            "process/thread %u/%u not found",
+            target_pid, target_tid);
+
+        yagl_marshal_put_uint32(&in_buff, 0);
+
+        YAGL_LOG_FUNC_EXIT(NULL);
+
+        return NULL;
+    }
+
+    if ((api_id <= 0) || (api_id > YAGL_NUM_APIS)) {
+        YAGL_LOG_CRITICAL(
+            "target-host protocol error, bad api_id - %u", api_id);
+
+        yagl_marshal_put_uint32(&in_buff, 0);
+
+        YAGL_LOG_FUNC_EXIT(NULL);
+
+        return NULL;
+    }
+
+    api = ss->apis[api_id - 1];
+
+    if (!api) {
         YAGL_LOG_CRITICAL(
-            "target-host protocol error, unknown command id - %d\n", command_id);
-        memset(in_buff, 0, TARGET_PAGE_SIZE);
+            "uninitialized api - %u. host logic error", api_id);
+
+        yagl_marshal_put_uint32(&in_buff, 0);
+
+        YAGL_LOG_FUNC_EXIT(NULL);
+
+        return NULL;
     }
 
+    in_buff_ret = in_buff;
+
+    yagl_marshal_skip(&in_buff);
+
+    out_buff = yagl_thread_call(ts, api_id, func_id, out_buff, in_buff);
+
+    yagl_marshal_put_uint32(&in_buff_ret, (out_buff ? 1 : 0));
+
     YAGL_LOG_FUNC_EXIT(NULL);
+
+    return out_buff;
 }
 
 void yagl_server_dispatch_exit(struct yagl_server_state *ss,
index 362ae36..429a35d 100644 (file)
@@ -32,8 +32,7 @@ void yagl_server_state_destroy(struct yagl_server_state *ss);
 void yagl_server_reset(struct yagl_server_state *ss);
 
 /*
- * This is called for first YaGL call. 'buff' is guaranteed to be one
- * target page long, server code should not read/write more.
+ * This is called for first YaGL call.
  */
 bool yagl_server_dispatch_init(struct yagl_server_state *ss,
                                yagl_pid target_pid,
@@ -42,14 +41,14 @@ bool yagl_server_dispatch_init(struct yagl_server_state *ss,
                                uint8_t *in_buff);
 
 /*
- * This is called for each host YaGL call. 'buff' is guaranteed to be one
- * target page long, server code should not read/write more.
+ * This is called for each host YaGL call. Returns new
+ * position of 'out_buff' on success and NULL on failure.
  */
-void yagl_server_dispatch(struct yagl_server_state *ss,
-                          yagl_pid target_pid,
-                          yagl_tid target_tid,
-                          uint8_t *out_buff,
-                          uint8_t *in_buff);
+uint8_t *yagl_server_dispatch(struct yagl_server_state *ss,
+                              yagl_pid target_pid,
+                              yagl_tid target_tid,
+                              uint8_t *out_buff,
+                              uint8_t *in_buff);
 
 /*
  * This is called for last YaGL call.
index 644865a..d98bd19 100644 (file)
@@ -47,14 +47,6 @@ static void *yagl_thread_func(void* arg)
             break;
         }
 
-        /*
-         * At this point we should have api id, func id and out buffer.
-         */
-
-        assert(ts->current_api);
-        assert(ts->current_func);
-        assert(ts->current_out_buff);
-
         YAGL_LOG_TRACE("calling (api = %u, func = %u)",
                        ts->current_api,
                        ts->current_func);
@@ -62,87 +54,18 @@ static void *yagl_thread_func(void* arg)
         api_ps = ts->ps->api_states[ts->current_api - 1];
         assert(api_ps);
 
-        /*
-         * Only here we can reset return events, since it's guaranteed that
-         * the caller and host thread are in sync at this point.
-         */
-
-        yagl_event_reset(&ts->return_event);
-        yagl_event_reset(&ts->return_processed_event);
-
         func = api_ps->get_func(api_ps, ts->current_func);
 
-        ts->call_was_processed = false;
-
         if (!func) {
             api_ps->bad_call();
+            ts->current_out_buff = NULL;
         } else {
-            func(ts, ts->current_out_buff, ts->in_buff);
+            ts->current_out_buff = func(ts,
+                                        ts->current_out_buff,
+                                        ts->current_in_buff);
         }
 
-        assert(ts->call_was_processed || !ts->can_return);
-
-        YAGL_LOG_TRACE("returned");
-
-        if (!yagl_event_is_set(&ts->return_processed_event)) {
-            /*
-             * 'YAGL_BARRIER_ARG_NORET' was not called, that's the most common
-             * case.
-             */
-            if (ts->call_was_processed) {
-                /*
-                 * 'func' did call 'YAGL_BARRIER_ARG'. This is
-                 * slow path.
-                 */
-
-                /*
-                 * In case it didn't call 'YAGL_BARRIER_RET'.
-                 */
-                if (!yagl_thread_wait_return(ts)) {
-                    break;
-                }
-
-                /*
-                 * At this point caller is waiting for return.
-                 */
-                assert(ts->current_in_buff);
-
-                memcpy(ts->current_in_buff,
-                       ts->in_buff,
-                       YAGL_MARSHAL_MAX_RESPONSE);
-
-                ts->current_env = NULL;
-                yagl_event_set(&ts->return_processed_event);
-            } else {
-                /*
-                 * 'func' didn't call neither 'YAGL_BARRIER_ARG' nor
-                 * 'YAGL_BARRIER_XXX_RET', this is fast path.
-                 */
-                assert(!ts->can_return);
-
-                /*
-                 * We can't be in destroying state cause we know for sure
-                 * we're in 'yagl_thread_call'.
-                 */
-                assert(!ts->destroying);
-
-                /*
-                 * And we know for sure that buffer is available at
-                 * this point.
-                 */
-                assert(ts->current_in_buff);
-
-                memcpy(ts->current_in_buff,
-                       ts->in_buff,
-                       YAGL_MARSHAL_MAX_RESPONSE);
-
-                ts->call_was_processed = true;
-                ts->can_return = true;
-                ts->current_env = NULL;
-                yagl_event_set(&ts->call_processed_event);
-                yagl_event_set(&ts->return_processed_event);
-            }
-        }
+        yagl_event_set(&ts->call_processed_event);
     }
 
     /*
@@ -173,11 +96,6 @@ struct yagl_thread_state
     yagl_event_init(&ts->call_event, 0, 0);
     yagl_event_init(&ts->call_processed_event, 0, 0);
 
-    yagl_event_init(&ts->return_event, 1, 0);
-    yagl_event_init(&ts->return_processed_event, 1, 0);
-
-    ts->in_buff = g_malloc0(TARGET_PAGE_SIZE);
-
     qemu_thread_create(&ts->host_thread,
                        yagl_thread_func,
                        ts,
@@ -190,26 +108,19 @@ void yagl_thread_state_destroy(struct yagl_thread_state *ts)
 {
     ts->destroying = true;
     yagl_event_set(&ts->call_event);
-    yagl_event_set(&ts->return_event);
     qemu_thread_join(&ts->host_thread);
 
-    g_free(ts->in_buff);
-
-    yagl_event_cleanup(&ts->return_processed_event);
-    yagl_event_cleanup(&ts->return_event);
-
     yagl_event_cleanup(&ts->call_processed_event);
     yagl_event_cleanup(&ts->call_event);
 
     g_free(ts);
 }
 
-bool yagl_thread_call(struct yagl_thread_state *ts,
-                      yagl_api_id api_id,
-                      yagl_func_id func_id,
-                      uint8_t *out_buff,
-                      uint8_t *in_buff,
-                      uint32_t* returned)
+uint8_t *yagl_thread_call(struct yagl_thread_state *ts,
+                          yagl_api_id api_id,
+                          yagl_func_id func_id,
+                          uint8_t *out_buff,
+                          uint8_t *in_buff)
 {
     YAGL_LOG_FUNC_ENTER_TS(ts,
                            yagl_thread_call,
@@ -217,19 +128,6 @@ bool yagl_thread_call(struct yagl_thread_state *ts,
                            api_id,
                            func_id);
 
-    *returned = 0;
-
-    if (ts->current_api || ts->current_func) {
-        YAGL_LOG_CRITICAL(
-            "another call (api = %u, func = %u) is already in progress, not scheduling (api = %u, func = %u)",
-            ts->current_api, ts->current_func,
-            api_id, func_id);
-
-        YAGL_LOG_FUNC_EXIT(NULL);
-
-        return false;
-    }
-
     assert(cpu_single_env);
 
     ts->current_api = api_id;
@@ -238,7 +136,7 @@ bool yagl_thread_call(struct yagl_thread_state *ts,
     ts->current_in_buff = in_buff;
     ts->current_env = cpu_single_env;
 
-    YAGL_LOG_TRACE("calling to (api = %u, func = %u)",
+    YAGL_LOG_TRACE("calling (api = %u, func = %u)",
                    ts->current_api,
                    ts->current_func);
 
@@ -247,123 +145,7 @@ bool yagl_thread_call(struct yagl_thread_state *ts,
     yagl_event_set(&ts->call_event);
     yagl_event_wait(&ts->call_processed_event);
 
-    assert(!ts->current_env);
-
-    if (ts->can_return) {
-        /*
-         * Fast path, we can return immediately.
-         */
-
-        /*
-         * We need to set 'current_env' again for the case
-         * when working thread has already called
-         * 'YAGL_BARRIER_ARG/YAGL_BARRIER_RET' sequence.
-         */
-        ts->current_env = cpu_single_env;
-
-        yagl_event_set(&ts->return_event);
-        yagl_event_wait(&ts->return_processed_event);
-
-        /*
-         * We'll have to reset ourselves since the thread
-         * might have issued 'ts->current_env = NULL' before
-         * our 'ts->current_env = cpu_single_env'
-         */
-        ts->current_env = NULL;
-
-        ts->current_api = 0;
-        ts->current_func = 0;
-        ts->can_return = false;
-
-        *returned = 1;
-    }
-
-    ts->current_out_buff = NULL;
-    ts->current_in_buff = NULL;
-
     YAGL_LOG_FUNC_EXIT(NULL);
 
-    return true;
-}
-
-bool yagl_thread_try_return(struct yagl_thread_state *ts,
-                            uint8_t *in_buff,
-                            uint32_t* returned)
-{
-    YAGL_LOG_FUNC_ENTER_TS(ts, yagl_thread_try_return, NULL);
-
-    *returned = 0;
-
-    if (!ts->current_api || !ts->current_func) {
-        YAGL_LOG_CRITICAL("no call in progress");
-
-        YAGL_LOG_FUNC_EXIT("false");
-
-        return false;
-    }
-
-    if (!ts->can_return) {
-        YAGL_LOG_TRACE("still in progress (api = %u, func = %u)",
-                       ts->current_api,
-                       ts->current_func);
-
-        YAGL_LOG_FUNC_EXIT("true");
-
-        return true;
-    }
-
-    YAGL_LOG_TRACE("returning from (api = %u, func = %u)",
-                   ts->current_api,
-                   ts->current_func);
-
-    assert(cpu_single_env);
-
-    ts->current_in_buff = in_buff;
-    ts->current_env = cpu_single_env;
-
-    yagl_cpu_synchronize_state(ts->ps);
-
-    yagl_event_set(&ts->return_event);
-    yagl_event_wait(&ts->return_processed_event);
-
-    /*
-     * We'll have to reset ourselves since the thread
-     * might have issued 'ts->current_env = NULL' before
-     * our 'ts->current_env = cpu_single_env'
-     */
-    ts->current_env = NULL;
-
-    ts->current_api = 0;
-    ts->current_func = 0;
-    ts->current_in_buff = NULL;
-    ts->can_return = false;
-
-    *returned = 1;
-
-    YAGL_LOG_FUNC_EXIT("true");
-
-    return true;
-}
-
-void yagl_thread_call_processed_willwait(struct yagl_thread_state *ts)
-{
-    ts->call_was_processed = true;
-    ts->current_env = NULL;
-    yagl_event_set(&ts->call_processed_event);
-}
-
-void yagl_thread_call_processed_nowait(struct yagl_thread_state *ts)
-{
-    ts->call_was_processed = true;
-    ts->can_return = true;
-    ts->current_env = NULL;
-    yagl_event_set(&ts->call_processed_event);
-    yagl_event_set(&ts->return_processed_event);
-}
-
-bool yagl_thread_wait_return(struct yagl_thread_state *ts)
-{
-    ts->can_return = true;
-    yagl_event_wait(&ts->return_event);
-    return !ts->destroying;
+    return ts->current_out_buff;
 }
index 97be484..5ac218e 100644 (file)
@@ -30,51 +30,23 @@ struct yagl_thread_state
      * @}
      */
 
-    /*
-     * And these are manual reset.
-     * @{
-     */
-    struct yagl_event return_event; /* Set whenever target wants return */
-    struct yagl_event return_processed_event; /* Set whenever host processed target return */
-    /*
-     * @}
-     */
-
-    /*
-     * Indicates that host thread processed the call. This is needed in order to
-     * detect functions that do not set 'call_processed_event' due to errors for
-     * example and set it ourselves in thread body.
-     */
-    volatile bool call_was_processed;
-
-    volatile bool can_return; /* Indicates that host thread is ready to return the value */
-
     volatile yagl_api_id current_api;
 
     volatile yagl_func_id current_func;
 
     /*
-     * TARGET_PAGE_SIZE buffers, enough to marshal/unmarshal arguments.
-     */
-
-    /*
-     * Allocated by the caller of yagl_thread_call/yagl_thread_try_return,
+     * Allocated by the caller of yagl_thread_call,
      * invalidated after function return.
      */
     uint8_t * volatile current_out_buff;
     uint8_t * volatile current_in_buff;
 
     /*
-     * Set by the caller of yagl_thread_call/yagl_thread_try_return for
+     * Set by the caller of yagl_thread_call for
      * the time of call. This is the time when host thread can
      * read/write target memory.
      */
     CPUArchState * volatile current_env;
-
-    /*
-     * Allocated here, copied to 'current_in_buff' when needed.
-     */
-    uint8_t *in_buff;
 };
 
 struct yagl_thread_state
@@ -83,48 +55,17 @@ struct yagl_thread_state
 
 void yagl_thread_state_destroy(struct yagl_thread_state *ts);
 
-bool yagl_thread_call(struct yagl_thread_state *ts,
-                      yagl_api_id api_id,
-                      yagl_func_id func_id,
-                      uint8_t *out_buff,
-                      uint8_t *in_buff,
-                      uint32_t* returned);
-
-bool yagl_thread_try_return(struct yagl_thread_state *ts,
-                            uint8_t *in_buff,
-                            uint32_t* returned);
-
-/*
- * Function below should only be called by API dispatch functions.
- * @{
- */
-
-/*
- * Specifies that a call was processed and the caller can return.
- * You should call 'yagl_thread_wait_return' at some point later.
- * If you don't call 'yagl_thread_wait_return' then it'll be called
- * automatically for you.
- */
-void yagl_thread_call_processed_willwait(struct yagl_thread_state *ts);
-
-/*
- * Specifies that a call was processed and the caller can return.
- * You should not call 'yagl_thread_wait_return'.
- */
-void yagl_thread_call_processed_nowait(struct yagl_thread_state *ts);
-
 /*
- * Waits for the caller to query for return. If return value is false then
- * the target thread terminated and you should return as soon as possible.
+ * Returns new position of 'out_buff' on success and NULL on failure.
  */
-bool yagl_thread_wait_return(struct yagl_thread_state *ts);
-
-/*
- * @}
- */
-
-#define YAGL_BARRIER_ARG(ts) yagl_thread_call_processed_willwait(ts)
-#define YAGL_BARRIER_RET(ts) yagl_thread_wait_return(ts)
-#define YAGL_BARRIER_ARG_NORET(ts) yagl_thread_call_processed_nowait(ts)
+uint8_t *yagl_thread_call(struct yagl_thread_state *ts,
+                          yagl_api_id api_id,
+                          yagl_func_id func_id,
+                          uint8_t *out_buff,
+                          uint8_t *in_buff);
+
+#define YAGL_BARRIER_ARG(ts)
+#define YAGL_BARRIER_RET(ts) 1
+#define YAGL_BARRIER_ARG_NORET(ts)
 
 #endif
index f04e800..379a2b5 100644 (file)
@@ -36,8 +36,8 @@ typedef enum
 
 struct yagl_thread_state;
 
-typedef void (*yagl_api_func)(struct yagl_thread_state */*ts*/,
-                              uint8_t */*out_buff*/,
-                              uint8_t */*in_buff*/);
+typedef uint8_t *(*yagl_api_func)(struct yagl_thread_state */*ts*/,
+                                  uint8_t */*out_buff*/,
+                                  uint8_t */*in_buff*/);
 
 #endif
index be25d55..11331ff 100644 (file)
@@ -6,6 +6,6 @@
 /*
  * Whenever protocol changes be sure to bump this.
  */
-#define YAGL_VERSION 2
+#define YAGL_VERSION 3
 
 #endif