From 40de5e0551f18bef6694b360dcd7a4caa787e36e Mon Sep 17 00:00:00 2001 From: Patrick Mackinlay Date: Fri, 13 Sep 2019 11:09:24 +0700 Subject: bt431: fix masking (nw) Address and command register masking to match SGI IDE cursor test expectations. --- src/devices/video/bt431.cpp | 2 +- src/devices/video/bt431.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/devices/video/bt431.cpp b/src/devices/video/bt431.cpp index c66b404c39f..80aa8c7766f 100644 --- a/src/devices/video/bt431.cpp +++ b/src/devices/video/bt431.cpp @@ -118,7 +118,7 @@ void bt431_device::reg_w(u8 data) switch (m_address & 0xf) { case REG_COMMAND: - m_command = data; + m_command = data & CR_WM; LOG("64x64 cursor %s, cross hair cursor %s, cursor format %s, cross hair thickness %d\n", (data & CR_D6) ? "enable" : "disable", (data & CR_D5) ? "enable" : "disable", diff --git a/src/devices/video/bt431.h b/src/devices/video/bt431.h index 86241a8d87b..1ea71b56794 100644 --- a/src/devices/video/bt431.h +++ b/src/devices/video/bt431.h @@ -35,6 +35,8 @@ public: CR_D4 = 0x10, // cursor format control CR_D5 = 0x20, // cross hair cursor enable CR_D6 = 0x40, // 64x64 cursor enable + + CR_WM = 0x7f, // write mask }; enum cr_d1d0_mask : u8 @@ -62,7 +64,7 @@ protected: virtual void device_reset() override; template u8 addr_r() { return m_address >> S; } - template void addr_w(u8 data) { m_address = (m_address & (0xff00 >> S)) | (u16(data) << S); } + template void addr_w(u8 data) { m_address = ((m_address & (0xff00 >> S)) | (u16(data) << S)) & ADDRESS_MASK; } u8 ram_r(); void ram_w(u8 data); -- cgit v1.2.3