Jump to content

All my products and services are free. All my costs are met by donations I receive from my users. If you enjoy using any of my products, please donate to support me. My bare hosting costs are currently not met so please consider donating by either clicking this text or the Patreon link on the right.

Patreon

Recommended Posts

Posted

I know I mentioned this before but now I have the GP-49 with Midway 49 way sticks and wanted to bring up the idea of supporting automatic mode switching based on controls.ini.

For those that don't know, the GP-49 is a new interface for Midway/Happ 49 way sticks commonly found in NFL Blitz, NBA Jam and a few others. It was a way to get almost analog functionality at a cheaper cost per stick since it wasn't a full analog stick. The GP-49 is a USB interface for these sticks and the computer treats them as standard HID gamepads. To MAME it looks like an analog stick (just like a gamepad with an analog stick) and no special drivers or versions of MAME are needed. One thing that makes the GP-49 interface so appealing is that the developer has incorporated 7 Digital Restrictor Selection (DRS) modes to allow using the stick in dedicated 2 way H, 2 way V, 4 way, 8 way, 16 way, 49 way progressive and 49 way RAW modes. After using it for a day I can say he got the DRS modes very close to original sticks and it is the best option out there for an all in one switchable joystick. If you don't like the tight, wrist killing feel of the Ultimarc t-stick+ and long for a decent "Old School" feel like the Wico sticks then this is what you are looking for! Enough of the commercial.

Here's the one "Annoyance" I have with the product. In order to switch modes you have to install a dedicated Mode Switch button and one additional button for each mode you want to use. The mode buttons can double as player buttons though so you can use your normal player 1 buttons along with the new dedicated button to do the switching. For people with limited space on their CP adding another button isn't necessarily the best option. The other issue might be configuring MAME and your other emulators to use the new player buttons once you switch them to the GP-49. The way I want to approach this is not to add or change the buttons already running through my JPAC but rather have the mode change accomplished by the PC. Ideally it will do this automatically based on the game being played and the info in controls.ini which GameEx already uses to display the control panel layout. The same info can be used to switch modes if there is a way to send the button pushes from the PC rather than using buttons. This also means you can keep all of your emulator key configs the same and won't have an issue with exiting a game using a gamepad because only the joystick controls need to run through the GP-49.

The question is how do you do it?

The easiest answer and the one I am looking for support of is to use a Parallel port relay board and have GameEx set the appropriate bits on the parallel port that would correspond to the desired mode. An inexpensive board that would work perfectly and is available as a kit or fully assembled is This One.

There are already dos & windows programs that support the board although the support in GameEx would not have to use them. A driver is needed to access the parallel port in Win2K & XP. A free driver along with programming examples of how to use the DLL is available Here.

The simple explaination is that GameEx would need to set 2 bits for any given mode then possibly clear them as only a short push of the button is needed. Using bit 0 as the mode switch button, the modes would go something like mode1 - mode 7 = bit 1 to bit 7. Very simple and it makes sense. Since there are 8 relays on the board, every mode can be accessed via this method and GameEx can select the desired mode based on controls.ini for automatic mode switching based on the selected game! Something no other front end can do as of yet!!!

There are a couple of things I can think of like what to do if the game you are trying to play is not in controls.ini. The answer for that would be to possibly flash a message that control info is not available and default to 8 way. The user can always add it to their control.dat to use a particular mode in the future. Also, since there are 2 49 way modes GameEx would either need a way to know which of the 49 way modes the user wanted (RAW or Progressive) via the config or controls.ini would have to be modified by the user with an annotation as to which one to use. Personally, I didn't see or feel much difference between the 2 49 way modes and would think that just having it as a config item would be more than enough.

I sincerly hope that Tom has the time and desire to add this type of support (and soon. My relay board will be here in a couple of days :lol: ) as it would be VERY useful as the MAME community starts finding out about these sticks & the GP-49. Now is a good time to pick the sticks up on eBay as they are cheap because so very few games used them and until recently, MAME didn't support using them. I just bought a pair of them on eBay for $26 + shipping. Certainly better than the $92 I paid for 2 t-stick+ that these replaced.

