From b71b1679eb8bf971c2f1365f7968482324a68e7a Mon Sep 17 00:00:00 2001 From: adelikat Date: Sun, 23 Nov 2008 03:10:09 +0000 Subject: [PATCH] Win32-turbo now works with VBlank sync options. Fix warning in memwatch.cpp. Added Cheats Hotkey Menu Item update. --- changelog.txt | 1 + src/drivers/win/input.cpp | 13 +++++++++++++ src/drivers/win/memwatch.cpp | 2 +- src/drivers/win/window.cpp | 5 +++++ 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/changelog.txt b/changelog.txt index 5bcb15a9..a780415b 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,5 @@ ---version 2.0.4 yet to be released--- +22-nov-2008 - adelikat - win32 - fixed so that turbo works with VBlank sync settings 21-nov-2008 - qfox - Lua - added joypad.write and joypad.get for naming consistency. Added plane display toggle for lua: FCEU.fceu_setrenderplanes(sprites, background) which accepts two boolean args and toggles the drawing of those planes from Lua. Changed movie.framecount() to always return a number, even when no movie is playing. Should return the same number as in view; the number of frames since last reset, if no movie is playing. 17-nov-2008 - adelikat - added Open Cheats hotkey (currently a windows only function) 16-nov-2008 - adelikat - win32 - menu items that are hotkey mappable show the current hotkey mapping diff --git a/src/drivers/win/input.cpp b/src/drivers/win/input.cpp index a9f6f1e7..0f95e05b 100644 --- a/src/drivers/win/input.cpp +++ b/src/drivers/win/input.cpp @@ -40,6 +40,8 @@ LPDIRECTINPUT7 lpDI=0; void InitInputPorts(bool fourscore); +int tempwinsync = 0; +extern int winsync; //UsrInputType[] is user-specified. InputType[] is current // (game/savestate/movie loading can override user settings) @@ -1476,16 +1478,27 @@ int FCEUD_TestCommandState(int c) void FCEUD_TurboOn (void) { + tempwinsync = winsync; //Store winsync setting + winsync = 0; //turn off winsync for turbo (so that turbo can function even with VBlank sync methods + turbo = true; if (muteTurbo) TrashSound(); } void FCEUD_TurboOff (void) { + winsync = tempwinsync; //Restore winsync setting turbo = false; if (muteTurbo) InitSound(); } void FCEUD_TurboToggle(void) { + if (turbo) winsync = tempwinsync; //If turbo was on, restore winsync + else + { + tempwinsync = winsync; + winsync = 0; //If turbo was off, turn off winsync (so that turbo can function even with VBlank sync methods + } + turbo = !turbo; if (muteTurbo) { diff --git a/src/drivers/win/memwatch.cpp b/src/drivers/win/memwatch.cpp index 334307c5..43dd63a8 100644 --- a/src/drivers/win/memwatch.cpp +++ b/src/drivers/win/memwatch.cpp @@ -710,7 +710,7 @@ static BOOL CALLBACK MemWatchCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA //Initialize RAM Change monitor globals - for (int x; x < MAX_RAMMONITOR; x++) + for (int x = 0; x < MAX_RAMMONITOR; x++) { editnow[x] = 0; editlast[x]= 0; diff --git a/src/drivers/win/window.cpp b/src/drivers/win/window.cpp index 9b016939..1e8dfd6b 100644 --- a/src/drivers/win/window.cpp +++ b/src/drivers/win/window.cpp @@ -1897,6 +1897,11 @@ void UpdateMenuHotkeys() ChangeMenuItemText(MENU_DISPLAY_OBJ, combined); //-------------------------------Tools-------------------------------------- + //Open Cheats + combo = GetKeyComboName(FCEUD_CommandMapping[EMUCMD_TOOL_OPENCHEATS]); + combined = "&Cheats...\t" + combo; + ChangeMenuItemText(MENU_CHEATS, combined); + //Open Memory Watch combo = GetKeyComboName(FCEUD_CommandMapping[EMUCMD_TOOL_OPENMEMORYWATCH]); combined = "&Memory Watch...\t" + combo;