| Main > Software Forum |
| Idea for implementing controls display in Mame (CPViwer/Johnny5) |
| (1/2) > >> |
| headkaze:
I have an idea for displaying the control layout during Mame (via CPViewer or Johnny5). My apologies if someone has already thought of this. Currently Johnny5 seems to be using set of batch files prior to running Mame with the appropriate CP generated in the background. There is also an AutoHotkey method that minimizes Mame and displays the CP. Unfortunately I dont think Mame stays paused using this method (correct me if I'm wrong). CPViewer works as far as I can tell by modifying the actual Mame source. Another rather complicated method. My idea is quite simple, and it's based on my experience from CoinDrop. With CoinDrop I can intercept & inject keypresses to Mame. With this, I can allow the 'p' button to pause Mame, then while paused allow another button to bring up the CP, or just bring up the CP (it could be optional exactly how and when the CP is displayed). The idea is to run my program in the background as a DLL attached to the Mame process which intercepts the pause key. When it recieves a pause key, it uses EnumWindows() to get the Titlebar name of Mame which contains the ROM name in square brackets eg. "MAME:1942 [1942]". With the ROM name, you can simply pass it on as a parameter to the appropriate viewer (CPViewer or Johnny5). Eg. "Johnny5 1942". It will launch, minimise Mame, display the CP and wait for a keypress. You press 'p' again, for example, the CP viewer closes and either my program maximises Mame or the CP viewer program does. Mame is shown, still paused.. press 'p' again and the game is unpaused and you continue on. My apologies if this has been thought of before, but I would like to hear feedback from John and Howard about this if it has not. |
| Buddabing:
I believe that Johnny + the AHK script does what you describing. But, if you choose to implement such a method, and you are using C, I would like to see your source. |
| BobbyG66:
I would really like to see something like this. My thoughts for my control panel were to have a PAUSE button and a HELP button. PAUSE for bathrooom breaks and HELP to view controls during game play. Alot of people do not like alot of admin buttons, if any, so I kind of like the one key approach of PAUSE and HELP combined. Works for me. I tried J5 will little success of getting it running. I like the way CPViewer works and was trying to make that work during game play. I am currently working on getting other things running on my cab and planned to work on this idea later. Hopefully someone will figure out a way to make this work. Thanks and good luck. BobbyG66 |
| Tiger-Heli:
--- Quote from: headkaze on January 11, 2006, 02:26:54 am ---I have an idea for displaying the control layout during Mame (via CPViewer or Johnny5). My apologies if someone has already thought of this. Currently Johnny5 seems to be using set of batch files prior to running Mame with the appropriate CP generated in the background. There is also an AutoHotkey method that minimizes Mame and displays the CP. Unfortunately I dont think Mame stays paused using this method (correct me if I'm wrong). CPViewer works as far as I can tell by modifying the actual Mame source. Another rather complicated method. My idea is quite simple, and it's based on my experience from CoinDrop. With CoinDrop I can intercept & inject keypresses to Mame. With this, I can allow the 'p' button to pause Mame, then while paused allow another button to bring up the CP, or just bring up the CP (it could be optional exactly how and when the CP is displayed). The idea is to run my program in the background as a DLL attached to the Mame process which intercepts the pause key. When it recieves a pause key, it uses EnumWindows() to get the Titlebar name of Mame which contains the ROM name in square brackets eg. "MAME:1942 [1942]". With the ROM name, you can simply pass it on as a parameter to the appropriate viewer (CPViewer or Johnny5). Eg. "Johnny5 1942". It will launch, minimise Mame, display the CP and wait for a keypress. You press 'p' again, for example, the CP viewer closes and either my program maximises Mame or the CP viewer program does. Mame is shown, still paused.. press 'p' again and the game is unpaused and you continue on. My apologies if this has been thought of before, but I would like to hear feedback from John and Howard about this if it has not. --- End quote --- This IS currently done with AHK and Johnny5. See http://www.mameworld.net/tigerheli/johnny/ Method 4 or Method 5. Method 4 does sometimes get out-of-sync and not pause MAME when it displays the CP, but it is supposed to pause MAME. I recommend you try your method out and post back if it works (or doesn't). |
| headkaze:
Yeah I read that link and that's when I thought up this idea. I've realised I didn't need to intercept/inject keys so I only needed a global hook dll to read keypresses. I've written an example that runs in the background hooking keypresses. When it detects a 'p' key press, it checks for Mame by searching for "MAME:" in the titlebar. If it finds it, it reads the ROM name between the square brackets. Then it will load CPViewer (or whatever) by passing it the ROM name as a parameter and minimises Mame (and hides it if you want) whilst it's still paused, then it brings CPViewer to the front. It then waits for the CPViewer process to finished, and once it's closed it will then bring up Mame back to the foreground, maxmised and visible and unpaused at the moment it was left. Unfortunately, CPViewer won't run for me, so I can't fully test it. I'm hoping you have some experience with C and DLL's for this to help integrate CPViewer with Mame more easily - without the use of AutoHotkey, batch files or modifying the Mame source. Attached below is the C source for VC6. Let me know how you go modifying it to work for CPViewer. Download |
| Navigation |
| Message Index |
| Next page |