psx_gpu: some argument checks
[pcsx_rearmed.git] / plugins / gpu_neon / vout_sdl.c
index f2f87e9..53ed197 100644 (file)
@@ -68,7 +68,7 @@ static void blit(void)
   else
   {
     uint16_t *s = gpu.vram;
-    d = screen->pixels;
+    d = (uint32_t *)screen->pixels;
     for (i = 0; i < 1024 * 512; i++)
       d[i] = (((uint32_t)s[i] << 19) & 0xf80000) | ((s[i] << 6) & 0xf800) |
         ((s[i] >> 7) & 0xf8);
@@ -79,8 +79,11 @@ static void blit(void)
 
 void GPUupdateLace(void)
 {
-  if (!gpu.status.blanking)
+  if (!gpu.status.blanking && gpu.state.fb_dirty) {
+    renderer_flush_queues();
     blit();
+    gpu.state.fb_dirty = 0;
+  }
 }
 
 long GPUopen(void **dpy)
@@ -94,8 +97,16 @@ long GPUclose(void)
   return 0;
 }
 
-void GPUrearmedCallbacks(const void *cbs_)
+#include "../../frontend/plugin_lib.h"
+
+void GPUrearmedCallbacks(const struct rearmed_cbs *cbs)
 {
+  gpu.state.hcnt = cbs->gpu_hcnt;
+  gpu.state.frame_count = cbs->gpu_frame_count;
+
+  if (cbs->pl_vout_set_raw_vram)
+    cbs->pl_vout_set_raw_vram(gpu.vram);
+  renderer_set_config(cbs);
 }
 
 // vim:shiftwidth=2:expandtab