summaryrefslogtreecommitdiff
path: root/arm/arm_emit.h
diff options
context:
space:
mode:
authornotaz2011-09-08 01:39:47 +0300
committernotaz2011-09-08 01:39:47 +0300
commit804e743b41827d1e8a5337d04638f0a578319893 (patch)
treeddb9338d67b8b513147dd55a640b014f59dc2cca /arm/arm_emit.h
parentd40aa461c5267826ec092f80b9e4db6cc38466b1 (diff)
downloadpicogpsp-804e743b41827d1e8a5337d04638f0a578319893.tar.gz
picogpsp-804e743b41827d1e8a5337d04638f0a578319893.tar.bz2
picogpsp-804e743b41827d1e8a5337d04638f0a578319893.zip
handle div by 0
Diffstat (limited to 'arm/arm_emit.h')
-rw-r--r--arm/arm_emit.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/arm/arm_emit.h b/arm/arm_emit.h
index a270a24..a770063 100644
--- a/arm/arm_emit.h
+++ b/arm/arm_emit.h
@@ -1931,6 +1931,9 @@ void execute_swi_hle_div_thumb();
void execute_swi_hle_div_c()
{
+ if (reg[1] == 0)
+ // real BIOS supposedly locks up, but game can recover on interrupt
+ return;
s32 result = (s32)reg[0] / (s32)reg[1];
reg[1] = (s32)reg[0] % (s32)reg[1];
reg[0] = result;