Main > Main Forum

Frontend feature req: Display image when emulator paused

<< < (4/5) > >>

Tiger-Heli:
Did some digging and found out I knew more in Oct 2005 than I do now  :laugh2:  http://forum.arcadecontrols.com/index.php?topic=43567.0

1)  AHK only works under Win2K/NT/XP, not Win9x, but you might have read that on my page.

2)  Method 5 should indeed know if MAME is paused or not, so using Joystick left should not be a problem.

3)  Using Method 4 with IrfanView still causes timing issues in MAME, but if you like Method 5, that shouldn't be an issue.

4)  My current script works as follows:
P pauses MAME,
Ctrl, 1, 2, or A (P1B1, Start1, Start2, P2B1) displays the hints,
Esc closes the hints image
P unpauses MAME
Esc exits MAME and unloads the script.

There isn't an image toggle, per se, but I think it could be modded to do this.  It also could be easily modded so that pressing ANY button when the Emu was paused would display the image.  You could even modify it so pressing any button displayed the image and any button took it back down.

4) I suspect that modifying the beginning of the script so it reads (red text added):

~p::
{
   if p_pressed = 1
     p_pressed = 0
send, {Ctrl down}
send, {P down}
send, {P up}   
send, {Ctrl up}
   else
     p_pressed = 1
}

may allow the the script to work with all emulators, but it's a sloppy way to do it.

What the above code does (I think) in words is:

When P is pressed (first), send P to pause the emulator and set the watchdog "P_pressed" so the viewer can be launched.

When P is pressed the second time, send P reset the watchdog, and send Ctrl-P.

MAME will ignore the Ctrl-P combination and if the non-MAME emu ignores the second P press after it is paused, this should work fine, although it's not a very elegant solution.

What you really want to be more elegant is the existing script for MAME and a new script for different unpause emu's with:

p::
{
   if p_pressed = 1
     p_pressed = 0
send, {Ctrl down}
send, {P down}
send, {P up}   
send, {Ctrl up}
   else
     p_pressed = 1
send, {P down}
send, {P up}
}

If you don't want your non-MAME emulators re-mapped so that P both pauses and unpauses them, I think you want the following code (for different unpause key emu's only):

~p::
{p_pressed = 1}
~^P::
{p_pressed = 0}

However, I have much higher confidence in the first two methods working and I have not tested any of this . . .

unclet:
Wow, seems like you have been busy .....  thanks for the effort.    I do not plan on spending time playing around with the script stuff yet.  I need to wrap my jukebox software up .... been working on updating it for about 3 months now (night and weekends).   My wife is giving me looks  ::) , so I really need to get it done. 

Anyway, I quickly looked through my emulators and there are NONE which I have configured which require different keypresses to pause and unpause, although there are some emulators which use some of the following to toggle pause on/off:

1) LAlt
2) Ctrl-P
3) Esc
4) P
5) F1
6) F2
7) F12
8) Backspace

Hopefully altering the script for these keypresses would be possible.   Anyway, I will eventually try out the script stuff on an emulator which uses the "P" to toggle first to verify it works well.   As for other emulators, I use their default key mappings (whatever that is) instead of redefining my own mappings for each (found this to be easier with upgrades, etc..) so this is why a lot of them do not use "P" to pause.

BTW:  I mapped "Backspace" to pause my MAME emulator ....   :D   ... dont remember why I did this .... some reason.

Anyway, I will definitely get back into this a bit later .....  I need to sit down and look into the script stuff so I can understand exactly the changes you are making to determine whether a solution will work for me for all my emulators (or most all of them).

Also ... I am leaving on a four day vacation this afternoon, so I will not be responding for a bit.

I guess the goal would be to have a script which would work with other emulators (some of which use "P" to pause and others which use other keys to pause).  If I can not get this working for the majority of the emulators, then I most likely will not use the script idea (since I do not want a paused image to come up on only some emulators and not others ... confusing), although I believe you are indicating this would be feasible, so it sounds good so far.


 


Tiger-Heli:

--- Quote from: unclet on March 15, 2007, 09:20:38 pm ---Anyway, I quickly looked through my emulators and there are NONE which I have configured which require different keypresses to pause and unpause, although there are some emulators which use some of the following to toggle pause on/off:
1) LAlt
2) Ctrl-P
3) Esc
4) P
5) F1
6) F2
7) F12
8) Backspace

--- End quote ---
I don't see any problem with those keys.  I was thinking there might be some emulators that use Alt-F4 rather than Esc to exit.  (That won't be a problem either.)

What can be a problem is if you have an emulator that uses the same key for pause and exit, but I doubt that you will.


--- Quote ---Anyway, I will definitely get back into this a bit later .....  I need to sit down and look into the script stuff so I can understand exactly the changes you are making to determine whether a solution will work for me for all my emulators (or most all of them).
--- End quote ---

