mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-26 15:32:04 +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) {
|
||||
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);
|
||||
}
|
||||
WD::WD1770::run_for(Cycles((int)number_of_cycles));
|
||||
WD::WD1770::run_for(cycles);
|
||||
}
|
||||
|
||||
bool Microdisc::get_drive_is_ready() {
|
||||
|
@ -10,10 +10,11 @@
|
||||
#define Microdisc_hpp
|
||||
|
||||
#include "../../Components/1770/1770.hpp"
|
||||
#include "../../Components/ClockReceiver.hpp"
|
||||
|
||||
namespace Oric {
|
||||
|
||||
class Microdisc: public WD::WD1770 {
|
||||
class Microdisc: public ClockReceiver<Microdisc>, public WD::WD1770 {
|
||||
public:
|
||||
Microdisc();
|
||||
|
||||
@ -24,7 +25,7 @@ class Microdisc: public WD::WD1770 {
|
||||
|
||||
bool get_interrupt_request_line();
|
||||
|
||||
void run_for_cycles(unsigned int number_of_cycles);
|
||||
void run_for(const Cycles &cycles);
|
||||
|
||||
enum PagingFlags {
|
||||
BASICDisable = (1 << 0),
|
||||
|
@ -131,7 +131,7 @@ unsigned int Machine::perform_bus_operation(CPU::MOS6502::BusOperation operation
|
||||
}
|
||||
|
||||
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_++;
|
||||
return 1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user