From 5082ee91335edd95f4ec57a9b94112951e95f798 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felipe=20Corr=C3=AAa=20da=20Silva=20Sanches?= Date: Sun, 2 Nov 2014 02:10:46 -0200 Subject: Galaxy Force II: Mapping the port bits used to provide motor movement feedback signals such as Up/Down/Left/Right limit switches. --- src/mame/drivers/segaybd.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/mame/drivers/segaybd.c b/src/mame/drivers/segaybd.c index 79547125902..c951ef45324 100644 --- a/src/mame/drivers/segaybd.c +++ b/src/mame/drivers/segaybd.c @@ -871,6 +871,13 @@ static INPUT_PORTS_START( gforce2 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Shoot") PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Missile") + PORT_MODIFY("PORTC") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Floor Switch") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Beam Sensor 2 / Down Limit") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Beam Sensor 1 / Up Limit") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Left CCW Limit") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Right CW Limit") + PORT_MODIFY("DSW") PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWB:1") PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) -- cgit v1.2.3 From 55b4c23e6482b826436b68831310cb80fd115e62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felipe=20Corr=C3=AAa=20da=20Silva=20Sanches?= Date: Sun, 2 Nov 2014 02:22:27 -0200 Subject: Galaxy Force II: Adding gforce_output_cb1 (the values written there seem to select the meaning of some of the PORTC bits related to motor control) --- src/mame/drivers/segaybd.c | 19 +++++++++++++++++-- src/mame/includes/segaybd.h | 1 + 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/mame/drivers/segaybd.c b/src/mame/drivers/segaybd.c index c951ef45324..21672c8138b 100644 --- a/src/mame/drivers/segaybd.c +++ b/src/mame/drivers/segaybd.c @@ -395,6 +395,20 @@ void segaybd_state::device_timer(emu_timer &timer, device_timer_id id, int param // (IO chip 0), seem to have something to do with the sensor // switches we need to fix +//------------------------------------------------- +// gforce2_output_cb1 - output #1 handler for +// Galaxy Force +//------------------------------------------------- + +void segaybd_state::gforce2_output_cb1(UINT16 data) +{ + logerror("gforce2_output_cb1: '%02X'\n", data & 0xFF); + //bits 4, 5, and 7 seem to be used to multiplex the PORTC signals + //The exact mapping of these signals is yet not perfectly understood. + //You can observe how this value changes when switching pages in the + //service mode motor test menu +} + //------------------------------------------------- // gforce2_output_cb2 - output #2 handler for // Galaxy Force @@ -873,8 +887,8 @@ static INPUT_PORTS_START( gforce2 ) PORT_MODIFY("PORTC") PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Floor Switch") - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Beam Sensor 2 / Down Limit") - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Beam Sensor 1 / Up Limit") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Beam Sensor 2 / Down Limit") //The meaning of these portbits seems to be selected + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Beam Sensor 1 / Up Limit") // by the output value written to gforce2_output_cb1 PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Left CCW Limit") PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Right CW Limit") @@ -2524,6 +2538,7 @@ DRIVER_INIT_MEMBER(segaybd_state,generic) DRIVER_INIT_MEMBER(segaybd_state,gforce2) { DRIVER_INIT_CALL(generic); + m_output_cb1 = output_delegate(FUNC(segaybd_state::gforce2_output_cb1), this); m_output_cb2 = output_delegate(FUNC(segaybd_state::gforce2_output_cb2), this); } diff --git a/src/mame/includes/segaybd.h b/src/mame/includes/segaybd.h index 90a0efa2127..65b7d811adc 100644 --- a/src/mame/includes/segaybd.h +++ b/src/mame/includes/segaybd.h @@ -64,6 +64,7 @@ public: DECLARE_READ8_MEMBER( link_portc0_r ); // game-specific output handlers + void gforce2_output_cb1(UINT16 data); void gforce2_output_cb2(UINT16 data); void gloc_output_cb1(UINT16 data); void gloc_output_cb2(UINT16 data); -- cgit v1.2.3 From 95aa583dc1c0131e5d93e91f273cccc016867b02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felipe=20Corr=C3=AAa=20da=20Silva=20Sanches?= Date: Sun, 2 Nov 2014 03:23:19 -0200 Subject: G-LOC: Mapping portbits related to the moving cabinet limit switches. --- src/mame/drivers/segaybd.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/mame/drivers/segaybd.c b/src/mame/drivers/segaybd.c index 21672c8138b..84f306f19ac 100644 --- a/src/mame/drivers/segaybd.c +++ b/src/mame/drivers/segaybd.c @@ -118,7 +118,7 @@ WRITE16_MEMBER( segaybd_state::analog_w ) //------------------------------------------------- IOPORT_ARRAY_MEMBER( segaybd_state::digital_ports ) -{ "P1", "GENERAL", "PORTC", "PORTD", "PORTE", "DSW", "COINAGE", "PORTH" }; +{ "P1", "GENERAL", "LIMITSW", "PORTD", "PORTE", "DSW", "COINAGE", "PORTH" }; READ16_MEMBER( segaybd_state::io_chip_r ) { @@ -403,7 +403,7 @@ void segaybd_state::device_timer(emu_timer &timer, device_timer_id id, int param void segaybd_state::gforce2_output_cb1(UINT16 data) { logerror("gforce2_output_cb1: '%02X'\n", data & 0xFF); - //bits 4, 5, and 7 seem to be used to multiplex the PORTC signals + //bits 4, 5, and 7 seem to be used to multiplex the "LIMITSW" port signals //The exact mapping of these signals is yet not perfectly understood. //You can observe how this value changes when switching pages in the //service mode motor test menu @@ -846,7 +846,7 @@ static INPUT_PORTS_START( yboard_generic ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) - PORT_START("PORTC") + PORT_START("LIMITSW") PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("PORTD") @@ -885,7 +885,7 @@ static INPUT_PORTS_START( gforce2 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Shoot") PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Missile") - PORT_MODIFY("PORTC") + PORT_MODIFY("LIMITSW") PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Floor Switch") PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Beam Sensor 2 / Down Limit") //The meaning of these portbits seems to be selected PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Beam Sensor 1 / Up Limit") // by the output value written to gforce2_output_cb1 @@ -934,6 +934,12 @@ static INPUT_PORTS_START( gloc ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Vulcan") PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Missile") + PORT_MODIFY("LIMITSW") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Right Upper Limit Switch") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Right Lower Limit Switch") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Left Upper Limit Switch") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Left Lower Limit Switch") + PORT_MODIFY("DSW") PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SWB:1,2") PORT_DIPSETTING( 0x02, DEF_STR( Easy ) ) -- cgit v1.2.3 From fe6fe7357c4bb0be0fad6d61c9eda12580f9ed3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felipe=20Corr=C3=AAa=20da=20Silva=20Sanches?= Date: Sun, 2 Nov 2014 04:10:33 -0200 Subject: Power Drift: Portbits for Limit & Safety switches --- src/mame/drivers/segaybd.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/mame/drivers/segaybd.c b/src/mame/drivers/segaybd.c index 84f306f19ac..facb919bdba 100644 --- a/src/mame/drivers/segaybd.c +++ b/src/mame/drivers/segaybd.c @@ -1068,6 +1068,12 @@ static INPUT_PORTS_START( pdrift ) PORT_MODIFY("GENERAL") PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Gear Shift") PORT_CODE(KEYCODE_SPACE) PORT_TOGGLE + PORT_MODIFY("LIMITSW") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Safety Sensor Left") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Safety Sensor Right") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Limit Switch Left") + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Limit Switch Right") + PORT_MODIFY("DSW") PORT_DIPNAME( 0x03, 0x02, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SWB:1,2") PORT_DIPSETTING( 0x03, "Moving" ) -- cgit v1.2.3