Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Frontend feature req: Display image when emulator paused  (Read 6432 times)

0 Members and 1 Guest are viewing this topic.

unclet

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3561
  • Last login:March 17, 2025, 11:51:15 am
Frontend feature req: Display image when emulator paused
« on: March 15, 2007, 08:52:24 am »
.....this post was created since I did not want to hijack Paige's post any longer   :P


Quote
Quote
Tiger-Heli
I have images of my control panel mappings for all of my 30+ non-mame emulators.  I am just waiting for some frontend (MALA hopefully) to offer the ability to display an image when the emulator is paused.  I do not know of any frontend which does this yet.   Since I am mainly interested in being able to view the control panel mapping image when the game is paused (instead of before the game starts), I have not looked into using Johnny5 or CPViewer, but rather simply show the image manually now (ie: get it out and place it on the table next to the cabinet).



What you want can be done fairly easily, but not through a frontend, AFAIK, and since different emulators support different methods for pause, I doubt it will be incorporated anytime soon.

My page will tell you basically how to do it, though.  Here are some hints:

First off - Emuloader (and I'm fairly sure Mala) will allow you to display the image before you launch the game.  In EL you scroll through what image is displayed - I have Titles, Snaps, Marquees, CP's, Instruction Cards, and finally CP Hints, which is my Johnny5 images.  In MameWah (or I think Mala), you would have to design this into your layout bezel, but it can be easily done.  I'm attaching a quick Photochop based on shock_'s excellent mala layouts just to give you an idea of the concept.

As far as displaying your image when a game is paused, you just need to combine several of the concepts on my page.

For MAME, you can use BuddaMAME (not sure what the latest version is), but the image is scrunched for vertical games.  I cover that on the bottom of the main page.  http://www.mameworld.net/tigerheli/johnny/static.htm

Howard Casto wrote an AHK script to lauch Johnny 5 when MAME was paused and then go back to MAME, but I don't think we ever resolved timing issues with it.  (Sometimes MAME would not pause when Johnny5 was displayed, sometimes Johnny5 would come up and exit, but MAME would remain paused).  I explain that here: http://www.mameworld.net/tigerheli/johnny/ahk_hc.htm  (I don't think I mention it on the page, but this script will work with any full-screen emulator that uses P to pause, not just MAME.  You could easily change the places where P is called out to some other key to make it work with Emu's that use a different pause key.)  (I don't know if other emulators will have the same timing issues as MAME did (does?) or not.  Howard Casto could likely tell you.  IMS, it was pretty much specific to MAME.

An alternative that I came up with was to have MAME pause normally and then have a different hotkey to call Johnny5.  I cover that here:  http://www.mameworld.net/tigerheli/johnny/ahk_th.htm  This is just a modification of Howard's script, so it also could be used with any emulator.

The final piece is that you want to display static images rather than setting up Johnny5.  On this page, I explain how to use Irfanview to display a static image prior to launching MAME: http://www.mameworld.net/tigerheli/johnny/static.htm and further down, I even mention how to modify the above scripts to call Irfanview and display the images rather than launching Johnny5 (See AHK SCRIPT INTEGRATION on the page above).


Thanks for the details, but that is just my point .... way too much configuring to get an image to show up.   Did not even realize there was timing issues to worry about as well.   Also, I would like it to work no matter which key sequence causes the emulator to pause ... not just via the "P" key.

Displaying an image of a control panel (or any image really ...  an instructional card, picture of my pet, etc..) is nice before the game starts, however, I am much more interested in being able to display an image when the game is paused.  The image displayed should be fullscreen and should not have to be integrated into a skin used for a particular frontend (ie: simply show an image file fullscreen).   I am not expecting frontends to have to be able to calculate or show the key mappings for various emulators, but simply to show an image file fullscreen.   The image file might just be a picture stating "PAUSED, drank to much beer, be back soon" ... or in my case, the image would be a picture of the control panel showing the key mappings for a particular emulator.     Emulators other than Mame really do not change there key mappings from game to game, so a static image showing the key mappings can be used for all games.  Now, if a person (like myself) grouped all their PC games within one emulator game list, then there would be a need to display an image on a per game basis, but this should nto be very hard for a frontend to do as well.   Simply have the frontend add an additional option to indicate whether one main image should be used for "all" games in the game list or whether an image should be used on a "per-game" basis (image file name would match the game name in this case of course).

I do not understand why a frontend has not implemented this yet, seems very easy to me.   All it would take would be to configure the frontend with which key (P) or keys (Ctrl-P) is used to pause the emulator.   The frontend would then monitor the keypresses entered in the window in which the emulator was running (or for that matter, any keypresses entered on the whole system .... since when playing a game, it can be assumed the game is being played in fullscreen mode, so any keypresses must be related to the game being played).  Anyway, when the key sequence has been entered, the frontend sends the pause key sequence to the emulator (ie: lets the entered keypresses go through to the emulator just like any other entered keypresses do when playing a game) thus pausing the game, but then the frontend can then display the image.   When the remove-from-pause key sequence (ie: some emulators have a different key sequence to un-pause a game ... believe it or not)  is entered, then the frontend can remove the image and pass the keypresses to the game as normal, which will un-pause the game.

Basically, it seems the frontend just has to offer key mappings for Pause and UnPause sequences then hook the keyboard for the system looking for those keypresses to display (or remove) and image.   

I will wait until some frontend offers this functionality instead of trying to setup many different types of control panel viewers.

PS:  Although I appreciate the work which went into Johnny5, I believe it is best suited for 2-player control panels.   Trying to display everything on a four player control image background was getting a bit crazy looking, especially when all the labels started scrolling the text.  Plus if I ever had to reinstall my arcade cabient, I would not want to have to remember how to reinstall/configure a control panel viewer.  I would just like to have a nice frontend GUI to configure only
« Last Edit: March 15, 2007, 09:17:28 am by unclet »

leapinlew

  • Some questionable things going on in this room with cheetos
  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7919
  • Last login:June 29, 2025, 08:37:44 pm
Re: Frontend feature req: Display image when emulator paused
« Reply #1 on: March 15, 2007, 09:16:03 am »
I do not understand why a frontend has not implemented this yet, seems very easy to me.   

I would guess it hasn't been implemented because it's not that big of a deal and has a very low request rate (This is the first time I've heard of someone wanting this)

Also, I don't think it's that practical. When I pause it - it's for 2 reasons.

  • I need to do something real quick (grab a drink, bathroom, etc.)
  • I want to show someone something on the screen

If an image popped up of the control panel(or any image), I wouldn't be able to show what I had on the screen. In Mala, I can hit a button and display the original control panel before I launch a game. Thats more than good enough for what most folks do.


unclet

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3561
  • Last login:March 17, 2025, 11:51:15 am
Re: Frontend feature req: Display image when emulator paused
« Reply #2 on: March 15, 2007, 09:30:40 am »
I can understand that rational perfectly, but when people play games which have many button mappings (ie: Nintendo 64, various PC games, etc..) then it is very easy for a person (especially small children) to forget the key mappings.   If you mainly play a few games on your cabinet then you will not have any problem remembering the key mappings, but when my kids play multiple games from many different emulators then it would be nice to see the mappings when the game is paused. 

One big thing is when my children's friends come over and play, they all wait there turn to play the game everyone is playing at the time.  Usually, one child will play one level, then the next child will come in and start the next level, etc.....  basically they take turns.   Thing is, when a child enters the game in middle, they always ask what keys do what ..... I would rather them be able to see the key mappings when the game is paused.

Again, I see your point, but since I think this is rather an easy addition to any frontend, I decided to throw the idea out there ......   Actually, I am hoping to convince Swindus (MALA creator) to put this feature request high on his list.  If not, then I will just keep showing the kids printed copies of the key mapping images, since I do not plan on switching frontend now ..... spent a lot of time configuring everything to work with MALA .... and I am happy with MALA a lot.

PS:  Now, in order to see the game display when the game is paused instead of always seeing an image (to show your friends something on the screen when the game is paused), the frontend  could offer the additional feature of cycling between the "image" and the "paused game display screen", until the game is unPaused ...... good idea.  Should not be that hard to implement either.   The frontend will know the game is paused since it was monitoring for the pause sequence, and can offer an additional key mapping (to be used when the game is paused) to cycle between the image and game screen.  Basically a person could pause the game, then use their joystick left/right to cycle through the pause screens ......
« Last Edit: March 15, 2007, 09:35:39 am by unclet »

Tiger-Heli

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5447
  • Last login:January 03, 2018, 02:19:23 pm
  • Ron Howard? . . . er, I mean . . . Run, Coward!!!
    • Tiger-Heli
Re: Frontend feature request: Display image when emulator is paused
« Reply #3 on: March 15, 2007, 09:48:17 am »
Mods - this would get more traction in the Software forum. . .

Quote
Thanks for the details, but that is just my point .... way too much configuring to get an image to show up.   Did not even realize there was timing issues to worry about as well.

Unclet - not to be rude, and not that I've never done the same thing, but you are asking for my help with doing something, I am telling you exactly how to do it, and then you are complaining about not being able to do what you want without even TRYING my suggestion.  If you don't want my help that's fine, but what you want to do can be setup in fifteen minutes with AHK, and I seriously doubt a FE author is going to implement it for you, and even if they did, it would take you as long to configure the FE with the new features and get it working as it does to setup the AHK script.

Quote
Displaying an image of a control panel (or any image really ...  an instructional card, picture of my pet, etc..) is nice before the game starts, however, I am much more interested in being able to display an image when the game is paused.  The image displayed should be fullscreen and should not have to be integrated into a skin used for a particular frontend (ie: simply show an image file fullscreen).

If you look at my previous reply - I said it could be shown before the game starts or in the skin for the front-end, but I also explained how to use the same methods to show it in game.

Quote
Simply have the frontend add an additional option to indicate whether one main image should be used for "all" games in the game list or whether an image should be used on a "per-game" basis (image file name would match the game name in this case of course).

I am most familiar with Emuloader.  EL (and most any frontend) allows you to pass the gamename to a batch file or to a command line issued prior to launching the emulator.  If you want one image for all games (say you are using Z26, so all your Atari 2600 games use an image called 2600.png, you just modify the ahk script to display 2600.png instead of calling %1.png which would be the game name.)

Alternately, if this can't be done (and the only way it wouldn't work would be if your frontend didn't allow you to call different batch file or pre-emulator launch commands for different games in the same game list) . . . the simple alternative would be to create a simple batch file to copy your 2600.png image to multiple images based on your z26 gamename - i.e. 2600.png becomes game1.png, game2.png, etc.

Quote
I do not understand why a frontend has not implemented this yet, seems very easy to me.   All it would take would be to configure the frontend with which key (P) or keys (Ctrl-P) is used to pause the emulator.   The frontend would then monitor the keypresses entered in the window in which the emulator was running (or for that matter, any keypresses entered on the whole system .... since when playing a game, it can be assumed the game is being played in fullscreen mode, so any keypresses must be related to the game being played).

You just nailed the reason FE have not implemented this yet.  An FE will have a hard time monitoring for a certain key combination to be pressed, and most FE's are concerned about the FE itself slowing down or affecting gameplay.  Having the FE monitoring keypresses during the emulator execution could only increase these concerns.  OTOH, AHK can do this quite easily, will work with virtually any FE, and keeps the FE developer from having to concern himself with it.

Quote
When the remove-from-pause key sequence (ie: some emulators have a different key sequence to un-pause a game ... believe it or not)  is entered, then the frontend can remove the image and pass the keypresses to the game as normal, which will un-pause the game.

Okay, now you're adding yet another wrinkle into the mix for FEdev's to deal with.  I ran into this with Train Simulator.  It uses one key to activate sanding "X" and another combo "Shift-X" to de-activate it.  I tried writing an AHK script to send "X" whenever "Shift-X" was pressed, but didn't get it to work.  I am pretty sure Howard C would be able to modify his script so that it called Johnny 5 when P was pressed and returned to the emulator when Ctrl-P was pressed, but I don't know how to do it.  Once that is done it's a simple matter to modify it to call IrfanView rather than Johnny5, but I suggest you get it working on an emulator that uses the same keys for pause and unpause, before I bother Howard to modify his script for something that I will likely never use.

Quote
Basically, it seems the frontend just has to offer key mappings for Pause and UnPause sequences then hook the keyboard for the system looking for those keypresses to display (or remove) and image.

Which is exactly what the AHK scripts with the modifications will do for you without involving the FE authors.

Quote
I will wait until some frontend offers this functionality instead of trying to setup many different types of control panel viewers.

You don't need to set up any control panel viewers.  I already explained you will be modifying my (Howard's) AHK script to call IrfanView and display your image rather than calling Johnny5.  Maybe some FE Dev will surprise me, but otherwise, I suspect you may have quite a long wait . . .

Quote
PS:  Although I appreciate the work which went into Johnny5, I believe it is best suited for 2-player control panels.   Trying to display everything on a four player control image background was getting a bit crazy looking, especially when all the labels started scrolling the text.

Well . . . Trying to display button functions of a four-player panel on any static image as reasonable screen resolution is going to be difficult, but I will grant that J5 is likely geared toward 2-Player panels - although it is also Howard C's app, so that is just my opinion as an end-user.

It's not what you take when you leave this world behind you, it's what you leave behind you when you go. - R. Travis.
When all is said and done, generally much more is SAID than DONE.

Tiger-Heli

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5447
  • Last login:January 03, 2018, 02:19:23 pm
  • Ron Howard? . . . er, I mean . . . Run, Coward!!!
    • Tiger-Heli
Re: Frontend feature req: Display image when emulator paused
« Reply #4 on: March 15, 2007, 09:49:30 am »
PS:  Now, in order to see the game display when the game is paused instead of always seeing an image (to show your friends something on the screen when the game is paused), the frontend  could offer the additional feature of cycling between the "image" and the "paused game display screen", until the game is unPaused ...... good idea.  Should not be that hard to implement either.   The frontend will know the game is paused since it was monitoring for the pause sequence, and can offer an additional key mapping (to be used when the game is paused) to cycle between the image and game screen.  Basically a person could pause the game, then use their joystick left/right to cycle through the pause screens ......
That's what my Method 5 allows . . .
It's not what you take when you leave this world behind you, it's what you leave behind you when you go. - R. Travis.
When all is said and done, generally much more is SAID than DONE.

unclet

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3561
  • Last login:March 17, 2025, 11:51:15 am
Re: Frontend feature req: Display image when emulator paused
« Reply #5 on: March 15, 2007, 11:22:36 am »
Ok, clearly I did not read your recommendation correctly ..... can I pled insanity    :dizzy:

I will look into the AFK script as well as IrfanView .... thanks for explaining everything twice for me      :angel:

I am going away on vacation and will not be back for 4 days, but I will put this on my list of things to look into ...... just after finishing up my jukebox software ..... thanks again for setting me straight.

Tiger-Heli

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5447
  • Last login:January 03, 2018, 02:19:23 pm
  • Ron Howard? . . . er, I mean . . . Run, Coward!!!
    • Tiger-Heli
Re: Frontend feature req: Display image when emulator paused
« Reply #6 on: March 15, 2007, 11:30:55 am »
Again, I see your point, but since I think this is rather an easy addition to any frontend, I decided to throw the idea out there ......   Actually, I am hoping to convince Swindus (MALA creator) to put this feature request high on his list.  If not, then I will just keep showing the kids printed copies of the key mapping images, since I do not plan on switching frontend now ..... spent a lot of time configuring everything to work with MALA .... and I am happy with MALA a lot.
Again, at the risk of coming off as a know-it-all jerk, which is not my intent - your original request was for a front-end to enable this.  Your comment above states that you have Mala configured the way you want it and don't plan to change to something else.  That doesn't give any frontend authors besides Swindus much incentive to develop a feature that likely only you will use.

I can't code MALA, but again, I am fairly certain you can get the current version of Mala to do what you want using AHK.  (I just looked at Mala's setup web page and it looks like it has a "Custom Command Line" feature.  You would simply modify this to launch a batch file that runs the AHK script and then launches MAME to start the game.  (Or other emulator).

If you don't understand what I suggested, reply back and I will try to explain better how to get it to do what you want.

It's not what you take when you leave this world behind you, it's what you leave behind you when you go. - R. Travis.
When all is said and done, generally much more is SAID than DONE.

unclet

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3561
  • Last login:March 17, 2025, 11:51:15 am
Re: Frontend feature req: Display image when emulator paused
« Reply #7 on: March 15, 2007, 11:51:33 am »
I guess I just came up with the subject line based on the topic we were talking about when I decided to move the topic out of Paige's thread into this post.   Not really a request from me to have other frontend developers to make this feature for me since I plan on staying with MALA, although others might have shown interest ..... until they discover the AFK script stuff you are referring to.

Hey, is the AFK script a standalone script or is it part of Johnny5 ..... I need to look at Howard's site and read what you receommend evetnually ..... thanks.
« Last Edit: March 15, 2007, 11:55:36 am by unclet »

Tiger-Heli

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5447
  • Last login:January 03, 2018, 02:19:23 pm
  • Ron Howard? . . . er, I mean . . . Run, Coward!!!
    • Tiger-Heli
Re: Frontend feature req: Display image when emulator paused
« Reply #8 on: March 15, 2007, 11:59:23 am »
Ok, clearly I did not read your recommendation correctly ..... can I pled insanity    :dizzy:
Apparently you were typing at the same time I was.  No problem.

Quote
I will look into the AFK script as well as IrfanView .... thanks for explaining everything twice for me      :angel:

No problem.  First thing is to decide how you want this to work!  I.e. do you want the emulator to display your hints immediately when paused or do you want it to pause normally and then you have to move a joystick to display your image.

Things that I am not sure of, but I think we can find workarounds for:

1)  As I said, MAME had timing issues when calling Johnny5 immediately on pausing.  Johnny5 does a lot of stuff, so it takes a while to render an image and then to exit again.  Calling IrfanView should be much quicker, so it might not have the timing issues that MAME does.  And other emu's might not have these issues at all.  (I don't currently have my system set up to use these scripts anymore, but I do have static images of my layouts, so I can set up a test of this and see if timing issues exist, but no promises that I'll have that working before you are ready to do it yourself.

