Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Fixing MAME's handling of 12-position rotary controls  (Read 18164 times)

0 Members and 1 Guest are viewing this topic.

RobotronNut

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 315
  • Last login:December 22, 2018, 11:39:19 am
  • I want to build my own arcade controls!
Fixing MAME's handling of 12-position rotary controls
« on: January 30, 2006, 02:02:31 am »
I believe I can properly implement this device if MAME used a 1 input cycle per movement scheme.  It wouldn't lose movements and would consume a lot less than 12 inputs.

SO,  who's gonna fix it :) ?

i spent a couple hours last night, reading my way through a good bit of mame's input system and the snk driver. doesn't look like it would be hard to fix this problem.

i'll volunteer, but it may take a few wks; i won't have a rotary to test with until my slikstik arrives (it's currently in production).

hardware would deliver to mame the equivalent of one button press for each "click" of the rotary. (there would be two simulated buttons, one for clockwise rotation and one for counter-clockwise). mame maintains a simulated rotary switch, which it increments or decrements one position for each simulated button press it receives.

this would be my first contribution to mame; could someone clue me in about how to submit it for consideration for permanent inclusion in mame?
to see my "Frankenpanel" and design notes, click here.

Minwah

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7662
  • Last login:January 18, 2019, 05:03:20 am
    • MAMEWAH
Re: Fixing MAME's handling of 12-position rotary controls
« Reply #1 on: January 30, 2006, 05:09:51 am »
I'll be interested to see if MAME accept this as an 'official' fix...they seem to have an unhealthy liking to poorly handled controls...

Not sure about the answer to your question tho, but the Software board or mame.net board might be a better place to post.

Tiger-Heli

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5447
  • Last login:January 03, 2018, 02:19:23 pm
  • Ron Howard? . . . er, I mean . . . Run, Coward!!!
    • Tiger-Heli
Re: Fixing MAME's handling of 12-position rotary controls
« Reply #2 on: January 30, 2006, 07:27:44 am »
See my comments in the original thread: http://forum.arcadecontrols.com/index.php?topic=49037.0
It's not what you take when you leave this world behind you, it's what you leave behind you when you go. - R. Travis.
When all is said and done, generally much more is SAID than DONE.

Lilwolf

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4946
  • Last login:July 31, 2022, 10:26:34 pm
Re: Fixing MAME's handling of 12-position rotary controls
« Reply #3 on: January 30, 2006, 07:36:54 am »
I believe it wasn't originally accepted because

1) it didn't work on all of the games
and main reason
(2) Mame didn't handle that many inputs that well at the time.  You need to use player 3 and player 4 inputs to get it to work (if I remember correctly... been a year+ since I set this up).

