]> Shamusworld >> Repos - apple2/blobdiff - src/timing.cpp
Changes to sound system relating to the new threaded CPU core. It works,
[apple2] / src / timing.cpp
index eafaa21f236edf8342ce4870592086751c9b11f5..e93ee1a7e77565474ef634c7306f083141b1f358 100755 (executable)
@@ -38,6 +38,7 @@ struct Event
     void (* timerCallback)(void);
 };
 
+//let's try +1... nope.
 static Event eventList[EVENT_LIST_SIZE];
 static uint32 nextEvent;
 
@@ -98,6 +99,7 @@ double GetTimeToNextEvent(void)
        // increasing time, we have to search through the list for the lowest one.
 
 //ALSO: There's a bug here--nextEvent is getting a bogus value/getting clobbered...
+//      Seems like it's getting clobbered somewhere other than here...
     double time = 0;
     bool firstTime = true;
 
@@ -125,6 +127,9 @@ double GetTimeToNextEvent(void)
        if (time == 0)
                WriteLog("TIMING: GetTimeToNextEvent() failed to find next event!\n");
 
+       if (nextEvent >= EVENT_LIST_SIZE)
+               WriteLog("TIMING: GetTimeToNextEvent() has bad nextEvent (=%u)!\n", nextEvent);
+
     return time;
 }