notaz.gp2x.de
/
pcsx_rearmed.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
1f84e11
)
gpus: handle list underflows better
author
notaz
<notasas@gmail.com>
Sun, 6 Jan 2013 01:55:09 +0000
(
03:55
+0200)
committer
notaz
<notasas@gmail.com>
Sun, 6 Jan 2013 01:55:09 +0000
(
03:55
+0200)
plugins/dfxvideo/gpulib_if.c
patch
|
blob
|
blame
|
history
plugins/gpu-gles/gpulib_if.c
patch
|
blob
|
blame
|
history
plugins/gpu_neon/psx_gpu/psx_gpu_parse.c
patch
|
blob
|
blame
|
history
plugins/gpu_unai/gpulib_if.cpp
patch
|
blob
|
blame
|
history
diff --git
a/plugins/dfxvideo/gpulib_if.c
b/plugins/dfxvideo/gpulib_if.c
index
d98520c
..
01b8dde
100644
(file)
--- 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)
{
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++;
break;
list_position++;
@@
-360,7
+365,12
@@
int do_cmd_list(unsigned int *list, int list_len, int *last_cmd)
while(1)
{
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;
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;
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
(file)
--- 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)
{
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++;
break;
list_position++;
@@
-567,7
+572,12
@@
int do_cmd_list(unsigned int *list, int list_len, int *last_cmd)
while(1)
{
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;
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;
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
(file)
--- 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)
num_vertexes++;
if(list_position >= list_end)
- break;
+ {
+ current_command = (u32)-1;
+ goto breakloop;
+ }
xy = *list_position;
if((xy & 0xF000F000) == 0x50005000)
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)
num_vertexes++;
if(list_position >= list_end)
- break;
+ {
+ current_command = (u32)-1;
+ goto breakloop;
+ }
color = list_position[0];
if((color & 0xF000F000) == 0x50005000)
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:
breakloop:
-#endif
if (last_command != NULL)
*last_command = current_command;
return list - list_start;
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)
num_vertexes++;
if(list_position >= list_end)
- break;
+ {
+ current_command = (u32)-1;
+ goto breakloop;
+ }
xy = *list_position;
if((xy & 0xF000F000) == 0x50005000)
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)
num_vertexes++;
if(list_position >= list_end)
- break;
+ {
+ current_command = (u32)-1;
+ goto breakloop;
+ }
color = list_position[0];
if((color & 0xF000F000) == 0x50005000)
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
(file)
--- 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++;
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;
}
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++;
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;
}
break;
}