1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-01-22 19:31:27 +00:00

Report a 1 in the stack pointer high byte when in emulation mode.

It has one internally, it just wasn't previously exposed via this method.
This commit is contained in:
Thomas Harte 2022-06-22 15:55:34 -04:00
parent a72dd96dc6
commit ecfd17a259

View File

@ -14,7 +14,10 @@ uint16_t ProcessorBase::get_value_of_register(Register r) const {
switch (r) {
case Register::ProgramCounter: return registers_.pc;
case Register::LastOperationAddress: return last_operation_pc_;
case Register::StackPointer: return registers_.s.full & (registers_.emulation_flag ? 0xff : 0xffff);
case Register::StackPointer:
return
(registers_.s.full & (registers_.emulation_flag ? 0xff : 0xffff)) |
(registers_.emulation_flag ? 0x100 : 0x000);
case Register::Flags: return get_flags();
case Register::A: return registers_.a.full;
case Register::X: return registers_.x.full;