2)  I set my script (Method 5) up to display the image when F7 was pressed, but don't remember for sure if I had a check in there to only have F7 activate it when MAME was paused.  (You wouldn't normally press it anyway during a game, so it didn't matter in my case, but if you wanted pause and joystick left to activate it, you wouldn't want the layout popping up each time you moved the stick to the left).  I think I had it set up where it was only active when MAME was paused, but it's been a couple of years since I did any development or work with it.

3 and 4)  My method 5 is set up so the same key is used to display the image as to go back to the pause screen.  So it would be - Pause button pauses emulator, Joystick left (or right) displays image, Joystick left (or right) again returns to pause screen.  Pause unpauses emulator.  If you wanted left to display the image and right to remove it rather than left-left, I would need to get Howard C to look at what needs to be changed on the script.  Similarly, if you go with Method 4 (Pause immediately brings up the image) we will need Howard C's help for the emulators that use a different key to unpause the emu.

Personally, I like Method 5 for similar reasons to what leapinlew said: 1)  If I am in the middle of a firefight and need to leave or don't know what the controls are and pause the game and an image pops up, I no longer know that a fireball is coming down from the left, so I need to move right to duck it, and I will end up losing a life.  2)  Is probably a bit easier to implement and avoids MAME timing issues, although we still may need HC's help for emu's that use different pause/unpause keys.  I have no problem with asking him for help, but want to get further along to make sure this works for you before we involve him in this.

