mirror of
https://github.com/TomHarte/CLK.git
synced 2025-02-20 14:29:11 +00:00
Adds a single-cycle M1 delay to the ColecoVision.
This commit is contained in:
parent
28e69152d8
commit
d2da55aa03
@ -192,14 +192,14 @@ class ConcreteMachine:
|
|||||||
// MARK: Z80::BusHandler
|
// MARK: Z80::BusHandler
|
||||||
forceinline HalfCycles perform_machine_cycle(const CPU::Z80::PartialMachineCycle &cycle) {
|
forceinline HalfCycles perform_machine_cycle(const CPU::Z80::PartialMachineCycle &cycle) {
|
||||||
// The SN76489 will use its ready line to trigger the Z80's wait for three
|
// The SN76489 will use its ready line to trigger the Z80's wait for three
|
||||||
// cycles when accessed. Everything else runs at full speed. Short-circuit
|
// cycles when accessed. M1 cycles are extended by a single cycle. Short-circuit
|
||||||
// that whole piece of communications by just accruing the time here if applicable.
|
// that whole piece of communications by just accruing the time here if applicable.
|
||||||
const HalfCycles penalty(
|
HalfCycles penalty(0);
|
||||||
(
|
if(cycle.operation == CPU::Z80::PartialMachineCycle::Output && ((*cycle.address >> 5) & 7) == 7) {
|
||||||
cycle.operation == CPU::Z80::PartialMachineCycle::Output &&
|
penalty = HalfCycles(6);
|
||||||
((*cycle.address >> 5) & 7) == 7
|
} else if(cycle.operation == CPU::Z80::PartialMachineCycle::ReadOpcode) {
|
||||||
) ? 6 : 0
|
penalty = HalfCycles(2);
|
||||||
);
|
}
|
||||||
const HalfCycles length = cycle.length + penalty;
|
const HalfCycles length = cycle.length + penalty;
|
||||||
|
|
||||||
time_since_vdp_update_ += length;
|
time_since_vdp_update_ += length;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user