Better comments

This commit is contained in:
tomcw 2023-01-25 21:30:29 +00:00
parent c6059dadc1
commit db48893677

View File

@ -91,13 +91,13 @@ MockingboardCard::MockingboardCard(UINT slot, SS_CARDTYPE type) : Card(type, slo
for (UINT i = 0; i < NUM_VOICES; i++)
m_ppAYVoiceBuffer[i] = new short[MAX_SAMPLES]; // Buffer can hold a max of 0.37 seconds worth of samples (16384/44100)
// Construct via placement new, so that it is an array of 'MB_SUBUNIT' objects
// Allocate space for an array of 'MB_SUBUNIT' objects
m_MBSubUnit = (MB_SUBUNIT*) new BYTE[sizeof(MB_SUBUNIT) * NUM_SUBUNITS_PER_MB];
memset(m_MBSubUnit, sizeof(MB_SUBUNIT) * NUM_SUBUNITS_PER_MB, 0);
for (UINT i = 0; i < NUM_SUBUNITS_PER_MB; i++)
{
new (&m_MBSubUnit[i]) MB_SUBUNIT(m_slot);
new (&m_MBSubUnit[i]) MB_SUBUNIT(m_slot); // Construct via placement new
m_MBSubUnit[i].nAY8910Number = i;
const UINT id0 = i * SY6522::kNumTimersPer6522 + 0; // TIMER1
const UINT id1 = i * SY6522::kNumTimersPer6522 + 1; // TIMER2
@ -117,7 +117,7 @@ MockingboardCard::~MockingboardCard(void)
Destroy();
for (UINT i = 0; i < NUM_SUBUNITS_PER_MB; i++)
m_MBSubUnit[i].~MB_SUBUNIT();
m_MBSubUnit[i].~MB_SUBUNIT(); // Explicitly call dtor
delete[](BYTE*) m_MBSubUnit;
}