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: Tutorial on how to write ctrlr files?  (Read 3483 times)

0 Members and 1 Guest are viewing this topic.

clanggedin

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1071
  • Last login:July 02, 2012, 11:08:55 pm
  • O'DOYLE RULES!!!
Tutorial on how to write ctrlr files?
« on: September 01, 2004, 12:58:18 am »
I have read all of the supplied documents on ctrlr files, but I can't find one that teaches me how to write on for a specific game. Is the ctrlr file just named mk.cfg for mortal kombat and placed in the ctrlr folder?

Please help a newb. I would ask this question in the forum at mame.net, but I'm afraid I'll get my head ripped off.

Thanks.

cdbrown

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1241
  • Last login:October 16, 2017, 09:52:03 pm
  • Bowowow

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8188
  • Last login:July 20, 2025, 03:37:24 pm
  • The Bears Still Suck!
Re:Tutorial on how to write ctrlr files?
« Reply #2 on: September 01, 2004, 10:23:49 am »
http://www.mameworld.net/easyemu/

However not sure if it is out of date.  The ctrlr files are now in xml files.  They are the same format as the cfg files now.  So really it is a different process.

clanggedin

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1071
  • Last login:July 02, 2012, 11:08:55 pm
  • O'DOYLE RULES!!!
Re:Tutorial on how to write ctrlr files?
« Reply #3 on: September 01, 2004, 12:10:28 pm »
Thanks guy. I have tried using the "Input (this game)" for the Mortal Kombats, but for some reason some of the buttons will not change. They are being overridden by the default and I don't know why.

I spent 2 hours last night trying to re-configure MK to layout in the MK2 manual where the middle buttons are both block and it kept making buttons 2 and 3 block and 5 and 6 low kick/ high kick. No matter what I tried I couldn't  get it to work correctly. I just switched button 5 and 6 so the kicks would be in the middle and block on the outside. It's totally bass ackwards. I'm hoping a ctrlr file will correct it for me. There just isn't a document that shows you how to do it in the new format.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Today at 01:05:18 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re:Tutorial on how to write ctrlr files?
« Reply #4 on: September 01, 2004, 01:51:53 pm »
my suggestion:  don't

do it in the old format, go to my site and convert it using the converter i posted

xml isn't exactly user friendly when you have to type it by hand :)

clanggedin

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1071
  • Last login:July 02, 2012, 11:08:55 pm
  • O'DOYLE RULES!!!
Re:Tutorial on how to write ctrlr files?
« Reply #5 on: September 01, 2004, 02:29:54 pm »
Thanks for the input HC. I guess that's what I'll do.

Minwah

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7662
  • Last login:January 18, 2019, 05:03:20 am
    • MAMEWAH
Re:Tutorial on how to write ctrlr files?
« Reply #6 on: September 01, 2004, 03:37:55 pm »
I noticed somthing with the new ctrlr files which I'm not sure is a bug or not (I think it is).  Here is a snippet from one of my game-specific parts:

<port type="P1_TRACKBALL_Y" mask="255" defvalue="0" value="0" keydelta="20" centerdelta="20" sensitivity="100" reverse="no">
            <newseq type="standard">MOUSECODE_1_ANALOG_Y</newseq>
            <newseq type="decrement">NONE</newseq>
            <newseq type="increment">NONE</newseq>
         </port>
         <port type="P1_TRACKBALL_X" mask="255" defvalue="0" value="0" keydelta="20" centerdelta="20" sensitivity="100" reverse="yes">
            <newseq type="standard">MOUSECODE_1_ANALOG_X</newseq>
            <newseq type="decrement">NONE</newseq>
            <newseq type="increment">NONE</newseq>
         </port>


Now all works fine, but I figure I could now change the sensitivity setting...but it doesn't seem to take effect when I load the game.  Should it take effect, or have the mame dev's purposely made it this way?

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Today at 01:05:18 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re:Tutorial on how to write ctrlr files?
« Reply #7 on: September 01, 2004, 04:25:03 pm »
it's supposed to work... if it actually does or not is questionable though

CrispyXUK2

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 26
  • Last login:July 26, 2006, 11:49:06 am
  • minty
