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: Mame .cfg schema question  (Read 4549 times)

0 Members and 1 Guest are viewing this topic.

arzoo

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2093
  • Last login:January 26, 2025, 08:51:53 am
  • Robots WILL kill you.
    • LEDBlinky
Mame .cfg schema question
« on: October 30, 2009, 02:13:00 pm »
Hey all -
I've been working with a LEDBlinky user who's having problems when he remaps controls. Here's his asteroid.cfg file:
Code: [Select]
<?xml version="1.0"?>
<!-- This file is autogenerated; comments and unknown tags will be stripped -->
<mameconfig version="10">
    <system name="asteroid">
        <input>
            <port tag="IN0" type="P1_BUTTON5" mask="8" defvalue="0">
                <newseq type="standard">
                    DEFAULT
                </newseq>
            </port>
            <port tag="IN0" type="P1_BUTTON3" mask="16" defvalue="0">
                <newseq type="standard">
                    DEFAULT
                </newseq>
            </port>
            <port tag="IN1" type="P1_BUTTON4" mask="32" defvalue="0">
                <newseq type="standard">
                    DEFAULT
                </newseq>
            </port>
            <port tag="IN1" type="P1_BUTTON2" mask="64" defvalue="0">
                <newseq type="standard">
                    KEYCODE_LCONTROL
                </newseq>
            </port>
            <port tag="IN1" type="P1_BUTTON1" mask="128" defvalue="0">
                <newseq type="standard">
                    KEYCODE_LALT
                </newseq>
            </port>
        </input>
    </system>
</mameconfig>

The reason LEDBlinky is not working correctly is because the code is not expecting "DEFAULT" as a keycode. I've never seen this value before and I don't think any version of mame I've used can generate this value.

<port tag="IN0" type="P1_BUTTON5" mask="8" defvalue="0">
   <newseq type="standard">
      DEFAULT
   </newseq>
</port>

Does that value indicate that the button should use the keycode from the default.cfg file? How does that value get set? Any help or elaboration would be greatly appreciated.

Thanks,
arzoo
Robots will kill you.



Arcade Addiction

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: Mame .cfg schema question
« Reply #1 on: October 30, 2009, 06:09:53 pm »
Does that value indicate that the button should use the keycode from the default.cfg file? How does that value get set? Any help or elaboration would be greatly appreciated.

Sort answer: Yes, it tells mame to use the default.cfg, sort of. ;)

Long answer: Mame saves three* input maps: internal global defaults, global "remaps", and game specific "remaps".  The default.cfg file effects the second, and game specific.cfg the last.  (the first is set in the source.)  Normally, both the default.cfg and gamespecific.cfg are completely set to "DEFAULT", which means mame looks at the next higher level.  Since mame doesn't save in either default.cfg or gamespecific.cfg the defaults, you don't see it.  There is one exception.  If the game driver remaps in source the buttons, that game's default isn't "DEFAULT", but whatever is hardcoded in the source.*  (Such as asteroids.)  So if you remap mame to use the global "DEFAULT", mame has to save it.

So "DEFAULT" means "check the next higher up list


BTW, what mame version is he using?  This was broken a couple times, and I thought currently was.  (I need to retest at home.)


*TMI answer: Technically, mame has another input map: game specific defaults.  This list is only used to see if mame needs to if the input were changed, and if not don't save that input.  It is out of the check the higher hierarchy.


If I'm not clear, sorry.  Let me know where I went into left field. ;D
Robin
Knowledge is Power

mark6437

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 181
  • Last login:March 23, 2020, 03:20:11 pm
  • THB2
Re: Mame .cfg schema question
« Reply #2 on: October 30, 2009, 07:51:40 pm »
u_rebelscum, It is me he is helping. Me again, same guy that you answered the U-Trak mouse button question for   :notworthy:

I am using .133u3 mame.exe but I am using .134 roms, and thre is a reason for this.

Short reason is because I couldnt figure out how to compile on my own, ever tried headkazes program. I got frustrated.

So I was on the highscore page and they have a download able mame.exe 133u3 that MKCHAMP compiled that has highscore in it:
http://highscore.mameworld.info/download.htm

So I figured I would use that since its already done. And it is working :)

arzoo is helpig me with Asteroids because after I remap the controls in mame to what i want, I go back into the game and the speak and blink is off. Even though in controls editor its right. So he had me send him the debug. Thats where we are at  :banghead:

THX!
Mark

arzoo

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2093
  • Last login:January 26, 2025, 08:51:53 am
  • Robots WILL kill you.
    • LEDBlinky
Re: Mame .cfg schema question
« Reply #3 on: October 30, 2009, 09:05:36 pm »

Sort answer: Yes, it tells mame to use the default.cfg, sort of. ;)

Long answer: Mame saves three* input maps: internal global defaults, global "remaps", and game specific "remaps".  The default.cfg file effects the second, and game specific.cfg the last.  (the first is set in the source.)  Normally, both the default.cfg and gamespecific.cfg are completely set to "DEFAULT", which means mame looks at the next higher level.  Since mame doesn't save in either default.cfg or gamespecific.cfg the defaults, you don't see it.  There is one exception.  If the game driver remaps in source the buttons, that game's default isn't "DEFAULT", but whatever is hardcoded in the source.*  (Such as asteroids.)  So if you remap mame to use the global "DEFAULT", mame has to save it.

So "DEFAULT" means "check the next higher up list


BTW, what mame version is he using?  This was broken a couple times, and I thought currently was.  (I need to retest at home.)


*TMI answer: Technically, mame has another input map: game specific defaults.  This list is only used to see if mame needs to if the input were changed, and if not don't save that input.  It is out of the check the higher hierarchy.


If I'm not clear, sorry.  Let me know where I went into left field. ;D

Thanks rebel for the info - makes perfect sense. I have a pretty good handle on how the source/default.cfg/game.cfg hierarchy works - but I did not know about the game drivers that remap in source. And I guess it doesn't work in the versions of mame I've used because I've never seen this before. So now I'll update LEDBlinky to handle this case.

Thanks for the help!!!  :cheers:
Robots will kill you.



Arcade Addiction