1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-23 20:29:42 +00:00

Extends testing to disabling IO space.

This commit is contained in:
Thomas Harte 2020-12-06 21:53:53 -05:00
parent 9062e80e9d
commit d5f209366a

View File

@ -42,16 +42,19 @@ namespace {
return value;
}
- (void)testHigherRAM {
- (void)testAllRAM {
// Disable IO/LC 'shadowing', to give linear memory up to bank $80.
_memoryMap.set_shadow_register(0x5f);
// Fill memory via the map.
for(int address = 0x02'0000; address < 0x80'0000; ++address) {
const uint8_t value = uint8_t(address ^ (address >> 8));
for(int address = 0x00'0000; address < 0x80'0000; ++address) {
const uint8_t value = uint8_t(address ^ (address >> 8) ^ (address >> 16));
[self write:value address:address];
}
// Test by direct access.
for(int address = 0x02'0000; address < 0x80'0000; ++address) {
const uint8_t value = uint8_t(address ^ (address >> 8));
for(int address = 0x00'0000; address < 0x80'0000; ++address) {
const uint8_t value = uint8_t(address ^ (address >> 8) ^ (address >> 16));
XCTAssertEqual([self readAddress:address], value);
}
}