summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Phil Bennett <philipjbennett@users.noreply.github.com>2013-09-11 12:49:57 +0000
committer Phil Bennett <philipjbennett@users.noreply.github.com>2013-09-11 12:49:57 +0000
commit2a9e72a7caff8d8f5bc4c5be86897d6e5210db70 (patch)
tree3eabe40e142975d718a99b60ae9b9a95b1c86771 /src
parent8a48b5878be1a7d4b04e603ab2ffda70f8480670 (diff)
New games added or promoted from NOT_WORKING status
--------------------------------------------------- Tap a Tune [Phil Bennett, Mariusz Wojcieszek]
Diffstat (limited to 'src')
-rw-r--r--src/mame/drivers/tapatune.c628
1 files changed, 398 insertions, 230 deletions
diff --git a/src/mame/drivers/tapatune.c b/src/mame/drivers/tapatune.c
index f96b0b8ceb0..baf9d136fce 100644
--- a/src/mame/drivers/tapatune.c
+++ b/src/mame/drivers/tapatune.c
@@ -1,67 +1,90 @@
-/*
+/***************************************************************************
-Tap-A-Tune
-1994 CES?
----------
+ Tap a Tune
-Driver by Mariusz Wojcieszek and Phil Bennett
+ driver by Mariusz Wojcieszek and Phil Bennett
-Top board notable:
-- Hitachi HD68HC000-12 68000 CPU (24 MHz crystal)
-- Hitachi HD46505SP-2 CRTC
-- 2x Sony CXK581000P-10L RAM
-- 2x Mosel MS6264L-10PC RAM
-- 2x Mosel MS62256L-10PC RAM
-- rom0.u3 / rom1.u12 - 68000 program
-- rom2.u4 / rom3.u13 / rom4.u5 / rom5.u14 - graphics
+ PCB Notes:
-Bottom board notable:
+ Top board notable:
-- Zilog Z0840006PSC Z80 CPU (24 MHz crystal, clock unknown)
-- BSMT2000 custom audio IC
-- rom.u8 Z80 program
-- arom1.u16 BSMT2000 samples
-- 2 banks of 8-position DIP switches
-- red/green/yellow LEDs
-- many connectors for I/O
+ - Hitachi HD68HC000-12 68000 CPU (24 MHz crystal)
+ - Hitachi HD46505SP-2 CRTC
+ - 2x Sony CXK581000P-10L RAM
+ - 2x Mosel MS6264L-10PC RAM
+ - 2x Mosel MS62256L-10PC RAM
+ - rom0.u3 / rom1.u12 - 68000 program
+ - rom2.u4 / rom3.u13 / rom4.u5 / rom5.u14 - graphics
-*/
+ Bottom board notable:
+
+ - Zilog Z0840006PSC Z80 CPU (24 MHz crystal)
+ - BSMT2000 custom audio IC
+ - rom.u8 Z80 program
+ - arom1.u16 BSMT2000 samples
+ - 2 banks of 8-position DIP switches
+ - red/green/yellow LEDs
+ - many connectors for I/O
+
+ The sound and I/O board is used by other redemption games such as
+ Colorama and Wheel 'Em In
+
+****************************************************************************/
#include "emu.h"
#include "cpu/m68000/m68000.h"
#include "cpu/z80/z80.h"
-#include "video/mc6845.h"
-#include "sound/bsmt2000.h"
+#include "machine/nvram.h"
#include "machine/ticket.h"
+#include "sound/bsmt2000.h"
+#include "video/mc6845.h"
+
+
+/*************************************
+ *
+ * Driver state
+ *
+ *************************************/
class tapatune_state : public driver_device
{
public:
tapatune_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
- m_videoram(*this, "videoram") ,
m_maincpu(*this, "maincpu"),
- m_soundcpu(*this, "soundcpu") {}
-
- UINT8 m_paletteram[0x300];
- UINT16 m_palette_write_address;
- rgb_t m_pens[0x100];
+ m_soundcpu(*this, "soundcpu"),
+ m_bsmt(*this, "bsmt"),
+ m_videoram(*this, "videoram") {}
+ required_device<cpu_device> m_maincpu;
+ required_device<cpu_device> m_soundcpu;
+ required_device<bsmt2000_device> m_bsmt;
required_shared_ptr<UINT16> m_videoram;
+ UINT8 m_paletteram[0x300];
+ UINT16 m_palette_write_addr;
+ rgb_t m_pens[0x100];
UINT8 m_controls_mux;
UINT8 m_z80_to_68k_index;
UINT8 m_z80_to_68k_data;
-
UINT8 m_68k_to_z80_index;
UINT8 m_68k_to_z80_data;
+ UINT8 m_z80_data_available;
+ UINT8 m_68k_data_available;
+ UINT8 m_bsmt_data_l;
+ UINT8 m_bsmt_data_h;
+ bool m_bsmt_reset;
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ DECLARE_WRITE_LINE_MEMBER(crtc_vsync);
- UINT16 m_bsmt_data;
DECLARE_WRITE16_MEMBER(palette_w);
DECLARE_READ16_MEMBER(read_from_z80);
DECLARE_WRITE16_MEMBER(write_to_z80);
- DECLARE_READ16_MEMBER(irq_ack_r);
+
DECLARE_READ8_MEMBER(sound_irq_clear);
DECLARE_WRITE8_MEMBER(controls_mux);
DECLARE_READ8_MEMBER(controls_r);
@@ -69,188 +92,354 @@ public:
DECLARE_WRITE8_MEMBER(write_data_to_68k);
DECLARE_READ8_MEMBER(read_index_from_68k);
DECLARE_READ8_MEMBER(read_data_from_68k);
- DECLARE_READ8_MEMBER(bsmt_status_r);
+ DECLARE_WRITE8_MEMBER(lamps_w);
+ DECLARE_READ8_MEMBER(status_r);
DECLARE_WRITE8_MEMBER(bsmt_data_lo_w);
DECLARE_WRITE8_MEMBER(bsmt_data_hi_w);
DECLARE_WRITE8_MEMBER(bsmt_reg_w);
- DECLARE_WRITE_LINE_MEMBER(crtc_vsync);
- virtual void video_start();
- required_device<cpu_device> m_maincpu;
- required_device<cpu_device> m_soundcpu;
+ DECLARE_READ8_MEMBER(special_r);
};
+
+/*************************************
+ *
+ * Initialization & interrupts
+ *
+ *************************************/
+
+void tapatune_state::machine_start()
+{
+ save_item(NAME(m_paletteram));
+ save_item(NAME(m_palette_write_addr));
+ save_item(NAME(m_pens));
+ save_item(NAME(m_controls_mux));
+ save_item(NAME(m_z80_to_68k_index));
+ save_item(NAME(m_z80_to_68k_data));
+ save_item(NAME(m_68k_to_z80_index));
+ save_item(NAME(m_68k_to_z80_data));
+ save_item(NAME(m_z80_data_available));
+ save_item(NAME(m_68k_data_available));
+ save_item(NAME(m_bsmt_data_l));
+ save_item(NAME(m_bsmt_data_h));
+ save_item(NAME(m_bsmt_reset));
+}
+
+
+void tapatune_state::machine_reset()
+{
+ // The BSMT2000 is held in reset until the Z80 writes to P1
+ m_bsmt_reset = true;
+ m_z80_data_available = 0;
+ m_68k_data_available = 0;
+}
+
+
+/*************************************
+ *
+ * Video hardware
+ *
+ *************************************/
+
+const pen_t* get_pens(tapatune_state *state)
+{
+ for (UINT32 i = 0; i < 0x100; i++)
+ {
+ int r = state->m_paletteram[3 * i + 0];
+ int g = state->m_paletteram[3 * i + 1];
+ int b = state->m_paletteram[3 * i + 2];
+
+ r = pal6bit(r);
+ g = pal6bit(g);
+ b = pal6bit(b);
+
+ state->m_pens[i] = MAKE_RGB(r, g, b);
+ }
+
+ return state->m_pens;
+}
+
+
+static MC6845_BEGIN_UPDATE( begin_update )
+{
+ tapatune_state *state = device->machine().driver_data<tapatune_state>();
+
+ // Create the pens
+ get_pens(state);
+
+ return state->m_pens;
+}
+
+
+static MC6845_UPDATE_ROW( update_row )
+{
+ tapatune_state *state = device->machine().driver_data<tapatune_state>();
+ UINT32 *dest = &bitmap.pix32(y);
+ pen_t *pens = (pen_t *)param;
+ offs_t offs = (ma*2 + ra*0x40)*4;
+
+ UINT8 *videoram = reinterpret_cast<UINT8 *>(state->m_videoram.target());
+
+ for (UINT32 x = 0; x < x_count*4; x++)
+ {
+ UINT8 pix = videoram[BYTE_XOR_BE(offs + x)];
+ dest[2*x] = pens[((pix >> 4) & 0x0f)];
+ dest[2*x + 1] = pens[(pix & 0x0f)];
+ }
+}
+
+
WRITE16_MEMBER(tapatune_state::palette_w)
{
//logerror("Palette write: offset = %02x, data = %04x, mask = %04x\n", offset, data, mem_mask );
switch(offset)
{
case 0: // address register
- m_palette_write_address = ((data >> 8) & 0xff) * 3;
+ m_palette_write_addr = ((data >> 8) & 0xff) * 3;
break;
case 1: // palette data
- m_paletteram[m_palette_write_address++] = (data >> 8) & 0xff;
+ m_paletteram[m_palette_write_addr++] = (data >> 8) & 0xff;
break;
case 2: // unknown?
break;
}
}
-READ16_MEMBER(tapatune_state::read_from_z80)
+
+WRITE_LINE_MEMBER(tapatune_state::crtc_vsync)
{
- //logerror("Reading data from Z80: index = %02x, data = %02x\n", m_z80_to_68k_index, m_z80_to_68k_data );
+ m_maincpu->set_input_line(2, state ? HOLD_LINE : CLEAR_LINE);
+}
- switch( offset )
- {
- case 0:
- return ((UINT16)m_z80_to_68k_data << 8) | (m_z80_to_68k_index);
- default:
- return 0;
- }
+
+/*************************************
+ *
+ * 68000 <-> Z80 comms
+ *
+ *************************************/
+
+READ16_MEMBER(tapatune_state::read_from_z80)
+{
+ m_z80_data_available = 0;
+ return ((UINT16)m_z80_to_68k_data << 8) | (m_z80_to_68k_index);
}
+
WRITE16_MEMBER(tapatune_state::write_to_z80)
{
- switch( offset )
+ m_68k_to_z80_index = data & 0xff;
+ m_68k_to_z80_data = (data >> 8) & 0xff;
+
+ if (m_68k_data_available)
{
- case 0:
- //if ( (data >> 8) & 0xff )
- // logerror("Command to Z80: %04x\n", data);
- m_68k_to_z80_index = data & 0xff;
- m_68k_to_z80_data = (data >> 8) & 0xff;
- m_maincpu->set_input_line(3, CLEAR_LINE);
- break;
- case 1:
- break;
+ fatalerror("68000 overwrote old Z80 data");
}
+ m_68k_data_available = 1;
+}
+
+
+/*************************************
+ *
+ * Z80 <-> 68000 comms
+ *
+ *************************************/
+
+WRITE8_MEMBER(tapatune_state::write_index_to_68k)
+{
+ m_z80_to_68k_index = data;
}
-READ16_MEMBER(tapatune_state::irq_ack_r)
+
+WRITE8_MEMBER(tapatune_state::write_data_to_68k)
{
- m_maincpu->set_input_line(2, CLEAR_LINE);
- return 0;
+ m_z80_to_68k_data = data;
+ m_z80_data_available = 1;
+ m_maincpu->set_input_line(1, HOLD_LINE);
+}
+
+
+READ8_MEMBER(tapatune_state::read_index_from_68k)
+{
+ return m_68k_to_z80_index;
}
+
+READ8_MEMBER(tapatune_state::read_data_from_68k)
+{
+ m_68k_data_available = 0;
+
+ return m_68k_to_z80_data;
+}
+
+
+/*************************************
+ *
+ * Memory maps
+ *
+ *************************************/
+
static ADDRESS_MAP_START( tapatune_map, AS_PROGRAM, 16, tapatune_state )
- AM_RANGE(0x000000, 0x2fffff) AM_ROM // program rom and graphics roms
- AM_RANGE(0x300000, 0x31ffff) AM_RAM AM_SHARE("videoram") // hardware video buffer
- AM_RANGE(0x320000, 0x327fff) AM_RAM // workram
- AM_RANGE(0x328000, 0x32ffff) AM_RAM
- AM_RANGE(0x330000, 0x337fff) AM_RAM // ram used as system video buffer
- AM_RANGE(0x338000, 0x33ffff) AM_RAM
+ AM_RANGE(0x000000, 0x2fffff) AM_ROM
+ AM_RANGE(0x300000, 0x31ffff) AM_RAM AM_SHARE("videoram")
+ AM_RANGE(0x320000, 0x33ffff) AM_RAM
AM_RANGE(0x400000, 0x400003) AM_READWRITE(read_from_z80, write_to_z80)
- AM_RANGE(0x400010, 0x400011) AM_READ(irq_ack_r)
+ AM_RANGE(0x400010, 0x400011) AM_NOP // Watchdog?
AM_RANGE(0x600000, 0x600005) AM_WRITE(palette_w)
AM_RANGE(0x800000, 0x800001) AM_DEVWRITE8("crtc", mc6845_device, address_w, 0xff00)
AM_RANGE(0x800002, 0x800003) AM_DEVREADWRITE8("crtc", mc6845_device, register_r, register_w, 0xff00)
ADDRESS_MAP_END
+
+static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, tapatune_state )
+ AM_RANGE(0x0000, 0x7fff) AM_ROM AM_WRITENOP
+ AM_RANGE(0xe000, 0xffff) AM_RAM AM_SHARE("nvram")
+ADDRESS_MAP_END
+
+
+static ADDRESS_MAP_START ( sound_io_map, AS_IO, 8, tapatune_state )
+ ADDRESS_MAP_GLOBAL_MASK(0xff)
+ AM_RANGE(0x00, 0x00) AM_WRITE(bsmt_data_lo_w)
+ AM_RANGE(0x08, 0x08) AM_WRITE(bsmt_data_hi_w)
+ AM_RANGE(0x10, 0x10) AM_WRITE(bsmt_reg_w)
+ AM_RANGE(0x18, 0x18) AM_WRITE(controls_mux)
+ AM_RANGE(0x20, 0x20) AM_READ(sound_irq_clear)
+ AM_RANGE(0x28, 0x28) AM_READ(status_r)
+ AM_RANGE(0x30, 0x30) AM_READ(controls_r)
+ AM_RANGE(0x38, 0x38) AM_READ_PORT("COINS")
+ AM_RANGE(0x60, 0x60) AM_WRITE(write_index_to_68k)
+ AM_RANGE(0x61, 0x61) AM_WRITE(write_data_to_68k)
+ AM_RANGE(0x63, 0x63) AM_WRITE(lamps_w)
+ AM_RANGE(0x68, 0x68) AM_READ(read_index_from_68k)
+ AM_RANGE(0x69, 0x69) AM_READ(read_data_from_68k)
+ AM_RANGE(0x6b, 0x6b) AM_READ(special_r)
+ADDRESS_MAP_END
+
+
+/*************************************
+ *
+ * I/O
+ *
+ *************************************/
+
READ8_MEMBER(tapatune_state::sound_irq_clear)
{
m_soundcpu->set_input_line(0, CLEAR_LINE);
return 0;
}
+
WRITE8_MEMBER(tapatune_state::controls_mux)
{
- //logerror("Controls mux written with %02x\n", data);
+ /*
+ Input multiplexer select and outputs:
+
+ 76543210
+ .......x Mux A
+ ......x. Mux B (/Red LED)
+ .....x.. Mux C (/Yellow LED)
+ ....x... Mux D (/Green LED)
+ ...x.... DOUT1 - High current driver 0
+ ..x..... DOUT2 - High current driver 1
+ .x...... DOUT3 - High current driver 2
+ x....... DOUT4 - Ticket dispenser
+ */
+
m_controls_mux = data;
}
+
READ8_MEMBER(tapatune_state::controls_r)
{
- switch( m_controls_mux )
+ switch (m_controls_mux & 0xf)
{
- case 0x07: return ioport("DSW1")->read();
- case 0x08: return ioport("DSW2")->read();
+ case 0x07: return ioport("SW4")->read();
+ case 0x08: return ioport("SW5")->read();
case 0x09: return ioport("IN0")->read();
- default: return 0xff;
+ default:
+ return 0xff;
}
}
-WRITE8_MEMBER(tapatune_state::write_index_to_68k)
-{
- m_z80_to_68k_index = data;
-}
-WRITE8_MEMBER(tapatune_state::write_data_to_68k)
+READ8_MEMBER(tapatune_state::special_r)
{
- m_z80_to_68k_data = data;
- //logerror("Writing data from Z80: index = %02x, data = %02x\n", m_z80_to_68k_index, m_z80_to_68k_data );
- m_maincpu->set_input_line(3, ASSERT_LINE);
+ // Not sure if this is actually correct
+ if (m_z80_data_available)
+ return m_68k_data_available ? 0x80 : 0;
+ else
+ return ioport("BUTTONS")->read();
}
-READ8_MEMBER(tapatune_state::read_index_from_68k)
-{
- return m_68k_to_z80_index;
-}
-READ8_MEMBER(tapatune_state::read_data_from_68k)
+WRITE8_MEMBER(tapatune_state::lamps_w)
{
- //if ( m_68k_to_z80_data != 0 )
- // logerror("Load command from 68K: %02x %02x\n", m_68k_to_z80_index, m_68k_to_z80_data);
- return m_68k_to_z80_data;
+ /*
+ Button Lamps:
+
+ 7654 3210
+ .... ...x Pink
+ .... ..x. Purple
+ .... .x.. Blue
+ .... x... Dark Green
+ ...x .... Light Green
+ ..x. .... Yellow
+ .x.. .... Orange
+ x... .... Red
+ */
}
-READ8_MEMBER(tapatune_state::bsmt_status_r)
+
+/*************************************
+ *
+ * BSMT communications
+ *
+ *************************************/
+
+READ8_MEMBER(tapatune_state::status_r)
{
- bsmt2000_device *bsmt = machine().device<bsmt2000_device>("bsmt");
- return (bsmt->read_status() << 7) ^ 0x80;
+ return !m_bsmt->read_status() << 7;
}
+
WRITE8_MEMBER(tapatune_state::bsmt_data_lo_w)
{
- m_bsmt_data = (m_bsmt_data & 0xff00) | data;
+ m_bsmt_data_l = data;
}
+
WRITE8_MEMBER(tapatune_state::bsmt_data_hi_w)
{
- m_bsmt_data = (m_bsmt_data & 0x00ff) | (data << 8);
+ m_bsmt_data_h = data;
+
+ if (m_bsmt_reset)
+ {
+ m_bsmt->reset();
+ m_bsmt_reset = false;
+ }
}
+
WRITE8_MEMBER(tapatune_state::bsmt_reg_w)
{
- bsmt2000_device *bsmt = machine().device<bsmt2000_device>("bsmt");
-
-
- //logerror("Writing BSMT reg: %02X data: %04X\n", data, m_bsmt_data);
- bsmt->write_reg(data);
- bsmt->write_data(m_bsmt_data);
+ m_bsmt->write_reg(data);
+ m_bsmt->write_data((m_bsmt_data_h << 8) | m_bsmt_data_l);
}
-static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, tapatune_state )
- AM_RANGE(0x0000, 0x7fff) AM_ROM AM_WRITENOP
- AM_RANGE(0xe000, 0xefff) AM_RAM
- AM_RANGE(0xf000, 0xffff) AM_RAM
-ADDRESS_MAP_END
-
-static ADDRESS_MAP_START ( sound_io_map, AS_IO, 8, tapatune_state )
- ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x00, 0x00) AM_WRITE(bsmt_data_lo_w)
- AM_RANGE(0x08, 0x08) AM_WRITE(bsmt_data_hi_w)
- AM_RANGE(0x10, 0x10) AM_WRITE(bsmt_reg_w)
- AM_RANGE(0x18, 0x18) AM_WRITE(controls_mux)
- AM_RANGE(0x20, 0x20) AM_READ(sound_irq_clear)
- AM_RANGE(0x28, 0x28) AM_READ(bsmt_status_r)
- AM_RANGE(0x30, 0x30) AM_READ(controls_r)
- AM_RANGE(0x38, 0x38) AM_READ_PORT("COINS")
- AM_RANGE(0x60, 0x60) AM_WRITE(write_index_to_68k)
- AM_RANGE(0x61, 0x61) AM_WRITE(write_data_to_68k)
- AM_RANGE(0x63, 0x63) AM_WRITENOP // leds? lamps?
- AM_RANGE(0x68, 0x68) AM_READ(read_index_from_68k)
- AM_RANGE(0x69, 0x69) AM_READ(read_data_from_68k)
- AM_RANGE(0x6b, 0x6b) AM_READ_PORT("BUTTONS")
-ADDRESS_MAP_END
+/*************************************
+ *
+ * Input definitions
+ *
+ *************************************/
static INPUT_PORTS_START( tapatune )
- PORT_START("DSW1")
- PORT_DIPNAME( 0x01, 0x01, "Dispense" )
+ PORT_START("SW4")
+ PORT_DIPNAME( 0x01, 0x01, "Dispense" ) PORT_DIPLOCATION("SW4:1")
PORT_DIPSETTING( 0x01, "Tickets" )
PORT_DIPSETTING( 0x00, "Capsules" )
- PORT_DIPNAME( 0x02, 0x02, "Award per" )
+ PORT_DIPNAME( 0x02, 0x02, "Award per" ) PORT_DIPLOCATION("SW4:2")
PORT_DIPSETTING( 0x02, "Game" )
PORT_DIPSETTING( 0x00, "Tune" )
- PORT_DIPNAME( 0x1c, 0x1c, "Tickets per game/tune" )
+ PORT_DIPNAME( 0x1c, 0x1c, "Tickets/capsules per game/tune" ) PORT_DIPLOCATION("SW4:3,4,5")
PORT_DIPSETTING( 0x1c, "Disabled" )
PORT_DIPSETTING( 0x18, "1" )
PORT_DIPSETTING( 0x14, "2" )
@@ -259,109 +448,68 @@ static INPUT_PORTS_START( tapatune )
PORT_DIPSETTING( 0x08, "5" )
PORT_DIPSETTING( 0x04, "6" )
PORT_DIPSETTING( 0x00, "7" )
- PORT_DIPNAME( 0x60, 0x60, "Tune bonus tickets" )
+ PORT_DIPNAME( 0x60, 0x60, "Tune bonus tickets/capsules" ) PORT_DIPLOCATION("SW4:6,7")
PORT_DIPSETTING( 0x60, "Disabled" )
PORT_DIPSETTING( 0x40, "1" )
PORT_DIPSETTING( 0x20, "3" )
PORT_DIPSETTING( 0x00, "5" )
- PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
+ PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW4:8")
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_START("DSW2")
- PORT_DIPUNKNOWN( 0x01, 0x01 )
- PORT_DIPUNKNOWN( 0x02, 0x02 )
- PORT_DIPUNKNOWN( 0x04, 0x04 )
- PORT_DIPUNKNOWN( 0x08, 0x08 )
- PORT_DIPUNKNOWN( 0x10, 0x10 )
- PORT_DIPUNKNOWN( 0x20, 0x20 )
- PORT_DIPNAME( 0x40, 0x40, DEF_STR( Free_Play ) )
+ PORT_START("SW5")
+ PORT_DIPNAME( 0x07, 0x03, "Tune Timer" ) PORT_DIPLOCATION("SW5:1,2,3")
+ PORT_DIPSETTING( 0x07, "5 secs" )
+ PORT_DIPSETTING( 0x06, "10 secs" )
+ PORT_DIPSETTING( 0x05, "15 secs" )
+ PORT_DIPSETTING( 0x04, "20 secs" )
+ PORT_DIPSETTING( 0x03, "25 secs" )
+ PORT_DIPSETTING( 0x02, "30 secs" )
+ PORT_DIPSETTING( 0x01, "35 secs" )
+ PORT_DIPSETTING( 0x00, "40 secs" )
+ PORT_DIPNAME( 0x18, 0x10, "Bad note penalty" ) PORT_DIPLOCATION("SW5:4,5")
+ PORT_DIPSETTING( 0x18, "0 secs" )
+ PORT_DIPSETTING( 0x10, "1 secs" )
+ PORT_DIPSETTING( 0x08, "5 secs" )
+ PORT_DIPSETTING( 0x00, "10 secs" )
+ PORT_DIPNAME( 0x20, 0x20, "Coins per game" ) PORT_DIPLOCATION("SW5:6")
+ PORT_DIPSETTING( 0x20, "1" )
+ PORT_DIPSETTING( 0x00, "2" )
+ PORT_DIPNAME( 0x40, 0x40, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW5:7")
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPUNKNOWN( 0x80, 0x80 )
-
+ PORT_DIPNAME( 0x80, 0x80, "Burn in Mode" ) PORT_DIPLOCATION("SW5:8")
+ PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_START("IN0")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("SW2") PORT_CODE(KEYCODE_Q)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("SW3") PORT_CODE(KEYCODE_W)
- PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Advance (SW3)") PORT_CODE(KEYCODE_F1)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Service (SW2)")
+ PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("COINS")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(1)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(1)
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r)
PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("BUTTONS")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) // pink
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) // purple
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) // blue
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) // d. green
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON5 ) // l. green
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON6 ) // yellow
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON7 ) // orange
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON8 ) // red
-
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Pink")
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Purple")
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Blue")
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Dark Green")
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Light Green")
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("Yellow")
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("Orange")
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("Red")
INPUT_PORTS_END
-const pen_t* get_pens(tapatune_state *state)
-{
- offs_t i;
-
- for (i = 0; i < 0x100; i++)
- {
- int r, g, b;
-
- r = state->m_paletteram[3 * i + 0];
- g = state->m_paletteram[3 * i + 1];
- b = state->m_paletteram[3 * i + 2];
-
- r = pal6bit(r);
- g = pal6bit(g);
- b = pal6bit(b);
-
- state->m_pens[i] = MAKE_RGB(r, g, b);
- }
-
- return state->m_pens;
-}
-
-static MC6845_BEGIN_UPDATE( begin_update )
-{
- tapatune_state *state = device->machine().driver_data<tapatune_state>();
- /* create the pens */
- get_pens(state);
-
- return state->m_pens;
-}
-
-static MC6845_UPDATE_ROW( update_row )
-{
- tapatune_state *state = device->machine().driver_data<tapatune_state>();
- UINT32 *dest = &bitmap.pix32(y);
- UINT16 x;
-
- pen_t *pens = (pen_t *)param;
-
- offs_t offs = (ma*2 + ra*0x40)*4;
-
- UINT8 *videoram = reinterpret_cast<UINT8 *>(state->m_videoram.target());
- for (x = 0; x < x_count*4; x++)
- {
- UINT8 pix = videoram[BYTE_XOR_BE(offs + x)];
- dest[2*x] = pens[((pix >> 4) & 0x0f)];
- dest[2*x + 1] = pens[(pix & 0x0f)];
- }
-}
-void tapatune_state::video_start()
-{
-}
-
-WRITE_LINE_MEMBER(tapatune_state::crtc_vsync)
-{
- m_maincpu->set_input_line(2, state ? ASSERT_LINE : CLEAR_LINE);
-}
+/*************************************
+ *
+ * 6845 interface
+ *
+ *************************************/
static MC6845_INTERFACE( h46505_intf )
{
@@ -378,31 +526,33 @@ static MC6845_INTERFACE( h46505_intf )
};
-static MACHINE_CONFIG_START( tapatune, tapatune_state )
+/*************************************
+ *
+ * Machine driver
+ *
+ *************************************/
- MCFG_CPU_ADD("maincpu", M68000, 24000000/2 )
+static MACHINE_CONFIG_START( tapatune, tapatune_state )
+ /* basic machine hardware */
+ MCFG_CPU_ADD("maincpu", M68000, XTAL_24MHz / 2)
MCFG_CPU_PROGRAM_MAP(tapatune_map)
- MCFG_CPU_ADD("soundcpu", Z80, 24000000/6 )
+ MCFG_CPU_ADD("soundcpu", Z80, XTAL_24MHz / 4)
MCFG_CPU_PROGRAM_MAP(sound_map)
MCFG_CPU_IO_MAP(sound_io_map)
- MCFG_CPU_PERIODIC_INT_DRIVER(tapatune_state, irq0_line_assert, 183)
+ MCFG_CPU_PERIODIC_INT_DRIVER(tapatune_state, irq0_line_assert, XTAL_24MHz / 4 / 4 / 4096)
+
+ MCFG_QUANTUM_PERFECT_CPU("maincpu")
+
+ MCFG_NVRAM_ADD_0FILL("nvram")
+ MCFG_MC6845_ADD("crtc", H46505, "screen", XTAL_24MHz / 16, h46505_intf)
+ MCFG_TICKET_DISPENSER_ADD("ticket", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_LOW)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
- MCFG_SCREEN_SIZE(32*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
+ MCFG_SCREEN_RAW_PARAMS(XTAL_24MHz / 16 * 5, 500, 0, 320, 250, 0, 240)
MCFG_SCREEN_UPDATE_DEVICE("crtc", h46505_device, screen_update)
- MCFG_PALETTE_LENGTH(16)
-
-
- MCFG_MC6845_ADD("crtc", H46505, "screen", 24000000/16, h46505_intf) /* H46505 */
-
- MCFG_TICKET_DISPENSER_ADD("ticket", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_LOW)
-
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
@@ -411,7 +561,14 @@ static MACHINE_CONFIG_START( tapatune, tapatune_state )
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
MACHINE_CONFIG_END
-ROM_START(tapatune)
+
+/*************************************
+ *
+ * ROM definition(s)
+ *
+ *************************************/
+
+ROM_START( tapatune )
ROM_REGION( 0x300000, "maincpu", 0 )
ROM_LOAD16_BYTE("rom1.u12", 0x000000, 0x80000, CRC(1d3ed3f9) SHA1(a42997dffcd4a3e83a5cec75d5bb0c295bd18a8d) )
ROM_LOAD16_BYTE("rom0.u3", 0x000001, 0x80000, CRC(d76e5dec) SHA1(11b5fa6019e8b891550d37667aa156b113266b9b) )
@@ -423,8 +580,19 @@ ROM_START(tapatune)
ROM_REGION( 0x10000, "soundcpu", 0 )
ROM_LOAD( "rom.u8", 0x0000, 0x10000, CRC(f5c571d7) SHA1(cb5ef3b2bce9a579b54678962082d0e2fc0f1cd9) )
- ROM_REGION(0x1000000, "bsmt", 0 )
- ROM_LOAD( "arom1.u16", 0x000000, 0x80000, CRC(e51696bc) SHA1(b002f8705ad1877f91a860dddb0ae16b2e73dd15) )
+ ROM_REGION( 0x1000000, "bsmt", 0 )
+ ROM_LOAD( "arom1.u16", 0x000000, 0x20000, CRC(e51696bc) SHA1(b002f8705ad1877f91a860dddb0ae16b2e73dd15) )
+ ROM_CONTINUE( 0x040000, 0x20000 )
+ ROM_CONTINUE( 0x080000, 0x20000 )
+ ROM_CONTINUE( 0x0c0000, 0x20000 )
+ // U21 is not populated
ROM_END
-GAME(1994, tapatune, 0, tapatune, tapatune, driver_device, 0, ROT0, "Creative Electronics And Software", "Tap-a-Tune", GAME_NOT_WORKING | GAME_NO_SOUND )
+
+/*************************************
+ *
+ * Game driver(s)
+ *
+ *************************************/
+
+GAME(1994, tapatune, 0, tapatune, tapatune, driver_device, 0, ROT0, "Moloney Manufacturing Inc. / Creative Electronics and Software", "Tap a Tune", 0 )