aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/dfxvideo/gpulib_if.c15
-rw-r--r--plugins/gpu-gles/gpulib_if.c15
-rw-r--r--plugins/gpu_neon/psx_gpu/psx_gpu_parse.c22
-rw-r--r--plugins/gpu_unai/gpulib_if.cpp12
4 files changed, 52 insertions, 12 deletions
diff --git a/plugins/dfxvideo/gpulib_if.c b/plugins/dfxvideo/gpulib_if.c
index d98520c..01b8dde 100644
--- a/plugins/dfxvideo/gpulib_if.c
+++ b/plugins/dfxvideo/gpulib_if.c
@@ -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;
diff --git a/plugins/gpu-gles/gpulib_if.c b/plugins/gpu-gles/gpulib_if.c
index 068dc41..2090553 100644
--- a/plugins/gpu-gles/gpulib_if.c
+++ b/plugins/gpu-gles/gpulib_if.c
@@ -549,7 +549,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++;
@@ -567,7 +572,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;
@@ -593,6 +603,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;
diff --git a/plugins/gpu_neon/psx_gpu/psx_gpu_parse.c b/plugins/gpu_neon/psx_gpu/psx_gpu_parse.c
index a364eef..ffa9b9a 100644
--- a/plugins/gpu_neon/psx_gpu/psx_gpu_parse.c
+++ b/plugins/gpu_neon/psx_gpu/psx_gpu_parse.c
@@ -435,7 +435,10 @@ u32 gpu_parse(psx_gpu_struct *psx_gpu, u32 *list, u32 size, u32 *last_command)
num_vertexes++;
if(list_position >= list_end)
- break;
+ {
+ current_command = (u32)-1;
+ goto breakloop;
+ }
xy = *list_position;
if((xy & 0xF000F000) == 0x50005000)
@@ -496,7 +499,10 @@ u32 gpu_parse(psx_gpu_struct *psx_gpu, u32 *list, u32 size, u32 *last_command)
num_vertexes++;
if(list_position >= list_end)
- break;
+ {
+ current_command = (u32)-1;
+ goto breakloop;
+ }
color = list_position[0];
if((color & 0xF000F000) == 0x50005000)
@@ -774,9 +780,7 @@ u32 gpu_parse(psx_gpu_struct *psx_gpu, u32 *list, u32 size, u32 *last_command)
}
}
-#ifdef PCSX
breakloop:
-#endif
if (last_command != NULL)
*last_command = current_command;
return list - list_start;
@@ -1193,7 +1197,10 @@ u32 gpu_parse_enhanced(psx_gpu_struct *psx_gpu, u32 *list, u32 size,
num_vertexes++;
if(list_position >= list_end)
- break;
+ {
+ current_command = (u32)-1;
+ goto breakloop;
+ }
xy = *list_position;
if((xy & 0xF000F000) == 0x50005000)
@@ -1259,7 +1266,10 @@ u32 gpu_parse_enhanced(psx_gpu_struct *psx_gpu, u32 *list, u32 size,
num_vertexes++;
if(list_position >= list_end)
- break;
+ {
+ current_command = (u32)-1;
+ goto breakloop;
+ }
color = list_position[0];
if((color & 0xF000F000) == 0x50005000)
diff --git a/plugins/gpu_unai/gpulib_if.cpp b/plugins/gpu_unai/gpulib_if.cpp
index de16721..0d506bc 100644
--- a/plugins/gpu_unai/gpulib_if.cpp
+++ b/plugins/gpu_unai/gpulib_if.cpp
@@ -307,7 +307,11 @@ int do_cmd_list(unsigned int *list, int list_len, int *last_cmd)
gpuDrawLF(gpuPixelDrivers [ (Blending_Mode | Masking | Blending | (PixelMSB>>3)) >> 1]);
num_vertexes++;
- if((*list_position & 0xf000f000) == 0x50005000 || list_position >= list_end)
+ if(list_position >= list_end) {
+ cmd = -1;
+ goto breakloop;
+ }
+ if((*list_position & 0xf000f000) == 0x50005000)
break;
}
@@ -338,7 +342,11 @@ int do_cmd_list(unsigned int *list, int list_len, int *last_cmd)
gpuDrawLG(gpuPixelDrivers [ (Blending_Mode | Masking | Blending | (PixelMSB>>3)) >> 1]);
num_vertexes++;
- if((*list_position & 0xf000f000) == 0x50005000 || list_position >= list_end)
+ if(list_position >= list_end) {
+ cmd = -1;
+ goto breakloop;
+ }
+ if((*list_position & 0xf000f000) == 0x50005000)
break;
}