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: Help with Optical Inputs (Trackball and 2 LCD TopGuns) w/ verbose and mame.ini  (Read 2791 times)

0 Members and 1 Guest are viewing this topic.

bigster

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 204
  • Last login:June 16, 2022, 08:24:40 pm
I am sorry for yet another lightgun related thread, but after about a week of messing with my setup I simply cannot get any results.  And now I have lost my trackball input.

Ok so here is my setup, ipac32 (works great) ps2 imput, optipac usb with 1 happ trackball, 2 ems topguns running MAME 134 (ini and verbose below).

Initially when I set up mame with the optipac and one topgun (using EMS drivers) everything worked.  The trackball games used trackball and the lightgun games used the first light gun.  Now when I tried to hook up the second topgun things went wrong.  The games did not recognize it, so I tried switching drivers to Smog’s and nothing.  Also tried wingun and numerous other configurations and nothing.  Worst off now the trackball is not being recognized in mame (although windows recognizes it just fine).

I tried deleting the mame.ini and removing the guns but the trackball is still not working in mame.  I would like to get all three working, right now I have smog’s drivers for the topguns and the profiler recognizes them.  I can switch to EMS drivers if that would work better. 

If someone could help that would be great.

Here is my verbose output and relevant mame.ini.  (Note: I also had a usb keyboard connected for debugging)

Verbose
Code: [Select]
RawInput: APIs detected
Input: Adding Kbd #1: Standard 101/102-Key or Microsoft Natural PS/2 Keyboard
Input: Adding Mouse #1: HID-compliant mouse
Input: Adding Gun #1: HID-compliant mouse
Input: Adding Mouse #2: HID-compliant mouse
Input: Adding Gun #2: HID-compliant mouse
Input: Adding Mouse #3: HID-compliant mouse
Input: Adding Gun #3: HID-compliant mouse
Input: Adding Mouse #4: HID-compliant mouse
Input: Adding Gun #4: HID-compliant mouse
Input: Adding Kbd #2: HID Keyboard Device

and Mame.ini

Code: [Select]
#
# CORE INPUT OPTIONS
#
coin_lockout              1
ctrlr                     
mouse                     1
joystick                  1
lightgun                  1
multikeyboard             0
multimouse                1
steadykey                 0
offscreen_reload          1
joystick_map              auto
joystick_deadzone         0.3
joystick_saturation       0.85

#
# CORE INPUT AUTOMATIC ENABLE OPTIONS
#
paddle_device             mouse
adstick_device            mouse
pedal_device              keyboard
dial_device               mouse
trackball_device          mouse
lightgun_device           lightgun
positional_device         keyboard
mouse_device              mouse
#
# INPUT DEVICE OPTIONS
#
dual_lightgun             0

Any new suggestions would be great, this is really driving me nuts, I cannot figure it out.

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+
"Doesn't recognize" means what exactly?  Looks like mame is seeing 4 mice and 2 keyboards (4 mice = the 2 guns + 2 for optipac).

First I'd try disabling offscreen reload, testing for now.

Then try remapping in side map any analog type input (trackball analog, AD stick analog, dial analog, lightgun analog, paddle analog) in mame's remap menu.  See if mame can remap to each of the guns and or TB; if it can, what's the mouse or gun number.  If none work, try disabling mouse but leaving lightgun enabled, and then vice versa, again testing with remapping.

For best remapping guns, tab, Input (this game), scroll to your input, point both guns at middle of screen, enter, move the gun you want to near edge, and mame should register in about a second.
Robin
Knowledge is Power

bigster

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 204
  • Last login:June 16, 2022, 08:24:40 pm
Thanks for your reply.  I tried changing every configuration, and no luck...But I did find out that deleting my default.cfg and I can get it to recognize everything and everything works.  Below is my default.cfg, any ideas why it is causing problems?  When I have this file, all the buttons and joysticks work but the trackball and guns do not.  When I delete it the guns and trackball work, but my buttons are all off. 

Below is the default cfg that is causing problems. 

