From 02259559393c90faac22858065de39fb2aa2c511 Mon Sep 17 00:00:00 2001 From: scawful Date: Wed, 24 Apr 2024 10:16:21 -0400 Subject: [PATCH] Fix Cpu::SetFlags bug in emulation mode --- src/app/emu/cpu/cpu.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/emu/cpu/cpu.h b/src/app/emu/cpu/cpu.h index c3cb0cf4..ddc740a2 100644 --- a/src/app/emu/cpu/cpu.h +++ b/src/app/emu/cpu/cpu.h @@ -106,9 +106,11 @@ class Cpu : public Loggable, public core::ExperimentFlags { void SetFlags(uint8_t val) { status = val; if (E) { - status |= 0x10; + SetAccumulatorSize(true); + SetIndexSize(true); + SetSP(SP() & 0xFF | 0x100); } - if (status & 0x20) { + if (GetIndexSize()) { X &= 0xff; Y &= 0xff; }