1 GP-49 is needed for each stick you want to use and at $19.95 for the solder version, it's a bargain! http://www.groovygamegear.com is where you will find the GP-49.

Thanks!

Toonces

Posted

I need this feature too, to control my multisync monitor. I'm building a multisync memory for H/V shift and size for my arcademonitor, it should be controlled by the parallel-Port of the computer. I would prefer the ability to set a dos command like:

"par.bat $gamesizex $gamesizey". Or for Toonces: par.bat $axes.

Cu Cupid!

Posted
I need this feature too, to control my multisync monitor. I'm building a multisync memory for H/V shift and size for my arcademonitor, it should be controlled by the parallel-Port of the computer.  I would prefer the ability to set a dos command like:

"par.bat $gamesizex $gamesizey". Or for Toonces: par.bat $axes.

Cu Cupid!

Hi Cupid, Looking at what you want to do I am curious as to what your program does? Do you have to manually set a resolution (LOW, MED, HIGH res)? Using .ini files for each game will already override default game settings or even using arcade mode or AVGA support.

Just Curious

Toonces

Posted
Hi Cupid, Looking at what you want to do I am curious as to what your program does? Do you have to manually set a resolution (LOW, MED, HIGH res)? Using .ini files for each game will already override default game settings or even using arcade mode or AVGA support.

Just Curious

Toonces

I'd have to go with Cupid for the way I'd prefer to do this and that is also something that was brought up once before. This would be like the Also Launch feature for emulators in GameEx but for MAME. With the addition of being able to send info to an app such as par.bat %[RESX] %[RESY]

Toonces, can you think of a way how this would work for you? IE what info what you need passed from GameEx. This method would mean though that your controller would need a custom app or batch file to change the controls. However, I much prefer this method though as it makes GameEx much more extensible for plugins etc in the future.

Posted

I've been thinking of an easy way this might be done and after reading Cupid's post, perhaps the easy way would be to have GameEx be able to run a batch file before and after any game that is run. The batch file would need to be able to have variables passed to it from GameEx. I beleive this is similar to how you have emulators run passing in rom name, etc. The questions then become what variables are available in GameEx and what to pass to the batch file.

Looking at controls.ini. Here's a typical entry:

[mspacman]

gamename=Ms. Pac-Man

numPlayers=2

alternating=1

mirrored=1

tilt=0

cocktail=1

usesService=0

miscDetails=

P1NumButtons=0

P1Controls=4-way Joystick+joy4way

P1_JOYSTICK_UP=Up

P1_JOYSTICK_DOWN=Down

P1_JOYSTICK_LEFT=Left

P1_JOYSTICK_RIGHT=Right

It looks like the thing to pass in would be joy4way and then the batch file could use that to set the mode to 4 way. Passing just that would probably handle about 85-90% of the games? There are 8 selectable modes.

1 - Raw49 - Standard 49 way

2 - Progressive 49 - basically the same thing with a dead zone inbetween the active zones.

3 - 8 way

4 - 4 way

5 - 4 way diagonals - Q*Bert, etc

6 - 2 way horizontal

7 - 2 way vertical

8 - 16 way - custom mode to try to make 720 more playable. 49 way works better.

So, with the above modes in mind I eliminated 2 modes that I don't think are very useful nor do they map to any kind of "standard" mode. I am kicking out modes 2 & 8 leaving my list as:

1 - 49 way

3 - 8 way

4 - 4 way

5 - 4 way diagonal

6 - 2 way H

7 - 2 way V

passing in just joy4way will not work for Q*Bert as I really want mode 5 for that game. So back to controls.ini and look at Q*Bert. The entry for P1Controls there looks like this:

P1Controls=Diagonal 4-way Joystick+joy4way

So this information is there to be had. Unfortunately, I am not sure of how to handle it in the batch file. I have found that it not always consistent in controls.ini. Take for example, Puzzle Bobble which uses a 2 way Horizontal stick:

P1Controls=2-way Joystick (Horizontal)+joy2way

