* Resets emulator speed / pause states after script exit. */
| 332 | * Resets emulator speed / pause states after script exit. |
| 333 | */ |
| 334 | static void FCEU_LuaOnStop() |
| 335 | { |
| 336 | luaRunning = FALSE; |
| 337 | luazapperx = -1; |
| 338 | luazappery = -1; |
| 339 | luazapperfire = -1; |
| 340 | for (int i = 0 ; i < 4 ; i++ ){ |
| 341 | luajoypads1[i]= 0xFF; // Set these back to pass-through |
| 342 | luajoypads2[i]= 0x00; |
| 343 | } |
| 344 | gui_used = GUI_CLEAR; |
| 345 | //if (wasPaused && !FCEUI_EmulationPaused()) |
| 346 | // FCEUI_ToggleEmulationPause(); |
| 347 | |
| 348 | //zero 21-nov-2014 - this variable doesnt exist outside windows so it cant have this feature |
| 349 | #ifdef __WIN_DRIVER__ |
| 350 | if (fps_scale != 256) //thanks, we already know it's on normal speed |
| 351 | FCEUD_SetEmulationSpeed(EMUSPEED_NORMAL); //TODO: Ideally lua returns the speed to the speed the user set before running the script |
| 352 | //rather than returning it to normal, and turbo off. Perhaps some flags and a FCEUD_GetEmulationSpeed function |
| 353 | #endif |
| 354 | |
| 355 | turbo = false; |
| 356 | //FCEUD_TurboOff(); |
| 357 | #ifdef __WIN_DRIVER__ |
| 358 | TaseditorDisableManualFunctionIfNeeded(); |
| 359 | #endif |
| 360 | } |
| 361 | |
| 362 | |
| 363 | /** |
no test coverage detected