Quote
I am going away on vacation and will not be back for 4 days, but I will put this on my list of things to look into ...... just after finishing up my jukebox software ..... thanks again for setting me straight.

Take your time, and let me know if you get stuck along the way!
It's not what you take when you leave this world behind you, it's what you leave behind you when you go. - R. Travis.
When all is said and done, generally much more is SAID than DONE.

Tiger-Heli

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5447
  • Last login:January 03, 2018, 02:19:23 pm
  • Ron Howard? . . . er, I mean . . . Run, Coward!!!
    • Tiger-Heli
Re: Frontend feature req: Display image when emulator paused
« Reply #9 on: March 15, 2007, 12:12:23 pm »
Hey, is the AFK script a standalone script or is it part of Johnny5 ..... I need to look at Howard's site and read what you receommend evetnually ..... thanks.
AHK - AutoHotKey, not AFK.

It is standalone.  The AHK script takes care of monitoring keypresses, pausing MAME and calling Johnny5 when P is first pressed, then exiting Johnny5 and unpausing MAME when P is pressed again, etc., then exiting from memory when MAME quits.  That is the reason that it is so simple to modify the script to simply call IrfanView to display your image full screen rather than calling Johnny5.

The main advantage Johnny5 gives you is that if you change your key assignments in MAME, it will automatically pick those up and you don't have to create new static images.  (Also saves HD space by doing so, but that's usually not much of a concern anymore.

