t blx long with bit 0 set should raise an exception

fixes a bug with gbarunner3
This commit is contained in:
Jaklyy 2024-11-07 13:16:39 -05:00
parent 3bd6274477
commit ef5de6091b

View File

@ -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;