Quit Without Pause?

If you're having problems with Snes9x, or think you've found a bug, this is the place to be.
Post Reply
Krues8dr
Snes9x White Belt
Posts: 3
Joined: Mon Apr 26, 2010 4:26 pm

Quit Without Pause?

Post 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!
User avatar
zones
Official Mac OSX Porter/Dev
Posts: 908
Joined: Sat May 15, 2004 11:58 pm
Location: Japan

Post by zones »

It's by design by me, to prevent accidental quitting. Probably Mac only.
Krues8dr
Snes9x White Belt
Posts: 3
Joined: Mon Apr 26, 2010 4:26 pm

Post 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!
Krues8dr
Snes9x White Belt
Posts: 3
Joined: Mon Apr 26, 2010 4:26 pm

Post 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. ;)
Post Reply