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: Emulating a 4-way joystick  (Read 2170 times)

0 Members and 1 Guest are viewing this topic.

JZSlenker

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 35
  • Last login:April 20, 2014, 10:06:50 pm
Emulating a 4-way joystick
« on: February 18, 2010, 07:17:37 am »
I know I know, lots of people have already talked about this but I have one more question.  I am fully aware that I can (or could) have put a third joystick in that is an actual 4-way joystick, or I could change the restrictor, or I could buy ultimarcs joystick.  At this point I'm not going to do either of those things.  My question is....   Somewhere I had read the following for a way to make 8-way sticks behave better on 4-way games. 

... map your inputs as such
ultimately:
UP = UP NOT UP/LEFT NOT UP/RIGHT
DOWN = DOWN NOT DOWN/LEFT NOT DOWN/RIGHT

etc.
the end result, the game only accepts the "pure" four directions.
if you push diagonal, you get no response.


Now what I did was to map things as follows
UP=UP not LEFT or UP not RIGHT
DOWN = DOWN not LEFT or DOWN not RIGHT
etc etc

This DOES make a marked difference in controllability.!  Would it be better to map it as the post suggests using the same time wording, or is the way I've done it better?

Thanks

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: Emulating a 4-way joystick
« Reply #1 on: February 18, 2010, 12:14:38 pm »
...Now what I did was to map things as follows
UP=UP not LEFT or UP not RIGHT
DOWN = DOWN not LEFT or DOWN not RIGHT
etc etc

This DOES make a marked difference in controllability.!  Would it be better to map it as the post suggests using the same time wording, or is the way I've done it better?

It makes a difference? ???

What are the differences?  Are you using a keyboard encoder, or a gamepad encoder? (Mame does extra stuff with gamepad encoders.)  What game(s) have you tested? (Games handle diagonals differently.)


Logically, what you have is the same as Up = Up. 
Why: Your map is Up = (Up not Left) or (Up not Right).  If you press up-left, mame looks at the map and checks if it is (Up not Left); it fails this one, so mame checks the next part.  Is Up-Left (Up not right)? Yup it is, so mame accepts Up-Left as Up.  Mirror for Up-right, etc. 
The only difference I can see between your map and the simplified Up=Up is that mame has to do some more logical steps sometimes.

If you want to have diagonals ignored, it should be mapped:
Up = Up not Left not Right.
Down = Down not Left not Right
etc

If you mapped exactly as you guoted, no directions would work, I think.
Robin
Knowledge is Power

JZSlenker

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 35
  • Last login:April 20, 2014, 10:06:50 pm
Re: Emulating a 4-way joystick
« Reply #2 on: February 18, 2010, 01:28:24 pm »
You are right, mapped as quoted nothing works.  UP=UP NOT LEFT NOT RIGHT works great.  I'm using an I-Pac and testing on games like Donkey Kong, and MsPacman

Thanks for the reply.

ark_ader

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5645
  • Last login:March 02, 2019, 07:35:34 pm
  • I glow in the dark.
Re: Emulating a 4-way joystick
« Reply #3 on: February 18, 2010, 01:28:53 pm »
I think it would be more challenging for a game like pacman just to have four push buttons instead of a joystick.
If I had only one wish, it would be for three more wishes.

JZSlenker

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 35
  • Last login:April 20, 2014, 10:06:50 pm
Re: Emulating a 4-way joystick
« Reply #4 on: February 18, 2010, 01:42:24 pm »
So for a game like pacman to disable diagonals for both joysticks I can do...

UP=UP OR R NOT LEFT NOT RIGHT NOT D NOT G
LEFT=LEFT OR D NOT UP NOT DOWN NOT R NOT F
etc etc


RayB

  • I'm not wearing pants! HA!
  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 11279
  • Last login:August 18, 2025, 10:59:20 pm
  • There's my post
    • RayB.com
Re: Emulating a 4-way joystick
« Reply #5 on: February 18, 2010, 03:25:54 pm »
How does one get the "NOT" part ? Or is this strictly done via direct editing of the CFG files?
NO MORE!!

JZSlenker

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 35
  • Last login:April 20, 2014, 10:06:50 pm
Re: Emulating a 4-way joystick
« Reply #6 on: February 18, 2010, 03:49:15 pm »
you can get the NOT by hitting the not key two times fast.

For example if you wanted up not right you would do the following....

ENTER on the UP line then press UP  RIGHT RIGHT 

If you are too slow on the RIGHT RIGHT you will end up with UP being assigned to UP AND RIGHT

It's easier to edit the cfg file though if you want a more complicated line like..
UP=UP OR R NOT LEFT NOT RIGHT NOT D NOT G

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: Emulating a 4-way joystick
« Reply #7 on: February 19, 2010, 01:39:48 pm »
So for a game like pacman to disable diagonals for both joysticks I can do...

UP=UP OR R NOT LEFT NOT RIGHT NOT D NOT G
LEFT=LEFT OR D NOT UP NOT DOWN NOT R NOT F
etc etc

Close.  Mame uses Ors to separate groups.  So as shown mame sees:
UP = (UP) OR (R NOT LEFT NOT RIGHT NOT D NOT G)
etc

So up-right is fine for the first group, so mame will treat stick 1 as an 8-way and stick 2 as a 4-way as long as stick 1 isn't used.

You want:
UP = UP NOT LEFT NOT RIGHT OR R NOT D NOT G
LEFT = LEFT NOT UP NOT DOWN OR D NOT R NOT F

A little more human readable:
UP = (Up not Left not Right)   OR   (R not D not G)

It's easier to edit the cfg file though if you want a more complicated line like..

I find hand editing the cfg easy too, but using mame's UI isn't too hard for those who like GUIs, either. 
The map I suggested:
For UP: enter, up, right, right, left, left, wait about 1 second for mame to register, R, D, D, G, G, wait.
(repeat for other directions)
OTOH, I will often most of the above in a test editor.
Robin
Knowledge is Power