diff --git a/src/mame/drivers/kingpin.c b/src/mame/drivers/kingpin.c index 6c456d802b1..9a2aac91cf2 100644 --- a/src/mame/drivers/kingpin.c +++ b/src/mame/drivers/kingpin.c @@ -1,28 +1,38 @@ /* -King Pin (c) 1983 American Communication Laboratories Inc. +ACL Manufacturing 1983 hardware (a division of American Communication Laboratories) Driver by Andrew Gardner +2 x Sharp Z80 +2 x NEC 8255 +2 x OKI MSM5126-25RS (2Kx8 RAM), 3.6V battery connected to main RAM +TI TMS9928ANL +GI AY-3-8912 +DSW bank at S1 +3.579545MHz XTAL for CPU/sound, 10.7386MHz XTAL for video + +several multigame gamblers on this hardware: +- The Dealer (not dumped) +- Kingpin +- Maxi-Dealer + Notes: - There are some writes around 0xe000 in the multi-game set that can't - possibly go anywhere on the board I own. A bigger RAM chip would - accommodate them though. - There are 6 pots labeled vr2-vr7. Color adjustments? - The edge-connectors are non-jamma on this board. +- To enter setup mode, boot the game with dips 1, 4, 5, 7 set to on +- There are some writes around 0xe000 in the maxideal set that can't + possibly go anywhere on the board I own. A bigger RAM chip would + accommodate them though. +- There are 6 pots labeled vr2-vr7. Color adjustments? +- The edge-connectors are non-jamma on this board. Todo: - Hook up sound - -two crystals on the board : 3.579545 for sound(?) and main CPU - 10.7386 for the tms9928ANL - Figure out DIPs, buttons, and outputs - -DIPs are weird. setting them to ~0x6A and resetting the machine enters 'setup' mode - -0x30-0x70 are very likely lights - do the buttons light up? - -what really is I/O 0x02? +- lamps + */ #include "emu.h" #include "cpu/z80/z80.h" #include "video/tms9928a.h" #include "sound/ay8910.h" +#include "machine/i8255.h" #include "machine/nvram.h" @@ -30,78 +40,25 @@ class kingpin_state : public driver_device { public: kingpin_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag) { } + : driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_audiocpu(*this, "audiocpu") + { } - UINT8 *m_code_base; - DECLARE_READ8_MEMBER(io_read_missing_dips); + required_device m_maincpu; + required_device m_audiocpu; + + DECLARE_WRITE8_MEMBER(sound_nmi_w); DECLARE_WRITE_LINE_MEMBER(vdp_interrupt); - DECLARE_DRIVER_INIT(kingpin); }; -READ8_MEMBER(kingpin_state::io_read_missing_dips) +WRITE8_MEMBER(kingpin_state::sound_nmi_w) { - return 0x00; + soundlatch_byte_w(space, 0, data); + device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE); } - -/* Ports */ -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_BUTTON6 ) /* Likely unused */ - PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME( "Start" ) - PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME( "Apply Credit" ) - - PORT_START("IN1") - PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_BUTTON9 ) - PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_BUTTON10 ) - PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_BUTTON11 ) - PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) - PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_BUTTON12 ) - PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_SERVICE ) - PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_BUTTON13 ) PORT_NAME( "Cash Out" ) - PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_BUTTON14 ) - - /* There are 3 banks of solder pads, but only one is poupulated with DIPs */ - PORT_START("DSW") - PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - -INPUT_PORTS_END - - -/* PROGRAM MAPS */ - -/* Main CPU */ -/* There's an OKI MSM5126-25RS in here - (2k RAM) */ -/* A 3.6V battery traces directly to U19, rendering it nvram */ static ADDRESS_MAP_START( kingpin_program_map, AS_PROGRAM, 8, kingpin_state ) AM_RANGE(0x0000, 0xdfff) AM_ROM AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_SHARE("nvram") @@ -109,79 +66,133 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( kingpin_io_map, AS_IO, 8, kingpin_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) - AM_RANGE(0x00, 0x00) AM_READ(io_read_missing_dips) - AM_RANGE(0x01, 0x01) AM_READ_PORT("DSW") -/* AM_RANGE(0x02, 0x02) AM_READ(io_read_missing_dips) */ -/* AM_RANGE(0x02, 0x02) AM_WRITE_LEGACY(NO IDEA) */ - AM_RANGE(0x10, 0x10) AM_READ_PORT("IN0") - AM_RANGE(0x11, 0x11) AM_READ_PORT("IN1") -/* AM_RANGE(0x12, 0x12) AM_WRITE_LEGACY(NO IDEA) */ -/* AM_RANGE(0x13, 0x13) AM_WRITE_LEGACY(NO IDEA) */ + AM_RANGE(0x00, 0x03) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write) + AM_RANGE(0x10, 0x13) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write) AM_RANGE(0x20, 0x20) AM_DEVREADWRITE("tms9928a", tms9928a_device, vram_read, vram_write) AM_RANGE(0x21, 0x21) AM_DEVREADWRITE("tms9928a", tms9928a_device, register_read, register_write) -/* AM_RANGE(0x30, 0x30) AM_WRITE_LEGACY(LIKELY LIGHTS) */ -/* AM_RANGE(0x40, 0x40) AM_WRITE_LEGACY(LIKELY LIGHTS) */ -/* AM_RANGE(0x50, 0x50) AM_WRITE_LEGACY(LIKELY LIGHTS) */ -/* AM_RANGE(0x60, 0x60) AM_WRITE_LEGACY(LIKELY LIGHTS) */ -/* AM_RANGE(0x70, 0x70) AM_WRITE_LEGACY(LIKELY LIGHTS) */ + AM_RANGE(0x60, 0x60) AM_WRITE(sound_nmi_w) + //AM_RANGE(0x30, 0x30) AM_WRITENOP // lamps? + //AM_RANGE(0x40, 0x40) AM_WRITENOP // lamps? + //AM_RANGE(0x50, 0x50) AM_WRITENOP // ? + //AM_RANGE(0x70, 0x70) AM_WRITENOP // ? ADDRESS_MAP_END - -/* Sound CPU */ -/* There's an OKI MSM5126-25RS in here - (2k RAM) */ static ADDRESS_MAP_START( kingpin_sound_map, AS_PROGRAM, 8, kingpin_state ) AM_RANGE(0x0000, 0x1fff) AM_ROM - AM_RANGE(0x8400, 0x8bff) AM_RAM + AM_RANGE(0x8000, 0x8001) AM_DEVWRITE_LEGACY("aysnd", ay8910_address_data_w) + //AM_RANGE(0x8400, 0x8400) AM_READNOP // ? + //AM_RANGE(0x8401, 0x8401) AM_WRITENOP // ? + AM_RANGE(0x8800, 0x8fff) AM_RAM + AM_RANGE(0x9000, 0x9000) AM_READ(soundlatch_byte_r) ADDRESS_MAP_END + +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_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 ( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) + 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_START("DSW1") + PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "S1:1" ) + 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_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "S1:6" ) + PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "S1:7" ) + PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "S1:8" ) +INPUT_PORTS_END + + + +static I8255A_INTERFACE( ppi8255_0_intf ) +{ + DEVCB_NULL, /* Port A read = watchdog? */ + DEVCB_NULL, /* Port A write */ + DEVCB_INPUT_PORT("DSW1"), /* Port B read */ + DEVCB_NULL, /* Port B write */ + DEVCB_NULL, /* Port C read = unused? */ + DEVCB_NULL /* Port C write */ +}; + +static I8255A_INTERFACE( ppi8255_1_intf ) +{ + DEVCB_INPUT_PORT("IN0"), /* Port A read */ + DEVCB_NULL, /* Port A write */ + DEVCB_INPUT_PORT("IN1"), /* Port B read */ + DEVCB_NULL, /* Port B write */ + DEVCB_NULL, /* Port C read */ + DEVCB_NULL /* Port C write = unknown */ +}; + WRITE_LINE_MEMBER(kingpin_state::vdp_interrupt) { - cputag_set_input_line(machine(), "maincpu", 0, HOLD_LINE); + device_set_input_line(m_maincpu, 0, state ? ASSERT_LINE : CLEAR_LINE); } static TMS9928A_INTERFACE(kingpin_tms9928a_interface) { "screen", 0x4000, - DEVCB_DRIVER_LINE_MEMBER(kingpin_state,vdp_interrupt) + DEVCB_DRIVER_LINE_MEMBER(kingpin_state, vdp_interrupt) +}; + +static AY8910_INTERFACE( ay8912_interface ) +{ + AY8910_LEGACY_OUTPUT, + AY8910_DEFAULT_LOADS, + DEVCB_NULL, + DEVCB_NULL, + DEVCB_NULL, + DEVCB_NULL }; static MACHINE_CONFIG_START( kingpin, kingpin_state ) -/* MAIN CPU */ - MCFG_CPU_ADD("maincpu", Z80, 3579545) + + /* basic machine hardware */ + MCFG_CPU_ADD("maincpu", Z80, XTAL_3_579545MHz) MCFG_CPU_PROGRAM_MAP(kingpin_program_map) MCFG_CPU_IO_MAP(kingpin_io_map) -/* SOUND CPU */ - MCFG_CPU_ADD("audiocpu", Z80, 3579545) - MCFG_CPU_PROGRAM_MAP(kingpin_sound_map) - /*MCFG_CPU_IO_MAP(sound_io_map)*/ + MCFG_I8255A_ADD( "ppi8255_0", ppi8255_0_intf ) + MCFG_I8255A_ADD( "ppi8255_1", ppi8255_1_intf ) -/* VIDEO */ + MCFG_NVRAM_ADD_1FILL("nvram") + + MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz) + MCFG_CPU_PROGRAM_MAP(kingpin_sound_map) + MCFG_CPU_PERIODIC_INT(irq0_line_hold, 1000) // unknown freq + + /* video hardware */ MCFG_TMS9928A_ADD( "tms9928a", TMS9928A, kingpin_tms9928a_interface ) MCFG_TMS9928A_SCREEN_ADD_NTSC( "screen" ) MCFG_SCREEN_UPDATE_DEVICE( "tms9928a", tms9928a_device, screen_update ) - MCFG_NVRAM_ADD_0FILL("nvram") - -/* Sound chip is a AY-3-8912 */ -/* - MCFG_SPEAKER_STANDARD_MONO("mono") - - MCFG_SOUND_ADD("aysnd", AY8912, 1500000) - MCFG_SOUND_CONFIG(ay8912_interface) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -*/ + /* sound hardware */ + MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_SOUND_ADD("aysnd", AY8912, XTAL_3_579545MHz) + MCFG_SOUND_CONFIG(ay8912_interface) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) MACHINE_CONFIG_END -DRIVER_INIT_MEMBER(kingpin_state,kingpin) -{ - /* Hacks to keep the emu a'runnin */ - m_code_base = memregion("maincpu")->base(); - m_code_base[0x17d4] = 0xc3; /* Maybe sound related? */ -} ROM_START( kingpin ) ROM_REGION( 0xe000, "maincpu", 0 ) @@ -194,12 +205,15 @@ ROM_START( kingpin ) ROM_REGION( 0x2000, "audiocpu", 0 ) 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_REGION( 0x40, "user1", 0 ) ROM_LOAD( "n82s123n.u29", 0x00, 0x20, CRC(ce8b1a6f) SHA1(9b8f564efa4efea867884970f4a5850d598bc7a7) ) ROM_LOAD( "n82s123n.u43", 0x20, 0x20, CRC(55569a2a) SHA1(5b0482546161c9d14a7d2c719d40774539cb41ca) ) ROM_END -ROM_START( kingpinm ) +ROM_START( maxideal ) ROM_REGION( 0xe000, "maincpu", 0 ) ROM_LOAD( "mdc0.u12", 0x0000, 0x2000, CRC(0a73dd98) SHA1(ef3e20ecae646c2eda7364f566f3841747f982a5) ) ROM_LOAD( "mdc1.u13", 0x2000, 0x2000, CRC(18c2550c) SHA1(1466f7d9601c336b4c802821bd2ba0091c9ff143) ) @@ -212,10 +226,14 @@ ROM_START( kingpinm ) ROM_REGION( 0x2000, "audiocpu", 0 ) ROM_LOAD( "7.u22", 0x0000, 0x2000, CRC(077f533d) SHA1(74d0115b2cef5c35294ecb29771689b40ad1c25a) ) + ROM_REGION( 0x0800, "nvram", 0 ) // default nvram + ROM_LOAD( "nvram.u19", 0x0000, 0x0800, CRC(30a08f13) SHA1(a87d21c333bb8bc2e714aa843319643a84928269) ) + ROM_REGION( 0x40, "user1", 0 ) ROM_LOAD( "n82s123n.u29", 0x00, 0x20, CRC(ce8b1a6f) SHA1(9b8f564efa4efea867884970f4a5850d598bc7a7) ) ROM_LOAD( "n82s123n.u43", 0x20, 0x20, CRC(55569a2a) SHA1(5b0482546161c9d14a7d2c719d40774539cb41ca) ) ROM_END -GAME( 1983, kingpin, 0, kingpin, kingpin, kingpin_state, kingpin, 0, "American Communication Laboratories Inc.", "King Pin",GAME_NO_SOUND) -GAME( 1983, kingpinm, 0, kingpin, kingpin, kingpin_state, kingpin, 0, "American Communication Laboratories Inc.", "King Pin Multi-Game",GAME_NO_SOUND) + +GAME( 1983, kingpin, 0, kingpin, kingpin, driver_device, 0, 0, "ACL Manufacturing", "Kingpin", 0) +GAME( 1983, maxideal, 0, kingpin, kingpin, driver_device, 0, 0, "ACL Manufacturing", "Maxi-Dealer", 0) diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 9155f445978..1d0f6cb4538 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -10824,7 +10824,7 @@ miniboy7a // (c) 1983, Bonanza Enterprises 48in1 // MAME based bootleg 48in1a // MAME based bootleg kingpin // (c) 1983 American Communications Laboratories Inc. -kingpinm // (c) 1983 American Communications Laboratories Inc. +maxideal // (c) 1983 American Communications Laboratories Inc. thayers // (c) 1983 RDI Video Systems thayersa // (c) 1983 RDI Video Systems istellar // (c) 1983 Funai / Gakken