diff --git a/Machines/Commodore/1540/C1540.cpp b/Machines/Commodore/1540/C1540.cpp index 49209d1a4..8724a2f2b 100644 --- a/Machines/Commodore/1540/C1540.cpp +++ b/Machines/Commodore/1540/C1540.cpp @@ -91,6 +91,11 @@ void Machine::set_rom(const uint8_t *rom) memcpy(_rom, rom, sizeof(_rom)); } +void Machine::set_disk(std::shared_ptr disk) +{ + _disk = disk; +} + #pragma mark - 6522 delegate void Machine::mos6522_did_change_interrupt_status(void *mos6522) diff --git a/Machines/Commodore/1540/C1540.hpp b/Machines/Commodore/1540/C1540.hpp index 92ceccb6e..1935b1e5d 100644 --- a/Machines/Commodore/1540/C1540.hpp +++ b/Machines/Commodore/1540/C1540.hpp @@ -11,8 +11,11 @@ #include "../../../Processors/6502/CPU6502.hpp" #include "../../../Components/6522/6522.hpp" + #include "../SerialBus.hpp" +#include "../../../Storage/Disk/Disk.hpp" + namespace Commodore { namespace C1540 { @@ -173,6 +176,11 @@ class Machine: */ void set_serial_bus(std::shared_ptr<::Commodore::Serial::Bus> serial_bus); + /*! + Sets the disk from which this 1540 is reading data. + */ + void set_disk(std::shared_ptr disk); + // to satisfy CPU6502::Processor unsigned int perform_bus_operation(CPU6502::BusOperation operation, uint16_t address, uint8_t *value); @@ -186,6 +194,8 @@ class Machine: std::shared_ptr _serialPortVIA; std::shared_ptr _serialPort; DriveVIA _driveVIA; + + std::shared_ptr _disk; }; } diff --git a/Machines/Commodore/Vic-20/Vic20.cpp b/Machines/Commodore/Vic-20/Vic20.cpp index 78107cf60..2b4f3d3ba 100644 --- a/Machines/Commodore/Vic-20/Vic20.cpp +++ b/Machines/Commodore/Vic-20/Vic20.cpp @@ -54,9 +54,6 @@ Machine::Machine() : write_to_map(_processorWriteMemoryMap, _screenMemory, 0x1000, sizeof(_screenMemory)); write_to_map(_processorWriteMemoryMap, _colorMemory, 0x9400, sizeof(_colorMemory)); - // TEMPORARY: attach a [diskless] 1540 -// set_disc(); - // _debugPort.reset(new ::Commodore::Serial::DebugPort); // _debugPort->set_serial_bus(_serialBus); // _serialBus->add_port(_debugPort); @@ -222,7 +219,8 @@ void Machine::set_disk(std::shared_ptr disk) // attach it to the serial bus _c1540->set_serial_bus(_serialBus); - // TODO: push the disk to the C1540 + // hand it the disk + _c1540->set_disk(disk); } #pragma mark - Typer