From a7103f93331b4a3af64fe1fa9b1dfc6e1f465c06 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 6 Aug 2017 13:24:14 -0400 Subject: [PATCH] Disks are now communicated to the 8272. Which is able to handle four of them. --- Components/8272/i8272.cpp | 3 +++ Components/8272/i8272.hpp | 2 ++ Machines/AmstradCPC/AmstradCPC.cpp | 8 +++++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Components/8272/i8272.cpp b/Components/8272/i8272.cpp index eaa769fb1..84a032940 100644 --- a/Components/8272/i8272.cpp +++ b/Components/8272/i8272.cpp @@ -69,6 +69,9 @@ uint8_t i8272::get_register(int address) { } } +void i8272::set_disk(std::shared_ptr disk, int drive) { +} + #define BEGIN_SECTION() switch(resume_point_) { default: #define END_SECTION() } diff --git a/Components/8272/i8272.hpp b/Components/8272/i8272.hpp index 41ebec243..c2b2f10b9 100644 --- a/Components/8272/i8272.hpp +++ b/Components/8272/i8272.hpp @@ -25,6 +25,8 @@ class i8272: public Storage::Disk::MFMController { void set_register(int address, uint8_t value); uint8_t get_register(int address); + void set_disk(std::shared_ptr disk, int drive); + private: void posit_event(int type); uint8_t main_status_; diff --git a/Machines/AmstradCPC/AmstradCPC.cpp b/Machines/AmstradCPC/AmstradCPC.cpp index 024017916..4df26302e 100644 --- a/Machines/AmstradCPC/AmstradCPC.cpp +++ b/Machines/AmstradCPC/AmstradCPC.cpp @@ -739,7 +739,13 @@ class ConcreteMachine: tape_player_.set_tape(target.tapes.front()); } - // TODO: disks. + // Insert up to four disks. + int c = 0; + for(auto &disk : target.disks) { + fdc_.set_disk(disk, c); + c++; + if(c == 4) break; + } } // See header; provides the system ROMs.