summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame
diff options
context:
space:
mode:
author Dirk Best <mail@dirk-best.de>2021-01-21 13:13:32 +0100
committer Dirk Best <mail@dirk-best.de>2021-01-21 13:14:38 +0100
commita0bf53801ddb93a2eac5f2ef735b42e3a71124c6 (patch)
tree397b794b1cc9571604a42138e8293ca019fb9a25 /src/mame
parent66d5ac699884495e181893c57a7bbd5b7c0231f4 (diff)
kingpin: Various updates
- Add basic layout showing buttons and lamps - Hook up lamp outputs and hopper - Map missing buttons and second coin slot - Label setup mode dip switches - Update default NVRAM to enable attract music, second coin slot and hopper
Diffstat (limited to 'src/mame')
-rw-r--r--src/mame/drivers/kingpin.cpp106
-rw-r--r--src/mame/layout/kingpin.lay152
2 files changed, 236 insertions, 22 deletions
diff --git a/src/mame/drivers/kingpin.cpp b/src/mame/drivers/kingpin.cpp
index 5ff8c7952ed..25445b5a604 100644
--- a/src/mame/drivers/kingpin.cpp
+++ b/src/mame/drivers/kingpin.cpp
@@ -36,10 +36,13 @@ Todo:
#include "machine/gen_latch.h"
#include "machine/i8255.h"
#include "machine/nvram.h"
+#include "machine/ticket.h"
#include "sound/ay8910.h"
#include "video/tms9928a.h"
#include "speaker.h"
+#include "kingpin.lh"
+
namespace {
@@ -51,11 +54,16 @@ public:
, m_maincpu(*this, "maincpu")
, m_audiocpu(*this, "audiocpu")
, m_soundlatch(*this, "soundlatch")
+ , m_hopper(*this, "hopper")
+ , m_leds(*this, "led_%u", 0U)
{ }
void kingpin(machine_config &config);
void dealracl(machine_config &config);
+protected:
+ virtual void machine_start() override;
+
private:
void sound_nmi_w(uint8_t data);
void kingpin_io_map(address_map &map);
@@ -66,8 +74,50 @@ private:
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
required_device<generic_latch_8_device> m_soundlatch;
+ required_device<hopper_device> m_hopper;
+
+ output_finder<16> m_leds;
+
+ void output1_w(uint8_t data);
+ void output2_w(uint8_t data);
};
+void kingpin_state::machine_start()
+{
+ m_leds.resolve();
+}
+
+void kingpin_state::output1_w(uint8_t data)
+{
+ // 7------- bottom row button 3
+ // -6------ bottom row button 2
+ // --5----- bottom row button 1
+ // ---4---- top row button 5
+ // ----3--- top row button 4
+ // -----2-- top row button 3
+ // ------1- top row button 2
+ // -------0 top row button 1
+
+ for (int i = 0; i < 8; i++)
+ m_leds[i] = BIT(data, i);
+}
+
+void kingpin_state::output2_w(uint8_t data)
+{
+ // 7------- coin out counter/motor?
+ // -6------ payout
+ // --5----- service
+ // ---4---- coin slot 2
+ // ----3--- coin slot 1
+ // -----2-- hopper motor
+ // ------1- bottom row button 5
+ // -------0 bottom row button 4
+
+ for (int i = 0; i < 8; i++)
+ m_leds[8 + i] = BIT(data, i);
+
+ m_hopper->motor_w(BIT(data, 2));
+}
void kingpin_state::sound_nmi_w(uint8_t data)
{
@@ -93,11 +143,11 @@ void kingpin_state::kingpin_io_map(address_map &map)
map(0x00, 0x03).rw("ppi8255_0", FUNC(i8255_device::read), FUNC(i8255_device::write));
map(0x10, 0x13).rw("ppi8255_1", FUNC(i8255_device::read), FUNC(i8255_device::write));
map(0x20, 0x21).rw("tms9928a", FUNC(tms9928a_device::read), FUNC(tms9928a_device::write));
+ map(0x30, 0x30).w(FUNC(kingpin_state::output1_w));
+ map(0x40, 0x40).w(FUNC(kingpin_state::output2_w));
+// map(0x50, 0x50)
map(0x60, 0x60).w(FUNC(kingpin_state::sound_nmi_w));
- //map(0x30, 0x30).nopw(); // lamps?
- //map(0x40, 0x40).nopw(); // lamps?
- //map(0x50, 0x50).nopw(); // ?
- //map(0x70, 0x70).nopw(); // ?
+// map(0x70, 0x70)
}
void kingpin_state::kingpin_sound_map(address_map &map)
@@ -114,33 +164,41 @@ void kingpin_state::kingpin_sound_map(address_map &map)
static INPUT_PORTS_START( kingpin )
PORT_START("IN0")
- PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
- PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
- PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 )
- PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 )
- PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_BUTTON5 )
- PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_START1 )
- PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_BET )
+ PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Choice 1")
+ PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Choice 2")
+ PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Choice 3")
+ PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Choice 4")
+ PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Choice 5")
+ PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("Even")
+ PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Start / Bowl")
+ PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_NAME("Credits / Kingpin")
PORT_START("IN1")
- PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("Quit")
+ PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("Odd")
+ PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r)
PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
- PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_SERVICE_NO_TOGGLE( 0x20, IP_ACTIVE_LOW )
PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT )
- PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_SERVICE )
+ PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_SERVICE ) // switches to next screen in attract mode
PORT_START("DSW1")
- PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "S1:1" )
+ PORT_DIPNAME( 0x01, 0x01, "Setup (1 of 4)" ) PORT_DIPLOCATION("S1:1")
+ PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "S1:2" )
PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "S1:3" )
- PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "S1:4" )
- PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "S1:5" )
+ PORT_DIPNAME( 0x08, 0x08, "Setup (2 of 4)" ) PORT_DIPLOCATION("S1:4")
+ PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( On ) )
+ PORT_DIPNAME( 0x10, 0x10, "Setup (3 of 4)" ) PORT_DIPLOCATION("S1:5")
+ PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "S1:6" )
- PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "S1:7" )
+ PORT_DIPNAME( 0x40, 0x40, "Setup (4 of 4)" ) PORT_DIPLOCATION("S1:7")
+ PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "S1:8" )
INPUT_PORTS_END
@@ -181,6 +239,10 @@ void kingpin_state::kingpin(machine_config &config)
GENERIC_LATCH_8(config, m_soundlatch);
AY8912(config, "aysnd", XTAL(3'579'545)).add_route(ALL_OUTPUTS, "mono", 0.50);
+
+ HOPPER(config, "hopper", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW);
+
+ config.set_default_layout(layout_kingpin);
}
void kingpin_state::dealracl(machine_config &config)
@@ -203,7 +265,7 @@ ROM_START( kingpin )
ROM_LOAD( "7.u22", 0x0000, 0x2000, CRC(077f533d) SHA1(74d0115b2cef5c35294ecb29771689b40ad1c25a) )
ROM_REGION( 0x0800, "nvram", 0 ) // default nvram
- ROM_LOAD( "nvram.u19", 0x0000, 0x0800, CRC(59de96fe) SHA1(0fcbd8305b66db4d3e9c8070d70ad673d30610a3) )
+ ROM_LOAD( "nvram.u19", 0x0000, 0x0800, CRC(391453cf) SHA1(22f2df50e1c87d3d04f44c9b88a4f7ccfb893d5f) )
ROM_REGION( 0x40, "user1", 0 )
ROM_LOAD( "n82s123n.u29", 0x00, 0x20, CRC(ce8b1a6f) SHA1(9b8f564efa4efea867884970f4a5850d598bc7a7) )
diff --git a/src/mame/layout/kingpin.lay b/src/mame/layout/kingpin.lay
new file mode 100644
index 00000000000..83dc39c8e86
--- /dev/null
+++ b/src/mame/layout/kingpin.lay
@@ -0,0 +1,152 @@
+<?xml version="1.0"?>
+
+<!--
+license: CC0
+copyright-holders: Dirk Best
+
+ACL Manufacturing Video Poker machine layout
+-->
+
+<mamelayout version="2">
+
+ <element name="background">
+ </element>
+
+ <element name="rect_orange" defstate="0">
+ <rect state="0">
+ <color red="0.3" green="0.15" blue="0.0" />
+ </rect>
+ <rect state="1">
+ <color red="0.9" green="0.45" blue="0.0" />
+ </rect>
+ </element>
+
+ <element name="rect_red" defstate="0">
+ <rect state="0">
+ <color red="0.3" green="0.0" blue="0.0" />
+ </rect>
+ <rect state="1">
+ <color red="0.9" green="0.0" blue="0.0" />
+ </rect>
+ </element>
+
+ <element name="rect_white" defstate="0">
+ <rect state="0">
+ <color red="0.3" green="0.3" blue="0.3" />
+ </rect>
+ <rect state="1">
+ <color red="0.9" green="0.9" blue="0.9" />
+ </rect>
+ </element>
+
+ <element name="text_EVEN"><text string="EVEN"><color red="0.0" green="0.0" blue="0.0" /></text></element>
+ <element name="text_START"><text string="START"><color red="0.0" green="0.0" blue="0.0" /></text></element>
+ <element name="text_BOWL"><text string="BOWL"><color red="0.0" green="0.0" blue="0.0" /></text></element>
+ <element name="text_CREDITS"><text string="CREDITS"><color red="0.0" green="0.0" blue="0.0" /></text></element>
+ <element name="text_KINGPIN"><text string="KINGPIN"><color red="0.0" green="0.0" blue="0.0" /></text></element>
+ <element name="text_QUIT"><text string="QUIT"><color red="0.0" green="0.0" blue="0.0" /></text></element>
+ <element name="text_ODD"><text string="ODD"><color red="0.0" green="0.0" blue="0.0" /></text></element>
+ <element name="text_HOPPER"><text string="HOPPER"><color red="0.0" green="0.0" blue="0.0" /></text></element>
+ <element name="text_COIN1"><text string="COIN1"><color red="0.0" green="0.0" blue="0.0" /></text></element>
+ <element name="text_COIN2"><text string="COIN2"><color red="0.0" green="0.0" blue="0.0" /></text></element>
+ <element name="text_SERVICE"><text string="SERVICE"><color red="0.0" green="0.0" blue="0.0" /></text></element>
+ <element name="text_PAY"><text string="PAY"><color red="0.0" green="0.0" blue="0.0" /></text></element>
+
+ <view name="Buttons">
+ <element ref="background">
+ <bounds x="0" y="0" width="640" height="640" />
+ </element>
+
+ <screen index="0">
+ <bounds left="0" top="0" right="640" bottom="480" />
+ </screen>
+
+ <element name="led_0" ref="rect_orange" inputtag="IN0" inputmask="0x01">
+ <bounds x="80" y="505" width="70" height="35" />
+ </element>
+ <element name="led_1" ref="rect_orange" inputtag="IN0" inputmask="0x02">
+ <bounds x="180" y="505" width="70" height="35" />
+ </element>
+ <element name="led_2" ref="rect_orange" inputtag="IN0" inputmask="0x04">
+ <bounds x="280" y="505" width="70" height="35" />
+ </element>
+ <element name="led_3" ref="rect_orange" inputtag="IN0" inputmask="0x08">
+ <bounds x="380" y="505" width="70" height="35" />
+ </element>
+ <element name="led_4" ref="rect_orange" inputtag="IN0" inputmask="0x10">
+ <bounds x="480" y="505" width="70" height="35" />
+ </element>
+
+ <element name="led_5" ref="rect_red" inputtag="IN0" inputmask="0x20">
+ <bounds x="80" y="555" width="70" height="35" />
+ </element>
+ <element ref="text_EVEN">
+ <bounds x="90" y="560" width="50" height="25" />
+ </element>
+ <element name="led_6" ref="rect_red" inputtag="IN0" inputmask="0x40">
+ <bounds x="180" y="555" width="70" height="35" />
+ </element>
+ <element ref="text_START">
+ <bounds x="190" y="558" width="50" height="13" />
+ </element>
+ <element ref="text_BOWL">
+ <bounds x="190" y="573" width="50" height="13" />
+ </element>
+ <element name="led_7" ref="rect_red" inputtag="IN0" inputmask="0x80">
+ <bounds x="280" y="555" width="70" height="35" />
+ </element>
+ <element ref="text_CREDITS">
+ <bounds x="290" y="558" width="50" height="13" />
+ </element>
+ <element ref="text_KINGPIN">
+ <bounds x="290" y="573" width="50" height="13" />
+ </element>
+ <element name="led_8" ref="rect_red" inputtag="IN1" inputmask="0x01">
+ <bounds x="380" y="555" width="70" height="35" />
+ </element>
+ <element ref="text_QUIT">
+ <bounds x="390" y="560" width="50" height="25" />
+ </element>
+ <element name="led_9" ref="rect_red" inputtag="IN1" inputmask="0x02">
+ <bounds x="480" y="555" width="70" height="35" />
+ </element>
+ <element ref="text_ODD">
+ <bounds x="490" y="560" width="50" height="25" />
+ </element>
+
+ <element name="led_10" ref="rect_white" inputtag="IN1" inputmask="0x04">
+ <bounds x="280" y="605" width="35" height="20" />
+ </element>
+ <element ref="text_HOPPER">
+ <bounds x="280" y="605" width="35" height="20" />
+ </element>
+ <element name="led_11" ref="rect_white" inputtag="IN1" inputmask="0x08">
+ <bounds x="330" y="605" width="35" height="20" />
+ </element>
+ <element ref="text_COIN1">
+ <bounds x="330" y="605" width="35" height="20" />
+ </element>
+ <element name="led_12" ref="rect_white" inputtag="IN1" inputmask="0x10">
+ <bounds x="380" y="605" width="35" height="20" />
+ </element>
+ <element ref="text_COIN2">
+ <bounds x="380" y="605" width="35" height="20" />
+ </element>
+ <element name="led_13" ref="rect_white" inputtag="IN1" inputmask="0x20">
+ <bounds x="430" y="605" width="35" height="20" />
+ </element>
+ <element ref="text_SERVICE">
+ <bounds x="430" y="605" width="35" height="20" />
+ </element>
+ <element name="led_14" ref="rect_white" inputtag="IN1" inputmask="0x40">
+ <bounds x="480" y="605" width="35" height="20" />
+ </element>
+ <element ref="text_PAY">
+ <bounds x="480" y="605" width="35" height="20" />
+ </element>
+ <element name="led_15" ref="rect_white" inputtag="IN1" inputmask="0x80">
+ <bounds x="530" y="605" width="35" height="20" />
+ </element>
+ </view>
+
+</mamelayout>