From ef5de6091b903bac7a0d4f34673a69efbea27906 Mon Sep 17 00:00:00 2001 From: Jaklyy <102590697+Jaklyy@users.noreply.github.com> Date: Thu, 7 Nov 2024 13:16:39 -0500 Subject: [PATCH] t blx long with bit 0 set should raise an exception fixes a bug with gbarunner3 --- src/ARMInterpreter_Branch.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ARMInterpreter_Branch.cpp b/src/ARMInterpreter_Branch.cpp index 623be41a..88b14ab7 100644 --- a/src/ARMInterpreter_Branch.cpp +++ b/src/ARMInterpreter_Branch.cpp @@ -104,6 +104,9 @@ void T_BL_LONG_1(ARM* cpu) void T_BL_LONG_2(ARM* cpu) { + if ((cpu->CurInstr & 0x1801) == 0x0801) // "BLX" with bit 0 set is an unvalid instruction. + return T_UNK(cpu); // TODO: Check ARM7 for exceptions + s32 offset = (cpu->CurInstr & 0x7FF) << 1; u32 pc = cpu->R[14] + offset; cpu->R[14] = (cpu->R[15] - 2) | 1;