From 94d0e20d26af7369aea70e34ea2070a267e19bc8 Mon Sep 17 00:00:00 2001 From: cottonvibes Date: Sat, 20 Sep 2008 09:32:59 +0000 Subject: [PATCH] minor change: small optimization and fixed a typo. git-svn-id: http://pcsx2-playground.googlecode.com/svn/trunk@135 a6443dda-0b58-4228-96e9-037be469359c --- pcsx2/Counters.c | 17 ++++++++++------- pcsx2/R5900.c | 17 ++++++++++------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/pcsx2/Counters.c b/pcsx2/Counters.c index e81c2c8971..54cc4028d6 100644 --- a/pcsx2/Counters.c +++ b/pcsx2/Counters.c @@ -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(); } diff --git a/pcsx2/R5900.c b/pcsx2/R5900.c index 5a167b46c3..f2e31f3e1b 100644 --- a/pcsx2/R5900.c +++ b/pcsx2/R5900.c @@ -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");