Re:Tutorial on how to write ctrlr files?
« Reply #8 on: September 03, 2004, 05:06:31 am »
Is there an easy why do write CTRL file for the neogeo driver?

for example, could I configure the controls for King of Fighter 95 in MAME and then rename the CTRL file for KOF95 to NEOGEO.INI?

I'm confused  :P ??? :-[
-----------------------------------------------
"Ambition makes you look pretty ugly,
kicking squeling gucci little piggy"

Minwah

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7662
  • Last login:January 18, 2019, 05:03:20 am
    • MAMEWAH
Re:Tutorial on how to write ctrlr files?
« Reply #9 on: September 03, 2004, 09:13:52 am »
Is there an easy why do write CTRL file for the neogeo driver?

for example, could I configure the controls for King of Fighter 95 in MAME and then rename the CTRL file for KOF95 to NEOGEO.INI?

I'm confused  :P ??? :-[

Take one of the pre-done ctrlr files as an example.  eg open hotrodse.cfg, and scroll down.  You'll see a system-specific section for neogeo - should give you an idea...

CrispyXUK2

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 26
  • Last login:July 26, 2006, 11:49:06 am
  • minty
Re:Tutorial on how to write ctrlr files?
« Reply #10 on: September 03, 2004, 11:57:01 am »
how do i make mame use the ctrl file?
-----------------------------------------------
"Ambition makes you look pretty ugly,
kicking squeling gucci little piggy"

Minwah

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7662
  • Last login:January 18, 2019, 05:03:20 am
    • MAMEWAH
Re:Tutorial on how to write ctrlr files?
« Reply #11 on: September 03, 2004, 02:22:46 pm »
how do i make mame use the ctrl file?

Edit your mame.ini file and find/edit the 'ctrlr' line, eg:

ctrlr                   hotrodse

vputz

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 115
  • Last login:August 23, 2010, 08:16:05 am
  • I'm a llobter!
Re:Tutorial on how to write ctrlr files?
« Reply #12 on: September 04, 2004, 01:33:32 am »
OK, here's something that wasn't clear to me on the ctrlr business--

I think I understand how to write the ctrlr files.  But I wasn't clear on the business of writing a file for each type of control, or for families of games; that confuses me.

For example, I'd like to have a ctrlr file loaded for all games using "dual fisted joysticks" (crazy climber, robotron, smash tv, etc).  Is there a way to have that automatically done?

Learning much,
-->VPutz

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Today at 01:05:18 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re:Tutorial on how to write ctrlr files?
« Reply #13 on: September 04, 2004, 09:17:55 am »
Nope:

mame supports:

Screentype.ini (raster or vector)

driver.ini (bios or romof)

clone.ini

parent.ini


they are loaded in that order in a hierarchy, so if you define something in raster.ini it'll apply to all raster games unless the driver or ect ini for that game overrides it specifically.  



Ctrlr files are not a hard concept to grasp at all, if you remember those two key things.  


About the new xml files......  There aren't different files for each driver, clone, ect. You have a "system" entry which defines that.  This is why I said make them in the old format and let my converter fix them.  It makes a lot more sense to have a folder named whatever with all of your various ini files and have my converter automatically merge the contents of that folder into one big xml file (with proper system entries in tact of course) than to try to follow an endless 40 page nightmare. ;)


u_rebelscum

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3633
  • Last login:April 21, 2010, 03:06:26 pm
  • You rebel scum
    • Mame:Analog+
Re:Tutorial on how to write ctrlr files?
« Reply #14 on: September 04, 2004, 02:56:12 pm »
It makes a lot more sense to have a folder named whatever with all of your various ini files and have my converter automatically merge the contents of that folder into one big xml file (with proper system entries in tact of course) than to try to follow an endless 40 page nightmare. ;)

Amen
Robin
Knowledge is Power

CrispyXUK2

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 26
  • Last login:July 26, 2006, 11:49:06 am
  • minty
Re:Tutorial on how to write ctrlr files?
« Reply #15 on: September 06, 2004, 02:15:32 pm »
are there any apps available to create these ctrlr files? or is anyone working on one?
-----------------------------------------------
"Ambition makes you look pretty ugly,
kicking squeling gucci little piggy"

clanggedin

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1071
  • Last login:July 02, 2012, 11:08:55 pm
  • O'DOYLE RULES!!!