One caveat - I wrote my pages a couple of years ago using Beta 14 or something of Johnny5.  Several of the frontends have changed how they support batch files since then (Emuloader has), and HC has released an updated version of J5 that I am not sure works the same way as the one I used to develop the page, but the basic concepts remain the same.  (Doesn't really affect you now as I don't cover Mala and IrfanView still works basically the same way.)
It's not what you take when you leave this world behind you, it's what you leave behind you when you go. - R. Travis.
When all is said and done, generally much more is SAID than DONE.

unclet

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3561
  • Last login:March 17, 2025, 11:51:15 am
Re: Frontend feature req: Display image when emulator paused
« Reply #10 on: March 15, 2007, 02:21:26 pm »
Ok, I had to read "Method 5" as well as download the script from that same page ....

The script file downloaded was called "j5script_afk.zip", but inside there is a file with the extension "ahk" instead.

Your description states in order to use the script I would need to install Johnny5, however, I would assume this is a description explicitly for usage with Mame.  Since you indicated the AHK script is standalone then I would assume I do not have to install Johnny5 as long as I do not want Mame key mappings to be displayed ... correct?   Basically, I just need to update thsi script to interact with my non-Mame emulators rather than Johnny5.

I will read more when I have time .....  probably another day .....
« Last Edit: March 15, 2007, 02:23:25 pm by unclet »

