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

Does any body know of a way to send input to mame in AHK?

I tried all of the following:

Sendplay, {o Down}

Sleep, 50

Sendplay, {o Up}

Sleep, 50

Sendplay, {k Down}

Sleep, 50

Sendplay, {k Up}

SendInput {Blind}{o DownTemp}

SendInput {Blind}{o Up}

SendInput {Blind}{k DownTemp}

SendInput {Blind}{k Up}

Send ok

SendEvent ok

I thought maybe it was the new input system that was keeping it from working, so I downloaded Mame.117, and no luck.

And yes, I know I can compile my own version to stop Mame from asking to enter "OK", but that's not where I'm headed... ;):lol:

  • Replies 54
  • Created
  • Last Reply

Top Posters In This Topic

Posted

You can't do it with AHK. Why not just compile your own version of Mame and apply the hiscore patch which will mean you don't have to press ok at the start of a game.

I can send keys to Mame using custom software I've written but I won't be making it available to the public.

Posted
I thought maybe it was the new input system that was keeping it from working, so I downloaded Mame.117, and no luck.

And yes, I know I can compile my own version to stop Mame from asking to enter "OK", but that's not where I'm headed... ;):lol:

Ok Headkaze, for you, I'll explain where I am headed... LOL

I'm trying to get all of my 4 button games to light up like the Neogeo games. I have a list from Romlister that has an additional 234 games, not including NeoGeo. I tried to just make duplicate cfg files, but Mame adds some masks to the cfg files, and I don't know where the information for the masks come from (It doesn't appear to be in list.xml). The duplicated cfg files do not work.

My intentions were to write a script to run Mame, and through the Tab menu, change the default settings for every game on the list, therefore creating the cfg files with the masks in them. (Just running the games themselves doesn't put the "Mask" information in the cfg, you have to change a mapping to get the "Mask" to show up). I couldn't find a pattern in list.xml as to how the information shows up in the "Input This Game" section in Mame (For example if it says coin 2 in list.xml, then most of the time, there are two entries in Mame, Coin1, and Coin2, but somtimes only Coin1). Since I don't think I can count on how many times to send "Down" to get to the correct entries in the Tab menu, I was planning on using the "shotgun approach" to change every input from the 3rd to the 17th on the Menu to the letter Q. (I'm only doing all of this to get the "Mask" information correct.)

After all of that was done, I would have the script then go through each cfg file, and change them to the correct inputs by searching for coin1, button1, button2, etc.

So there it is... If I can't send input to Mame, do you know an easier way? Where does the "Mask" information come from?

I could do this by hand, but I won't, I'm mostly just fooling around with scripting...

BTW: This SHOULD teach you to (not) reply to one of my posts! ;):lol:

Posted

Hehe interesting, didn't expect it would be about that.

I have no idea what the newseq and mask info is for or why Mame needs it, but it wasn't always there and makes creating custom cfg's by hand pretty much impossible. You could probably figure out how to calculate this information by taking a look at the Mame source code.

The Raw Input System was introduced around 0.117 which is when AHK stopped being able to send keys to Mame. So perhaps you could trying using an older version of Mame with AHK to generate the cfg's and then copy them over to your newer version.

Another option might be to compile Mame using the DIRECTINPUT=1 variable which forced Mame to compile using the old input code. I don't believe this is available in newer versions of Mame though, so I have no idea if that would work either.

Since neogeo games are all decended from the same parent, you could just use a ctrlr file with the neogeo entry, but I'm sure your aware of that and are not using it for a reason. You can also set up cfg's for games using the source file, cloneof or romof. So there is quite a bit of flexability there.

I'm not sure if this will be of any interest to you but I wrote a program recently called "ControlsDat" which was to help in updating Controls.xml file. It's also handy for viewing game's controls and their relation to each other. Anyway you can download it from here

Posted
Hehe interesting, didn't expect it would be about that.

I have no idea what the newseq and mask info is for or why Mame needs it, but it wasn't always there and makes creating custom cfg's by hand pretty much impossible. You could probably figure out how to calculate this information by taking a look at the Mame source code.

I read this far, and broke out laughing. I didn't know it until now, but you are funnier than GreatFlash! ME, take a look at the source code...that's a good one! :lol:

