-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
xavix.cpp : gave tomplc & tcarnavi inputs (they seem to use digital pedals/steering etc.) and promoted both to working [David Haywood] #12163
Conversation
…edals/steering etc.) and promoted both to working
src/mame/tvgames/xavix.cpp
Outdated
// should this be a 3 position shifter? (off or either state) - this is the up/down handle | ||
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("Throttle Low") | ||
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("Throttle High") | ||
|
||
PORT_MODIFY("IN1") | ||
// should this be a 3 position shifter? (off or either state) - this is the rotational handle | ||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON8 ) PORT_NAME("Brake Low") | ||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON9 ) PORT_NAME("Brake High") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IPT_POSITIONAL
or IPT_POSITIONAL_V
might be a better choice for these – they both have off/1/2 notches, and holding buttons for them isn’t very realistic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively, I guess they could be treated as very low-resolution IPT_PADDLE
/IPT_PADDLE_V
. But MAME will map those to auto-centring joystick axes, which will make them snap to the “1” position. That’s not very helpful for a train simulator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean if you have a preference, I don't really mind you adjusting it, I just wanted to identify the inputs.
These plug and plays tend to use all sorts of weird inputs, either simplified versions of things you might expect to be analog (as we see here) or ridiculously complex camera based where they're looking at an entire grid of analog values to work out exactly where you're holding something and at what angle in 3D space.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean if you have a preference, I don't really mind you adjusting it, I just wanted to identify the inputs.
Can you go with IPT_POSITIONAL
and IPT_POSITIONAL_V
for the train controller for now?
simplified versions of things you might expect to be analog (as we see here)
FWIW, train controls are often digital, just with more notches than the three you see here. The old UK “standard” electropneumatic brake system has five notches (off, three levels, plus emergency), old electric trains often had four power notches, the standard AAR diesel loco controls have nine notches on the power control. Digital (“notched”) brake controls tend to be less common than “notched” power controls, but they aren’t unheard-of.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really know how those work though, they seem rather obfuscated
static const ioport_value positional_table_v[3] =
{
0x00, 0x10, 0x20
};
PORT_BIT( 0x30, 0x00, IPT_POSITIONAL_V ) PORT_POSITIONS(3) PORT_REMAP_TABLE(positional_table_v) PORT_SENSITIVITY(5) PORT_KEYDELTA(10) PORT_CENTERDELTA(0)
seems to do nothing. These are treated as analog, but they don't seem like analog, as it should just switch between positions, however if I don't specify sensitivity it just complains.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought you didn’t need the remap table if the values were sequential? I didn’t use it in Sega BEENA.
Does something like this work?
PORT_BIT( 0x30, 0x00, IPT_POSITIONAL_V ) PORT_POSITIONS(3) PORT_SENSITIVITY(10) PORT_KEYDELTA(1) PORT_FULL_TURN_COUNT(3) PORT_NAME("Power")
PORT_MODIFY("IN1")
PORT_BIT( 0x03, 0x00, IPT_POSITIONAL ) PORT_POSITIONS(3) PORT_SENSITIVITY(10) PORT_KEYDELTA(1) PORT_FULL_TURN_COUNT(3) PORT_NAME("Brake")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That should give increment/decrement buttons to assign to step through the positions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it kinda works, but it doesn't lock in place, it keeps trying to go back to 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to be annoying, positional controls default to auto-centre if they don’t wrap. Easy enough to fix.
No description provided.