If you put the mmFrame call after VBlank interrupt (mmSetVBlankHandler(mmFrame)) the sound output is great at any frame rate, but if you get too much active channels probably you'll run out of VBlank cycles.
I think the best idea is to call mmFrame at the end of VBlank period when the game is at 60fps and to call mmFrame after VBlank interrupt when the frame rate drops below 60fps:
Code: Select all
//Main loop:
while(1)
{
// Game logic:
...
mmSetVBlankHandler(NULL);
VBlankIntrWait();
// Update GBA HW during VBlank period:
...
mmFrame();
mmSetVBlankHandler(mmFrame);
}
So... which way do you think is the best to get clean sound below 60fps?