The Raw Input System was introduced around 0.117 which is when AHK stopped being able to send keys to Mame. So perhaps you could trying using an older version of Mame with AHK to generate the cfg's and then copy them over to your newer version.

I did try 0.117, maybe I'll give 0.116 a shot.

Another option might be to compile Mame using the DIRECTINPUT=1 variable which forced Mame to compile using the old input code. I don't believe this is available in newer versions of Mame though, so I have no idea if that would work either.

I may try this as well...

Since neogeo games are all decended from the same parent, you could just use a ctrlr file with the neogeo entry, but I'm sure your aware of that and are not using it for a reason. You can also set up cfg's for games using the source file, cloneof or romof. So there is quite a bit of flexability there.

I have the Neogeo set up in my ctrlr file (I still haven't checked to see what's going on as per our PM's, but I will)

This is for the 234 (not including clones) other Non-Neogeo 4 button games. Maybe I'll check to see how many "Source File" entries it would take.

I'm not sure if this will be of any interest to you but I wrote a program recently called "ControlsDat" which was to help in updating Controls.xml file. It's also handy for viewing game's controls and their relation to each other. Anyway you can download it from here

I'll take a look.

Have a good evening HK. :)

  • 1 month later...
Posted
Ok Headkaze, for you, I'll explain where I am headed... LOL

I'm trying to get all of my 4 button games to light up like the Neogeo games. I have a list from Romlister that has an additional 234 games, not including NeoGeo. I tried to just make duplicate cfg files, but Mame adds some masks to the cfg files, and I don't know where the information for the masks come from (It doesn't appear to be in list.xml). The duplicated cfg files do not work.

My intentions were to write a script to run Mame, and through the Tab menu, change the default settings for every game on the list, therefore creating the cfg files with the masks in them. (Just running the games themselves doesn't put the "Mask" information in the cfg, you have to change a mapping to get the "Mask" to show up). I couldn't find a pattern in list.xml as to how the information shows up in the "Input This Game" section in Mame (For example if it says coin 2 in list.xml, then most of the time, there are two entries in Mame, Coin1, and Coin2, but somtimes only Coin1). Since I don't think I can count on how many times to send "Down" to get to the correct entries in the Tab menu, I was planning on using the "shotgun approach" to change every input from the 3rd to the 17th on the Menu to the letter Q. (I'm only doing all of this to get the "Mask" information correct.)

After all of that was done, I would have the script then go through each cfg file, and change them to the correct inputs by searching for coin1, button1, button2, etc.

So there it is... If I can't send input to Mame, do you know an easier way? Where does the "Mask" information come from?

I could do this by hand, but I won't, I'm mostly just fooling around with scripting...

BTW: This SHOULD teach you to (not) reply to one of my posts! ;):lol:

Quoting myself, so you guys will know what I'm talking about....

I'm coming along fairly well on this. I used Romlister to create a list of 4 button games, 5 button games, 6 button games, and a list of alternating 2 player games. With the script I wrote, I can automatically remap any list of games created by Romlister.

For Example:

The original goal was the 4 button games. I select the 4 button list, choose whether or not I want to use the Player 2 controls in addition to the Player 1 controls in an alternating game, and it makes the CFGs for me.

The reason I went the route of making all of the individual CFGs, instead of Mame_Loader, or The Controlinator plugin is that I have lighted buttons, and am using CPWizard, and ASSUMED that they would not work correctly. By having all of the CFGs, CPWizard, and LEDWiz will read all of the files, and act accordingly.

QUESTION. Does anybody have an option that I haven't thought of added to the script?

My stuff is SO POPULAR, that when I release it you'd better hurray and get it before supplies run out! :lol:

Posted

Can you post a list of the 5 button and 6 button games that you've come up with? I need to redo those games again due to a stupid move, so I was hoping there might be a list that would be comprehensive. I can come up with a list of what I had done, but I'd like to compare it to what you've found. Thanks!

Posted
Can you post a list of the 5 button and 6 button games that you've come up with? I need to redo those games again due to a stupid move, so I was hoping there might be a list that would be comprehensive. I can come up with a list of what I had done, but I'd like to compare it to what you've found. Thanks!

If you already have the cfg's, with the mask information in them, you can use my script to redo them automatically. The script is fully working, for existing cfgs. You won't need a list, it will remap the keys in your cfgs. I only have it doing the buttons, I couldn't think of a reason to include other controls in each individual cfg. As a matter of fact, it will delete any other information! If that is a problem for you, I can change it to include other existing information.

