1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-25 18:30:21 +00:00

Merge pull request #450 from TomHarte/OricMicrodisc

Corrects meaning of the Microdisc's paging control.
This commit is contained in:
Thomas Harte 2018-05-24 18:58:07 -04:00 committed by GitHub
commit 7d652e53e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 6 deletions

View File

@ -72,7 +72,7 @@ void Microdisc::set_control_register(uint8_t control, uint8_t changes) {
// b7: EPROM select (0 = select)
// b1: ROM disable (0 = disable)
if(changes & 0x82) {
paging_flags_ = ((control & 0x02) ? 0 : BASICDisable) | ((control & 0x80) ? MicrodscDisable : 0);
paging_flags_ = ((control & 0x02) ? 0 : BASICDisable) | ((control & 0x80) ? MicrodiscDisable : 0);
if(delegate_) delegate_->microdisc_did_change_paging_flags(this);
}
}

View File

@ -31,8 +31,14 @@ class Microdisc: public WD::WD1770 {
using WD::WD1770::run_for;
enum PagingFlags {
BASICDisable = (1 << 0),
MicrodscDisable = (1 << 1)
/// Indicates that the BASIC ROM should be disabled; if this is set then either
/// the Microdisc ROM or overlay RAM will be visible. If it is not set, BASIC
/// should be visible.
BASICDisable = (1 << 0),
/// Indicates that the Microdisc ROM is disabled. If BASIC is disabled and the Microdisc
/// is also disabled, overlay RAM should be visible.
MicrodiscDisable = (1 << 1)
};
class Delegate: public WD1770::Delegate {

View File

@ -504,11 +504,11 @@ template <Analyser::Static::Oric::Target::DiskInterface disk_interface> class Co
void microdisc_did_change_paging_flags(class Microdisc *microdisc) override final {
int flags = microdisc->get_paging_flags();
if(!(flags&Microdisc::PagingFlags::BASICDisable)) {
ram_top_ = basic_invisible_ram_top_;
ram_top_ = basic_visible_ram_top_;
paged_rom_ = rom_.data();
} else {
if(flags&Microdisc::PagingFlags::MicrodscDisable) {
ram_top_ = basic_visible_ram_top_;
if(flags&Microdisc::PagingFlags::MicrodiscDisable) {
ram_top_ = basic_invisible_ram_top_;
} else {
ram_top_ = 0xdfff;
paged_rom_ = microdisc_rom_.data();