1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-23 03:32:32 +00:00

Include prefetch in 68000 state.

This commit is contained in:
Thomas Harte 2022-09-05 22:00:04 -04:00
parent b6da1019bd
commit 93c1f7fc90
3 changed files with 10 additions and 0 deletions

View File

@ -252,6 +252,8 @@ void print_state(FILE *target, const CPU::MC68000Mk2::State &state, const std::v
fprintf(target, "\"SR\": %u, ", state.registers.status);
fprintf(target, "\"PC\": %u, ", state.registers.program_counter - 4);
fprintf(target, "\"prefetch\": [%u, %u], ", state.prefetch[0], state.prefetch[1]);
fprintf(target, "\"ram\": [");
// Compute RAM from transactions; if this is the initial state then RAM should

View File

@ -354,6 +354,7 @@ class BusHandler {
};
struct State {
uint16_t prefetch[2];
InstructionSet::M68k::RegisterSet registers;
};

View File

@ -3025,6 +3025,9 @@ CPU::MC68000Mk2::State Processor<BusHandler, dtack_is_implicit, permit_overrun,
state.registers.user_stack_pointer = stack_pointers_[0].l;
state.registers.supervisor_stack_pointer = stack_pointers_[1].l;
state.prefetch[0] = prefetch_.high.w;
state.prefetch[1] = prefetch_.low.w;
return state;
}
@ -3048,6 +3051,10 @@ void Processor<BusHandler, dtack_is_implicit, permit_overrun, signal_will_perfor
// Ensure the local is-supervisor flag is updated.
did_update_status();
// Populate the prefetch.
prefetch_.high.w = state.prefetch[0];
prefetch_.low.w = state.prefetch[1];
}
template <class BusHandler, bool dtack_is_implicit, bool permit_overrun, bool signal_will_perform>