If you mouse over the script code on my webpages, I have "ToolTips" (enable javascript in your browser) that explain what each line of the script does.

One thing I was getting at earlier is that you can re-map keys with the script, but with that many combinations I suspect you are re-mapping your CP with an I-PAC or similar anyway.  At risk of confusing you further -

Let's say you have a button on your control panel mapped to "Backspace" and your emulator currently uses "P" to pause -

You could either:

1)  Modify the emulator so that Pause was activated with Backspace instead of P and set up the script so the keys to display the image were active when Backspace was pressed.  (if the Emu allows you to remap the Pause key).
2)  Modify the I-PAC so that the button mapped to Backspace now sends P when that Emu is called, and set the script up so that P allows the image to be displayed after P is pressed.
3)  Leave the I-PAC and Emu alone and modify the script so that when Backspace is pressed, the script actually sends P to the emulator to pause it and allow the image to be displayed.

Any method is about as easy as any of the others (Option 1 won't work with many Emu's and Option 2 is probably better at this point, as I suspect you already have I-PAC mappings and would want to both change those and configure a new script.)

In closing (for now), just so you are aware - based on the fact that you probably want a different image for each Emu, and most of them use different keys for pause, and what  I can tell about Mala, I fully expect that you will end up with:

1)  A slightly different version of the script for each emulator that you use.
2)  A different batch file that will be used to call each emulator.
3)  Modifications to Mala to call the different batch files (might not be required if you are already using Mala to call batch files to re-config the I-PAC prior to launching the emu - in which case you would just mod your existing batch file to add a call to start the script.)
4)  Scripts are usually a trial-and-error thing for me.  Modify this, try it out, didn't work, change this, almost works, change this - Golden!!!.

The good side to this:

1) Can be done in stages - Absolutely no reason you can't get this working for Z26 and still play your MAME games, then add it for ZSNES, then add it for MAME - etc.
2) Should be easier to add for other Emu's once you get the first one added.
3) Once you get it set up - you will have a consistent setup for ALL your Emu's and it should be easy for the user to understand.  For example, you could pretty easily end up with this setup (in ANY Emu) (I am going to assume you have a dedicated orange pause button and red exit button, but if you use the I-PAC shift function you can continue doing that as well).

a)  Press Orange button to pause game.
b)  Press any other button on the CP to display the controls (even the red one) (on a per-game basis if the Emu uses different controls for different games)
c)  Press any button besides the orange one to return to the paused game.
d) Press the orange button again to unpause the game.
e) Press the red button to exit back to Mala.
f)  Select any other game to play and continue.

Just post back in here when you get ready to spend some time with this.  (Hopefully I'll remember better what I did next time around).

unclet:
Thanks for the information.  I will definitely get back in touch when the time comes.   

Now, just to share my thoughts ....

MALA has a separate section for keyboard encoder files.  It allows a keyboard encoder configuration file to be associated with an emulator or with specific games within an emulator's game list.  This is not a BAT file, but rather the file which is used to remap the keyboard encoder key settings.   I have separate keyboard encoder files for each emulator and for each separate PC game on my cabinet.  I use the Hagstrom KE72 encoder by the way.

Also, MALA allows for a BAT file (or anything really) to be executed prior to launching the specific emulator.   It seems I can simply create a BAT file to launch the associated script, which would then in turn launch the emulator if I understand you correctly ....... this seems fine.

I believe MALA first executes any associated keyboard encoder configuration file then proceeds to execute any command line commands (ie: BAT files, etc..)  associated with the emulator, then finally launches the emulator.   It might do other stuff in there like playing sounds, showing an image before hand, etc.... but I do not use that stuff.

Regarding (1) ...... Some of the emulators I have configured do not let the user remap stuff.  Plus I really like using the default settings which come with the emulator.  This makes updating certain emulators a lot easier sicne I can simply install a new version of the emulator and not have to remap anything since I am using the default mappings.  This is particularly nice to do since I have 30+ emulators so decreasing the amount of churn required is nice.

Regarding (2) ....... I do not want to change my keyboard encoder mappings (since they represent the default configurations of the emulator).

Regarding (3) ......  This seems a lot easier to me.  I will not have to change any existing keyboard encoder or emulator key mappings.   I can just simply create separate script files for each emulator.   A lot easier to maintain once the files are created.  Basically, if I had to reinstall all my emulators a few years down the road, then I do not have to remember how each special keyboard encoder or emulator needs to be mapped.   I can simply use the default settings of the emulator and use the associated AHK script already created right away to get pause working again.   I believe one script per emulator is the way to go.   


loadman:
Nice to see you 'active' again UNCLET  ;D

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version