I am now working on getting all of the mask information from Mame.

I will upload the script if you want to try it. I could use an endorsement!

Posted
If you already have the cfg's, with the mask information in them, you can use my script to redo them automatically. The script is fully working, for existing cfgs. You won't need a list, it will remap the keys in your cfgs. I only have it doing the buttons, I couldn't think of a reason to include other controls in each individual cfg. As a matter of fact, it will delete any other information! If that is a problem for you, I can change it to include other existing information.

I am now working on getting all of the mask information from Mame.

I will upload the script if you want to try it. I could use an endorsement!

I'll vouch for it.. You did a good job on the app. :)

Please share it once you feel your ready to support it... hehehehehehe

Posted

Ok, here's the scoop. The 7z file below contains these files:

post-2333-1226623396_thumb.jpg

The empty cfg folder is where the new cfgs are copied to, your old cfgs are not altered in any way.

The 4,5,6 button.csv, allgames.csv, and AlternatingGames.csv are files that I made with Romlister.

The MakeNew CFG2.4.exe is the script (DUH!)

When you run the script, it will:

  1. Ask you to browse to your Mame\cfg folder.
  2. Ask you what list of games you want to convert. You can use one of the files provided, or you can make your own list with romlister. The nice thing about this, is that you can create any list you want. If you have a trackball, and want to map keys for p1 and p2 so that either set of buttons can be used you can do it. In this way, a player could use either hand for the trackball, and have buttons on either side for the other hand.
  3. Ask if you want to mirror player1 buttons to player2 for alternating games. If you do this, for games like Asteroids that normally only use the one player controls, both sets of controls will be mapped, so that two players can play without "swapping" in and out. If you want to convert all 2 player alternating games, select the "AlternatingGames.csv" in step 2, and say yes in step 3.
  4. Ask you to enter button P1B1-6, and P2B1-6. These are the controls that you want mapped to the new cfg's. I haven't tried it, but you should be able to enter these from the CP.
  5. Make a copy of any existing files from your Mame\cfg folder, to the CFGmaker\cfg folder. It will overwrite files in the CFGmaker\cfg folder!

At this time, it will only convert games that you have the existing cfgs for, so this isn't going to help alot of people. I am looking into mass producing the cfg in mame with the "mask" information in them. No, you can't just make 7000 duplicates of one cfg, so don't try it! ;)

All of the .csv files that I have provide are "No Clones, No Preliminary Emulation" again, if you need something different, use Romlister.

That's about it, I'm sure I have more work to do, If anybody has suggestions, feel free to ask. :)

BTW: Thanks for the endorsement Brian! Can I get another, BK? :P

(Attachment Deleted, see post #35)

Posted

This is a cool idea! I grabbed it now and I'll check it out later when I have access to my own computer (my work machine doesn't read 7zip files).

I was thinking about another way to do this that wouldn't require modifying so many files. Maybe your way is better, so let me know what you think. Since MAME supports controller files (slik stik, x-arcade, ipac, etc), I was thinking that I could make a controller file for 5 button and 6 button games. Then, in combination with the MAME_Loader script, I could have a list for 5 and 6 button games that simply added a -ctrl xbutton switch that would call the right config. I haven't used these files before, so I could be wrong on how to implement this.

Any thoughts?

Posted

Well, I could be wrong here....

I use CPWizard ( I think you do too), and LedWiz. I started this mostly because it's been bugging me that the 234 no-clone, non neogeo, 4 button games do not light the same as the neogeo ones. ( I was using a ctrlr file with a neogeo entry. )

I'm sure that if all you use CPWizard for is to batch output your cp's, you could do as you describe, but I think it would be a PITA. You would have to batch ouput all games, sort out the ones you want to keep (Could be done with romlister), delete the ones you don't want to keep, switch configs, and start all over again, with a batch output set to not overwrite existing files.

AFAIK, it wouldn't work with the LEDWiz at all, HK reads all the information in at the start, and when you switched Ctrlr files through Mame_Loader, it wouldn't light the correct game buttons.

