Plumb through disk insertion.

Surprisingly: some things now load.
This commit is contained in:
Thomas Harte 2024-04-08 21:15:40 -04:00
parent 5e502df48b
commit 169298af42
5 changed files with 20 additions and 10 deletions

View File

@ -470,15 +470,14 @@ class ConcreteMachine:
void tick_floppy() { executor_.bus.tick_floppy(); }
// MARK: - MediaTarget
bool insert_media(const Analyser::Static::Media &) override {
// int c = 0;
// for(auto &disk : media.disks) {
// fdc_.set_disk(disk, c);
// c++;
// if(c == 4) break;
// }
// return true;
return false;
bool insert_media(const Analyser::Static::Media &media) override {
int c = 0;
for(auto &disk : media.disks) {
executor_.bus.set_disk(disk, c);
c++;
if(c == 4) break;
}
return true;
}
// MARK: - Activity::Source.

View File

@ -37,6 +37,10 @@ public:
}
void reset() {}
void set_disk(std::shared_ptr<Storage::Disk::Disk> disk, size_t drive) {
get_drive(drive).set_disk(disk);
}
private:
InterruptObserverT &observer_;
};

View File

@ -116,6 +116,10 @@ struct InputOutputController {
floppy_.run_for(Cycles(1));
}
void set_disk(std::shared_ptr<Storage::Disk::Disk> disk, size_t drive) {
floppy_.set_disk(disk, drive);
}
/// Decomposes an Archimedes bus address into bank, offset and type.
struct Address {
constexpr Address(uint32_t bus_address) noexcept {

View File

@ -199,6 +199,9 @@ struct MemoryController {
//
void tick_timers() { ioc_.tick_timers(); }
void tick_floppy() { ioc_.tick_floppy(); }
void set_disk(std::shared_ptr<Storage::Disk::Disk> disk, size_t drive) {
ioc_.set_disk(disk, drive);
}
auto &sound() { return ioc_.sound(); }
const auto &sound() const { return ioc_.sound(); }

View File

@ -62,7 +62,7 @@
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
enableASanStackUseAfterReturn = "YES"