Code: [Select]
<mameconfig version="10">
    <system name="default">
        <input>
            <port type="P1_BUTTON1">
                <newseq type="standard">
                    KEYCODE_J OR GUNCODE_3_BUTTON1 OR MOUSECODE_1_BUTTON1
                </newseq>
            </port>
            <port type="P1_BUTTON2">
                <newseq type="standard">
                    KEYCODE_L OR GUNCODE_3_BUTTON2 OR MOUSECODE_1_BUTTON2
                </newseq>
            </port>
            <port type="P1_BUTTON3">
                <newseq type="standard">
                    KEYCODE_B
                </newseq>
            </port>
            <port type="P1_BUTTON4">
                <newseq type="standard">
                    KEYCODE_N
                </newseq>
            </port>
            <port type="P2_BUTTON1">
                <newseq type="standard">
                    KEYCODE_A OR GUNCODE_4_BUTTON1 OR MOUSECODE_1_BUTTON1
                </newseq>
            </port>
            <port type="P2_BUTTON2">
                <newseq type="standard">
                    KEYCODE_S OR GUNCODE_4_BUTTON2 OR MOUSECODE_1_BUTTON1
                </newseq>
            </port>
            <port type="P1_LIGHTGUN_X">
                <newseq type="standard">
                    GUNCODE_3_XAXIS
                </newseq>
            </port>
            <port type="P2_LIGHTGUN_X">
                <newseq type="standard">
                    GUNCODE_4_XAXIS
                </newseq>
            </port>
            <port type="P1_LIGHTGUN_Y">
                <newseq type="standard">
                    GUNCODE_3_YAXIS
                </newseq>
            </port>
            <port type="P2_LIGHTGUN_Y">
                <newseq type="standard">
                    GUNCODE_4_YAXIS
                </newseq>
            </port>
        </input>
    </system>
</mameconfig>

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+
I'm still not clear on what you mean by "does not work".  Is only in some games?  Is it also when you try to remap with in mame?  Becasue the way you word it, it sounds like the latter, which a bad default.cfg shouldn't cause.  edit: you're using an older cfg format; see below for correct format.  If it's the former, I'll need more info on exactly which doesn't work exactly when.

