}
else if ((addr & 0xFFF0) == 0xC030)
{
+/*
+This is problematic, mainly because the v65C02 removes actual cycles run after each call.
+Therefore, we don't really have a reliable method of sending a timestamp to the sound routine.
+How to fix?
+
+What we need to send is a delta T value but related to the IRQ buffer routine. E.g., if the buffer
+hasn't had any changes in it then we just fill it with the last sample value and are done. Then
+we need to adjust our delta T accordingly. What we could do is keep a running total of time since the
+last change and adjust it accordingly, i.e., whenever a sound IRQ happens.
+How to keep track?
+
+Have deltaT somewhere. Then, whenever there's a toggle, backfill buffer with last spkr state and reset
+deltaT to zero. In the sound IRQ, if deltaT > buffer size, then subtract buffer size from deltaT. (?)
+
+
+
+*/
ToggleSpeaker(GetCurrentV65C02Clock());
//should it return something else here???
return 0x00;
SetCallbackTime(FrameCallback, 16666.66666667);
//Instead of this, we should yield remaining time to other processes... !!! FIX !!!
+//lessee...
+//nope. SDL_Delay(10);
while (SDL_GetTicks() - startTicks < 16); // Wait for next frame...
startTicks = SDL_GetTicks();
}