diff --git a/source/Mockingboard.cpp b/source/Mockingboard.cpp index 346dc10a..361cdf9c 100644 --- a/source/Mockingboard.cpp +++ b/source/Mockingboard.cpp @@ -131,6 +131,20 @@ struct SY6522_AY8910 SSI263 ssi263; MockingboardUnitState_e state; // Where a unit is a 6522+AY8910 pair 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 { - memset(&g_MB,0,sizeof(g_MB)); - for (UINT i=0; i