mirror of
https://github.com/AppleWin/AppleWin.git
synced 2024-09-28 00:54:40 +00:00
Set busState for 6522-A for AY_INACTIVE state
This commit is contained in:
parent
16003ba507
commit
5ff43789dd
@ -292,6 +292,7 @@ void MockingboardCard::AY8913_Write(BYTE subunit, BYTE ay, BYTE value)
|
|||||||
m_regAccessedFlag = true;
|
m_regAccessedFlag = true;
|
||||||
MB_SUBUNIT* pMB = &m_MBSubUnit[subunit];
|
MB_SUBUNIT* pMB = &m_MBSubUnit[subunit];
|
||||||
SY6522& r6522 = (QueryType() != CT_SDMusic) ? pMB->sy6522 : m_MBSubUnit[0].sy6522;
|
SY6522& r6522 = (QueryType() != CT_SDMusic) ? pMB->sy6522 : m_MBSubUnit[0].sy6522;
|
||||||
|
bool busState = false; // Default: Mockingboard or Phasor(any mode) will read PortA inputs as high.
|
||||||
|
|
||||||
// Determine the AY8913 inputs
|
// Determine the AY8913 inputs
|
||||||
int nBDIR = (value & 2) ? 1 : 0;
|
int nBDIR = (value & 2) ? 1 : 0;
|
||||||
@ -317,12 +318,11 @@ void MockingboardCard::AY8913_Write(BYTE subunit, BYTE ay, BYTE value)
|
|||||||
|
|
||||||
case AY_READ: // 5: READ FROM PSG (need to set DDRA to input)
|
case AY_READ: // 5: READ FROM PSG (need to set DDRA to input)
|
||||||
{
|
{
|
||||||
bool busState = true; // Initially default to true
|
|
||||||
|
|
||||||
if (pMB->isChipSelected[ay] && pMB->isAYLatchedAddressValid[ay])
|
if (pMB->isChipSelected[ay] && pMB->isAYLatchedAddressValid[ay])
|
||||||
|
{
|
||||||
r6522.SetRegIRA(AYReadReg(subunit, ay, pMB->nAYCurrentRegister[ay]) & (r6522.GetReg(SY6522::rDDRA) ^ 0xff));
|
r6522.SetRegIRA(AYReadReg(subunit, ay, pMB->nAYCurrentRegister[ay]) & (r6522.GetReg(SY6522::rDDRA) ^ 0xff));
|
||||||
else
|
busState = true;
|
||||||
busState = false;
|
}
|
||||||
|
|
||||||
if (m_phasorEnable && m_phasorMode == PH_Phasor) // GH#1192
|
if (m_phasorEnable && m_phasorMode == PH_Phasor) // GH#1192
|
||||||
{
|
{
|
||||||
@ -332,11 +332,6 @@ void MockingboardCard::AY8913_Write(BYTE subunit, BYTE ay, BYTE value)
|
|||||||
r6522.SetRegIRA(r6522.GetReg(SY6522::rORA) | (AYReadReg(subunit, AY8913_DEVICE_B, pMB->nAYCurrentRegister[AY8913_DEVICE_B]) & (r6522.GetReg(SY6522::rDDRA) ^ 0xff)));
|
r6522.SetRegIRA(r6522.GetReg(SY6522::rORA) | (AYReadReg(subunit, AY8913_DEVICE_B, pMB->nAYCurrentRegister[AY8913_DEVICE_B]) & (r6522.GetReg(SY6522::rDDRA) ^ 0xff)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (QueryType() != CT_SDMusic)
|
|
||||||
pMB->SetBusState(busState);
|
|
||||||
else
|
|
||||||
m_MBSubUnit[0].SetBusState(busState);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -387,13 +382,10 @@ void MockingboardCard::AY8913_Write(BYTE subunit, BYTE ay, BYTE value)
|
|||||||
|
|
||||||
state = nAYFunc;
|
state = nAYFunc;
|
||||||
|
|
||||||
if (state == AY_INACTIVE) // Mockingboard or Phasor(any mode) will read PortA inputs as high.
|
if (QueryType() == CT_SDMusic)
|
||||||
{
|
m_MBSubUnit[0].SetBusState(busState);
|
||||||
if (QueryType() != CT_SDMusic)
|
|
||||||
pMB->SetBusState(false);
|
|
||||||
else
|
else
|
||||||
m_MBSubUnit[0].SetBusState(false);
|
pMB->SetBusState(busState);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user