mirror of
https://github.com/TomHarte/CLK.git
synced 2024-07-10 12:29:01 +00:00
Converted the Microdisc into a ClockReceiver
.
This commit is contained in:
parent
13f7aa4063
commit
55ecb0c022
@ -104,12 +104,12 @@ void Microdisc::set_head_load_request(bool head_load) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Microdisc::run_for_cycles(unsigned int number_of_cycles) {
|
void Microdisc::run_for(const Cycles &cycles) {
|
||||||
if(head_load_request_counter_ < head_load_request_counter_target) {
|
if(head_load_request_counter_ < head_load_request_counter_target) {
|
||||||
head_load_request_counter_ += number_of_cycles;
|
head_load_request_counter_ += cycles.as_int();
|
||||||
if(head_load_request_counter_ >= head_load_request_counter_target) set_head_loaded(true);
|
if(head_load_request_counter_ >= head_load_request_counter_target) set_head_loaded(true);
|
||||||
}
|
}
|
||||||
WD::WD1770::run_for(Cycles((int)number_of_cycles));
|
WD::WD1770::run_for(cycles);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Microdisc::get_drive_is_ready() {
|
bool Microdisc::get_drive_is_ready() {
|
||||||
|
@ -10,10 +10,11 @@
|
|||||||
#define Microdisc_hpp
|
#define Microdisc_hpp
|
||||||
|
|
||||||
#include "../../Components/1770/1770.hpp"
|
#include "../../Components/1770/1770.hpp"
|
||||||
|
#include "../../Components/ClockReceiver.hpp"
|
||||||
|
|
||||||
namespace Oric {
|
namespace Oric {
|
||||||
|
|
||||||
class Microdisc: public WD::WD1770 {
|
class Microdisc: public ClockReceiver<Microdisc>, public WD::WD1770 {
|
||||||
public:
|
public:
|
||||||
Microdisc();
|
Microdisc();
|
||||||
|
|
||||||
@ -24,7 +25,7 @@ class Microdisc: public WD::WD1770 {
|
|||||||
|
|
||||||
bool get_interrupt_request_line();
|
bool get_interrupt_request_line();
|
||||||
|
|
||||||
void run_for_cycles(unsigned int number_of_cycles);
|
void run_for(const Cycles &cycles);
|
||||||
|
|
||||||
enum PagingFlags {
|
enum PagingFlags {
|
||||||
BASICDisable = (1 << 0),
|
BASICDisable = (1 << 0),
|
||||||
|
@ -131,7 +131,7 @@ unsigned int Machine::perform_bus_operation(CPU::MOS6502::BusOperation operation
|
|||||||
}
|
}
|
||||||
|
|
||||||
via_.run_for_cycles(1);
|
via_.run_for_cycles(1);
|
||||||
if(microdisc_is_enabled_) microdisc_.run_for_cycles(8);
|
if(microdisc_is_enabled_) microdisc_.run_for(Cycles(8));
|
||||||
cycles_since_video_update_++;
|
cycles_since_video_update_++;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user