Mame controls driving me crazy... again !

MAME Gurus come to your aide to help you. Please use the search before adding a topic. This will help cut down on having multiple topics with the same subject.
Voljega
Mame Addict Supreme
Mame Addict Supreme
Posts: 74
Joined: August 13th, 2015, 10:38 am

Mame controls driving me crazy... again !

Post by Voljega » August 21st, 2015, 6:39 am

Well I was determined that I could end my control problems once and for all this time but no !

I have a problem in gun games (or any games) where bizarrely mame by default maps button 2 of the game to mouse button 2 (which is the third, the left being 0, the right being 1)

So I edited my general controls with TAB and put for button 2 control : mouse 1 instead of mouse 2.

It works fine until I quit MAME, well to be more clear until I quit the UI MamePlus. Then it comes back to what it was before but not on every relaunching of MamePlus ! Sometimes it seems to take two or three relaunching to reset the controls.

Now I noticed a strange thing : sometimes when I edit the control, its color turns to grey after validating the change and it stays that way even after relaunching.
Once I even edited general controls for player 1 , the corresponding control line turned to grey, and when I came on players control general selection I noticed the entry for player 8 turned to... blue ??!! I got inside the entry for player 8 but there was nothing fishy like conflicts or something, everything seemed normal.

Well my problem is to keep my edited control that way and not to have them changed every time i quit my MamePlus UI

I must also say that I don't think I tried to modify controls only for the game to see if the problem is the same.

Any idea ? I just had one pop in my mind, that the cfg file for my MAME CMD is maybe read only but I couldn't verify it.

And I would still like to know what the grey and blue change of color means ?

BTW my MamePlus UI is 1.8.0, latest version I could find (still full of basic bug and pretty ugly) and my MAME CMD is 0.152

User avatar
Incito
Founder
Founder
Posts: 2097
Joined: June 5th, 2008, 3:20 pm
Favorite Game: Marvel vs. Capcom 2
Location: Metro City
Contact:

Re: Mame controls driving me crazy... again !

Post by Incito » August 21st, 2015, 7:55 am

First off, 1.8.0? Please verify the version again. Is this your UI or MAME version?

Not sure about the color thing, but the abilty to not save the changes after you close the UI could be a permissions issue. Where on your PC is the MAME folder placed?
What OS are you running?
Try putting mame in your documents folder where you know you have permissions.

Perhaps the color thing is tied to the above, but I can say for certain as I have not experienced this.

Voljega
Mame Addict Supreme
Mame Addict Supreme
Posts: 74
Joined: August 13th, 2015, 10:38 am

Re: Mame controls driving me crazy... again !

Post by Voljega » August 21st, 2015, 10:49 am

Yeah 1.8.0 as is said is my UI version (of MamePlusGUI or Mame+GUI). I know the name of this thing is confusing (it's not the same as MameUI Plus! it's an ugly little thing programmed in Qt) but as I said in my message it is only a standalone UI using a MAME CMD 0.152
There are so many versions of Mame CMD or Mame with an integrated GUI which are closely named it's so difficult to understand what is going one

I'm on Windows 7 so permissions is not an issue I think (it's in a c:\Emu folder and my user has admin privileges) but you're right I should try executing MAME as an administrator, I'll try that !

Voljega
Mame Addict Supreme
Mame Addict Supreme
Posts: 74
Joined: August 13th, 2015, 10:38 am

Re: Mame controls driving me crazy... again !

Post by Voljega » August 21st, 2015, 4:13 pm

I managed to test it better.

First to be more precise the exact name of the GUI is Mame+ 1.8.0 and the about mentions "a qt implementation of MameUI". The file is named mamepgui.exe

The mame CMD it is using is a 0.152 version but the name of the executable file is mamep64.exe

The ./cfg directory was indeed in read-only mode I modified that and put it in write mode along with all the files it contains.
Now I can't find any general file in it and I remember to have read it here there should be a file used for registering custom general input buttons which can be deleted to go back to default configuration but I can't find it.

I also modified the properties of both .exe to launch them as administrator.

All that seems to have corrected my issue a little bit :
- The modifications I now enter for the mouse and the joystick button are kept from launch to launch
- The colors in the inputs menu (accessible ingame through TAB) are still there : the blue color seems to appears as a graphical bug when some selection is made but is not important I think
- More annoying, all manually modified command for general inputs always appear in gray, even after exiting the GUI and relaunching it
- Now is a more tricky part : if I exit the GUI, unplug the joystick, relaunch the GUI for all command which had joystick button input, the joystick inputs disappear. This could be a feature but the following happens : if I exit the GUI, replug the joystick, relaunch the GUI, launch a game and go into TAB menu : now all modified gray command have lost their joystick inputs. Modified keyboard and mouse inputs still appears in modified command but not the joystick input.
The white command (not manually modified) has recovered its joystick inputs