The direction of the 2 way is noted in parentheses. That appears to be consistent throughout for 2 way modes. It's just not the same way 4 way does it :huh:

So how do you effectively parse controls.ini and pass something usable by the batch file??

There are other anomolies but those could effectively be dealt with by ending the batch file with a default 8 way control if nothing matches.

Sorry if this wandered off topic into batch file stuff.

Toonces

Posted
I'd have to go with Cupid for the way I'd prefer to do this and that is also something that was brought up once before. This would be like the Also Launch feature for emulators in GameEx but for MAME. With the addition of being able to send info to an app such as    par.bat  %[RESX] %[RESY]

Toonces, can you think of a way how this would work for you? IE what info what you need passed from GameEx. This method would mean though that your controller would need a custom app or batch file to change the controls. However, I much prefer this method though as it makes GameEx much more extensible for plugins etc in the future.

HEHE, See my reply. Funny, I was answering that for the last hour and when I posted it there was your answer. I agree completely. a batch option before and after would give the flexibility to do all kinds of things. The relay board has the driver and dos program to use in a batch file already so it should be an easy thing to do. As you can see from my post above, I am not quite sure what to do about some of the variables only because they affect fairly popular games. Defender, Q*Bert, etc. I am no batch file expert either so I am not sure where to begin.

On a similar note, the relay board was just delivered :D So I can play with this and "Git R Done"!

Thanks Tom!

Toonces

Posted

I was just preparing what I thought would be needed and as I was going through controls.ini noticed that 2 way may already be taken care of. Horizontal 2 way entries have joy2way and vertical ones like defender already have vjoy2way so those are already addressed. That would only leave a few cases to modify and they could be done in controls.ini directly so GameEx could simply pass whatever is after the + in controls.ini!

So P1Controls=Diagonal 4-way Joystick+djoy4way would pass djoy4way (note, I added the d. There are only a few games that use a diagonal stick so it's easier to modify controls.ini rather than GameEx.

As far as standardizing, my idea is to talk to SirPoonga (maintainer of controls.ini) and see if they can accomodate the slight modifications.

But as far as GameEx goes, just the batch file support along with being able to pass that piece of info should work beautifully.

I am attaching the readme file from the dos utility. If anyone can assist me in getting the batch file to work I would GREATLY appreciate it.

Thanks!

Toonces

k74_dos.txt

Posted

BTW, since I have gotten the relay board I have figured out, that with the dos utilities it provides, the relay board is not strictly needed in order to control the GP-49. You could have a parallel cable, connect it directly to the switch terminals on the GP-49 and just adjust the batch file to do reverse login. Instead of turning on the desired bits you would initialize them all on then turn them off as needed.

One of the things the relay board does provide is isolation though so there's always the possibility that you could fry either your GP-49 or your computer or both. It shouldn't be a problem but the possibility exists as both are powered seperately and may not have the same ground reference. The relay board is just safer. The plus sidde is you can also trigger other stuff like lights or even monitor power, etc.

Toonces

Posted
HEHE, See my reply. Funny, I was answering that for the last hour and when I posted it there was your answer. I agree completely. a batch option before and after would give the flexibility to do all kinds of things. The relay board has the driver and dos program to use in a batch file already so it should be an easy thing to do. As you can see from my post above, I am not quite sure what to do about some of the variables only because they affect fairly popular games. Defender, Q*Bert, etc. I am no batch file expert either so I am not sure where to begin.

On a similar note, the relay board was just delivered  :D  So I can play with this and "Git R Done"!

Thanks Tom!

Toonces

OK, heres what Ill think we will do (feel free to but in :)

Two New 'MAME Launch' settings:

CMD before Game Launch

CMD after GAME Exit

If you think that this is going to be cool for others how about I do the 'calculations' in GameEx and parse %[CONTROLMODE] as either 1,3,4,5,6, or 7 (along with the Res stuff for Cupid, and the existing ROM Name W/WO EXT)

Now, with this in mind, of course I can enhance these new features later, but do you think this will cover it for now?

Posted
OK, heres what Ill think we will do (feel free to but in  :)

Two New 'MAME Launch' settings:

CMD before Game Launch

CMD after GAME Exit

If you think that this is going to be cool for others how about I do the 'calculations' in GameEx and parse %[CONTROLMODE] as either 1,3,4,5,6, or 7 (along with the Res stuff for Cupid, and the existing ROM Name W/WO EXT)

Now, with this in mind, of course I can enhance these new features later, but do you think this will cover it for now?

In addition, could this be extended to download IPAC codes at all in any way or am I barking up the wrong tree? If it is doable could someone give me a reminder on or say what needs to be done?

Posted
OK, heres what Ill think we will do (feel free to but in  :)

Two New 'MAME Launch' settings:

CMD before Game Launch

CMD after GAME Exit

If you think that this is going to be cool for others how about I do the 'calculations' in GameEx and parse %[CONTROLMODE] as either 1,3,4,5,6, or 7 (along with the Res stuff for Cupid, and the existing ROM Name W/WO EXT)

Now, with this in mind, of course I can enhance these new features later, but do you think this will cover it for now?

Awesome! The only thing I see with using the numbers instead of passing the joy4way or whatever directly is that it ties you to maintaining the translation of controls.ini to the joystick mode. Unless the translation were in the config file of course. Maybe that's the way to do it? let gamex pass all the modes 1-8 based on the gameex.ini having a section that say joy4way=4, analog=1, djoy4way=5 (assuming I were to modify the 5 or 6 enteries in controls.ini to reflect diagonal games as djoy4way). etc. That way it could be extended easily by the end user and you don't have to leave any modes out for people that want to use the 2 I am leaving out. It definately works for me in any case though. I guess it depends on how you want to maintain it :) I love it however you do it.

