mirror of
https://github.com/AppleWin/AppleWin.git
synced 2024-06-01 14:41:33 +00:00
WIP supprt for Speech-Sound card
This commit is contained in:
parent
ce309324bb
commit
5f6a5361c0
|
@ -105,7 +105,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||
|
||||
#include "YamlHelper.h"
|
||||
|
||||
#define LOG_IRQ_TAKEN_AND_RTI 0
|
||||
#define LOG_IRQ_TAKEN_AND_RTI 1
|
||||
|
||||
// 6502 Accumulator Bit Flags
|
||||
#define AF_SIGN 0x80
|
||||
|
@ -236,7 +236,7 @@ static __forceinline void DoIrqProfiling(DWORD uCycles)
|
|||
{
|
||||
#ifdef _DEBUG
|
||||
if(regs.ps & AF_INTERRUPT)
|
||||
return; // Still in Apple's ROM
|
||||
return; // Still in Apple's ROM (or an NMI with I=1)
|
||||
|
||||
#if LOG_IRQ_TAKEN_AND_RTI
|
||||
LogOutput("ISR-end\n\n");
|
||||
|
@ -378,7 +378,7 @@ static __forceinline void Fetch(BYTE& iOpcode, ULONG uExecutedCycles)
|
|||
regs.pc++;
|
||||
}
|
||||
|
||||
//#define ENABLE_NMI_SUPPORT // Not used - so don't enable
|
||||
#define ENABLE_NMI_SUPPORT // Not used - so don't enable
|
||||
static __forceinline void NMI(ULONG& uExecutedCycles, BOOL& flagc, BOOL& flagn, BOOL& flagv, BOOL& flagz)
|
||||
{
|
||||
#ifdef ENABLE_NMI_SUPPORT
|
||||
|
@ -397,6 +397,12 @@ static __forceinline void NMI(ULONG& uExecutedCycles, BOOL& flagc, BOOL& flagn,
|
|||
regs.pc = * (WORD*) (mem+0xFFFA);
|
||||
UINT uExtraCycles = 0; // Needed for CYC(a) macro
|
||||
CYC(7)
|
||||
#if defined(_DEBUG) && LOG_IRQ_TAKEN_AND_RTI
|
||||
std::string irq6522;
|
||||
MB_Get6522IrqDescription(irq6522);
|
||||
const char* pSrc = irq6522.c_str();
|
||||
LogOutput("NMI (%08X) (%s)\n", (UINT)g_nCycleIrqStart, pSrc);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -736,7 +742,6 @@ void CpuNmiAssert(eIRQSRC Device)
|
|||
|
||||
void CpuNmiDeassert(eIRQSRC Device)
|
||||
{
|
||||
_ASSERT(g_bCritSectionValid);
|
||||
if (g_bCritSectionValid) EnterCriticalSection(&g_CriticalSection);
|
||||
g_bmNMI &= ~(1<<Device);
|
||||
if (g_bCritSectionValid) LeaveCriticalSection(&g_CriticalSection);
|
||||
|
|
|
@ -93,7 +93,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||
#include "AY8910.h"
|
||||
#include "SSI263.h"
|
||||
|
||||
#define DBG_MB_SS_CARD 0 // From UI, select Mockingboard (not Phasor)
|
||||
#define DBG_MB_SS_CARD 1 // From UI, select Mockingboard (not Phasor)
|
||||
|
||||
#define SY6522_DEVICE_A 0
|
||||
#define SY6522_DEVICE_B 1
|
||||
|
@ -583,11 +583,16 @@ static void UpdateIFR(SY6522_AY8910* pMB, BYTE clr_ifr, BYTE set_ifr=0)
|
|||
else
|
||||
pMB->sy6522.IFR &= 0x7F;
|
||||
|
||||
#if DBG_MB_SS_CARD
|
||||
UINT bIRQ = (g_MB[0].sy6522.IFR & 0x80) | (g_MB[2].sy6522.IFR & 0x80); // $Cn00
|
||||
UINT bNMI = (g_MB[1].sy6522.IFR & 0x80) | (g_MB[3].sy6522.IFR & 0x80); // $Cn80
|
||||
#else
|
||||
// Now update the IRQ signal from all 6522s
|
||||
// . OR-sum of all active TIMER1, TIMER2 & SPEECH sources (from all 6522s)
|
||||
UINT bIRQ = 0;
|
||||
for (UINT i=0; i<NUM_SY6522; i++)
|
||||
bIRQ |= g_MB[i].sy6522.IFR & 0x80;
|
||||
#endif
|
||||
|
||||
// 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)
|
||||
|
@ -599,6 +604,13 @@ static void UpdateIFR(SY6522_AY8910* pMB, BYTE clr_ifr, BYTE set_ifr=0)
|
|||
CpuIrqAssert(IS_6522);
|
||||
else
|
||||
CpuIrqDeassert(IS_6522);
|
||||
|
||||
#if DBG_MB_SS_CARD
|
||||
if (bNMI)
|
||||
CpuNmiAssert(IS_6522);
|
||||
else
|
||||
CpuNmiDeassert(IS_6522);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void SY6522_Write(BYTE nDevice, BYTE nReg, BYTE nValue)
|
||||
|
|
Loading…
Reference in New Issue
Block a user