Build Your Own Arcade Controls Forum

Main => Software Forum => Topic started by: Hippo on September 04, 2006, 06:04:39 pm

Title: Looking for Modified Emulators : Esc key friendly
Post by: Hippo on September 04, 2006, 06:04:39 pm
Im looking for the modifed version of Project 64 that allows quitting via the ESC key.

All the links I've found in the search are no longer available.

Dammed interwebs..
Title: Re: Looking for Modified Emulators : Esc key friendly
Post by: Brad on September 04, 2006, 06:07:23 pm
http://www.emuchrist.org/cpviewer/

Brad
Title: Re: Looking for Modified Emulators : Esc key friendly
Post by: Hippo on September 04, 2006, 06:09:28 pm
Your a Gent, Thanks :)

+1 Virtual Cookie for you.
Title: Re: Looking for Modified Emulators : Esc key friendly
Post by: Havok on September 05, 2006, 07:21:20 am
AtomicFE also adds support to use ESC to quit for any emulator it launches...
Title: Re: Looking for Modified Emulators : Esc key friendly
Post by: Macarro on September 05, 2006, 12:17:52 pm
And MALA too ;)
Title: Re: Looking for Modified Emulators : Esc key friendly
Post by: jcrouse on September 05, 2006, 02:49:16 pm
I am curious as to how the dev's do this. I have written apps with keyboard hooks, some of my wrappers, but it just seems like it would be inefficient if the FE is monitoring all the keypress or keydown events looking for the ESC key. Wouldn't you think this would effect input speed (minor lag) for the emulator.

John
Title: Re: Looking for Modified Emulators : Esc key friendly
Post by: swindus on September 05, 2006, 03:29:06 pm
MaLa uses two different methods to do this:

1. A system hook which catch one defined key and close the running process (emu) like your wrappers.

2. Windows hotkeys. With this method MaLa can convert pressed keys to other keys like ESC -> Alt + X for example or terminate the process or just catch the pressed key so that it never reach the emulator.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceui40/html/cerefwm_hotkey.asp

I never noticed any negative effects on input speed with this methods so far. Maybe it depends on the used emulator.
Title: Re: Looking for Modified Emulators : Esc key friendly
Post by: headkaze on September 05, 2006, 08:58:37 pm
GameEx can also use ESC to kill an emu. I have written system wide keyboard hooks myself and it dosn't effect the speed of the emu because you don't need to poll the input at 100% CPU usage. You can sleep() for as long as you want after checking for a keypress and it won't effect the emu. It depends on how you code it I suppose.

BTW You can often re-map keys in an emu's exe using Resource Hacker. For example in VisualBoy advance you can map exit to the ESC key and change menu to ENTER.

Eg.
Code: [Select]
VK_ESCAPE, 40002, NOINVERT, VIRTKEY
VK_RETURN, 40263, NOINVERT, VIRTKEY
Title: Re: Looking for Modified Emulators : Esc key friendly
Post by: jcrouse on September 05, 2006, 09:33:08 pm
GameEx can also use ESC to kill an emu. I have written system wide keyboard hooks myself and it dosn't effect the speed of the emu because you don't need to poll the input at 100% CPU usage. You can sleep() for as long as you want after checking for a keypress and it won't effect the emu. It depends on how you code it I suppose.

BTW You can often re-map keys in an emu's exe using Resource Hacker. For example in VisualBoy advance you can map exit to the ESC key and change menu to ENTER.

Eg.
Code: [Select]
VK_ESCAPE, 40002, NOINVERT, VIRTKEY
VK_RETURN, 40263, NOINVERT, VIRTKEY

I realize this was just an example, but just an FYI, I believe, buriend in the menu's, you can change EVERY key input for Visualboy Advance. I know you can on the knock-offs such as smoth_vba.

John
Title: Re: Looking for Modified Emulators : Esc key friendly
Post by: Howard_Casto on September 06, 2006, 12:52:11 am
GameEx can also use ESC to kill an emu. I have written system wide keyboard hooks myself and it dosn't effect the speed of the emu because you don't need to poll the input at 100% CPU usage. You can sleep() for as long as you want after checking for a keypress and it won't effect the emu. It depends on how you code it I suppose.


But is it an external app or gameex itself that is doing it?  Because if gameex is running, even with sleep, all of the resources (including memory space) are still there taking up space.  That is unless you are doing it some way I don't know of. 

That's why we normally use the wrappers.  They have to be resident too, but they are tiny little apps, so they don't take up much space. 
Title: Re: Looking for Modified Emulators : Esc key friendly
Post by: headkaze on September 06, 2006, 06:00:33 pm
But is it an external app or gameex itself that is doing it?  Because if gameex is running, even with sleep, all of the resources (including memory space) are still there taking up space.  That is unless you are doing it some way I don't know of. 

That's why we normally use the wrappers.  They have to be resident too, but they are tiny little apps, so they don't take up much space. 

I'm not sure how GameEx polls the keyboard since I didn't write it. But Tom being the smart fellow he is, would be aware that having GameEx running in the background even in a low CPU usage state would still take up memory. I've never noticed it slow down any emu on my cab, but he does use a number of DLL's (some of which are written in C++), so perhaps he's used an external utility to poll the keyboard for ESC. It has quite an advanced key re-mapping feature aswell that can be setup on a per emulator basis. That is you can remap any key to something else. I probably shouldn't really speculate as to how it works exactly, because I don't know.
Title: Re: Looking for Modified Emulators : Esc key friendly
Post by: Howard_Casto on September 07, 2006, 08:02:20 am
I would be interested in learning what he is doing then.  Hopefully it's like you say and he's just using a dll or something or else I've totally missed the boat on some sort of technique. 


Key remapping is actually quite easy.  It's even built into windows.  I've just found it to be "dangerous" so I've never looked into implementing it.  It is a way to solve the problem though, remap "key x" to your escape button and boom no more escape isssues.  The only problem is if the emu in question crashes for some reason, the key might get "stuck" and then the user has no clue how to map it back.  An interesting approach though.