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 --- Bug Reports --- Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Illuminating the Qbert joystick  (Read 210 times)

0 Members and 1 Guest are viewing this topic.

aesculus

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 8
  • Last login:Yesterday at 08:51:01 pm
  • I want to build my own arcade controls!
Illuminating the Qbert joystick
« on: April 14, 2019, 10:38:57 pm »
I'm using an 8-way joystick and mame is set to use double inputs for control (pushing down and left sends N and U). This configuration is apparently confounding LEDBlinky because it won't light the stick or identify the controls with voice. If I change the inputs to singles (1 key per direction of the stick) then LEDBlinky works as expected, but of course the game isn't playable that way. I've tried defining the JOYSTICK1 color in colors.ini as well as using the LEDBlinky controls config utility, but I can't get it to work. Is it just not possible to use this configuration?

aesculus

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 8
  • Last login:Yesterday at 08:51:01 pm
  • I want to build my own arcade controls!
Re: Illuminating the Qbert joystick
« Reply #1 on: April 15, 2019, 11:34:48 am »
So I've tried defining the diagonal directionals using OR (like N OR U) and that actually made LEDBlinky happy. But it's not ideal. So I tried changing the 4 instances of OR to AND in the qbert.cfg file and guess what? It worked! But...

After exiting Qbert and then running it again, it no longer works. MAME removes all the ANDs from the file and then LEDBlinky won't work right.

Just for clarification, here is what I do to the cfg manually:
Code: [Select]
<input>
            <port tag=":DSW" type="DIPSWITCH" mask="1" defvalue="0" value="1" />
            <port tag=":IN4" type="P1_JOYSTICK_RIGHT" mask="1" defvalue="0">
                <newseq type="standard">
                    KEYCODE_M AND KEYCODE_J
                </newseq>
            </port>
            <port tag=":IN4" type="P1_JOYSTICK_LEFT" mask="2" defvalue="0">
                <newseq type="standard">
                    KEYCODE_U AND KEYCODE_N
                </newseq>
            </port>
            <port tag=":IN4" type="P1_JOYSTICK_UP" mask="4" defvalue="0">
                <newseq type="standard">
                    KEYCODE_M AND KEYCODE_U
                </newseq>
            </port>
            <port tag=":IN4" type="P1_JOYSTICK_DOWN" mask="8" defvalue="0">
                <newseq type="standard">
                    KEYCODE_N AND KEYCODE_J
                </newseq>
            </port>
        </input>

And here is what MAME does with it after running the rom once:
Code: [Select]
<input>
            <port tag=":DSW" type="DIPSWITCH" mask="1" defvalue="0" value="1" />
            <port tag=":IN4" type="P1_JOYSTICK_RIGHT" mask="1" defvalue="0">
                <newseq type="standard">
                    KEYCODE_M KEYCODE_J
                </newseq>
            </port>
            <port tag=":IN4" type="P1_JOYSTICK_LEFT" mask="2" defvalue="0">
                <newseq type="standard">
                    KEYCODE_U KEYCODE_N
                </newseq>
            </port>
            <port tag=":IN4" type="P1_JOYSTICK_UP" mask="4" defvalue="0">
                <newseq type="standard">
                    KEYCODE_M KEYCODE_U
                </newseq>
            </port>
            <port tag=":IN4" type="P1_JOYSTICK_DOWN" mask="8" defvalue="0">
                <newseq type="standard">
                    KEYCODE_N KEYCODE_J
                </newseq>
            </port>
        </input>

Why can't LEDBlinky deal with this?

nexusmtz

  • Trade Count: (0)
  • Full Member
  • ***
  • Online Online
  • Posts: 327
  • Last login:Today at 10:12:24 pm
Re: Illuminating the Qbert joystick
« Reply #2 on: April 15, 2019, 04:13:10 pm »
I can't answer the question about LEDBlinky, but you might be able to work around the problem of it automatically reverting by manually editing the file, then setting the read-only attribute in Windows explorer.

aesculus

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 8
  • Last login:Yesterday at 08:51:01 pm
  • I want to build my own arcade controls!
Re: Illuminating the Qbert joystick
« Reply #3 on: April 15, 2019, 06:35:25 pm »
Well, that sure sounded like a good idea, so I tried it. Curiously, LEDBlinky will not illuminate the stick with the Read Only attribute on the qbert.cfg file. It doesn't matter what is in the file, it just doesn't work. But as soon as I remove the Read Only attribute, it works again. And then removes my ANDs. :/

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 7147
  • Last login:Today at 08:11:58 pm
  • Designated spam hunter
