minor change: small optimization and fixed a typo.

git-svn-id: http://pcsx2-playground.googlecode.com/svn/trunk@135 a6443dda-0b58-4228-96e9-037be469359c
This commit is contained in:
cottonvibes 2008-09-20 09:32:59 +00:00 committed by Gregory Hainaut
parent b0c4145950
commit 94d0e20d26
2 changed files with 20 additions and 14 deletions

View File

@ -195,15 +195,18 @@ void UpdateVSyncRate() {
counters[5].Cycle = PS2VBLANKEND;*/
{
u32 vsyncs = (Config.PsxType&1) ? 5000:5994;
if(Config.CustomFps>0) vsyncs = Config.CustomFps*100;
iTicks = GetTickFrequency()/vsyncs*100;
if (Config.CustomFps != 0)
if (Config.CustomFps > 0) {
iTicks = GetTickFrequency() / Config.CustomFps;
SysPrintf("Framelimiter rate updated (UpdateVSyncRate): %d fps\n", Config.CustomFps);
else if (Config.PsxType&1)
}
else if (Config.PsxType & 1) {
iTicks = (GetTickFrequency() / 5000) * 100;
SysPrintf("Framelimiter rate updated (UpdateVSyncRate): 50 fps\n");
else
SysPrintf("Framelimiter rate updated (UpdateVSyncRate): 50.94 fps\n");
}
else {
iTicks = (GetTickFrequency() / 5994) * 100;
SysPrintf("Framelimiter rate updated (UpdateVSyncRate): 59.94 fps\n");
}
}
rcntSet();
}

View File

@ -534,15 +534,18 @@ void cpuExecuteBios()
{
extern u64 GetTickFrequency();
extern u64 iTicks;
u32 vsyncs = (Config.PsxType&1) ? 5000:5994;
if(Config.CustomFps>0) vsyncs = Config.CustomFps*100;
iTicks = GetTickFrequency()/vsyncs*100;
if (Config.CustomFps != 0)
if (Config.CustomFps > 0) {
iTicks = GetTickFrequency() / Config.CustomFps;
SysPrintf("Framelimiter rate updated (UpdateVSyncRate): %d fps\n", Config.CustomFps);
else if (Config.PsxType&1)
}
else if (Config.PsxType & 1) {
iTicks = (GetTickFrequency() / 5000) * 100;
SysPrintf("Framelimiter rate updated (UpdateVSyncRate): 50 fps\n");
else
SysPrintf("Framelimiter rate updated (UpdateVSyncRate): 50.94 fps\n");
}
else {
iTicks = (GetTickFrequency() / 5994) * 100;
SysPrintf("Framelimiter rate updated (UpdateVSyncRate): 59.94 fps\n");
}
}
SysPrintf("* PCSX2 *: ExecuteBios\n");