Main > Main Forum

4-way stick in software?

Pages: << < (2/6) > >>

_Iz-:

In mame, search src\inptport.c for "sticky" to find out more info on the 4-way on 8-way stuff...

(steady key is the debounce option)

u_rebelscum:

Mame currently does the first method for inputs compiled with the 4way flag, and the second way for the sticky option, IIRC.

pragma:

Could you tell me more about the 4way flag and how to use it?

Thanks
Paul

seaner:


--- Quote from: seaner on March 21, 2003, 03:58:11 pm ---Has anyone considered turning an 8-way stick into a 4-way in software?  Has anyone tried it?  Success?  Miserable failure?
Since I designed my own keyboard encoder, this is obviously an option for me, rather than eating up panel space for dedicated 4-way sticks.

--- End quote ---

If anyone cares to know.. a firmware solution works dandy.  I put a toggle switch on my panel.  Flipping it puts all of my sticks into 4-way mode.  It may not feel like a restricted 4-way stick, but no more pesky diagonals now on pacman, etc.

u_rebelscum:


--- Quote from: pragma on March 21, 2003, 08:30:18 pm ---Could you tell me more about the 4way flag and how to use it?
--- End quote ---

You have to put it in the driver source file and can't change it (except by recompiling again).

Example straight from pacman.c:
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_4WAY )

The biggest problem with it is with 8way sticks with huge diagonals.  You are pushing up, but not quite straight up, and accidentally move into the diagonal up-right.  Mame thinks, "oh, he's switching to right, so I'll just read this as right.  You can look at how mame handles the 4way flag in src/inptport.c, ScanJoysticks() function.  Pretty good documentation in the code on this, IMO.

Restricter plate is the best way it you have a choice, though.

Pages: << < (2/6) > >>

Go to full version