From 03a92c7815f4955ab581eac59630c145ec68869c Mon Sep 17 00:00:00 2001 From: kanjitalk755 Date: Wed, 16 Jan 2019 19:44:09 +0900 Subject: [PATCH] append pref item cpuclock --- SheepShaver/src/Unix/main_unix.cpp | 2 ++ SheepShaver/src/Windows/main_windows.cpp | 4 ++++ SheepShaver/src/prefs_items.cpp | 1 + 3 files changed, 7 insertions(+) diff --git a/SheepShaver/src/Unix/main_unix.cpp b/SheepShaver/src/Unix/main_unix.cpp index d5580a51..34c104cc 100755 --- a/SheepShaver/src/Unix/main_unix.cpp +++ b/SheepShaver/src/Unix/main_unix.cpp @@ -401,6 +401,8 @@ static void get_system_info(void) #if EMULATED_PPC PVR = 0x000c0000; // Default: 7400 (with AltiVec) + int pref_cpu_clock = PrefsFindInt32("cpuclock"); + if (pref_cpu_clock) CPUClockSpeed = 1000000 * pref_cpu_clock; #elif defined(__APPLE__) && defined(__MACH__) proc_file = popen("ioreg -c IOPlatformDevice", "r"); if (proc_file) { diff --git a/SheepShaver/src/Windows/main_windows.cpp b/SheepShaver/src/Windows/main_windows.cpp index 22cafb45..0683c471 100755 --- a/SheepShaver/src/Windows/main_windows.cpp +++ b/SheepShaver/src/Windows/main_windows.cpp @@ -249,6 +249,10 @@ int main(int argc, char **argv) TimebaseSpeed = 25000000; // Default: 25MHz PVR = 0x000c0000; // Default: 7400 (with AltiVec) D(bug("PVR: %08x (assumed)\n", PVR)); + { + int pref_cpu_clock = PrefsFindInt32("cpuclock"); + if (pref_cpu_clock) CPUClockSpeed = 1000000 * pref_cpu_clock; + } // Init system routines SysInit(); diff --git a/SheepShaver/src/prefs_items.cpp b/SheepShaver/src/prefs_items.cpp index b0a9f919..5a7f7761 100644 --- a/SheepShaver/src/prefs_items.cpp +++ b/SheepShaver/src/prefs_items.cpp @@ -62,6 +62,7 @@ prefs_desc common_prefs_items[] = { {"hotkey", TYPE_INT32, false, "hotkey modifier"}, {"scale_nearest",TYPE_BOOLEAN,false,"nearest neighbor scaling"}, {"scale_integer",TYPE_BOOLEAN,false,"integer scaling"}, + {"cpuclock", TYPE_INT32, 0, "CPU clock [MHz] of system info"}, {NULL, TYPE_END, false, NULL} // End of list };