1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-09-29 00:56:21 +00:00

Switches to partial decoding for paging registers; permits video address changes after paging is locked.

This commit is contained in:
Thomas Harte 2021-03-21 20:23:00 -04:00
parent 064667c0c3
commit 9ce1dbaebb

View File

@ -70,6 +70,7 @@ template<Model model> class ConcreteMachine:
// Set up initial memory map.
update_memory_map();
set_video_address();
Memory::Fuzz(ram_);
// Insert media.
@ -186,30 +187,26 @@ template<Model model> class ConcreteMachine:
// b4: tape and speaker output
}
// Test for classic 128kb paging.
// if(!(address&0x8002)) {
// }
// Test for classic 128kb paging register.
if((address & 0xc002) == 0x4000) {
disable_paging_ |= *cycle.value & 0x20;
// Set the proper video base pointer.
set_video_address();
port7ffd_ = *cycle.value;
update_memory_map();
}
// Test for +2a/+3 paging.
// if((address & 0xc002) == 0x4000) {
// }
if((address & 0xf002) == 0x1000) {
port1ffd_ = *cycle.value;
update_memory_map();
}
switch(address) {
default: break;
case 0x1ffd:
// Write to +2a/+3 paging register.
port1ffd_ = *cycle.value;
update_memory_map();
break;
case 0x7ffd:
// Write to classic 128kb paging register.
disable_paging_ |= *cycle.value & 0x20;
port7ffd_ = *cycle.value;
update_memory_map();
break;
case 0xfffd:
// Select AY register.
update_audio();
@ -391,14 +388,11 @@ template<Model model> class ConcreteMachine:
return;
}
// Set the proper video base pointer.
video_->set_video_source(&ram_[((port7ffd_ & 0x08) ? 7 : 5) * 16384]);
if(port1ffd_ & 1) {
if(port1ffd_ & 0x01) {
// "Special paging mode", i.e. one of four fixed
// RAM configurations, port 7ffd doesn't matter.
switch(port1ffd_ & 0x6) {
switch(port1ffd_ & 0x06) {
default:
case 0x00:
set_memory(0, &ram_[0 * 16384], &ram_[0 * 16384], false);
@ -449,6 +443,10 @@ template<Model model> class ConcreteMachine:
write_pointers_[bank] = (write ? write : scratch_.data()) - bank*16384;
}
void set_video_address() {
video_->set_video_source(&ram_[((port7ffd_ & 0x08) ? 7 : 5) * 16384]);
}
// MARK: - Audio.
Concurrency::DeferringAsyncTaskQueue audio_queue_;
GI::AY38910::AY38910<false> ay_;