1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-23 03:32:32 +00:00

Does a better job of having just 512kb.

This commit is contained in:
Thomas Harte 2019-10-21 23:10:30 -04:00
parent e30ba58e0d
commit 092a61f93e
2 changed files with 11 additions and 8 deletions

View File

@ -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;

View File

@ -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_;
}
}