1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-26 09:29:45 +00:00

Completed handing of the disk all the way to the 1540.

This commit is contained in:
Thomas Harte 2016-07-10 16:24:46 -04:00
parent 6593caca93
commit ada2f073e0
3 changed files with 17 additions and 4 deletions

View File

@ -91,6 +91,11 @@ void Machine::set_rom(const uint8_t *rom)
memcpy(_rom, rom, sizeof(_rom));
}
void Machine::set_disk(std::shared_ptr<Storage::Disk> disk)
{
_disk = disk;
}
#pragma mark - 6522 delegate
void Machine::mos6522_did_change_interrupt_status(void *mos6522)

View File

@ -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<Storage::Disk> 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> _serialPortVIA;
std::shared_ptr<SerialPort> _serialPort;
DriveVIA _driveVIA;
std::shared_ptr<Storage::Disk> _disk;
};
}

View File

@ -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<Storage::Disk> 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