Show: Today's Messages :: Show Polls :: Message Navigator |
Pause on focus loss [message #5818] | Wed, 20 March 2019 07:33 | |||
| ||||
In other emulators when it is inactive it will pause itself automatically. Is there a feature like this in mednafen? | ||||
|
Re: Pause on focus loss [message #5819 is a reply to message #5818 ] | Sun, 24 March 2019 18:57 | |||
| ||||
Hi there, even though I'm not a mednafen programmer I might help you with that. Can you manage to compile mednafen's latest release (1.22.1)? For a quick and dirty patch you only have to add the following lines to src/drivers/main.cpp at line 1524: PauseGameLoop(0); And into line 1530 (or 1529 if have not patched the aforementioned) : PauseGameLoop(1); You can only patch the second item if you want the emulator to only pause on lost focus and have to un-pause manually when you get back, to avoid sound spouting unadvertedly after alt-tabbing back into it. I'll try to make it into a configuration setting and if everything goes as planned I might attach a patch file (maybe even submit it) anytime soon. | ||||
|
Re: Pause on focus loss [message #5820 is a reply to message #5818 ] | Sun, 24 March 2019 19:43 | |||
| ||||
Here's the two diff files, apply those patches and get an auto-pause version of mednafen. There are 2 new configuration settings called "focus_pause" that pauses the game when focus is lost and "focus_resume" to resume upon focus. Beware that for some reason I just discovered that my mednafen pause-emulator button is not working, neither for pausing/resuming, I don't know why, regardless the auto-resume is working a-ok. To patch, on Linux, you can issue "patch -t src/mednafen.cpp <path-to-mednafen.cpp.diff>" and "patch -t src/drivers/main.cpp <patch-to-main.cpp.diff>"
(Size: 0.14KB, Downloaded 115 time(s)) Attachment: mednafen.cpp.diff (Size: 0.27KB, Downloaded 110 time(s)) | ||||
|
Previous Topic: | Debugger (Wonderswan text routine) |
Next Topic: | [SSaturn] Decreased Performance in Build 1.22.1 in Specific Games |