1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-09-27 02:55:07 +00:00

Deal with pre-ROM03 case, now that it's easy.

This commit is contained in:
Thomas Harte 2022-09-13 16:31:06 -04:00
parent 6773a321c1
commit 36c3cb1f70
2 changed files with 11 additions and 6 deletions

View File

@ -200,6 +200,7 @@ class ConcreteMachine:
public:
ConcreteMachine(const Analyser::Static::AppleIIgs::Target &target, const ROMMachine::ROMFetcher &rom_fetcher) :
m65816_(*this),
memory_(target.model >= Analyser::Static::AppleIIgs::Target::Model::ROM03),
iwm_(CLOCK_RATE / 2),
drives35_{
{CLOCK_RATE / 2, true},

View File

@ -26,8 +26,8 @@ class MemoryMap {
public:
// MARK: - Initial construction and configuration.
MemoryMap() : auxiliary_switches_(*this), language_card_(*this) {
setup_shadow_maps();
MemoryMap(bool is_rom03) : auxiliary_switches_(*this), language_card_(*this) {
setup_shadow_maps(is_rom03);
}
void set_storage(std::vector<uint8_t> &ram, std::vector<uint8_t> &rom) {
@ -479,7 +479,8 @@ class MemoryMap {
}
// Text Page 2, main and auxiliary — 0x08000x0c00.
// TODO: on a ROM03 machine only.
//
// The mask applied will be all 0 for a pre-ROM03 machine.
{
const bool should_shadow_text2 = !(shadow_register_ & Inhibit::TextPage2);
if(should_shadow_text2) {
@ -574,7 +575,7 @@ class MemoryMap {
std::bitset<128> shadow_highres2, shadow_highres2_aux;
std::bitset<128> shadow_superhighres;
void setup_shadow_maps() {
void setup_shadow_maps(bool is_rom03) {
static constexpr int shadow_shift = 10;
static constexpr int auxiliary_offset = 0x1'0000 >> shadow_shift;
@ -582,8 +583,11 @@ class MemoryMap {
shadow_text1[c] = shadow_text1[c+auxiliary_offset] = true;
}
for(size_t c = 0x0800 >> shadow_shift; c < 0x0c00 >> shadow_shift; c++) {
shadow_text2[c] = shadow_text2[c+auxiliary_offset] = true;
// Shadowing of text page 2 was added only with the ROM03 machine.
if(is_rom03) {
for(size_t c = 0x0800 >> shadow_shift; c < 0x0c00 >> shadow_shift; c++) {
shadow_text2[c] = shadow_text2[c+auxiliary_offset] = true;
}
}
for(size_t c = 0x2000 >> shadow_shift; c < 0x4000 >> shadow_shift; c++) {