So I did a little more looking into this.
In core.vbs, the pinmame timer seems to be trying to do a sort of "mutex". There is:
Sub PinMAMETimer_Timer
...
Me.Enabled = False
...
Me.Enabled = True
...
End Sub
Since the timers are being checked by a single loop, and this is a single threaded application, these shouldn't be necessary as there's no way the loop is going to re-enter itself. If I remove those, the game works fine.
The loop that iterates through timers iterates through m_vht, so modifying the timers inside a timer is somewhat dangerous, since the timer routine can modify the contents of the vector while you're iterating through it.
for (int i = 0; i < m_vht.size(); i++)
{
HitTimer * const pht = m_vht.ElementAt(i);
if ((pht->m_interval >= 0 && pht->m_nextfire <= p_timeCur) || (pht->m_interval < 0 && first_cycle))
{
pht->m_pfe->FireGroupEvent(DISPID_TimerEvents_Timer); /// <-- I can modify m_vht!
If I copy the vector first:
Vector<HitTimer> vht;
for (int i = 0; i < m_vht.size(); i++)
vht.AddElement(m_vht.ElementAt(i));
for (int i = 0; i < vht.size(); i++)
It stops the vector from growing out of control, but the game still doesn't run right unless I remove the set/clear timer calls from core.vbs.
(Sidenote: MFC/ATL's vector class's copy operator/constructor doesn't seem to work like STL's, it didn't work unless I manually copied the array).
Edited by DJRobX, 05 November 2016 - 04:17 PM.