mirror of
https://github.com/TomHarte/CLK.git
synced 2025-03-06 17:31:55 +00:00
Eliminates modulus operation per ROM access.
This commit is contained in:
parent
f3db1a0c60
commit
af976b8b3d
@ -101,8 +101,10 @@ class ConcreteMachine:
|
|||||||
|
|
||||||
const bool is_early_tos = true;
|
const bool is_early_tos = true;
|
||||||
if(is_early_tos) {
|
if(is_early_tos) {
|
||||||
|
rom_start_ = 0xfc0000;
|
||||||
for(c = 0xfc; c < 0xff; ++c) memory_map_[c] = BusDevice::ROM;
|
for(c = 0xfc; c < 0xff; ++c) memory_map_[c] = BusDevice::ROM;
|
||||||
} else {
|
} else {
|
||||||
|
rom_start_ = 0xe00000;
|
||||||
for(c = 0xe0; c < 0xe4; ++c) memory_map_[c] = BusDevice::ROM;
|
for(c = 0xe0; c < 0xe4; ++c) memory_map_[c] = BusDevice::ROM;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -245,7 +247,7 @@ class ConcreteMachine:
|
|||||||
|
|
||||||
case BusDevice::ROM:
|
case BusDevice::ROM:
|
||||||
memory = rom_.data();
|
memory = rom_.data();
|
||||||
address %= rom_.size();
|
address -= rom_start_;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BusDevice::Floating:
|
case BusDevice::Floating:
|
||||||
@ -505,6 +507,7 @@ class ConcreteMachine:
|
|||||||
|
|
||||||
std::vector<uint8_t> ram_;
|
std::vector<uint8_t> ram_;
|
||||||
std::vector<uint8_t> rom_;
|
std::vector<uint8_t> rom_;
|
||||||
|
uint32_t rom_start_ = 0;
|
||||||
|
|
||||||
enum class BusDevice {
|
enum class BusDevice {
|
||||||
/// A mostly RAM page is one that returns ROM for the first 8 bytes, RAM elsewhere.
|
/// A mostly RAM page is one that returns ROM for the first 8 bytes, RAM elsewhere.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user