The only thing that could come up with my method, is that I have it set to overwrite existing files in the CFGmaker\cfg folder. So as you go through your different searches, you would want to keep in mind which files to do first. In my trackball example, you may have trackball games that overlap with games found in other searches. You would just have to keep this in mind, and do the high priority searches last. I could add the feature of entering more than one list from romlister at the beginning, then run one after the other without having to restart the script. It shouldn't be difficult to do.....

I'm also thinking that HK said that ctrlr files don't work with romnames, but you could do parents, driver, etc. I looked at that option, but I wasn't finding very many files that were connected in that way. It would take alot of entries...

Does that make sense? Or am I overlooking something?

I look forward to your comments!

Edit: I see what your saying about Mame_loader, so disregard my last comment!

Posted

Ahhh, I understand. I don't use LED's on my cab, so I didn't realize the ctrl files didn't work the same with LEDWiz. I think I know how to make ctrl files now (just rename the default.cfg file in the cfg dir after changing global settings and move it to ctrl). I don't know if my way will work, but I was just thinking that modifying one ctrl file for all 5 button games and one for all 6 button games would be a bit easier than running a script to change everything. The only draw back is that I need to come up with a list of games that are mapped a certain way. This isn't truly a big deal since I just need to add it to a txt file when a new one is encountered, though.

Anyway, I'm going to check out your script to see what you're doing. I enjoy looking at code....yes, I admit it! :ph34r:

Posted

Hmmm, Ledwiz, and CPWizard will work with ctrlr files, I think that the problem would come with using Mame_Loader. HK reads all of the information he needs to display the info correctly at startup. So if you switch horses in the middle of the stream, HK would still be riding the old horse!

I updated my Script to use LSHIFT, LALT, and LCTRL. I also fixed a bug, so you will want to use the new version. It still leaves KEYCODE_{blank} if all of the fields are not filled in, I will work on that this weekend, I knew you wanted to play, so I wanted to get this updated. I included the AHK file (The other package only had the EXE) since you wanted to look at it. In the future, I can do .tar, and .zip, if that works better for you at work. I will update my first (#11) post now.

BTW: The best tutorial I could find on ctrlr files is here:

http://wiki.arcadecontrols.com/w/index.php?title=Ctrlr_file

Posted

Yup, I found that article. I haven't had a problem with CP Wizard working with the MAME_Loader script so far. I primarily use it to show keys before the game launches and that works fine. Pause brings up the CP for standard MAME, but I don't recall if it's a problem for the other versions. I'll have to check that next time I remember...

Posted
Yup, I found that article. I haven't had a problem with CP Wizard working with the MAME_Loader script so far. I primarily use it to show keys before the game launches and that works fine. Pause brings up the CP for standard MAME, but I don't recall if it's a problem for the other versions. I'll have to check that next time I remember...

I hope your memorys not like mine, or it will never get done! :(

Posted

I was actually just playing with things this morning and had a question. If I want to use an alternate version of mame.ini for specific games, can I make one called "mame-alternate.ini" and somehow call it? I know I can have 1942.ini for example, but I want to be able to call it for a set of games. I'm thinking I could have a different config directory or a different rom folder without having to set up a whole new version of MAME for example.

Posted
In my ControlsDat program you can click the NumButtons column to sort it by number of buttons.

I checked out the program this morning and am really impressed! It doesn't help me with my project since I can't output a list of games that have exactly 5 and 6 buttons, but it's useful for reference.

Posted

Yup, Romlister can do it. In fact, that's how I've done this in the past. I was mainly just providing HK with feedback since he suggested giving it a try.

Btw, I was thinking about what you said earlier today and realized what you meant by "your plan is crap!" I wasn't thinking about how CP Wizard would grab the config data when I thought about my scheme, so really it won't work at all. I'll have to get all the games set up the way I did before by manually configuring each one. It's not a HUGE hassle, just not as easy as a ctrl file if I could use a single entry for 5 or 6 button games. I like the idea of your script, but I don't know if it will help since it requires that the game already have a config set up for it.

Ehhh, I'll get to it later since I have other systems that need work too.

Posted

Really?! I can wait then ;)

I keep getting stuck messing with the stupid little things lately rather than getting the majority of stuff set up. I spent a good 2 hours looking around for this stuff on Saturday when I should have just moved on to getting all the other emulators reconfigured. Then on Sunday I spent an hour with Gens32 trying to decide what buttons to map where. I really should have just gotten all my MAME versions going and then knocked off the low hanging consoles. BAH!!!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...