vba-next: frame timing wizardry

This commit is contained in:
goyuken 2014-08-08 04:15:57 +00:00
parent 31fe0c57e3
commit bf14551632
2 changed files with 4 additions and 2 deletions

Binary file not shown.

View File

@ -12505,7 +12505,7 @@ void CPUInterrupt(void)
void CPULoop (void)
{
bus.busPrefetchCount = 0;
int ticks = 50000;
int ticks = 300000;
int timerOverflow = 0;
// variable used by the CPU core
cpuTotalTicks = 0;
@ -12514,6 +12514,7 @@ void CPULoop (void)
if(cpuNextEvent > ticks)
cpuNextEvent = ticks;
bool framedone = false;
do
{
@ -12641,6 +12642,7 @@ updateLoop:
systemDrawScreen();
process_sound_tick_fn();
framedone = true;
}
UPDATE_REG(0x04, io_registers[REG_DISPSTAT]);
@ -12916,7 +12918,7 @@ updateLoop:
if(cpuNextEvent > ticks)
cpuNextEvent = ticks;
if(ticks <= 0)
if(ticks <= 0 || framedone)
break;
}