[opti495] fix read/writes to the scratch area

This commit is contained in:
David Hrdlička
2021-12-29 17:39:56 +01:00
parent bc56f85d40
commit bc26bc3ea6

View File

@@ -151,8 +151,10 @@ opti495_write(uint16_t addr, uint8_t val, void *priv)
break; break;
case 0xe1: case 0xe1:
dev->scratch[0] = val;
break;
case 0xe2: case 0xe2:
dev->scratch[addr] = val; dev->scratch[1] = val;
break; break;
} }
} }
@@ -175,8 +177,10 @@ opti495_read(uint16_t addr, void *priv)
} }
break; break;
case 0xe1: case 0xe1:
ret = dev->scratch[0];
break;
case 0xe2: case 0xe2:
ret = dev->scratch[addr]; ret = dev->scratch[1];
break; break;
} }