ARM Debugger: Fix disassembly alignment (fixes #2204)

This commit is contained in:
Vicki Pfau 2021-06-04 21:01:07 -07:00
parent 806ce79f91
commit f3ae8f2143
2 changed files with 3 additions and 1 deletions

View File

@ -5,6 +5,7 @@ Emulation fixes:
- GBA Video: Revert scanline latching changes (fixes mgba.io/i/2153, mgba.io/i/2149)
Other fixes:
- 3DS: Fix disabling "wide" mode on 2DS (fixes mgba.io/i/2167)
- ARM Debugger: Fix disassembly alignment (fixes mgba.io/i/2204)
- Core: Fix memory leak in opening games from the library
- Core: Fix memory searches for relative values (fixes mgba.io/i/2135)
- GB Core: Fix GBC colors setting breaking default model overrides (fixes mgba.io/i/2161)

View File

@ -101,9 +101,10 @@ static inline uint32_t _printLine(struct CLIDebugger* debugger, uint32_t address
struct mCore* core = debugger->d.core;
char disassembly[64];
struct ARMInstructionInfo info;
address &= ~(WORD_SIZE_THUMB - 1);
be->printf(be, "%08X: ", address);
if (mode == MODE_ARM) {
uint32_t instruction = core->busRead32(core, address);
uint32_t instruction = core->busRead32(core, address & ~(WORD_SIZE_ARM - 1));
ARMDecodeARM(instruction, &info);
ARMDisassemble(&info, core->cpu, core->symbolTable, address + WORD_SIZE_ARM * 2, disassembly, sizeof(disassembly));
be->printf(be, "%08X\t%s\n", instruction, disassembly);