Tiger-Heli

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5447
  • Last login:January 03, 2018, 02:19:23 pm
  • Ron Howard? . . . er, I mean . . . Run, Coward!!!
    • Tiger-Heli
Re: Frontend feature req: Display image when emulator paused
« Reply #11 on: March 15, 2007, 02:39:36 pm »
Ok, I had to read "Method 5" as well as download the script from that same page ....
The script file downloaded was called "j5script_afk.zip", but inside there is a file with the extension "ahk" instead.

j5script_af.zip but in retrospect, I don't know why I named it that.  I think AllisterFiend on here might have made the initial suggestion or helped me figure it out, so that's probably how it happened.  Anyway, the actual script file should be a .ahk file as you say.

Quote
Your description states in order to use the script I would need to install Johnny5, however, I would assume this is a description explicitly for usage with Mame.  Since you indicated the AHK script is standalone then I would assume I do not have to install Johnny5 as long as I do not want Mame key mappings to be displayed ... correct?

Correct - Those instructions were assuming you were using the script with Johnny5 (not necessarily with MAME), which 95% of users would be.  For your usage, you need to install AutoHotKey and Irfanview and modify the script to call Irfanview per the instructions that I mentioned above which are located on the Method 1 page under AHK SCRIPT IMPLEMENTATION.

