mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-26 15:32:04 +00:00
Adds enough of a BD500 for the boot sector seemingly to load.
This commit is contained in:
parent
6b84ae3095
commit
f258fc2971
@ -1,12 +1,41 @@
|
||||
//
|
||||
// Jasmin.cpp
|
||||
// BD500.cpp
|
||||
// Clock Signal
|
||||
//
|
||||
// Created by Thomas Harte on 05/01/2020.
|
||||
// Created by Thomas Harte on 14/01/2020.
|
||||
// Copyright © 2020 Thomas Harte. All rights reserved.
|
||||
//
|
||||
|
||||
#include "Jasmin.hpp"
|
||||
#include "BD500.hpp"
|
||||
|
||||
using namespace Oric;
|
||||
|
||||
BD500::BD500() : DiskController(P1793, 9000000) {
|
||||
set_paged_item(PagedItem::DiskROM);
|
||||
set_is_double_density(true);
|
||||
}
|
||||
|
||||
void BD500::write(int address, uint8_t value) {
|
||||
switch(address) {
|
||||
case 0x0320: case 0x0321: case 0x0322: case 0x0323:
|
||||
WD::WD1770::write(address, value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t BD500::read(int address) {
|
||||
switch(address) {
|
||||
case 0x0320: case 0x0321: case 0x0322: case 0x0323:
|
||||
return WD::WD1770::read(address);
|
||||
}
|
||||
|
||||
return 0xff;
|
||||
}
|
||||
|
||||
void BD500::set_head_load_request(bool head_load) {
|
||||
// Turn all motors on or off, and load the head instantly.
|
||||
for(auto &drive : drives_) {
|
||||
if(drive) drive->set_motor_on(head_load);
|
||||
}
|
||||
set_head_loaded(head_load);
|
||||
}
|
||||
|
@ -18,6 +18,17 @@
|
||||
|
||||
namespace Oric {
|
||||
|
||||
class BD500: public DiskController {
|
||||
public:
|
||||
BD500();
|
||||
|
||||
void write(int address, uint8_t value);
|
||||
uint8_t read(int address);
|
||||
|
||||
private:
|
||||
void set_head_load_request(bool head_load) final;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
#endif /* BD500_hpp */
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
#include "Oric.hpp"
|
||||
|
||||
#include "BD500.hpp"
|
||||
#include "Jasmin.hpp"
|
||||
#include "Keyboard.hpp"
|
||||
#include "Microdisc.hpp"
|
||||
@ -321,7 +322,7 @@ template <Analyser::Static::Oric::Target::DiskInterface disk_interface> class Co
|
||||
switch(target.disk_interface) {
|
||||
default: break;
|
||||
case DiskInterface::BD500:
|
||||
// jasmin_.set_delegate(this);
|
||||
bd500_.set_delegate(this);
|
||||
break;
|
||||
case DiskInterface::Jasmin:
|
||||
jasmin_.set_delegate(this);
|
||||
@ -397,16 +398,10 @@ template <Analyser::Static::Oric::Target::DiskInterface disk_interface> class Co
|
||||
|
||||
if(!media.disks.empty()) {
|
||||
switch(disk_interface) {
|
||||
case DiskInterface::Jasmin:
|
||||
inserted |= insert_disks(media, jasmin_, 4);
|
||||
break;
|
||||
case DiskInterface::Microdisc: {
|
||||
inserted |= insert_disks(media, microdisc_, 4);
|
||||
} break;
|
||||
case DiskInterface::Pravetz: {
|
||||
inserted |= insert_disks(media, diskii_, 2);
|
||||
} break;
|
||||
|
||||
case DiskInterface::BD500: inserted |= insert_disks(media, bd500_, 4); break;
|
||||
case DiskInterface::Jasmin: inserted |= insert_disks(media, jasmin_, 4); break;
|
||||
case DiskInterface::Microdisc: inserted |= insert_disks(media, microdisc_, 4); break;
|
||||
case DiskInterface::Pravetz: inserted |= insert_disks(media, diskii_, 2); break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
@ -441,6 +436,10 @@ template <Analyser::Static::Oric::Target::DiskInterface disk_interface> class Co
|
||||
} else {
|
||||
switch(disk_interface) {
|
||||
default: break;
|
||||
case DiskInterface::BD500:
|
||||
if(isReadOperation(operation)) *value = bd500_.read(address);
|
||||
else bd500_.write(address, *value);
|
||||
break;
|
||||
case DiskInterface::Jasmin:
|
||||
if(address >= 0x3f4) {
|
||||
if(isReadOperation(operation)) *value = jasmin_.read(address);
|
||||
@ -504,6 +503,9 @@ template <Analyser::Static::Oric::Target::DiskInterface disk_interface> class Co
|
||||
tape_player_.run_for(Cycles(1));
|
||||
switch(disk_interface) {
|
||||
default: break;
|
||||
case DiskInterface::BD500:
|
||||
bd500_.run_for(Cycles(8));
|
||||
break;
|
||||
case DiskInterface::Jasmin:
|
||||
jasmin_.run_for(Cycles(8));
|
||||
|
||||
@ -573,22 +575,6 @@ template <Analyser::Static::Oric::Target::DiskInterface disk_interface> class Co
|
||||
string_serialiser_ = std::make_unique<Utility::StringSerialiser>(string, true);
|
||||
}
|
||||
|
||||
// for Microdisc::Delegate
|
||||
/* void microdisc_did_change_paging_flags(class Microdisc *microdisc) final {
|
||||
const int flags = microdisc->get_paging_flags();
|
||||
if(!(flags&Microdisc::PagingFlags::BASICDisable)) {
|
||||
ram_top_ = basic_visible_ram_top_;
|
||||
paged_rom_ = rom_.data();
|
||||
} else {
|
||||
if(flags&Microdisc::PagingFlags::MicrodiscDisable) {
|
||||
ram_top_ = basic_invisible_ram_top_;
|
||||
} else {
|
||||
ram_top_ = 0xdfff;
|
||||
paged_rom_ = disk_rom_.data();
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
// DiskController::Delegate
|
||||
void disk_controller_did_change_paged_item(DiskController *controller) final {
|
||||
switch(controller->get_paged_item()) {
|
||||
@ -707,6 +693,9 @@ template <Analyser::Static::Oric::Target::DiskInterface disk_interface> class Co
|
||||
Jasmin jasmin_;
|
||||
int jasmin_reset_counter_ = 0;
|
||||
|
||||
// the BD-500, if in use.
|
||||
BD500 bd500_;
|
||||
|
||||
// the Pravetz/Disk II, if in use.
|
||||
Apple::DiskII diskii_;
|
||||
Cycles cycles_since_diskii_update_;
|
||||
|
Loading…
x
Reference in New Issue
Block a user