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

Pages: 1

Ron347
MAME Fan
Reged: 12/29/18
Posts: 4
Send PM


Stop toggle action in MAME input
#380415 - 12/29/18 10:12 PM


A low/high shift stick like in spy hunter 1983 is a single switch. I have that switch assembly. MAME toggles (low <> high) on that input so I'd have to double shift to toggle.

Is there any way (other than rewriting MAME) to replace a toggle input with normal input (press and hold)?

I don't want to build a circuit to send a press / release every time the switch changes at all. Even with that, I'd have to add another button to sync the setting if it was in the opposite state. Double burden.



Heihachi_73
I am the Table!
Reged: 10/29/03
Posts: 1074
Loc: Melbourne, Australia
Send PM


Re: Stop toggle action in MAME input new [Re: Ron347]
#380429 - 12/30/18 07:47 AM


> Is there any way (other than rewriting MAME) to replace a toggle input with normal
> input (press and hold)?

Only by changing the source and recompiling MAME unfortunately. The current toggle design is only for compatibility with keyboards and game controllers where it would be a pain to have to hold the button down all the time.

Just remove PORT_TOGGLE from line 898 in mcr3.cpp (assuming current MAME), save, compile, and it should be gone for good. In older versions which don't line up with 898 just look for static INPUT_PORTS_START( spyhunt ) and a few lines down you should see the PORT_TOGGLE to remove.

This is the line to change, just in case...

Code:

	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Gear Shift") PORT_TOGGLE




hap
Reged: 12/01/08
Posts: 296
Send PM


Re: Stop toggle action in MAME input new [Re: Ron347]
#380433 - 12/30/18 02:39 PM


Yes there is: https://docs.mamedev.org/advanced/shiftertoggle.html


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 411 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 431