Posted
In addition, could this be extended to download IPAC codes at all in any way or am I barking up the wrong tree? If it is doable could someone give me a reminder on or say what needs to be done?

http://www.ultimarc.com/winipac.html has the instructions for using it to download the codes.

Basically, you create a profile you want. save it as an .IPC file then use it in a batch file as:

"winipac <IPC file name>"

The winipac program works with both old and new versions of the ipac/jpac so no worries about which type you have.

Thanks Again!

Toonce

Posted

Great work!

I'm building a circuit that saves four Bytes of data and sends every byte to a digital-analog converter to control the width and phase for H/V of my Hantarex monitor.

I will post my work here in this forum. Maybe i will control more than this with my circuit. I Could turn the Monitor on or off (to hide starting windows, turn the marque on and off, control the Volume of my speakers and the Speaker-Rear-Output, and so on).

CU Cupid

Posted
http://www.ultimarc.com/winipac.html has the instructions for using it to download the codes.

Basically, you create a profile you want. save it as an .IPC file then use it in a batch file as:

"winipac "

The winipac program works with both old and new versions of the ipac/jpac so no worries about which type you have.

Thanks Again!

Toonce

Yes, but how would this be used? Just need a top level overview of when this would be used (called from GameEx) and the benefits of it.

Thanks,

Tom.

Posted
Yes, but how would this be used? Just need a top level overview of when this would be used (called from GameEx) and the benefits of it.

Thanks,

Tom.

ok, a couple of different scenarios for this one. The first is on a per rom basis in order to change key mappings based on the game. This is especially useful for emulators that do not have the same key mappings that MAME uses or where you might want a different button mapping for a specific game. The way I see this being used is in the same batch file you run before and after a game. It could be passed in with the rom name and the IPC file would be gamename.ipc so the correct ipc file would be identified by simply passing in the rom name without extension. Something you are already doing by adding romname without extension as a variable.

On a per emulator basis, it could pass in based on the emulator name? That way every time you launched an emulator you want to remap the keys for it would pass the emulator name in and you could have an emulator.ipc file. Tis might even be a better solution for ZiNC as I think it uses the same mappings for every game, they're just different than MAME's default. Being zinc support is built in, this is one place I could see you passing the emulator name.

On exit you would just pass back in MAME or even gameex.ipc to remap back to defulat or customized gamex settings.

