mirror of
https://github.com/TomHarte/CLK.git
synced 2025-02-09 17:31:18 +00:00
Attempted to regularise the 6502 with the Z80 as to scheduling. I think that at least one bug remains.
This commit is contained in:
parent
b5ad910b81
commit
5aa8b03349
@ -557,7 +557,6 @@ template <class T> class Processor: public MicroOpScheduler<MicroOp> {
|
|||||||
// These plus program below act to give the compiler permission to update these values
|
// These plus program below act to give the compiler permission to update these values
|
||||||
// without touching the class storage (i.e. it explicitly says they need be completely up
|
// without touching the class storage (i.e. it explicitly says they need be completely up
|
||||||
// to date in this stack frame only); which saves some complicated addressing
|
// to date in this stack frame only); which saves some complicated addressing
|
||||||
unsigned int scheduleProgramsReadPointer = schedule_programs_read_pointer_;
|
|
||||||
RegisterPair nextAddress = next_address_;
|
RegisterPair nextAddress = next_address_;
|
||||||
BusOperation nextBusOperation = next_bus_operation_;
|
BusOperation nextBusOperation = next_bus_operation_;
|
||||||
uint16_t busAddress = bus_address_;
|
uint16_t busAddress = bus_address_;
|
||||||
@ -565,7 +564,6 @@ template <class T> class Processor: public MicroOpScheduler<MicroOp> {
|
|||||||
|
|
||||||
#define checkSchedule(op) \
|
#define checkSchedule(op) \
|
||||||
if(!scheduled_program_counter_) {\
|
if(!scheduled_program_counter_) {\
|
||||||
scheduleProgramsReadPointer = schedule_programs_write_pointer_ = 0;\
|
|
||||||
if(interrupt_requests_) {\
|
if(interrupt_requests_) {\
|
||||||
if(interrupt_requests_ & (InterruptRequestFlags::Reset | InterruptRequestFlags::PowerOn)) {\
|
if(interrupt_requests_ & (InterruptRequestFlags::Reset | InterruptRequestFlags::PowerOn)) {\
|
||||||
interrupt_requests_ &= ~InterruptRequestFlags::PowerOn;\
|
interrupt_requests_ &= ~InterruptRequestFlags::PowerOn;\
|
||||||
@ -591,7 +589,6 @@ template <class T> class Processor: public MicroOpScheduler<MicroOp> {
|
|||||||
|
|
||||||
checkSchedule();
|
checkSchedule();
|
||||||
number_of_cycles += cycles_left_to_run_;
|
number_of_cycles += cycles_left_to_run_;
|
||||||
const MicroOp *program = scheduled_programs_[scheduleProgramsReadPointer];
|
|
||||||
|
|
||||||
while(number_of_cycles > 0) {
|
while(number_of_cycles > 0) {
|
||||||
|
|
||||||
@ -646,11 +643,8 @@ template <class T> class Processor: public MicroOpScheduler<MicroOp> {
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
case OperationMoveToNextProgram:
|
case OperationMoveToNextProgram:
|
||||||
scheduled_programs_[scheduleProgramsReadPointer] = NULL;
|
move_to_next_program();
|
||||||
scheduleProgramsReadPointer = (scheduleProgramsReadPointer+1)&3;
|
|
||||||
scheduled_program_counter_ = scheduled_programs_[scheduleProgramsReadPointer];
|
|
||||||
checkSchedule();
|
checkSchedule();
|
||||||
program = scheduled_programs_[scheduleProgramsReadPointer];
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
#define push(v) {\
|
#define push(v) {\
|
||||||
@ -713,7 +707,7 @@ template <class T> class Processor: public MicroOpScheduler<MicroOp> {
|
|||||||
|
|
||||||
if(jam_handler_) {
|
if(jam_handler_) {
|
||||||
jam_handler_->processor_did_jam(this, pc_.full - 1);
|
jam_handler_->processor_did_jam(this, pc_.full - 1);
|
||||||
checkSchedule(is_jammed_ = false; program = scheduled_programs_[scheduleProgramsReadPointer]);
|
checkSchedule(is_jammed_ = false; scheduled_program_counter_ = scheduled_programs_[schedule_programs_read_pointer_]);
|
||||||
}
|
}
|
||||||
} continue;
|
} continue;
|
||||||
|
|
||||||
@ -1081,7 +1075,6 @@ template <class T> class Processor: public MicroOpScheduler<MicroOp> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
cycles_left_to_run_ = number_of_cycles;
|
cycles_left_to_run_ = number_of_cycles;
|
||||||
schedule_programs_read_pointer_ = scheduleProgramsReadPointer;
|
|
||||||
next_address_ = nextAddress;
|
next_address_ = nextAddress;
|
||||||
next_bus_operation_ = nextBusOperation;
|
next_bus_operation_ = nextBusOperation;
|
||||||
bus_address_ = busAddress;
|
bus_address_ = busAddress;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user