mirror of
https://github.com/AppleWin/AppleWin.git
synced 2025-01-01 12:31:59 +00:00
Fix so that MockingboardCardMgr asserts IRQ based on the wired-OR sum of all MB card's 6522s. (Fixes #1173)
This commit is contained in:
parent
c56d341bdb
commit
cf722ff0cc
@ -128,7 +128,7 @@ void SY6522::UpdateIFR(BYTE clr_ifr, BYTE set_ifr /*= 0*/)
|
|||||||
m_regs.IFR &= ~IFR_IRQ;
|
m_regs.IFR &= ~IFR_IRQ;
|
||||||
|
|
||||||
if (GetCardMgr().GetObj(m_slot)) // If called from MockingboardCard ctor, then CardManager::m_slot[slot] == NULL
|
if (GetCardMgr().GetObj(m_slot)) // If called from MockingboardCard ctor, then CardManager::m_slot[slot] == NULL
|
||||||
dynamic_cast<MockingboardCard&>(GetCardMgr().GetRef(m_slot)).UpdateIRQ();
|
GetCardMgr().GetMockingboardCardMgr().UpdateIRQ();
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
@ -288,13 +288,13 @@ void MockingboardCard::UpdateIFRandIRQ(MB_SUBUNIT* pMB, BYTE clr_mask, BYTE set_
|
|||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
// Called from class SY6522
|
// Called from class SY6522
|
||||||
void MockingboardCard::UpdateIRQ(void)
|
bool MockingboardCard::Is6522IRQ(void)
|
||||||
{
|
{
|
||||||
// Now update the IRQ signal from all 6522s
|
// Now update the IRQ signal from all 6522s
|
||||||
// . OR-sum of all active TIMER1, TIMER2 & SPEECH sources (from all 6522s)
|
// . OR-sum of all active TIMER1, TIMER2 & SPEECH sources (from all 6522s)
|
||||||
UINT bIRQ = 0;
|
bool irq = false;
|
||||||
for (UINT i = 0; i < NUM_SUBUNITS_PER_MB; i++)
|
for (UINT i = 0; i < NUM_SUBUNITS_PER_MB; i++)
|
||||||
bIRQ |= m_MBSubUnit[i].sy6522.GetReg(SY6522::rIFR) & 0x80;
|
irq |= m_MBSubUnit[i].sy6522.GetReg(SY6522::rIFR) & 0x80 ? true : false;
|
||||||
|
|
||||||
// NB. Mockingboard generates IRQ on both 6522s:
|
// NB. Mockingboard generates IRQ on both 6522s:
|
||||||
// . SSI263's IRQ (A/!R) is routed via the 2nd 6522 (at $Cn80) and must generate a 6502 IRQ (not NMI)
|
// . SSI263's IRQ (A/!R) is routed via the 2nd 6522 (at $Cn80) and must generate a 6502 IRQ (not NMI)
|
||||||
@ -302,10 +302,7 @@ void MockingboardCard::UpdateIRQ(void)
|
|||||||
// . SC-01's IRQ (A/!R) is routed via the 6522 at $Cn00 (NB. Only the Mockingboard "Sound/Speech I" card supports the SC-01)
|
// . SC-01's IRQ (A/!R) is routed via the 6522 at $Cn00 (NB. Only the Mockingboard "Sound/Speech I" card supports the SC-01)
|
||||||
// Phasor's SSI263 IRQ (A/!R) line is *also* wired directly to the 6502's IRQ (as well as the 6522's CA1)
|
// Phasor's SSI263 IRQ (A/!R) line is *also* wired directly to the 6502's IRQ (as well as the 6522's CA1)
|
||||||
|
|
||||||
if (bIRQ)
|
return irq;
|
||||||
CpuIrqAssert(IS_6522);
|
|
||||||
else
|
|
||||||
CpuIrqDeassert(IS_6522);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
@ -43,7 +43,7 @@ public:
|
|||||||
void Get6522IrqDescription(std::string& desc);
|
void Get6522IrqDescription(std::string& desc);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void UpdateIRQ(void);
|
bool Is6522IRQ(void);
|
||||||
UINT64 GetLastCumulativeCycles(void);
|
UINT64 GetLastCumulativeCycles(void);
|
||||||
void UpdateIFR(BYTE nDevice, BYTE clr_mask, BYTE set_mask);
|
void UpdateIFR(BYTE nDevice, BYTE clr_mask, BYTE set_mask);
|
||||||
BYTE GetPCR(BYTE nDevice);
|
BYTE GetPCR(BYTE nDevice);
|
||||||
|
@ -32,6 +32,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||||||
#include "MockingboardCardManager.h"
|
#include "MockingboardCardManager.h"
|
||||||
#include "Core.h"
|
#include "Core.h"
|
||||||
#include "CardManager.h"
|
#include "CardManager.h"
|
||||||
|
#include "CPU.h"
|
||||||
#include "Mockingboard.h"
|
#include "Mockingboard.h"
|
||||||
#include "MockingboardDefs.h"
|
#include "MockingboardDefs.h"
|
||||||
#include "Riff.h"
|
#include "Riff.h"
|
||||||
@ -108,6 +109,21 @@ void MockingboardCardManager::UpdateCycles(ULONG executedCycles)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MockingboardCardManager::UpdateIRQ(void)
|
||||||
|
{
|
||||||
|
bool irq = false;
|
||||||
|
for (UINT i = SLOT0; i < NUM_SLOTS; i++)
|
||||||
|
{
|
||||||
|
if (IsMockingboard(i))
|
||||||
|
irq |= dynamic_cast<MockingboardCard&>(GetCardMgr().GetRef(i)).Is6522IRQ();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (irq)
|
||||||
|
CpuIrqAssert(IS_6522);
|
||||||
|
else
|
||||||
|
CpuIrqDeassert(IS_6522);
|
||||||
|
}
|
||||||
|
|
||||||
bool MockingboardCardManager::IsActive(void)
|
bool MockingboardCardManager::IsActive(void)
|
||||||
{
|
{
|
||||||
if (!m_mockingboardVoice.bActive)
|
if (!m_mockingboardVoice.bActive)
|
||||||
|
@ -26,6 +26,7 @@ public:
|
|||||||
void MuteControl(bool mute);
|
void MuteControl(bool mute);
|
||||||
void SetCumulativeCycles(void);
|
void SetCumulativeCycles(void);
|
||||||
void UpdateCycles(ULONG executedCycles);
|
void UpdateCycles(ULONG executedCycles);
|
||||||
|
void UpdateIRQ(void);
|
||||||
bool IsActive(void);
|
bool IsActive(void);
|
||||||
DWORD GetVolume(void);
|
DWORD GetVolume(void);
|
||||||
void SetVolume(DWORD volume, DWORD volumeMax);
|
void SetVolume(DWORD volume, DWORD volumeMax);
|
||||||
|
Loading…
Reference in New Issue
Block a user