From 312171fa592275840bf1cc0401405b47e1fc754c Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Wed, 9 May 2018 20:28:25 -0400 Subject: [PATCH] Pulls out a couple of repeating constants. --- Machines/Oric/Oric.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Machines/Oric/Oric.cpp b/Machines/Oric/Oric.cpp index 0cbd28efa..c5a8492a9 100644 --- a/Machines/Oric/Oric.cpp +++ b/Machines/Oric/Oric.cpp @@ -399,7 +399,7 @@ template class Co else { switch(address) { case 0x380: case 0x381: case 0x382: case 0x383: - ram_top_ = (address&1) ? 0xffff : 0xbfff; + ram_top_ = (address&1) ? basic_invisible_ram_top_ : basic_visible_ram_top_; pravetz_rom_base_pointer_ = (address&2) ? 0x100 : 0x000; break; } @@ -496,11 +496,11 @@ template 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_ = 0xbfff; + ram_top_ = basic_invisible_ram_top_; paged_rom_ = rom_.data(); } else { if(flags&Microdisc::PagingFlags::MicrodscDisable) { - ram_top_ = 0xffff; + ram_top_ = basic_visible_ram_top_; } else { ram_top_ = 0xdfff; paged_rom_ = microdisc_rom_.data(); @@ -552,6 +552,9 @@ template class Co } private: + const uint16_t basic_invisible_ram_top_ = 0xffff; + const uint16_t basic_visible_ram_top_ = 0xbfff; + CPU::MOS6502::Processor m6502_; // RAM and ROM @@ -598,7 +601,7 @@ template class Co } // Overlay RAM - uint16_t ram_top_ = 0xbfff; + uint16_t ram_top_ = basic_visible_ram_top_; uint8_t *paged_rom_ = nullptr; // Helper to discern current IRQ state