But now there is the mahjong game buttons.  If you look at the snk inputs, you should consider putting the inputs in on these I think.  Might be perfect.  (10 inputs plus a bet and another... at work, can't look now).

I would LOVE to see it in the original mame.  But even then, it would be very very cool to get victory road running.  I can do without ikari warriors (or just use the left/right from analog+ isn't bad) but vict road + the sword doesn't work well at all.

Let me know if there is ANYTHING I can do to help you.  Not a C programmer (java) so I don't know much help I can be... but if you would like beta testers let me know. 

XtraSmiley

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 958
  • Last login:April 06, 2024, 09:29:46 pm
  • Kill the Big Dog
Re: Fixing MAME's handling of 12-position rotary controls
« Reply #4 on: January 30, 2006, 08:55:34 am »
Well, I have the original SNK yellow sticks, (mechanical) plus druins interface board, so as long as you are not making these obsolete, I'm good.  (or at least making them work better).

As for MAME, they may not take it b/c the inputs may or may not be true to the original game.  Not sure about this, as I'm no programmer, but they want things to be 100% as they original boards.  So, if the original game didn't take just two inputs to turn, then MAME won't want it that way.

Of course, I'm talking out ---my bottom---, so check over at www.mame.net for more info.

Thanks for any contribution you can give to the cause to!
hearingprotectionBIGDOG@yahooBIGDOG.com

Kill the Dog man.

markrvp

  • ARGHHHHHHHHHHHHH!!!!!!!!!! True Genius!
  • Wiki Contributor
  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3353
  • Last login:September 14, 2020, 10:19:57 am
  • NFL Expert
Re: Fixing MAME's handling of 12-position rotary controls
« Reply #5 on: January 30, 2006, 09:00:52 am »
I'm pretty sure all of us who actually play these games support your efforts 100% regardless of how the Mamedevs feel.  Thank you for tackling this.

Minwah

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7662
  • Last login:January 18, 2019, 05:03:20 am
    • MAMEWAH
Re: Fixing MAME's handling of 12-position rotary controls
« Reply #6 on: January 30, 2006, 09:43:01 am »
As for MAME, they may not take it b/c the inputs may or may not be true to the original game.  Not sure about this, as I'm no programmer, but they want things to be 100% as they original boards.  So, if the original game didn't take just two inputs to turn, then MAME won't want it that way.

Unfortunately that is rubbish.  The current way of using a dial for rotation is terribly incorrect.  Most driving game shifters are not handled correctly.  The dial input for 720 was removed, even though that was the best (in comparison to original arcade) input method.  I could go on...

Sadly the MAMEdev do not consider this in their 'accuracy' goal.  I don't know why, but they don't.  I have made this point (& I know others have) at mame.net and the answer is always the same.  The last response I got re PolePos was 'well the code for the original shifter is in there so just recompile it'.  That's fine, but IMO the arcade-accurate handling should be in MAME by default.  Hypocrisy anyone?  :P

Still, with that said I really hope they will consider at least the 12-input 'raw' method for the rotational games (being careful to leave as dial the games which used an optical rotary).

Tiger-Heli

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5447
  • Last login:January 03, 2018, 02:19:23 pm
  • Ron Howard? . . . er, I mean . . . Run, Coward!!!
    • Tiger-Heli
Re: Fixing MAME's handling of 12-position rotary controls
« Reply #7 on: January 30, 2006, 10:15:12 am »
As for MAME, they may not take it b/c the inputs may or may not be true to the original game.  Not sure about this, as I'm no programmer, but they want things to be 100% as they original boards.  So, if the original game didn't take just two inputs to turn, then MAME won't want it that way.

Unfortunately that is rubbish.  The current way of using a dial for rotation is terribly incorrect.  Most driving game shifters are not handled correctly.  The dial input for 720 was removed, even though that was the best (in comparison to original arcade) input method.  I could go on...

Sadly the MAMEdev do not consider this in their 'accuracy' goal.  I don't know why, but they don't.  I have made this point (& I know others have) at mame.net and the answer is always the same.  The last response I got re PolePos was 'well the code for the original shifter is in there so just recompile it'.  That's fine, but IMO the arcade-accurate handling should be in MAME by default.  Hypocrisy anyone?  :P

Still, with that said I really hope they will consider at least the 12-input 'raw' method for the rotational games (being careful to leave as dial the games which used an optical rotary).

WORD!!!!!
It's not what you take when you leave this world behind you, it's what you leave behind you when you go. - R. Travis.
When all is said and done, generally much more is SAID than DONE.

RobotronNut

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 315
  • Last login:December 22, 2018, 11:39:19 am
  • I want to build my own arcade controls!
Re: Fixing MAME's handling of 12-position rotary controls
« Reply #8 on: January 30, 2006, 01:15:20 pm »
See my comments in the original thread: http://forum.arcadecontrols.com/index.php?topic=49037.0
hmmm... if i can find versions of mame out there that play these games properly, i probably won't bother re-implementing the solution.

it's unfortunate that versions that meet different people's needs can't be maintained in the official mame source tree, so we all benefit from each others work.
to see my "Frankenpanel" and design notes, click here.

PetitMorte

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 332
  • Last login:December 11, 2015, 10:03:43 am
  • . . . - - - . . .
Re: Fixing MAME's handling of 12-position rotary controls
« Reply #9 on: January 30, 2006, 01:42:25 pm »
If MAME gets corrected input for raw 12-way, then we will need some sort of new interface for the joysticks, yes? as opposed to Druin's board... coming soon: Rot-Wiz12?  ;D
Bitten by the cabinet bug... obsessing ever since.

mahuti

  • Wiki Master
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 2757
  • Last login:March 02, 2022, 09:51:19 pm
  • I dare anything! I am Skeletor!
Re: Fixing MAME's handling of 12-position rotary controls
« Reply #10 on: January 30, 2006, 01:48:18 pm »
All I know is that for every game like these, there are games like Off-Road that now use the correct controls making them near impossible to play without having the actual controls. (now uses analog up for the gas feed rather than a button press)

I figure they should be consistent. If they support one game's controls accurately, they should support them all.
Raspberry Pi, AttractMode, and Skeletor enthusiast.

RandyT

  • Trade Count: (+14)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 6890
  • Last login:Yesterday at 08:20:02 pm
  • Friends don't let friends hack keyboards.
    • GroovyGameGear.com
Re: Fixing MAME's handling of 12-position rotary controls
« Reply #11 on: January 30, 2006, 02:27:55 pm »
If MAME gets corrected input for raw 12-way, then we will need some sort of new interface for the joysticks, yes? as opposed to Druin's board... coming soon: Rot-Wiz12?  ;D

Heh.  Raw 12-way wouldn't be the preferred method.  I think the same thing can be accomplished using far fewer inputs.

RandyT

Kremmit

  • - AHOTW -
  • Wiki Contributor
  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3164
  • Last login:November 22, 2020, 05:59:29 pm
  • Who the heck is that?
Re: Fixing MAME's handling of 12-position rotary controls
« Reply #12 on: January 30, 2006, 03:08:02 pm »
How can you use fewer inputs?  That rotary switch has 12 positions.  Even if MAME is looking for a left or right press instead of an absolute position, you've still got to physically hook that switch to something.

A raw 12-way solution still seems best to me.  That's what the original game had, that's what's hiding inside the ROM code, that's what the actual hardware outputs.  The only reason that's not the way it's already working is that the MAME code in betweeen the joystick and the game ROM is muddling the whole thing up.  I don't buy the input arguement, either.  With today's affordable encoders, 12 inputs doesn't really cost that much, especially if you're talking about people who are already willing to drop the cash on the rotary sticks.

A consistent left/right hack for all the games would be the 2nd best option, but you'd need another layer of hardware just to convert the 12-way switch into left/right presses, like the Druin board.  And everybody that's used one of those knows it's not perfect.  One click doesn't always equal 1 turn, and it ought to.  I believe a better piece of hardware could be built, but at what cost? 

Don't get me wrong, if somebody makes a left/right hack, and it works better than what we've got now, I'm all for it.  But it seems to me that if there's to be an attempt made at fixing these games, the raw 12-way fix is the right direction to work in.  U_Rebel already got it working for some games in Analog_+, why not just carry on with that work?

Necro

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1031
  • Last login:November 29, 2022, 08:22:22 pm
  • Building a 'Classic' MAME Cab
Re: Fixing MAME's handling of 12-position rotary controls
« Reply #13 on: January 30, 2006, 03:11:13 pm »
8 with double button combos would work also...is that what you mean?  (Sorry, just interested in this stuff, I want to start coding edits into mame eventually).

markrvp

  • ARGHHHHHHHHHHHHH!!!!!!!!!! True Genius!
  • Wiki Contributor
  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3353
  • Last login:September 14, 2020, 10:19:57 am
  • NFL Expert
Re: Fixing MAME's handling of 12-position rotary controls
« Reply #14 on: January 30, 2006, 03:55:28 pm »
If MAME gets corrected input for raw 12-way, then we will need some sort of new interface for the joysticks, yes? as opposed to Druin's board... coming soon: Rot-Wiz12?  ;D

Wouldn't you just hook up up each leg of the rotary switch to one input on your encoder?  Is the switch position then always active (i.e. a key is always pressed)?

Lilwolf

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4946
  • Last login:July 31, 2022, 10:26:34 pm
Re: Fixing MAME's handling of 12-position rotary controls
« Reply #15 on: January 30, 2006, 04:04:31 pm »
btw, there wouldn't ever be a use for a key12wiz whatever... Since its just 12 inputs...

so keywiz eco will do..

but if someone built a keyboard encoder with the right connectors so the original wires worked... and then enought extra inputs for the joystick and buttons... maybe....

but just to speed up wiring doesn't seem worth a custom board.. :)

And for anyone who doesn't think the extra 12 buttons are needed... until you try it with direct connect in analog+ mame, you can really say.  Its more pronounced change then 8way and a true 4way controller.  REALLY makes a difference.  But without ikari warrior / vict road support, its hard to justify an extra 24 inputs for a cab.... if you don't already have them.

rdagger

Re: Fixing MAME's handling of 12-position rotary controls
« Reply #16 on: January 30, 2006, 04:08:18 pm »
Is the switch position then always active (i.e. a key is always pressed)?

This would be another concern for me in addition to the large number of inputs.  If you had 2 joysticks wired up using 24 inputs than there would always be 2 key presses being sent to the computer, which could be annoying when not playing a game.

rdagger

Re: Fixing MAME's handling of 12-position rotary controls
« Reply #17 on: January 30, 2006, 04:14:50 pm »
It would be possible to build a USB rotary interface that did not require a keyboard encoder.  It could have 2 headers for 2 rotary joysticks and a single USB plug.  It could also have an on/off switch to prevent key presses when not in use.  The interface could be designed to implement either a USB keyboard or joystick using HID drivers.  The cost would probably be about the same as a standard rotary interface, but it would be easier to wire and not require any keyboard encoder inputs.

mahuti

  • Wiki Master
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 2757
  • Last login:March 02, 2022, 09:51:19 pm
  • I dare anything! I am Skeletor!
Re: Fixing MAME's handling of 12-position rotary controls
« Reply #18 on: January 30, 2006, 04:52:14 pm »
The best solution as far as I'm concerned IS raw, IF the original ikari warriors handled conversion of the inputs through routines on its rom. If there was originally a converter, then 2 button solutions are fine, but ultimately it would be great to use an 12 postion stick wired up to just the 1 encoder, be it Ipac, GP-wiz, etc and let the game do the work it was designed to do.
Raspberry Pi, AttractMode, and Skeletor enthusiast.

RobotronNut

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 315
  • Last login:December 22, 2018, 11:39:19 am
  • I want to build my own arcade controls!
Re: Fixing MAME's handling of 12-position rotary controls
« Reply #19 on: January 30, 2006, 05:09:03 pm »
The best solution as far as I'm concerned IS raw, IF the original ikari warriors handled conversion of the inputs through routines on its rom. If there was originally a converter, then 2 button solutions are fine, but ultimately it would be great to use an 12 postion stick wired up to just the 1 encoder, be it Ipac, GP-wiz, etc and let the game do the work it was designed to do.
based on the code in snk.c, the ROM reads 4 bits from an input port and expects to see a number from 0 thru 11, so the 12 switch inputs must have gone through a hardware encoder.
to see my "Frankenpanel" and design notes, click here.

RandyT

  • Trade Count: (+14)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 6890
  • Last login:Yesterday at 08:20:02 pm
  • Friends don't let friends hack keyboards.
    • GroovyGameGear.com
Re: Fixing MAME's handling of 12-position rotary controls
« Reply #20 on: January 30, 2006, 05:13:11 pm »

Do these sticks have an indicator pointing to the same direction as the on-screen action?

Also, are ALL of these games 12-way or are there 24-way and 6-way and whathaveyou?  And if so, how do you manage these?

Don't get me wrong, for someone with a couple of GP-Wiz49 interfaces, direct input connection would be fine (there should be plenty of free inputs for it.)  The gamepad buttons are probably a pretty good candidate for being held down all the time as well without difficulty.  The keyboard encoders might have some other difficulties related to programming them and such, but I haven't tested for these possibilities yet.

RandyT

RobotronNut

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 315
  • Last login:December 22, 2018, 11:39:19 am
  • I want to build my own arcade controls!
Re: Fixing MAME's handling of 12-position rotary controls
« Reply #21 on: January 30, 2006, 05:14:53 pm »
A consistent left/right hack for all the games would be the 2nd best option, but you'd need another layer of hardware just to convert the 12-way switch into left/right presses, like the Druin board.  And everybody that's used one of those knows it's not perfect.  One click doesn't always equal 1 turn, and it ought to.

but the problems may very well be mame's fault, not druin's. does MameAnalog+ work 100% correctly with druin's board?

i prefer druin's to direct connect, because it doesn't leave any keys always on, as long as there is a software solution that yields perfect behavior.
to see my "Frankenpanel" and design notes, click here.

mahuti

  • Wiki Master
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 2757
  • Last login:March 02, 2022, 09:51:19 pm
  • I dare anything! I am Skeletor!
Re: Fixing MAME's handling of 12-position rotary controls
« Reply #22 on: January 30, 2006, 05:37:05 pm »
There are 2 types. Optical and Mechanical rotaries. The optical ones are like spinners. The mechanical ones are 12 position, though I seem to recall there being mention of either and 8 or 10 position mechanical rotary as well. The 12 position ones are currently the only ones that anybody ever talks about, Ikari warriors being the primary game.

The sticks didn't have an indicator about which way the stick was supposed to point (i.e no "north" arrow) but you could definitely FEEL the major clicks as you spun your little dude around.

As you click left with a rotary to shoot somebody while you're walking forward and you rotate one click and your guy moves 2 clicks...AAARGhh.. maddening. Like having mario all confused on a ladder in Donkey Kong. I know you can relate. You KNOW what's supposed to happen, and something is obviously NOT happening and you just wanna scream.
Raspberry Pi, AttractMode, and Skeletor enthusiast.

Kremmit

  • - AHOTW -
  • Wiki Contributor
  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3164
  • Last login:November 22, 2020, 05:59:29 pm
  • Who the heck is that?
Re: Fixing MAME's handling of 12-position rotary controls
« Reply #23 on: January 30, 2006, 06:01:59 pm »
Do these sticks have an indicator pointing to the same direction as the on-screen action?

Nope, but they could.  The same side of the stick is always pointing straight up when the character is pointing straight up.

Also, are ALL of these games 12-way or are there 24-way and 6-way and whathaveyou?  And if so, how do you manage these?

Nope, all the games using mechanichal rotary sticks are 12-way. 

There are some other games that always come up when we get to talking about rotary games, that used different hardware:  Xybots, Frontline, Cal. 50. 

Xybots had a stick that didn't rotate all the way, it went a little less than 1/2 a turn either direction.  Twisting it contacted either a "Turn Right" or "Turn Left" switch.  MAME already correctly emulates this, by mapping "Turn Right" and "Turn Left" to button presses.

Frontline (and Tin Star & Wild Western) used a 8-way joystick with a knob instead of a regular handle.  When you twisted the knob, it rotated an actuator that would contact the correct microswitch(es) to point the gun in the correct direction.  You could also call this an 8-way rotary, but it does not use an 8-position switch, but rather 4 microswitches, just like a joystick.  MAME already correctly emulates this, with aiming handled by the "P2 Joystick" controls.

Cal. 50 used a rotary joystick with an optical encoder wheel on the bottom.  MAME already correctly emulates this, by using the "Dial" control type.

Don't get me wrong, for someone with a couple of GP-Wiz49 interfaces, direct input connection would be fine (there should be plenty of free inputs for it.) 


Agreed.  Two rotary joys could even be handled by a single GP-Wiz Eco, for less than $20.  If MAME were fixed.

but the problems may very well be mame's fault, not druin's. does MameAnalog+ work 100% correctly with druin's board?

The problem is MAME's fault.  MAME is forcing us to use an extra piece of hardware to translate an simple bit of absoulte data (which way is the switch pointing) into some very non-absolute data (how long were you twisting the knob), which MAME then attempts to re-translate back into absolute data (where would the switch be pointing if you turned it for x number of nanoseconds), and the result is that your guy doesn't point where he should.

Analog_+ works perfectly without the Druin's board.  It just doesn't support all the games.

It would be possible to build a USB rotary interface that did not require a keyboard encoder.  It could have 2 headers for 2 rotary joysticks and a single USB plug.  It could also have an on/off switch to prevent key presses when not in use.  The interface could be designed to implement either a USB keyboard or joystick using HID drivers.  The cost would probably be about the same as a standard rotary interface, but it would be easier to wire and not require any keyboard encoder inputs.

Why save keyboard encoder inputs by building a whole extra encoder?  I just don't get this thinking.  Again, don't get me wrong.  If you build one, and it works better than what we've got now, good.  But fixing the software seems like a superior fix in this case.


based on the code in snk.c, the ROM reads 4 bits from an input port and expects to see a number from 0 thru 11, so the 12 switch inputs must have gone through a hardware encoder.


If that's the case, then it was on-board the original PCB, and all it did was translate a simple closed circuit into a number.  Can you tell what's feeding that number to snk.c now?

If you had 2 joysticks wired up using 24 inputs than there would always be 2 key presses being sent to the computer, which could be annoying when not playing a game.

If this proved troublesome, a dpdt switch wired to the ground for the rotary switch could be used to kill them when not in use.

RandyT

  • Trade Count: (+14)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 6890
  • Last login:Yesterday at 08:20:02 pm
  • Friends don't let friends hack keyboards.
    • GroovyGameGear.com
Re: Fixing MAME's handling of 12-position rotary controls
« Reply #24 on: January 30, 2006, 06:02:32 pm »
There are 2 types. Optical and Mechanical rotaries. The optical ones are like spinners. The mechanical ones are 12 position, though I seem to recall there being mention of either and 8 or 10 position mechanical rotary as well. The 12 position ones are currently the only ones that anybody ever talks about, Ikari warriors being the primary game.

If this is true, then that is a good reason as to why 12 direct connections may not be the best approach, except for the games that require exactly a 12 position dial.

Quote
The sticks didn't have an indicator about which way the stick was supposed to point (i.e no "north" arrow) but you could definitely FEEL the major clicks as you spun your little dude around.

As I expected.  Still confident that a better solution can be had for far fewer inputs, but MAME would have to support it properly and some hardware would be involved.

Quote
As you click left with a rotary to shoot somebody while you're walking forward and you rotate one click and your guy moves 2 clicks...AAARGhh.. maddening. Like having mario all confused on a ladder in Donkey Kong. I know you can relate. You KNOW what's supposed to happen, and something is obviously NOT happening and you just wanna scream.

Yeah, I'm familiar with the problem.  No time constant or sensitivity seems to offer good results when using a button for right or left.  That's why I haven't even considered adding that kind of support.  It's one of those things that doesn't work well enough for it to be considered a "solution".

RandyT

Kremmit

  • - AHOTW -
  • Wiki Contributor
  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3164
  • Last login:November 22, 2020, 05:59:29 pm
  • Who the heck is that?
Re: Fixing MAME's handling of 12-position rotary controls
« Reply #25 on: January 30, 2006, 06:08:47 pm »
edit- already covered.
« Last Edit: January 30, 2006, 06:12:50 pm by Kremmit »

markrvp

  • ARGHHHHHHHHHHHHH!!!!!!!!!! True Genius!
  • Wiki Contributor
  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3353
  • Last login:September 14, 2020, 10:19:57 am
  • NFL Expert
Re: Fixing MAME's handling of 12-position rotary controls
« Reply #26 on: January 30, 2006, 06:09:31 pm »
I agree that the GP-Wiz gamepad inputs would be better candidates for always having a button pressed.  It's also easier to setup by using the GAMEPAD calibration in Control Panel.

Minwah

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7662
  • Last login:January 18, 2019, 05:03:20 am
    • MAMEWAH
Re: Fixing MAME's handling of 12-position rotary controls
« Reply #27 on: January 30, 2006, 06:10:15 pm »
All I know is that for every game like these, there are games like Off-Road that now use the correct controls making them near impossible to play without having the actual controls. (now uses analog up for the gas feed rather than a button press)

I might have misunderstood (& I'm still on v0.101), but if you want to use a button for gas then why not just remap it?

But yes I agree all games should be treated as they were in the arcade.  That way we can interface just about anything and have it work properly one way or another.  However if we came up with our own 'BYOAC build' we could be a little less arcade-accurate if neccessary, and have some solid rules in place for max compatibility with the hardware we use.  Edit: for example here we would want raw 12 input and probably 2 input (left/right) inputs for Druin owners...
« Last Edit: January 30, 2006, 06:14:04 pm by Minwah »

Kremmit

  • - AHOTW -
  • Wiki Contributor
  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3164
  • Last login:November 22, 2020, 05:59:29 pm
  • Who the heck is that?
Re: Fixing MAME's handling of 12-position rotary controls
« Reply #28 on: January 30, 2006, 06:12:21 pm »
If this is true, then that is a good reason as to why 12 direct connections may not be the best approach, except for the games that require exactly a 12 position dial.

But the games almost all do require exactly a 12 positon dial.  Other than the ones I listed above, they all use the same setup.  Here they are:

-----------------------

Battle Field
Top Gunner (bootleg only)
World Wars
Ikari Warriors
Victory Road
Heavy Barrel
Gondomania
Bermuda Triangle
Time Soldiers
Guerilla War
SAR - Search And Rescue
Downtown
Legendary Wings
Victory Road
Midnight Resistance
Ikari III - The Rescue
Exterminator
TNK III
Touchdown Fever edit - oops, optical rotary!

-------
« Last Edit: February 01, 2006, 01:35:12 am by Kremmit »

RobotronNut

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 315
  • Last login:December 22, 2018, 11:39:19 am
  • I want to build my own arcade controls!
Re: Fixing MAME's handling of 12-position rotary controls
« Reply #29 on: January 30, 2006, 06:31:01 pm »
based on the code in snk.c, the ROM reads 4 bits from an input port and expects to see a number from 0 thru 11, so the 12 switch inputs must have gone through a hardware encoder.

If that's the case, then it was on-board the original PCB, and all it did was translate a simple closed circuit into a number.
that's very likely.

Quote
Can you tell what's feeding that number to snk.c now?

mame sees keystrokes which it interprets as CW and CCW rotations of an analog dial (a "relative" device). it munges these into a 16-bit number (i haven't read exactly how it does this) and the snk driver then munges them back into discrete CW or CCW rotations. by observation, these are not always one-to-one with the hardware rotations. the cleaner thing would be to create a new input type and model the 12-switch rotary directly, using the CW and CCW keystrokes that you'd get from the druin's thru a keyboard encoder.
to see my "Frankenpanel" and design notes, click here.

Kremmit

  • - AHOTW -
  • Wiki Contributor
  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3164
  • Last login:November 22, 2020, 05:59:29 pm
  • Who the heck is that?
Re: Fixing MAME's handling of 12-position rotary controls
« Reply #30 on: January 30, 2006, 06:42:15 pm »
Wouldn't it be even cleaner to strip out the CW and CCW keystrokes entirely, and convert directly between the 12 way switch and the SNK driver?

mahuti

  • Wiki Master
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 2757
  • Last login:March 02, 2022, 09:51:19 pm
  • I dare anything! I am Skeletor!
Re: Fixing MAME's handling of 12-position rotary controls
« Reply #31 on: January 30, 2006, 07:11:50 pm »
Right. Exactly.

Raspberry Pi, AttractMode, and Skeletor enthusiast.

RobotronNut

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 315
  • Last login:December 22, 2018, 11:39:19 am
  • I want to build my own arcade controls!
Re: Fixing MAME's handling of 12-position rotary controls
« Reply #32 on: January 30, 2006, 07:37:41 pm »
Wouldn't it be even cleaner to strip out the CW and CCW keystrokes entirely, and convert directly between the 12 way switch and the SNK driver?
i prefer the druin's method, because you don't have any always-on keys, which might interfere with front-ends or general windows use.

i don't see any reason why the druin's solution couldn't be made 100% accurate. (unless there's some defect in the druin's hardware that i'm not aware of. but i suspect the druin's is fine and all the problems people are seeing are the result of mame's problems.)
« Last Edit: January 30, 2006, 07:55:46 pm by RobotronNut »
to see my "Frankenpanel" and design notes, click here.

rdagger

Re: Fixing MAME's handling of 12-position rotary controls
« Reply #33 on: January 30, 2006, 08:15:32 pm »
i don't see any reason why the druin's solution couldn't be made 100% accurate. (unless there's some defect in the druin's hardware that i'm not aware of. but i suspect the druin's is fine and all the problems people are seeing are the result of mame's problems.)

There is probably nothing wrong with Druin's board.  I built a rotary interface and I know it works accurately, because I can open up notepad and rotate the handles and I will always get 1 letter for every turn.  However, in Ikari I often get 1 too many or too few clicks.

rdagger

Re: Fixing MAME's handling of 12-position rotary controls
« Reply #34 on: January 30, 2006, 11:05:48 pm »
OK, I finally got MAME Analog+ working with my rotary interface so now it is exactly 1 rotation for every click of the LS-30.  I felt retarded because I was following all the instructions and I could not get the latest version .9 to work.  So I decided to download an earlier version and all the problems went away.  It worked perfectly without any adjustments. 

I tested every version and it appears that the last one to work correctly with a Druin-type rotary interface is MameAnalog+ ver. 0.83.2.

Maybe I'm still missing something to why the later versions don't work, but anyway Ikari rocks now.


spidermonkey

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 850
  • Last login:October 01, 2023, 04:15:59 am
  • Bombjack junkie
Re: Fixing MAME's handling of 12-position rotary controls
« Reply #35 on: January 31, 2006, 12:38:05 am »


Here's a pair of loop 24 optical rotaries. They have an encoder wheel like a spinner but they don't act anything like a spinner. These sticks click just like their mechanical cousins(LS-30s) but they have 24 distinct positions instead of 12 ie  "loop 24" . Cal 50 and Touchdown fever 1 & 2 are the only three games that use loop 24 optical rotaries. The rest of Kremmit's list all use 12 position mechanical rotaries. Oh and another unimportant tidbit of info from the mind of Spidermonkey ::)...Both the LS-30S and the similar Loop 24 sticks were manufactured by Seimitsu. Not SNK.
"Sinistar has bad breath"

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8183
  • Last login:April 12, 2023, 09:22:35 pm
  • The Bears Still Suck!
Re: Fixing MAME's handling of 12-position rotary controls
« Reply #36 on: January 31, 2006, 02:07:09 am »
I haven't read through all this yet.  If anyone needs to know something about the ls30 let me know, I have one.

Minwah

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7662
  • Last login:January 18, 2019, 05:03:20 am
    • MAMEWAH
Re: Fixing MAME's handling of 12-position rotary controls
« Reply #37 on: January 31, 2006, 04:54:14 am »
the cleaner thing would be to create a new input type and model the 12-switch rotary directly, using the CW and CCW keystrokes that you'd get from the druin's thru a keyboard encoder.

My only problem with this is that this requires the Druin or similar interface, whereas with raw-12 inputs you would not.

Personally I think both methods should be incorporated so everyone is happy, and arcade-accurate-ness is retained too.

Teknique

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 204
  • Last login:October 02, 2015, 10:35:46 am
  • I'm a Gauntlet wizard in real life
Re: Fixing MAME's handling of 12-position rotary controls
« Reply #38 on: January 31, 2006, 06:56:12 am »
OK, I finally got MAME Analog+ working with my rotary interface so now it is exactly 1 rotation for every click of the LS-30.  I felt retarded because I was following all the instructions and I could not get the latest version .9 to work.  So I decided to download an earlier version and all the problems went away.  It worked perfectly without any adjustments. 

I tested every version and it appears that the last one to work correctly with a Druin-type rotary interface is MameAnalog+ ver. 0.83.2.

Maybe I'm still missing something to why the later versions don't work, but anyway Ikari rocks now.



rdagger,
Can you post your sensitivity settings and anything else you did in the tab menu to make it work as flawlessly as you have so the rest of us can test her out?

Thx.
Your screen name has been added to my frag list.

Tiger-Heli

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5447
  • Last login:January 03, 2018, 02:19:23 pm
  • Ron Howard? . . . er, I mean . . . Run, Coward!!!
    • Tiger-Heli
Re: Fixing MAME's handling of 12-position rotary controls
« Reply #39 on: January 31, 2006, 12:21:11 pm »
There are 2 types. Optical and Mechanical rotaries. The optical ones are like spinners. The mechanical ones are 12 position, though I seem to recall there being mention of either and 8 or 10 position mechanical rotary as well. The 12 position ones are currently the only ones that anybody ever talks about, Ikari warriors being the primary game.

The sticks didn't have an indicator about which way the stick was supposed to point (i.e no "north" arrow) but you could definitely FEEL the major clicks as you spun your little dude around.
Do these sticks have an indicator pointing to the same direction as the on-screen action?
Nope, but they could.  The same side of the stick is always pointing straight up when the character is pointing straight up.
Let me touch on a couple of points here.  Assuming the information on my page is correct, and I think I got it from BYOAC - All the games used a 12-position switch - but, IKARI (and many - ALL??? - other games) only rotated the sprites through 8 positions (45-degree firing).  So if you clicked the stick 180 degrees - six clicks - CW - your character should actually rotate 270 degrees and be pointing left.  However, the clicks were very easy to feel, so it became second-nature to rotate the stick 4 clicks to turn 180 degrees, and you never noticed that the actual stick only turned 120 degrees.

Frontline (and Tin Star & Wild Western) used a 8-way joystick with a knob instead of a regular handle.  When you twisted the knob, it rotated an actuator that would contact the correct microswitch(es) to point the gun in the correct direction.  You could also call this an 8-way rotary, but it does not use an 8-position switch, but rather 4 microswitches, just like a joystick.  MAME already correctly emulates this, with aiming handled by the "P2 Joystick" controls.
BINGO!!!! - Perfect example of what Mahuti and Minwah and I have been complaining about.

Frontline and Tin Star and Wild Western used a very unique controller that is not available except rarely on E-bay.  However, it could be played very authentically using a spinner.  MAME does not support the spinner (or really keyboard inputs), but sets itself up to use the actual arcade controls.

Ikari, et. al. used a very unique joystick with a mechanical rotary 12-position switch.  These were readily available as NOS until a couple of years ago, and are still quite common on E-bay.  The games could also be played using an optical rotary joystick or a spinner, or buttons for rotation.  MAME supports the game using a spinner or buttons, and does not (except for Analog Plus and some games) support the actual hardware.

If you ask about these things on www.mame.net, they will say that Tin Star is accurate, and that IKARI supports a dial or buttons because everyone has either a keyboard or mouse.

Our point is that MAME should either consistently support the actual hardware - and let the user figure out how to play the game without it, or consistently support the keyboard and mouse - and let the user come up with their own converters to make the actual hardware work, not some games one way and others the ohter way.
It's not what you take when you leave this world behind you, it's what you leave behind you when you go. - R. Travis.
When all is said and done, generally much more is SAID than DONE.