mirror of
https://github.com/TomHarte/CLK.git
synced 2025-02-16 18:30:32 +00:00
Edges almost up to an initially complete implementation.
This commit is contained in:
parent
7c9d9ee048
commit
3709aa7555
@ -35,6 +35,16 @@ State::State(const ProcessorBase &src): State() {
|
||||
inputs.nmi = src.nmi_line_;
|
||||
inputs.wait = src.wait_line_;
|
||||
inputs.bus_request = src.bus_request_line_;
|
||||
|
||||
// Execution State.
|
||||
execution_state.is_halted = src.halt_mask_ == 0x00;
|
||||
execution_state.requests = src.request_status_;
|
||||
execution_state.last_requests = src.last_request_status_;
|
||||
execution_state.temp8 = src.temp8_;
|
||||
execution_state.temp16 = src.temp16_.full;
|
||||
execution_state.operation = src.operation_;
|
||||
execution_state.flag_adjustment_history = src.flag_adjustment_history_;
|
||||
execution_state.pc_increment = src.pc_increment_;
|
||||
}
|
||||
|
||||
void State::apply(ProcessorBase &target) {
|
||||
@ -62,6 +72,18 @@ void State::apply(ProcessorBase &target) {
|
||||
target.nmi_line_ = inputs.nmi;
|
||||
target.wait_line_ = inputs.wait;
|
||||
target.bus_request_line_ = inputs.bus_request;
|
||||
|
||||
// Execution State.
|
||||
target.halt_mask_ = execution_state.is_halted ? 0x00 : 0xff;
|
||||
target.request_status_ = execution_state.requests;
|
||||
target.last_request_status_ = execution_state.last_requests;
|
||||
target.temp8_ = execution_state.temp8;
|
||||
target.temp16_.full = execution_state.temp16;
|
||||
target.operation_ = execution_state.operation;
|
||||
target.flag_adjustment_history_ = execution_state.flag_adjustment_history;
|
||||
target.pc_increment_ = execution_state.pc_increment;
|
||||
|
||||
// TODO: scheduled_program_counter_ and number_of_cycles_.
|
||||
}
|
||||
|
||||
// Boilerplate follows here, to establish 'reflection'.
|
||||
@ -97,6 +119,14 @@ State::Registers::Registers() {
|
||||
|
||||
State::ExecutionState::ExecutionState() {
|
||||
if(needs_declare()) {
|
||||
DeclareField(is_halted);
|
||||
DeclareField(requests);
|
||||
DeclareField(last_requests);
|
||||
DeclareField(temp8);
|
||||
DeclareField(operation);
|
||||
DeclareField(temp16);
|
||||
DeclareField(flag_adjustment_history);
|
||||
DeclareField(pc_increment);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -60,6 +60,15 @@ struct State: public Reflection::StructImpl<State> {
|
||||
obviously doesn't.
|
||||
*/
|
||||
struct ExecutionState: public Reflection::StructImpl<ExecutionState> {
|
||||
bool is_halted;
|
||||
|
||||
uint8_t requests;
|
||||
uint8_t last_requests;
|
||||
uint8_t temp8;
|
||||
uint8_t operation;
|
||||
uint16_t temp16;
|
||||
unsigned int flag_adjustment_history;
|
||||
uint16_t pc_increment;
|
||||
|
||||
ExecutionState();
|
||||
} execution_state;
|
||||
|
Loading…
x
Reference in New Issue
Block a user