GamePlan 1: Machines are working, with a few bugs.

This commit is contained in:
Robbbert 2014-07-23 13:17:01 +00:00
parent c4a198d842
commit 1fd5d11389
2 changed files with 194 additions and 124 deletions

View File

@ -4,6 +4,13 @@
Game Plan MPU-1
These are "cocktail" cabinets, although there is only one seating position.
ToDo:
- Player 4 score doesn't show
- Tens digit of credits doesn't show
- The machine awards 3 free credits per player at the start of ball 1.
- Nothing specific done with Family Fun / Star Trip, although they seem to work
just as well as the others.
********************************************************************************/
#include "machine/genpin.h"
@ -11,6 +18,7 @@
#include "cpu/z80/z80daisy.h"
#include "machine/i8255.h"
#include "machine/z80ctc.h"
#include "machine/nvram.h"
#include "gp_1.lh"
class gp_1_state : public genpin_class
@ -20,6 +28,15 @@ public:
: genpin_class(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
, m_ctc(*this, "ctc")
, m_io_dsw0(*this, "DSW0")
, m_io_dsw1(*this, "DSW1")
, m_io_dsw2(*this, "DSW2")
, m_io_dsw3(*this, "DSW3")
, m_io_x7(*this, "X7")
, m_io_x8(*this, "X8")
, m_io_x9(*this, "X9")
, m_io_xa(*this, "XA")
, m_io_xb(*this, "XB")
{ }
DECLARE_DRIVER_INIT(gp_1);
@ -30,16 +47,25 @@ public:
private:
UINT8 m_u14;
UINT8 m_digit;
UINT8 m_segment;
UINT8 m_segment[16];
virtual void machine_reset();
required_device<cpu_device> m_maincpu;
required_device<z80ctc_device> m_ctc;
required_ioport m_io_dsw0;
required_ioport m_io_dsw1;
required_ioport m_io_dsw2;
required_ioport m_io_dsw3;
required_ioport m_io_x7;
required_ioport m_io_x8;
required_ioport m_io_x9;
required_ioport m_io_xa;
required_ioport m_io_xb;
};
static ADDRESS_MAP_START( gp_1_map, AS_PROGRAM, 8, gp_1_state )
AM_RANGE(0x0000, 0x0fff) AM_ROM
AM_RANGE(0x8c00, 0x8cff) AM_RAM
AM_RANGE(0x8c00, 0x8cff) AM_RAM AM_SHARE("nvram")
ADDRESS_MAP_END
static ADDRESS_MAP_START( gp_1_io, AS_IO, 8, gp_1_state )
@ -50,21 +76,38 @@ ADDRESS_MAP_END
static INPUT_PORTS_START( gp_1 )
PORT_START("DSW0")
PORT_DIPNAME( 0x01, 0x00, "S01") // S1-5: 32 combinations of coins/credits of coin slot 1.
PORT_DIPSETTING( 0x00, DEF_STR( Off ))
PORT_DIPSETTING( 0x01, DEF_STR( On ))
PORT_DIPNAME( 0x02, 0x02, "S02")
PORT_DIPSETTING( 0x00, DEF_STR( Off ))
PORT_DIPSETTING( 0x02, DEF_STR( On ))
PORT_DIPNAME( 0x04, 0x00, "S03")
PORT_DIPSETTING( 0x00, DEF_STR( Off ))
PORT_DIPSETTING( 0x04, DEF_STR( On ))
PORT_DIPNAME( 0x08, 0x00, "S04")
PORT_DIPSETTING( 0x00, DEF_STR( Off ))
PORT_DIPSETTING( 0x08, DEF_STR( On ))
PORT_DIPNAME( 0x10, 0x00, "S05")
PORT_DIPSETTING( 0x00, DEF_STR( Off ))
PORT_DIPSETTING( 0x10, DEF_STR( On ))
PORT_DIPNAME( 0x1f, 0x02, "Coin Slot 1")
PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C )) // same as 01
PORT_DIPSETTING( 0x02, DEF_STR( 1C_1C ))
PORT_DIPSETTING( 0x03, DEF_STR( 2C_1C ))
PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ))
PORT_DIPSETTING( 0x05, DEF_STR( 2C_2C ))
PORT_DIPSETTING( 0x06, DEF_STR( 1C_3C ))
PORT_DIPSETTING( 0x07, DEF_STR( 2C_3C ))
PORT_DIPSETTING( 0x08, DEF_STR( 1C_4C ))
PORT_DIPSETTING( 0x09, DEF_STR( 2C_4C ))
PORT_DIPSETTING( 0x0a, DEF_STR( 1C_5C ))
PORT_DIPSETTING( 0x0b, DEF_STR( 2C_5C ))
PORT_DIPSETTING( 0x0c, DEF_STR( 1C_6C ))
PORT_DIPSETTING( 0x0d, DEF_STR( 2C_6C ))
PORT_DIPSETTING( 0x0e, DEF_STR( 1C_7C ))
PORT_DIPSETTING( 0x0f, DEF_STR( 2C_7C ))
PORT_DIPSETTING( 0x10, DEF_STR( 1C_8C ))
PORT_DIPSETTING( 0x11, DEF_STR( 2C_8C ))
PORT_DIPSETTING( 0x12, DEF_STR( 1C_9C ))
PORT_DIPSETTING( 0x13, "2 coins 9 credits")
PORT_DIPSETTING( 0x14, "1 coin 10 credits")
PORT_DIPSETTING( 0x15, "2 coins 10 credits")
PORT_DIPSETTING( 0x16, "1 coin 11 credits")
PORT_DIPSETTING( 0x17, "2 coins 11 credits")
PORT_DIPSETTING( 0x18, "1 coin 12 credits")
PORT_DIPSETTING( 0x19, "2 coins 12 credits")
PORT_DIPSETTING( 0x1a, "1 coin 13 credits")
PORT_DIPSETTING( 0x1b, "2 coins 13 credits")
PORT_DIPSETTING( 0x1c, "1 coin 14 credits")
PORT_DIPSETTING( 0x1d, "2 coins 14 credits")
PORT_DIPSETTING( 0x1e, "1 coin 15 credits")
PORT_DIPSETTING( 0x1f, "2 coins 15 credits")
PORT_DIPNAME( 0x20, 0x00, "S06")
PORT_DIPSETTING( 0x00, DEF_STR( Off ))
PORT_DIPSETTING( 0x20, DEF_STR( On ))
@ -76,18 +119,23 @@ static INPUT_PORTS_START( gp_1 )
PORT_DIPSETTING( 0x80, DEF_STR( On ))
PORT_START("DSW1")
PORT_DIPNAME( 0x01, 0x00, "S09") // S09-12 determine coinage for slot 2
PORT_DIPSETTING( 0x00, DEF_STR( Off ))
PORT_DIPSETTING( 0x01, DEF_STR( On ))
PORT_DIPNAME( 0x02, 0x00, "S10")
PORT_DIPSETTING( 0x00, DEF_STR( Off ))
PORT_DIPSETTING( 0x02, DEF_STR( On ))
PORT_DIPNAME( 0x04, 0x00, "S11")
PORT_DIPSETTING( 0x00, DEF_STR( Off ))
PORT_DIPSETTING( 0x04, DEF_STR( On ))
PORT_DIPNAME( 0x08, 0x00, "S12")
PORT_DIPSETTING( 0x00, DEF_STR( Off ))
PORT_DIPSETTING( 0x08, DEF_STR( On ))
PORT_DIPNAME( 0x0f, 0x00, "Coin Slot 2") // S09-12 determine coinage for slot 2
PORT_DIPSETTING( 0x00, "Same as Slot 1")
PORT_DIPSETTING( 0x01, DEF_STR( 1C_1C ))
PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ))
PORT_DIPSETTING( 0x03, DEF_STR( 1C_3C ))
PORT_DIPSETTING( 0x04, DEF_STR( 1C_4C ))
PORT_DIPSETTING( 0x05, DEF_STR( 1C_5C ))
PORT_DIPSETTING( 0x06, DEF_STR( 1C_6C ))
PORT_DIPSETTING( 0x07, DEF_STR( 1C_7C ))
PORT_DIPSETTING( 0x08, DEF_STR( 1C_8C ))
PORT_DIPSETTING( 0x09, DEF_STR( 1C_9C ))
PORT_DIPSETTING( 0x0a, "1 coin 10 credits")
PORT_DIPSETTING( 0x0b, "1 coin 11 credits")
PORT_DIPSETTING( 0x0c, "1 coin 12 credits")
PORT_DIPSETTING( 0x0d, "1 coin 13 credits")
PORT_DIPSETTING( 0x0e, "1 coin 14 credits")
PORT_DIPSETTING( 0x0f, "1 coin 15 credits")
PORT_DIPNAME( 0x10, 0x00, "S13")
PORT_DIPSETTING( 0x00, DEF_STR( Off ))
PORT_DIPSETTING( 0x10, DEF_STR( On ))
@ -102,21 +150,38 @@ static INPUT_PORTS_START( gp_1 )
PORT_DIPSETTING( 0x80, DEF_STR( On ))
PORT_START("DSW2")
PORT_DIPNAME( 0x01, 0x00, "S17") // S17-21 coins for slot 3
PORT_DIPSETTING( 0x00, DEF_STR( Off ))
PORT_DIPSETTING( 0x01, DEF_STR( On ))
PORT_DIPNAME( 0x02, 0x02, "S18")
PORT_DIPSETTING( 0x00, DEF_STR( Off ))
PORT_DIPSETTING( 0x02, DEF_STR( On ))
PORT_DIPNAME( 0x04, 0x00, "S19")
PORT_DIPSETTING( 0x00, DEF_STR( Off ))
PORT_DIPSETTING( 0x04, DEF_STR( On ))
PORT_DIPNAME( 0x08, 0x00, "S20")
PORT_DIPSETTING( 0x00, DEF_STR( Off ))
PORT_DIPSETTING( 0x08, DEF_STR( On ))
PORT_DIPNAME( 0x10, 0x00, "S21")
PORT_DIPSETTING( 0x00, DEF_STR( Off ))
PORT_DIPSETTING( 0x10, DEF_STR( On ))
PORT_DIPNAME( 0x1f, 0x02, "Coin Slot 3")
PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C )) // same as 01
PORT_DIPSETTING( 0x02, DEF_STR( 1C_1C ))
PORT_DIPSETTING( 0x03, DEF_STR( 2C_1C ))
PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ))
PORT_DIPSETTING( 0x05, DEF_STR( 2C_2C ))
PORT_DIPSETTING( 0x06, DEF_STR( 1C_3C ))
PORT_DIPSETTING( 0x07, DEF_STR( 2C_3C ))
PORT_DIPSETTING( 0x08, DEF_STR( 1C_4C ))
PORT_DIPSETTING( 0x09, DEF_STR( 2C_4C ))
PORT_DIPSETTING( 0x0a, DEF_STR( 1C_5C ))
PORT_DIPSETTING( 0x0b, DEF_STR( 2C_5C ))
PORT_DIPSETTING( 0x0c, DEF_STR( 1C_6C ))
PORT_DIPSETTING( 0x0d, DEF_STR( 2C_6C ))
PORT_DIPSETTING( 0x0e, DEF_STR( 1C_7C ))
PORT_DIPSETTING( 0x0f, DEF_STR( 2C_7C ))
PORT_DIPSETTING( 0x10, DEF_STR( 1C_8C ))
PORT_DIPSETTING( 0x11, DEF_STR( 2C_8C ))
PORT_DIPSETTING( 0x12, DEF_STR( 1C_9C ))
PORT_DIPSETTING( 0x13, "2 coins 9 credits")
PORT_DIPSETTING( 0x14, "1 coin 10 credits")
PORT_DIPSETTING( 0x15, "2 coins 10 credits")
PORT_DIPSETTING( 0x16, "1 coin 11 credits")
PORT_DIPSETTING( 0x17, "2 coins 11 credits")
PORT_DIPSETTING( 0x18, "1 coin 12 credits")
PORT_DIPSETTING( 0x19, "2 coins 12 credits")
PORT_DIPSETTING( 0x1a, "1 coin 13 credits")
PORT_DIPSETTING( 0x1b, "2 coins 13 credits")
PORT_DIPSETTING( 0x1c, "1 coin 14 credits")
PORT_DIPSETTING( 0x1d, "2 coins 14 credits")
PORT_DIPSETTING( 0x1e, "1 coin 15 credits")
PORT_DIPSETTING( 0x1f, "2 coins 15 credits")
PORT_DIPNAME( 0x20, 0x00, "S22")
PORT_DIPSETTING( 0x00, DEF_STR( Off ))
PORT_DIPSETTING( 0x20, DEF_STR( On ))
@ -153,7 +218,7 @@ static INPUT_PORTS_START( gp_1 )
PORT_DIPSETTING( 0xC0, "3")
PORT_START("X7")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE2 ) PORT_NAME("Accounting Reset")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE2 ) PORT_NAME("Accounting Reset") // This pushbutton on the MPU board is called "S33"
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START1 )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_TILT1 ) PORT_NAME("Slam Tilt")
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
@ -196,90 +261,91 @@ READ8_MEMBER( gp_1_state::portb_r )
switch (m_u14)
{
case 7:
return ioport("X7")->read();
return m_io_x7->read();
case 8:
return ioport("X8")->read();
return m_io_x8->read();
case 9:
return ioport("X9")->read();
return m_io_x9->read();
case 10:
return ioport("XA")->read();
return m_io_xa->read();
case 11:
return ioport("XB")->read();
return m_io_xb->read();
case 12:
return ioport("DSW0")->read();
return m_io_dsw0->read();
case 13:
return ioport("DSW1")->read();
return m_io_dsw1->read();
case 14:
return ioport("DSW2")->read();
return m_io_dsw2->read();
case 15:
return ioport("DSW3")->read();
return m_io_dsw3->read();
}
return 0xff;
return 0;
}
WRITE8_MEMBER( gp_1_state::porta_w )
{
m_u14 = data >> 4;
/*if (m_u14 >= 8)*/ m_segment = data & 15;
if ((data > 0x0f) && (data < 0x30))
{
switch (data)
{
case 0x10:
break;
case 0x11:
m_samples->start(0, 5);
break;
case 0x12:
m_samples->start(0, 6);
break;
case 0x13:
m_samples->start(0, 1);
break;
case 0x14:
m_samples->start(0, 2);
break;
case 0x15:
case 0x10: // chime c
m_samples->start(0, 3);
break;
case 0x16:
case 0x11: // chime b
m_samples->start(0, 2);
break;
case 0x12: // knocker
m_samples->start(0, 6);
break;
case 0x13: // not used
case 0x14: // not used
break;
case 0x15: // chime a
m_samples->start(0, 1);
break;
case 0x16: // chime d
m_samples->start(0, 4);
break;
case 0x17:
case 0x18:
case 0x19:
case 0x17: // outhole
case 0x18: // r sling
case 0x19: // l sling
m_samples->start(0, 5);
break;
case 0x1a:
case 0x1b:
case 0x1a: // c kickout
m_samples->start(0, 5);
break;
case 0x1b: // r bumper
m_samples->start(0, 0);
break;
case 0x1c:
case 0x1d:
case 0x1c: // a kickout
m_samples->start(0, 5);
break;
case 0x1e:
case 0x1f:
case 0x1d: // l bumper
m_samples->start(0, 0);
break;
case 0x1e: // a kickout
m_samples->start(0, 5);
break;
case 0x1f: // not used
break;
}
}
static const UINT8 patterns[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7c,0x07,0x7f,0x67,0x58,0x4c,0x62,0x69,0x78,0x00 }; // 7448
if ((m_u14 >= 8) && (m_u14 <= 11))
static const UINT8 patterns[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7c,0x07,0x7f,0x67,0x58,0x4c,0x62,0x69,0x78,0 }; // 7448
if (m_u14 >= 8)
{
output_set_digit_value(m_digit+(m_u14-8)*8, patterns[m_segment]);
if (m_digit == 7)
m_segment[m_u14] = data & 15;
else
output_set_digit_value(m_digit+(m_u14-8)*8, patterns[m_segment[m_u14]]);
}
}
WRITE8_MEMBER( gp_1_state::portc_w )
{
output_set_value("led0", BIT(data, 3));
m_digit = data & 7;
static const UINT8 patterns[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7c,0x07,0x7f,0x67,0x58,0x4c,0x62,0x69,0x78,0x00 }; // 7448
if ((m_digit) && (m_u14 >= 8) && (m_u14 <= 11))
{
output_set_digit_value(m_digit+(m_u14-8)*8, patterns[m_segment]);
}
}
void gp_1_state::machine_reset()
@ -308,6 +374,8 @@ static MACHINE_CONFIG_START( gp_1, gp_1_state )
MCFG_CPU_IO_MAP(gp_1_io)
MCFG_CPU_CONFIG(daisy_chain)
MCFG_NVRAM_ADD_0FILL("nvram")
/* Video */
MCFG_DEFAULT_LAYOUT(layout_gp_1)

