cleaned up midvunit inputs and outputs. cleaned up seattle outputs. (#3355)

* cleaned up midvunit inputs and outputs. cleaned up seattle outputs.

* better motion inputs and sorted main buttons for midvunit

* keep case the same

* removed runtime tagmap lookup
This commit is contained in:
Risugami 2018-03-18 22:13:03 -05:00 committed by Vas Crabb
parent 8b492a67bc
commit 647ea55ea5
4 changed files with 150 additions and 206 deletions

View File

@ -57,6 +57,8 @@ void midvunit_state::machine_start()
save_item(NAME(m_wheel_board_output)); save_item(NAME(m_wheel_board_output));
save_item(NAME(m_wheel_board_last)); save_item(NAME(m_wheel_board_last));
save_item(NAME(m_wheel_board_u8_latch)); save_item(NAME(m_wheel_board_u8_latch));
m_optional_drivers.resolve();
} }
@ -366,7 +368,7 @@ WRITE32_MEMBER(midvunit_state::offroadc_serial_data_w)
READ32_MEMBER(midvunit_state::midvunit_wheel_board_r) READ32_MEMBER(midvunit_state::midvunit_wheel_board_r)
{ {
//logerror("midvunit_wheel_board_r: %08X\n", m_wheel_board_output); //logerror("midvunit_wheel_board_r: %08X\n", m_wheel_board_output);
return m_wheel_board_output; return m_wheel_board_output << 8;
} }
void midvunit_state::set_input(const char *s) void midvunit_state::set_input(const char *s)
@ -406,7 +408,7 @@ WRITE32_MEMBER(midvunit_state::midvunit_wheel_board_w)
switch (wa) switch (wa)
{ {
case 0: case 0:
m_wheel_board_output = m_galil_input[m_galil_input_index++] << 8; m_wheel_board_output = m_galil_input[m_galil_input_index++];
break; break;
case 1: case 1:
if (arg != 0xD) if (arg != 0xD)
@ -442,7 +444,7 @@ WRITE32_MEMBER(midvunit_state::midvunit_wheel_board_w)
} }
break; break;
case 2: case 2:
m_wheel_board_output = (m_galil_input_index < m_galil_input_length) ? 0x8000 : 0x0; m_wheel_board_output = (m_galil_input_index < m_galil_input_length) ? 0x80 : 0x0;
break; break;
case 3: // Galil init? case 3: // Galil init?
break; break;
@ -476,7 +478,7 @@ WRITE32_MEMBER(midvunit_state::midvunit_wheel_board_w)
break; break;
case 5: // DRVCTLZ case 5: // DRVCTLZ
for (uint8_t bit = 0; bit < 8; bit++) for (uint8_t bit = 0; bit < 8; bit++)
output().set_lamp_value(bit, BIT(data, bit)); m_optional_drivers[bit] = BIT(data, bit);
//logerror("Wheel board (U10 74HC574; Lamps) = %02X\n", arg); //logerror("Wheel board (U10 74HC574; Lamps) = %02X\n", arg);
break; break;
case 6: // PRTCTLZ case 6: // PRTCTLZ
@ -493,6 +495,18 @@ WRITE32_MEMBER(midvunit_state::midvunit_wheel_board_w)
} }
DECLARE_CUSTOM_INPUT_MEMBER(midvunit_state::motion_r)
{
uint8_t status = m_motion->read();
for (uint8_t bit = 0; bit < 8; bit++)
{
if (BIT(status, bit))
return bit + 1;
}
return 0;
}
/************************************* /*************************************
* *
* War Gods I/O ASICs * War Gods I/O ASICs
@ -640,8 +654,8 @@ void midvunit_state::midvplus_map(address_map &map)
* Input ports * Input ports
* *
*************************************/ *************************************/
static INPUT_PORTS_START( crusnusa ) static INPUT_PORTS_START( midvunit )
PORT_START("991030") PORT_START("991030")
PORT_BIT( 0x0000ffff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, driver_device,custom_port_read, "IN1") PORT_BIT( 0x0000ffff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, driver_device,custom_port_read, "IN1")
PORT_BIT( 0xffff0000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, driver_device,custom_port_read, "IN1") PORT_BIT( 0xffff0000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, driver_device,custom_port_read, "IN1")
@ -661,30 +675,54 @@ static INPUT_PORTS_START( crusnusa )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_COIN3 )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_VOLUME_DOWN ) PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_VOLUME_DOWN )
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_VOLUME_UP ) PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_VOLUME_UP )
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("4th Gear") /* 4th */ PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("4th Gear") /* 4th */
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("3rd Gear") /* 3rd */ PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("3rd Gear") /* 3rd */
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("2nd Gear") /* 2nd */ PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("2nd Gear") /* 2nd */
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("1st Gear") /* 1st */ PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("1st Gear") /* 1st */
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_COIN4 ) PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_COIN4 )
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("IN1") PORT_START("IN1")
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("Radio") /* radio */ PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Radio") /* radio */
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("View 1") /* view 1 */ PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("View 1") /* view 1 */
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON9 ) PORT_NAME("View 2") /* view 2 */ PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("View 2") /* view 2 */
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON10 ) PORT_NAME("View 3") /* view 3 */ PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("View 3") /* view 3 */
PORT_BIT( 0xff80, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("WHEEL") /* wheel */
PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x10,0xf0) PORT_SENSITIVITY(25) PORT_KEYDELTA(20)
PORT_START("ACCEL") /* gas pedal */
PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(20)
PORT_START("BRAKE") /* brake pedal */
PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_SENSITIVITY(25) PORT_KEYDELTA(20)
INPUT_PORTS_END
static INPUT_PORTS_START( crusnusa )
PORT_INCLUDE( midvunit )
PORT_START("MOTION")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_NAME("Motion Status - Mat Not Plugged In")
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_NAME("Motion Status - Mat Stepped On")
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_NAME("Motion Status - Opto Path Broken")
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_NAME("Motion Status - Opto Detector Not Receiving")
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_NAME("Motion Status - Opto LED Not Emitting")
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_NAME("Motion Status - Fail Safe Switch Engaged")
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_NAME("Motion Status - Fail Safe Switch Not Connected Correctly")
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_NAME("Motion Status - Board Not Plugged In")
PORT_MODIFY("IN1")
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_NAME("Motion Stop") PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_NAME("Motion Stop")
PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_NAME("Right Mat") PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_NAME("Motion Status - Device 1")
PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_NAME("Rear Mat") PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_NAME("Motion Status - Device 2")
PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_NAME("Left Mat") PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_NAME("Motion Status - Device 3")
PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_NAME("Front Mat") PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_NAME("Motion Status - Device 4")
PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_NAME("Mat Plugin") PORT_BIT( 0xf000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, midvunit_state, motion_r, nullptr )
PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_NAME("Mat Step")
PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_NAME("Opto Detector")
PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_NAME("Failsafe Switch")
PORT_START("DSW") PORT_START("DSW")
/* DSW2 at U97 */ /* DSW2 at U97 */
@ -771,55 +809,11 @@ static INPUT_PORTS_START( crusnusa )
PORT_DIPSETTING( 0x1c00, "Spain-3" ) PORT_DIPSETTING( 0x1c00, "Spain-3" )
PORT_DIPSETTING( 0x1800, "Spain-4" ) PORT_DIPSETTING( 0x1800, "Spain-4" )
PORT_DIPSETTING( 0x0e00, "Netherland-1" ) PORT_DIPSETTING( 0x0e00, "Netherland-1" )
PORT_START("WHEEL") /* wheel */
PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x10,0xf0) PORT_SENSITIVITY(25) PORT_KEYDELTA(20)
PORT_START("ACCEL") /* gas pedal */
PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(20)
PORT_START("BRAKE") /* brake pedal */
PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_SENSITIVITY(25) PORT_KEYDELTA(20)
INPUT_PORTS_END INPUT_PORTS_END
static INPUT_PORTS_START( crusnwld ) static INPUT_PORTS_START( crusnwld )
PORT_START("991030") PORT_INCLUDE( midvunit )
PORT_BIT( 0x0000ffff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, driver_device,custom_port_read, "IN1")
PORT_BIT( 0xffff0000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, driver_device,custom_port_read, "IN1")
PORT_START("992000")
PORT_BIT( 0x0000ffff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, driver_device,custom_port_read, "DSW")
PORT_BIT( 0xffff0000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, driver_device,custom_port_read, "DSW")
PORT_START("IN0")
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_TILT ) /* Slam Switch */
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Enter") PORT_CODE(KEYCODE_F2) /* Test switch */
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_COIN3 )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_VOLUME_DOWN )
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_VOLUME_UP )
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("4th Gear") /* 4th */
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("3rd Gear") /* 3rd */
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("2nd Gear") /* 2nd */
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("1st Gear") /* 1st */
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_COIN4 )
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("IN1")
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("Radio") /* radio */
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("View 1") /* view 1 */
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON9 ) PORT_NAME("View 2") /* view 2 */
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON10 ) PORT_NAME("View 3") /* view 3 */
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON11 ) PORT_NAME("View 4") /* view 4 */
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("DSW") PORT_START("DSW")
/* DSW2 at U97 */ /* DSW2 at U97 */
@ -901,55 +895,11 @@ static INPUT_PORTS_START( crusnwld )
PORT_DIPSETTING( 0x1c00, "Spain-3" ) PORT_DIPSETTING( 0x1c00, "Spain-3" )
PORT_DIPSETTING( 0x1800, "Spain-4" ) PORT_DIPSETTING( 0x1800, "Spain-4" )
PORT_DIPSETTING( 0x0e00, "Netherland-1" ) PORT_DIPSETTING( 0x0e00, "Netherland-1" )
PORT_START("WHEEL") /* wheel */
PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x10,0xf0) PORT_SENSITIVITY(25) PORT_KEYDELTA(20)
PORT_START("ACCEL") /* gas pedal */
PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(20)
PORT_START("BRAKE") /* brake pedal */
PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_SENSITIVITY(25) PORT_KEYDELTA(20)
INPUT_PORTS_END INPUT_PORTS_END
static INPUT_PORTS_START( offroadc ) static INPUT_PORTS_START( offroadc )
PORT_START("991030") PORT_INCLUDE( midvunit )
PORT_BIT( 0x0000ffff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, driver_device,custom_port_read, "IN1")
PORT_BIT( 0xffff0000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, driver_device,custom_port_read, "IN1")
PORT_START("992000")
PORT_BIT( 0x0000ffff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, driver_device,custom_port_read, "DSW")
PORT_BIT( 0xffff0000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, driver_device,custom_port_read, "DSW")
PORT_START("IN0")
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_TILT ) /* Slam Switch */
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Enter") PORT_CODE(KEYCODE_F2) /* Test switch */
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_COIN3 )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_VOLUME_DOWN )
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_VOLUME_UP )
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("4th Gear") /* 4th */
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("3rd Gear") /* 3rd */
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("2nd Gear") /* 2nd */
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("1st Gear") /* 1st */
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_COIN4 )
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("IN1")
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("Radio") /* radio */
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("View 1") /* view 1 */
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON9 ) PORT_NAME("View 2") /* view 2 */
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON10 ) PORT_NAME("View 3") /* view 3 */
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON11 ) PORT_NAME("View 4") /* view 4 */
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("DSW") PORT_START("DSW")
/* DSW2 at U97 */ /* DSW2 at U97 */
@ -997,15 +947,6 @@ static INPUT_PORTS_START( offroadc )
PORT_DIPSETTING( 0x7800, "Norway 1" ) PORT_DIPSETTING( 0x7800, "Norway 1" )
PORT_DIPSETTING( 0x7000, "Denmark 1" ) PORT_DIPSETTING( 0x7000, "Denmark 1" )
PORT_DIPSETTING( 0x6800, "Hungary 1" ) PORT_DIPSETTING( 0x6800, "Hungary 1" )
PORT_START("WHEEL") /* wheel */
PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x10,0xf0) PORT_SENSITIVITY(25) PORT_KEYDELTA(20)
PORT_START("ACCEL") /* gas pedal */
PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(20)
PORT_START("BRAKE") /* brake pedal */
PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_SENSITIVITY(25) PORT_KEYDELTA(20)
INPUT_PORTS_END INPUT_PORTS_END