With the addition of the launch before and after batch files you really don't need to do anything other than maybe provide the emulator name as a variable? The run before and after really kinda takes care of it :)

Posted

Tom,

I wrote some batch files to take %[CONTROLMODE] as numbers 1-8 in order to support the new run before and run after functions. I PM'd you the URL for you to downlaod the files. Please take a look and let me know if any changes are needed. Calling the actual MS-DOS proggram directly just wasn't working out so I made the batch files as wrappers. I also included compiled versions of the batch file in case it is easier to use in another batch file.

I think the best way to approach it as you had stated. The only change is I would also make modes 2 & 8 as valid although they'll never map to anything with the standard controls.ini. If you added support for the mappings in the gameex.ini someone could change it as they want so maybe 49 way games actually use mode 2 instead of 1. dunno.

Best Regards,

Erik

Posted

Hi Tom,

One note, IF you wanted to add support for controlling the GP-49 or anything else directly into GameEx, I have found some very good resources on Parallel port programming. In trying to find a simple program that just sets some bits on the port I ran into hundreds of pages and examples including how to get around NT/2K/XP protection of the ports. Funny, all that info and only 1 dos program to actually do the setting :)

Anyways, here are some links with the required DLL and programming examples:

http://www.lvr.com/parport.htm - Has links to more parallel port info than should exist. Lots of technical info and programming examples.

http://www.logix4u.net/ - Freeware DLL that works with Win9X through XP. Includes programming examples too

Between those two links, there's enough info there to make your head hurt. For a programmer, there's enough info there to easily write an application using the parallel port :)

I am not asking you to change how you plan to support the GP-49. The run before and run after options will work very well for me. I just wanted to pass on the info I found because it seems very useful if you want to control pretty much anything via the parallel port.

Erik

Posted
Tom,

  I wrote some batch files to take %[CONTROLMODE] as numbers 1-8 in order to support the new run before and run after functions. I PM'd you the URL for you to downlaod the files. Please take a look and let me know if any changes are needed. Calling the actual MS-DOS proggram directly just wasn't working out so I made the batch files as wrappers. I also included compiled versions of the batch file in case it is easier to use in another batch file.

I think the best way to approach it as you had stated. The only change is I would also make modes 2 & 8 as valid although they'll never map to anything with the standard controls.ini. If you added support for the mappings in the gameex.ini someone could change it as they want so maybe 49 way games actually use mode 2 instead of 1. dunno.

Best Regards,

Erik

Thanks for doing some research Erik. I appreciate this and i do plan to look at the joytokey type app you posted before. I think that would be something Id like to look into more than this kind of thing. Although this could open GameEx to the home automation folks possibly.

Please be patient wating for me to implement the new features. I am a busy man ;)

Thanks,

Tom.

Posted
Thanks for doing some research Erik. I appreciate this and i do plan to look at the joytokey type app you posted before. I think that would be something Id like to look into more than this kind of thing. Although this could open GameEx to the home automation folks possibly.

Please be patient wating for me to implement the new features. I am a busy man  ;)

Thanks,

Tom.

No Problem Tom! I appreciate that you are willing to add new features and are open to suggestions. The Run Before and Run After each mame rom along with the parsing of the Controls.ini along with those files I sent are all that is needed to get GP-49 capability working. Any other stuff on the parallel ports is really just info I found. You can get all kinds of crazy with that stuff but you really don't need to. I don't know how you are planning on parsing controls.ini but even just a straight mapping in gameex.ini would work well and shouldn't require a lot more programming. Something simple like:

joy8way=3

joy4way=4

stick=1

analog=1

That handles a great majority of the games in MAME and allows the end user to customize the mappings.

There's a lot of buzz over on BYOAC about computer control of the GP-49 and people are chomping at the bit for a front end that supports it so they have a good reason to ditch their t-stick+ and omnisticks.

Minwah is out of the country so the feild is wide open to be the first ;)

I am going to make some text changes to the readme file included in the zip I sent then I plan on releasing the files on BYOAC probably tomorrow. I've had a lot of requests for the stuff.

