Add a threaded renderer
[pcsx_rearmed.git] / plugins / dfxvideo / gpulib_if.c
index d98520c..db0797c 100644 (file)
@@ -309,11 +309,11 @@ void renderer_notify_res_change(void)
 
 extern const unsigned char cmd_lengths[256];
 
-int do_cmd_list(unsigned int *list, int list_len, int *last_cmd)
+int do_cmd_list(uint32_t *list, int list_len, int *last_cmd)
 {
   unsigned int cmd = 0, len;
-  unsigned int *list_start = list;
-  unsigned int *list_end = list + list_len;
+  uint32_t *list_start = list;
+  uint32_t *list_end = list + list_len;
 
   for (; list < list_end; list += 1 + len)
   {
@@ -342,7 +342,12 @@ int do_cmd_list(unsigned int *list, int list_len, int *last_cmd)
 
         while(1)
         {
-          if((*list_position & 0xf000f000) == 0x50005000 || list_position >= list_end)
+          if(list_position >= list_end) {
+            cmd = -1;
+            goto breakloop;
+          }
+
+          if((*list_position & 0xf000f000) == 0x50005000)
             break;
 
           list_position++;
@@ -360,7 +365,12 @@ int do_cmd_list(unsigned int *list, int list_len, int *last_cmd)
 
         while(1)
         {
-          if((*list_position & 0xf000f000) == 0x50005000 || list_position >= list_end)
+          if(list_position >= list_end) {
+            cmd = -1;
+            goto breakloop;
+          }
+
+          if((*list_position & 0xf000f000) == 0x50005000)
             break;
 
           list_position += 2;
@@ -386,6 +396,7 @@ int do_cmd_list(unsigned int *list, int list_len, int *last_cmd)
     }
   }
 
+breakloop:
   gpu.ex_regs[1] &= ~0x1ff;
   gpu.ex_regs[1] |= lGPUstatusRet & 0x1ff;
 
@@ -415,6 +426,14 @@ void renderer_set_interlace(int enable, int is_odd)
 {
 }
 
+void renderer_sync(void)
+{
+}
+
+void renderer_notify_update_lace(int updated)
+{
+}
+
 #include "../../frontend/plugin_lib.h"
 
 void renderer_set_config(const struct rearmed_cbs *cbs)