From b9aecfae452a5f9b7a459790455f83c569650508 Mon Sep 17 00:00:00 2001 From: angelosa Date: Mon, 2 Sep 2024 11:06:35 +0200 Subject: excellent/dblcrown.cpp: preliminary hopper hookup --- src/mame/excellent/dblcrown.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/mame/excellent/dblcrown.cpp b/src/mame/excellent/dblcrown.cpp index 291dd878ce2..f580bd4665c 100644 --- a/src/mame/excellent/dblcrown.cpp +++ b/src/mame/excellent/dblcrown.cpp @@ -5,8 +5,8 @@ Double Crown (c) 1997 Cadence Technology / Dyna TODO: -- Bogus "Hole" in main screen display; - Is the background pen really black? +- Pinpoint optional hopper line_r hookup, via dip4:8. - Lots of unmapped I/Os (game doesn't make much use of the HW); - video / irq timings; @@ -47,6 +47,7 @@ and for nvram functions. #include "machine/bankdev.h" #include "machine/i8255.h" #include "machine/nvram.h" +#include "machine/ticket.h" #include "machine/timer.h" #include "machine/watchdog.h" #include "sound/ay8910.h" @@ -68,6 +69,7 @@ public: : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") , m_watchdog(*this, "watchdog") + , m_hopper(*this, "hopper") , m_vram(*this, "vram") , m_vram_bank(*this, "vram_bank%u", 0U) , m_gfxdecode(*this, "gfxdecode") @@ -86,6 +88,7 @@ private: required_device m_maincpu; required_device m_watchdog; + required_device m_hopper; required_shared_ptr m_vram; required_device_array m_vram_bank; required_device m_gfxdecode; @@ -274,7 +277,7 @@ uint8_t dblcrown_state::key_pending_r() /* bits * 7654 3210 - * ---- -x-- unknown (active after deal) + * ---- -x-- coin lockout * ---- x--- Payout counter pulse * ---x ---- Coin In counter pulse * -x-- ---- unknown (active after deal) @@ -283,8 +286,8 @@ uint8_t dblcrown_state::key_pending_r() void dblcrown_state::output_w(uint8_t data) { machine().bookkeeping().coin_counter_w(0, BIT(data, 4)); /* Coin In counter pulse */ - // TODO: should be hopper motor_w - machine().bookkeeping().coin_counter_w(1, BIT(data, 3)); /* Payout counter pulse */ + m_hopper->motor_w(BIT(data, 3)); + machine().bookkeeping().coin_lockout_global_w(!BIT(data, 2)); } /* bits @@ -368,7 +371,7 @@ static INPUT_PORTS_START( dblcrown ) PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_HIGH ) PORT_NAME("Big") PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_LOW ) PORT_NAME("Small") PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_TAKE ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_NAME("Payout") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("IN2") @@ -492,7 +495,8 @@ static INPUT_PORTS_START( dblcrown ) PORT_DIPSETTING( 0x20, "1 Coin/50 Credits" ) PORT_DIPSETTING( 0x10, "1 Coin/100 Credits" ) PORT_DIPSETTING( 0x00, "1 Coin/500 Credits" ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) + // TODO: game will error blink if On at payout time + PORT_DIPNAME( 0x80, 0x80, "Hopper Status?" ) PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) INPUT_PORTS_END @@ -584,6 +588,8 @@ void dblcrown_state::dblcrown(machine_config &config) // 1000 ms. (minimal of MAX693A watchdog long timeout period with internal oscillator) WATCHDOG_TIMER(config, m_watchdog).set_time(attotime::from_msec(1000)); + HOPPER(config, m_hopper, attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH ); + NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); i8255_device &ppi(I8255(config, "ppi")); -- cgit v1.2.3