- The number of emulated CPU cycles that have been executed thus far.
- The number of emulated CPU cycles that had been executed the last time this callback function was called.
- A queue of sound hardware writes with times.
Timing sound when being generated in software
I'm writing an emulator, and so need to emulate graphics and sound hardware.
The timing is really confusing me when it comes to sound, however.
The way I'm handling sound is to use the conventional method - a callback function that is called by the sound API (in this case, FMOD Ex) that fills a buffer with a number of samples.
Said samples are generated by software emulation of the Master System's sound hardware.
I've tried two methods to handle timing:
Elaborate method
Writes to the sound hardware are queued up, along with a timestamp (in this case, the number of emulated CPU cycles that have been executed).
When the callback function to fill the sound buffer is called, I know three things:
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement