MAMEWorld >> EmuChat
Previous thread Previous  View all threads Index   Next thread Next   Threaded Mode Threaded  

Pages: 1

hippox89
MAME Fan
Reged: 07/24/16
Posts: 1
Send PM


Configuring a 8-way joystick to work better as a 4-way by mapping alone in MAME (suggestion for new feature)
#358620 - 09/13/16 01:09 PM


Hi. I have an 8-way joystick that I want to configure to work better in some 4-way games, like Ghouls n' Ghosts. What I found that I can currently achieve in MAME is:

#1

Using the 'NOT' statement to ignore diagonals inputs altogether, however, this doesn't work great in practice. It actually kinda sucks when you accidentally hit an diagonal and there's no input.

#2

Again, by using the 'NOT' statement, you can make 'up/right' act as just 'right'. And 'up/left' as just 'left'. Same with 'down' instead of 'up'. However, although this is slightly better than simply ignoring diagonals, it's not perfect. I'll explain below why.

#A better solution (suggestion)

The best solution would be if MAME could figure out when a specific key, which is part of a key combination, is pressed first and threat it as an unique input.

For example, 'right + down' should be able to make a character duck down. But 'down + right' should be able to make a character move to the right instead of ducking. This would seem to be the most logical setup in practice if it could actually work like this. However, even if MAME will display the first key pressed in a combination, it actually seems to ignore the order completely, unfortunately.

The short version:

MAME doesn't seem to care which key is pressed first in a combination. Eg. 'right + down' is treated the same as 'down + right'. This is unfortunate because it would otherwise allow you to setup a 8-way joystick to work much better in 4-way games without ignoring diagonals inputs.

I've also discovered that some 4-ways games, like Timber, seem to already work in the exact way that I described using a 8-way joystick. It seems to be a much more sensible approach than simply ignoring diagonals. If MAME supported key combinations by order of the inputs then games such as Ghouls n' Ghosts could work as well as Timber and others with an 8-way configuration.

It currently makes too good sense to me not to implement such a feature. At least, I can't see why it shouldn't be technically durable.

If I did something wrong and MAME can actually figure it out, let me know what I might have done wrong. If there's an alternative solution then please share it. Thank you.

*also posted on /r/MAME

Edited by hippox89 (09/13/16 01:11 PM)



AJR Hacker
MAME Developer
Reged: 02/01/16
Posts: 144
Send PM


Re: Configuring a 8-way joystick to work better as a 4-way by mapping alone in MAME (suggestion for new feature) new [Re: hippox89]
#358630 - 09/13/16 08:06 PM


No, you haven't done anything wrong.

The "most logical" 4-way joystick semantics you request are already implemented in MAME, but only for games whose inputs are configured that way. If you scan the -listxml output carefully for the tags describing joystick controls, you may be able to see the number of ways they have been configured with.

I've put in a request to change the Ghouls'n Ghosts joysticks to 4-way, as well as those in all the Pang games except Mighty! Pang (whose flyer, unlike those of previous games, does specify an 8-way joystick).



casm
Cinematronics > *
Reged: 08/27/07
Posts: 668
Send PM


Re: Configuring a 8-way joystick to work better as a 4-way by mapping alone in MAME (suggestion for new feature) new [Re: AJR Hacker]
#358636 - 09/14/16 12:12 AM


> No, you haven't done anything wrong.
>
> The "most logical" 4-way joystick semantics you request are already implemented in
> MAME, but only for games whose inputs are configured that way. If you scan the
> -listxml output carefully for the tags describing joystick controls, you may be able
> to see the number of ways they have been configured with.

As an adjunct to this: something that I would like to see implemented would be the ability to select how many positions the joystick has from the tab menu.

Whatever the driver specified would be the default, but being able to manually select a value could be useful. It's something I've wished that MAME could do a few times over the years to see how the original hardware might behave if a different joystick type is in use without actually replacing the stick currently in a physical machine or recompiling.

I realise that's something of a corner case, but it may also be helpful with verifying game behaviour in the debugger in certain situations.

Related to that, the OP's idea of also being able to select which keypress is read first when multiple presses are registered sounds like it has some merit. This might also work well as a tab menu item, but may need to have some knobs applied to it. As an example, if UP + RIGHT is registered it may be more desirable to read UP and not RIGHT, but there may be situations where the opposite applies. Sort of a 'cardinal directions priority' setting, so to speak.



Haze
Reged: 09/23/03
Posts: 5245
Send PM


Re: Configuring a 8-way joystick to work better as a 4-way by mapping alone in MAME (suggestion for new feature) new [Re: AJR Hacker]
#358638 - 09/14/16 12:41 AM


> No, you haven't done anything wrong.
>
> The "most logical" 4-way joystick semantics you request are already implemented in
> MAME, but only for games whose inputs are configured that way. If you scan the
> -listxml output carefully for the tags describing joystick controls, you may be able
> to see the number of ways they have been configured with.
>
> I've put in a request to change the Ghouls'n Ghosts joysticks to 4-way, as well as
> those in all the Pang games except Mighty! Pang (whose flyer, unlike those of
> previous games, does specify an 8-way joystick).

the only Ghouls and Ghosts cabinets I've seen have had 8-ways, so it's likely such a change would be rejected, I believe the CPS boards were meant, for the most part, to be interchangable on a standard Jamma cabinet.

it needs to be selectable at a different level of abstraction, the way the ports and inputs tie directly together at the moment is one of those old legacy things in MAME, really we should be dealing with control panels / types of panels at a different level.

Edited by Haze (09/14/16 12:42 AM)



AJR Hacker
MAME Developer
Reged: 02/01/16
Posts: 144
Send PM


Re: Configuring a 8-way joystick to work better as a 4-way by mapping alone in MAME (suggestion for new feature) new [Re: Haze]
#358640 - 09/14/16 02:24 AM



Quote:



the only Ghouls and Ghosts cabinets I've seen have had 8-ways, so it's likely such a change would be rejected, I believe the CPS boards were meant, for the most part, to be interchangable on a standard Jamma cabinet.





The available Capcom USA service manual for Ghouls'n Ghosts clearly specifies 4-way joysticks. JAMMA isn't exactly a standard for control panel layouts; still, I strongly suspect that arcade owners preferred to disregard the manufacturer's instructions and reuse their old 8-way joystick assemblies, especially since way more arcade games in 1988 required 8-way joysticks.



AJR Hacker
MAME Developer
Reged: 02/01/16
Posts: 144
Send PM


Re: Configuring a 8-way joystick to work better as a 4-way by mapping alone in MAME (suggestion for new feature) new [Re: casm]
#358641 - 09/14/16 02:32 AM



Quote:




As an adjunct to this: something that I would like to see implemented would be the ability to select how many positions the joystick has from the tab menu.

Whatever the driver specified would be the default, but being able to manually select a value could be useful. It's something I've wished that MAME could do a few times over the years to see how the original hardware might behave if a different joystick type is in use without actually replacing the stick currently in a physical machine or recompiling.

I realise that's something of a corner case, but it may also be helpful with verifying game behaviour in the debugger in certain situations.




I think such a feature could be useful, too. It would mean adding a new submenu, since none of the current ones would quite cover it.



H@P
Lurker in perpetuity
Reged: 09/22/03
Posts: 234
Loc: Seattle area
Send PM


Re: Configuring a 8-way joystick to work better as a 4-way by mapping alone in MAME (suggestion for new feature) new [Re: hippox89]
#358647 - 09/14/16 07:14 AM


I believe your suggestion for a new feature is an old feature that's since been removed.

It was called "sticky keys". There's mention of it in MAME 0.37B14 (April 2001) readme.txt:

- Changed 4-way emulation on a 8-way joystick to "sticky" mode. This makes
Lady Bug and other 4-way games more playable.
Explanation here: http://www.rentrondesign.homestead.com/JoyPrimer.html
[Jeoff Krontz]


Don't bother with the JoyPrimer link above; it's long dead, and even archive.org doesn't have it.

It looks like it was changed in MAME 0.57 (January 2002) src/inptport.c:

/* If joystick is pointing at a diagonal, acknowledge that the player moved
* the joystick by favoring a direction change. This minimizes frustration
* when using a keyboard for input, and maximizes responsiveness.
*
* For example, if you are holding "left" then switch to "up" (where both left
* and up are briefly pressed at the same time), we'll transition immediately
* to "up."
*
* Under the old "sticky" key implentation, "up" wouldn't be triggered until
* left was released.
*
* Zero any switches that didn't change from the previous to current state.
*/


And it was further tweaked in MAME 0.84u4 (July 2004), where it looks like it's remained mostly unchanged since.

There's also a (very) old conversation about it here, with some suggestions on key mappings that might help.

I was concerned about this when I started buying components for a cocktail cabinet, so I settled on joysticks with a rotating restrictor plate. With a pull and twist, the joystick goes from 8-way to 4-way mode, and back again. No need to even open the cabinet. See Mag-Stik/Mag-Stik Plus.

H@P

Edited by H@P (09/14/16 07:46 AM)



Traso
MAME Fan
Reged: 01/15/13
Posts: 2687
Send PM


Re: Configuring a 8-way joystick to work better as a 4-way by mapping alone in MAME (suggestion for new feature) new [Re: H@P]
#358667 - 09/14/16 11:48 PM


Shit, I don't recall that at all. And I would, because my first panel had T-sticks to address just this, let alone going onto U360s in further vein.



> I believe your suggestion for a new feature is an old feature that's since been
> removed.
>
> It was called "sticky keys". There's mention of it in MAME 0.37B14 (April 2001)
> readme.txt:
>
> - Changed 4-way emulation on a 8-way joystick to "sticky" mode. This makes
> Lady Bug and other 4-way games more playable.
> Explanation here: http://www.rentrondesign.homestead.com/JoyPrimer.html
> [Jeoff Krontz]
>
> Don't bother with the JoyPrimer link above; it's long dead, and even archive.org
> doesn't have it.
>
> It looks like it was changed in MAME 0.57 (January 2002) src/inptport.c:
>
> /* If joystick is pointing at a diagonal, acknowledge that the player moved
> * the joystick by favoring a direction change. This minimizes frustration
> * when using a keyboard for input, and maximizes responsiveness.
> *
> * For example, if you are holding "left" then switch to "up" (where both left
> * and up are briefly pressed at the same time), we'll transition immediately
> * to "up."
> *
> * Under the old "sticky" key implentation, "up" wouldn't be triggered until
> * left was released.
> *
> * Zero any switches that didn't change from the previous to current state.
> */
>
> And it was further tweaked in MAME 0.84u4 (July 2004), where it looks like it's
> remained mostly unchanged since.
>
> There's also a (very) old conversation about it here, with some suggestions on key
> mappings that might help.
>
> I was concerned about this when I started buying components for a cocktail cabinet,
> so I settled on joysticks with a rotating restrictor plate. With a pull and twist,
> the joystick goes from 8-way to 4-way mode, and back again. No need to even open the
> cabinet. See Mag-Stik/Mag-Stik Plus.
>
> H@P



Scifi frauds. SF illuminates.
_________________

Culture General Contact Unit (Eccentric)



AJR Hacker
MAME Developer
Reged: 02/01/16
Posts: 144
Send PM


Re: Configuring a 8-way joystick to work better as a 4-way by mapping alone in MAME (suggestion for new feature) new [Re: hippox89]
#358741 - 09/17/16 09:38 PM


hippox89, how many 4-way games do you know (besides Ghouls'n Ghosts) that are not currently configured that way in MAME?


Pages: 1

MAMEWorld >> EmuChat
Previous thread Previous  View all threads Index   Next thread Next   Threaded Mode Threaded  

Extra information Permissions
Moderator:  Robbbert, Tafoid 
0 registered and 146 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 3488