Skip to content

Commit

Permalink
Fix 6270 reading invalid reg returning read buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
drhelius committed Sep 9, 2024
1 parent 02ef64d commit 47ce4d6
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/huc6270_inline.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,11 @@ inline u8 HuC6270::ReadRegister(u32 address)
}
// Data register (LSB)
case 2:
if (m_address_register == HUC6270_REG_VRR)
{
return m_read_buffer & 0xFF;
}
else
if (m_address_register != HUC6270_REG_VRR)
{
//Debug("HuC6270 invalid read data register: %02X", m_address_register);
return m_register[HUC6270_REG_VWR] & 0xFF;
}
return m_read_buffer & 0xFF;
break;
// Data register (MSB)
case 3:
Expand All @@ -114,7 +110,7 @@ inline u8 HuC6270::ReadRegister(u32 address)
else
{
//Debug("HuC6270 invalid read data register: %02X", m_address_register);
return m_register[HUC6270_REG_VWR] & 0xFF;
return m_read_buffer >> 8;
}
break;
default:
Expand Down

0 comments on commit 47ce4d6

Please sign in to comment.