View File

@ -280,7 +280,9 @@ public:
m_dcs(*this, "dcs"), m_dcs(*this, "dcs"),
m_ethernet(*this, "ethernet"), m_ethernet(*this, "ethernet"),
m_ioasic(*this, "ioasic"), m_ioasic(*this, "ioasic"),
m_io_analog(*this, "AN%u", 0) m_io_analog(*this, "AN%u", 0),
m_lamps(*this, "lamp%u", 0U),
m_leds(*this, "led%u", 0U)
{} {}
required_device<nvram_device> m_nvram; required_device<nvram_device> m_nvram;
@ -290,6 +292,8 @@ public:
optional_device<smc91c94_device> m_ethernet; optional_device<smc91c94_device> m_ethernet;
required_device<midway_ioasic_device> m_ioasic; required_device<midway_ioasic_device> m_ioasic;
optional_ioport_array<8> m_io_analog; optional_ioport_array<8> m_io_analog;
output_finder<16> m_lamps;
output_finder<24> m_leds;
widget_data m_widget; widget_data m_widget;
uint32_t m_interrupt_enable; uint32_t m_interrupt_enable;
@ -305,7 +309,7 @@ public:
uint8_t m_pending_analog_read; uint8_t m_pending_analog_read;
uint8_t m_status_leds; uint8_t m_status_leds;
uint32_t m_cmos_write_enabled; uint32_t m_cmos_write_enabled;
uint32_t m_output; uint16_t m_output_last;
uint8_t m_output_mode; uint8_t m_output_mode;
uint32_t m_gear; uint32_t m_gear;
int8_t m_wheel_force; int8_t m_wheel_force;
@ -426,10 +430,13 @@ void seattle_state::machine_start()
save_item(NAME(m_pending_analog_read)); save_item(NAME(m_pending_analog_read));
save_item(NAME(m_status_leds)); save_item(NAME(m_status_leds));
save_item(NAME(m_cmos_write_enabled)); save_item(NAME(m_cmos_write_enabled));
save_item(NAME(m_output)); save_item(NAME(m_output_last));
save_item(NAME(m_output_mode)); save_item(NAME(m_output_mode));
save_item(NAME(m_gear)); save_item(NAME(m_gear));
save_item(NAME(m_wheel_calibrated)); save_item(NAME(m_wheel_calibrated));
m_lamps.resolve();
m_leds.resolve();
} }
@ -671,33 +678,28 @@ WRITE32_MEMBER(seattle_state::analog_port_w)
*************************************/ *************************************/
WRITE32_MEMBER(seattle_state::wheel_board_w) WRITE32_MEMBER(seattle_state::wheel_board_w)
{ {
//logerror("wheel_board_w: data = %08x\n", data); //logerror("wheel_board_w: data = %08X\n", data);
/* two writes in pairs. flag off first, on second. arg remains the same. */ uint8_t arg = data & 0xFF;
bool flag = (data & (1 << 11));
uint8_t op = (data >> 8) & 0x7;
uint8_t arg = data & 0xff;
if (flag) if (!BIT(m_output_last, 11) && BIT(data, 11)) // output latch
{ {
switch (op) if (BIT(data, 10))
{ {
case 0x0: uint8_t base = BIT(data, 8) << 3;
machine().output().set_value("wheel", arg); // target wheel angle. signed byte. for (uint8_t bit = 0; bit < 8; bit++)
m_lamps[base | bit] = BIT(arg, bit);
}
else if (BIT(data, 9) || BIT(data, 8))
{
logerror("%08X:wheel_board_w(%d) = %08X\n", m_maincpu->pc(), offset, data);
}
else
{
output().set_value("wheel", arg); // target wheel angle. signed byte.
m_wheel_force = int8_t(arg); m_wheel_force = int8_t(arg);
//logerror("wheel_board_w: data = %08x op: %02x arg: %02x\n", data, op, arg);
break;
case 0x4:
for (uint8_t bit = 0; bit < 8; bit++)
machine().output().set_lamp_value(bit, (arg >> bit) & 0x1);
break;
case 0x5:
for (uint8_t bit = 0; bit < 8; bit++)
machine().output().set_lamp_value(8 + bit, (arg >> bit) & 0x1);
break;
} }
} }
m_output_last = data;
} }
/************************************* /*************************************
@ -829,61 +831,57 @@ void seattle_state::update_widget_irq()
READ32_MEMBER(seattle_state::output_r) READ32_MEMBER(seattle_state::output_r)
{ {
return m_output; logerror("%08X:output_r(%d)\n", m_maincpu->pc(), offset);
return 0;
} }
WRITE32_MEMBER(seattle_state::output_w) WRITE32_MEMBER(seattle_state::output_w)
{ {
uint8_t op = (data >> 8) & 0xF;
uint8_t arg = data & 0xFF; uint8_t arg = data & 0xFF;
switch (op) if (!BIT(m_output_last, 11) && BIT(data, 11))
m_output_mode = arg;
m_output_last = data;
if (!BIT(data, 10))
{ {
default: switch (m_output_mode)
logerror("Unknown output (%02X) = %02X\n", op, arg); {
break; default:
logerror("%08X:output_w(%d) = %04X\n", m_maincpu->pc(), m_output_mode, data);
break;
case 0xF: break; // sync/security wrapper commands. arg matches the wrapped command. case 0x04:
output().set_value("wheel", arg); // wheel motor delta. signed byte.
m_wheel_force = int8_t(~arg);
//logerror("wheel_board_w: data = %08x op: %02x arg: %02x\n", data, op, arg);
break;
case 0x7: case 0x05:
m_output_mode = arg; for (uint8_t bit = 0; bit < 8; bit++)
break; m_lamps[bit] = BIT(arg, bit);
break;
case 0xB: case 0x06: // Hyperdrive LEDs 0-7
switch (m_output_mode) for (uint8_t bit = 0; bit < 8; bit++)
{ m_leds[bit] = BIT(arg, bit);
default: break;
logerror("Unknown output with mode (%02X) = %02X\n", m_output_mode, arg);
break;
case 0x04: case 0x07: // Hyperdrive LEDs 8-15
output().set_value("wheel", arg); // wheel motor delta. signed byte. for (uint8_t bit = 0; bit < 8; bit++)
m_wheel_force = int8_t(~arg); m_leds[8 | bit] = BIT(arg, bit);
//logerror("wheel_board_w: data = %08x op: %02x arg: %02x\n", data, op, arg); break;
break;
case 0x05: case 0x08: // Hyperdrive LEDs 16-23 (Only uses up to 19)
for (uint8_t bit = 0; bit < 8; bit++) for (uint8_t bit = 0; bit < 8; bit++)
output().set_lamp_value(bit, (arg >> bit) & 0x1); m_leds[16 | bit] = BIT(arg, bit);
break; break;
}
case 0x06: // Hyperdrive LEDs 0-7 }
for (uint8_t bit = 0; bit < 8; bit++) else if (!BIT(data, 9) || !BIT(data, 8))
output().set_led_value(bit, (arg >> bit) & 0x1); {
break; logerror("%08X:output_w = %04X\n", m_maincpu->pc(), data);
case 0x07: // Hyperdrive LEDs 8-15
for (uint8_t bit = 0; bit < 8; bit++)
output().set_led_value(8 + bit, (arg >> bit) & 0x1);
break;
case 0x08: // Hyperdrive LEDs 16-23 (Only uses up to 19)
for (uint8_t bit = 0; bit < 8; bit++)
output().set_led_value(16 + bit, (arg >> bit) & 0x1);
break;
}
break;
} }
} }

View File

@ -68,7 +68,9 @@ public:
m_midway_serial_pic2(*this, "serial_pic2"), m_midway_serial_pic2(*this, "serial_pic2"),
m_midway_ioasic(*this, "ioasic"), m_midway_ioasic(*this, "ioasic"),
m_dcs(*this, "dcs"), m_dcs(*this, "dcs"),
m_generic_paletteram_32(*this, "paletteram") { } m_generic_paletteram_32(*this, "paletteram"),
m_optional_drivers(*this, "lamp%u", 0U),
m_motion(*this, "MOTION") { }
optional_shared_ptr<uint32_t> m_nvram; optional_shared_ptr<uint32_t> m_nvram;
required_shared_ptr<uint32_t> m_ram_base; required_shared_ptr<uint32_t> m_ram_base;
@ -100,7 +102,7 @@ public:
const char *m_galil_input; const char *m_galil_input;
uint8_t m_galil_output_index; uint8_t m_galil_output_index;
char m_galil_output[450]; char m_galil_output[450];
uint32_t m_wheel_board_output; uint8_t m_wheel_board_output;
uint32_t m_wheel_board_last; uint32_t m_wheel_board_last;
uint32_t m_wheel_board_u8_latch; uint32_t m_wheel_board_u8_latch;
DECLARE_WRITE32_MEMBER(midvunit_dma_queue_w); DECLARE_WRITE32_MEMBER(midvunit_dma_queue_w);
@ -140,6 +142,7 @@ public:
DECLARE_READ32_MEMBER(generic_speedup_r); DECLARE_READ32_MEMBER(generic_speedup_r);
DECLARE_READ32_MEMBER(midvunit_wheel_board_r); DECLARE_READ32_MEMBER(midvunit_wheel_board_r);
DECLARE_WRITE32_MEMBER(midvunit_wheel_board_w); DECLARE_WRITE32_MEMBER(midvunit_wheel_board_w);
DECLARE_CUSTOM_INPUT_MEMBER(motion_r);
DECLARE_DRIVER_INIT(crusnu40); DECLARE_DRIVER_INIT(crusnu40);
DECLARE_DRIVER_INIT(crusnu21); DECLARE_DRIVER_INIT(crusnu21);
DECLARE_DRIVER_INIT(crusnwld); DECLARE_DRIVER_INIT(crusnwld);
@ -165,6 +168,8 @@ public:
optional_device<midway_ioasic_device> m_midway_ioasic; optional_device<midway_ioasic_device> m_midway_ioasic;
required_device<dcs_audio_device> m_dcs; required_device<dcs_audio_device> m_dcs;
required_shared_ptr<uint32_t> m_generic_paletteram_32; required_shared_ptr<uint32_t> m_generic_paletteram_32;
output_finder<8> m_optional_drivers;
optional_ioport m_motion;
void postload(); void postload();
void midvcommon(machine_config &config); void midvcommon(machine_config &config);

View File

@ -87,40 +87,40 @@
</element> </element>
<view name="Dashboard"> <view name="Dashboard">
<bounds left="0" top="0" right="4" bottom="3.472" /> <bounds left="0" top="0" right="4" bottom="3.525" />
<screen index="0"> <screen index="0">
<bounds left="0" top="0" right="4" bottom="3" /> <bounds left="0" top="0" right="4" bottom="3.125" />
</screen> </screen>
<bezel name="lamp0" element="start" inputtag="IN0" inputmask="0x04"> <bezel element="radio" inputtag="IN1" inputmask="0x02">
<bounds x="3.60" y="3.1" width="0.3" height="0.3" /> <bounds x="3.250" y="3.150" width="0.35" height="0.35" />
</bezel> </bezel>
<bezel name="lamp0" element="start" inputtag="IN0" inputmask="0x04">
<bounds x="3.625" y="3.150" width="0.35" height="0.35" />
</bezel>
<bezel name="lamp1" element="view1" inputtag="IN1" inputmask="0x10"> <bezel name="lamp1" element="view1" inputtag="IN1" inputmask="0x10">
<bounds x="0.1" y="3.075" width="0.5" height="0.1" /> <bounds x="0.025" y="3.150" width="0.5" height="0.1" />
</bezel> </bezel>
<bezel name="lamp2" element="view2" inputtag="IN1" inputmask="0x20"> <bezel name="lamp2" element="view2" inputtag="IN1" inputmask="0x20">
<bounds x="0.1" y="3.2" width="0.5" height="0.1" /> <bounds x="0.025" y="3.275" width="0.5" height="0.1" />
</bezel> </bezel>
<bezel name="lamp3" element="view3" inputtag="IN1" inputmask="0x40"> <bezel name="lamp3" element="view3" inputtag="IN1" inputmask="0x40">
<bounds x="0.1" y="3.325" width="0.5" height="0.1" /> <bounds x="0.025" y="3.400" width="0.5" height="0.1" />
</bezel> </bezel>
<bezel name="lamp4" element="lamp"> <bezel name="lamp4" element="lamp">
<bounds x="1.785" y="3.2" width="0.1" height="0.1" /> <bounds x="1.785" y="3.275" width="0.1" height="0.1" />
</bezel> </bezel>
<bezel name="lamp5" element="lamp"> <bezel name="lamp5" element="lamp">
<bounds x="1.895" y="3.2" width="0.1" height="0.1" /> <bounds x="1.895" y="3.275" width="0.1" height="0.1" />
</bezel> </bezel>
<bezel name="lamp6" element="lamp"> <bezel name="lamp6" element="lamp">
<bounds x="2.005" y="3.2" width="0.1" height="0.1" /> <bounds x="2.005" y="3.275" width="0.1" height="0.1" />
</bezel> </bezel>
<bezel name="lamp7" element="lamp"> <bezel name="lamp7" element="lamp">
<bounds x="2.115" y="3.2" width="0.1" height="0.1" /> <bounds x="2.115" y="3.275" width="0.1" height="0.1" />
</bezel>
<bezel element="radio" inputtag="IN1" inputmask="0x02">
<bounds x="3.20" y="3.1" width="0.3" height="0.3" />
</bezel> </bezel>
</view> </view>
</mamelayout> </mamelayout>