aboutsummaryrefslogtreecommitdiff
path: root/plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.S
diff options
context:
space:
mode:
authornotaz2012-10-28 16:32:24 +0200
committernotaz2012-10-28 16:32:24 +0200
commitb7569147823a8fc5a9de98e5d491da906e119296 (patch)
tree37756722a18e390c8ef5908ab5a21fd89a8da722 /plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.S
parent8438c3c78159bd3986560e30bfe97b7bb91f8cc4 (diff)
downloadpcsx_rearmed-b7569147823a8fc5a9de98e5d491da906e119296.tar.gz
pcsx_rearmed-b7569147823a8fc5a9de98e5d491da906e119296.tar.bz2
pcsx_rearmed-b7569147823a8fc5a9de98e5d491da906e119296.zip
psx_gpu: workaround overflow crash
rare corner case
Diffstat (limited to 'plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.S')
-rw-r--r--plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.S13
1 files changed, 13 insertions, 0 deletions
diff --git a/plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.S b/plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.S
index a2bfa5b..4e1e403 100644
--- a/plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.S
+++ b/plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.S
@@ -1175,6 +1175,10 @@ function(setup_spans_up_down)
ldrh temp, [ psx_gpu, #psx_gpu_num_spans_offset ]
add temp, temp, height_minor_b
+
+ cmp temp, #MAX_SPANS
+ beq 5f
+
strh temp, [ psx_gpu, #psx_gpu_num_spans_offset ]
2:
@@ -1190,6 +1194,15 @@ function(setup_spans_up_down)
setup_spans_prologue_b()
bal 4b
+ 5:
+ // FIXME: overflow corner case
+ sub temp, temp, height_minor_b
+ bics height_minor_b, #3
+ add temp, temp, height_minor_b
+ strh temp, [ psx_gpu, #psx_gpu_num_spans_offset ]
+ bne 2b
+ bal 1b
+
.pool
#undef span_uvrg_offset