From 804e743b41827d1e8a5337d04638f0a578319893 Mon Sep 17 00:00:00 2001 From: notaz Date: Thu, 8 Sep 2011 01:39:47 +0300 Subject: [PATCH] handle div by 0 --- arm/arm_emit.h | 3 +++ 1 file changed, 3 insertions(+) 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; -- 2.39.5