From 2d28451f6cb74eed09203b4b3a2da3549dd27cc9 Mon Sep 17 00:00:00 2001 From: David Guillen Fandos Date: Thu, 20 Apr 2023 21:08:49 +0200 Subject: [PATCH] Fix SWI branch mismatch The mismatch causes one-of errors for instruction 0F000000 (swieq 0) which results in all sorts of funny errors (branches to bad addresses). Fixes a couple of games. --- cpu_threaded.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpu_threaded.c b/cpu_threaded.c index 5cf545b..c2dc35f 100644 --- a/cpu_threaded.c +++ b/cpu_threaded.c @@ -2697,7 +2697,7 @@ u8 function_cc *block_lookup_address_thumb(u32 pc) ((opcode & 0x12FFF10) == 0x12FFF10) || \ ((opcode & 0x8108000) == 0x8108000) || \ ((opcode >= 0xA000000) && (opcode < 0xF000000)) || \ - ((opcode > 0xF000000) && (!is_div_swi((opcode >> 16) & 0xFF)))) \ + ((opcode >= 0xF000000) && (!is_div_swi((opcode >> 16) & 0xFF)))) \ #define arm_opcode_branch \ ((opcode & 0xE000000) == 0xA000000) \