Quote
   Basically, I just need to update thsi script to interact with my non-Mame emulators rather than Johnny5.
I will read more when I have time .....  probably another day .....

You need to update it to interact with Irfanview rather than Johnny5.  It should work with both non-MAME and Mame emulators, but I will try to test MAME compatibilty, and you might need to modify it and have a different script for each different emulator, but that is simple enough if required.
It's not what you take when you leave this world behind you, it's what you leave behind you when you go. - R. Travis.
When all is said and done, generally much more is SAID than DONE.

Tiger-Heli

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5447
  • Last login:January 03, 2018, 02:19:23 pm
  • Ron Howard? . . . er, I mean . . . Run, Coward!!!
    • Tiger-Heli
Re: Frontend feature req: Display image when emulator paused
« Reply #12 on: March 15, 2007, 03:26:42 pm »
Two questions in case I get time to look into this:

1) Which Emu's use different keys for Pause and UnPause?

2)  I am assuming you are leaning toward Method 5.  If the Emulator uses P to Pause and Ctrl-P to unpause (and you use "Left" to launch Irfanview), I think there are two ways to set AHK up:

a)  Pressing P causes AHK to pause the Emu and sets an internal watchdog so that Left toggles the image on and off.  Pressing "Ctrl-P" closes IrfanView (if active) resets the watchdog and restarts the Emu.

