From 2dd082e07c5b828b7ac14f250f55d05f0d0a4bc3 Mon Sep 17 00:00:00 2001 From: hap Date: Wed, 9 Jun 2021 20:47:00 +0200 Subject: [PATCH] c140: correct offset range when reading keyon status [dink] --- src/devices/sound/c140.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/devices/sound/c140.cpp b/src/devices/sound/c140.cpp index c6e5a05271e..683f2a7ebda 100644 --- a/src/devices/sound/c140.cpp +++ b/src/devices/sound/c140.cpp @@ -478,7 +478,7 @@ inline u8 c140_device::keyon_status_read(u16 offset) u8 c140_device::c140_r(offs_t offset) { offset &= 0x1ff; - if ((offset & 0xf) == 0x5) + if ((offset & 0xf) == 0x5 && offset < 0x180) return keyon_status_read(offset); return m_REG[offset]; } @@ -552,6 +552,8 @@ void c140_device::c140_w(offs_t offset, u8 data) u8 c219_device::c219_r(offs_t offset) { + offset &= 0x1ff; + // assume same as c140 // TODO: what happens here on reading unmapped voice regs? return c140_r(offset);