mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-26 23:52:26 +00:00
Allows Z80 users to opt out of support for the bus request line. Which both now do.
This commit is contained in:
parent
1237f174fe
commit
e1aded0d95
@ -992,7 +992,7 @@ class ConcreteMachine:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CPU::Z80::Processor<ConcreteMachine> z80_;
|
CPU::Z80::Processor<ConcreteMachine, false> z80_;
|
||||||
|
|
||||||
CRTCBusHandler crtc_bus_handler_;
|
CRTCBusHandler crtc_bus_handler_;
|
||||||
Motorola::CRTC::CRTC6845<CRTCBusHandler> crtc_;
|
Motorola::CRTC::CRTC6845<CRTCBusHandler> crtc_;
|
||||||
|
@ -330,7 +330,7 @@ class ConcreteMachine:
|
|||||||
HalfCycles get_typer_frequency() { return Cycles(390000); }
|
HalfCycles get_typer_frequency() { return Cycles(390000); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CPU::Z80::Processor<ConcreteMachine> z80_;
|
CPU::Z80::Processor<ConcreteMachine, false> z80_;
|
||||||
|
|
||||||
std::shared_ptr<Video> video_;
|
std::shared_ptr<Video> video_;
|
||||||
std::vector<uint8_t> zx81_rom_, zx80_rom_;
|
std::vector<uint8_t> zx81_rom_, zx80_rom_;
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
#ifndef Z80_hpp
|
#ifndef Z80_hpp
|
||||||
#define Z80_hpp
|
#define Z80_hpp
|
||||||
|
|
||||||
|
#include <cassert>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
@ -180,7 +181,7 @@ class BusHandler {
|
|||||||
order to provide the bus on which the Z80 operates and @c flush(), which is called upon completion of a continuous run
|
order to provide the bus on which the Z80 operates and @c flush(), which is called upon completion of a continuous run
|
||||||
of cycles to allow a subclass to bring any on-demand activities up to date.
|
of cycles to allow a subclass to bring any on-demand activities up to date.
|
||||||
*/
|
*/
|
||||||
template <class T> class Processor {
|
template <class T, bool uses_bus_request> class Processor {
|
||||||
private:
|
private:
|
||||||
T &bus_handler_;
|
T &bus_handler_;
|
||||||
|
|
||||||
@ -910,7 +911,7 @@ template <class T> class Processor {
|
|||||||
while(1) {
|
while(1) {
|
||||||
|
|
||||||
do_bus_acknowledge:
|
do_bus_acknowledge:
|
||||||
while(bus_request_line_) {
|
while(uses_bus_request && bus_request_line_) {
|
||||||
static PartialMachineCycle bus_acknowledge_cycle = {PartialMachineCycle::BusAcknowledge, HalfCycles(2), nullptr, nullptr, false};
|
static PartialMachineCycle bus_acknowledge_cycle = {PartialMachineCycle::BusAcknowledge, HalfCycles(2), nullptr, nullptr, false};
|
||||||
number_of_cycles_ -= bus_handler_.perform_machine_cycle(bus_acknowledge_cycle) + HalfCycles(1);
|
number_of_cycles_ -= bus_handler_.perform_machine_cycle(bus_acknowledge_cycle) + HalfCycles(1);
|
||||||
if(!number_of_cycles_) {
|
if(!number_of_cycles_) {
|
||||||
@ -946,7 +947,7 @@ template <class T> class Processor {
|
|||||||
number_of_cycles_ -= operation->machine_cycle.length;
|
number_of_cycles_ -= operation->machine_cycle.length;
|
||||||
last_request_status_ = request_status_;
|
last_request_status_ = request_status_;
|
||||||
number_of_cycles_ -= bus_handler_.perform_machine_cycle(operation->machine_cycle);
|
number_of_cycles_ -= bus_handler_.perform_machine_cycle(operation->machine_cycle);
|
||||||
if(bus_request_line_) goto do_bus_acknowledge;
|
if(uses_bus_request && bus_request_line_) goto do_bus_acknowledge;
|
||||||
break;
|
break;
|
||||||
case MicroOp::MoveToNextProgram:
|
case MicroOp::MoveToNextProgram:
|
||||||
advance_operation();
|
advance_operation();
|
||||||
@ -1953,6 +1954,7 @@ template <class T> class Processor {
|
|||||||
Sets the logical value of the bus request line.
|
Sets the logical value of the bus request line.
|
||||||
*/
|
*/
|
||||||
void set_bus_request_line(bool value) {
|
void set_bus_request_line(bool value) {
|
||||||
|
assert(uses_bus_request);
|
||||||
bus_request_line_ = value;
|
bus_request_line_ = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user