Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Andrea Odetti 2021-04-06 08:22:40 +01:00
commit ee48c0d567
2 changed files with 26 additions and 3 deletions

View file

@ -131,6 +131,20 @@ struct SY6522_AY8910
SSI263 ssi263; SSI263 ssi263;
MockingboardUnitState_e state; // Where a unit is a 6522+AY8910 pair MockingboardUnitState_e state; // Where a unit is a 6522+AY8910 pair
MockingboardUnitState_e stateB; // Phasor: 6522 & 2nd AY8910 MockingboardUnitState_e stateB; // Phasor: 6522 & 2nd AY8910
// SSI263 has a constructor, and so SY6522_AY8910 needs one too
// memset(0) is not guaranteed to work
SY6522_AY8910(void)
{
memset(&sy6522, 0, sizeof(sy6522));
nAY8910Number = 0;
nAYCurrentRegister = 0;
bTimer1Active = false;
bTimer2Active = false;
state = AY_NOP0;
stateB = AY_NOP0;
// ssi263 has already been default constructed
}
}; };
@ -1104,8 +1118,6 @@ void MB_Initialize()
} }
else else
{ {
memset(&g_MB,0,sizeof(g_MB));
for (UINT i=0; i<NUM_VOICES; i++) for (UINT i=0; i<NUM_VOICES; i++)
ppAYVoiceBuffer[i] = new short [SAMPLE_RATE]; // Buffer can hold a max of 1 seconds worth of samples ppAYVoiceBuffer[i] = new short [SAMPLE_RATE]; // Buffer can hold a max of 1 seconds worth of samples
@ -1114,6 +1126,7 @@ void MB_Initialize()
for (UINT i=0; i<NUM_AY8910; i++) for (UINT i=0; i<NUM_AY8910; i++)
{ {
g_MB[i] = SY6522_AY8910();
g_MB[i].nAY8910Number = i; g_MB[i].nAY8910Number = i;
g_MB[i].ssi263.SetDevice(i); g_MB[i].ssi263.SetDevice(i);
} }

View file

@ -288,7 +288,7 @@ const BYTE SSI263::m_Votrax2SSI263[/*64*/] =
void SSI263::Votrax_Write(BYTE value) void SSI263::Votrax_Write(BYTE value)
{ {
#if LOG_SC01 #if LOG_SC01
LogOutput("SC01: %02X\n", value); LogOutput("SC01: %02X (= SSI263: %02X)\n", value, m_Votrax2SSI263[value & PHONEME_MASK]);
#endif #endif
m_isVotraxPhoneme = true; m_isVotraxPhoneme = true;
@ -314,9 +314,15 @@ void SSI263::Play(unsigned int nPhoneme)
if (m_dbgFirst) if (m_dbgFirst)
{ {
m_dbgStartTime = g_nCumulativeCycles; m_dbgStartTime = g_nCumulativeCycles;
#if LOG_SSI263 || LOG_SSI263B || LOG_SC01
LogOutput("1st phoneme = 0x%02X\n", nPhoneme); LogOutput("1st phoneme = 0x%02X\n", nPhoneme);
#endif
} }
#if LOG_SSI263 || LOG_SSI263B || LOG_SC01
if (m_currentActivePhoneme != -1)
LogOutput("Overlapping phonemes: current=%02X, next=%02X\n", m_currentActivePhoneme&0xff, nPhoneme&0xff);
#endif
m_currentActivePhoneme = nPhoneme; m_currentActivePhoneme = nPhoneme;
bool bPause = false; bool bPause = false;
@ -381,7 +387,9 @@ void SSI263::Update(void)
{ {
// Willy Byte does SSI263 detection with drive motor on // Willy Byte does SSI263 detection with drive motor on
m_phonemeLengthRemaining = 0; m_phonemeLengthRemaining = 0;
#if LOG_SSI263 || LOG_SSI263B || LOG_SC01
if (m_dbgFirst) LogOutput("1st phoneme short-circuited by fullspeed\n"); if (m_dbgFirst) LogOutput("1st phoneme short-circuited by fullspeed\n");
#endif
if (m_phonemeAccurateLengthRemaining) if (m_phonemeAccurateLengthRemaining)
m_phonemeCompleteByFullSpeed = true; // Let UpdateAccurateLength() call UpdateIRQ() m_phonemeCompleteByFullSpeed = true; // Let UpdateAccurateLength() call UpdateIRQ()
@ -678,8 +686,10 @@ void SSI263::UpdateIRQ(void)
if (m_dbgFirst && m_dbgStartTime) if (m_dbgFirst && m_dbgStartTime)
{ {
#if LOG_SSI263 || LOG_SSI263B || LOG_SC01
UINT64 diff = g_nCumulativeCycles - m_dbgStartTime; UINT64 diff = g_nCumulativeCycles - m_dbgStartTime;
LogOutput("1st phoneme playback time = 0x%08X cy\n", (UINT32)diff); LogOutput("1st phoneme playback time = 0x%08X cy\n", (UINT32)diff);
#endif
m_dbgFirst = false; m_dbgFirst = false;
} }