If you look at the new pics I posted you'll see that I have menu items to switch joystick modes so I can change before I play a game. Works really well! If you've wanted an all in one stick I would encourage you to give it a try. Great feel. Very responsive and the best control so far short of a bunch of dedicated sticks.

Thanks Again for addressing so many of my requests!

Erik

Posted
i do plan to look at the joytokey type app you posted before.

When I switched to the 49 way sticks and got them under computer control I left all my existing buttons on the JPAC so I could exit programs, etc without having to use joytokey. Now that I am running a "Hybrid" system that only uses the gamepad joysticks and normal keyboard keys for buttons, I've found things like Enter and Tab don't work as they were shifted commands that relied on the joystick for input. Since the JPAC does not interface to the joystick to get those shifted keys. This is another place that Run Before and Run After will take care of as I will just remap my keys and setup my mappings specifically for GameEx and use a different mapping for MAME, ZiNC, etc. The downside to all this is I broke zinc since I am no longer using the arrow keys for up down left right and my son can't play Mr. Driller anymore :huh:

I also ran out of USB ports and had to unplug the N64 controller and broke all those games too:) Thank God my wife only plays SNES DK Country. That's the one controller I left alone :D

It's not a problem, just my experiences so far living on the bleeding edge of emulation technology :lol:

Back to Robotron (It's FUN again!)

Erik

Posted
When I switched to the 49 way sticks and got them under computer control I left all my existing buttons on the JPAC so I could exit programs, etc without having to use joytokey. Now that I am running a "Hybrid" system that only uses the gamepad joysticks and normal keyboard keys for buttons, I've found things like Enter and Tab don't work as they were shifted commands that relied on the joystick for input. Since the JPAC does not interface to the joystick to get those shifted keys. This is another place that Run Before and Run After will take care of as I will just remap my keys and setup my mappings specifically for GameEx and use a different mapping for MAME, ZiNC, etc.  The downside to all this is I broke zinc since I am no longer using the arrow keys for up down left right and my son can't play Mr. Driller anymore  :huh:

I also ran out of USB ports and had to unplug the N64 controller and broke all those games too:) Thank God my wife only plays SNES DK Country. That's the one controller I left alone  :D

It's not a problem, just my experiences so far living on the bleeding edge of emulation technology  :lol:

Back to Robotron (It's FUN again!)

Erik

Hi Erik,

To make this easy for me. Could you post a simple list of the 8 modes with a corresponding P1Controls Controls.ini setting? In three columns - The number, the control type and how P1Controls shows this.

I will use this as my reference for calculting the control types programmatically in GameEx and then assigning a number 1-8.

Make it easy for me ;)

Thanks,

Tom.

Posted
Hi Erik,

To make this easy for me. Could you post a simple list of the 8 modes with a corresponding P1Controls Controls.ini setting? In three columns - The number, the control type and how P1Controls shows this.

I will use this as my reference for calculting the control types programmatically in GameEx and then assigning a number 1-8.

Make it easy for me  ;)

Thanks,

Tom.

How's this? The file is in Excel & csv formats and uses the definitions found in the controls.ini dev kit. It looks like you have to use more than just the short description like joy4way because of Diagonal controls and 2 button controls not being consistent with the rest of the definitions (they don't use modifiers, just text in the description).

Erik

controlmap.zip

Posted
Hi Erik,

To make this easy for me. Could you post a simple list of the 8 modes with a corresponding P1Controls Controls.ini setting? In three columns - The number, the control type and how P1Controls shows this.

I will use this as my reference for calculting the control types programmatically in GameEx and then assigning a number 1-8.

Make it easy for me  ;)

Thanks,

Tom.

Hi Tom,

Sorry, I left the 2 unused modes out of the files. Here it is again with the 2 unused modes defined at the bottom.

Erik

controlmap.zip

Posted
Hi Tom,

  Sorry, I left the 2 unused modes out of the files. Here it is again with the 2 unused modes defined at the bottom.

Erik

Thanks for that. I think that's all I need.

Its very well done. Do you write up requirements/designs for a living ? ;)

Guest
This topic is now closed to further replies.
×
×
  • Create New...