There is a new menu item when Real/Fake controls are found called "Controller Type." There you can select to use 1 of the 3 types.
a.) Changing MAME core engine functionality to suit only one game, or very small and specific group of games, is no good.
b.) You have not submitted all the changes, not even complete "atarisy2.c", but more importantly you forgot to mention what other files you modified.
c.) As other similar menu options this should then also be accompanied with a new command line switch, and as anything 'unnecessary' this is also no good.
d.) You have only TWO types of devices there, not three. Arcade spinner can be mapped to "720 spinner" with no problems. No need for "real" and "fake" when we already have "mouse" and "analog", where analog stick maps to analog axes and both 'arcade spinner' and '720 spinner' map to mouse axes.
PORT_MODIFY("LETA0")
PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10)
PORT_REAL("Rotation", fake_leta_r) PORT_NAME("Center")
PORT_MODIFY("LETA1")
PORT_BIT( 0xff, 0x00, IPT_DIAL_V ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10)
PORT_FULL_TURN_COUNT(144) PORT_REAL("Rotation", fake_leta_r) PORT_NAME("Rotate")
Addition of "PORT_REAL", "PORT_FAKE", "PORT_FULL_TURN_COUNT(144)" is unnecessary and involves changes to core MAME engine, like modification of "inptport.c", and who knows what else.
It's nice to see you too named calibration port as "IPT_DIAL_V", but Mouse_Y and Mouse_X data seem to be swapped around in "REAL_FUNCTION", which is one of those things you did not show us.
PORT_START("FAKE_JOY_X") /* not direct mapped */
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(10)
PORT_FAKE("Rotation", "Joystick")
PORT_START("FAKE_JOY_Y") /* not direct mapped */
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(10)
PORT_REVERSE PORT_FAKE("Rotation", "Joystick")
Now that I know there is such thing as "PORT_START" I can add a 3rd variant to the list of my beautiful solutions, which generally is to any PC game developer just a very common and standard way to handle different input devices.
PORT_START("FAKE_SPINNER") /* not direct mapped */
PORT_BIT( 0xffff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(12) PORT_KEYDELTA(10)
PORT_FAKE("Rotation", "Spinner")
You do not need this, 'arcade spinner' maps to '720 spinner' very well. If you are doing it just to set different sensitivity then you shouldn't as various types of 'arcade spinners' would require different settings anyway, and their full rotation does not need to equal 720's full rotation, so the sensitivity of arcade spinners in this case is more a matter of personal preference, plus it can always be adjusted from the menu. Gameplay with an arcade spinner is much like gameplay with a mouse where you rotate the character by moving the mouse left-right, calibration at "360 degrees" in not necessary or better to say it's inapplicable.
static FAKE_INPUT( fake_leta_r )
You show us "FAKE_INPUT", but not "REAL_INPUT" function, nor where is the branching instruction to decide which one of them to execute. Without you submitting complete, and all the files you have modified no one will able to compile your changes, try to improve, learn from it, play with it, or anything.
if (!strcmp(current_controller, "Joystick"))
Finally we know what was the mysterious variable in infamous "Step 2", it's a bloody STRING?! Are you mad, comparing strings in a core function that you execute at least once per frame? So, you were not happy with all the unnecessary bloat introduced for this simple thing, now you also have to make it run slower, sheesh!
int analogx = input_port_read(field->port->machine, "FAKE_JOY_X") - 128;
int analogy = input_port_read(field->port->machine, "FAKE_JOY_Y") - 128;
Should be "- 127", not "- 128". I suggest you try to monitor what kind of data is incoming to those variables. Something seem wrong there as it gets clamped to min and max when stick retains in constant position, only when actually being moved, I suppose when there is a difference between immediate data packets - deltaX and deltaY, only then we can read actual position of the stick, which might have to do with why anal_hack rotation is not smooth but flickers and jitters.
else if (!strcmp(current_controller, "Spinner"))
It makes me puke just to look at the word - "strcmp". Anyway, "else" will do here, you do not need that second comparison until you decide to add keyboard hack too. But, the thing is, you do not need that whole part at all, the real input function can handle 'arcade spinner' as it is, without any hacks, changes or additions - it's still just a "mouse input" in either case.