Re: Illuminating the Qbert joystick
« Reply #4 on: April 15, 2019, 06:59:19 pm »
How about this approach?

1. Save the manually modded file under a different filename like "qbert_bak.cfg".

2. Point your FE to a .bat file that does these two things:
- Copies "qbert_bak.cfg" to "qbert.cfg".
- Launches the game.


Scott
« Last Edit: April 15, 2019, 07:03:16 pm by PL1 »

aesculus

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 8
  • Last login:Yesterday at 08:51:01 pm
  • I want to build my own arcade controls!
Re: Illuminating the Qbert joystick
« Reply #5 on: April 15, 2019, 09:15:46 pm »
These are excellent suggestions, but after fiddling with it some more I've discovered that it will run once correctly no matter if Read Only is checked or not. After that, you need to change to OR within MAME and let it write the file. Then it can be changed manually again and it will run correctly once. Maddening. I think Arzoo is my only hope.

aesculus

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 8
  • Last login:Yesterday at 08:51:01 pm
  • I want to build my own arcade controls!
WORKAROUND SOLVED
« Reply #6 on: April 16, 2019, 11:12:30 am »
Since LEDBlinky likes OR when defining controls, I simply added an OR key press that I don't use in my MAME machine (]) to one of the joystick directions. Then I added it to the input code on the joystick port in the LEDBlinky input map. Voila, stick lights up.
Here is the cfg
Code: [Select]
        <input>
            <port tag=":DSW" type="DIPSWITCH" mask="1" defvalue="0" value="1" />
            <port tag=":IN4" type="P1_JOYSTICK_RIGHT" mask="1" defvalue="0">
                <newseq type="standard">
                    KEYCODE_M KEYCODE_J
                </newseq>
            </port>
            <port tag=":IN4" type="P1_JOYSTICK_LEFT" mask="2" defvalue="0">
                <newseq type="standard">
                    KEYCODE_U KEYCODE_N
                </newseq>
            </port>
            <port tag=":IN4" type="P1_JOYSTICK_UP" mask="4" defvalue="0">
                <newseq type="standard">
                    KEYCODE_M KEYCODE_U OR KEYCODE_CLOSEBRACE
                </newseq>
            </port>
            <port tag=":IN4" type="P1_JOYSTICK_DOWN" mask="8" defvalue="0">
                <newseq type="standard">
                    KEYCODE_J KEYCODE_N
                </newseq>
            </port>
        </input>

I have to say, I'm surprised that given this forum's long history nobody has asked this question before. Am I some kind of an outlier in how I do things? Or maybe I just have poor search skills.  ;)

arzoo

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1875
  • Last login:Today at 08:21:23 am
  • We are not in the 8th dimension. We are over NJ.
    • LEDBlinky
Re: Illuminating the Qbert joystick
« Reply #7 on: Yesterday at 09:54:19 am »
Sounds like you've got it working but just for reference, here's a support link on lighting up joystick(s); http://ledblinky.net/Support.htm#LightTBJoy

You are also correct that LEDBlinky doesn't correctly parse multiple input codes unless they are separated with "OR". I'll have to update the code so that it also works when the input codes are just separated with spaces. I'm not sure what version of mame started using this format - can you tell me which version of mame you're using? Thanks.
Robots will kill you.



Arcade Addiction

aesculus

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 8
  • Last login:Yesterday at 08:51:01 pm
  • I want to build my own arcade controls!
Re: Illuminating the Qbert joystick
« Reply #8 on: Yesterday at 08:51:01 pm »
I'm using 205. Speaking of workarounds, I have a problem with the trackball lighting when the primary control is the spinner. When you map the trackball LED as MOUSE_X and MOUSE_Y, LEDBlinky will light the trackball when playing games like Tempest, because the spinner uses the Y axis on the mouse. To prevent the trackball from lighting, I only map it as MOUSE_X. Is this the proper workaround for this problem, or is there a more graceful way?

arzoo

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1875
  • Last login:Today at 08:21:23 am
  • We are not in the 8th dimension. We are over NJ.
    • LEDBlinky
Re: Illuminating the Qbert joystick
« Reply #9 on: Today at 08:21:23 am »
I'm using 205. Speaking of workarounds, I have a problem with the trackball lighting when the primary control is the spinner. When you map the trackball LED as MOUSE_X and MOUSE_Y, LEDBlinky will light the trackball when playing games like Tempest, because the spinner uses the Y axis on the mouse. To prevent the trackball from lighting, I only map it as MOUSE_X. Is this the proper workaround for this problem, or is there a more graceful way?

The workaround you're using is fine - that's the way I would do it.
Robots will kill you.



Arcade Addiction