mirror of
https://github.com/TomHarte/CLK.git
synced 2024-07-23 06:28:59 +00:00
Adds route for inserting disks.
This commit is contained in:
parent
18631399ad
commit
2253ff656a
@ -39,6 +39,7 @@ namespace Amiga {
|
|||||||
class ConcreteMachine:
|
class ConcreteMachine:
|
||||||
public Activity::Source,
|
public Activity::Source,
|
||||||
public CPU::MC68000::BusHandler,
|
public CPU::MC68000::BusHandler,
|
||||||
|
public MachineTypes::MediaTarget,
|
||||||
public MachineTypes::ScanProducer,
|
public MachineTypes::ScanProducer,
|
||||||
public MachineTypes::TimedMachine,
|
public MachineTypes::TimedMachine,
|
||||||
public Machine {
|
public Machine {
|
||||||
@ -47,8 +48,6 @@ class ConcreteMachine:
|
|||||||
mc68000_(*this),
|
mc68000_(*this),
|
||||||
chipset_(memory_, PALClockRate)
|
chipset_(memory_, PALClockRate)
|
||||||
{
|
{
|
||||||
(void)target;
|
|
||||||
|
|
||||||
// Temporary: use a hard-coded Kickstart selection.
|
// Temporary: use a hard-coded Kickstart selection.
|
||||||
constexpr ROM::Name rom_name = ROM::Name::AmigaA500Kickstart13;
|
constexpr ROM::Name rom_name = ROM::Name::AmigaA500Kickstart13;
|
||||||
ROM::Request request(rom_name);
|
ROM::Request request(rom_name);
|
||||||
@ -58,7 +57,18 @@ class ConcreteMachine:
|
|||||||
}
|
}
|
||||||
Memory::PackBigEndian16(roms.find(rom_name)->second, memory_.kickstart.data());
|
Memory::PackBigEndian16(roms.find(rom_name)->second, memory_.kickstart.data());
|
||||||
|
|
||||||
|
// For now, also hard-code assumption of PAL.
|
||||||
|
// (Assumption is both here and in the video timing of the Chipset).
|
||||||
set_clock_rate(PALClockRate);
|
set_clock_rate(PALClockRate);
|
||||||
|
|
||||||
|
// Insert supplied media.
|
||||||
|
insert_media(target.media);
|
||||||
|
}
|
||||||
|
|
||||||
|
// MARK: - MediaTarget.
|
||||||
|
|
||||||
|
bool insert_media(const Analyser::Static::Media &media) final {
|
||||||
|
return chipset_.insert(media.disks);
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - MC68000::BusHandler.
|
// MARK: - MC68000::BusHandler.
|
||||||
|
@ -1125,3 +1125,21 @@ uint8_t Chipset::DiskController::get_rdy_trk0_wpro_chng() {
|
|||||||
(drive.get_is_read_only() ? 0x08 : 0x00);
|
(drive.get_is_read_only() ? 0x08 : 0x00);
|
||||||
return 0xff & ~active_high;
|
return 0xff & ~active_high;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Chipset::DiskController::insert(const std::shared_ptr<Storage::Disk::Disk> &disk, size_t drive) {
|
||||||
|
if(drive >= 4) return false;
|
||||||
|
get_drive(drive).set_disk(disk);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Chipset::insert(const std::vector<std::shared_ptr<Storage::Disk::Disk>> &disks) {
|
||||||
|
bool inserted = false;
|
||||||
|
|
||||||
|
size_t target = 0;
|
||||||
|
for(const auto &disk: disks) {
|
||||||
|
inserted |= disk_controller_.insert(disk, target);
|
||||||
|
++target;
|
||||||
|
}
|
||||||
|
|
||||||
|
return inserted;
|
||||||
|
}
|
||||||
|
@ -91,6 +91,10 @@ class Chipset: private ClockingHint::Observer {
|
|||||||
return interrupt_level_;
|
return interrupt_level_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Inserts the disks provided.
|
||||||
|
/// @returns @c true if anything was inserted; @c false otherwise.
|
||||||
|
bool insert(const std::vector<std::shared_ptr<Storage::Disk::Disk>> &disks);
|
||||||
|
|
||||||
// The standard CRT set.
|
// The standard CRT set.
|
||||||
void set_scan_target(Outputs::Display::ScanTarget *scan_target);
|
void set_scan_target(Outputs::Display::ScanTarget *scan_target);
|
||||||
Outputs::Display::ScanStatus get_scaled_scan_status() const;
|
Outputs::Display::ScanStatus get_scaled_scan_status() const;
|
||||||
@ -230,6 +234,8 @@ class Chipset: private ClockingHint::Observer {
|
|||||||
Storage::Disk::Controller::run_for(duration);
|
Storage::Disk::Controller::run_for(duration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool insert(const std::shared_ptr<Storage::Disk::Disk> &disk, size_t drive);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void process_input_bit(int value) final;
|
void process_input_bit(int value) final;
|
||||||
void process_index_hole() final;
|
void process_index_hole() final;
|
||||||
|
Loading…
Reference in New Issue
Block a user