From f4fbeee8035a8ccdd1d28243723ed363bd242c11 Mon Sep 17 00:00:00 2001 From: hap Date: Thu, 4 Jan 2024 23:07:53 +0100 Subject: ht1130: safety mask when reading/writing ram --- src/devices/cpu/ht1130/ht1130.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/devices/cpu/ht1130/ht1130.cpp b/src/devices/cpu/ht1130/ht1130.cpp index 63bf9b05e1b..d35c8299ab2 100644 --- a/src/devices/cpu/ht1130/ht1130.cpp +++ b/src/devices/cpu/ht1130/ht1130.cpp @@ -145,36 +145,36 @@ inline u8 ht1130_device::gettimer_lower() inline u8 ht1130_device::getr1r0() { - return (getreg(1)<<4) | getreg(0); + return (getreg(1) << 4) | getreg(0); } inline u8 ht1130_device::getr1r0_data() { const u8 dataaddress = getr1r0(); - return m_data.read_byte(dataaddress); + return m_data.read_byte(dataaddress) & 0xf; } inline void ht1130_device::setr1r0_data(u8 data) { const u8 dataaddress = getr1r0(); - m_data.write_byte(dataaddress, data); + m_data.write_byte(dataaddress, data & 0xf); } inline u8 ht1130_device::getr3r2() { - return (getreg(3)<<4) | getreg(2); + return (getreg(3) << 4) | getreg(2); } inline u8 ht1130_device::getr3r2_data() { const u8 dataaddress = getr3r2(); - return m_data.read_byte(dataaddress); + return m_data.read_byte(dataaddress) & 0xf; } inline void ht1130_device::setr3r2_data(u8 data) { const u8 dataaddress = getr3r2(); - m_data.write_byte(dataaddress, data); + m_data.write_byte(dataaddress, data & 0xf); } -- cgit v1.2.3