From b50e1534003b293fe61560f8d0229bd2d5a4bb6f Mon Sep 17 00:00:00 2001 From: TC1995 Date: Mon, 7 Feb 2022 19:14:54 +0100 Subject: [PATCH] Ported the latest fixes of the SCAMP EMS implementation from PCem. --- src/chipset/scamp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/chipset/scamp.c b/src/chipset/scamp.c index 33d6d909e..57b0120b2 100644 --- a/src/chipset/scamp.c +++ b/src/chipset/scamp.c @@ -729,7 +729,7 @@ scamp_write(uint16_t addr, uint8_t val, void *priv) recalc_ems(dev); } if (dev->ems_autoinc) - dev->ems_index = (dev->ems_index + 1) & 0x1f; + dev->ems_index = (dev->ems_index + 1) & 0x3f; break; case 0xec: @@ -795,9 +795,9 @@ scamp_read(uint16_t addr, void *priv) break; case 0xeb: if (dev->ems_index < 0x24) - ret = dev->ems[dev->ems_index] = (dev->ems[dev->ems_index] >> 8) & 0xfc; + ret = (dev->ems[dev->ems_index] >> 8) | 0xfc; if (dev->ems_autoinc) - dev->ems_index = (dev->ems_index + 1) & 0x1f; + dev->ems_index = (dev->ems_index + 1) & 0x3f; break; case 0xed: