Page 1 of 1

Quit Without Pause?

Posted: Wed Apr 28, 2010 7:39 pm
by Krues8dr
Hi everybody, I've been using SNES9X for years, but I'm new to the forums, so I apologize if I'm not posting this in the right place.

I'm running 1.52 for Mac 10.5.8 (2Ghz Core 2 Duo / 3Gb RAM), but I've experienced this issue with every version I've used. I've recently started playing with XBMC as a media center, and trying to get SNES9X to work as my primary SNES emulator therein (because, you know, it's the best). The problem is that it requires the emulation to be paused before quitting the emulator, unlike most every other emulator I've run into. There's just no easy way to do this in a keyboard-less setup; I can easily send a Command-Q with the remote, but two keystrokes on a per-application basis is crazy-whack.

I was wondering if there's any way around this, or if there's some technical reason why this limitation exists? Or is this a Mac-version-only thing? I'm pretty handy with code, is it worth me trying my hand at hacking the limitation out of the source and rolling my own?

Thanks for any help you all can provide!

Posted: Wed Apr 28, 2010 10:58 pm
by zones
It's by design by me, to prevent accidental quitting. Probably Mac only.

Posted: Thu Apr 29, 2010 1:06 am
by Krues8dr
Great, so there's no technical challenge to removing it then? I'll start hacking on the source you posted with the 1.52 links. Thanks!

Posted: Thu Apr 29, 2010 2:08 am
by Krues8dr
Ok, here's what I did to get it to work. (Sorry if my noob hacking is a mess.)

In mac-os.cpp, OSStatus SubEventHandler(), I added a case in the cmd.commandID switch that looks like:

case 'quit': // Quit SNES9X
running = false;
while (s9xthreadrunning)
sleep(0);

SNES9X_Quit();

break;

And then I commented out the disabling of the menu item in AdjustMenus(). Seems to work ok. Console isn't showing anything bad, but I'm not altogether sure that I haven't created a memory leak unknowingly or anything. ;)