On Fri, 17 Nov 2017 19:27:39 +0000 (UTC), Eli the Bearded
declaimed the following:
>I have long thought making one of the MAME arcade boxes would fun, and
>recently stumbled on some second hand arcade controls, so I've decided
>now's the time.
>
>No, my questions are how the controllers work. The up-to-date pi MAME
>system, Recalbox, just says buy USB controllers or use a keyboard.
>
Would depend upon the controller type. Simple joysticks are just four
digital switches, probably wired to be active-low, so when the stick is
centered all read HIGH. Move the stick in X or Y activates the relevant
switch, making it read LOW. Move the stick on a diagonal activates one each
of X and Y switches... So four GPIO inputs per joystick (note: if the
joystick common lead is attached to a GPIO output that is used as a
selector, you could poll two joysticks using 4 input pins and two output
pins -- have the output/selects in a pulled-high configuration and set the
GPIO Low to select a joystick). Add another input for each trigger/button.
If you have actual analog joysticks -- you'd need some A/D converter
logic*. You might still be able to use a polling scheme, changing between
X1, Y1, X2, Y2 -- though the conversion time may have an effect on polling
speed. Having separate A/Ds for each channel/joystick using a common "start
conversion", with polled read-out from the A/D would be more costly, but
faster.
* For the R-Pi, this will require external converters as it does not have
in-built A/D capability; whereas the BeagleBone Black has 12-bit A/D
internal (Arduino tends to run 10-bit A/D).
>
>I don't have the Pi for this yet, I was leaning towards a 3, but if
>there's a good reason for another one, I could still switch.
>
While Raspbian/NOOBS doesn't currently provide a 64-bit OS version, so
you won't be taking advantage of 64-bit processing, the multiple cores of
the 3 could be effective: one core could be running a process dedicated to
handling the controller inputs, placing results into a shared memory
location from which the rest of the system can grab them as needed.
How this would fit within the MAME system I can't say -- perhaps by
exposing A/D converters through kernel drivers which update entries in the
"sys" file system?
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|