Now I'm afraid I'm not that clear so let's describe the following.
I have the following commands :
Button 1 : KB ctrl, Mouse 1 Button 0, Joystick 1 Button 0
I have manually modified the Button 2 :
Button 2 : KB alt, Mouse 1 Button 1, Joystick 1 Button 1
The command line for Button 2 is now always going to appear gray.

No if do the following :
- Exit TAB menu, exit game, exit GUI
- Unplug joystick, launch GUI, launch game (the bug may not appear if I'm not launching a game and thus MAME cmd but I'm not 100% sure), exit game, exit GUI
- Plug joystick, launch GUI, launch game, go into TAB menu and general inputs for player 1

I now have the following :
Button 1 : KB ctrl, Mouse 1 Button 0, Joystick 1 Button 0
Button 2 : KB alt, Mouse 1 Button 1

I lost my joystick entry for my previously manually modified entry and only for that one

I'm sure I've read on this very forum someone who had the same issue but from what I recall, nobody was able to help him, it may even be a mame cmd bug

I'd like to see that general mame config file for inputs, though

User avatar
Hierophant
Site Administrator
Site Administrator
Posts: 3456
Joined: December 11th, 2008, 8:41 pm
Favorite Game: Alien vs Predator
Location: LV-426 Acheron
Contact:

Re: Mame controls driving me crazy... again !

Post by Hierophant » August 22nd, 2015, 3:59 am

Much of what I could take in from your description actually sounds like the normal behaviour of MAME. The most straightforward thing I can say is this: Always launch games with the joystick plugged in to keep its modified settings.

Voljega
Mame Addict Supreme
Mame Addict Supreme
Posts: 74
Joined: August 13th, 2015, 10:38 am

Re: Mame controls driving me crazy... again !

Post by Voljega » August 22nd, 2015, 4:26 pm

Well in that case it seems to be a beautiful case of "it's not a bug it's a feature!".

Let's imagine for a second that I launch my GUI with my xbox360 or any bluetooth controller and before launching a game, the battery dies I wouldn't lose any tweaked configuration for the joystick ? That's pretty lame.

Anyway the workaround is to do a regular save of the file containing the general inputs settings. Where can I find that one ? It's not in the mame.ini at the root of mame folder.

Voljega
Mame Addict Supreme
Mame Addict Supreme
Posts: 74
Joined: August 13th, 2015, 10:38 am

Re: Mame controls driving me crazy... again !

Post by Voljega » August 22nd, 2015, 4:34 pm

Found it through this good site which may be pretty useful to anyone having basic mame troubles :
http://easyemu.mameworld.info/mameguide ... index.html

The related files, containing only the custom commands is in ./cfg/default.cfg

User avatar
Incito
Founder
Founder
Posts: 2097
Joined: June 5th, 2008, 3:20 pm
Favorite Game: Marvel vs. Capcom 2
Location: Metro City
Contact:

Re: Mame controls driving me crazy... again !

Post by Incito » August 23rd, 2015, 4:48 pm

My youtube video talks about the .ini with cmd and gui.
https://youtu.be/t82rG0UMzFs?list=PL0CABFEF11F175A7A

My inputs do not erase when I remove my gamepad from my laptop. The arcade itself never has the controller removed.
The video will show you some command line and where to find all the commands.

Voljega
Mame Addict Supreme
Mame Addict Supreme
Posts: 74
Joined: August 13th, 2015, 10:38 am

Re: Mame controls driving me crazy... again !

Post by Voljega » August 25th, 2015, 5:34 am

Thantk you i'll look at it as soon as possible.

So Hierophant and Incito you apparently don't agree on the automatic removal of custom joystick command when starting MAME CMD without a connected joystick ?
For Hierophant this happens and this a standard thing for MAME, but you Incito don't have a issue.

Which versions of MAME CMD are both of you using (standalone or embedded in a GUI) and could it be the issue ?
Or maybe some obscure configuration general option which is or isn't checked ?

I solved the issue by creating a .bak copy of the default.cfg to reuse if I inadvertently starts MAME without joystick connected...

User avatar
Hierophant
Site Administrator
Site Administrator
Posts: 3456
Joined: December 11th, 2008, 8:41 pm
Favorite Game: Alien vs Predator
Location: LV-426 Acheron
Contact:

MAME Controller Configuration Losing Saved Settings

Post by Hierophant » August 26th, 2015, 12:57 am

I agree with Incito that, on its own, simply removing a controller from a PC will have no affect on its MAME configuration. However, what's specifically being discussed here is what happens to a controller configuration after a game is launched and no controller is detected by MAME. I've been aware of the results for a long time, at least as far back as when I wrote the MAME FAQs in 2009:
Hierophant in MAME FAQs, Q9. wrote:
Assuming you want to use a controller for most games, always have one plugged in before opening MAME and make sure it's recognised in your PC's devices.
I'll break it down thoroughly, step by step.


*****


MAME Controller Configuration Losing Saved Settings


