minor change

This commit is contained in:
steve 2023-09-30 12:51:46 +01:00
parent 279bbc6b5a
commit 78e3fff5c3
1 changed files with 2 additions and 3 deletions

View File

@ -27,7 +27,7 @@ void PIA::write(Memory::address a, uint8_t b) {
Serial.print(' '); Serial.print(' ');
Serial.println(b, 16); Serial.println(b, 16);
#endif #endif
switch(a % 4) { switch(a & 3) {
case 0: case 0:
output_selected(cra)? write_porta(b): write_ddra(b); output_selected(cra)? write_porta(b): write_ddra(b);
break; break;
@ -49,7 +49,7 @@ uint8_t PIA::read(Memory::address a) {
Serial.print(" < "); Serial.print(" < ");
Serial.println(a, 16); Serial.println(a, 16);
#endif #endif
switch (a % 4) { switch (a & 3) {
case 0: case 0:
return output_selected(cra)? read_porta(): read_ddra(); return output_selected(cra)? read_porta(): read_ddra();
case 1: case 1:
@ -59,7 +59,6 @@ uint8_t PIA::read(Memory::address a) {
case 3: case 3:
return read_crb(); return read_crb();
} }
return 0xff;
} }
void PIA::checkpoint(Stream &s) { void PIA::checkpoint(Stream &s) {