From 491879da95b4286f0f41ed0f650a00e91f37c671 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Mon, 26 Jun 2023 16:14:25 -0700 Subject: [PATCH] ARM: Remove obsolete force-alignment in `bx pc` (fixes #2964) --- CHANGES | 1 + src/arm/isa-thumb.c | 6 +----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index 14a71073e..aa3162ca1 100644 --- a/CHANGES +++ b/CHANGES @@ -6,6 +6,7 @@ Features: - New unlicensed GB mappers: NT (older types 1 and 2), Li Cheng, GGB-81 - Debugger: Add range watchpoints Emulation fixes: + - ARM: Remove obsolete force-alignment in `bx pc` (fixes mgba.io/i/2964) - GB Audio: Fix channels 1/2 staying muted if restarted after long silence - GB I/O: Read back proper SVBK value after writing 0 (fixes mgba.io/i/2921) - GB Serialize: Add missing Pocket Cam state to savestates diff --git a/src/arm/isa-thumb.c b/src/arm/isa-thumb.c index 6e3c30e11..e2af3d179 100644 --- a/src/arm/isa-thumb.c +++ b/src/arm/isa-thumb.c @@ -401,11 +401,7 @@ DEFINE_INSTRUCTION_THUMB(BL2, DEFINE_INSTRUCTION_THUMB(BX, int rm = (opcode >> 3) & 0xF; _ARMSetMode(cpu, cpu->gprs[rm] & 0x00000001); - int misalign = 0; - if (rm == ARM_PC) { - misalign = cpu->gprs[rm] & 0x00000002; - } - cpu->gprs[ARM_PC] = (cpu->gprs[rm] & 0xFFFFFFFE) - misalign; + cpu->gprs[ARM_PC] = cpu->gprs[rm] & 0xFFFFFFFE; if (cpu->executionMode == MODE_THUMB) { currentCycles += ThumbWritePC(cpu); } else {