MegaAudio card: Reads of 6522 IRB & IRA always return 0x00

. generalise the implementation: move AY READ logic down to 6522 read
This commit is contained in:
tomcw 2024-01-21 20:42:57 +00:00
parent 43daabec54
commit 56cc779351
2 changed files with 5 additions and 11 deletions

View File

@ -345,9 +345,11 @@ BYTE SY6522::Read(BYTE nReg)
{
case 0x00: // IRB
nValue = m_regs.ORB | (m_regs.DDRB ^ 0xff); // Input bits read back as 1's (GH#1260)
if (m_isMegaAudio) nValue = 0x00; // MegaAudio: IRB just reads as $00
break;
case 0x01: // IRA
nValue = m_regs.ORA | (m_isBusDriven ? 0x00 : (m_regs.DDRA ^ 0xff)); // NB. Inputs bits driven by AY8913 if in PSG READ mode
if (m_isMegaAudio) nValue = 0x00; // MegaAudio: IRA just reads as $00
break;
case 0x02: // DDRB
nValue = m_regs.DDRB;

View File

@ -313,18 +313,10 @@ void MockingboardCard::AY8913_Write(BYTE subunit, BYTE ay, BYTE value)
{
bool busState = true; // Initially default to true
if (QueryType() != CT_MegaAudio)
{
if (pMB->isChipSelected[ay] && pMB->isAYLatchedAddressValid[ay])
r6522.SetRegIRA(AYReadReg(subunit, ay, pMB->nAYCurrentRegister[ay]) & (r6522.GetReg(SY6522::rDDRA) ^ 0xff));
else
busState = false;
}
if (pMB->isChipSelected[ay] && pMB->isAYLatchedAddressValid[ay])
r6522.SetRegIRA(AYReadReg(subunit, ay, pMB->nAYCurrentRegister[ay]) & (r6522.GetReg(SY6522::rDDRA) ^ 0xff));
else
{
r6522.SetRegIRA(0x00); // Reads not supported - always return 0x00.
busState = true;
}
busState = false;
if (m_phasorEnable && m_phasorMode == PH_Phasor) // GH#1192
{