bt431: fix masking (nw)

Address and command register masking to match SGI IDE cursor test expectations.
This commit is contained in:
Patrick Mackinlay 2019-09-13 11:09:24 +07:00
parent bd50190cfe
commit 40de5e0551
2 changed files with 4 additions and 2 deletions

View File

@ -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",

View File

@ -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);