diff options
author | 2021-01-23 00:55:21 +1100 | |
---|---|---|
committer | 2021-01-23 00:55:21 +1100 | |
commit | 205511eea7e39e4d5a6f642bd05a223c023059c6 (patch) | |
tree | c379ae67a0550e4ba84344fdb7a5f11e31bd34c6 /src/mame/drivers/getaway.cpp | |
parent | 463e48a7e5db6a0c26c405fef848882faff556d8 (diff) |
-getaway.cpp: Fixed steering control.
* Works fine with an analog stick/wheel, difficult to steer on the
slippery "dotted" surface with keyboard/D-pad.
-osd: Moved GCC intrinsics out of eminline.h so MAME_NOASM will take the
pure C++ implementation with GCC (makes testing the fallback easier).
-Removed a bunch of [[maybe_unused]] that aren't actually needed.
Diffstat (limited to 'src/mame/drivers/getaway.cpp')
-rw-r--r-- | src/mame/drivers/getaway.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/mame/drivers/getaway.cpp b/src/mame/drivers/getaway.cpp index cf12aecbaaf..14887e0255b 100644 --- a/src/mame/drivers/getaway.cpp +++ b/src/mame/drivers/getaway.cpp @@ -47,18 +47,22 @@ namespace { class getaway_state : public driver_device { public: - getaway_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag) + getaway_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") , m_gfxrom(*this, "gfx") , m_screen(*this, "screen") , m_inputs(*this, "IN.%u", 0) , m_dsw(*this, "DSW.%u", 0) + , m_wheel(*this, "WHEEL") { } // machine configs void getaway(machine_config &config); + // input functions + ioport_value read_wheel() { return (m_wheel->read() - 0x08) & 0xff; } + protected: virtual void machine_start() override; @@ -69,6 +73,7 @@ private: required_device<screen_device> m_screen; required_ioport_array<3> m_inputs; required_ioport_array<2> m_dsw; + required_ioport m_wheel; void main_map(address_map &map); void io_map(address_map &map); @@ -336,9 +341,12 @@ static INPUT_PORTS_START( getaway ) PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_MINMAX(0x00,0x1f) PORT_SENSITIVITY(10) PORT_KEYDELTA(15) PORT_START("IN.2") - // steering wheel, 0x00 is neutral, range seems to be 0xe0-0x1f where bit 7 on goes to left dir. - // TODO: better input type/defaults - PORT_BIT( 0xff, 0, IPT_AD_STICK_X ) PORT_MINMAX(0x80, 0x7f) PORT_SENSITIVITY(5) PORT_KEYDELTA(5) // PORT_CENTERDELTA(0) + // steering wheel, signed byte, absolute values larger than 8 ignored + PORT_BIT( 0xff, 0x00, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(getaway_state, read_wheel) + + PORT_START("WHEEL") + // TODO: check sensitivity and key delta + PORT_BIT( 0xff, 0x08, IPT_AD_STICK_X ) PORT_MINMAX(0x00, 0x10) PORT_SENSITIVITY(5) PORT_KEYDELTA(25) // PORT_CENTERDELTA(0) // dips are two banks, a regular 8 banks one // and a tiny 4. They are labeled, hard to read from the provided pic :=( |