diff options
author | 2021-07-10 13:27:08 +0200 | |
---|---|---|
committer | 2021-07-10 13:27:08 +0200 | |
commit | aa34ffb2389b3c23ad3cce4dd73728bbd696bdbd (patch) | |
tree | d07d49794c822d1ec5e25c80e26e9c5302ea923a | |
parent | e97fe0becb6913527a00d7b96b70b12cd4b3230b (diff) |
magic10.cpp: added ticket and hopper devices [Grull Osgo]
-rw-r--r-- | src/mame/drivers/magic10.cpp | 61 |
1 files changed, 42 insertions, 19 deletions
diff --git a/src/mame/drivers/magic10.cpp b/src/mame/drivers/magic10.cpp index dccae49c1a9..1725d7862fd 100644 --- a/src/mame/drivers/magic10.cpp +++ b/src/mame/drivers/magic10.cpp @@ -123,6 +123,7 @@ Both setups show different variants for components layout, memory size, NVRAM, e #include "cpu/m68000/m68000.h" #include "machine/nvram.h" +#include "machine/ticket.h" #include "sound/okim6295.h" #include "emupal.h" #include "screen.h" @@ -176,6 +177,8 @@ class magic10_state : public magic10_base_state public: magic10_state(const machine_config &mconfig, device_type type, const char *tag) : magic10_base_state(mconfig, type, tag), + m_ticket(*this, "ticket"), + m_hopper(*this, "hopper"), m_lamps(*this, "lamp%u", 1U) { } @@ -189,6 +192,9 @@ public: protected: virtual void machine_start() override { m_lamps.resolve(); } + required_device<ticket_dispenser_device> m_ticket; + required_device<ticket_dispenser_device> m_hopper; + private: output_finder<8> m_lamps; @@ -221,11 +227,11 @@ private: void map(address_map &map); }; -class hotslot_state : public magic10_base_state +class hotslot_state : public magic10_state { public: hotslot_state(const machine_config &mconfig, device_type type, const char *tag) : - magic10_base_state(mconfig, type, tag) + magic10_state(mconfig, type, tag) { } void hotslot(machine_config &config); @@ -360,8 +366,9 @@ void magic10_state::out_w(uint16_t data) 7654 3210 ========= ---- ---x Payout lamp. + ---- --x- Ticket Motor Out. ---- -x-- Coin counter. - + -x-- ---- Hopper Motor Out. */ // popmessage("lamps: %02X", data); @@ -375,7 +382,9 @@ void magic10_state::out_w(uint16_t data) m_lamps[6] = BIT(data, 6); // Lamp 7 - PLAY (BET/TAKE/CANCEL) m_lamps[7] = BIT(data, 8); // Lamp 8 - PAYOUT/SUPERGAME + m_ticket->motor_w(BIT(data, 9) ); machine().bookkeeping().coin_counter_w(0, BIT(data, 10)); + m_hopper->motor_w(BIT(data, 14) ); } /*************************** @@ -502,7 +511,7 @@ static INPUT_PORTS_START( magic10 ) PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_NAME("Note B") PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_COIN4 ) PORT_NAME("Note C") PORT_SERVICE_NO_TOGGLE( 0x1000, IP_ACTIVE_LOW ) - PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Out Hole") PORT_CODE(KEYCODE_D) + PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_COIN5 ) PORT_NAME("Note D") PORT_CODE(KEYCODE_9) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_NAME("Collect") @@ -510,19 +519,23 @@ static INPUT_PORTS_START( magic10 ) PORT_DIPNAME( 0x0001, 0x0001, "Display Logo" ) PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) PORT_DIPSETTING( 0x0001, DEF_STR( Yes ) ) - PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_CUSTOM ) // empty dispenser - PORT_DIPNAME( 0x00ee, 0x00ee, "Disable Free Play" ) - PORT_DIPSETTING( 0x00ee, DEF_STR( Off ) ) + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) + PORT_DIPNAME( 0x0008, 0x0008, "Clear NVRAM" ) // Needs to enabled by other DSW + PORT_DIPSETTING( 0x0000, DEF_STR( On )) + PORT_DIPSETTING( 0x0008, DEF_STR( Off )) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_NAME("Hopper Refill") PORT_CODE(KEYCODE_F) // empty dispenser + PORT_DIPNAME( 0x00e4, 0x00e4, "Disable Free Play" ) + PORT_DIPSETTING( 0x00e4, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0300, 0x0100, DEF_STR( Difficulty ) ) PORT_DIPSETTING( 0x0300, DEF_STR( Hardest ) ) PORT_DIPSETTING( 0x0200, DEF_STR( Hard ) ) - PORT_DIPSETTING( 0x0100, DEF_STR( Medium ) ) + PORT_DIPSETTING( 0x0100, DEF_STR( Medium ) ) // Clr.NVRAM Enable PORT_DIPSETTING( 0x0000, DEF_STR( Easy ) ) PORT_DIPNAME( 0x0c00, 0x0000, "Notes Settings" ) PORT_DIPSETTING( 0x0000, "Note A: 10 - Note B: 20 - Note C: 50 - Note D: 100" ) PORT_DIPSETTING( 0x0800, "Note A: 20 - Note B: 40 - Note C: 100 - Note D: 200" ) - PORT_DIPSETTING( 0x0400, "Note A: 50 - Note B: 100 - Note C: 500 - Note D: 1000" ) + PORT_DIPSETTING( 0x0400, "Note A: 50 - Note B: 100 - Note C: 500 - Note D: 1000" ) // Clr.NVRAM Enable PORT_DIPSETTING( 0x0c00, "Note A: 100 - Note B: 200 - Note C: 1000 - Note D: 2000" ) PORT_DIPNAME( 0x3000, 0x3000, "Lots At" ) PORT_CONDITION("DSW", 0xc000, EQUALS, 0xc000) PORT_DIPSETTING( 0x0000, "50 200 500 1000 2000" ) @@ -535,11 +548,11 @@ static INPUT_PORTS_START( magic10 ) PORT_DIPSETTING( 0x2000, "Every 100 Score" ) PORT_DIPSETTING( 0x3000, "Every 100 Score" ) PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unused ) ) PORT_CONDITION("DSW", 0xc000, EQUALS, 0x4000) - PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) // Clr.NVRAM Enable PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unused ) ) PORT_CONDITION("DSW", 0xc000, EQUALS, 0x4000) PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) // Clr.NVRAM Enable PORT_DIPNAME( 0x3000, 0x3000, "1 Play Won" ) PORT_CONDITION("DSW", 0xc000, EQUALS, 0x0000) PORT_DIPSETTING( 0x0000, "Every 10 Score" ) PORT_DIPSETTING( 0x1000, "Every 10 Score" ) @@ -547,7 +560,7 @@ static INPUT_PORTS_START( magic10 ) PORT_DIPSETTING( 0x3000, "Every 10 Score" ) PORT_DIPNAME( 0xc000, 0xc000, "Dispenser Type" ) PORT_DIPSETTING( 0x0000, "MKII Hopper - Supergame" ) - PORT_DIPSETTING( 0x4000, "10 Tokens" ) + PORT_DIPSETTING( 0x4000, "10 Tokens" ) // Clr.NVRAM Enable PORT_DIPSETTING( 0x8000, "Tickets Dispenser" ) PORT_DIPSETTING( 0xc000, "Lots Dispenser" ) INPUT_PORTS_END @@ -585,13 +598,13 @@ static INPUT_PORTS_START( musicsrt ) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_POKER_HOLD5 ) PORT_NAME("Hold 5 / Half Gamble") PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_NAME("Play (Bet / Take)") - PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Door") PORT_CODE(KEYCODE_S) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_GAMBLE_DOOR ) PORT_NAME("Door") PORT_TOGGLE PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_NAME("Aux A") PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_COIN4 ) PORT_NAME("Aux B") PORT_SERVICE_NO_TOGGLE( 0x1000, IP_ACTIVE_LOW ) - PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Outhole") PORT_CODE(KEYCODE_D) + PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_COIN5 ) PORT_NAME("Aux C") PORT_CODE(KEYCODE_9) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_NAME("OK") @@ -629,7 +642,7 @@ static INPUT_PORTS_START( hotslot ) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_GAMBLE_HALF ) PORT_NAME("1/2 Win") PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) - PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Hopper") PORT_CODE(KEYCODE_H) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("IN1") @@ -638,7 +651,7 @@ static INPUT_PORTS_START( hotslot ) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_NAME("Note B") PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN4 ) PORT_NAME("Note C") PORT_SERVICE_NO_TOGGLE( 0x0010, IP_ACTIVE_LOW ) - PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Outhole") PORT_CODE(KEYCODE_S) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_COIN5 ) PORT_NAME("Note D") PORT_CODE(KEYCODE_9) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_GAMBLE_DOOR ) PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -687,13 +700,20 @@ static INPUT_PORTS_START( sgsafari ) PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_NAME("Note B") PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_COIN4 ) PORT_NAME("Note C") PORT_SERVICE_NO_TOGGLE( 0x1000, IP_ACTIVE_LOW ) - PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_COIN5 ) PORT_NAME("Note D") PORT_CODE(KEYCODE_9) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_NAME("Payout / Super Game") PORT_START("DSW1") // TODO: defaults are hardwired with aforementioned startup code, is it intentional? - PORT_BIT( 0x00ff, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_DIPNAME( 0x0300, 0x0000, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:1,2") PORT_DIPSETTING( 0x0300, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x0200, DEF_STR( Normal ) ) @@ -783,6 +803,9 @@ void magic10_state::magic10(machine_config &config) // basic machine hardware m_maincpu->set_addrmap(AS_PROGRAM, &magic10_state::magic10_map); + + TICKET_DISPENSER(config, m_ticket, attotime::from_msec(6), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH ); + HOPPER(config, m_hopper, attotime::from_msec(20), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH ); } @@ -808,7 +831,7 @@ void magic102_state::magic102(machine_config &config) void hotslot_state::hotslot(machine_config &config) { - base(config); + magic10(config); // basic machine hardware m_maincpu->set_addrmap(AS_PROGRAM, &hotslot_state::map); |