Win32 - Lua - speedmode("turbo") now sets turbo on, rather than setting to max speed. Turbo employs frame-skipping (therefore has a different (and faster) effect than speed maximum.

This commit is contained in:
adelikat 2009-02-23 15:35:21 +00:00
parent 9a4b12d5a7
commit 2e97fa8f53
3 changed files with 17 additions and 11 deletions

View File

@ -1,4 +1,5 @@
---version 2.0.4 yet to be released---
22-feb-2009 - adelikat - win32 - Lua - made speedmode("turbo") turn on turbo (which employs frameskipping) rather than max speed
22-feb-2009 - adelikat - Increased lua gui.text height (and DrawTextTransWH() height)
21-feb-2009 - adelikat - win32 - Lua - Added -lua commandline argment, loads a lua script on startup
21-feb-2009 - adelikat - win32 - Debugger - Added pixel display after scanline display - Thanks to DWEdit for this patch

View File

@ -1059,18 +1059,16 @@ void CollapseWindow(void)
{
wrect.right = (wrect.right - ((wrect.right-wrect.left)/2));
MemWCollapsed = true;
SetDlgItemText(hwndMemWatch, MEMW_EXPANDCOLLAPSE, ">"); //Put Address value
SetDlgItemText(hwndMemWatch, MEMW_EXPANDCOLLAPSE, ">");
ChangeMemwMenuItemText(MEMW_OPTIONS_EXPANDCOLLAPSE, "&Expand to 2 columns");
}
else
else //Else expand it
{
wrect.right = (wrect.right + (wrect.right-wrect.left));
MemWCollapsed = false;
SetDlgItemText(hwndMemWatch, MEMW_EXPANDCOLLAPSE, "<"); //Put Address value
SetDlgItemText(hwndMemWatch, MEMW_EXPANDCOLLAPSE, "<");
ChangeMemwMenuItemText(MEMW_OPTIONS_EXPANDCOLLAPSE, "&Collapse to 1 column");
}
SetWindowPos(hwndMemWatch,NULL,MemWatch_wndx,MemWatch_wndy,(wrect.right-wrect.left),(wrect.bottom-wrect.top),NULL);
SetWindowPos(hwndMemWatch,NULL,MemWatch_wndx,MemWatch_wndy,(wrect.right-wrect.left),(wrect.bottom-wrect.top),NULL);
}

View File

@ -149,7 +149,10 @@ static void FCEU_LuaOnStop() {
gui_used = GUI_CLEAR;
if (wasPaused && !FCEUI_EmulationPaused())
FCEUI_ToggleEmulationPause();
FCEUD_SetEmulationSpeed(EMUSPEED_NORMAL);
FCEUD_SetEmulationSpeed(EMUSPEED_NORMAL); //TODO: Ideally lua returns the speed to the speed the user set before running the script
#ifdef WIN32 //rather than returning it to normal, and turbo off. Perhaps some flags and a FCEUD_GetEmulationSpeed function
FCEUD_TurboOff(); //Turn off turbo
#endif
}
@ -282,11 +285,15 @@ static int fceu_speedmode(lua_State *L) {
luaL_error(L, "Invalid mode %s to FCEU.speedmode",mode);
//printf("new speed mode: %d\n", speedmode);
if (speedmode == SPEED_NORMAL) FCEUD_SetEmulationSpeed(EMUSPEED_NORMAL);
else FCEUD_SetEmulationSpeed(EMUSPEED_FASTEST);
if (speedmode == SPEED_NORMAL)
FCEUD_SetEmulationSpeed(EMUSPEED_NORMAL);
#ifdef WIN32
else if (speedmode == SPEED_TURBO) //adelikat: Making turbo actually use turbo in Win32.
FCEUD_TurboOn(); //In Win32, turbo and max speed are two different results. Turbo employs frame skipping and sound bypassing if mute turbo option is enabled.
#endif //This makes it faster but with frame skipping. Therefore, maximum is still a useful feature, in case the user is recording an avi or making screenshots (or something else that needs all frames)
else
FCEUD_SetEmulationSpeed(EMUSPEED_FASTEST); //TODO: Make nothrottle turn off throttle, or remove the option
return 0;
}