For this demonstration I'm using MAMEUI64 0.163 with the most default settings possible. In any case, the behaviour I'm about to show has been the same for as long as I can remember since using MAME, the first one being MAMEUIFX32 0.128 in 2008.


1. MAME Default

To begin, have a controller plugged into the PC and working. I'm using an arcade fight stick. Open MAME and launch a game. It can be any game, really, but I'm using Aliens, Konami, 1990. Press the tab key to open the options menu. Go to 'Input (this Machine)'. All of the following also applies to 'Input (general)' or any other menu item where you might apply controller input. Here's how the default MAME settings look for Aliens:

Image


2. Configure Controller

Map the desired inputs to the controller. It's easy to see the modified settings since they are now grey instead of white:

Image

Exit MAME. There is now an auto-generated aliens.cfg file in my CFG folder containing the settings I just made:

Code: Select all

<?xml version="1.0"?>
<!-- This file is autogenerated; comments and unknown tags will be stripped -->
<mameconfig version="10">
    <system name="aliens">
        <counters>
            <coins index="0" number="3" />
        </counters>
        <input>
            <port tag=":P1" type="P1_JOYSTICK_LEFT" mask="1" defvalue="1">
                <newseq type="standard">
                    JOYCODE_1_HATSWITCHL
                </newseq>
            </port>
            <port tag=":P1" type="P1_JOYSTICK_RIGHT" mask="2" defvalue="2">
                <newseq type="standard">
                    JOYCODE_1_HATSWITCHR
                </newseq>
            </port>
            <port tag=":P1" type="P1_JOYSTICK_UP" mask="4" defvalue="4">
                <newseq type="standard">
                    JOYCODE_1_HATSWITCHU
                </newseq>
            </port>
            <port tag=":P1" type="P1_JOYSTICK_DOWN" mask="8" defvalue="8">
                <newseq type="standard">
                    JOYCODE_1_HATSWITCHD
                </newseq>
            </port>
            <port tag=":P1" type="P1_BUTTON1" mask="16" defvalue="16">
                <newseq type="standard">
                    JOYCODE_1_BUTTON3
                </newseq>
            </port>
            <port tag=":P1" type="P1_BUTTON2" mask="32" defvalue="32">
                <newseq type="standard">
                    JOYCODE_1_BUTTON4
                </newseq>
            </port>
            <port tag=":P1" type="COIN1" mask="64" defvalue="64">
                <newseq type="standard">
                    JOYCODE_1_BUTTON9
                </newseq>
            </port>
            <port tag=":P1" type="START1" mask="128" defvalue="128">
                <newseq type="standard">
                    JOYCODE_1_BUTTON10
                </newseq>
            </port>
        </input>
    </system>
</mameconfig>

3. Remove Controller

Now to simulate an accidental loss of of the new settings. Intentionally remove the controller from the PC. That is the only intervention. Everything else that changes after this point is MAME's own doing. Open MAME and launch the same game again. The effect is readily apparent in the next screenshot:

Image

MAME has detected that the controller is no longer present. The start button, coin button, and action buttons 1 and 2 are gone. At this point, MAME simply calls them 'n/a' (not applicable). MAME has already restored the directional inputs to a semi-default state by changing them to keyboard arrow keys.

Exit MAME. Here's how the aliens.cfg looks now:

Code: Select all

<?xml version="1.0"?>
<!-- This file is autogenerated; comments and unknown tags will be stripped -->
<mameconfig version="10">
    <system name="aliens">
        <counters>
            <coins index="0" number="3" />
        </counters>
        <input>
            <port tag=":P1" type="P1_BUTTON1" mask="16" defvalue="16">
                <newseq type="standard">
                    JOYCODE_1_UNKNOWN_SWITCH
                </newseq>
            </port>
            <port tag=":P1" type="P1_BUTTON2" mask="32" defvalue="32">
                <newseq type="standard">
                    JOYCODE_1_UNKNOWN_SWITCH
                </newseq>
            </port>
            <port tag=":P1" type="COIN1" mask="64" defvalue="64">
                <newseq type="standard">
                    JOYCODE_1_UNKNOWN_SWITCH
                </newseq>
            </port>
            <port tag=":P1" type="START1" mask="128" defvalue="128">
                <newseq type="standard">
                    JOYCODE_1_UNKNOWN_SWITCH
                </newseq>
            </port>
        </input>
    </system>
</mameconfig>
Now to complete the process. Open MAME one last time with the controller still unplugged. Launch the same game again. By this stage, MAME has finished restoring all mouse and keyboard defaults:

Image

Exit MAME. The aliens.cfg is now totally stripped back:

Code: Select all

<?xml version="1.0"?>
<!-- This file is autogenerated; comments and unknown tags will be stripped -->
<mameconfig version="10">
    <system name="aliens">
        <counters>
            <coins index="0" number="3" />
        </counters>
    </system>
</mameconfig>

*****


Anyway, as has been discussed, the easy way around all of this is to keep backups of the CFG folder whenever any changes are made.

:V:

Post Reply