From 092a61f93e7a592008455d280f458a54074b6c5e Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 21 Oct 2019 23:10:30 -0400 Subject: [PATCH] Does a better job of having just 512kb. --- Machines/AtariST/AtariST.cpp | 7 ++++--- Machines/AtariST/Video.cpp | 12 +++++++----- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Machines/AtariST/AtariST.cpp b/Machines/AtariST/AtariST.cpp index 256005def..22c88d285 100644 --- a/Machines/AtariST/AtariST.cpp +++ b/Machines/AtariST/AtariST.cpp @@ -242,11 +242,12 @@ class ConcreteMachine: // Set up basic memory map. memory_map_[0] = BusDevice::MostlyRAM; - for(int c = 1; c < 0xf0; ++c) memory_map_[c] = BusDevice::RAM; + int c = 1; + for(; c < 0x08; ++c) memory_map_[c] = BusDevice::RAM; // This is appropriate for: TOS 1.x, no cartridge. - for(int c = 0xf0; c < 0xfc; ++c) memory_map_[c] = BusDevice::Unassigned; - for(int c = 0xfc; c < 0xff; ++c) memory_map_[c] = BusDevice::ROM; + for(; c < 0xfc; ++c) memory_map_[c] = BusDevice::Unassigned; + for(; c < 0xff; ++c) memory_map_[c] = BusDevice::ROM; memory_map_[0xfa] = memory_map_[0xfb] = BusDevice::Cartridge; memory_map_[0xff] = BusDevice::IO; diff --git a/Machines/AtariST/Video.cpp b/Machines/AtariST/Video.cpp index 890d5b35f..c1ab58d9e 100644 --- a/Machines/AtariST/Video.cpp +++ b/Machines/AtariST/Video.cpp @@ -95,11 +95,12 @@ void Video::run_for(HalfCycles duration) { const auto target = std::min(mode_params.end_of_output, final_x); while(x < target) { if(!(x&31) && pixel_pointer_) { + // TODO: RAM sizes other than 512kb. uint16_t source[4] = { - ram_[current_address_ + 0], - ram_[current_address_ + 1], - ram_[current_address_ + 2], - ram_[current_address_ + 3], + ram_[(current_address_ + 0) & 262143], + ram_[(current_address_ + 1) & 262143], + ram_[(current_address_ + 2) & 262143], + ram_[(current_address_ + 3) & 262143], }; current_address_ += 4; @@ -148,7 +149,8 @@ void Video::run_for(HalfCycles duration) { if(x == mode_params.line_length) { x = 0; y = (y + 1) % mode_params.lines_per_frame; - if(!y) current_address_ = base_address_; + if(!y) + current_address_ = base_address_; } }