Main > Driving & Racing Cabinets
Universal Gear Shifter support in MAME discussion
abaraba:
In pole position, when changing gear there comes a little window on the screen saying "HI" or "LO", which looks more like MAME user interface message than part of the game, am I dreaming?
SavannahLion:
--- Quote from: BadMouth on January 15, 2011, 12:22:43 am ---Are you talking about the gear shifter code that's sending the input to the driver becoming out of sync with the game's driver?
Like if someone goes into the service menu or resets the game while in 3rd gear?
That's something I never thought to consider. I'll have to ponder that one for a while.
--- End quote ---
Yeah, that's pretty much it. It's not hard to realize. Let's say we create an virtual shifter using keyboard buttons A and Z. Press A, we go HI, press Z we go low. Our imaginary player leaves the shifter on HI and exits the game for some reason (any reason, it doesn't matter). Then the gamer reenters the game at some point. The game driver has to make a choice about what state the shifter is in. Is it HI or is it LO? Since the game driver itself did not receive the last state of the shifter it sees that there is no signal and defaults to LO even though the shifter is left on HI. Now they're out of sync. To resync, the gamer has to know to throw the shifter to LO, then back up to HI again. It's been a while, but I can't recall very many arcade games that have this type of behavior. And I'm reasonably sure no real world car does either. You'll also need to modify the joystick hardware to send a pulsed signal or to include some sort of interface board that does the same.
However, by leveraging the given properties of your joystick interface, you can safely hold the respective buttons down and properly mimic the expected behavior, regardless of whether the HI/LO shifter uses one switch or two. This does several things in one fell swoop. It allows the shifter to remain stock with little or no modification whatsoever, it guarantees existing joystick controllers remain compatible, and lets MAME decide when to poll the joystick for shifter state negating any need to hold a state based driver that isn't going to survive between restarts anyways.
--- Quote ---If you're talking about the physical shifter becoming out of sync, here's my logic.....
With the old hi/lo shifter, there was only one switch (on the hi side).
If that switch wasn't closed, it defaulted to low gear.
Being in low gear is just the normal state of the game, like when no buttons are being pressed.
Think of the high gear switch as a turbo boost button.
Having the shifter in lo means absolutely nothing except that the high gear button isn't being pressed.
Same reasoning would apply to 1st gear on the 3 switch 4 spd shifter.
--- End quote ---
That is exactly what my proposal encompasses. But keep in mind, you have to restrict the chosen interface. That kind of design will not work with a keyboard, period. A keyboard, within the OS, is designed to be interrupt driven. It has to. The OS needs to respond if something craps out. So by hooking up said shifter to a keyboard based controller and leaving it on HI would appear to the OS (or MAME or any other program) as a rapid series of key repeats. To prevent that, you would have to go in and tweak your OS settings (I believe Windows has it under Access settings) and that's kind of annoying.
The Joystick, on the other hand, is specifically designed to be polled. Leave it up to the program to figure out the state of the joy and it completely bypasses anything the OS might expect.
The whole fake/real scheme that keeps coming up is just nonsense. You're virtualizing the controller. That's it. There's nothing magical about it.
Again, not looking at MAME code at the moment. I think a possible solution would be for MAME to simply expose the interface the game actually expects and allow the individual community to create the necessary MAME drivers between game and UID. However, I believe Haze (in another thread) explicitly mentions that this (or something similar to this) is not what the MAMEDev community wants to do. The advantage to exposing the real game interface means that MAME can switch to a standard interface of dildos and no one will care. Maybe something akin to Windows hooks, I dunno. :dunno
I'm not entirely sure how I would want to tackle this. I might look at compiling a proper list identifying the shifter and, exactly, how they function. Without classifying or even trying to figure out how they would all interface in a standard way. Then I would examine the MAME code for each of those games and figure out what they were doing there. Then I would ultimately decided on how best to tackle the problem.
I imagine the easiest would be some form of a callback to external drivers. I can't imagine maintaining so many diffs through so many potential changes would be fun, but slipping call backs into the code might be considerably easier.
I suppose if I can ever get my Hang-On up and running again, I'll probably fabricate something that's somewhat useful.
SavannahLion:
I'm really just speculating at this point. I don't have any driving games because I don't have a cab with a steering wheel or shifter and I'm not going to fire up my testbed and try it with a keyboard/Mouse/Joy. That would result in ---uvula--- behavior.
BadMouth:
--- Quote from: SavannahLion on January 15, 2011, 01:09:49 pm ---I'm really just speculating at this point. I don't have any driving games because I don't have a cab with a steering wheel or shifter and I'm not going to fire up my testbed and try it with a keyboard/Mouse/Joy. That would result in ---uvula--- behavior.
--- End quote ---
I think I've wrapped my head around what you were saying about the analogue joystick interface.
Speculation isn't all bad. Sometimes it leads to a revelation.
(and sometimes I guess it doesn't amount to anything more than people talking about things they know nothing about :-\ )
I downloaded a ton of manuals. I have to go be social for the rest of the evening, but tomorrow I'll try to put together a fairly complete list of games and organize them in a spreadsheet. It will be useful. If not for this, for other projects.
jennifer:
The steering/shifter [or a mockup] would have to be obtained, or this will become yet another mouse hack. This should be in the interest of
preservation.... drop in replacement, But will it still need a patch for the mousers.
Would this not require a starting over point?.....OS, Dumps, compatiblily for the future, every aspect?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version