diff options
author | Patrick Mackinlay <pmackinlay@hotmail.com> | 2019-09-13 11:09:24 +0700 |
---|---|---|
committer | Patrick Mackinlay <pmackinlay@hotmail.com> | 2019-09-13 11:09:24 +0700 |
commit | 40de5e0551f18bef6694b360dcd7a4caa787e36e (patch) | |
tree | a5ff69a5e58521677a38fe3b243247fbe88afe75 | |
parent | bd50190cfe70f741590c9689872f7ff14111a83e (diff) |
bt431: fix masking (nw)
Address and command register masking to match SGI IDE cursor test expectations.
-rw-r--r-- | src/devices/video/bt431.cpp | 2 | ||||
-rw-r--r-- | 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 <unsigned S> u8 addr_r() { return m_address >> S; } - template <unsigned S> void addr_w(u8 data) { m_address = (m_address & (0xff00 >> S)) | (u16(data) << S); } + template <unsigned S> void addr_w(u8 data) { m_address = ((m_address & (0xff00 >> S)) | (u16(data) << S)) & ADDRESS_MASK; } u8 ram_r(); void ram_w(u8 data); |