1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-17 13:29:02 +00:00

Fixed: attempting to read the screen start address no longer alters it.

This commit is contained in:
Thomas Harte 2016-03-13 18:50:23 -04:00
parent 1c4acfb599
commit bc554dedf7

View File

@ -124,14 +124,18 @@ unsigned int Machine::perform_bus_operation(CPU6502::BusOperation operation, uin
case 0x1: case 0x1:
break; break;
case 0x2: case 0x2:
printf("%02x to [2] mutates %04x ", *value, _startScreenAddress); if(!isReadOperation(operation))
{
_startScreenAddress = (_startScreenAddress & 0xfe00) | (uint16_t)(((*value) & 0xe0) << 1); _startScreenAddress = (_startScreenAddress & 0xfe00) | (uint16_t)(((*value) & 0xe0) << 1);
printf("into %04x\n", _startScreenAddress); if(!_startScreenAddress) _startScreenAddress |= 0x8000;
}
break; break;
case 0x3: case 0x3:
printf("%02x to [3] mutates %04x ", *value, _startScreenAddress); if(!isReadOperation(operation))
{
_startScreenAddress = (_startScreenAddress & 0x01ff) | (uint16_t)(((*value) & 0x3f) << 9); _startScreenAddress = (_startScreenAddress & 0x01ff) | (uint16_t)(((*value) & 0x3f) << 9);
printf("into %04x\n", _startScreenAddress); if(!_startScreenAddress) _startScreenAddress |= 0x8000;
}
break; break;
case 0x4: case 0x4:
if(isReadOperation(operation)) if(isReadOperation(operation))