mirror of
https://github.com/dborth/vbagx.git
synced 2025-02-19 20:12:45 +01:00
add timing correction for GB games
This commit is contained in:
parent
0ae30cfd17
commit
4e0ff85b3f
@ -132,9 +132,6 @@ static u32 autoFrameSkipLastTime = 0;
|
||||
|
||||
void system10Frames(int rate)
|
||||
{
|
||||
if (cartridgeType == 1)
|
||||
return;
|
||||
|
||||
u32 time = systemGetClock();
|
||||
u32 diff = time - autoFrameSkipLastTime;
|
||||
|
||||
@ -146,6 +143,8 @@ void system10Frames(int rate)
|
||||
else
|
||||
timeOff = 0; // timeoff was not valid
|
||||
|
||||
if (cartridgeType == 2) // GBA games require frameskipping
|
||||
{
|
||||
// consider increasing skip
|
||||
if(diff >= 270)
|
||||
systemFrameSkip += 4;
|
||||
@ -169,6 +168,7 @@ void system10Frames(int rate)
|
||||
systemFrameSkip = 20;
|
||||
else if(systemFrameSkip < 0)
|
||||
systemFrameSkip = 0;
|
||||
}
|
||||
|
||||
autoFrameSkipLastTime = time + timeOff; // total time = processing time + sleep time
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user