1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-09-27 18:55:48 +00:00

Provide an always-16bit-address route to the stack.

This commit is contained in:
Thomas Harte 2023-07-30 16:25:51 -04:00
parent 6ae967de51
commit 3a02c22072
2 changed files with 19 additions and 0 deletions

View File

@ -191,6 +191,13 @@ template <typename BusHandler, bool uses_ready_line> void Processor<BusHandler,
--registers_.s.full;
break;
case CyclePushNotEmulation:
bus_address_ = registers_.s.full;
bus_value_ = data_buffer_.next_output_descending();
bus_operation_ = MOS6502Esque::Write;
--registers_.s.full;
break;
case CyclePullIfNotEmulation:
if(registers_.emulation_flag) {
continue;
@ -202,6 +209,13 @@ template <typename BusHandler, bool uses_ready_line> void Processor<BusHandler,
stack_access(data_buffer_.next_input(), MOS6502Esque::Read);
break;
case CyclePullNotEmulation:
++registers_.s.full;
bus_address_ = registers_.s.full;
bus_value_ = data_buffer_.next_input();
bus_operation_ = MOS6502Esque::Read;
break;
case CycleAccessStack:
stack_access(&bus_throwaway_, MOS6502Esque::InternalOperationRead);
break;

View File

@ -58,6 +58,11 @@ enum MicroOp: uint8_t {
/// Performs as CyclePull if the 65816 is not in emulation mode; otherwise skips itself.
CyclePullIfNotEmulation,
/// Pushes a single byte from the data buffer to the stack, always using its full 16-bit address.
CyclePushNotEmulation,
/// Pulls a single byte to the data buffer from the stack, always using its full 16-bit address.
CyclePullNotEmulation,
/// Issues a BusOperation::None and regresses the micro-op counter until an established
/// STP or WAI condition is satisfied.
CycleRepeatingNone,