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: Idea for implementing controls display in Mame (CPViwer/Johnny5)  (Read 3355 times)

0 Members and 1 Guest are viewing this topic.

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:August 14, 2023, 02:00:48 am
  • 0x2b|~0x2b?
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

  • Wiki Master
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 1845
  • Last login:February 12, 2015, 02:51:45 pm
  • I'm a llama!
Re: Idea for implementing controls display in Mame (CPViwer/Johnny5)
« Reply #1 on: January 11, 2006, 05:47:57 am »
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.

I have changed my nickname to "Cakemeister". Please do not PM the Buddabing account because I do not check it anymore.

Please read the wiki!

BobbyG66

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 588
  • Last login:November 13, 2016, 11:52:09 am
  • Current project: Dodgeball
Re: Idea for implementing controls display in Mame (CPViwer/Johnny5)
« Reply #2 on: January 11, 2006, 08:51:51 am »
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
Half of the people you meet are below average.

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: Idea for implementing controls display in Mame (CPViwer/Johnny5)
« Reply #3 on: January 11, 2006, 12:14:29 pm »
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.
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).
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.

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:August 14, 2023, 02:00:48 am
  • 0x2b|~0x2b?
Re: Idea for implementing controls display in Mame (CPViwer/Johnny5)
« Reply #4 on: January 11, 2006, 12:36:00 pm »
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

Popcorrin

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 858
  • Last login:March 06, 2022, 11:11:43 am
Re: Idea for implementing controls display in Mame (CPViwer/Johnny5)
« Reply #5 on: January 11, 2006, 02:05:53 pm »
Buddamame already does this, but it can be difficult to set up.  The good news is that Buddabing is planning on releasing a more user friendly interface.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19428
  • Last login:Yesterday at 06:08:43 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Idea for implementing controls display in Mame (CPViwer/Johnny5)
« Reply #6 on: January 11, 2006, 10:29:37 pm »
Also note that hooking the keys isn't the issue, it's getting mame to accept simulated keys (or keys modified in the hook).  IE ahk works great, it's just that mame is the picky one.  Also I would like to point out that ahk doesn't have to be installed to use the script.  The ahk program gomes with an ahk to exe utility, I just don't use it. 

The stuff ahk is doing, indeed, can be easily done in vs6, but this just seemed simplier and easier for the lamen to tweak for their own personal setup. 

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:August 14, 2023, 02:00:48 am
  • 0x2b|~0x2b?
Re: Idea for implementing controls display in Mame (CPViwer/Johnny5)
« Reply #7 on: January 12, 2006, 06:18:31 am »
Looks like Tom has managed to integrate this feature into GameEx :)

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: Idea for implementing controls display in Mame (CPViwer/Johnny5)
« Reply #8 on: January 12, 2006, 06:25:02 am »
Looks like Tom has managed to integrate this feature into GameEx :)
I don't think so, depending on what you mean by "integrate into GameEx".
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.

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:August 14, 2023, 02:00:48 am
  • 0x2b|~0x2b?
Re: Idea for implementing controls display in Mame (CPViwer/Johnny5)
« Reply #9 on: January 12, 2006, 06:33:48 am »
Yes, there is new development. And for a long time GameEx had the ability to view the CP using his own built-in viewer. But just today he has added the ability to view it while Mame is running. Although he hasn't quite finished it for release yet.

Here's the topic about it...

http://www.gameex.info/forums/index.php?showtopic=1018