Re:Tutorial on how to write ctrlr files?
« Reply #16 on: September 06, 2004, 03:22:07 pm »
There is a program that converts the old format to the new format. Other than that there is nothing.

u_rebelscum

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3633
  • Last login:April 21, 2010, 03:06:26 pm
  • You rebel scum
    • Mame:Analog+
Re:Tutorial on how to write ctrlr files?
« Reply #17 on: September 07, 2004, 02:58:10 pm »
are there any apps available to create these ctrlr files? or is anyone working on one?

Mame is your best bet.  

Play a game, open up the resulting cfg/*.cfg file and copy from "<system..." to </system>" into the ctrlr file you're using.  Then edit it (if needed) and save.
Robin
Knowledge is Power

Minwah

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7662
  • Last login:January 18, 2019, 05:03:20 am
    • MAMEWAH
Re:Tutorial on how to write ctrlr files?
« Reply #18 on: September 07, 2004, 06:08:22 pm »
Play a game, open up the resulting cfg/*.cfg file and copy from "<system..." to </system>" into the ctrlr file you're using.  Then edit it (if needed) and save.

I was thinking, is there any need using the ctrlr files anymore?  Dumb question I know but what I mean is, will the new .cfg files get outdated over time?  Seems to me with the xml format it shouldn't be so much of a problem as the old cfg files... I'm sure I'm wrong, or the mame devs would've removed ctrlr support altogether...

u_rebelscum

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3633
  • Last login:April 21, 2010, 03:06:26 pm
  • You rebel scum
    • Mame:Analog+
Re:Tutorial on how to write ctrlr files?
« Reply #19 on: September 08, 2004, 12:33:46 am »
I was thinking, is there any need using the ctrlr files anymore?  Dumb question I know but what I mean is, will the new .cfg files get outdated over time?  Seems to me with the xml format it shouldn't be so much of a problem as the old cfg files... I'm sure I'm wrong, or the mame devs would've removed ctrlr support altogether...

Currently, AFAIK:

cfg/cfg: All inputs used in the game needs to be listed.  Also does inputs and other stuff (counters and mixers).

ctrlr/cfg:  You can pick and choose what inputs you want to include (one button, all inputs, even not used input). Only reads the input part (not counters and mixers).

---

cfg/cfg: Game and default.

ctrlr/cfg: Game, parent, driver ("neogeo"), and default.

---

cfg/cfg: Can have problems if driver is changed (inputs, counters, and/or mixers)

ctrlr/cfg: Will ignore unused parts (designed to be "forward comptable").
Robin
Knowledge is Power

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Today at 01:05:18 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re:Tutorial on how to write ctrlr files?
« Reply #20 on: September 09, 2004, 12:32:08 pm »
Also, by default.. the internal addresses are used in cfg files instead of regular constants.  So writing to them is easy, but reading from them is a different story.  They are readable in the sense that you know which input constants are used for that game and analog inputs are fairly readable.... other than that, not so much.

Also the biggest issue is one rebel went over.  Cfg files aren't permenant.  If the driver is changed usually the cfg file is overwritten to avoid conflicts. (Or you have to manually remove it, it just depends.)


However I'll be working on utilites in the future that'll take advantage of some of mame's oddities to fix control related annoyances.  One of which is a nullifier which takes all hardcoded keys (which ctrlr files can't write over) and sets them to none.  (which ctrlr files CAN write over).  

Minwah

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7662
  • Last login:January 18, 2019, 05:03:20 am
    • MAMEWAH
Re:Tutorial on how to write ctrlr files?
« Reply #21 on: September 09, 2004, 02:07:00 pm »
I'll be working on utilites in the future that'll take advantage of some of mame's oddities to fix control related annoyances.  One of which is a nullifier which takes all hardcoded keys (which ctrlr files can't write over) and sets them to none.  (which ctrlr files CAN write over).  

Sounds good...and thanks for explaining chaps :)

simplygriff

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 400
  • Last login:January 10, 2008, 10:05:05 am
    • simplygriff.com
Re:Tutorial on how to write ctrlr files?
« Reply #22 on: September 09, 2004, 03:10:38 pm »
I know I'm coming in late on this but...
If I upgrade from the old .cfg system (0.82) will I have to reconfigure all my games with the new XML system (0.86)?  Or is that what Howard's converter is for?  Did they totally do away with the ctrlr files?  I tried to write a ctrlr file a while back and had some problems with mame finding my joysticks because I'm using a PS2 to USB adapter.  SO I gave up and have just been gradually configuring things through the tab menu.  Will I have to redo all this if I upgrade form 0.82 to 0.86 or do the .cfg files transfer over?
-G
www.simplygriff.com
art : videogames : transformers : life

Live, but Under Heavy Construction

u_rebelscum

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3633
  • Last login:April 21, 2010, 03:06:26 pm
  • You rebel scum
    • Mame:Analog+
Re:Tutorial on how to write ctrlr files?
« Reply #23 on: September 10, 2004, 02:32:22 pm »
I know I'm coming in late on this but...
If I upgrade from the old .cfg system (0.82) will I have to reconfigure all my games with the new XML system (0.86)?  Or is that what Howard's converter is for?  Did they totally do away with the ctrlr files?  I tried to write a ctrlr file a while back and had some problems with mame finding my joysticks because I'm using a PS2 to USB adapter.  SO I gave up and have just been gradually configuring things through the tab menu.  Will I have to redo all this if I upgrade form 0.82 to 0.86 or do the .cfg files transfer over?
-G

The old cfg/cfg files do not transfer over.  This was always the problem with the old, binary cfg/cfg; if anything in the driver changed in the new mame, the cfg/cfg from the last mame might need to be deleted.  It's just this time you know it needs to be.

HC's app converts the old ctrlr/ini files to the new ctrlr/cfg files.

This time, use ctrlr files!  (Or at least backup the cfg/cfg files you remake in the ctrlr folder.)
Robin
Knowledge is Power

simplygriff

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 400
  • Last login:January 10, 2008, 10:05:05 am
    • simplygriff.com
Re:Tutorial on how to write ctrlr files?
« Reply #24 on: September 11, 2004, 10:54:19 am »
Aw Hell! >:( ;D

Guess I'm gonna have a lot of configuring to do when I get my setup back together.  Guess that's half the fun isn't it.:)
-G
www.simplygriff.com
art : videogames : transformers : life

Live, but Under Heavy Construction

hulkster

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2382
  • Last login:September 05, 2021, 04:27:59 pm
  • HulkaMAMEia is runnin' wild!
Re:Tutorial on how to write ctrlr files?
« Reply #25 on: September 18, 2004, 10:35:30 am »
just a suggestion after reading this old post....why doesnt someone post the ctrlr files for download somewhere.  i KNOW they wont be the same for everybody since the buttons arent mapped the same everywhere, but at least if it was close, they could just download the files and then change the letters....therefore not having to ask questions on this board so much.  just a thought?  lazy? yes, but it might save you a little grief instead of having answer these questions over and over again.

clanggedin

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1071
  • Last login:July 02, 2012, 11:08:55 pm
  • O'DOYLE RULES!!!
Re:Tutorial on how to write ctrlr files?
« Reply #26 on: September 18, 2004, 04:13:38 pm »
I just want the ctrlr file for Mortal Kombat

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:Tutorial on how to write ctrlr files?
« Reply #27 on: September 18, 2004, 08:37:13 pm »
I just want the ctrlr file for Mortal Kombat

This little subsection will do it for the first player on a HotRod SE, or on any panel with the player 1 buttons in the order left-control, left-alt, space, left-shift, z, and x. (MAME defaults)

        <system name="mk">
           <input>
           <port type="P1_BUTTON1">
              <newseq type="standard">KEYCODE_LSHIFT</newseq>
           </port>
           <port type="P1_BUTTON2">
              <newseq type="standard">KEYCODE_LALT OR KEYCODE_Z</newseq>
           </port>
           <port type="P1_BUTTON3">
              <newseq type="standard">KEYCODE_X</newseq>
           </port>
           <port type="P1_BUTTON4">
              <newseq type="standard">KEYCODE_LCONTROL</newseq>
           </port>
           <port type="P1_BUTTON5">
              <newseq type="standard">KEYCODE_SPACE</newseq>
           </port>
           </input>
        </system>
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!