The NEW Build Your Own Arcade Controls
Main => Software Forum => Topic started by: MrSaLTy on April 26, 2005, 07:12:43 pm
-
Here is how I got this to work for anyone with a GPWIZ49 and wants to have it 'automatically' switch modes in Mamewah.
-
contents of runwiz.bat....
@echo off
REM Mode 1 = 49 Way RAW
REM Mode 2 = 49 Way Progressive
REM Mode 3 = 8 Way
REM Mode 4 = 4 Way
REM Mode 5 = 4 Way Diagonal
REM Mode 6 = 2 Way Horizontal
REM Mode 7 = 2 Way Vertical
REM Mode 8 = 16 Way
IF %1x==x GOTO END
SET PASS=1
SET A=%1
:BEGIN
IF /I %A% == 720 GOTO EIGHT
IF /I %A% == assault GOTO FOUR
IF /I %A% == kchamp GOTO FOUR
IF /I %A% == wacko GOTO FOUR
IF /I %A% == 4enraya GOTO SIX
IF /I %A% == alpine GOTO SIX
IF /I %A% == armora GOTO SIX
IF /I %A% == astdelux GOTO SIX
IF /I %A% == asteroid GOTO SIX
IF /I %A% == astinvad GOTO SIX
IF /I %A% == astrob GOTO SIX
IF /I %A% == astrof GOTO SIX
IF /I %A% == ballbomb GOTO SIX
IF /I %A% == bankp GOTO SIX
IF /I %A% == bcruzm12 GOTO SIX
IF /I %A% == blkhole GOTO SIX
IF /I %A% == bublbobl GOTO SIX
IF /I %A% == carnival GOTO SIX
IF /I %A% == challeng GOTO SIX
IF /I %A% == circusc GOTO SIX
IF /I %A% == cosmicg GOTO SIX
IF /I %A% == crgolf GOTO SIX
IF /I %A% == depthch GOTO SIX
IF /I %A% == devzone GOTO SIX
IF /I %A% == elim2 GOTO SIX
IF /I %A% == frogs GOTO SIX
IF /I %A% == galaga GOTO SIX
IF /I %A% == galaxian GOTO SIX
IF /I %A% == gmissile GOTO SIX
IF /I %A% == gravitar GOTO SIX
IF /I %A% == hustler GOTO SIX
IF /I %A% == invaders GOTO SIX
IF /I %A% == invadpt2 GOTO SIX
IF /I %A% == invrvnge GOTO SIX
IF /I %A% == joust GOTO SIX
IF /I %A% == joust2 GOTO SIX
IF /I %A% == kaos GOTO SIX
IF /I %A% == kingball GOTO SIX
IF /I %A% == llander GOTO SIX
IF /I %A% == lrescue GOTO SIX
IF /I %A% == magspot GOTO SIX
IF /I %A% == mappy GOTO SIX
IF /I %A% == mario GOTO SIX
IF /I %A% == mooncrst GOTO SIX
IF /I %A% == mpatrol GOTO SIX
IF /I %A% == pacland GOTO SIX
IF /I %A% == pbobble GOTO SIX
IF /I %A% == phoenix GOTO SIX
IF /I %A% == radarscp GOTO SIX
IF /I %A% == rainbow GOTO SIX
IF /I %A% == redufo GOTO SIX
IF /I %A% == ripoff GOTO SIX
IF /I %A% == skydiver GOTO SIX
IF /I %A% == sspaceat GOTO SIX
IF /I %A% == starcas GOTO SIX
IF /I %A% == theend GOTO SIX
IF /I %A% == uniwars GOTO SIX
IF /I %A% == wboy GOTO SIX
IF /I %A% == yosakdon GOTO SIX
IF /I %A% == 005 GOTO FOUR
IF /I %A% == alibaba GOTO FOUR
IF /I %A% == alphaho GOTO FOUR
IF /I %A% == amidar GOTO FOUR
IF /I %A% == anteater GOTO FOUR
IF /I %A% == armorcar GOTO FOUR
IF /I %A% == armwrest GOTO FOUR
IF /I %A% == atetris GOTO FOUR
IF /I %A% == atomicp GOTO FOUR
IF /I %A% == bagman GOTO FOUR
IF /I %A% == ballbros GOTO FOUR
IF /I %A% == barricad GOTO FOUR
IF /I %A% == barrier GOTO FOUR
IF /I %A% == bbonk GOTO FOUR
IF /I %A% == blasto GOTO FOUR
IF /I %A% == blockade GOTO FOUR
IF /I %A% == bouldash GOTO FOUR
IF /I %A% == btime GOTO FOUR
IF /I %A% == cavelon GOTO FOUR
IF /I %A% == checkman GOTO FOUR
IF /I %A% == ckong GOTO FOUR
IF /I %A% == columns GOTO FOUR
IF /I %A% == congo GOTO FIVE
IF /I %A% == crush GOTO FOUR
IF /I %A% == devilfsh GOTO FOUR
IF /I %A% == digdug GOTO FOUR
IF /I %A% == digger GOTO FOUR
IF /I %A% == dkong GOTO FOUR
IF /I %A% == dkong3 GOTO FOUR
IF /I %A% == dkongjr GOTO FOUR
IF /I %A% == docastle GOTO FOUR
IF /I %A% == domino GOTO FOUR
IF /I %A% == dominos GOTO FOUR
IF /I %A% == dorunrun GOTO FOUR
IF /I %A% == elevator GOTO FOUR
IF /I %A% == eyes GOTO FOUR
IF /I %A% == frogger GOTO FOUR
IF /I %A% == galpanic GOTO FOUR
IF /I %A% == glfgreat GOTO FOUR
IF /I %A% == hustle GOTO FOUR
IF /I %A% == jrpacman GOTO FOUR
IF /I %A% == jungler GOTO FOUR
IF /I %A% == kicker GOTO FOUR
IF /I %A% == klax GOTO FOUR
IF /I %A% == kungfum GOTO FOUR
IF /I %A% == ladybug GOTO FOUR
IF /I %A% == ldrun GOTO FOUR
IF /I %A% == lnc GOTO FOUR
IF /I %A% == locomotn GOTO FOUR
IF /I %A% == maze GOTO FOUR
IF /I %A% == mineswpr GOTO FOUR
IF /I %A% == moguchan GOTO FOUR
IF /I %A% == monsterb GOTO FOUR
IF /I %A% == mrdo GOTO FOUR
IF /I %A% == mspacman GOTO FOUR
IF /I %A% == mtrap GOTO FOUR
IF /I %A% == nibbler GOTO FOUR
IF /I %A% == olibochu GOTO FOUR
IF /I %A% == pacmania GOTO FOUR
IF /I %A% == pacplus GOTO FOUR
IF /I %A% == panic GOTO FOUR
IF /I %A% == pengo GOTO FOUR
IF /I %A% == pepper2 GOTO FOUR
IF /I %A% == pitfall2 GOTO FOUR
IF /I %A% == ponpoko GOTO FOUR
IF /I %A% == puckman GOTO FOUR
IF /I %A% == pulsar GOTO FOUR
IF /I %A% == punchout GOTO FOUR
IF /I %A% == qbert GOTO FIVE
IF /I %A% == qbertqub GOTO FOUR
IF /I %A% == qix GOTO FOUR
IF /I %A% == rallyx GOTO FOUR
IF /I %A% == robby GOTO FOUR
IF /I %A% == roundup GOTO FOUR
IF /I %A% == rthunder GOTO FOUR
IF /I %A% == spacezap GOTO FOUR
IF /I %A% == sqbert GOTO FOUR
IF /I %A% == sqix GOTO FOUR
IF /I %A% == superpac GOTO FOUR
IF /I %A% == tapper GOTO FOUR
IF /I %A% == targ GOTO FOUR
IF /I %A% == tetrisp GOTO FOUR
IF /I %A% == thief GOTO FOUR
IF /I %A% == timber GOTO FOUR
IF /I %A% == toypop GOTO FOUR
IF /I %A% == tranqgun GOTO FOUR
IF /I %A% == upndown GOTO FOUR
IF /I %A% == warpwarp GOTO FOUR
IF /I %A% == wbml GOTO FOUR
IF /I %A% == wow GOTO FOUR
IF /I %A% == zerozone GOTO FOUR
IF /I %A% == zigzag GOTO FOUR
IF /I %A% == zoar GOTO FOUR
IF /I %A% == zookeep GOTO FOUR
IF /I %A% == aburner2 GOTO ONE
IF /I %A% == alleymas GOTO ONE
IF /I %A% == archrivl GOTO ONE
IF /I %A% == aztarac GOTO ONE
IF /I %A% == blaster GOTO ONE
IF /I %A% == bshark GOTO ONE
IF /I %A% == cybsled GOTO ONE
IF /I %A% == eprom GOTO ONE
IF /I %A% == esb GOTO ONE
IF /I %A% == foodf GOTO ONE
IF /I %A% == irobot GOTO ONE
IF /I %A% == jedi GOTO ONE
IF /I %A% == pigskin GOTO ONE
IF /I %A% == roadrunn GOTO ONE
IF /I %A% == sinistar GOTO ONE
IF /I %A% == starwars GOTO ONE
IF /I %A% == tailg GOTO ONE
IF /I %A% == teamqb GOTO ONE
IF /I %A% == thndrbld GOTO ONE
IF /I %A% == tunhunt GOTO ONE
IF /I %A% == wseries GOTO ONE
IF /I %A% == paperboy GOTO ONE
IF /I %A% == bzone GOTO SEVEN
IF /I %A% == ultratnk GOTO SEVEN
IF /I %A% == vindctr2 GOTO SEVEN
IF /I %A% == vindictr GOTO SEVEN
IF /I %A% == ace GOTO SEVEN
IF /I %A% == arlingtn GOTO SEVEN
IF /I %A% == crater GOTO SEVEN
IF /I %A% == defender GOTO SEVEN
IF /I %A% == looping GOTO SEVEN
IF /I %A% == m4 GOTO SEVEN
IF /I %A% == pooyan GOTO SEVEN
IF /I %A% == stargate GOTO SEVEN
IF /I %A% == videopin GOTO SEVEN
IF /I %A% == zzyzzyxx GOTO SEVEN
IF %PASS% == 2 GOTO END
SET PASS=2
IF %2x==[cloneof]x GOTO END
SET A=%2
GOTO BEGIN
:ONE
c:\mame\gpwiz49\gpwiz49.exe 1
GOTO END
:TWO
c:\mame\gpwiz49\gpwiz49.exe 2
GOTO END
:THREE
c:\mame\gpwiz49\gpwiz49.exe 3
GOTO END
:FOUR
c:\mame\gpwiz49\gpwiz49.exe 4
GOTO END
:FIVE
c:\mame\gpwiz49\gpwiz49.exe 5
GOTO END
:SIX
c:\mame\gpwiz49\gpwiz49.exe 6
GOTO END
:SEVEN
c:\mame\gpwiz49\gpwiz49.exe 7
GOTO END
:EIGHT
c:\mame\gpwiz49\gpwiz49.exe 8
GOTO END
:END
-
I then run mame with this bat file to switch it to 8way when done with a game.....
contents of runmame.bat
---------------------------------
@echo off
cd c:\mame
mame.exe %1 %2 %3 %4 %5 %6 %7 %8 %9
IF %2x == -verifyromsx GOTO END
c:\mame\gpwiz49\gpwiz49.exe 3
:END
------------------------------------------
You can also set a external app call in mamewah to switch to 8way mode if needed like when it starts or add it to a startup bat for mamewah to make sure its in 8way mode to start.
EDIT:
This list is probably not 100% correct.... I have not sat and studied it to see if its all there, this is something I threw together in one night. But it can be changed or added to if changes need to be made.
-
Wow MrSalty! That's a lot of work you did!
I don't have my 49-ways yet so this probably won't work since I haven't tested it, but this is how I planned on doing it.. it seems a little simpler...
1) make a mame.bat file and use it as your emulator_executable in MAMEWAH:
SET MYMODE=""
IF %1 == "4-Way Joystick" MYMODE=4
IF %1 == "8-Way Joystick" MYMODE=3
IF "%MYMODE%" == "" GOTO MAME
d:\utils\gpwiz49\gpwiz49.exe %MODE%
:MAME
cd d:\emus\mame %2 %3 %4 %5 %6 %7 %8
mame.exe
d:\utils\gpwiz49\gpwiz49.exe 3
2) Set your commandline_format = "[input]" [name]
I *think* that should come pretty close. There just needs to be some exception for every other input type (2-way, etc) that MAMEWAH doesn't support, but I planned on adding controls.dat support to Listgen.. Or I'd end up making another small utility to extract controls.dat info and output a number for gpwiz49.exe.
What do you think?
-sab
-
Wow MrSalty! That's a lot of work you did!
I don't have my 49-ways yet so this probably won't work since I haven't tested it, but this is how I planned on doing it.. it seems a little simpler...
1) make a mame.bat file and use it as your emulator_executable in MAMEWAH:
SET MYMODE=""
IF %1 == "4-Way Joystick" MYMODE=4
IF %1 == "8-Way Joystick" MYMODE=3
IF "%MYMODE%" == "" GOTO MAME
d:\utils\gpwiz49\gpwiz49.exe %MODE%
:MAME
cd d:\emus\mame %2 %3 %4 %5 %6 %7 %8
mame.exe
d:\utils\gpwiz49\gpwiz49.exe 3
2) Set your commandline_format = "[input]" [name]
I *think* that should come pretty close.
-
Cool idea! Thanks for putting this together and sharing with the community!
-
Mr SaLTy -
That is sweet ! ;D
You have made an already exccellent joystick that much better!
Thanks
Tek
-
Obviously a utility to extract data from controls.dat is a better choice.
-
Sweet SirP.... I'd try it but my windoz programming skilz are not 'mad' at this point. ;D
-
I made a small utility that pretty much does the same thing as what MrSalty made, but this should be a little easier to maintain.
You can get it here (http://www.bluecamel.org/software/gpinput/gpinput.zip).
It's my first-ever C++ project so go easy on me ;)
All it really does is take a map file (included in the .zip with info on controls.xml .88 and mame .92) and translates the input to a number compatible with gpwiz49.exe, then passes it to the gpwiz.exe specified in the (included) .ini file.
The map file is pretty simple:
<romname>=<control>
<control> is the short "constant" from the controls.dat project, with the addition of 'djoy4way' and 'joy49way'.
The newest ListGen.NET (http://forum.arcadecontrols.com/index.php/topic,36762.0.html) can generate this map file for you, or you can simply modify the default. As soon as I can figure out how to add the expat libraries to my IDE I'll make this a built-in function so you can create the map file with just this .exe.
*shrug* let me know if you have any problems...
-sab
-
I made a small utility that pretty much does the same thing as what MrSalty made, but this should be a little easier to maintain.
You can get it here (http://www.bluecamel.org/software/gpinput/gpinput.zip).
It's my first-ever C++ project so go easy on me ;)
All it really does is take a map file (included in the .zip with info on controls.xml .88 and mame .92) and translates the input to a number compatible with gpwiz49.exe, then passes it to the gpwiz.exe specified in the (included) .ini file.
The map file is pretty simple:
<romname>=<control>
<control> is the short "constant" from the controls.dat project, with the addition of 'djoy4way' and 'joy49way'.
The newest ListGen.NET (http://forum.arcadecontrols.com/index.php/topic,36762.0.html) can generate this map file for you, or you can simply modify the default. As soon as I can figure out how to add the expat libraries to my IDE I'll make this a built-in function so you can create the map file with just this .exe.
*shrug* let me know if you have any problems...
-sab
hey screaming...
any bugs or errors come up using your program with the newer mamewah?...
-
Nope! I use MAMEWAH 1.61 exclusively. Are you having issues?
(Actually, this program has nothing to do with MAMEWAH specifically, so it will work with anything.)
-sab
-
Obviously a utility to extract data from controls.dat is a better choice.
-
Hey Screaming,
Have you gotten this software switching to work properly with your program? I haven't been able to test it yet and I'd like to be able to include it in the Retroblast review of this product. Have you been able to test yet? I'll try to test it out tonight, although I'm using an older version of MameWah.
Cheers,
KenToad
-
I'm sorry.. I lost track somehow
What ever became of all of this?
Did MinWah ever take a look at this?
-
Did MinWah ever take a look at this?
-
Did MinWah ever take a look at this?
Does he need too?
-
I'm not sure Intruder, I have only seen him back on for a couple of days and didn't want to be a jerk and start hammering on him 4 seconds after he was back. ;D All we really need is for mamewah to parse controls.ini and we should be able to get it to work. In the meantime the above does work. I haven't tried the prog screaming has but that may be an alternative also.
-
Hmm, shouldn't be too difficult to parse the controls.ini file, although I was planning on doing this when I re-write the backend to MAMEWAH. Admittedly the way I wrote it makes it a right pain to add any new fields.
That said, I may be able to bodge something into the 'controls' field in there currently. I would still have to do something to alter the input type into the no. required for the gp-wiz49 software, wouldn't be hard mind.
Sorry but I won't be looking at it for a while tho as I have a lot of things on atm :(
-
Sorry but I won't be looking at it for a while tho as I have a lot of things on atm :(
I understand.... being gone for that long, I'm sure you have a nice backlog of stuff to do. I'm just satisfied that you are aware of this and can put it on your 'TODO' list. ;D
-
As far as I know this works? It works for my set up with MAMEWAH 1.6, yes, and it will work for any FE... At the very least you just need to put it in a batch file set to go right before the game runs.
-sab
-
I understand.... being gone for that long, I'm sure you have a nice backlog of stuff to do. I'm just satisfied that you are aware of this and can put it on your 'TODO' list. ;D
Well I hope to get one of these gp-wiz49's eventually so you can be sure I'll put some work into it then ;)
I just ripped out half of the contents of my cab for some fairly major reworking so I have my hands full with that, as well as a lot of festivals to frequent, and beer to drink 8)
-
-
The software for the gpwiz will switch modes for all the sticks attached to the system at the same time. If you use my batch files or the above program, they both will call the gpwiz software to do the actual switching.
-
When Mame exits and the software is called to switch back to 8-way, is there any way to hide the graphic that pops up indicating 8-way mode? I'd rather have this switch done behind the scenes rather than popping up on top of Mamewah.
-
Not that I know of.... thats part of how Randy's program works and as far as I know you cannot change that.
-
I use screamings program and it seems to work, although I really can't be sure. I know that the diagnal games seem to be working. I don't get the gpwiz screen when exiting a game so I am not sure if it really is working.
Is there any way to tell if it is changing the modes?
-
I would think if you go to the Window Joystick calibration screen you'll be able to tell pretty easily.
-
Tiger-Heli is right... if you use the gpwiz software in interactive mode so you can switch between the different modes... you can go then into the windows joystick setup and move the stick and see how it reacts after each mode. Its pretty easy to tell once you know how each mode reacts.
-
I don't know much about batch files, but when I ran MrSalty's batch file it works great except if a game is 8-way. I just added a line at the end of the game list to go to 8-way, so now if a game doesn't match any on the list it will default to 8-way. Also I will have to play with this more because I don't think all games are listed here that are not 8-way, I could be wrong though.
I tried Screaming's program since I believe his list of games is more complete, but windows XP kept giving me an exception error everytime I ran it. I don't know what I am doing wrong or why windows doesn't like this program on my machine. It said something about a problem with one of the .dll files on debug.
MrSalty you mentioned you run a batch file to force the stick back to 8-way after you exit a game, how do you do this? Mame doesn't have an exit program you can setup.
Great stuff guys, keep up the good work.
-
If you look at the 3rd post above thats the batch file I use to run mame. It will switch to 8-way after the game is run. This way you don't have to switch to 8-way for each game thats 8-way as most of them are. What you are doing probably will work too. I just did it slightly different.
-
How do you run the 'runmame.bat' file from Mamewah if you are already running the 'runwiz.bat' file as an external app in Mamewah.
Sorry for all the questions, just trying to figure this out.
Thanks for your help.
-
They are 2 seperate things.... look in the mame.ini file and instead of mame.exe as the executable for mame use the bat like so....
### Execution Settings ###
emulator_executable c:\mame\runmame.bat
-
ahhh finally got it to work and it works great.
Thanks for the help!!!!
-
Screaming, I have tried your gpinput program and have been unable to get it to work. It errors out on Win XP computer and also my Win2k computer. I first tried to get it to work from mamewah and I then tried to do it from the command line. I kept getting a program error saying that gpinput has generated errors and will be closed by windows.
Below I have listed how far it gets before it gives me the error.
C:\wiz\gpinput qbert
exe: c:\wiz\gpwiz49.exe
exe (short): gpwiz49.exe
arg: 5
-
I had the same problem and then changed over to the .bat files and they work flawless.
-
I have to admit that the batch files work pretty well but I like the idea of being able to keep an updated list for screaming's gpinput program with his listgen utility.
On another note, I was reading in HowardC's Johnny5 thread that he is looking into adding modeswitching into Johnny5. Knowing him, if he does go thru with it, johnny5 will do all the work for you. You will just have to keep your controls.ini file up to date.
-
I spent all day trying both ways... Both work setting the mode & running the ROM, and also resetting back to 8 way mode on exit. Problem is anytime I start MAME with a .BAT file, on game exit the Mamewah screen comes back small in the upper left of the screen and locked up... This problem is independant of the Gpwiz49 function as I tried a .BAT with only the Mame.exe %1 %2 etc in it and got the same thing.
-
FYI I did make a utility that does this with controls.dat
http://fe.donkeyfly.com check the forums