summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author MetalliC <0vetal0@gmail.com>2017-08-22 20:29:37 +0300
committer MetalliC <0vetal0@gmail.com>2017-08-22 20:29:37 +0300
commit4792c5a8cb3b60a6b2b099fe8404f54ced13d715 (patch)
tree4e63e752ba22dc8baed8d93b7602005112cfbf9c
parentfc55c527ce9906aec6031f8770cf6b2113cc7dd3 (diff)
gaelco3d.cpp: better Football Power ball mechanic simulation, promoted to working
-rw-r--r--src/mame/drivers/gaelco3d.cpp34
-rw-r--r--src/mame/includes/gaelco3d.h5
2 files changed, 21 insertions, 18 deletions
diff --git a/src/mame/drivers/gaelco3d.cpp b/src/mame/drivers/gaelco3d.cpp
index f99651b93cc..512feb7fff6 100644
--- a/src/mame/drivers/gaelco3d.cpp
+++ b/src/mame/drivers/gaelco3d.cpp
@@ -187,6 +187,7 @@ void gaelco3d_state::machine_start()
save_item(NAME(m_fp_clock));
save_item(NAME(m_fp_state));
save_item(NAME(m_fp_analog_ports));
+ save_item(NAME(m_fp_lenght));
}
@@ -392,19 +393,17 @@ WRITE_LINE_MEMBER(gaelco3d_state::fp_analog_clock_w)
if (m_fp_clock == 28)
{
m_fp_clock = 0;
-
- for (auto i = 0; i < 6; i++)
+ for (auto i = 0; i < 2; i++)
{
- u8 shift = (i % 3) * 8 + 2;
- u8 newval = m_analog[i].read_safe(0);
- u8 oldval = m_fp_analog_ports[i / 3] >> shift;
- m_fp_analog_ports[i / 3] &= ~(0xff << shift);
- m_fp_analog_ports[i / 3] |= newval << shift;
-
- if (newval > oldval)
- m_fp_analog_ports[i / 3] &= ~2;
- else if (newval < oldval)
- m_fp_analog_ports[i / 3] |= 2;
+ u32 ay = m_analog[i * 2].read_safe(0);
+ u32 ax = m_analog[i * 2 + 1].read_safe(0);
+ m_fp_analog_ports[i] = (ax << 18) | ((ax ^ 0xff) << 10) | (ay << 2) | 1;
+ s32 aay = ay - 0x80;
+ s32 aax = ax - 0x80;
+ u32 len = aay * aay + aax * aax;
+ if (len <= m_fp_lenght[i])
+ m_fp_analog_ports[i] |= 2;
+ m_fp_lenght[i] = len;
}
}
}
@@ -934,13 +933,16 @@ static INPUT_PORTS_START( footbpow )
PORT_BIT( 0xffff0000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("ANALOG0")
- PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(100)
+ PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_MINMAX(0x00, 0xff) PORT_REVERSE PORT_SENSITIVITY(25) PORT_KEYDELTA(50)
PORT_START("ANALOG1")
- PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_SENSITIVITY(100) PORT_KEYDELTA(100)
+ PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(50)
PORT_START("ANALOG2")
- PORT_BIT( 0xff, 0x00, IPT_PEDAL3 ) PORT_SENSITIVITY(100) PORT_KEYDELTA(100)
+ PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_MINMAX(0x00, 0xff) PORT_PLAYER(2) PORT_REVERSE PORT_SENSITIVITY(25) PORT_KEYDELTA(50)
+
+ PORT_START("ANALOG3")
+ PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_MINMAX(0x00, 0xff) PORT_PLAYER(2) PORT_SENSITIVITY(25) PORT_KEYDELTA(50)
INPUT_PORTS_END
@@ -1302,4 +1304,4 @@ GAME( 1997, surfplnt40, surfplnt, gaelco3d, surfplnt, gaelco3d_state, gaelco3d,
GAME( 1998, radikalb, 0, gaelco3d2, radikalb, gaelco3d_state, gaelco3d, ROT0, "Gaelco", "Radikal Bikers (Version 2.02)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE)
GAME( 1998, radikalba, radikalb, gaelco3d2, radikalb, gaelco3d_state, gaelco3d, ROT0, "Gaelco (Atari license)", "Radikal Bikers (Version 2.02, Atari license)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE)
-GAME( 1999, footbpow, 0, footbpow, footbpow, gaelco3d_state, gaelco3d, ROT0, "Gaelco", "Football Power", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_CONTROLS | MACHINE_NOT_WORKING )
+GAME( 1999, footbpow, 0, footbpow, footbpow, gaelco3d_state, gaelco3d, ROT0, "Gaelco", "Football Power", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_CONTROLS )
diff --git a/src/mame/includes/gaelco3d.h b/src/mame/includes/gaelco3d.h
index 03a253349d9..40d567b669f 100644
--- a/src/mame/includes/gaelco3d.h
+++ b/src/mame/includes/gaelco3d.h
@@ -74,7 +74,7 @@ public:
m_outlatch(*this, "outlatch"),
m_paletteram16(*this, "paletteram"),
m_paletteram32(*this, "paletteram"),
- m_analog(*this, {"ANALOG0", "ANALOG1", "ANALOG2", "ANALOG3", "ANALOG4", "ANALOG5" })
+ m_analog(*this, {"ANALOG0", "ANALOG1", "ANALOG2", "ANALOG3"})
{ }
required_shared_ptr<uint32_t> m_adsp_ram_base;
@@ -92,13 +92,14 @@ public:
required_device<ls259_device> m_outlatch;
optional_shared_ptr<uint16_t> m_paletteram16;
optional_shared_ptr<uint32_t> m_paletteram32;
- optional_ioport_array<6> m_analog;
+ optional_ioport_array<4> m_analog;
uint16_t m_sound_data;
uint8_t m_sound_status;
offs_t m_tms_offset_xor;
uint8_t m_analog_ports[4];
uint32_t m_fp_analog_ports[2];
+ uint32_t m_fp_lenght[2];
uint8_t m_fp_clock;
uint8_t m_fp_state;
uint8_t m_framenum;