View File

@ -20,6 +20,7 @@
</element>
<element name="P0"><text string="Ball / Match"><color red="1.0" green="1.0" blue="1.0" /></text></element>
<element name="P1"><text string="Credits"><color red="1.0" green="1.0" blue="1.0" /></text></element>
<element name="P2"><text string="Players"><color red="1.0" green="1.0" blue="1.0" /></text></element>
<element name="P3"><text string="Player 1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
<element name="P4"><text string="Player 2"><color red="1.0" green="1.0" blue="1.0" /></text></element>
<element name="P5"><text string="Player 3"><color red="1.0" green="1.0" blue="1.0" /></text></element>
@ -36,105 +37,106 @@
<!-- Player 1 Score -->
<bezel name="digit0" element="digit">
<bezel name="digit5" element="digit">
<bounds left="10" top="45" right="44" bottom="84" />
</bezel>
<bezel name="digit1" element="digit">
<bezel name="digit4" element="digit">
<bounds left="54" top="45" right="88" bottom="84" />
</bezel>
<bezel name="digit2" element="digit">
<bezel name="digit3" element="digit">
<bounds left="98" top="45" right="132" bottom="84" />
</bezel>
<bezel name="digit3" element="digit">
<bezel name="digit2" element="digit">
<bounds left="142" top="45" right="176" bottom="84" />
</bezel>
<bezel name="digit4" element="digit">
<bezel name="digit1" element="digit">
<bounds left="186" top="45" right="220" bottom="84" />
</bezel>
<bezel name="digit5" element="digit">
<bezel name="digit0" element="digit">
<bounds left="230" top="45" right="264" bottom="84" />
</bezel>
<!-- Player 2 Score -->
<bezel name="digit8" element="digit">
<bezel name="digit13" element="digit">
<bounds left="10" top="105" right="44" bottom="144" />
</bezel>
<bezel name="digit9" element="digit">
<bezel name="digit12" element="digit">
<bounds left="54" top="105" right="88" bottom="144" />
</bezel>
<bezel name="digit10" element="digit">
<bezel name="digit11" element="digit">
<bounds left="98" top="105" right="132" bottom="144" />
</bezel>
<bezel name="digit11" element="digit">
<bezel name="digit10" element="digit">
<bounds left="142" top="105" right="176" bottom="144" />
</bezel>
<bezel name="digit12" element="digit">
<bezel name="digit9" element="digit">
<bounds left="186" top="105" right="220" bottom="144" />
</bezel>
<bezel name="digit13" element="digit">
<bezel name="digit8" element="digit">
<bounds left="230" top="105" right="264" bottom="144" />
</bezel>
<!-- Player 3 Score -->
<bezel name="digit16" element="digit">
<bezel name="digit21" element="digit">
<bounds left="10" top="165" right="44" bottom="204" />
</bezel>
<bezel name="digit17" element="digit">
<bezel name="digit20" element="digit">
<bounds left="54" top="165" right="88" bottom="204" />
</bezel>
<bezel name="digit18" element="digit">
<bezel name="digit19" element="digit">
<bounds left="98" top="165" right="132" bottom="204" />
</bezel>
<bezel name="digit19" element="digit">
<bezel name="digit18" element="digit">
<bounds left="142" top="165" right="176" bottom="204" />
</bezel>
<bezel name="digit20" element="digit">
<bezel name="digit17" element="digit">
<bounds left="186" top="165" right="220" bottom="204" />
</bezel>
<bezel name="digit21" element="digit">
<bezel name="digit16" element="digit">
<bounds left="230" top="165" right="264" bottom="204" />
</bezel>
<!-- Player 4 Score -->
<bezel name="digit24" element="digit">
<bezel name="digit29" element="digit">
<bounds left="10" top="225" right="44" bottom="264" />
</bezel>
<bezel name="digit25" element="digit">
<bezel name="digit28" element="digit">
<bounds left="54" top="225" right="88" bottom="264" />
</bezel>
<bezel name="digit26" element="digit">
<bezel name="digit27" element="digit">
<bounds left="98" top="225" right="132" bottom="264" />
</bezel>
<bezel name="digit27" element="digit">
<bezel name="digit26" element="digit">
<bounds left="142" top="225" right="176" bottom="264" />
</bezel>
<bezel name="digit28" element="digit">
<bezel name="digit25" element="digit">
<bounds left="186" top="225" right="220" bottom="264" />
</bezel>
<bezel name="digit29" element="digit">
<bezel name="digit24" element="digit">
<bounds left="230" top="225" right="264" bottom="264" />
</bezel>
<!-- Credits and Balls -->
<bezel name="digit14" element="digit">
<bounds left="10" top="345" right="44" bottom="384" />
</bezel>
<bezel name="digit15" element="digit">
<bounds left="54" top="345" right="88" bottom="384" />
<bounds left="39" top="345" right="73" bottom="384" />
</bezel>
<bezel name="digit6" element="digit">
<bounds left="186" top="345" right="220" bottom="384" />
<bounds left="110" top="345" right="144" bottom="384" />
</bezel>
<bezel name="digit7" element="digit">
<bounds left="230" top="345" right="264" bottom="384" />
<bezel name="digit30" element="digit">
<bounds left="171" top="345" right="205" bottom="384" />
</bezel>
<bezel element="P0"><bounds left="200" right="258" top="330" bottom="342" /></bezel>
<bezel element="P1"><bounds left="30" right="88" top="330" bottom="342" /></bezel>
<bezel name="digit22" element="digit">
<bounds left="210" top="345" right="244" bottom="384" />
</bezel>
<bezel element="P2"><bounds left="100" right="158" top="330" bottom="342" /></bezel>
<bezel element="P1"><bounds left="200" right="258" top="330" bottom="342" /></bezel>
<bezel element="P0"><bounds left="30" right="88" top="330" bottom="342" /></bezel>
<bezel name="text3" element="P3"><bounds left="100" right="180" top="30" bottom="42" /></bezel>
<bezel name="text2" element="P4"><bounds left="100" right="180" top="90" bottom="102" /></bezel>
<bezel name="text1" element="P5"><bounds left="100" right="180" top="150" bottom="162" /></bezel>
<bezel name="text0" element="P6"><bounds left="100" right="180" top="210" bottom="222" /></bezel>
<bezel name="led0" element="red_led">
<bounds left="110" right="125" top="360" bottom="375" /></bezel>
<bounds left="10" right="25" top="360" bottom="375" /></bezel>
</view>
</mamelayout>