1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-26 10:29:31 +00:00

Avoid permitting writes in the Cx00 region after uninhibiting the language card.

This commit is contained in:
Thomas Harte 2022-06-28 16:35:47 -04:00
parent 22c0b588c4
commit 6abc317986
2 changed files with 11 additions and 2 deletions

View File

@ -379,6 +379,7 @@ class MemoryMap {
c0_region.flags |= Region::IsIO;
#define apply_region(flag, region) \
region.write = nullptr; \
if(flag) { \
region.read = rom; \
region.flags &= ~Region::IsIO; \

View File

@ -318,9 +318,13 @@ namespace {
// Test read pointers.
testMemory(@"read", ^(int logical, int physical, const MemoryMap::Region &region) {
XCTAssert(region.read != nullptr);
const int foundPhysical = physicalOffset(&region.read[logical << 8]);
if(region.read == nullptr) {
*stop = YES;
return;
}
// Compare to correct value.
const int foundPhysical = physicalOffset(&region.read[logical << 8]);
XCTAssert(physical == foundPhysical,
@"Logical page %04x should be mapped to read physical %04x; is instead %04x",
logical,
@ -341,9 +345,13 @@ namespace {
}
XCTAssert(region.write != nullptr);
const int foundPhysical = physicalOffset(&region.write[logical << 8]);
if(region.write == nullptr) {
*stop = YES;
return;
}
// Compare to correct value.
const int foundPhysical = physicalOffset(&region.write[logical << 8]);
XCTAssert(physical == foundPhysical,
@"Logical page %04x should be mapped to write physical %04x; is instead %04x",
logical,