psx_gpu: fix line cmd length and move w/h masking
[pcsx_rearmed.git] / plugins / gpulib / gpu.c
index aefd53b..79a5fa4 100644 (file)
@@ -333,6 +333,7 @@ static noinline int do_cmd_list_skip(uint32_t *data, int count, int *last_cmd)
   int cmd = 0, pos = 0, len, dummy;
   int skip = 1;
 
+  // XXX: polylines are not properly handled
   while (pos < count && skip) {
     uint32_t *list = data + pos;
     cmd = list[0] >> 24;
@@ -581,6 +582,7 @@ long GPUfreeze(uint32_t type, struct GPUFreeze *freeze)
       memcpy(gpu.regs, freeze->ulControl, sizeof(gpu.regs));
       memcpy(gpu.ex_regs, freeze->ulControl + 0xe0, sizeof(gpu.ex_regs));
       gpu.status.reg = freeze->ulStatus;
+      gpu.cmd_len = 0;
       for (i = 8; i > 0; i--) {
         gpu.regs[i] ^= 1; // avoid reg change detection
         GPUwriteStatus((i << 24) | (gpu.regs[i] ^ 1));