From bc26bc3ea64241d426a3b271c133b2a498ba9abe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Hrdli=C4=8Dka?= Date: Wed, 29 Dec 2021 17:39:56 +0100 Subject: [PATCH] [opti495] fix read/writes to the scratch area --- src/chipset/opti495.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/chipset/opti495.c b/src/chipset/opti495.c index 5d2313ef9..20dc23bc5 100644 --- a/src/chipset/opti495.c +++ b/src/chipset/opti495.c @@ -151,8 +151,10 @@ opti495_write(uint16_t addr, uint8_t val, void *priv) break; case 0xe1: + dev->scratch[0] = val; + break; case 0xe2: - dev->scratch[addr] = val; + dev->scratch[1] = val; break; } } @@ -175,8 +177,10 @@ opti495_read(uint16_t addr, void *priv) } break; case 0xe1: + ret = dev->scratch[0]; + break; case 0xe2: - ret = dev->scratch[addr]; + ret = dev->scratch[1]; break; }