b)  Pressing P causes AHK to pause the Emu and sets the internal watchdog, pressing P a second time resets the watchdog and sends "Ctrl-P" to unpause the Emu.

Option b) would make your non-MAME emu's "behave" the same as MAME and might be easier to code.  If this approach would work for you.   
It's not what you take when you leave this world behind you, it's what you leave behind you when you go. - R. Travis.
When all is said and done, generally much more is SAID than DONE.

unclet

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3561
  • Last login:March 17, 2025, 11:51:15 am
Re: Frontend feature req: Display image when emulator paused
« Reply #13 on: March 15, 2007, 04:03:40 pm »
I can not remember off the top of my head which emulator(s) have different pause/unpause,  I will try to find this when I get home.   

As for 2a vs 2b ...

.. if I understand you correctly, then 2a would pause the emulator and let me see the paused game display.  I can then move the joystick left to toggle between the image.

.. for 2b, are you saying that the game would be paused and the image shown immediately?  If so, then the benefit of seeing the burning bolder prior to returning to the game would eb lost ... correct?


Perhaps I never took the time to add the emulator whcih had different keys for pausing and unpausing .... I just now I encountered one (or more) along the way.   Again, I will check tonight to see if any of my emulators have different keys to exit.  If not, then this is a moot point.

Gotta go for now .....

Tiger-Heli

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5447
  • Last login:January 03, 2018, 02:19:23 pm
  • Ron Howard? . . . er, I mean . . . Run, Coward!!!
    • Tiger-Heli
Re: Frontend feature req: Display image when emulator paused
« Reply #14 on: March 15, 2007, 04:47:18 pm »
As for 2a vs 2b ...
.. if I understand you correctly, then 2a would pause the emulator and let me see the paused game display.  I can then move the joystick left to toggle between the image.
.. for 2b, are you saying that the game would be paused and the image shown immediately?  If so, then the benefit of seeing the burning bolder prior to returning to the game would eb lost ... correct?

No, what I am saying is 2a pauses the game and let's you move the joystick left to toggle the image.  Ctrl-P then needs to be pressed to return to the game.  2b works the same way except AHK "fools" the emu so the second time you press P it actually sends Ctrl-P, so you press P twice to pause and unpause the emulator, and it works (to the user) exactly the same as MAME.

Quote
If not, then this is a moot point.

Agreed, I think I have a solution for you, working on another reply, so should have that up in about a half-hour or so, then will check back tomorrow.
It's not what you take when you leave this world behind you, it's what you leave behind you when you go. - R. Travis.
When all is said and done, generally much more is SAID than DONE.

Tiger-Heli

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5447
  • Last login:January 03, 2018, 02:19:23 pm
  • Ron Howard? . . . er, I mean . . . Run, Coward!!!
    • Tiger-Heli
Re: Frontend feature req: Display image when emulator paused
« Reply #15 on: March 15, 2007, 04:57:25 pm »
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 . . .
It's not what you take when you leave this world behind you, it's what you leave behind you when you go. - R. Travis.
When all is said and done, generally much more is SAID than DONE.

