From 2b34f2624c26aa4e592854431fc342e1913a018e Mon Sep 17 00:00:00 2001 From: adelikat Date: Mon, 8 Dec 2008 16:45:11 +0000 Subject: [PATCH] Win32 - doloopy code clean up, Memwatch - fix bug in RamChange() --- src/drivers/win/main.cpp | 14 +++++++------- src/drivers/win/memwatch.cpp | 6 +++++- src/drivers/win/sound.cpp | 1 + 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/drivers/win/main.cpp b/src/drivers/win/main.cpp index 2d92d0d1..e01a969b 100644 --- a/src/drivers/win/main.cpp +++ b/src/drivers/win/main.cpp @@ -97,9 +97,8 @@ #endif // External functions -extern std::string cfgFile; -extern bool turbo; -int counter = 0; +extern std::string cfgFile; //Contains the filename of the config file used. +extern bool turbo; //Is game in turbo mode? void ResetVideo(void); void ShowCursorAbs(int w); void HideFWindow(int h); @@ -128,7 +127,8 @@ int pal_emulation = 0; int ntsccol = 0, ntsctint, ntschue; std::string BaseDirectory; int PauseAfterLoad; -unsigned int skippy = 0; //Frame skip +unsigned int skippy = 0; //Frame skip +int frameSkipCounter = 0; //Counter for managing frame skip // Contains the names of the overridden standard directories // in the order roms, nonvol, states, fdsrom, snaps, cheats, movies, memwatch, macro, input presets, lua scripts, base char *directory_names[14] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; @@ -681,14 +681,14 @@ doloopy: if (turbo) { - if (!counter) + if (!frameSkipCounter) { - counter = 15; + frameSkipCounter = 15; skippy = 0; } else { - counter--; + frameSkipCounter--; skippy = 1; } diff --git a/src/drivers/win/memwatch.cpp b/src/drivers/win/memwatch.cpp index fce0068a..8087af6d 100644 --- a/src/drivers/win/memwatch.cpp +++ b/src/drivers/win/memwatch.cpp @@ -923,7 +923,11 @@ void RamChange() if (!RamChangeInitialize) return; for (int x = 0; x < MAX_RAMMONITOR; x++) { - MWRec& mwrec = mwrecs[x]; + int whichRec; + if (x<2) whichRec = x; + else whichRec = x+10; //If ramchange monitor 3 or 4, must use 1st two of 2nd column (12 & 13) + MWRec& mwrec = mwrecs[whichRec]; + if(mwrec.valid && GameInfo) { int whichADDR = 0; diff --git a/src/drivers/win/sound.cpp b/src/drivers/win/sound.cpp index 9dff33e0..79fb4a25 100644 --- a/src/drivers/win/sound.cpp +++ b/src/drivers/win/sound.cpp @@ -394,6 +394,7 @@ static void UpdateSD(HWND hwndDlg) CheckDlgButton(hwndDlg,CHECK_SOUND_GLOBAL_FOCUS,(soundoptions&SO_GFOCUS)?BST_CHECKED:BST_UNCHECKED); CheckDlgButton(hwndDlg,CHECK_SOUND_MUTEFA,(soundoptions&SO_MUTEFA)?BST_CHECKED:BST_UNCHECKED); CheckDlgButton(hwndDlg,CHECK_SOUND_MUTETURBO,(muteTurbo)?BST_CHECKED:BST_UNCHECKED); + // The option formerly flagged by SO_OLDUP can no longer be enabled. // CheckDlgButton(hwndDlg,131,(soundoptions&SO_OLDUP)?BST_CHECKED:BST_UNCHECKED); SendDlgItemMessage(hwndDlg,COMBO_SOUND_QUALITY,CB_SETCURSEL,soundquality,(LPARAM)(LPSTR)0);