For now, if mame wrote out the defaults, this is would those same ports in your's:
Code: [Select]
<?xml version="1.0"?>
<!-- This file is autogenerated; comments and unknown tags will be stripped -->
<mameconfig version="10">
    <system name="default">
        <input>
            <port type="P1_BUTTON1">
                <newseq type="standard">
                    KEYCODE_LCONTROL OR JOYCODE_1_BUTTON1_SWITCH OR MOUSECODE_1_BUTTON1 OR GUNCODE_1_BUTTON1
                </newseq>
            </port>
            <port type="P1_BUTTON2">
                <newseq type="standard">
                    KEYCODE_LALT OR JOYCODE_1_BUTTON2_SWITCH OR MOUSECODE_1_BUTTON3 OR GUNCODE_1_BUTTON2
                </newseq>
            </port>
            <port type="P1_BUTTON3">
                <newseq type="standard">
                    KEYCODE_SPACE OR JOYCODE_1_BUTTON3_SWITCH OR MOUSECODE_1_BUTTON2
                </newseq>
            </port>
            <port type="P1_BUTTON4">
                <newseq type="standard">
                    KEYCODE_LSHIFT OR JOYCODE_1_BUTTON4_SWITCH
                </newseq>
            </port>
            <port type="P2_BUTTON1">
                <newseq type="standard">
                    KEYCODE_A OR JOYCODE_2_BUTTON1_SWITCH OR MOUSECODE_2_BUTTON1_SWITCH OR GUNCODE_2_BUTTON1_SWITCH
                </newseq>
            </port>
            <port type="P2_BUTTON2">
                <newseq type="standard">
                    KEYCODE_S OR JOYCODE_2_BUTTON2_SWITCH OR MOUSECODE_2_BUTTON3_SWITCH OR GUNCODE_2_BUTTON2_SWITCH
                </newseq>
            </port>
            <port type="P1_LIGHTGUN_X">
                <newseq type="standard">
                    GUNCODE_1_XAXIS OR MOUSECODE_1_XAXIS OR JOYCODE_1_XAXIS_ABSOLUTE
                </newseq>
                <newseq type="decrement">
                    KEYCODE_RIGHT OR JOYCODE_1_XAXIS_RIGHT_SWITCH
                </newseq>
                <newseq type="increment">
                    KEYCODE_LEFT OR JOYCODE_1_XAXIS_LEFT_SWITCH
                </newseq>
            </port>
            <port type="P2_LIGHTGUN_X">
                <newseq type="standard">
                    GUNCODE_2_XAXIS_ABSOLUTE OR MOUSECODE_2_XAXIS_RELATIVE OR JOYCODE_2_XAXIS_ABSOLUTE
                </newseq>
                <newseq type="decrement">
                    KEYCODE_G OR JOYCODE_2_XAXIS_RIGHT_SWITCH
                </newseq>
                <newseq type="increment">
                    KEYCODE_D OR JOYCODE_2_XAXIS_LEFT_SWITCH
                </newseq>
            </port>
            <port type="P1_LIGHTGUN_Y">
                <newseq type="standard">
                    GUNCODE_1_YAXIS OR MOUSECODE_1_YAXIS OR JOYCODE_1_YAXIS_ABSOLUTE
                </newseq>
                <newseq type="decrement">
                    KEYCODE_DOWN OR JOYCODE_1_YAXIS_DOWN_SWITCH
                </newseq>
                <newseq type="increment">
                    KEYCODE_UP OR JOYCODE_1_YAXIS_UP_SWITCH
                </newseq>
            </port>
            <port type="P2_LIGHTGUN_Y">
                <newseq type="standard">
                    GUNCODE_2_YAXIS_ABSOLUTE OR MOUSECODE_2_YAXIS_RELATIVE OR JOYCODE_2_YAXIS_ABSOLUTE
                </newseq>
                <newseq type="decrement">
                    KEYCODE_F OR JOYCODE_2_YAXIS_DOWN_SWITCH
                </newseq>
                <newseq type="increment">
                    KEYCODE_R OR JOYCODE_2_YAXIS_UP_SWITCH
                </newseq>
            </port>
        </input>
    </system>
</mameconfig>

A minor The only thing your's is missing is the very first line, which I think is needed.  Try adding just the first line to the frount of your's.  (The second line is just a comment and is ignored by mame anyway, so it's not needed.) 

edit:
The big thing is your format is short:
GUNCODE_4_YAXIS
should be
GUNCODE_4_YAXIS_ABSOLUTE
« Last Edit: October 13, 2009, 06:31:58 pm by u_rebelscum »
Robin
Knowledge is Power

bigster

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 204
  • Last login:June 16, 2022, 08:24:40 pm
Sorry for the confusion.  When I have that config file, the trackball and guns do not work in ANY games.  If I try to reconfigure inputs and press a mouse button (either the trackball button or the lightgun trigger) nothing happens.  If I delete the config file and load  area 51 (gun game) the guns work, same goes for the trackball if I test it with no config file.  

This is so odd.  I guess if I really wanted to I could just use the mame default buttons, but it just makes playing other windows based games/emulators difficult with that button combination.  

As for the missing ABSOLUTE, that was my fault, I was test it with and without the absolute in there.  

It seems that something in the default.cfg is keeping the inputs from working, just odd.  
« Last Edit: October 13, 2009, 08:06:11 pm by bigster »

bigster

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 204
  • Last login:June 16, 2022, 08:24:40 pm
Thanks for all your help rebel.  I figured it out, the default was missing somethings, after I added _absolute and _relative to the mousecodes and the decrement and increment values, mame  started to recognize the optical devices in my games again!!

I am pretty sure my cabinet is finally done!!!!!!!!!!!!

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+
Thanks for all your help rebel.  I figured it out, the default was missing somethings, after I added _absolute and _relative to the mousecodes and the decrement and increment values, mame  started to recognize the optical devices in my games again!!

I am pretty sure my cabinet is finally done!!!!!!!!!!!!

Great!  Have fun! :cheers:
Robin
Knowledge is Power