gpu_neon: flush queues before reads too
[pcsx_rearmed.git] / plugins / gpu_neon / vout_sdl.c
index 3152c32..0830c56 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);
@@ -80,6 +80,8 @@ static void blit(void)
 void GPUupdateLace(void)
 {
   if (!gpu.status.blanking && gpu.state.fb_dirty) {
+    if (gpu.cmd_len > 0)
+      flush_cmd_buffer();
     renderer_flush_queues();
     blit();
     gpu.state.fb_dirty = 0;
@@ -97,8 +99,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