mirror of
https://github.com/TomHarte/CLK.git
synced 2024-09-29 16:55:59 +00:00
Avoid permitting writes in the Cx00 region after uninhibiting the language card.
This commit is contained in:
parent
22c0b588c4
commit
6abc317986
@ -379,6 +379,7 @@ class MemoryMap {
|
|||||||
c0_region.flags |= Region::IsIO;
|
c0_region.flags |= Region::IsIO;
|
||||||
|
|
||||||
#define apply_region(flag, region) \
|
#define apply_region(flag, region) \
|
||||||
|
region.write = nullptr; \
|
||||||
if(flag) { \
|
if(flag) { \
|
||||||
region.read = rom; \
|
region.read = rom; \
|
||||||
region.flags &= ~Region::IsIO; \
|
region.flags &= ~Region::IsIO; \
|
||||||
|
@ -318,9 +318,13 @@ namespace {
|
|||||||
// Test read pointers.
|
// Test read pointers.
|
||||||
testMemory(@"read", ^(int logical, int physical, const MemoryMap::Region ®ion) {
|
testMemory(@"read", ^(int logical, int physical, const MemoryMap::Region ®ion) {
|
||||||
XCTAssert(region.read != nullptr);
|
XCTAssert(region.read != nullptr);
|
||||||
const int foundPhysical = physicalOffset(®ion.read[logical << 8]);
|
if(region.read == nullptr) {
|
||||||
|
*stop = YES;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Compare to correct value.
|
// Compare to correct value.
|
||||||
|
const int foundPhysical = physicalOffset(®ion.read[logical << 8]);
|
||||||
XCTAssert(physical == foundPhysical,
|
XCTAssert(physical == foundPhysical,
|
||||||
@"Logical page %04x should be mapped to read physical %04x; is instead %04x",
|
@"Logical page %04x should be mapped to read physical %04x; is instead %04x",
|
||||||
logical,
|
logical,
|
||||||
@ -341,9 +345,13 @@ namespace {
|
|||||||
}
|
}
|
||||||
|
|
||||||
XCTAssert(region.write != nullptr);
|
XCTAssert(region.write != nullptr);
|
||||||
const int foundPhysical = physicalOffset(®ion.write[logical << 8]);
|
if(region.write == nullptr) {
|
||||||
|
*stop = YES;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Compare to correct value.
|
// Compare to correct value.
|
||||||
|
const int foundPhysical = physicalOffset(®ion.write[logical << 8]);
|
||||||
XCTAssert(physical == foundPhysical,
|
XCTAssert(physical == foundPhysical,
|
||||||
@"Logical page %04x should be mapped to write physical %04x; is instead %04x",
|
@"Logical page %04x should be mapped to write physical %04x; is instead %04x",
|
||||||
logical,
|
logical,
|
||||||
|
Loading…
Reference in New Issue
Block a user