unclet

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3561
  • Last login:March 17, 2025, 11:51:15 am
Re: Frontend feature req: Display image when emulator paused
« Reply #16 on: March 15, 2007, 09:20:38 pm »
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.


 


« Last Edit: March 16, 2007, 07:22:58 am by unclet »

Tiger-Heli

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5447
  • Last login:January 03, 2018, 02:19:23 pm
  • Ron Howard? . . . er, I mean . . . Run, Coward!!!
    • Tiger-Heli
Re: Frontend feature req: Display image when emulator paused
« Reply #17 on: March 16, 2007, 07:58:20 am »
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
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).

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).
It's not what you take when you leave this world behind you, it's what you leave behind you when you go. - R. Travis.
When all is said and done, generally much more is SAID than DONE.

unclet

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3561
  • Last login:March 17, 2025, 11:51:15 am
Re: Frontend feature req: Display image when emulator paused
« Reply #18 on: March 16, 2007, 08:57:04 am »
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.   


« Last Edit: March 16, 2007, 09:00:49 am by unclet »

loadman

  • Wiki Contributor
  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4306
  • Last login:May 26, 2024, 05:14:32 am
  • Cocktail Cab owner and MaLa FE developer
    • MaLa
Re: Frontend feature req: Display image when emulator paused
« Reply #19 on: March 16, 2007, 09:29:51 am »
Nice to see you 'active' again UNCLET  ;D

Tiger-Heli

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5447
  • Last login:January 03, 2018, 02:19:23 pm
  • Ron Howard? . . . er, I mean . . . Run, Coward!!!
    • Tiger-Heli
Re: Frontend feature req: Display image when emulator paused
« Reply #20 on: March 16, 2007, 09:36:26 am »
Sounds like you'll be in good shape whenever you get ready to look at this.
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.

Almost correct - The script does not actually call the emulator.  The way I set it up, the batch file calls the script and then the batch file calls the emulator.  However, the script is also set up so that it exits from memory when the key to close the emulator is pressed, so you don't end up with the script still loaded after you have quit back to the FE.

I don't know if MALA can call a batch file and then have the batch file launch the emulator, or if the batch file would just pre-load the script and Mala would then launch the Emulator itself.  Either way would work, you just would need to include or remove the call for the emulator from the batch file.

One thing that will be required - For MAME where every game has a different hint image file - Mala will need to pass the romname to the script (or specifically to the batchfile that loads the script), but from the help files it looks like it is set up to do this normally.

Quote
Regarding (3) ......  This seems a lot easier to me.

We got our terms confused - what you are calling (3) is what I considered to be (2), but I'm on the same page with you - You want default emulator keymappings, you already have encoder mappings to correspond to this, and you want the script(s) customized to match these.  Sounds easy enough!!!

Quote
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.

Provided you have the encoder mappings and AHK scripts backed up somewhere before whatever happened that requires you to reload the emulators. ;) 8) :cheers:   
It's not what you take when you leave this world behind you, it's what you leave behind you when you go. - R. Travis.
When all is said and done, generally much more is SAID than DONE.

unclet

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3561
  • Last login:March 17, 2025, 11:51:15 am
Re: Frontend feature req: Display image when emulator paused
« Reply #21 on: March 16, 2007, 12:21:30 pm »
loadman
Hope everything is doing well with you  ....  I have been working on a bunch of new updates in my jukebox software fo rthe past 3 months so I have not really been keeping up with other stuff as often I as normally did. 


Tiger-Heli
Yes, I always have everything backed up in case disaster strikes (harddrive crash, children deleting stuff by "accident", etc..)   Also, I believe MALA can be configured to simply execute the batch file and not the actual emulator directly.  I believe everything is possible.   When I get time I will try setting up the script stuff for my Atari2600 emulator.

Thanks again, and I will be in touch when I get more for this.     Leaving on vacation soon. 
« Last Edit: March 16, 2007, 12:25:49 pm by unclet »