diff --git a/Processors/6502/AllRAM/6502AllRAM.cpp b/Processors/6502/AllRAM/6502AllRAM.cpp index 49344126d..cbd8e6b36 100644 --- a/Processors/6502/AllRAM/6502AllRAM.cpp +++ b/Processors/6502/AllRAM/6502AllRAM.cpp @@ -11,7 +11,7 @@ #include #include -//#define BE_NOISY +#define BE_NOISY using namespace CPU::MOS6502; @@ -45,14 +45,14 @@ template class ConcreteAllRAMProcessor: public AllRAMProcessor, publ *value = memory_[address]; #ifdef BE_NOISY // if((address&0xff00) == 0x100) { - printf("%04x -> %02x\n", address, *value); +// printf("%04x -> %02x\n", address, *value); // } #endif } else { memory_[address] = *value; #ifdef BE_NOISY // if((address&0xff00) == 0x100) { - printf("%04x <- %02x\n", address, *value); +// printf("%04x <- %02x\n", address, *value); // } #endif } diff --git a/Processors/65816/Implementation/65816Implementation.hpp b/Processors/65816/Implementation/65816Implementation.hpp index 5daa93055..3b1ba85f7 100644 --- a/Processors/65816/Implementation/65816Implementation.hpp +++ b/Processors/65816/Implementation/65816Implementation.hpp @@ -109,6 +109,10 @@ template void Processor::run_for(const Cycles write(data_address_, data_buffer_.next_output()); break; + case CycleStoreDataThrowaway: + write(data_address_, data_buffer_.preview_output()); + break; + case CycleStoreIncrementData: write(data_address_, data_buffer_.next_output()); increment_data_address(); diff --git a/Processors/65816/Implementation/65816Storage.cpp b/Processors/65816/Implementation/65816Storage.cpp index e451ee3ad..c83963d30 100644 --- a/Processors/65816/Implementation/65816Storage.cpp +++ b/Processors/65816/Implementation/65816Storage.cpp @@ -157,7 +157,7 @@ struct CPU::WDC65816::ProcessorStorageConstructor { target(CycleFetchData); // Data [high]. if(!is8bit) target(CycleFetchData); // 16-bit: reread final byte of data. - else target(CycleStoreData); // 8-bit rewrite final byte of data. + else target(CycleStoreDataThrowaway); // 8-bit rewrite final byte of data. target(OperationPerform); // Perform operation within the data buffer. diff --git a/Processors/65816/Implementation/65816Storage.hpp b/Processors/65816/Implementation/65816Storage.hpp index ff9206653..85964fa50 100644 --- a/Processors/65816/Implementation/65816Storage.hpp +++ b/Processors/65816/Implementation/65816Storage.hpp @@ -31,6 +31,8 @@ enum MicroOp: uint8_t { /// Stores a byte from the data buffer. CycleStoreData, + /// Stores the most recent byte placed into the data buffer without removing it. + CycleStoreDataThrowaway, /// Stores a byte to the data address from the data buffer and increments the data address. CycleStoreIncrementData, /// Stores a byte to the data address from the data buffer and decrements the data address. @@ -282,6 +284,10 @@ struct ProcessorStorage { return next; } + uint8_t *preview_output() { + return byte(read); + } + uint8_t *next_stack() { --size; return byte(size);