From fd856ac54dc3f7e1084b285453297dcf4204f015 Mon Sep 17 00:00:00 2001 From: hap Date: Sun, 23 Jul 2023 23:09:50 +0200 Subject: source org: move gameplan/gameplan.cpp to alliedleisure/killcom.cpp, and subdriver trvquest too, move toratora and enigma2 to misc folder, move aztarac to alliedleisure folder --- src/mame/alliedleisure/aleisttl.cpp | 10 +- src/mame/alliedleisure/aztarac.cpp | 433 +++++++++++ src/mame/alliedleisure/clayshoo.cpp | 41 +- src/mame/alliedleisure/killcom.cpp | 1362 +++++++++++++++++++++++++++++++++++ src/mame/alliedleisure/killcom.h | 95 +++ src/mame/alliedleisure/trvquest.cpp | 279 +++++++ src/mame/atari/asteroid.cpp | 2 +- src/mame/gameplan/enigma2.cpp | 829 --------------------- src/mame/gameplan/gameplan.cpp | 1362 ----------------------------------- src/mame/gameplan/gameplan.h | 95 --- src/mame/gameplan/toratora.cpp | 526 -------------- src/mame/gameplan/trvquest.cpp | 274 ------- src/mame/mame.lst | 52 +- src/mame/misc/aztarac.cpp | 435 ----------- src/mame/misc/enigma2.cpp | 829 +++++++++++++++++++++ src/mame/misc/toratora.cpp | 526 ++++++++++++++ 16 files changed, 3574 insertions(+), 3576 deletions(-) create mode 100644 src/mame/alliedleisure/aztarac.cpp create mode 100644 src/mame/alliedleisure/killcom.cpp create mode 100644 src/mame/alliedleisure/killcom.h create mode 100644 src/mame/alliedleisure/trvquest.cpp delete mode 100644 src/mame/gameplan/enigma2.cpp delete mode 100644 src/mame/gameplan/gameplan.cpp delete mode 100644 src/mame/gameplan/gameplan.h delete mode 100644 src/mame/gameplan/toratora.cpp delete mode 100644 src/mame/gameplan/trvquest.cpp delete mode 100644 src/mame/misc/aztarac.cpp create mode 100644 src/mame/misc/enigma2.cpp create mode 100644 src/mame/misc/toratora.cpp diff --git a/src/mame/alliedleisure/aleisttl.cpp b/src/mame/alliedleisure/aleisttl.cpp index 7bc01d96f90..c58e90e9b3e 100644 --- a/src/mame/alliedleisure/aleisttl.cpp +++ b/src/mame/alliedleisure/aleisttl.cpp @@ -41,12 +41,12 @@ namespace { #define V_TOTAL (0x105+1) // 262 #define H_TOTAL (0x1C6+1) // 454 -#define HBSTART (H_TOTAL) -#define HBEND (80) -#define VBSTART (V_TOTAL) -#define VBEND (16) +#define HBSTART (H_TOTAL) +#define HBEND (80) +#define VBSTART (V_TOTAL) +#define VBEND (16) -#define HRES_MULT (1) +#define HRES_MULT (1) // end diff --git a/src/mame/alliedleisure/aztarac.cpp b/src/mame/alliedleisure/aztarac.cpp new file mode 100644 index 00000000000..f980e00c5eb --- /dev/null +++ b/src/mame/alliedleisure/aztarac.cpp @@ -0,0 +1,433 @@ +// license:BSD-3-Clause +// copyright-holders:Mathis Rosenhauer +/*************************************************************************** + + Centuri Aztarac hardware + + driver by Mathis Rosenhauer + Thanks to David Fish for additional hardware information. + + Games supported: + * Aztarac + + Known bugs: + * none at this time + +***************************************************************************/ + +#include "emu.h" + +#include "cpu/m68000/m68000.h" +#include "cpu/z80/z80.h" +#include "machine/gen_latch.h" +#include "machine/watchdog.h" +#include "machine/x2212.h" +#include "sound/ay8910.h" +#include "video/vector.h" + +#include "screen.h" +#include "speaker.h" + + +namespace { + +class aztarac_state : public driver_device +{ +public: + aztarac_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_audiocpu(*this, "audiocpu"), + m_nvram(*this, "nvram"), + m_vector(*this, "vector"), + m_screen(*this, "screen"), + m_soundlatch(*this, "soundlatch"), + m_vectorram(*this, "vectorram"), + m_sticky(*this, "STICKY"), + m_stickz(*this, "STICKZ") + { } + + void aztarac(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + +private: + required_device m_maincpu; + required_device m_audiocpu; + required_device m_nvram; + required_device m_vector; + required_device m_screen; + required_device m_soundlatch; + + required_shared_ptr m_vectorram; + + required_ioport m_sticky; + required_ioport m_stickz; + + uint8_t m_sound_status = 0; + uint32_t m_xcenter = 0; + uint32_t m_ycenter = 0; + + void nvram_store_w(uint16_t data); + uint16_t joystick_r(); + void ubr_w(uint8_t data); + uint8_t sound_r(); + void sound_w(uint8_t data); + uint8_t snd_command_r(); + uint8_t snd_status_r(); + void snd_status_w(uint8_t data); + + void video_interrupt(int state); + INTERRUPT_GEN_MEMBER(snd_timed_irq); + + inline void read_vectorram(int addr, int *x, int *y, int *c); + void main_map(address_map &map); + void sound_map(address_map &map); +}; + + +// audio + +uint8_t aztarac_state::sound_r() +{ + return m_sound_status & 0x01; +} + +void aztarac_state::sound_w(uint8_t data) +{ + m_soundlatch->write(data); + m_sound_status ^= 0x21; + if (m_sound_status & 0x20) + m_audiocpu->set_input_line(0, HOLD_LINE); +} + +uint8_t aztarac_state::snd_command_r() +{ + m_sound_status |= 0x01; + m_sound_status &= ~0x20; + return m_soundlatch->read(); +} + +uint8_t aztarac_state::snd_status_r() +{ + return m_sound_status & ~0x01; +} + +void aztarac_state::snd_status_w(uint8_t data) +{ + m_sound_status &= ~0x10; +} + +INTERRUPT_GEN_MEMBER(aztarac_state::snd_timed_irq) +{ + m_sound_status ^= 0x10; + + if (m_sound_status & 0x10) + device.execute().set_input_line(0,HOLD_LINE); +} + + +// video + +#define AVECTOR(x, y, color, intensity) \ +m_vector->add_point(m_xcenter + ((x) << 16), m_ycenter - ((y) << 16), color, intensity) + + + +void aztarac_state::video_interrupt(int state) +{ + if (state) + m_maincpu->set_input_line(M68K_IRQ_4, ASSERT_LINE); +} + +inline void aztarac_state::read_vectorram(int addr, int *x, int *y, int *c) +{ + *c = m_vectorram[addr] & 0xffff; + *x = m_vectorram[addr + 0x800] & 0x03ff; + *y = m_vectorram[addr + 0x1000] & 0x03ff; + if (*x & 0x200) *x |= 0xfffffc00; + if (*y & 0x200) *y |= 0xfffffc00; +} + +void aztarac_state::ubr_w(uint8_t data) +{ + int x, y, c, intensity, xoffset, yoffset, color; + int defaddr, objaddr = 0, ndefs; + + m_maincpu->set_input_line(M68K_IRQ_4, CLEAR_LINE); + + if (data) // data is the global intensity (always 0xff in Aztarac). + { + m_vector->clear_list(); + + while (1) + { + read_vectorram(objaddr, &xoffset, &yoffset, &c); + objaddr++; + + if (c & 0x4000) + break; + + if ((c & 0x2000) == 0) + { + defaddr = (c >> 1) & 0x7ff; + AVECTOR(xoffset, yoffset, 0, 0); + + read_vectorram(defaddr, &x, &ndefs, &c); + ndefs++; + + if (c & 0xff00) + { + // latch color only once + intensity = (c >> 8); + color = vector_device::color222(c & 0x3f); + while (ndefs--) + { + defaddr++; + read_vectorram(defaddr, &x, &y, &c); + if ((c & 0xff00) == 0) + AVECTOR(x + xoffset, y + yoffset, 0, 0); + else + AVECTOR(x + xoffset, y + yoffset, color, intensity); + } + } + else + { + // latch color for every definition + while (ndefs--) + { + defaddr++; + read_vectorram(defaddr, &x, &y, &c); + color = vector_device::color222(c & 0x3f); + AVECTOR(x + xoffset, y + yoffset, color, c >> 8); + } + } + } + } + } +} + + +void aztarac_state::video_start() +{ + const rectangle &visarea = m_screen->visible_area(); + + int xmin = visarea.min_x; + int ymin = visarea.min_y; + int xmax = visarea.max_x; + int ymax = visarea.max_y; + + m_xcenter = ((xmax + xmin) / 2) << 16; + m_ycenter = ((ymax + ymin) / 2) << 16; +} + + +// machine + +/************************************* + * + * Machine init + * + *************************************/ + +void aztarac_state::machine_start() +{ + save_item(NAME(m_sound_status)); +} + +void aztarac_state::machine_reset() +{ + m_nvram->recall(1); + m_nvram->recall(0); +} + + + +/************************************* + * + * NVRAM handler + * + *************************************/ + +void aztarac_state::nvram_store_w(uint16_t data) +{ + m_nvram->store(1); + m_nvram->store(0); +} + + + +/************************************* + * + * Input ports + * + *************************************/ + +uint16_t aztarac_state::joystick_r() +{ + return (((m_stickz->read() - 0xf) << 8) | + ((m_sticky->read() - 0xf) & 0xff)); +} + + + +/************************************* + * + * Main CPU memory handlers + * + *************************************/ + +void aztarac_state::main_map(address_map &map) +{ + map(0x000000, 0x00bfff).rom(); + map(0x021000, 0x021001).w(FUNC(aztarac_state::nvram_store_w)); + map(0x022000, 0x0221ff).rw(m_nvram, FUNC(x2212_device::read), FUNC(x2212_device::write)).umask16(0x00ff); + map(0x027000, 0x027001).r(FUNC(aztarac_state::joystick_r)); + map(0x027004, 0x027005).portr("INPUTS"); + map(0x027009, 0x027009).rw(FUNC(aztarac_state::sound_r), FUNC(aztarac_state::sound_w)); + map(0x02700c, 0x02700d).portr("DIAL"); + map(0x02700e, 0x02700f).r("watchdog", FUNC(watchdog_timer_device::reset16_r)); + map(0xff8000, 0xffafff).ram().share(m_vectorram); + map(0xffb000, 0xffb001).nopr(); + map(0xffb001, 0xffb001).w(FUNC(aztarac_state::ubr_w)); + map(0xffe000, 0xffffff).ram(); +} + + + +/************************************* + * + * Sound CPU memory handlers + * + *************************************/ + +void aztarac_state::sound_map(address_map &map) +{ + map(0x0000, 0x1fff).rom(); + map(0x8000, 0x87ff).ram(); + map(0x8800, 0x8800).r(FUNC(aztarac_state::snd_command_r)); + map(0x8c00, 0x8c01).rw("ay1", FUNC(ay8910_device::data_r), FUNC(ay8910_device::data_address_w)); + map(0x8c02, 0x8c03).rw("ay2", FUNC(ay8910_device::data_r), FUNC(ay8910_device::data_address_w)); + map(0x8c04, 0x8c05).rw("ay3", FUNC(ay8910_device::data_r), FUNC(ay8910_device::data_address_w)); + map(0x8c06, 0x8c07).rw("ay4", FUNC(ay8910_device::data_r), FUNC(ay8910_device::data_address_w)); + map(0x9000, 0x9000).rw(FUNC(aztarac_state::snd_status_r), FUNC(aztarac_state::snd_status_w)); +} + + + +/************************************* + * + * Port definitions + * + *************************************/ + +static INPUT_PORTS_START( aztarac ) + PORT_START("STICKZ") + PORT_BIT( 0x1f, 0xf, IPT_AD_STICK_Z ) PORT_MINMAX(0, 0x1e) PORT_SENSITIVITY(100) PORT_KEYDELTA(1) + + PORT_START("STICKY") + PORT_BIT( 0x1f, 0xf, IPT_AD_STICK_Y ) PORT_MINMAX(0, 0x1e) PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_REVERSE + + PORT_START("DIAL") + PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X) PORT_REVERSE + + PORT_START("INPUTS") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_LOW) +INPUT_PORTS_END + + + +/************************************* + * + * Machine drivers + * + *************************************/ + +void aztarac_state::aztarac(machine_config &config) +{ + // basic machine hardware + m68000_device &maincpu(M68000(config, m_maincpu, 16_MHz_XTAL / 2)); + maincpu.set_addrmap(AS_PROGRAM, &aztarac_state::main_map); + maincpu.set_cpu_space(AS_PROGRAM); + + Z80(config, m_audiocpu, 16_MHz_XTAL / 8); + m_audiocpu->set_addrmap(AS_PROGRAM, &aztarac_state::sound_map); + m_audiocpu->set_periodic_int(FUNC(aztarac_state::snd_timed_irq), attotime::from_hz(100)); + + X2212(config, m_nvram); + + WATCHDOG_TIMER(config, "watchdog"); + + // video hardware + VECTOR(config, m_vector, 0); + SCREEN(config, m_screen, SCREEN_TYPE_VECTOR); + m_screen->set_refresh_hz(40); + m_screen->set_size(400, 300); + m_screen->set_visarea(0, 1024-1, 0, 768-1); + m_screen->set_screen_update("vector", FUNC(vector_device::screen_update)); + m_screen->screen_vblank().set(FUNC(aztarac_state::video_interrupt)); + + // sound hardware + SPEAKER(config, "mono").front_center(); + + GENERIC_LATCH_8(config, m_soundlatch); + + AY8910(config, "ay1", 16_MHz_XTAL / 8).add_route(ALL_OUTPUTS, "mono", 0.15); + AY8910(config, "ay2", 16_MHz_XTAL / 8).add_route(ALL_OUTPUTS, "mono", 0.15); + AY8910(config, "ay3", 16_MHz_XTAL / 8).add_route(ALL_OUTPUTS, "mono", 0.15); + AY8910(config, "ay4", 16_MHz_XTAL / 8).add_route(ALL_OUTPUTS, "mono", 0.15); +} + + + +/************************************* + * + * ROM definitions + * + *************************************/ + +ROM_START( aztarac ) + ROM_REGION( 0xc000, "maincpu", 0 ) + ROM_LOAD16_BYTE( "6.l8", 0x000000, 0x001000, CRC(25f8da18) SHA1(e8179ba3683e39c8225b549ead74c8af2d0a0b3e) ) + ROM_LOAD16_BYTE( "0.n8", 0x000001, 0x001000, CRC(04e20626) SHA1(2b6a04992037257830df2c01a6da748fb4449f79) ) + ROM_LOAD16_BYTE( "7.l7", 0x002000, 0x001000, CRC(230e244c) SHA1(42283a368144acf2aad2ef390e312e0951c3ea64) ) + ROM_LOAD16_BYTE( "1.n7", 0x002001, 0x001000, CRC(37b12697) SHA1(da288b077902e3205600a021c3fac5730f9fb832) ) + ROM_LOAD16_BYTE( "8.l6", 0x004000, 0x001000, CRC(1293fb9d) SHA1(5a8d512372fd38f1a55f990f5c3eb51833c463d8) ) + ROM_LOAD16_BYTE( "2.n6", 0x004001, 0x001000, CRC(712c206a) SHA1(eb29f161189c14d84896502940e3ab6cc3bd1cd0) ) + ROM_LOAD16_BYTE( "9.l5", 0x006000, 0x001000, CRC(743a6501) SHA1(da83a8f756466bcd94d4b0cc28a1a1858e9532f3) ) + ROM_LOAD16_BYTE( "3.n5", 0x006001, 0x001000, CRC(a65cbf99) SHA1(dd06f98c0989604bd4ac6317e545e1fcf6722e75) ) + ROM_LOAD16_BYTE( "a.l4", 0x008000, 0x001000, CRC(9cf1b0a1) SHA1(dd644026f49d8430c0b4cf4c750dc33c013c19fc) ) + ROM_LOAD16_BYTE( "4.n4", 0x008001, 0x001000, CRC(5f0080d5) SHA1(fb1303f9a02067faea2ac4d523051c416de9cf35) ) + ROM_LOAD16_BYTE( "b.l3", 0x00a000, 0x001000, CRC(8cc7f7fa) SHA1(fefb9a4fdd63878bc5d8138e3e8456cb6638425a) ) + ROM_LOAD16_BYTE( "5.n3", 0x00a001, 0x001000, CRC(40452376) SHA1(1d058b7ecd2bbff3393950aab9215b262908475b) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) + ROM_LOAD( "c.j4", 0x0000, 0x1000, CRC(e897dfcd) SHA1(750df3d08512d8098a13ec62677831efa164c126) ) + ROM_LOAD( "d.j3", 0x1000, 0x1000, CRC(4016de77) SHA1(7232ec003f1b9d3623d762f3270108a1d1837846) ) + + ROM_REGION( 0x3000, "proms", 0 ) // not hooked up + ROM_LOAD( "l5.l5", 0x0000, 0x0020, CRC(317fb438) SHA1(3130e1dbde06228707ba46ae85d8df8cc8f32b67) ) + ROM_LOAD( "k8.k8", 0x0000, 0x1000, CRC(596ad8d9) SHA1(7e2d2d3e02712911ef5ef55d1df5740f6ec28bcb) ) + ROM_LOAD( "k9.k9", 0x0000, 0x1000, CRC(b8544823) SHA1(78ff1fcb7e640929765533592015cfccef690179) ) +ROM_END + +} // anonymous namespace + + +/************************************* + * + * Game drivers + * + *************************************/ + +GAME( 1983, aztarac, 0, aztarac, aztarac, aztarac_state, empty_init, ROT0, "Centuri", "Aztarac", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/alliedleisure/clayshoo.cpp b/src/mame/alliedleisure/clayshoo.cpp index 1ad73e09ecd..94e984523a9 100644 --- a/src/mame/alliedleisure/clayshoo.cpp +++ b/src/mame/alliedleisure/clayshoo.cpp @@ -28,15 +28,22 @@ namespace { class clayshoo_state : public driver_device { public: - clayshoo_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_videoram(*this, "videoram"), - m_maincpu(*this, "maincpu") + clayshoo_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_videoram(*this, "videoram") { } void clayshoo(machine_config &config); protected: + virtual void machine_start() override; + virtual void machine_reset() override; + +private: + required_device m_maincpu; + required_shared_ptr m_videoram; + void analog_reset_w(uint8_t data); uint8_t analog_r(); void input_port_select_w(uint8_t data); @@ -46,21 +53,12 @@ protected: uint8_t difficulty_input_port_r(int bit); void create_analog_timers(); - virtual void machine_start() override; - virtual void machine_reset() override; void main_io_map(address_map &map); void main_map(address_map &map); -private: - /* memory pointers */ - required_shared_ptr m_videoram; - - /* misc */ emu_timer *m_analog_timer_1 = nullptr, *m_analog_timer_2 = nullptr; uint8_t m_input_port_select = 0; uint8_t m_analog_port_val = 0; - - required_device m_maincpu; }; @@ -81,7 +79,7 @@ uint8_t clayshoo_state::difficulty_input_port_r( int bit ) uint8_t ret = 0; /* read fake port and remap the buttons to 2 bits */ - uint8_t raw = ioport("FAKE")->read(); + uint8_t raw = ioport("FAKE")->read(); if (raw & (1 << (bit + 1))) ret = 0x03; /* expert */ @@ -100,13 +98,12 @@ uint8_t clayshoo_state::input_port_r() switch (m_input_port_select) { - case 0x01: ret = ioport("IN0")->read(); break; - case 0x02: ret = ioport("IN1")->read(); break; - case 0x04: ret = (ioport("IN2")->read() & 0xf0) | difficulty_input_port_r(0) | - (difficulty_input_port_r(3) << 2); break; - case 0x08: ret = ioport("IN3")->read(); break; + case 0x01: ret = ioport("IN0")->read(); break; + case 0x02: ret = ioport("IN1")->read(); break; + case 0x04: ret = (ioport("IN2")->read() & 0xf0) | difficulty_input_port_r(0) | (difficulty_input_port_r(3) << 2); break; + case 0x08: ret = ioport("IN3")->read(); break; case 0x10: - case 0x20: break; /* these two are not really used */ + case 0x20: break; /* these two are not really used */ default: logerror("Unexpected port read: %02X\n", m_input_port_select); } return ret; @@ -139,7 +136,6 @@ void clayshoo_state::analog_reset_w(uint8_t data) /* reset the analog value, and start the two times that will fire off in a short period proportional to the position of the analog control and set the appropriate bit. */ - m_analog_port_val = 0xff; m_analog_timer_1->adjust(compute_duration(m_maincpu.target(), ioport("AN1")->read()), 0x02); @@ -190,12 +186,11 @@ uint32_t clayshoo_state::screen_update_clayshoo(screen_device &screen, bitmap_rg for (offs = 0; offs < m_videoram.bytes(); offs++) { - int i; uint8_t x = offs << 3; uint8_t y = ~(offs >> 5); uint8_t data = m_videoram[offs]; - for (i = 0; i < 8; i++) + for (int i = 0; i < 8; i++) { pen_t pen = (data & 0x80) ? rgb_t::white() : rgb_t::black(); bitmap.pix(y, x) = pen; diff --git a/src/mame/alliedleisure/killcom.cpp b/src/mame/alliedleisure/killcom.cpp new file mode 100644 index 00000000000..c7c1345839e --- /dev/null +++ b/src/mame/alliedleisure/killcom.cpp @@ -0,0 +1,1362 @@ +// license:BSD-3-Clause +// copyright-holders:Chris Moore +/*************************************************************************** + +Killer Comet hardware, by Centuri (previously known as Allied Leisure) +driver by Chris Moore + +Killer Comet memory map + +MAIN CPU: + +Address Dir Data Name Description +---------------- --- -------- --------- ----------------------- +00000-xxxxxxxxxx R/W xxxxxxxx RAM can be either 256 bytes (2x2101) or 1kB (2x2114) +00001----------- n.c. +00010----------- n.c. +00011----------- n.c. +00100-------xxxx R/W xxxxxxxx VIA 1 6522 for video interface +00101-------xxxx R/W xxxxxxxx VIA 2 6522 for I/O interface +00110-------xxxx R/W xxxxxxxx VIA 3 6522 for interface with audio CPU +00111----------- n.c. +01-------------- n.c. +10-------------- n.c. +11000xxxxxxxxxxx R xxxxxxxx ROM E2 program ROM +11001xxxxxxxxxxx R xxxxxxxx ROM F2 program ROM +11010xxxxxxxxxxx R xxxxxxxx ROM G2 program ROM +11011xxxxxxxxxxx R xxxxxxxx ROM J2 program ROM +11100xxxxxxxxxxx R xxxxxxxx ROM J1 program ROM +11101xxxxxxxxxxx R xxxxxxxx ROM G1 program ROM +11110xxxxxxxxxxx R xxxxxxxx ROM F1 program ROM +11111xxxxxxxxxxx R xxxxxxxx ROM E1 program ROM + + +SOUND CPU: + +Address Dir Data Name Description +---------------- --- -------- --------- ----------------------- +000-0----xxxxxxx R/W xxxxxxxx VIA 5 6532 internal RAM +000-1------xxxxx R/W xxxxxxxx VIA 5 6532 for interface with main CPU +001------------- n.c. +010------------- n.c. +011------------- n.c. +100------------- n.c. +101-----------xx R/W xxxxxxxx PSG 1 AY-3-8910 +110------------- n.c. +111--xxxxxxxxxxx R xxxxxxxx ROM E1 + + +Notes: +- There are two dip switch banks connected to the 8910 ports. They are only + used for testing. + +- Megatack's test mode reports the same fire buttons as Killer Comet, but this + is wrong: there is only one fire button, not three. + +- Megatack's actual name which displays proudly on the cover and everywhere in + the manual as "MEGATTACK" + +- Checked and verified DIPs from manuals and service mode for: + Challenger + Kaos + Killer Comet + Megattack + Pot Of Gold (Leprechaun) + +- Leprechaun and Pirate Treasure were made for the Moppet Video arcade series + (Enter-Tech arcade cabs aimed at younger children). That's why the games are + so easy. + + +TODO: +- The board has, instead of a watchdog, a timed reset that has to be disabled + on startup. The disable line is tied to CA2 of VIA2, but I don't see writes + to that pin in the log. Missing support in machine/6522via.cpp? +- Investigate and document the 8910 dip switches +- Fix the input ports of Kaos +- Some of the games do unmapped reads all over the place, probably just bad + programming. One of these is piratetr, and it will lock up eventually when + reading from VIA1. It's possible to fix with a simple wire mod/pcb cut trace, + like done with piratetr_main_map. Let's assume they did something like that. + +BTANB: +- BGM stops in leprechn when you touch a tree + +****************************************************************************/ + +#include "emu.h" +#include "killcom.h" + +#include "cpu/m6502/m6502.h" +#include "speaker.h" + + + +/************************************* + * + * Initialization + * + *************************************/ + +void killcom_state::machine_start() +{ + // register for save states + save_item(NAME(m_current_port)); + save_item(NAME(m_audio_reset)); + save_item(NAME(m_audio_trigger)); +} + +void killcom_state::machine_reset() +{ + m_video_x = 0; + m_video_y = 0; + m_video_previous = 0; +} + + +void killcom_state::video_start() +{ + m_videoram = make_unique_clear(0x10000); + save_pointer(NAME(m_videoram), 0x10000); + + m_hblank_timer[0] = timer_alloc(FUNC(killcom_state::hblank_callback), this); + m_hblank_timer[0]->adjust(attotime::zero, 0, m_screen->scan_period()); + + m_hblank_timer[1] = timer_alloc(FUNC(killcom_state::hblank_callback), this); + m_hblank_timer[1]->adjust(256 * m_screen->pixel_period(), 1, m_screen->scan_period()); + + // register for save states + save_item(NAME(m_video_x)); + save_item(NAME(m_video_y)); + save_item(NAME(m_video_command)); + save_item(NAME(m_video_command_trigger)); + save_item(NAME(m_video_data)); + save_item(NAME(m_video_previous)); +} + + + +/************************************* + * + * Screen update + * + *************************************/ + +uint32_t killcom_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + for (int y = cliprect.min_y; y <= cliprect.max_y; y++) + { + for (int x = cliprect.min_x; x <= cliprect.max_x; x++) + { + bitmap.pix(y, x) = m_videoram[y << 8 | x] & 0x07; + } + } + + return 0; +} + + + +/************************************* + * + * VIA 1 - video + * + *************************************/ + +TIMER_CALLBACK_MEMBER(killcom_state::hblank_callback) +{ + // screen HBLANK is tied to VIA1 PB6 + m_via[0]->write_pb6(param); +} + + +void killcom_state::video_data_w(uint8_t data) +{ + m_video_data = data; +} + + +void killcom_state::video_command_w(uint8_t data) +{ + m_video_command = data & 0x07; +} + + +uint8_t killcom_state::video_status_r() +{ + // video busy flags on the upper bits + return 0xff; +} + + +uint8_t killcom_state::leprechn_videoram_r() +{ + return (video_status_r() & 0xf8) | m_video_previous; +} + + +void killcom_state::video_command_trigger_w(int state) +{ + if (state && !m_video_command_trigger) + { + switch (m_video_command) + { + // draw pixel + case 0: + // auto-adjust X? + if (m_video_data & 0x10) + { + if (m_video_data & 0x40) + m_video_x = m_video_x - 1; + else + m_video_x = m_video_x + 1; + } + + // auto-adjust Y? + if (m_video_data & 0x20) + { + if (m_video_data & 0x80) + m_video_y = m_video_y - 1; + else + m_video_y = m_video_y + 1; + } + + m_video_previous = m_videoram[m_video_y << 8 | m_video_x]; + + m_screen->update_now(); + m_videoram[m_video_y << 8 | m_video_x] = m_video_data & 0x07; + + break; + + // load X register + case 1: + m_video_x = m_video_data; + break; + + // load Y register + case 2: + m_video_y = m_video_data; + break; + + // clear screen + case 3: + m_screen->update_now(); + memset(m_videoram.get(), m_video_data & 0x07, 0x10000); + break; + + // N/C + default: + break; + } + } + + m_video_command_trigger = state; +} + + + +/************************************* + * + * VIA 2 - I/O + * + *************************************/ + +void killcom_state::io_select_w(uint8_t data) +{ + m_current_port = data; +} + + +uint8_t killcom_state::io_port_r() +{ + uint8_t data = 0xff; + + // COL A-D (E,F are N/C) + for (int i = 0; i < 4; i++) + if (BIT(m_current_port, i)) + data &= m_inputs[i]->read(); + + // DS A,B + for (int i = 0; i < 2; i++) + if (BIT(m_current_port, i ^ 7)) + data &= m_dsw[i]->read(); + + return data; +} + + +void killcom_state::coin_w(int state) +{ + machine().bookkeeping().coin_counter_w(0, ~state & 1); +} + + + +/************************************* + * + * VIA 3 - audio + * + *************************************/ + +void killcom_state::audio_reset_sync_w(int param) +{ + if (param && !m_audio_reset) + { + m_ay->reset(); + m_riot->reset(); + } + + m_audio_reset = param; + m_audiocpu->set_input_line(INPUT_LINE_RESET, param ? CLEAR_LINE : ASSERT_LINE); +} + + +void killcom_state::audio_reset_w(int state) +{ + machine().scheduler().synchronize(timer_expired_delegate(FUNC(killcom_state::audio_reset_sync_w), this), state); +} + + +void killcom_state::audio_trigger_sync_w(int param) +{ + m_audio_trigger = param; + m_riot->pa_w<7>(param); +} + + +void killcom_state::audio_trigger_w(int state) +{ + machine().scheduler().synchronize(timer_expired_delegate(FUNC(killcom_state::audio_trigger_sync_w), this), state); +} + + + +/************************************* + * + * RIOT - audio + * + *************************************/ + +uint8_t killcom_state::soundlatch_r() +{ + return m_audio_trigger << 7 | (m_soundlatch->read() & 0x7f); +} + + + +/************************************* + * + * Main CPU memory handlers + * + *************************************/ + +void killcom_state::killcom_main_map(address_map &map) +{ + map(0x0000, 0x03ff).mirror(0x0400).ram(); + map(0x2000, 0x200f).mirror(0x07f0).m(m_via[0], FUNC(via6522_device::map)); // VIA 1 + map(0x2800, 0x280f).mirror(0x07f0).m(m_via[1], FUNC(via6522_device::map)); // VIA 2 + map(0x3000, 0x300f).mirror(0x07f0).m(m_via[2], FUNC(via6522_device::map)); // VIA 3 + map(0x8000, 0xffff).rom(); +} + +void killcom_state::piratetr_main_map(address_map &map) +{ + killcom_main_map(map); + map(0x2010, 0x201f).mirror(0x07e0).unmaprw(); // A4, see TODO +} + + + +/************************************* + * + * Audio CPU memory handlers + * + *************************************/ + +void killcom_state::killcom_audio_map(address_map &map) +{ + map(0x0000, 0x007f).mirror(0x1780).m(m_riot, FUNC(mos6532_new_device::ram_map)); + map(0x0800, 0x081f).mirror(0x17e0).m(m_riot, FUNC(mos6532_new_device::io_map)); + map(0xa000, 0xa000).mirror(0x1ffc).w(m_ay, FUNC(ay8910_device::address_w)); + map(0xa001, 0xa001).mirror(0x1ffc).r(m_ay, FUNC(ay8910_device::data_r)); + map(0xa002, 0xa002).mirror(0x1ffc).w(m_ay, FUNC(ay8910_device::data_w)); + map(0xe000, 0xe7ff).mirror(0x1800).rom(); +} + +void killcom_state::leprechn_audio_map(address_map &map) +{ + killcom_audio_map(map); + map(0xe000, 0xefff).mirror(0x1000).rom(); +} + + + +/************************************* + * + * Input ports + * + *************************************/ + +static INPUT_PORTS_START( killcom ) + PORT_START("IN0") /* COL. A - from "TEST NO.7 - status locator - coin-door" */ + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Do Tests") PORT_CODE(KEYCODE_F1) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Select Test") PORT_CODE(KEYCODE_F2) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN3 ) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN2 ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 ) + + PORT_START("IN1") /* COL. B - from "TEST NO.7 - status locator - start sws." */ + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) + + PORT_START("IN2") /* COL. C - from "TEST NO.8 - status locator - player no.1" */ + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON4 ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) + + PORT_START("IN3") /* COL. D - from "TEST NO.8 - status locator - player no.2" */ + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_COCKTAIL + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_COCKTAIL + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_COCKTAIL + + PORT_START("DSW0") /* DSW A - from "TEST NO.6 - dip switch A" */ + PORT_DIPNAME( 0x03, 0x03, "Coinage P1/P2" ) PORT_DIPLOCATION("SW1:1,2") + PORT_DIPSETTING( 0x03, "1 Credit/2 Credits" ) + PORT_DIPSETTING( 0x02, "2 Credits/3 Credits" ) + PORT_DIPSETTING( 0x01, "2 Credits/4 Credits" ) + PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) + PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:3") + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:4") + PORT_DIPSETTING( 0x00, "4" ) + PORT_DIPSETTING( 0x08, "5" ) + PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "SW1:5" ) + PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW1:6" ) + PORT_DIPNAME( 0xc0, 0xc0, "Reaction" ) PORT_DIPLOCATION("SW1:7,8") + PORT_DIPSETTING( 0xc0, "Slowest" ) + PORT_DIPSETTING( 0x80, "Slow" ) + PORT_DIPSETTING( 0x40, "Fast" ) + PORT_DIPSETTING( 0x00, "Fastest" ) + + PORT_START("DSW1") /* DSW B - from "TEST NO.6 - dip switch B" */ + PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW2:1" ) + PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "SW2:2" ) + PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW2:3" ) + PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW2:4" ) + PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "SW2:5" ) + PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW2:6" ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:7") + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:8") + PORT_DIPSETTING( 0x80, DEF_STR( Upright ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) + + PORT_START("DSW2") /* audio board DSW A */ + PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW3:1" ) + PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "SW3:2" ) + PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW3:3" ) + PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW3:4" ) + PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "SW3:5" ) + PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW3:6" ) + PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW3:7" ) + PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW3:8" ) + + PORT_START("DSW3") /* audio board DSW B */ + PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW4:1" ) + PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "SW4:2" ) + PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW4:3" ) + PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW4:4" ) + PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "SW4:5" ) + PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW4:6" ) + PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW4:7" ) + PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW4:8" ) +INPUT_PORTS_END + + +static INPUT_PORTS_START( megatack ) + PORT_START("IN0") /* COL. A - from "TEST NO.7 - status locator - coin-door" */ + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Do Tests") PORT_CODE(KEYCODE_F1) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Select Test") PORT_CODE(KEYCODE_F2) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN3 ) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN2 ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 ) + + PORT_START("IN1") /* COL. B - from "TEST NO.7 - status locator - start sws." */ + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) + + PORT_START("IN2") /* COL. C - from "TEST NO.8 - status locator - player no.1" */ + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("IN3") /* COL. D - from "TEST NO.8 - status locator - player no.2" */ + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("DSW0") /* DSW A - from "TEST NO.6 - dip switch A" */ + PORT_DIPNAME( 0x03, 0x03, "Coinage P1/P2" ) PORT_DIPLOCATION("SW1:1,2") + PORT_DIPSETTING( 0x03, "1 Credit/2 Credits" ) + PORT_DIPSETTING( 0x02, "2 Credits/3 Credits" ) + PORT_DIPSETTING( 0x01, "2 Credits/4 Credits" ) + PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) + PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW1:3" ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:4") + PORT_DIPSETTING( 0x08, "3" ) + PORT_DIPSETTING( 0x00, "4" ) + PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "SW1:5" ) + PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW1:6" ) + PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW1:7" ) + PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW1:8" ) + + PORT_START("DSW1") /* DSW B - from "TEST NO.6 - dip switch B" */ + PORT_DIPNAME( 0x07, 0x07, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:1,2,3") + PORT_DIPSETTING( 0x07, "20000" ) + PORT_DIPSETTING( 0x06, "30000" ) + PORT_DIPSETTING( 0x05, "40000" ) + PORT_DIPSETTING( 0x04, "50000" ) + PORT_DIPSETTING( 0x03, "60000" ) + PORT_DIPSETTING( 0x02, "70000" ) + PORT_DIPSETTING( 0x01, "80000" ) + PORT_DIPSETTING( 0x00, "90000" ) + PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW2:4" ) + PORT_DIPNAME( 0x10, 0x10, "Monitor View" ) PORT_DIPLOCATION("SW2:5") + PORT_DIPSETTING( 0x10, "Direct" ) + PORT_DIPSETTING( 0x00, "Mirror" ) + PORT_DIPNAME( 0x20, 0x20, "Monitor Orientation" ) PORT_DIPLOCATION("SW2:6") + PORT_DIPSETTING( 0x20, "Horizontal" ) + PORT_DIPSETTING( 0x00, "Vertical" ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:7") + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:8") + PORT_DIPSETTING( 0x80, DEF_STR( Upright ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) + + PORT_START("DSW2") /* audio board DSW A */ + PORT_DIPNAME( 0x01, 0x00, "Sound Test A 0" ) PORT_DIPLOCATION("SW3:1") + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x00, "Sound Test A 1" ) PORT_DIPLOCATION("SW3:2") + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x00, "Sound Test A 2" ) PORT_DIPLOCATION("SW3:3") + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x00, "Sound Test A 3" ) PORT_DIPLOCATION("SW3:4") + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x00, "Sound Test A 4" ) PORT_DIPLOCATION("SW3:5") + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x00, "Sound Test A 5" ) PORT_DIPLOCATION("SW3:6") + PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x00, "Sound Test A 6" ) PORT_DIPLOCATION("SW3:7") + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, "Sound Test Enable" ) PORT_DIPLOCATION("SW3:8") + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + + PORT_START("DSW3") /* audio board DSW B */ + PORT_DIPNAME( 0x01, 0x00, "Sound Test B 0" ) PORT_DIPLOCATION("SW4:1") + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x00, "Sound Test B 1" ) PORT_DIPLOCATION("SW4:2") + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x00, "Sound Test B 2" ) PORT_DIPLOCATION("SW4:3") + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x00, "Sound Test B 3" ) PORT_DIPLOCATION("SW4:4") + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x00, "Sound Test B 4" ) PORT_DIPLOCATION("SW4:5") + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x00, "Sound Test B 5" ) PORT_DIPLOCATION("SW4:6") + PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x00, "Sound Test B 6" ) PORT_DIPLOCATION("SW4:7") + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x00, "Sound Test B 7" ) PORT_DIPLOCATION("SW4:8") + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) +INPUT_PORTS_END + + +static INPUT_PORTS_START( challeng ) + PORT_START("IN0") /* COL. A - from "TEST NO.7 - status locator - coin-door" */ + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Do Tests") PORT_CODE(KEYCODE_F1) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Select Test") PORT_CODE(KEYCODE_F2) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN3 ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) + + PORT_START("IN1") /* COL. B - from "TEST NO.7 - status locator - start sws." */ + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) + + PORT_START("IN2") /* COL. C - from "TEST NO.8 - status locator - player no.1" */ + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("IN3") /* COL. D - from "TEST NO.8 - status locator - player no.2" */ + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("DSW0") /* DSW A - from "TEST NO.6 - dip switch A" */ + PORT_DIPNAME( 0x03, 0x03, "Coinage P1/P2" ) PORT_DIPLOCATION("SW1:1,2") + PORT_DIPSETTING( 0x03, "1 Credit/2 Credits" ) + PORT_DIPSETTING( 0x02, "2 Credits/3 Credits" ) + PORT_DIPSETTING( 0x01, "2 Credits/4 Credits" ) + PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) + PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW1:3" ) + PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW1:4" ) + PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "SW1:5" ) + PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW1:6" ) + PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:7,8") + PORT_DIPSETTING( 0xc0, "3" ) + PORT_DIPSETTING( 0x80, "4" ) + PORT_DIPSETTING( 0x40, "5" ) + PORT_DIPSETTING( 0x00, "6" ) + + // Manual states information which differs from actual settings for DSW1 + // Switches 4 & 5 are factory settings and remain in the OFF position. + // Switches 6 & 7 are factory settings which remain in the ON position. + PORT_START("DSW1") /* DSW B - from "TEST NO.6 - dip switch B" */ + PORT_DIPNAME( 0x07, 0x07, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:1,2,3") + PORT_DIPSETTING( 0x01, "20000" ) + PORT_DIPSETTING( 0x00, "30000" ) + PORT_DIPSETTING( 0x07, "40000" ) + PORT_DIPSETTING( 0x06, "50000" ) + PORT_DIPSETTING( 0x05, "60000" ) + PORT_DIPSETTING( 0x04, "70000" ) + PORT_DIPSETTING( 0x03, "80000" ) + PORT_DIPSETTING( 0x02, "90000" ) + PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW2:4" ) + PORT_DIPNAME( 0x10, 0x10, "Monitor View" ) PORT_DIPLOCATION("SW2:5") + PORT_DIPSETTING( 0x10, "Direct" ) + PORT_DIPSETTING( 0x00, "Mirror" ) + PORT_DIPNAME( 0x20, 0x00, "Monitor Orientation" ) PORT_DIPLOCATION("SW2:6") + PORT_DIPSETTING( 0x20, "Horizontal" ) + PORT_DIPSETTING( 0x00, "Vertical" ) + PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:7") + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:8") + PORT_DIPSETTING( 0x80, DEF_STR( Upright ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) + + PORT_START("DSW2") /* audio board DSW A */ + PORT_DIPNAME( 0x01, 0x00, "Sound Test A 0" ) PORT_DIPLOCATION("SW3:1") + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x00, "Sound Test A 1" ) PORT_DIPLOCATION("SW3:2") + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x00, "Sound Test A 2" ) PORT_DIPLOCATION("SW3:3") + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x00, "Sound Test A 3" ) PORT_DIPLOCATION("SW3:4") + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x00, "Sound Test A 4" ) PORT_DIPLOCATION("SW3:5") + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x00, "Sound Test A 5" ) PORT_DIPLOCATION("SW3:6") + PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x00, "Sound Test A 6" ) PORT_DIPLOCATION("SW3:7") + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, "Sound Test Enable" ) PORT_DIPLOCATION("SW3:8") + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + + PORT_START("DSW3") /* audio board DSW B */ + PORT_DIPNAME( 0x01, 0x00, "Sound Test B 0" ) PORT_DIPLOCATION("SW4:1") + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x00, "Sound Test B 1" ) PORT_DIPLOCATION("SW4:2") + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x04, 0x00, "Sound Test B 2" ) PORT_DIPLOCATION("SW4:3") + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x00, "Sound Test B 3" ) PORT_DIPLOCATION("SW4:4") + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x00, "Sound Test B 4" ) PORT_DIPLOCATION("SW4:5") + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x00, "Sound Test B 5" ) PORT_DIPLOCATION("SW4:6") + PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x00, "Sound Test B 6" ) PORT_DIPLOCATION("SW4:7") + PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x00, "Sound Test B 7" ) PORT_DIPLOCATION("SW4:8") + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) +INPUT_PORTS_END + + +static INPUT_PORTS_START( kaos ) + PORT_START("IN0") /* COL. A - from "TEST NO.7 - status locator - coin-door" */ + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Do Tests") PORT_CODE(KEYCODE_F1) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Select Test") PORT_CODE(KEYCODE_F2) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN3 ) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN2 ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 ) + + PORT_START("IN1") /* COL. B - from "TEST NO.7 - status locator - start sws." */ + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) + + PORT_START("IN2") /* COL. C - from "TEST NO.8 - status locator - player no.1" */ + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("IN3") /* COL. D - from "TEST NO.8 - status locator - player no.2" */ + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("DSW0") + PORT_DIPNAME( 0x0f, 0x0e, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2,3,4") + PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x0e, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x0d, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x0c, DEF_STR( 1C_3C ) ) + PORT_DIPSETTING( 0x0b, DEF_STR( 1C_4C ) ) + PORT_DIPSETTING( 0x0a, DEF_STR( 1C_5C ) ) + PORT_DIPSETTING( 0x09, DEF_STR( 1C_6C ) ) + PORT_DIPSETTING( 0x08, DEF_STR( 1C_7C ) ) + PORT_DIPSETTING( 0x07, DEF_STR( 1C_8C ) ) + PORT_DIPSETTING( 0x06, DEF_STR( 1C_9C ) ) + PORT_DIPSETTING( 0x05, "1 Coin/10 Credits" ) + PORT_DIPSETTING( 0x04, "1 Coin/11 Credits" ) + PORT_DIPSETTING( 0x03, "1 Coin/12 Credits" ) + PORT_DIPSETTING( 0x02, "1 Coin/13 Credits" ) + PORT_DIPSETTING( 0x01, "1 Coin/14 Credits" ) + PORT_DIPSETTING( 0x0f, DEF_STR( 2C_3C ) ) + PORT_DIPNAME( 0x10, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:5") + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x60, 0x60, "Max Credits" ) PORT_DIPLOCATION("SW1:6,7") + PORT_DIPSETTING( 0x60, "10" ) + PORT_DIPSETTING( 0x40, "20" ) + PORT_DIPSETTING( 0x20, "30" ) + PORT_DIPSETTING( 0x00, "40" ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW1:8") + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + + PORT_START("DSW1") + PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:1") + PORT_DIPSETTING( 0x01, "3" ) + PORT_DIPSETTING( 0x00, "4" ) + PORT_DIPNAME( 0x02, 0x00, "Speed" ) PORT_DIPLOCATION("SW2:2") + PORT_DIPSETTING( 0x00, "Slow" ) + PORT_DIPSETTING( 0x02, "Fast" ) + PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:3,4") + PORT_DIPSETTING( 0x0c, "No Bonus" ) + PORT_DIPSETTING( 0x08, "10k" ) + PORT_DIPSETTING( 0x04, "10k 30k" ) + PORT_DIPSETTING( 0x00, "10k 30k 60k" ) + PORT_DIPNAME( 0x10, 0x10, "Number of $" ) PORT_DIPLOCATION("SW2:5") + PORT_DIPSETTING( 0x10, "8" ) + PORT_DIPSETTING( 0x00, "12" ) + PORT_DIPNAME( 0x20, 0x00, "Bonus erg" ) PORT_DIPLOCATION("SW2:6") + PORT_DIPSETTING( 0x20, "Every other screen" ) + PORT_DIPSETTING( 0x00, "Every screen" ) + PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW2:7" ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:8") + PORT_DIPSETTING( 0x80, DEF_STR( Upright ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) + + PORT_START("DSW2") /* audio board DSW A */ + PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW3:1" ) + PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "SW3:2" ) + PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW3:3" ) + PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW3:4" ) + PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "SW3:5" ) + PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW3:6" ) + PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW3:7" ) + PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW3:8" ) + + PORT_START("DSW3") /* audio board DSW B */ + PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW4:1" ) + PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "SW4:2" ) + PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW4:3" ) + PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW4:4" ) + PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "SW4:5" ) + PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW4:6" ) + PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW4:7" ) + PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW4:8" ) +INPUT_PORTS_END + + +static INPUT_PORTS_START( leprechn ) + PORT_START("IN0") /* COL. A - from "TEST NO.7 - status locator - coin-door" */ + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Do Tests") PORT_CODE(KEYCODE_F1) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Select Test") PORT_CODE(KEYCODE_F2) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN2 ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 ) + + PORT_START("IN1") /* COL. B - from "TEST NO.7 - status locator - start sws." */ + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) + + PORT_START("IN2") /* COL. C - from "TEST NO.8 - status locator - player no.1" */ + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) + + PORT_START("IN3") /* COL. D - from "TEST NO.8 - status locator - player no.2" */ + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_COCKTAIL + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_COCKTAIL + + PORT_START("DSW0") /* DSW A - from "TEST NO.6 - dip switch A" */ + PORT_DIPNAME( 0x09, 0x09, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:1,4") + PORT_DIPSETTING( 0x09, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x01, DEF_STR( 1C_5C ) ) + PORT_DIPSETTING( 0x08, DEF_STR( 1C_6C ) ) + PORT_DIPSETTING( 0x00, DEF_STR( 1C_7C ) ) + PORT_DIPNAME( 0x22, 0x22, "Max Credits" ) PORT_DIPLOCATION("SW1:2,6") + PORT_DIPSETTING( 0x22, "10" ) + PORT_DIPSETTING( 0x20, "20" ) + PORT_DIPSETTING( 0x02, "30" ) + PORT_DIPSETTING( 0x00, "40" ) + PORT_DIPNAME( 0x04, 0x04, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:3") + PORT_DIPSETTING( 0x04, DEF_STR( Upright ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW1:5") + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:7,8") + PORT_DIPSETTING( 0xc0, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x80, DEF_STR( 1C_3C ) ) + PORT_DIPSETTING( 0x00, DEF_STR( 1C_4C ) ) + + PORT_START("DSW1") /* DSW B - from "TEST NO.6 - dip switch B" */ + PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:1") + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "SW2:2" ) + PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW2:3" ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:4") + PORT_DIPSETTING( 0x08, "3" ) + PORT_DIPSETTING( 0x00, "4" ) + PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "SW2:5" ) + PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW2:6" ) + PORT_DIPNAME( 0xc0, 0x40, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:7,8") + PORT_DIPSETTING( 0x40, "30000" ) + PORT_DIPSETTING( 0x80, "60000" ) + PORT_DIPSETTING( 0x00, "90000" ) + PORT_DIPSETTING( 0xc0, DEF_STR( None ) ) + + PORT_START("DSW2") /* audio board DSW A */ + PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW3:1" ) + PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "SW3:2" ) + PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW3:3" ) + PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW3:4" ) + PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "SW3:5" ) + PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW3:6" ) + PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW3:7" ) + PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW3:8" ) + + PORT_START("DSW3") /* audio board DSW B */ + PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW4:1" ) + PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "SW4:2" ) + PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW4:3" ) + PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW4:4" ) + PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "SW4:5" ) + PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW4:6" ) + PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW4:7" ) + PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW4:8" ) +INPUT_PORTS_END + +static INPUT_PORTS_START( leprechna ) + PORT_INCLUDE(leprechn) + + PORT_MODIFY("DSW1") + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:4") + PORT_DIPSETTING( 0x08, "4" ) + PORT_DIPSETTING( 0x00, "5" ) +INPUT_PORTS_END + + +static INPUT_PORTS_START( piratetr ) + PORT_START("IN0") /* COL. A - from "TEST NO.7 - status locator - coin-door" */ + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Do Tests") PORT_CODE(KEYCODE_F1) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Select Test") PORT_CODE(KEYCODE_F2) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN2 ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 ) + + PORT_START("IN1") /* COL. B - from "TEST NO.7 - status locator - start sws." */ + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) + + PORT_START("IN2") /* COL. C - from "TEST NO.8 - status locator - player no.1" */ + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) + + PORT_START("IN3") /* COL. D - from "TEST NO.8 - status locator - player no.2" */ + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_COCKTAIL + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_COCKTAIL + + PORT_START("DSW0") /* DSW A - from "TEST NO.6 - dip switch A" */ + PORT_DIPNAME( 0x09, 0x09, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:1,4") + PORT_DIPSETTING( 0x09, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x01, DEF_STR( 1C_5C ) ) + PORT_DIPSETTING( 0x08, DEF_STR( 1C_6C ) ) + PORT_DIPSETTING( 0x00, DEF_STR( 1C_7C ) ) + PORT_DIPNAME( 0x22, 0x22, "Max Credits" ) PORT_DIPLOCATION("SW1:2,6") + PORT_DIPSETTING( 0x22, "10" ) + PORT_DIPSETTING( 0x20, "20" ) + PORT_DIPSETTING( 0x02, "30" ) + PORT_DIPSETTING( 0x00, "40" ) + PORT_DIPNAME( 0x04, 0x04, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:3") + PORT_DIPSETTING( 0x04, DEF_STR( Upright ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW1:5") + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:7,8") + PORT_DIPSETTING( 0xc0, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x80, DEF_STR( 1C_3C ) ) + PORT_DIPSETTING( 0x00, DEF_STR( 1C_4C ) ) + + PORT_START("DSW1") /* DSW B - from "TEST NO.6 - dip switch B" */ + PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:1") + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x02, "Stringing Check" ) PORT_DIPLOCATION("SW2:2") + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW2:3" ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:4") + PORT_DIPSETTING( 0x08, "3" ) + PORT_DIPSETTING( 0x00, "4" ) + PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "SW2:5" ) + PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW2:6" ) + PORT_DIPNAME( 0xc0, 0x40, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:7,8") + PORT_DIPSETTING( 0x40, "30000" ) + PORT_DIPSETTING( 0x80, "60000" ) + PORT_DIPSETTING( 0x00, "90000" ) + PORT_DIPSETTING( 0xc0, DEF_STR( None ) ) + + PORT_START("DSW2") /* audio board DSW A */ + PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW3:1" ) + PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "SW3:2" ) + PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW3:3" ) + PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW3:4" ) + PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "SW3:5" ) + PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW3:6" ) + PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW3:7" ) + PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW3:8" ) + + PORT_START("DSW3") /* audio board DSW B */ + PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW4:1" ) + PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "SW4:2" ) + PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW4:3" ) + PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW4:4" ) + PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "SW4:5" ) + PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW4:6" ) + PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW4:7" ) + PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW4:8" ) +INPUT_PORTS_END + + + +/************************************* + * + * Machine configs + * + *************************************/ + +void killcom_state::killcom_video(machine_config &config) +{ + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_raw(11.6688_MHz_XTAL / 2, 352, 0, 256, 280, 0, 256); + m_screen->set_screen_update(FUNC(killcom_state::screen_update)); + m_screen->screen_vblank().set(m_via[0], FUNC(via6522_device::write_ca1)); // VBLANK is connected to CA1 + m_screen->set_palette("palette"); + + PALETTE(config, "palette", palette_device::RGB_3BIT); +} + +void killcom_state::killcom(machine_config &config) +{ + // basic machine hardware + M6502(config, m_maincpu, 3.579545_MHz_XTAL / 4); + m_maincpu->set_addrmap(AS_PROGRAM, &killcom_state::killcom_main_map); + + input_merger_device &main_irqs(INPUT_MERGER_ANY_HIGH(config, "main_irqs")); + main_irqs.output_handler().set_inputline(m_maincpu, 0); + + M6502(config, m_audiocpu, 3.579545_MHz_XTAL / 4); + m_audiocpu->set_addrmap(AS_PROGRAM, &killcom_state::killcom_audio_map); + + GENERIC_LATCH_8(config, m_soundlatch); + + MOS6532_NEW(config, m_riot, 3.579545_MHz_XTAL / 4); + m_riot->pa_rd_callback().set(FUNC(killcom_state::soundlatch_r)); + m_riot->pb_wr_callback().set(m_via[2], FUNC(via6522_device::write_pb)); + m_riot->irq_wr_callback().set_inputline(m_audiocpu, 0); + + // via + MOS6522(config, m_via[0], 3.579545_MHz_XTAL / 4); + m_via[0]->writepa_handler().set(FUNC(killcom_state::video_data_w)); + m_via[0]->writepb_handler().set(FUNC(killcom_state::video_command_w)); + m_via[0]->readpb_handler().set(FUNC(killcom_state::video_status_r)); + m_via[0]->ca2_handler().set(FUNC(killcom_state::video_command_trigger_w)); + m_via[0]->irq_handler().set("main_irqs", FUNC(input_merger_device::in_w<0>)); + + MOS6522(config, m_via[1], 3.579545_MHz_XTAL / 4); + m_via[1]->readpa_handler().set(FUNC(killcom_state::io_port_r)); + m_via[1]->writepb_handler().set(FUNC(killcom_state::io_select_w)); + m_via[1]->cb2_handler().set(FUNC(killcom_state::coin_w)); + m_via[1]->irq_handler().set("main_irqs", FUNC(input_merger_device::in_w<1>)); + + MOS6522(config, m_via[2], 3.579545_MHz_XTAL / 4); + m_via[2]->writepa_handler().set(m_soundlatch, FUNC(generic_latch_8_device::write)); + m_via[2]->ca2_handler().set(FUNC(killcom_state::audio_trigger_w)); + m_via[2]->cb2_handler().set(FUNC(killcom_state::audio_reset_w)); + m_via[2]->irq_handler().set("main_irqs", FUNC(input_merger_device::in_w<2>)); + + // video hardware + killcom_video(config); + + // audio hardware + SPEAKER(config, "mono").front_center(); + + AY8910(config, m_ay, 3.579545_MHz_XTAL / 2); + m_ay->port_a_read_callback().set_ioport("DSW2"); + m_ay->port_b_read_callback().set_ioport("DSW3"); + m_ay->add_route(ALL_OUTPUTS, "mono", 0.33); +} + +void killcom_state::leprechn(machine_config &config) +{ + killcom(config); + + // basic machine hardware + m_maincpu->set_clock(4_MHz_XTAL / 4); + m_via[0]->set_clock(4_MHz_XTAL / 4); + m_via[1]->set_clock(4_MHz_XTAL / 4); + m_via[2]->set_clock(4_MHz_XTAL / 4); + + m_audiocpu->set_clock(4_MHz_XTAL / 4); + m_riot->set_clock(4_MHz_XTAL / 4); + m_ay->set_clock(4_MHz_XTAL / 2); + + m_audiocpu->set_addrmap(AS_PROGRAM, &killcom_state::leprechn_audio_map); + + // via + m_via[0]->readpb_handler().set(FUNC(killcom_state::leprechn_videoram_r)); + m_via[0]->writepb_handler().set(FUNC(killcom_state::video_command_w)).rshift(3); +} + +void killcom_state::piratetr(machine_config &config) +{ + leprechn(config); + m_maincpu->set_addrmap(AS_PROGRAM, &killcom_state::piratetr_main_map); +} + + + +/************************************* + * + * ROM defintions + * + *************************************/ + +ROM_START( killcom ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "killcom.e2", 0xc000, 0x0800, CRC(a01cbb9a) SHA1(a8769243adbdddedfda5f3c8f054e9281a0eca46) ) + ROM_LOAD( "killcom.f2", 0xc800, 0x0800, CRC(bb3b4a93) SHA1(a0ea61ac30a4d191db619b7bfb697914e1500036) ) + ROM_LOAD( "killcom.g2", 0xd000, 0x0800, CRC(86ec68b2) SHA1(a09238190d61684d943ce0acda25eb901d2580ac) ) + ROM_LOAD( "killcom.j2", 0xd800, 0x0800, CRC(28d8c6a1) SHA1(d9003410a651221e608c0dd20d4c9c60c3b0febc) ) + ROM_LOAD( "killcom.j1", 0xe000, 0x0800, CRC(33ef5ac5) SHA1(42f839ad295d3df457ced7886a0003eff7e6c4ae) ) + ROM_LOAD( "killcom.g1", 0xe800, 0x0800, CRC(49cb13e2) SHA1(635e4665042ddd9b8c0b9f275d4bcc6830dc6a98) ) + ROM_LOAD( "killcom.f1", 0xf000, 0x0800, CRC(ef652762) SHA1(414714e5a3f83916bd3ae54afe2cb2271ee9008b) ) + ROM_LOAD( "killcom.e1", 0xf800, 0x0800, CRC(bc19dcb7) SHA1(eb983d2df010c12cb3ffb584fceafa54a4e956b3) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) + ROM_LOAD( "killsnd.e1", 0xe000, 0x0800, CRC(77d4890d) SHA1(a3ed7e11dec5d404f022c521256ff50aa6940d3c) ) +ROM_END + +ROM_START( megatack ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "megattac.e2", 0xc000, 0x0800, CRC(33fa5104) SHA1(15693eb540563e03502b53ed8a83366e395ca529) ) + ROM_LOAD( "megattac.f2", 0xc800, 0x0800, CRC(af5e96b1) SHA1(5f6ab47c12d051f6af446b08f3cd459fbd2c13bf) ) + ROM_LOAD( "megattac.g2", 0xd000, 0x0800, CRC(670103ea) SHA1(e11f01e8843ed918c6ea5dda75319dc95105d345) ) + ROM_LOAD( "megattac.j2", 0xd800, 0x0800, CRC(4573b798) SHA1(388db11ab114b3575fe26ed65bbf49174021939a) ) + ROM_LOAD( "megattac.j1", 0xe000, 0x0800, CRC(3b1d01a1) SHA1(30bbf51885b1e510b8d21cdd82244a455c5dada0) ) + ROM_LOAD( "megattac.g1", 0xe800, 0x0800, CRC(eed75ef4) SHA1(7c02337344f2716d2f2771229f7dee7b651eeb95) ) + ROM_LOAD( "megattac.f1", 0xf000, 0x0800, CRC(c93a8ed4) SHA1(c87e2f13f2cc00055f4941c272a3126b165a6252) ) + ROM_LOAD( "megattac.e1", 0xf800, 0x0800, CRC(d9996b9f) SHA1(e71d65b695000fdfd5fd1ce9ae39c0cb0b61669e) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) + ROM_LOAD( "megatsnd.e1", 0xe000, 0x0800, CRC(0c186bdb) SHA1(233af9481a3979971f2d5aa75ec8df4333aa5e0d) ) +ROM_END + +ROM_START( megatacka ) // original Centuri PCB + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "meg-e2.e2", 0xc000, 0x0800, CRC(9664c7b1) SHA1(356e7f5f3b2a9b829fac53e7bf9193278b4de2ed) ) + ROM_LOAD( "meg-f2.f2", 0xc800, 0x0800, CRC(67c42523) SHA1(f9fc88cdea05a2d0e89e3ba9b545bf3476b37d2d) ) + ROM_LOAD( "meg-g2.g2", 0xd000, 0x0800, CRC(71f36604) SHA1(043988126343b6224e8e1d6c0dbba6b6b08fe493) ) + ROM_LOAD( "meg-j2.j2", 0xd800, 0x0800, CRC(4ddcc145) SHA1(3a6d42a58c388eaaf6561351fa98936d98975e0b) ) + ROM_LOAD( "meg-j1.j1", 0xe000, 0x0800, CRC(911d5d9a) SHA1(92bfe0f69a6e563363df59ebee745d7b3cfc0141) ) + ROM_LOAD( "meg-g1.g1", 0xe800, 0x0800, CRC(22a51c9b) SHA1(556e09216ed85eaf3870f85515c273c7eb1ab13a) ) + ROM_LOAD( "meg-f1.f1", 0xf000, 0x0800, CRC(2ffa51ac) SHA1(7c5d8295c5e71a9918a02d203139b024bd3bf8f4) ) + ROM_LOAD( "meg-e1.e1", 0xf800, 0x0800, CRC(01dbe4ad) SHA1(af72778ae112f24a92fb3007bb456331c3896b50) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) + ROM_LOAD( "megatsnd.e1", 0xe000, 0x0800, CRC(0c186bdb) SHA1(233af9481a3979971f2d5aa75ec8df4333aa5e0d) ) // missing for this board, using the one from the parent +ROM_END + +ROM_START( challeng ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "chall.6", 0xa000, 0x1000, CRC(b30fe7f5) SHA1(ce93a57d626f90d31ddedbc35135f70758949dfa) ) + ROM_LOAD( "chall.5", 0xb000, 0x1000, CRC(34c6a88e) SHA1(250577e2c8eb1d3a78cac679310ec38924ac1fe0) ) + ROM_LOAD( "chall.4", 0xc000, 0x1000, CRC(0ddc18ef) SHA1(9f1aa27c71d7e7533bddf7de420c06fb0058cf60) ) + ROM_LOAD( "chall.3", 0xd000, 0x1000, CRC(6ce03312) SHA1(69c047f501f327f568fe4ad1274168f9dda1ca70) ) + ROM_LOAD( "chall.2", 0xe000, 0x1000, CRC(948912ad) SHA1(e79738ab94501f858f4d5f218787267523611e92) ) + ROM_LOAD( "chall.1", 0xf000, 0x1000, CRC(7c71a9dc) SHA1(2530ada6390fb46c44bf7bf2636910ee54786493) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) + ROM_LOAD( "chall.snd", 0xe000, 0x0800, CRC(1b2bffd2) SHA1(36ceb5abbc92a17576c375019f1c5900320398f9) ) +ROM_END + +ROM_START( kaos ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "kaosab.g2", 0x9000, 0x0800, CRC(b23d858f) SHA1(e31fa657ace34130211a0b9fc0d115fd89bb20dd) ) + ROM_CONTINUE( 0xd000, 0x0800 ) + ROM_LOAD( "kaosab.j2", 0x9800, 0x0800, CRC(4861e5dc) SHA1(96ca0b8625af3897bd4a50a45ea964715f9e4973) ) + ROM_CONTINUE( 0xd800, 0x0800 ) + ROM_LOAD( "kaosab.j1", 0xa000, 0x0800, CRC(e055db3f) SHA1(099176629723c1a9bdc59f440339b2e8c38c3261) ) + ROM_CONTINUE( 0xe000, 0x0800 ) + ROM_LOAD( "kaosab.g1", 0xa800, 0x0800, CRC(35d7c467) SHA1(6d5bfd29ff7b96fed4b24c899ddd380e47e52bc5) ) + ROM_CONTINUE( 0xe800, 0x0800 ) + ROM_LOAD( "kaosab.f1", 0xb000, 0x0800, CRC(995b9260) SHA1(580896aa8b6f0618dc532a12d0795b0d03f7cadd) ) + ROM_CONTINUE( 0xf000, 0x0800 ) + ROM_LOAD( "kaosab.e1", 0xb800, 0x0800, CRC(3da5202a) SHA1(6b5aaf44377415763aa0895c64765a4b82086f25) ) + ROM_CONTINUE( 0xf800, 0x0800 ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) + ROM_LOAD( "kaossnd.e1", 0xe000, 0x0800, CRC(ab23d52a) SHA1(505f3e4a56e78a3913010f5484891f01c9831480) ) +ROM_END + +ROM_START( leprechn ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "1.u13", 0x8000, 0x1000, CRC(2c4a46ca) SHA1(28a157c1514bc9f27cc27baddb83cf1a1887f3d1) ) + ROM_LOAD( "2.u14", 0x9000, 0x1000, CRC(6ed26b3e) SHA1(4ee5d09200d9e8f94ae29751c8ee838faa268f15) ) + ROM_LOAD( "3.u15", 0xa000, 0x1000, CRC(b5f79fd8) SHA1(271f7b55ecda5bb99f40687264256b82649e2141) ) + ROM_LOAD( "4.u16", 0xb000, 0x1000, CRC(6c12a065) SHA1(2acae6a5b94cbdcc550cee88a7be9254fdae908c) ) + ROM_LOAD( "5.u17", 0xc000, 0x1000, CRC(21ddb539) SHA1(b4dd0a1916adc076fa6084c315459fcb2522161e) ) + ROM_LOAD( "6.u18", 0xd000, 0x1000, CRC(03c34dce) SHA1(6dff202e1a3d0643050f3287f6b5906613d56511) ) + ROM_LOAD( "7.u19", 0xe000, 0x1000, CRC(7e06d56d) SHA1(5f68f2047969d803b752a4cd02e0e0af916c8358) ) + ROM_LOAD( "8.u20", 0xf000, 0x1000, CRC(097ede60) SHA1(5509c41167c066fa4e7f4f4bd1ce9cd00773a82c) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) + ROM_LOAD( "lepsound", 0xe000, 0x1000, CRC(6651e294) SHA1(ce2875fc4df61a30d51d3bf2153864b562601151) ) +ROM_END + +ROM_START( leprechna ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "lep1.u13", 0x8000, 0x1000, CRC(2c4a46ca) SHA1(28a157c1514bc9f27cc27baddb83cf1a1887f3d1) ) + ROM_LOAD( "lep2.u14", 0x9000, 0x1000, CRC(6ed26b3e) SHA1(4ee5d09200d9e8f94ae29751c8ee838faa268f15) ) + ROM_LOAD( "lep3.u15", 0xa000, 0x1000, CRC(a2eaa016) SHA1(be992ee787766137fd800ec59529c98ef2e6991e) ) + ROM_LOAD( "lep4.u16", 0xb000, 0x1000, CRC(6c12a065) SHA1(2acae6a5b94cbdcc550cee88a7be9254fdae908c) ) + ROM_LOAD( "lep5.u17", 0xc000, 0x1000, CRC(21ddb539) SHA1(b4dd0a1916adc076fa6084c315459fcb2522161e) ) + ROM_LOAD( "lep6.u18", 0xd000, 0x1000, CRC(03c34dce) SHA1(6dff202e1a3d0643050f3287f6b5906613d56511) ) + ROM_LOAD( "lep7.u19", 0xe000, 0x1000, CRC(7e06d56d) SHA1(5f68f2047969d803b752a4cd02e0e0af916c8358) ) + ROM_LOAD( "lep8.u20", 0xf000, 0x1000, CRC(097ede60) SHA1(5509c41167c066fa4e7f4f4bd1ce9cd00773a82c) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) + ROM_LOAD( "lepsound", 0xe000, 0x1000, CRC(6651e294) SHA1(ce2875fc4df61a30d51d3bf2153864b562601151) ) +ROM_END + +ROM_START( potogold ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "pog.pg1", 0x8000, 0x1000, CRC(9f1dbda6) SHA1(baf20e9a0793c0f1529396f95a820bd1f9431465) ) + ROM_LOAD( "pog.pg2", 0x9000, 0x1000, CRC(a70e3811) SHA1(7ee306dc7d75a7d3fd497870ec92bef9d86535e9) ) + ROM_LOAD( "pog.pg3", 0xa000, 0x1000, CRC(81cfb516) SHA1(12732707e2a51ec39563f2d1e898cc567ab688f0) ) + ROM_LOAD( "pog.pg4", 0xb000, 0x1000, CRC(d61b1f33) SHA1(da024c0776214b8b5a3e49401c4110e86a1bead1) ) + ROM_LOAD( "pog.pg5", 0xc000, 0x1000, CRC(eee7597e) SHA1(9b5cd293580c5d212f8bf39286070280d55e4cb3) ) + ROM_LOAD( "pog.pg6", 0xd000, 0x1000, CRC(25e682bc) SHA1(085d2d553ec10f2f830918df3a7fb8e8c1e5d18c) ) + ROM_LOAD( "pog.pg7", 0xe000, 0x1000, CRC(84399f54) SHA1(c90ba3e3120adda2785ab5abd309e0a703d39f8b) ) + ROM_LOAD( "pog.pg8", 0xf000, 0x1000, CRC(9e995a1a) SHA1(5c525e6c161d9d7d646857b27cecfbf8e0943480) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) + ROM_LOAD( "pog.snd", 0xe000, 0x1000, CRC(ec61f0a4) SHA1(26944ecc3e7413259928c8b0a74b2260e67d2c4e) ) +ROM_END + +ROM_START( piratetr ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "1.u13", 0x8000, 0x1000, CRC(4433bb61) SHA1(eee0d7f356118f8595dd7533541db744a63a8176) ) + ROM_LOAD( "2.u14", 0x9000, 0x1000, CRC(9bdc4b77) SHA1(ebaab8b3024efd3d0b76647085d441ca204ad5d5) ) + ROM_LOAD( "3.u15", 0xa000, 0x1000, CRC(ebced718) SHA1(3a2f4385347f14093360cfa595922254c9badf1a) ) + ROM_LOAD( "4.u16", 0xb000, 0x1000, CRC(f494e657) SHA1(83a31849de8f4f70d7547199f229079f491ddc61) ) + ROM_LOAD( "5.u17", 0xc000, 0x1000, CRC(2789d68e) SHA1(af8f334ce4938cd75143b729c97cfbefd68c9e13) ) + ROM_LOAD( "6.u18", 0xd000, 0x1000, CRC(d91abb3a) SHA1(11170e69686c2a1f2dc31d41516f44b612f99bad) ) + ROM_LOAD( "7.u19", 0xe000, 0x1000, CRC(6e8808c4) SHA1(d1f76fd37d8f78552a9d53467073cc9a571d96ce) ) + ROM_LOAD( "8.u20", 0xf000, 0x1000, CRC(2802d626) SHA1(b0db688500076ee73e0001c00089a8d552c6f607) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) + ROM_LOAD( "s.u31", 0xe000, 0x1000, CRC(2fe86a11) SHA1(aaafe411b9cb3d0221cc2af73d34ad8bb74f8327) ) +ROM_END + + + +/************************************* + * + * Game drivers + * + *************************************/ + +// YEAR NAME PARENT MACHINE INPUT CLASS INIT SCREEN COMPANY FULLNAME FLAGS +GAME( 1980, killcom, 0, killcom, killcom, killcom_state, empty_init, ROT0, "Centuri (Game Plan license)", "Killer Comet", MACHINE_SUPPORTS_SAVE ) +GAME( 1980, megatack, 0, killcom, megatack, killcom_state, empty_init, ROT0, "Centuri (Game Plan license)", "Megatack (set 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1980, megatacka, megatack, killcom, megatack, killcom_state, empty_init, ROT0, "Centuri (Game Plan license)", "Megatack (set 2)", MACHINE_SUPPORTS_SAVE ) +GAME( 1981, challeng, 0, killcom, challeng, killcom_state, empty_init, ROT270, "Centuri", "Challenger", MACHINE_SUPPORTS_SAVE ) // cab is vertical + +GAME( 1981, kaos, 0, killcom, kaos, killcom_state, empty_init, ROT270, "Pacific Polytechnical Corp. (Game Plan license)", "Kaos", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, leprechn, 0, leprechn, leprechn, killcom_state, empty_init, ROT0, "Pacific Polytechnical Corp.", "Leprechaun (set 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, leprechna, leprechn, leprechn, leprechna, killcom_state, empty_init, ROT0, "Pacific Polytechnical Corp. (Tong Electronic license)", "Leprechaun (set 2)", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, potogold, leprechn, leprechn, leprechn, killcom_state, empty_init, ROT0, "Pacific Polytechnical Corp. (Game Plan license)", "Pot of Gold", MACHINE_SUPPORTS_SAVE ) +GAME( 1982, piratetr, 0, piratetr, piratetr, killcom_state, empty_init, ROT0, "Pacific Polytechnical Corp. (Tong Electronic license)", "Pirate Treasure", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/alliedleisure/killcom.h b/src/mame/alliedleisure/killcom.h new file mode 100644 index 00000000000..81f4343fdac --- /dev/null +++ b/src/mame/alliedleisure/killcom.h @@ -0,0 +1,95 @@ +// license:BSD-3-Clause +// copyright-holders:Chris Moore +/*************************************************************************** + + Killer Comet driver + +***************************************************************************/ + +#include "machine/6522via.h" +#include "machine/gen_latch.h" +#include "machine/input_merger.h" +#include "machine/mos6530n.h" +#include "sound/ay8910.h" + +#include "emupal.h" +#include "screen.h" + + +class killcom_state : public driver_device +{ +public: + killcom_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_via(*this, "via%u", 1U), + m_screen(*this, "screen"), + m_inputs(*this, "IN%u", 0U), + m_dsw(*this, "DSW%u", 0U), + m_audiocpu(*this, "audiocpu"), + m_riot(*this, "riot"), + m_ay(*this, "ay"), + m_soundlatch(*this, "soundlatch") + { } + + void killcom(machine_config &config); + void killcom_video(machine_config &config); + void leprechn(machine_config &config); + void piratetr(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + + required_device m_maincpu; + required_device_array m_via; + required_device m_screen; + optional_ioport_array<4> m_inputs; + optional_ioport_array<4> m_dsw; + + void coin_w(int state); + void video_data_w(uint8_t data); + void video_command_w(uint8_t data); + uint8_t video_status_r(); + void video_command_trigger_w(int state); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + +private: + /* machine state */ + uint8_t m_current_port = 0; + uint8_t m_audio_reset = 0; + uint8_t m_audio_trigger = 0; + + /* video state */ + std::unique_ptr m_videoram; + uint8_t m_video_x = 0; + uint8_t m_video_y = 0; + uint8_t m_video_command = 0; + uint8_t m_video_command_trigger = 0; + uint8_t m_video_data = 0; + uint8_t m_video_previous = 0; + emu_timer *m_hblank_timer[2]; + + /* devices */ + optional_device m_audiocpu; + optional_device m_riot; + optional_device m_ay; + optional_device m_soundlatch; + + void io_select_w(uint8_t data); + uint8_t io_port_r(); + void audio_reset_w(int state); + void audio_reset_sync_w(int param); + void audio_trigger_w(int state); + void audio_trigger_sync_w(int param); + uint8_t soundlatch_r(); + + TIMER_CALLBACK_MEMBER(hblank_callback); + uint8_t leprechn_videoram_r(); + + void killcom_main_map(address_map &map); + void killcom_audio_map(address_map &map); + void leprechn_audio_map(address_map &map); + void piratetr_main_map(address_map &map); +}; diff --git a/src/mame/alliedleisure/trvquest.cpp b/src/mame/alliedleisure/trvquest.cpp new file mode 100644 index 00000000000..13296be198d --- /dev/null +++ b/src/mame/alliedleisure/trvquest.cpp @@ -0,0 +1,279 @@ +// license:BSD-3-Clause +// copyright-holders:Pierpaolo Prazzoli +/* + +Trivia Quest +Sunn/Techstar 1984 + + driver by Pierpaolo Prazzoli + +This is a subdriver of killcom.cpp, the hardware is similar to it, +video blitter hardware is identical. + +TODO: +- button response is too rapid? PORT_IMPULSE on coin is also a bad sign + + +PCB notes: + +CPU: 6809 +Three SY6522 - for flashing lighted buttons? + +Sound: Two AY-3-8910 + +Forty eight! MK4027 4K Rams + +Six 6116 Rams with battery backup + +Two Crystals: +11.6688 Mhz +6 Mhz + +Two 8 position DIPS + +rom3 through rom7 - Main pcb PRG. + +roma through romi - Sub pcb Questions. + +The main pcb had empty sockets for rom0, rom1 and rom2. +This pcb has been tested and works as is. + +*/ + +#include "emu.h" +#include "killcom.h" + +#include "cpu/m6809/m6809.h" +#include "machine/6522via.h" +#include "machine/nvram.h" +#include "sound/ay8910.h" + +#include "speaker.h" + + +namespace { + +class trvquest_state : public killcom_state +{ +public: + trvquest_state(const machine_config &mconfig, device_type type, const char *tag) : + killcom_state(mconfig, type, tag), + m_bank(*this, "bank") + { } + + void trvquest(machine_config &config); + +protected: + virtual void machine_start() override; + +private: + required_memory_bank m_bank; + + void bankswitch_w(uint8_t data); + + void main_map(address_map &map); +}; + + + +/************************************* + * + * Bankswitch + * + *************************************/ + +void trvquest_state::machine_start() +{ + // no need to call killcom_state::machine_start() + m_bank->configure_entries(0, 16, memregion("questions")->base(), 0x2000); +} + +void trvquest_state::bankswitch_w(uint8_t data) +{ + m_bank->set_entry(data & 0xf); +} + + + +/************************************* + * + * Address map + * + *************************************/ + +void trvquest_state::main_map(address_map &map) +{ + map(0x0000, 0x1fff).ram().share("nvram"); // cmos ram + map(0x2000, 0x27ff).ram(); // main ram + map(0x2800, 0x2800).nopr(); // ? + map(0x3800, 0x380f).m(m_via[1], FUNC(via6522_device::map)); + map(0x3810, 0x381f).m(m_via[2], FUNC(via6522_device::map)); + map(0x3820, 0x382f).m(m_via[0], FUNC(via6522_device::map)); + map(0x3830, 0x3831).w("ay1", FUNC(ay8910_device::address_data_w)); + map(0x3840, 0x3841).w("ay2", FUNC(ay8910_device::address_data_w)); + map(0x3850, 0x3850).nopr(); // watchdog_reset_r ? + map(0x8000, 0x9fff).bankr(m_bank); + map(0xa000, 0xa000).w(FUNC(trvquest_state::bankswitch_w)).nopr(); + map(0xb000, 0xffff).rom(); +} + + + +/************************************* + * + * Input ports + * + *************************************/ + +static INPUT_PORTS_START( trvquest ) + PORT_START("IN0") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Reset") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(1) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + 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_UNKNOWN ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) + + PORT_START("UNK") + 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, 0x40, 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 ) ) + + PORT_START("DSW0") + PORT_DIPNAME( 0x07, 0x01, DEF_STR( Coinage ) ) + PORT_DIPSETTING( 0x06, DEF_STR( 4C_1C ) ) + PORT_DIPSETTING( 0x05, DEF_STR( 3C_1C ) ) + PORT_DIPSETTING( 0x04, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x01, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x03, DEF_STR( 1C_3C ) ) +// PORT_DIPSETTING( 0x07, DEF_STR( Free_Play ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) + 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, 0x40, 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 + + + +/************************************* + * + * Machine config + * + *************************************/ + +void trvquest_state::trvquest(machine_config &config) +{ + M6809(config, m_maincpu, 6_MHz_XTAL/4); + m_maincpu->set_addrmap(AS_PROGRAM, &trvquest_state::main_map); + + NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1); + + // via + MOS6522(config, m_via[0], 6_MHz_XTAL/4); + m_via[0]->writepa_handler().set(FUNC(trvquest_state::video_data_w)); + m_via[0]->writepb_handler().set(FUNC(trvquest_state::video_command_w)); + m_via[0]->readpb_handler().set(FUNC(trvquest_state::video_status_r)); + m_via[0]->ca2_handler().set(FUNC(trvquest_state::video_command_trigger_w)); + + MOS6522(config, m_via[1], 6_MHz_XTAL/4); + m_via[1]->readpa_handler().set_ioport("IN0"); + m_via[1]->readpb_handler().set_ioport("IN1"); + m_via[1]->ca2_handler().set(FUNC(trvquest_state::coin_w)); + + MOS6522(config, m_via[2], 6_MHz_XTAL/4); + m_via[2]->readpa_handler().set_ioport("UNK"); + m_via[2]->readpb_handler().set_ioport("DSW0"); + m_via[2]->irq_handler().set_inputline(m_maincpu, 0); + + // video hardware + killcom_video(config); + m_screen->screen_vblank().set(m_via[2], FUNC(via6522_device::write_ca1)); + + // sound hardware + SPEAKER(config, "mono").front_center(); + + AY8910(config, "ay1", 6_MHz_XTAL/2).add_route(ALL_OUTPUTS, "mono", 0.25); + AY8910(config, "ay2", 6_MHz_XTAL/2).add_route(ALL_OUTPUTS, "mono", 0.25); +} + + + +/************************************* + * + * ROM defintions + * + *************************************/ + +ROM_START( trvquest ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "rom3", 0xb000, 0x1000, CRC(2ff7f370) SHA1(66f40426ed02ee44235e17a49d9054ede42b83b9) ) + ROM_LOAD( "rom4", 0xc000, 0x1000, CRC(b1adebcb) SHA1(661cabc92b1defce5c2edb8e873a80d5032084d0) ) + ROM_LOAD( "rom5", 0xd000, 0x1000, CRC(2fc10a15) SHA1(8ecce32a5a167056c8fb48554a8907ae6299921e) ) + ROM_LOAD( "rom6", 0xe000, 0x1000, CRC(fabf4846) SHA1(862cac32de78f2ff4afef398b864d5533d302a4f) ) + ROM_LOAD( "rom7", 0xf000, 0x1000, CRC(a9f56551) SHA1(fb6fc3b17a6e66571a5ba837befbfac1ac26cc39) ) + + ROM_REGION( 0x20000, "questions", ROMREGION_ERASEFF ) // Question roms + // 0x00000 - 0x05fff empty + ROM_LOAD( "romi", 0x06000, 0x2000, CRC(c8368f69) SHA1(c1dfb701482c5ae922df0a93665a519995a2f4f1) ) + ROM_LOAD( "romh", 0x08000, 0x2000, CRC(f3aa8a08) SHA1(2bf8f878cc1df84806a6fb8e7be2656c422d61b9) ) + ROM_LOAD( "romg", 0x0a000, 0x2000, CRC(f85f8e48) SHA1(38c9142181a8ee5c0bc80cf2a06d4137fcb2a8b9) ) + ROM_LOAD( "romf", 0x0c000, 0x2000, CRC(2bffdcab) SHA1(96bd9aede5a76f9ddcf29e8df2c632075d21b8f6) ) + ROM_LOAD( "rome", 0x0e000, 0x2000, CRC(3ff66402) SHA1(da13fe6b99d7517ad2ecd0e42d0c306d4e49563a) ) + ROM_LOAD( "romd", 0x10000, 0x2000, CRC(4e21653f) SHA1(719a8dda9b81963a6b6d7d3e4966ecde676b9ecf) ) + ROM_LOAD( "romc", 0x12000, 0x2000, CRC(081a5322) SHA1(09e7ea5f1ee1dc35ec00bcea1550c6fe0bbdf60d) ) + ROM_LOAD( "romb", 0x14000, 0x2000, CRC(819ab451) SHA1(78c181eae63d55d1d0643bb7be07ca3cdbe14285) ) + ROM_LOAD( "roma", 0x16000, 0x2000, CRC(b4bcaf33) SHA1(c6b08fb8d55b2834d0c6c5baff9f544c795e4c15) ) +ROM_END + +} // anonymous namespace + + + +// YEAR NAME PARENT MACHINE INPUT CLASS INIT SCREEN COMPANY FULLNAME FLAGS +GAME( 1984, trvquest, 0, trvquest, trvquest, trvquest_state, empty_init, ROT90, "Techstar / Sunn", "Trivia Quest", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/atari/asteroid.cpp b/src/mame/atari/asteroid.cpp index 21383d94397..50277ef3f3c 100644 --- a/src/mame/atari/asteroid.cpp +++ b/src/mame/atari/asteroid.cpp @@ -856,7 +856,7 @@ void asteroid_state::asteroid_base(machine_config &config) VECTOR(config, "vector"); screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_VECTOR)); screen.set_refresh_hz(CLOCK_3KHZ/12/4); - screen.set_size(400,300); + screen.set_size(400, 300); screen.set_visarea(522, 1566, 394, 1182); screen.set_screen_update("vector", FUNC(vector_device::screen_update)); diff --git a/src/mame/gameplan/enigma2.cpp b/src/mame/gameplan/enigma2.cpp deleted file mode 100644 index 5e47aeacbe1..00000000000 --- a/src/mame/gameplan/enigma2.cpp +++ /dev/null @@ -1,829 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Pierpaolo Prazzoli, Tomasz Slanina -/******************************************************************** - -Enigma 2 (C) Zilec Electronics / Game Plan - -driver by Pierpaolo Prazzoli and Tomasz Slanina - - -enigma2 (1981) - 2xZ80 + AY8910 - Original dedicated board - -enigma2a (1984?) - Conversion applied to a Taito Space Invaders Part II board set with 1984 copyright. hack / Bootleg ? - -enigma2b (1981) - Conversion like enigma2a, but boots with 1981 copyright and Phantoms II title - -TODO: - - enigma2 - Star blinking frequency - - enigma2 - Sound is incorrectly emulated (see MT07777) - - enigma2a + enigma2b - bad sound ROM? - - -********************************************************************* -Enigma II, Game Plan, 1981 -PCB hardware notes by Guru - -GAME PLAN (C) 1981 -|------------------------------------------------------------------------------------------------------------| -| 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 | -| LS157 LS32 LS283 LS86 LS86 LS86 LS86 LS27 LS32 LS02 LS161 LS161 LS161 LS161 LS74 LS107 LS04 A| -| 10MHz| -| |---| | -| LS165 LS10 LS157 LS157 LS157 LS157 LS42 2114 2114 2114 2114 2114 2114 2114 2114 | | B| -| |Z80| LS161 | -| | | | -| LS08 2114 2114 2114 2114 2114 2114 2114 2114 | | C| -| LS165 |---| LS161 | -| | -| LS74 6.13D 5.11D 4.10D 3.8D 2.7D 1.5D LS138 LS244 LS04 D| -| LS245 | -| | -| LS42 |---| LS32 E| -| DIPSW(8) | A | | -| | Y | 9.2F | -|2 LS240 LS21 LS04 LS08 8.13F 7.11F LS244 | 3 | F| -|2 | 8 | 2114 | -|W LS175 LS04 | 9 | | -|A LS240 LS07 LS08 LS157 LS08 LS174 | 1 | 2114 G| -|Y | 0 | LS42 | -| |---| |----------| | -| LS164 | Z80 | H| -| LM380N VOLUME LS02 4040 |----------| | -| | -|------------------------------------------------------------------------------------------------------------| -Notes: (all IC's shown) - Z80 - Clock 2.5MHz (both) [10/4] - AY3-8910 - Clock 1.25MHz [10/8] - LM380N - 2.5w Audio Power Amp IC (DIP14) - 2114 - 1kx4-bit SRAM - 1.xx to 8.xx - 2716 EPROM - 9.2F - 2532 EPROM - HSync - 15.0539kHz - VSync - measured between 52Hz and 53Hz (moving) - - -Edge Connector --------------- - - Parts Solder - ------|------ - +5V 1 | A +5V - +5V 2 | B +5V - - 3 | C - - 2P THRUST 4 | D - - - 5 | E - - - 6 | F 2P RIGHT - 2P LEFT 7 | H 2P FIRE - 1P THRUST 8 | J 1P START - 2P START 9 | K COIN - - 10 | L 1P RIGHT - 1P LEFT 11 | M 1P FIRE - BLUE 12 | N GREEN - SYNC 13 | P RED -COMPOSITE VIDEO 14 | R - - - 15 | S - - - 16 | T - - SLAM 17 | U - - - 18 | V - - SPEAKER+ 19 | W SPEAKER- - +12V 20 | X +12V - GND 21 | Y GND - GND 22 | Z GND - -DIP Switches ------------- - -+-----------------+---+---+---+---+---+---+---+---+ -| Default=* | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -+-----------------+---+---+---+---+---+---+---+---+ -|Coinage 1C 1P* | |ON | | -| 2C 1P | |OFF| | -+-----------------+-------+---+---+---------------+ -|Cabinet Upright* | |ON | | -| Cocktail | |OFF| | -+-----------------+---+---+---+-------------------+ -|Lives 3* |ON |ON | | -| 4 |OFF|ON | | -| 5 |ON |OFF| | -| 6 |OFF|OFF| | -+-----------------+---+---+-----------+---+---+---+ -|Difficulty 1 | |OFF|ON |OFF| -| 2 | |OFF|ON |ON | -| 3* | |OFF|OFF|OFF| -| 4 | |OFF|OFF|ON | -| 5 | |ON |OFF|OFF| -| 6 | |ON |OFF|ON | -+-----------------+---------------+---+---+---+---+ -|# OF INVADERS 16*| |OFF| | -| 32 | |ON | | -+-----------------+---------------+---+-----------+ - -*********************************************************************/ - -#include "emu.h" -#include "cpu/i8085/i8085.h" -#include "cpu/z80/z80.h" -#include "sound/ay8910.h" -#include "emupal.h" -#include "screen.h" -#include "speaker.h" - -#define LOG_PROT (1U << 1) - -#define VERBOSE (0) -#include "logmacro.h" - - -namespace { - -/* these values provide a fairly low refresh rate of around 53Hz, but - they were derived from the schematics. The horizontal synch chain - counts from 0x0c0-0x1ff and the vertical one from 0x0d8-0x1ff. */ - -#define MASTER_CLOCK (10000000) -#define CPU_CLOCK (MASTER_CLOCK / 4) -#define PIXEL_CLOCK (MASTER_CLOCK / 2) -#define AY8910_CLOCK (MASTER_CLOCK / 8) -#define HCOUNTER_START (0x0c0) -#define HCOUNTER_END (0x1ff) -#define HTOTAL (HCOUNTER_END + 1 - HCOUNTER_START) -#define HBEND (0x000) -#define HBSTART (0x100) -#define VCOUNTER_START (0x0d8) -#define VCOUNTER_END (0x1ff) -#define VTOTAL (VCOUNTER_END + 1 - VCOUNTER_START) -#define VBEND (0x048) -#define VBSTART (VTOTAL) - -/* the IRQ line is cleared (active LO) at these vertical sync counter - values and raised one scan line later */ -#define INT_TRIGGER_COUNT_1 (0x10f) -#define INT_TRIGGER_COUNT_2 (0x18f) - - -class enigma2_state : public driver_device -{ -public: - enigma2_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_audiocpu(*this, "audiocpu"), - m_screen(*this, "screen"), - m_palette(*this, "palette"), - m_colors(*this, "colors"), - m_stars(*this, "stars"), - m_videoram(*this, "videoram") - { } - - void enigma2(machine_config &config); - void enigma2a(machine_config &config); - - void init_enigma2(); - - DECLARE_CUSTOM_INPUT_MEMBER(p1_controls_r); - DECLARE_CUSTOM_INPUT_MEMBER(p2_controls_r); - -protected: - virtual void machine_start() override; - virtual void machine_reset() override; - -private: - required_device m_maincpu; - required_device m_audiocpu; - required_device m_screen; - optional_device m_palette; - optional_region_ptr m_colors; - optional_region_ptr m_stars; - required_shared_ptr m_videoram; - - int m_blink_count = 0; - uint8_t m_sound_latch = 0; - uint8_t m_last_sound_data = 0; - uint8_t m_protection_data = 0; - uint8_t m_flip_screen = 0; - - emu_timer *m_interrupt_clear_timer = nullptr; - emu_timer *m_interrupt_assert_timer = nullptr; - - uint8_t dip_switch_r(offs_t offset); - void sound_data_w(uint8_t data); - void enigma2_flip_screen_w(uint8_t data); - uint8_t sound_latch_r(); - void protection_data_w(uint8_t data); - uint32_t screen_update_enigma2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - uint32_t screen_update_enigma2a(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - TIMER_CALLBACK_MEMBER(interrupt_clear_callback); - TIMER_CALLBACK_MEMBER(interrupt_assert_callback); - inline uint16_t vpos_to_vysnc_chain_counter( int vpos ); - inline int vysnc_chain_counter_to_vpos( uint16_t counter ); - void create_interrupt_timers(); - void start_interrupt_timers(); - - void enigma2_audio_cpu_map(address_map &map); - void enigma2_main_cpu_map(address_map &map); - void enigma2a_main_cpu_io_map(address_map &map); - void enigma2a_main_cpu_map(address_map &map); -}; - - -/************************************* - * - * Interrupt generation - * - *************************************/ - - -uint16_t enigma2_state::vpos_to_vysnc_chain_counter( int vpos ) -{ - return vpos + VCOUNTER_START; -} - - -int enigma2_state::vysnc_chain_counter_to_vpos( uint16_t counter ) -{ - return counter - VCOUNTER_START; -} - - -TIMER_CALLBACK_MEMBER(enigma2_state::interrupt_clear_callback) -{ - m_maincpu->set_input_line(0, CLEAR_LINE); -} - - -TIMER_CALLBACK_MEMBER(enigma2_state::interrupt_assert_callback) -{ - uint16_t next_counter; - int next_vpos; - - /* compute vector and set the interrupt line */ - int vpos = m_screen->vpos(); - uint16_t counter = vpos_to_vysnc_chain_counter(vpos); - uint8_t vector = 0xc7 | ((counter & 0x80) >> 3) | ((~counter & 0x80) >> 4); - m_maincpu->set_input_line_and_vector(0, ASSERT_LINE, vector); // Z80 - - /* set up for next interrupt */ - if (counter == INT_TRIGGER_COUNT_1) - next_counter = INT_TRIGGER_COUNT_2; - else - next_counter = INT_TRIGGER_COUNT_1; - - next_vpos = vysnc_chain_counter_to_vpos(next_counter); - m_interrupt_assert_timer->adjust(m_screen->time_until_pos(next_vpos)); - m_interrupt_clear_timer->adjust(m_screen->time_until_pos(vpos + 1)); -} - - -void enigma2_state::create_interrupt_timers( ) -{ - m_interrupt_clear_timer = timer_alloc(FUNC(enigma2_state::interrupt_clear_callback), this); - m_interrupt_assert_timer = timer_alloc(FUNC(enigma2_state::interrupt_assert_callback), this); -} - - -void enigma2_state::start_interrupt_timers( ) -{ - int vpos = vysnc_chain_counter_to_vpos(INT_TRIGGER_COUNT_1); - m_interrupt_assert_timer->adjust(m_screen->time_until_pos(vpos)); -} - - - -void enigma2_state::machine_start() -{ - create_interrupt_timers(); - - save_item(NAME(m_blink_count)); - save_item(NAME(m_sound_latch)); - save_item(NAME(m_last_sound_data)); - save_item(NAME(m_protection_data)); - save_item(NAME(m_flip_screen)); -} - - -void enigma2_state::machine_reset() -{ - m_audiocpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); - - m_last_sound_data = 0; - m_flip_screen = 0; - m_sound_latch = 0; - m_blink_count = 0; - - start_interrupt_timers(); -} - - -/************************************* - * - * Video system - * - *************************************/ - -uint32_t enigma2_state::screen_update_enigma2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) -{ - const rectangle &visarea = screen.visible_area(); - - uint8_t x = 0; - uint16_t bitmap_y = visarea.min_y; - uint8_t y = (uint8_t)vpos_to_vysnc_chain_counter(bitmap_y); - uint8_t video_data = 0; - uint8_t fore_color = 0; - uint8_t star_color = 0; - - while (1) - { - uint8_t bit; - uint8_t color; - - /* read the video RAM */ - if ((x & 0x07) == 0x00) - { - offs_t color_map_address = (y >> 3 << 5) | (x >> 3); - - /* the schematics shows it like this, but it doesn't work as this would - produce no stars, due to the contents of the PROM -- maybe there is - a star disabled bit somewhere that's connected here instead of flip_screen() */ - /* star_map_address = (y >> 4 << 6) | (enigma2_flip_screen_get() << 5) | (x >> 3); */ - offs_t star_map_address = (y >> 4 << 6) | 0x20 | (x >> 3); - if (m_blink_count & 0x08) - star_map_address |= 0x400; - - offs_t videoram_address = (y << 5) | (x >> 3); - - /* when the screen is flipped, all the video address bits are inverted, - and the adder at 16A is activated */ - if (m_flip_screen) - { - color_map_address |= 0x400; - videoram_address = (~videoram_address + 0x0400) & 0x1fff; - } - - video_data = m_videoram[videoram_address]; - - fore_color = m_colors[color_map_address] & 0x07; - star_color = m_stars[star_map_address] & 0x07; - } - - /* plot the current pixel */ - if (m_flip_screen) - { - bit = video_data & 0x80; - video_data = video_data << 1; - } - else - { - bit = video_data & 0x01; - video_data = video_data >> 1; - } - - if (bit) - color = fore_color; - else - /* stars only appear at certain positions */ - color = ((x & y & 0x0f) == 0x0f) ? star_color : 0; - - bitmap.pix(bitmap_y, x) = m_palette->pen_color(color); - - /* next pixel */ - x = x + 1; - - /* end of line? */ - if (x == 0) - { - /* end of screen? */ - if (bitmap_y == visarea.max_y) - break; - - /* next row */ - y = y + 1; - bitmap_y = bitmap_y + 1; - } - } - - m_blink_count++; - - return 0; -} - - -uint32_t enigma2_state::screen_update_enigma2a(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) -{ - uint8_t x = 0; - const rectangle &visarea = screen.visible_area(); - uint16_t bitmap_y = visarea.min_y; - uint8_t y = (uint8_t)vpos_to_vysnc_chain_counter(bitmap_y); - uint8_t video_data = 0; - - while (1) - { - uint8_t bit; - pen_t pen; - - /* read the video RAM */ - if ((x & 0x07) == 0x00) - { - offs_t videoram_address = (y << 5) | (x >> 3); - - /* when the screen is flipped, all the video address bits are inverted, - and the adder at 16A is activated */ - if (m_flip_screen) videoram_address = (~videoram_address + 0x0400) & 0x1fff; - - video_data = m_videoram[videoram_address]; - } - - /* plot the current pixel */ - if (m_flip_screen) - { - bit = video_data & 0x80; - video_data = video_data << 1; - } - else - { - bit = video_data & 0x01; - video_data = video_data >> 1; - } - - pen = bit ? rgb_t::white() : rgb_t::black(); - bitmap.pix(bitmap_y, x) = pen; - - /* next pixel */ - x = x + 1; - - /* end of line? */ - if (x == 0) - { - /* end of screen? */ - if (bitmap_y == visarea.max_y) - break; - - /* next row */ - y = y + 1; - bitmap_y = bitmap_y + 1; - } - } - - return 0; -} - - - -uint8_t enigma2_state::dip_switch_r(offs_t offset) -{ - uint8_t ret = 0x00; - - LOGMASKED(LOG_PROT, "DIP SW Read: %x at %x (prot data %x)\n", offset, m_maincpu->pc(), m_protection_data); - switch (offset) - { - case 0x01: - /* For the DIP switches to be read, protection_data must be - 0xff on reset. The AY8910 reset ensures this. */ - if (m_protection_data != 0xff) - ret = m_protection_data ^ 0x88; - else - ret = ioport("DSW")->read(); - break; - - case 0x02: - if (m_maincpu->pc() == 0x07e5) - ret = 0xaa; - else - ret = 0xf4; - break; - - case 0x35: ret = 0x38; break; - case 0x51: ret = 0xaa; break; - case 0x79: ret = 0x38; break; - } - - return ret; -} - - -void enigma2_state::sound_data_w(uint8_t data) -{ - /* clock sound latch shift register on rising edge of D2 */ - if (!(data & 0x04) && (m_last_sound_data & 0x04)) - m_sound_latch = (m_sound_latch << 1) | (~data & 0x01); - - m_audiocpu->set_input_line(INPUT_LINE_NMI, (data & 0x02) ? ASSERT_LINE : CLEAR_LINE); - - m_last_sound_data = data; -} - - -uint8_t enigma2_state::sound_latch_r() -{ - return bitswap<8>(m_sound_latch,0,1,2,3,4,5,6,7); -} - - -void enigma2_state::protection_data_w(uint8_t data) -{ - LOGMASKED(LOG_PROT, "%s: Protection Data Write: %x\n", machine().describe_context(), data); - m_protection_data = data; -} - - -void enigma2_state::enigma2_flip_screen_w(uint8_t data) -{ - m_flip_screen = ((data >> 5) & 0x01) && ((ioport("DSW")->read() & 0x20) == 0x20); -} - - -CUSTOM_INPUT_MEMBER(enigma2_state::p1_controls_r) -{ - return ioport("P1CONTROLS")->read(); -} - - -CUSTOM_INPUT_MEMBER(enigma2_state::p2_controls_r) -{ - if (m_flip_screen) - return ioport("P2CONTROLS")->read(); - else - return ioport("P1CONTROLS")->read(); -} - -void enigma2_state::enigma2_main_cpu_map(address_map &map) -{ - map.global_mask(0x7fff); - map(0x0000, 0x1fff).rom().nopw(); - map(0x2000, 0x3fff).mirror(0x4000).ram().share("videoram"); - map(0x4000, 0x4fff).rom().nopw(); - map(0x5000, 0x57ff).r(FUNC(enigma2_state::dip_switch_r)).nopw(); - map(0x5800, 0x5800).mirror(0x07f8).noprw(); - map(0x5801, 0x5801).mirror(0x07f8).portr("IN0").nopw(); - map(0x5802, 0x5802).mirror(0x07f8).portr("IN1").nopw(); - map(0x5803, 0x5803).mirror(0x07f8).nopr().w(FUNC(enigma2_state::sound_data_w)); - map(0x5804, 0x5804).mirror(0x07f8).noprw(); - map(0x5805, 0x5805).mirror(0x07f8).nopr().w(FUNC(enigma2_state::enigma2_flip_screen_w)); - map(0x5806, 0x5807).mirror(0x07f8).noprw(); -} - - -void enigma2_state::enigma2a_main_cpu_map(address_map &map) -{ - map(0x0000, 0x1fff).rom().nopw(); - map(0x2000, 0x3fff).mirror(0x4000).ram().share("videoram"); - map(0x4000, 0x4fff).rom().nopw(); - map(0x5000, 0x57ff).r(FUNC(enigma2_state::dip_switch_r)).nopw(); - map(0x5800, 0x5fff).noprw(); -} - - -void enigma2_state::enigma2a_main_cpu_io_map(address_map &map) -{ - map.global_mask(0x7); - map(0x00, 0x00).noprw(); - map(0x01, 0x01).portr("IN0").nopw(); - map(0x02, 0x02).portr("IN1").nopw(); - map(0x03, 0x03).nopr().w(FUNC(enigma2_state::sound_data_w)); - map(0x04, 0x04).noprw(); - map(0x05, 0x05).nopr().w(FUNC(enigma2_state::enigma2_flip_screen_w)); - map(0x06, 0x07).noprw(); -} - - -void enigma2_state::enigma2_audio_cpu_map(address_map &map) -{ - map(0x0000, 0x0fff).mirror(0x1000).rom().nopw(); - map(0x2000, 0x7fff).noprw(); - map(0x8000, 0x83ff).mirror(0x1c00).ram(); - map(0xa000, 0xa001).mirror(0x1ffc).w("aysnd", FUNC(ay8910_device::address_data_w)); - map(0xa002, 0xa002).mirror(0x1ffc).r("aysnd", FUNC(ay8910_device::data_r)); - map(0xa003, 0xa003).mirror(0x1ffc).noprw(); - map(0xc000, 0xffff).noprw(); -} - - - -static INPUT_PORTS_START( enigma2 ) - PORT_START("IN0") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 ) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 ) - PORT_BIT( 0x78, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(enigma2_state, p1_controls_r) - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) - - PORT_START("IN1") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x78, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(enigma2_state, p2_controls_r) - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) - - PORT_START("DSW") - PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("DSW:!1,!2") - PORT_DIPSETTING( 0x00, "3" ) - PORT_DIPSETTING( 0x01, "4" ) - PORT_DIPSETTING( 0x02, "5" ) - PORT_DIPSETTING( 0x03, "6" ) - PORT_DIPNAME( 0x1c, 0x00, "Skill Level" ) PORT_DIPLOCATION("DSW:!6,!7,!8") - PORT_DIPSETTING( 0x00, "1" ) - PORT_DIPSETTING( 0x04, "2" ) - PORT_DIPSETTING( 0x0c, "3" ) - PORT_DIPSETTING( 0x08, "4" ) - PORT_DIPSETTING( 0x10, "5" ) - PORT_DIPSETTING( 0x14, "6" ) - PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("DSW:!3") - PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Cocktail ) ) - PORT_DIPNAME( 0x40, 0x40, "Number of Invaders" ) PORT_DIPLOCATION("DSW:!5") - PORT_DIPSETTING( 0x40, "16" ) - PORT_DIPSETTING( 0x00, "32" ) - PORT_DIPNAME( 0x80, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("DSW:!4") - PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) ) - PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) - - PORT_START("P1CONTROLS") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(1) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(1) - PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED ) - - PORT_START("P2CONTROLS") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2) - PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED ) -INPUT_PORTS_END - - -static INPUT_PORTS_START( enigma2a ) - PORT_START("IN0") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 ) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 ) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(enigma2_state, p1_controls_r) - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) - - PORT_START("IN1") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(enigma2_state, p2_controls_r) - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) - - PORT_START("DSW") - PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("DSW:1,2") - PORT_DIPSETTING( 0x00, "3" ) - PORT_DIPSETTING( 0x01, "4" ) - PORT_DIPSETTING( 0x02, "5" ) - PORT_DIPSETTING( 0x03, "6" ) - PORT_DIPNAME( 0x1c, 0x00, "Skill Level" ) PORT_DIPLOCATION("DSW:6,7,8") - PORT_DIPSETTING( 0x00, "1" ) - PORT_DIPSETTING( 0x04, "2" ) - PORT_DIPSETTING( 0x0c, "3" ) - PORT_DIPSETTING( 0x08, "4" ) - PORT_DIPSETTING( 0x10, "5" ) - PORT_DIPSETTING( 0x14, "6" ) - PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("DSW:3") - PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Cocktail ) ) - PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW:5") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x40, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("DSW:4") - PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) ) - PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) - - PORT_START("P1CONTROLS") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(1) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(1) - PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED ) - - PORT_START("P2CONTROLS") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2) - PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED ) -INPUT_PORTS_END - - -void enigma2_state::enigma2(machine_config &config) -{ - /* basic machine hardware */ - Z80(config, m_maincpu, CPU_CLOCK); - m_maincpu->set_addrmap(AS_PROGRAM, &enigma2_state::enigma2_main_cpu_map); - - Z80(config, m_audiocpu, 2500000); - m_audiocpu->set_addrmap(AS_PROGRAM, &enigma2_state::enigma2_audio_cpu_map); - m_audiocpu->set_periodic_int(FUNC(enigma2_state::irq0_line_hold), attotime::from_hz(8*52)); - - /* video hardware */ - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_raw(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART); - m_screen->set_screen_update(FUNC(enigma2_state::screen_update_enigma2)); - - PALETTE(config, m_palette, palette_device::GBR_3BIT); - - /* audio hardware */ - SPEAKER(config, "mono").front_center(); - - ay8910_device &aysnd(AY8910(config, "aysnd", AY8910_CLOCK)); - aysnd.port_a_read_callback().set(FUNC(enigma2_state::sound_latch_r)); - aysnd.port_b_write_callback().set(FUNC(enigma2_state::protection_data_w)); - aysnd.add_route(ALL_OUTPUTS, "mono", 1.0); -} - - -void enigma2_state::enigma2a(machine_config &config) -{ - /* basic machine hardware */ - I8080(config, m_maincpu, CPU_CLOCK); - m_maincpu->set_addrmap(AS_PROGRAM, &enigma2_state::enigma2a_main_cpu_map); - m_maincpu->set_addrmap(AS_IO, &enigma2_state::enigma2a_main_cpu_io_map); - - Z80(config, m_audiocpu, 2500000); - m_audiocpu->set_addrmap(AS_PROGRAM, &enigma2_state::enigma2_audio_cpu_map); - m_audiocpu->set_periodic_int(FUNC(enigma2_state::irq0_line_hold), attotime::from_hz(8*52)); - - /* video hardware */ - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_raw(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART); - m_screen->set_screen_update(FUNC(enigma2_state::screen_update_enigma2a)); - - /* audio hardware */ - SPEAKER(config, "mono").front_center(); - - ay8910_device &aysnd(AY8910(config, "aysnd", AY8910_CLOCK)); - aysnd.port_a_read_callback().set(FUNC(enigma2_state::sound_latch_r)); - aysnd.port_b_write_callback().set(FUNC(enigma2_state::protection_data_w)); - aysnd.add_route(ALL_OUTPUTS, "mono", 1.0); -} - - - -ROM_START( enigma2 ) - ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "1.5d", 0x0000, 0x0800, CRC(499749de) SHA1(401928ff41d3b4cbb68e6ad3bf3be4a10ae1781f) ) - ROM_LOAD( "2.7d", 0x0800, 0x0800, CRC(173c1329) SHA1(3f1ad46d0e58ab236e4ff2b385d09fbf113627da) ) - ROM_LOAD( "3.8d", 0x1000, 0x0800, CRC(c7d3e6b1) SHA1(43f7c3a02b46747998260d5469248f21714fe12b) ) - ROM_LOAD( "4.10d", 0x1800, 0x0800, CRC(c6a7428c) SHA1(3503f09856655c5973fb89f60d1045fe41012aa9) ) - ROM_LOAD( "5.11d", 0x4000, 0x0800, CRC(098ac15b) SHA1(cce28a2540a9eabb473391fff92895129ae41751) ) - ROM_LOAD( "6.13d", 0x4800, 0x0800, CRC(240a9d4b) SHA1(ca1c69fafec0471141ce1254ddfaef54fecfcbf0) ) - - ROM_REGION( 0x10000, "audiocpu", 0 ) - ROM_LOAD( "9.2f", 0x0000, 0x1000, CRC(68fd8c54) SHA1(69996d5dfd996f0aacb26e397bef314204a2a88a) ) - - ROM_REGION( 0x0800, "colors", 0 ) - ROM_LOAD( "7.11f", 0x0000, 0x0800, CRC(409b5aad) SHA1(1b774a70f725637458ed68df9ed42476291b0e43) ) - - ROM_REGION( 0x0800, "stars", 0 ) - ROM_LOAD( "8.13f", 0x0000, 0x0800, CRC(e9cb116d) SHA1(41da4f46c5614ec3345c233467ebad022c6b0bf5) ) -ROM_END - - -ROM_START( enigma2a ) - ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "36_en1.bin", 0x0000, 0x0800, CRC(15f44806) SHA1(4a2f7bc91d4edf7a069e0865d964371c97af0a0a) ) - ROM_LOAD( "35_en2.bin", 0x0800, 0x0800, CRC(e841072f) SHA1(6ab02fd9fdeac5ab887cd25eee3d6b70ab01f849) ) - ROM_LOAD( "34_en3.bin", 0x1000, 0x0800, CRC(43d06cf4) SHA1(495af05d54c0325efb67347f691e64d194645d85) ) - ROM_LOAD( "33_en4.bin", 0x1800, 0x0800, CRC(8879a430) SHA1(c97f44bef3741eef74e137d2459e79f1b3a90457) ) - ROM_LOAD( "5.11d", 0x4000, 0x0800, CRC(098ac15b) SHA1(cce28a2540a9eabb473391fff92895129ae41751) ) - ROM_LOAD( "6.13d", 0x4800, 0x0800, CRC(240a9d4b) SHA1(ca1c69fafec0471141ce1254ddfaef54fecfcbf0) ) - - ROM_REGION( 0x10000, "audiocpu", 0 ) - ROM_LOAD( "sound.bin", 0x0000, 0x0800, BAD_DUMP CRC(5f092d3c) SHA1(17c70f6af1b5560a45e6b1bdb330a98b27570fe9) ) -ROM_END - -ROM_START( enigma2b ) - ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "ic36.bin", 0x0000, 0x0800, CRC(71dc9ecc) SHA1(a41260259cf0a36b01b5e8ad35cf968e920d22d9) ) - ROM_LOAD( "ic35.bin", 0x0800, 0x0800, CRC(e841072f) SHA1(6ab02fd9fdeac5ab887cd25eee3d6b70ab01f849) ) - ROM_LOAD( "ic34.bin", 0x1000, 0x0800, CRC(1384073d) SHA1(7a3a910c0431e680cc952a10a040b02f3df0532a) ) - ROM_LOAD( "ic33.bin", 0x1800, 0x0800, CRC(ac6c2410) SHA1(d35565a5ffe795d0c36970bd9c2f948bf79e0ed8) ) - ROM_LOAD( "ic32.bin", 0x4000, 0x0800, CRC(098ac15b) SHA1(cce28a2540a9eabb473391fff92895129ae41751) ) - ROM_LOAD( "ic42.bin", 0x4800, 0x0800, CRC(240a9d4b) SHA1(ca1c69fafec0471141ce1254ddfaef54fecfcbf0) ) - - /* this rom was completely broken on this pcb.. */ - ROM_REGION( 0x10000, "audiocpu", 0 ) - ROM_LOAD( "sound.bin", 0x0000, 0x0800, BAD_DUMP CRC(5f092d3c) SHA1(17c70f6af1b5560a45e6b1bdb330a98b27570fe9) ) -ROM_END - - -void enigma2_state::init_enigma2() -{ - uint8_t *rom = memregion("audiocpu")->base(); - for (offs_t i = 0; i < 0x2000; i++) - { - rom[i] = bitswap<8>(rom[i],4,5,6,0,7,1,3,2); - } -} - -} // Anonymous namespace - - -GAME( 1981, enigma2, 0, enigma2, enigma2, enigma2_state, init_enigma2, ROT270, "Zilec Electronics (Game Plan license)", "Enigma II", MACHINE_SUPPORTS_SAVE ) -GAME( 1984, enigma2a, enigma2, enigma2a, enigma2a, enigma2_state, init_enigma2, ROT270, "Zilec Electronics", "Enigma II (Space Invaders hardware)", MACHINE_SUPPORTS_SAVE ) -GAME( 1981, enigma2b, enigma2, enigma2a, enigma2a, enigma2_state, init_enigma2, ROT270, "Zilec Electronics", "Phantoms II (Space Invaders hardware)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/gameplan/gameplan.cpp b/src/mame/gameplan/gameplan.cpp deleted file mode 100644 index 35177bce8be..00000000000 --- a/src/mame/gameplan/gameplan.cpp +++ /dev/null @@ -1,1362 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Chris Moore -/*************************************************************************** - -Killer Comet hardware, by Centuri (previously known as Allied Leisure) -driver by Chris Moore - -Killer Comet memory map - -MAIN CPU: - -Address Dir Data Name Description ----------------- --- -------- --------- ----------------------- -00000-xxxxxxxxxx R/W xxxxxxxx RAM can be either 256 bytes (2x2101) or 1kB (2x2114) -00001----------- n.c. -00010----------- n.c. -00011----------- n.c. -00100-------xxxx R/W xxxxxxxx VIA 1 6522 for video interface -00101-------xxxx R/W xxxxxxxx VIA 2 6522 for I/O interface -00110-------xxxx R/W xxxxxxxx VIA 3 6522 for interface with audio CPU -00111----------- n.c. -01-------------- n.c. -10-------------- n.c. -11000xxxxxxxxxxx R xxxxxxxx ROM E2 program ROM -11001xxxxxxxxxxx R xxxxxxxx ROM F2 program ROM -11010xxxxxxxxxxx R xxxxxxxx ROM G2 program ROM -11011xxxxxxxxxxx R xxxxxxxx ROM J2 program ROM -11100xxxxxxxxxxx R xxxxxxxx ROM J1 program ROM -11101xxxxxxxxxxx R xxxxxxxx ROM G1 program ROM -11110xxxxxxxxxxx R xxxxxxxx ROM F1 program ROM -11111xxxxxxxxxxx R xxxxxxxx ROM E1 program ROM - - -SOUND CPU: - -Address Dir Data Name Description ----------------- --- -------- --------- ----------------------- -000-0----xxxxxxx R/W xxxxxxxx VIA 5 6532 internal RAM -000-1------xxxxx R/W xxxxxxxx VIA 5 6532 for interface with main CPU -001------------- n.c. -010------------- n.c. -011------------- n.c. -100------------- n.c. -101-----------xx R/W xxxxxxxx PSG 1 AY-3-8910 -110------------- n.c. -111--xxxxxxxxxxx R xxxxxxxx ROM E1 - - -Notes: -- There are two dip switch banks connected to the 8910 ports. They are only - used for testing. - -- Megatack's test mode reports the same fire buttons as Killer Comet, but this - is wrong: there is only one fire button, not three. - -- Megatack's actual name which displays proudly on the cover and everywhere in - the manual as "MEGATTACK" - -- Checked and verified DIPs from manuals and service mode for: - Challenger - Kaos - Killer Comet - Megattack - Pot Of Gold (Leprechaun) - -- Leprechaun and Pirate Treasure were made for the Moppet Video arcade series - (Enter-Tech arcade cabs aimed at younger children). That's why the games are - so easy. - - -TODO: -- The board has, instead of a watchdog, a timed reset that has to be disabled - on startup. The disable line is tied to CA2 of VIA2, but I don't see writes - to that pin in the log. Missing support in machine/6522via.cpp? -- Investigate and document the 8910 dip switches -- Fix the input ports of Kaos -- Some of the games do unmapped reads all over the place, probably just bad - programming. One of these is piratetr, and it will lock up eventually when - reading from VIA1. It's possible to fix with a simple wire mod/pcb cut trace, - like done with piratetr_main_map. Let's assume they did something like that. - -BTANB: -- BGM stops in leprechn when you touch a tree - -****************************************************************************/ - -#include "emu.h" -#include "gameplan.h" - -#include "cpu/m6502/m6502.h" -#include "speaker.h" - - - -/************************************* - * - * Initialization - * - *************************************/ - -void killcom_state::machine_start() -{ - // register for save states (killcom specific) - save_item(NAME(m_current_port)); - save_item(NAME(m_audio_reset)); - save_item(NAME(m_audio_trigger)); -} - -void killcom_state::machine_reset() -{ - m_video_x = 0; - m_video_y = 0; - m_video_previous = 0; -} - - -void killcom_state::video_start() -{ - m_videoram = make_unique_clear(0x10000); - save_pointer(NAME(m_videoram), 0x10000); - - m_hblank_timer[0] = timer_alloc(FUNC(killcom_state::hblank_callback), this); - m_hblank_timer[0]->adjust(attotime::zero, 0, m_screen->scan_period()); - - m_hblank_timer[1] = timer_alloc(FUNC(killcom_state::hblank_callback), this); - m_hblank_timer[1]->adjust(256 * m_screen->pixel_period(), 1, m_screen->scan_period()); - - // register for save states - save_item(NAME(m_video_x)); - save_item(NAME(m_video_y)); - save_item(NAME(m_video_command)); - save_item(NAME(m_video_command_trigger)); - save_item(NAME(m_video_data)); - save_item(NAME(m_video_previous)); -} - - - -/************************************* - * - * Screen update - * - *************************************/ - -uint32_t killcom_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - for (int y = cliprect.min_y; y <= cliprect.max_y; y++) - { - for (int x = cliprect.min_x; x <= cliprect.max_x; x++) - { - bitmap.pix(y, x) = m_videoram[y << 8 | x] & 0x07; - } - } - - return 0; -} - - - -/************************************* - * - * VIA 1 - video - * - *************************************/ - -TIMER_CALLBACK_MEMBER(killcom_state::hblank_callback) -{ - // screen HBLANK is tied to VIA1 PB6 - m_via[0]->write_pb6(param); -} - - -void killcom_state::video_data_w(uint8_t data) -{ - m_video_data = data; -} - - -void killcom_state::video_command_w(uint8_t data) -{ - m_video_command = data & 0x07; -} - - -uint8_t killcom_state::video_status_r() -{ - // video busy flags on the upper bits - return 0xff; -} - - -uint8_t killcom_state::leprechn_videoram_r() -{ - return (video_status_r() & 0xf8) | m_video_previous; -} - - -void killcom_state::video_command_trigger_w(int state) -{ - if (state && !m_video_command_trigger) - { - switch (m_video_command) - { - // draw pixel - case 0: - // auto-adjust X? - if (m_video_data & 0x10) - { - if (m_video_data & 0x40) - m_video_x = m_video_x - 1; - else - m_video_x = m_video_x + 1; - } - - // auto-adjust Y? - if (m_video_data & 0x20) - { - if (m_video_data & 0x80) - m_video_y = m_video_y - 1; - else - m_video_y = m_video_y + 1; - } - - m_video_previous = m_videoram[m_video_y << 8 | m_video_x]; - - m_screen->update_now(); - m_videoram[m_video_y << 8 | m_video_x] = m_video_data & 0x07; - - break; - - // load X register - case 1: - m_video_x = m_video_data; - break; - - // load Y register - case 2: - m_video_y = m_video_data; - break; - - // clear screen - case 3: - m_screen->update_now(); - memset(m_videoram.get(), m_video_data & 0x07, 0x10000); - break; - - // N/C - default: - break; - } - } - - m_video_command_trigger = state; -} - - - -/************************************* - * - * VIA 2 - I/O - * - *************************************/ - -void killcom_state::io_select_w(uint8_t data) -{ - m_current_port = data; -} - - -uint8_t killcom_state::io_port_r() -{ - uint8_t data = 0xff; - - // COL A-D (E,F are N/C) - for (int i = 0; i < 4; i++) - if (BIT(m_current_port, i)) - data &= m_inputs[i]->read(); - - // DS A,B - for (int i = 0; i < 2; i++) - if (BIT(m_current_port, i ^ 7)) - data &= m_dsw[i]->read(); - - return data; -} - - -void killcom_state::coin_w(int state) -{ - machine().bookkeeping().coin_counter_w(0, ~state & 1); -} - - - -/************************************* - * - * VIA 3 - audio - * - *************************************/ - -void killcom_state::audio_reset_sync_w(int param) -{ - if (param && !m_audio_reset) - { - m_ay->reset(); - m_riot->reset(); - } - - m_audio_reset = param; - m_audiocpu->set_input_line(INPUT_LINE_RESET, param ? CLEAR_LINE : ASSERT_LINE); -} - - -void killcom_state::audio_reset_w(int state) -{ - machine().scheduler().synchronize(timer_expired_delegate(FUNC(killcom_state::audio_reset_sync_w), this), state); -} - - -void killcom_state::audio_trigger_sync_w(int param) -{ - m_audio_trigger = param; - m_riot->pa_w<7>(param); -} - - -void killcom_state::audio_trigger_w(int state) -{ - machine().scheduler().synchronize(timer_expired_delegate(FUNC(killcom_state::audio_trigger_sync_w), this), state); -} - - - -/************************************* - * - * RIOT - audio - * - *************************************/ - -uint8_t killcom_state::soundlatch_r() -{ - return m_audio_trigger << 7 | (m_soundlatch->read() & 0x7f); -} - - - -/************************************* - * - * Main CPU memory handlers - * - *************************************/ - -void killcom_state::killcom_main_map(address_map &map) -{ - map(0x0000, 0x03ff).mirror(0x0400).ram(); - map(0x2000, 0x200f).mirror(0x07f0).m(m_via[0], FUNC(via6522_device::map)); // VIA 1 - map(0x2800, 0x280f).mirror(0x07f0).m(m_via[1], FUNC(via6522_device::map)); // VIA 2 - map(0x3000, 0x300f).mirror(0x07f0).m(m_via[2], FUNC(via6522_device::map)); // VIA 3 - map(0x8000, 0xffff).rom(); -} - -void killcom_state::piratetr_main_map(address_map &map) -{ - killcom_main_map(map); - map(0x2010, 0x201f).mirror(0x07e0).unmaprw(); // A4, see TODO -} - - - -/************************************* - * - * Audio CPU memory handlers - * - *************************************/ - -void killcom_state::killcom_audio_map(address_map &map) -{ - map(0x0000, 0x007f).mirror(0x1780).m(m_riot, FUNC(mos6532_new_device::ram_map)); - map(0x0800, 0x081f).mirror(0x17e0).m(m_riot, FUNC(mos6532_new_device::io_map)); - map(0xa000, 0xa000).mirror(0x1ffc).w(m_ay, FUNC(ay8910_device::address_w)); - map(0xa001, 0xa001).mirror(0x1ffc).r(m_ay, FUNC(ay8910_device::data_r)); - map(0xa002, 0xa002).mirror(0x1ffc).w(m_ay, FUNC(ay8910_device::data_w)); - map(0xe000, 0xe7ff).mirror(0x1800).rom(); -} - -void killcom_state::leprechn_audio_map(address_map &map) -{ - killcom_audio_map(map); - map(0xe000, 0xefff).mirror(0x1000).rom(); -} - - - -/************************************* - * - * Input ports - * - *************************************/ - -static INPUT_PORTS_START( killcom ) - PORT_START("IN0") /* COL. A - from "TEST NO.7 - status locator - coin-door" */ - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Do Tests") PORT_CODE(KEYCODE_F1) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Select Test") PORT_CODE(KEYCODE_F2) - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN3 ) - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN2 ) - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 ) - - PORT_START("IN1") /* COL. B - from "TEST NO.7 - status locator - start sws." */ - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) - - PORT_START("IN2") /* COL. C - from "TEST NO.8 - status locator - player no.1" */ - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON4 ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) - - PORT_START("IN3") /* COL. D - from "TEST NO.8 - status locator - player no.2" */ - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_COCKTAIL - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_COCKTAIL - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_COCKTAIL - - PORT_START("DSW0") /* DSW A - from "TEST NO.6 - dip switch A" */ - PORT_DIPNAME( 0x03, 0x03, "Coinage P1/P2" ) PORT_DIPLOCATION("SW1:1,2") - PORT_DIPSETTING( 0x03, "1 Credit/2 Credits" ) - PORT_DIPSETTING( 0x02, "2 Credits/3 Credits" ) - PORT_DIPSETTING( 0x01, "2 Credits/4 Credits" ) - PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:3") - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:4") - PORT_DIPSETTING( 0x00, "4" ) - PORT_DIPSETTING( 0x08, "5" ) - PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "SW1:5" ) - PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW1:6" ) - PORT_DIPNAME( 0xc0, 0xc0, "Reaction" ) PORT_DIPLOCATION("SW1:7,8") - PORT_DIPSETTING( 0xc0, "Slowest" ) - PORT_DIPSETTING( 0x80, "Slow" ) - PORT_DIPSETTING( 0x40, "Fast" ) - PORT_DIPSETTING( 0x00, "Fastest" ) - - PORT_START("DSW1") /* DSW B - from "TEST NO.6 - dip switch B" */ - PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW2:1" ) - PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "SW2:2" ) - PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW2:3" ) - PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW2:4" ) - PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "SW2:5" ) - PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW2:6" ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:7") - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:8") - PORT_DIPSETTING( 0x80, DEF_STR( Upright ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) - - PORT_START("DSW2") /* audio board DSW A */ - PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW3:1" ) - PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "SW3:2" ) - PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW3:3" ) - PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW3:4" ) - PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "SW3:5" ) - PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW3:6" ) - PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW3:7" ) - PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW3:8" ) - - PORT_START("DSW3") /* audio board DSW B */ - PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW4:1" ) - PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "SW4:2" ) - PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW4:3" ) - PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW4:4" ) - PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "SW4:5" ) - PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW4:6" ) - PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW4:7" ) - PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW4:8" ) -INPUT_PORTS_END - - -static INPUT_PORTS_START( megatack ) - PORT_START("IN0") /* COL. A - from "TEST NO.7 - status locator - coin-door" */ - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Do Tests") PORT_CODE(KEYCODE_F1) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Select Test") PORT_CODE(KEYCODE_F2) - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN3 ) - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN2 ) - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 ) - - PORT_START("IN1") /* COL. B - from "TEST NO.7 - status locator - start sws." */ - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) - - PORT_START("IN2") /* COL. C - from "TEST NO.8 - status locator - player no.1" */ - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("IN3") /* COL. D - from "TEST NO.8 - status locator - player no.2" */ - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("DSW0") /* DSW A - from "TEST NO.6 - dip switch A" */ - PORT_DIPNAME( 0x03, 0x03, "Coinage P1/P2" ) PORT_DIPLOCATION("SW1:1,2") - PORT_DIPSETTING( 0x03, "1 Credit/2 Credits" ) - PORT_DIPSETTING( 0x02, "2 Credits/3 Credits" ) - PORT_DIPSETTING( 0x01, "2 Credits/4 Credits" ) - PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) - PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW1:3" ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:4") - PORT_DIPSETTING( 0x08, "3" ) - PORT_DIPSETTING( 0x00, "4" ) - PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "SW1:5" ) - PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW1:6" ) - PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW1:7" ) - PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW1:8" ) - - PORT_START("DSW1") /* DSW B - from "TEST NO.6 - dip switch B" */ - PORT_DIPNAME( 0x07, 0x07, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:1,2,3") - PORT_DIPSETTING( 0x07, "20000" ) - PORT_DIPSETTING( 0x06, "30000" ) - PORT_DIPSETTING( 0x05, "40000" ) - PORT_DIPSETTING( 0x04, "50000" ) - PORT_DIPSETTING( 0x03, "60000" ) - PORT_DIPSETTING( 0x02, "70000" ) - PORT_DIPSETTING( 0x01, "80000" ) - PORT_DIPSETTING( 0x00, "90000" ) - PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW2:4" ) - PORT_DIPNAME( 0x10, 0x10, "Monitor View" ) PORT_DIPLOCATION("SW2:5") - PORT_DIPSETTING( 0x10, "Direct" ) - PORT_DIPSETTING( 0x00, "Mirror" ) - PORT_DIPNAME( 0x20, 0x20, "Monitor Orientation" ) PORT_DIPLOCATION("SW2:6") - PORT_DIPSETTING( 0x20, "Horizontal" ) - PORT_DIPSETTING( 0x00, "Vertical" ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:7") - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:8") - PORT_DIPSETTING( 0x80, DEF_STR( Upright ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) - - PORT_START("DSW2") /* audio board DSW A */ - PORT_DIPNAME( 0x01, 0x00, "Sound Test A 0" ) PORT_DIPLOCATION("SW3:1") - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x00, "Sound Test A 1" ) PORT_DIPLOCATION("SW3:2") - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x00, "Sound Test A 2" ) PORT_DIPLOCATION("SW3:3") - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x00, "Sound Test A 3" ) PORT_DIPLOCATION("SW3:4") - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x00, "Sound Test A 4" ) PORT_DIPLOCATION("SW3:5") - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x00, "Sound Test A 5" ) PORT_DIPLOCATION("SW3:6") - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x00, "Sound Test A 6" ) PORT_DIPLOCATION("SW3:7") - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, "Sound Test Enable" ) PORT_DIPLOCATION("SW3:8") - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - - PORT_START("DSW3") /* audio board DSW B */ - PORT_DIPNAME( 0x01, 0x00, "Sound Test B 0" ) PORT_DIPLOCATION("SW4:1") - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x00, "Sound Test B 1" ) PORT_DIPLOCATION("SW4:2") - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x00, "Sound Test B 2" ) PORT_DIPLOCATION("SW4:3") - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x00, "Sound Test B 3" ) PORT_DIPLOCATION("SW4:4") - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x00, "Sound Test B 4" ) PORT_DIPLOCATION("SW4:5") - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x00, "Sound Test B 5" ) PORT_DIPLOCATION("SW4:6") - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x00, "Sound Test B 6" ) PORT_DIPLOCATION("SW4:7") - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x00, "Sound Test B 7" ) PORT_DIPLOCATION("SW4:8") - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) -INPUT_PORTS_END - - -static INPUT_PORTS_START( challeng ) - PORT_START("IN0") /* COL. A - from "TEST NO.7 - status locator - coin-door" */ - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Do Tests") PORT_CODE(KEYCODE_F1) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Select Test") PORT_CODE(KEYCODE_F2) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN3 ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) - - PORT_START("IN1") /* COL. B - from "TEST NO.7 - status locator - start sws." */ - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) - - PORT_START("IN2") /* COL. C - from "TEST NO.8 - status locator - player no.1" */ - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("IN3") /* COL. D - from "TEST NO.8 - status locator - player no.2" */ - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("DSW0") /* DSW A - from "TEST NO.6 - dip switch A" */ - PORT_DIPNAME( 0x03, 0x03, "Coinage P1/P2" ) PORT_DIPLOCATION("SW1:1,2") - PORT_DIPSETTING( 0x03, "1 Credit/2 Credits" ) - PORT_DIPSETTING( 0x02, "2 Credits/3 Credits" ) - PORT_DIPSETTING( 0x01, "2 Credits/4 Credits" ) - PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) - PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW1:3" ) - PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW1:4" ) - PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "SW1:5" ) - PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW1:6" ) - PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:7,8") - PORT_DIPSETTING( 0xc0, "3" ) - PORT_DIPSETTING( 0x80, "4" ) - PORT_DIPSETTING( 0x40, "5" ) - PORT_DIPSETTING( 0x00, "6" ) - - // Manual states information which differs from actual settings for DSW1 - // Switches 4 & 5 are factory settings and remain in the OFF position. - // Switches 6 & 7 are factory settings which remain in the ON position. - PORT_START("DSW1") /* DSW B - from "TEST NO.6 - dip switch B" */ - PORT_DIPNAME( 0x07, 0x07, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:1,2,3") - PORT_DIPSETTING( 0x01, "20000" ) - PORT_DIPSETTING( 0x00, "30000" ) - PORT_DIPSETTING( 0x07, "40000" ) - PORT_DIPSETTING( 0x06, "50000" ) - PORT_DIPSETTING( 0x05, "60000" ) - PORT_DIPSETTING( 0x04, "70000" ) - PORT_DIPSETTING( 0x03, "80000" ) - PORT_DIPSETTING( 0x02, "90000" ) - PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW2:4" ) - PORT_DIPNAME( 0x10, 0x10, "Monitor View" ) PORT_DIPLOCATION("SW2:5") - PORT_DIPSETTING( 0x10, "Direct" ) - PORT_DIPSETTING( 0x00, "Mirror" ) - PORT_DIPNAME( 0x20, 0x00, "Monitor Orientation" ) PORT_DIPLOCATION("SW2:6") - PORT_DIPSETTING( 0x20, "Horizontal" ) - PORT_DIPSETTING( 0x00, "Vertical" ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:7") - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:8") - PORT_DIPSETTING( 0x80, DEF_STR( Upright ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) - - PORT_START("DSW2") /* audio board DSW A */ - PORT_DIPNAME( 0x01, 0x00, "Sound Test A 0" ) PORT_DIPLOCATION("SW3:1") - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x00, "Sound Test A 1" ) PORT_DIPLOCATION("SW3:2") - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x00, "Sound Test A 2" ) PORT_DIPLOCATION("SW3:3") - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x00, "Sound Test A 3" ) PORT_DIPLOCATION("SW3:4") - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x00, "Sound Test A 4" ) PORT_DIPLOCATION("SW3:5") - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x00, "Sound Test A 5" ) PORT_DIPLOCATION("SW3:6") - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x00, "Sound Test A 6" ) PORT_DIPLOCATION("SW3:7") - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, "Sound Test Enable" ) PORT_DIPLOCATION("SW3:8") - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - - PORT_START("DSW3") /* audio board DSW B */ - PORT_DIPNAME( 0x01, 0x00, "Sound Test B 0" ) PORT_DIPLOCATION("SW4:1") - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x00, "Sound Test B 1" ) PORT_DIPLOCATION("SW4:2") - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x00, "Sound Test B 2" ) PORT_DIPLOCATION("SW4:3") - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x00, "Sound Test B 3" ) PORT_DIPLOCATION("SW4:4") - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x00, "Sound Test B 4" ) PORT_DIPLOCATION("SW4:5") - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x00, "Sound Test B 5" ) PORT_DIPLOCATION("SW4:6") - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x00, "Sound Test B 6" ) PORT_DIPLOCATION("SW4:7") - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x00, "Sound Test B 7" ) PORT_DIPLOCATION("SW4:8") - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) -INPUT_PORTS_END - - -static INPUT_PORTS_START( kaos ) - PORT_START("IN0") /* COL. A - from "TEST NO.7 - status locator - coin-door" */ - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Do Tests") PORT_CODE(KEYCODE_F1) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Select Test") PORT_CODE(KEYCODE_F2) - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN3 ) - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN2 ) - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 ) - - PORT_START("IN1") /* COL. B - from "TEST NO.7 - status locator - start sws." */ - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) - - PORT_START("IN2") /* COL. C - from "TEST NO.8 - status locator - player no.1" */ - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("IN3") /* COL. D - from "TEST NO.8 - status locator - player no.2" */ - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("DSW0") - PORT_DIPNAME( 0x0f, 0x0e, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2,3,4") - PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) ) - PORT_DIPSETTING( 0x0e, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x0d, DEF_STR( 1C_2C ) ) - PORT_DIPSETTING( 0x0c, DEF_STR( 1C_3C ) ) - PORT_DIPSETTING( 0x0b, DEF_STR( 1C_4C ) ) - PORT_DIPSETTING( 0x0a, DEF_STR( 1C_5C ) ) - PORT_DIPSETTING( 0x09, DEF_STR( 1C_6C ) ) - PORT_DIPSETTING( 0x08, DEF_STR( 1C_7C ) ) - PORT_DIPSETTING( 0x07, DEF_STR( 1C_8C ) ) - PORT_DIPSETTING( 0x06, DEF_STR( 1C_9C ) ) - PORT_DIPSETTING( 0x05, "1 Coin/10 Credits" ) - PORT_DIPSETTING( 0x04, "1 Coin/11 Credits" ) - PORT_DIPSETTING( 0x03, "1 Coin/12 Credits" ) - PORT_DIPSETTING( 0x02, "1 Coin/13 Credits" ) - PORT_DIPSETTING( 0x01, "1 Coin/14 Credits" ) - PORT_DIPSETTING( 0x0f, DEF_STR( 2C_3C ) ) - PORT_DIPNAME( 0x10, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:5") - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x60, 0x60, "Max Credits" ) PORT_DIPLOCATION("SW1:6,7") - PORT_DIPSETTING( 0x60, "10" ) - PORT_DIPSETTING( 0x40, "20" ) - PORT_DIPSETTING( 0x20, "30" ) - PORT_DIPSETTING( 0x00, "40" ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW1:8") - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - - PORT_START("DSW1") - PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:1") - PORT_DIPSETTING( 0x01, "3" ) - PORT_DIPSETTING( 0x00, "4" ) - PORT_DIPNAME( 0x02, 0x00, "Speed" ) PORT_DIPLOCATION("SW2:2") - PORT_DIPSETTING( 0x00, "Slow" ) - PORT_DIPSETTING( 0x02, "Fast" ) - PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:3,4") - PORT_DIPSETTING( 0x0c, "No Bonus" ) - PORT_DIPSETTING( 0x08, "10k" ) - PORT_DIPSETTING( 0x04, "10k 30k" ) - PORT_DIPSETTING( 0x00, "10k 30k 60k" ) - PORT_DIPNAME( 0x10, 0x10, "Number of $" ) PORT_DIPLOCATION("SW2:5") - PORT_DIPSETTING( 0x10, "8" ) - PORT_DIPSETTING( 0x00, "12" ) - PORT_DIPNAME( 0x20, 0x00, "Bonus erg" ) PORT_DIPLOCATION("SW2:6") - PORT_DIPSETTING( 0x20, "Every other screen" ) - PORT_DIPSETTING( 0x00, "Every screen" ) - PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW2:7" ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:8") - PORT_DIPSETTING( 0x80, DEF_STR( Upright ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) - - PORT_START("DSW2") /* audio board DSW A */ - PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW3:1" ) - PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "SW3:2" ) - PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW3:3" ) - PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW3:4" ) - PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "SW3:5" ) - PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW3:6" ) - PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW3:7" ) - PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW3:8" ) - - PORT_START("DSW3") /* audio board DSW B */ - PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW4:1" ) - PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "SW4:2" ) - PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW4:3" ) - PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW4:4" ) - PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "SW4:5" ) - PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW4:6" ) - PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW4:7" ) - PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW4:8" ) -INPUT_PORTS_END - - -static INPUT_PORTS_START( leprechn ) - PORT_START("IN0") /* COL. A - from "TEST NO.7 - status locator - coin-door" */ - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Do Tests") PORT_CODE(KEYCODE_F1) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Select Test") PORT_CODE(KEYCODE_F2) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN2 ) - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 ) - - PORT_START("IN1") /* COL. B - from "TEST NO.7 - status locator - start sws." */ - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) - - PORT_START("IN2") /* COL. C - from "TEST NO.8 - status locator - player no.1" */ - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) - - PORT_START("IN3") /* COL. D - from "TEST NO.8 - status locator - player no.2" */ - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_COCKTAIL - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_COCKTAIL - - PORT_START("DSW0") /* DSW A - from "TEST NO.6 - dip switch A" */ - PORT_DIPNAME( 0x09, 0x09, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:1,4") - PORT_DIPSETTING( 0x09, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x01, DEF_STR( 1C_5C ) ) - PORT_DIPSETTING( 0x08, DEF_STR( 1C_6C ) ) - PORT_DIPSETTING( 0x00, DEF_STR( 1C_7C ) ) - PORT_DIPNAME( 0x22, 0x22, "Max Credits" ) PORT_DIPLOCATION("SW1:2,6") - PORT_DIPSETTING( 0x22, "10" ) - PORT_DIPSETTING( 0x20, "20" ) - PORT_DIPSETTING( 0x02, "30" ) - PORT_DIPSETTING( 0x00, "40" ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:3") - PORT_DIPSETTING( 0x04, DEF_STR( Upright ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW1:5") - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:7,8") - PORT_DIPSETTING( 0xc0, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) ) - PORT_DIPSETTING( 0x80, DEF_STR( 1C_3C ) ) - PORT_DIPSETTING( 0x00, DEF_STR( 1C_4C ) ) - - PORT_START("DSW1") /* DSW B - from "TEST NO.6 - dip switch B" */ - PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:1") - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "SW2:2" ) - PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW2:3" ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:4") - PORT_DIPSETTING( 0x08, "3" ) - PORT_DIPSETTING( 0x00, "4" ) - PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "SW2:5" ) - PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW2:6" ) - PORT_DIPNAME( 0xc0, 0x40, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:7,8") - PORT_DIPSETTING( 0x40, "30000" ) - PORT_DIPSETTING( 0x80, "60000" ) - PORT_DIPSETTING( 0x00, "90000" ) - PORT_DIPSETTING( 0xc0, DEF_STR( None ) ) - - PORT_START("DSW2") /* audio board DSW A */ - PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW3:1" ) - PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "SW3:2" ) - PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW3:3" ) - PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW3:4" ) - PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "SW3:5" ) - PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW3:6" ) - PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW3:7" ) - PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW3:8" ) - - PORT_START("DSW3") /* audio board DSW B */ - PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW4:1" ) - PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "SW4:2" ) - PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW4:3" ) - PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW4:4" ) - PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "SW4:5" ) - PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW4:6" ) - PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW4:7" ) - PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW4:8" ) -INPUT_PORTS_END - -static INPUT_PORTS_START( leprechna ) - PORT_INCLUDE(leprechn) - - PORT_MODIFY("DSW1") - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:4") - PORT_DIPSETTING( 0x08, "4" ) - PORT_DIPSETTING( 0x00, "5" ) -INPUT_PORTS_END - - -static INPUT_PORTS_START( piratetr ) - PORT_START("IN0") /* COL. A - from "TEST NO.7 - status locator - coin-door" */ - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Do Tests") PORT_CODE(KEYCODE_F1) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Select Test") PORT_CODE(KEYCODE_F2) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN2 ) - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 ) - - PORT_START("IN1") /* COL. B - from "TEST NO.7 - status locator - start sws." */ - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) - - PORT_START("IN2") /* COL. C - from "TEST NO.8 - status locator - player no.1" */ - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) - - PORT_START("IN3") /* COL. D - from "TEST NO.8 - status locator - player no.2" */ - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_COCKTAIL - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_COCKTAIL - - PORT_START("DSW0") /* DSW A - from "TEST NO.6 - dip switch A" */ - PORT_DIPNAME( 0x09, 0x09, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:1,4") - PORT_DIPSETTING( 0x09, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x01, DEF_STR( 1C_5C ) ) - PORT_DIPSETTING( 0x08, DEF_STR( 1C_6C ) ) - PORT_DIPSETTING( 0x00, DEF_STR( 1C_7C ) ) - PORT_DIPNAME( 0x22, 0x22, "Max Credits" ) PORT_DIPLOCATION("SW1:2,6") - PORT_DIPSETTING( 0x22, "10" ) - PORT_DIPSETTING( 0x20, "20" ) - PORT_DIPSETTING( 0x02, "30" ) - PORT_DIPSETTING( 0x00, "40" ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:3") - PORT_DIPSETTING( 0x04, DEF_STR( Upright ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW1:5") - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:7,8") - PORT_DIPSETTING( 0xc0, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) ) - PORT_DIPSETTING( 0x80, DEF_STR( 1C_3C ) ) - PORT_DIPSETTING( 0x00, DEF_STR( 1C_4C ) ) - - PORT_START("DSW1") /* DSW B - from "TEST NO.6 - dip switch B" */ - PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:1") - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, "Stringing Check" ) PORT_DIPLOCATION("SW2:2") - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW2:3" ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:4") - PORT_DIPSETTING( 0x08, "3" ) - PORT_DIPSETTING( 0x00, "4" ) - PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "SW2:5" ) - PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW2:6" ) - PORT_DIPNAME( 0xc0, 0x40, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:7,8") - PORT_DIPSETTING( 0x40, "30000" ) - PORT_DIPSETTING( 0x80, "60000" ) - PORT_DIPSETTING( 0x00, "90000" ) - PORT_DIPSETTING( 0xc0, DEF_STR( None ) ) - - PORT_START("DSW2") /* audio board DSW A */ - PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW3:1" ) - PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "SW3:2" ) - PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW3:3" ) - PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW3:4" ) - PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "SW3:5" ) - PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW3:6" ) - PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW3:7" ) - PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW3:8" ) - - PORT_START("DSW3") /* audio board DSW B */ - PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW4:1" ) - PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "SW4:2" ) - PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW4:3" ) - PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW4:4" ) - PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "SW4:5" ) - PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW4:6" ) - PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW4:7" ) - PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW4:8" ) -INPUT_PORTS_END - - - -/************************************* - * - * Machine configs - * - *************************************/ - -void killcom_state::killcom_video(machine_config &config) -{ - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_raw(11.6688_MHz_XTAL / 2, 352, 0, 256, 280, 0, 256); - m_screen->set_screen_update(FUNC(killcom_state::screen_update)); - m_screen->screen_vblank().set(m_via[0], FUNC(via6522_device::write_ca1)); // VBLANK is connected to CA1 - m_screen->set_palette("palette"); - - PALETTE(config, "palette", palette_device::RGB_3BIT); -} - -void killcom_state::killcom(machine_config &config) -{ - // basic machine hardware - M6502(config, m_maincpu, 3.579545_MHz_XTAL / 4); - m_maincpu->set_addrmap(AS_PROGRAM, &killcom_state::killcom_main_map); - - input_merger_device &main_irqs(INPUT_MERGER_ANY_HIGH(config, "main_irqs")); - main_irqs.output_handler().set_inputline(m_maincpu, 0); - - M6502(config, m_audiocpu, 3.579545_MHz_XTAL / 4); - m_audiocpu->set_addrmap(AS_PROGRAM, &killcom_state::killcom_audio_map); - - GENERIC_LATCH_8(config, m_soundlatch); - - MOS6532_NEW(config, m_riot, 3.579545_MHz_XTAL / 4); - m_riot->pa_rd_callback().set(FUNC(killcom_state::soundlatch_r)); - m_riot->pb_wr_callback().set(m_via[2], FUNC(via6522_device::write_pb)); - m_riot->irq_wr_callback().set_inputline(m_audiocpu, 0); - - // via - MOS6522(config, m_via[0], 3.579545_MHz_XTAL / 4); - m_via[0]->writepa_handler().set(FUNC(killcom_state::video_data_w)); - m_via[0]->writepb_handler().set(FUNC(killcom_state::video_command_w)); - m_via[0]->readpb_handler().set(FUNC(killcom_state::video_status_r)); - m_via[0]->ca2_handler().set(FUNC(killcom_state::video_command_trigger_w)); - m_via[0]->irq_handler().set("main_irqs", FUNC(input_merger_device::in_w<0>)); - - MOS6522(config, m_via[1], 3.579545_MHz_XTAL / 4); - m_via[1]->readpa_handler().set(FUNC(killcom_state::io_port_r)); - m_via[1]->writepb_handler().set(FUNC(killcom_state::io_select_w)); - m_via[1]->cb2_handler().set(FUNC(killcom_state::coin_w)); - m_via[1]->irq_handler().set("main_irqs", FUNC(input_merger_device::in_w<1>)); - - MOS6522(config, m_via[2], 3.579545_MHz_XTAL / 4); - m_via[2]->writepa_handler().set(m_soundlatch, FUNC(generic_latch_8_device::write)); - m_via[2]->ca2_handler().set(FUNC(killcom_state::audio_trigger_w)); - m_via[2]->cb2_handler().set(FUNC(killcom_state::audio_reset_w)); - m_via[2]->irq_handler().set("main_irqs", FUNC(input_merger_device::in_w<2>)); - - // video hardware - killcom_video(config); - - // audio hardware - SPEAKER(config, "mono").front_center(); - - AY8910(config, m_ay, 3.579545_MHz_XTAL / 2); - m_ay->port_a_read_callback().set_ioport("DSW2"); - m_ay->port_b_read_callback().set_ioport("DSW3"); - m_ay->add_route(ALL_OUTPUTS, "mono", 0.33); -} - -void killcom_state::leprechn(machine_config &config) -{ - killcom(config); - - // basic machine hardware - m_maincpu->set_clock(4_MHz_XTAL / 4); - m_via[0]->set_clock(4_MHz_XTAL / 4); - m_via[1]->set_clock(4_MHz_XTAL / 4); - m_via[2]->set_clock(4_MHz_XTAL / 4); - - m_audiocpu->set_clock(4_MHz_XTAL / 4); - m_riot->set_clock(4_MHz_XTAL / 4); - m_ay->set_clock(4_MHz_XTAL / 2); - - m_audiocpu->set_addrmap(AS_PROGRAM, &killcom_state::leprechn_audio_map); - - // via - m_via[0]->readpb_handler().set(FUNC(killcom_state::leprechn_videoram_r)); - m_via[0]->writepb_handler().set(FUNC(killcom_state::video_command_w)).rshift(3); -} - -void killcom_state::piratetr(machine_config &config) -{ - leprechn(config); - m_maincpu->set_addrmap(AS_PROGRAM, &killcom_state::piratetr_main_map); -} - - - -/************************************* - * - * ROM defintions - * - *************************************/ - -ROM_START( killcom ) - ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "killcom.e2", 0xc000, 0x0800, CRC(a01cbb9a) SHA1(a8769243adbdddedfda5f3c8f054e9281a0eca46) ) - ROM_LOAD( "killcom.f2", 0xc800, 0x0800, CRC(bb3b4a93) SHA1(a0ea61ac30a4d191db619b7bfb697914e1500036) ) - ROM_LOAD( "killcom.g2", 0xd000, 0x0800, CRC(86ec68b2) SHA1(a09238190d61684d943ce0acda25eb901d2580ac) ) - ROM_LOAD( "killcom.j2", 0xd800, 0x0800, CRC(28d8c6a1) SHA1(d9003410a651221e608c0dd20d4c9c60c3b0febc) ) - ROM_LOAD( "killcom.j1", 0xe000, 0x0800, CRC(33ef5ac5) SHA1(42f839ad295d3df457ced7886a0003eff7e6c4ae) ) - ROM_LOAD( "killcom.g1", 0xe800, 0x0800, CRC(49cb13e2) SHA1(635e4665042ddd9b8c0b9f275d4bcc6830dc6a98) ) - ROM_LOAD( "killcom.f1", 0xf000, 0x0800, CRC(ef652762) SHA1(414714e5a3f83916bd3ae54afe2cb2271ee9008b) ) - ROM_LOAD( "killcom.e1", 0xf800, 0x0800, CRC(bc19dcb7) SHA1(eb983d2df010c12cb3ffb584fceafa54a4e956b3) ) - - ROM_REGION( 0x10000, "audiocpu", 0 ) - ROM_LOAD( "killsnd.e1", 0xe000, 0x0800, CRC(77d4890d) SHA1(a3ed7e11dec5d404f022c521256ff50aa6940d3c) ) -ROM_END - -ROM_START( megatack ) - ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "megattac.e2", 0xc000, 0x0800, CRC(33fa5104) SHA1(15693eb540563e03502b53ed8a83366e395ca529) ) - ROM_LOAD( "megattac.f2", 0xc800, 0x0800, CRC(af5e96b1) SHA1(5f6ab47c12d051f6af446b08f3cd459fbd2c13bf) ) - ROM_LOAD( "megattac.g2", 0xd000, 0x0800, CRC(670103ea) SHA1(e11f01e8843ed918c6ea5dda75319dc95105d345) ) - ROM_LOAD( "megattac.j2", 0xd800, 0x0800, CRC(4573b798) SHA1(388db11ab114b3575fe26ed65bbf49174021939a) ) - ROM_LOAD( "megattac.j1", 0xe000, 0x0800, CRC(3b1d01a1) SHA1(30bbf51885b1e510b8d21cdd82244a455c5dada0) ) - ROM_LOAD( "megattac.g1", 0xe800, 0x0800, CRC(eed75ef4) SHA1(7c02337344f2716d2f2771229f7dee7b651eeb95) ) - ROM_LOAD( "megattac.f1", 0xf000, 0x0800, CRC(c93a8ed4) SHA1(c87e2f13f2cc00055f4941c272a3126b165a6252) ) - ROM_LOAD( "megattac.e1", 0xf800, 0x0800, CRC(d9996b9f) SHA1(e71d65b695000fdfd5fd1ce9ae39c0cb0b61669e) ) - - ROM_REGION( 0x10000, "audiocpu", 0 ) - ROM_LOAD( "megatsnd.e1", 0xe000, 0x0800, CRC(0c186bdb) SHA1(233af9481a3979971f2d5aa75ec8df4333aa5e0d) ) -ROM_END - -ROM_START( megatacka ) // original Centuri PCB - ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "meg-e2.e2", 0xc000, 0x0800, CRC(9664c7b1) SHA1(356e7f5f3b2a9b829fac53e7bf9193278b4de2ed) ) - ROM_LOAD( "meg-f2.f2", 0xc800, 0x0800, CRC(67c42523) SHA1(f9fc88cdea05a2d0e89e3ba9b545bf3476b37d2d) ) - ROM_LOAD( "meg-g2.g2", 0xd000, 0x0800, CRC(71f36604) SHA1(043988126343b6224e8e1d6c0dbba6b6b08fe493) ) - ROM_LOAD( "meg-j2.j2", 0xd800, 0x0800, CRC(4ddcc145) SHA1(3a6d42a58c388eaaf6561351fa98936d98975e0b) ) - ROM_LOAD( "meg-j1.j1", 0xe000, 0x0800, CRC(911d5d9a) SHA1(92bfe0f69a6e563363df59ebee745d7b3cfc0141) ) - ROM_LOAD( "meg-g1.g1", 0xe800, 0x0800, CRC(22a51c9b) SHA1(556e09216ed85eaf3870f85515c273c7eb1ab13a) ) - ROM_LOAD( "meg-f1.f1", 0xf000, 0x0800, CRC(2ffa51ac) SHA1(7c5d8295c5e71a9918a02d203139b024bd3bf8f4) ) - ROM_LOAD( "meg-e1.e1", 0xf800, 0x0800, CRC(01dbe4ad) SHA1(af72778ae112f24a92fb3007bb456331c3896b50) ) - - ROM_REGION( 0x10000, "audiocpu", 0 ) - ROM_LOAD( "megatsnd.e1", 0xe000, 0x0800, CRC(0c186bdb) SHA1(233af9481a3979971f2d5aa75ec8df4333aa5e0d) ) // missing for this board, using the one from the parent -ROM_END - -ROM_START( challeng ) - ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "chall.6", 0xa000, 0x1000, CRC(b30fe7f5) SHA1(ce93a57d626f90d31ddedbc35135f70758949dfa) ) - ROM_LOAD( "chall.5", 0xb000, 0x1000, CRC(34c6a88e) SHA1(250577e2c8eb1d3a78cac679310ec38924ac1fe0) ) - ROM_LOAD( "chall.4", 0xc000, 0x1000, CRC(0ddc18ef) SHA1(9f1aa27c71d7e7533bddf7de420c06fb0058cf60) ) - ROM_LOAD( "chall.3", 0xd000, 0x1000, CRC(6ce03312) SHA1(69c047f501f327f568fe4ad1274168f9dda1ca70) ) - ROM_LOAD( "chall.2", 0xe000, 0x1000, CRC(948912ad) SHA1(e79738ab94501f858f4d5f218787267523611e92) ) - ROM_LOAD( "chall.1", 0xf000, 0x1000, CRC(7c71a9dc) SHA1(2530ada6390fb46c44bf7bf2636910ee54786493) ) - - ROM_REGION( 0x10000, "audiocpu", 0 ) - ROM_LOAD( "chall.snd", 0xe000, 0x0800, CRC(1b2bffd2) SHA1(36ceb5abbc92a17576c375019f1c5900320398f9) ) -ROM_END - -ROM_START( kaos ) - ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "kaosab.g2", 0x9000, 0x0800, CRC(b23d858f) SHA1(e31fa657ace34130211a0b9fc0d115fd89bb20dd) ) - ROM_CONTINUE( 0xd000, 0x0800 ) - ROM_LOAD( "kaosab.j2", 0x9800, 0x0800, CRC(4861e5dc) SHA1(96ca0b8625af3897bd4a50a45ea964715f9e4973) ) - ROM_CONTINUE( 0xd800, 0x0800 ) - ROM_LOAD( "kaosab.j1", 0xa000, 0x0800, CRC(e055db3f) SHA1(099176629723c1a9bdc59f440339b2e8c38c3261) ) - ROM_CONTINUE( 0xe000, 0x0800 ) - ROM_LOAD( "kaosab.g1", 0xa800, 0x0800, CRC(35d7c467) SHA1(6d5bfd29ff7b96fed4b24c899ddd380e47e52bc5) ) - ROM_CONTINUE( 0xe800, 0x0800 ) - ROM_LOAD( "kaosab.f1", 0xb000, 0x0800, CRC(995b9260) SHA1(580896aa8b6f0618dc532a12d0795b0d03f7cadd) ) - ROM_CONTINUE( 0xf000, 0x0800 ) - ROM_LOAD( "kaosab.e1", 0xb800, 0x0800, CRC(3da5202a) SHA1(6b5aaf44377415763aa0895c64765a4b82086f25) ) - ROM_CONTINUE( 0xf800, 0x0800 ) - - ROM_REGION( 0x10000, "audiocpu", 0 ) - ROM_LOAD( "kaossnd.e1", 0xe000, 0x0800, CRC(ab23d52a) SHA1(505f3e4a56e78a3913010f5484891f01c9831480) ) -ROM_END - -ROM_START( leprechn ) - ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "1.u13", 0x8000, 0x1000, CRC(2c4a46ca) SHA1(28a157c1514bc9f27cc27baddb83cf1a1887f3d1) ) - ROM_LOAD( "2.u14", 0x9000, 0x1000, CRC(6ed26b3e) SHA1(4ee5d09200d9e8f94ae29751c8ee838faa268f15) ) - ROM_LOAD( "3.u15", 0xa000, 0x1000, CRC(b5f79fd8) SHA1(271f7b55ecda5bb99f40687264256b82649e2141) ) - ROM_LOAD( "4.u16", 0xb000, 0x1000, CRC(6c12a065) SHA1(2acae6a5b94cbdcc550cee88a7be9254fdae908c) ) - ROM_LOAD( "5.u17", 0xc000, 0x1000, CRC(21ddb539) SHA1(b4dd0a1916adc076fa6084c315459fcb2522161e) ) - ROM_LOAD( "6.u18", 0xd000, 0x1000, CRC(03c34dce) SHA1(6dff202e1a3d0643050f3287f6b5906613d56511) ) - ROM_LOAD( "7.u19", 0xe000, 0x1000, CRC(7e06d56d) SHA1(5f68f2047969d803b752a4cd02e0e0af916c8358) ) - ROM_LOAD( "8.u20", 0xf000, 0x1000, CRC(097ede60) SHA1(5509c41167c066fa4e7f4f4bd1ce9cd00773a82c) ) - - ROM_REGION( 0x10000, "audiocpu", 0 ) - ROM_LOAD( "lepsound", 0xe000, 0x1000, CRC(6651e294) SHA1(ce2875fc4df61a30d51d3bf2153864b562601151) ) -ROM_END - -ROM_START( leprechna ) - ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "lep1.u13", 0x8000, 0x1000, CRC(2c4a46ca) SHA1(28a157c1514bc9f27cc27baddb83cf1a1887f3d1) ) - ROM_LOAD( "lep2.u14", 0x9000, 0x1000, CRC(6ed26b3e) SHA1(4ee5d09200d9e8f94ae29751c8ee838faa268f15) ) - ROM_LOAD( "lep3.u15", 0xa000, 0x1000, CRC(a2eaa016) SHA1(be992ee787766137fd800ec59529c98ef2e6991e) ) - ROM_LOAD( "lep4.u16", 0xb000, 0x1000, CRC(6c12a065) SHA1(2acae6a5b94cbdcc550cee88a7be9254fdae908c) ) - ROM_LOAD( "lep5.u17", 0xc000, 0x1000, CRC(21ddb539) SHA1(b4dd0a1916adc076fa6084c315459fcb2522161e) ) - ROM_LOAD( "lep6.u18", 0xd000, 0x1000, CRC(03c34dce) SHA1(6dff202e1a3d0643050f3287f6b5906613d56511) ) - ROM_LOAD( "lep7.u19", 0xe000, 0x1000, CRC(7e06d56d) SHA1(5f68f2047969d803b752a4cd02e0e0af916c8358) ) - ROM_LOAD( "lep8.u20", 0xf000, 0x1000, CRC(097ede60) SHA1(5509c41167c066fa4e7f4f4bd1ce9cd00773a82c) ) - - ROM_REGION( 0x10000, "audiocpu", 0 ) - ROM_LOAD( "lepsound", 0xe000, 0x1000, CRC(6651e294) SHA1(ce2875fc4df61a30d51d3bf2153864b562601151) ) -ROM_END - -ROM_START( potogold ) - ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "pog.pg1", 0x8000, 0x1000, CRC(9f1dbda6) SHA1(baf20e9a0793c0f1529396f95a820bd1f9431465) ) - ROM_LOAD( "pog.pg2", 0x9000, 0x1000, CRC(a70e3811) SHA1(7ee306dc7d75a7d3fd497870ec92bef9d86535e9) ) - ROM_LOAD( "pog.pg3", 0xa000, 0x1000, CRC(81cfb516) SHA1(12732707e2a51ec39563f2d1e898cc567ab688f0) ) - ROM_LOAD( "pog.pg4", 0xb000, 0x1000, CRC(d61b1f33) SHA1(da024c0776214b8b5a3e49401c4110e86a1bead1) ) - ROM_LOAD( "pog.pg5", 0xc000, 0x1000, CRC(eee7597e) SHA1(9b5cd293580c5d212f8bf39286070280d55e4cb3) ) - ROM_LOAD( "pog.pg6", 0xd000, 0x1000, CRC(25e682bc) SHA1(085d2d553ec10f2f830918df3a7fb8e8c1e5d18c) ) - ROM_LOAD( "pog.pg7", 0xe000, 0x1000, CRC(84399f54) SHA1(c90ba3e3120adda2785ab5abd309e0a703d39f8b) ) - ROM_LOAD( "pog.pg8", 0xf000, 0x1000, CRC(9e995a1a) SHA1(5c525e6c161d9d7d646857b27cecfbf8e0943480) ) - - ROM_REGION( 0x10000, "audiocpu", 0 ) - ROM_LOAD( "pog.snd", 0xe000, 0x1000, CRC(ec61f0a4) SHA1(26944ecc3e7413259928c8b0a74b2260e67d2c4e) ) -ROM_END - -ROM_START( piratetr ) - ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "1.u13", 0x8000, 0x1000, CRC(4433bb61) SHA1(eee0d7f356118f8595dd7533541db744a63a8176) ) - ROM_LOAD( "2.u14", 0x9000, 0x1000, CRC(9bdc4b77) SHA1(ebaab8b3024efd3d0b76647085d441ca204ad5d5) ) - ROM_LOAD( "3.u15", 0xa000, 0x1000, CRC(ebced718) SHA1(3a2f4385347f14093360cfa595922254c9badf1a) ) - ROM_LOAD( "4.u16", 0xb000, 0x1000, CRC(f494e657) SHA1(83a31849de8f4f70d7547199f229079f491ddc61) ) - ROM_LOAD( "5.u17", 0xc000, 0x1000, CRC(2789d68e) SHA1(af8f334ce4938cd75143b729c97cfbefd68c9e13) ) - ROM_LOAD( "6.u18", 0xd000, 0x1000, CRC(d91abb3a) SHA1(11170e69686c2a1f2dc31d41516f44b612f99bad) ) - ROM_LOAD( "7.u19", 0xe000, 0x1000, CRC(6e8808c4) SHA1(d1f76fd37d8f78552a9d53467073cc9a571d96ce) ) - ROM_LOAD( "8.u20", 0xf000, 0x1000, CRC(2802d626) SHA1(b0db688500076ee73e0001c00089a8d552c6f607) ) - - ROM_REGION( 0x10000, "audiocpu", 0 ) - ROM_LOAD( "s.u31", 0xe000, 0x1000, CRC(2fe86a11) SHA1(aaafe411b9cb3d0221cc2af73d34ad8bb74f8327) ) -ROM_END - - - -/************************************* - * - * Game drivers - * - *************************************/ - -// YEAR NAME PARENT MACHINE INPUT CLASS INIT SCREEN COMPANY FULLNAME FLAGS -GAME( 1980, killcom, 0, killcom, killcom, killcom_state, empty_init, ROT0, "Centuri (Game Plan license)", "Killer Comet", MACHINE_SUPPORTS_SAVE ) -GAME( 1980, megatack, 0, killcom, megatack, killcom_state, empty_init, ROT0, "Centuri (Game Plan license)", "Megatack (set 1)", MACHINE_SUPPORTS_SAVE ) -GAME( 1980, megatacka, megatack, killcom, megatack, killcom_state, empty_init, ROT0, "Centuri (Game Plan license)", "Megatack (set 2)", MACHINE_SUPPORTS_SAVE ) -GAME( 1981, challeng, 0, killcom, challeng, killcom_state, empty_init, ROT270, "Centuri", "Challenger", MACHINE_SUPPORTS_SAVE ) // cab is vertical - -GAME( 1981, kaos, 0, killcom, kaos, killcom_state, empty_init, ROT270, "Pacific Polytechnical Corp. (Game Plan license)", "Kaos", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, leprechn, 0, leprechn, leprechn, killcom_state, empty_init, ROT0, "Pacific Polytechnical Corp.", "Leprechaun (set 1)", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, leprechna, leprechn, leprechn, leprechna, killcom_state, empty_init, ROT0, "Pacific Polytechnical Corp. (Tong Electronic license)", "Leprechaun (set 2)", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, potogold, leprechn, leprechn, leprechn, killcom_state, empty_init, ROT0, "Pacific Polytechnical Corp. (Game Plan license)", "Pot of Gold", MACHINE_SUPPORTS_SAVE ) -GAME( 1982, piratetr, 0, piratetr, piratetr, killcom_state, empty_init, ROT0, "Pacific Polytechnical Corp. (Tong Electronic license)", "Pirate Treasure", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/gameplan/gameplan.h b/src/mame/gameplan/gameplan.h deleted file mode 100644 index 81f4343fdac..00000000000 --- a/src/mame/gameplan/gameplan.h +++ /dev/null @@ -1,95 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Chris Moore -/*************************************************************************** - - Killer Comet driver - -***************************************************************************/ - -#include "machine/6522via.h" -#include "machine/gen_latch.h" -#include "machine/input_merger.h" -#include "machine/mos6530n.h" -#include "sound/ay8910.h" - -#include "emupal.h" -#include "screen.h" - - -class killcom_state : public driver_device -{ -public: - killcom_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_via(*this, "via%u", 1U), - m_screen(*this, "screen"), - m_inputs(*this, "IN%u", 0U), - m_dsw(*this, "DSW%u", 0U), - m_audiocpu(*this, "audiocpu"), - m_riot(*this, "riot"), - m_ay(*this, "ay"), - m_soundlatch(*this, "soundlatch") - { } - - void killcom(machine_config &config); - void killcom_video(machine_config &config); - void leprechn(machine_config &config); - void piratetr(machine_config &config); - -protected: - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; - - required_device m_maincpu; - required_device_array m_via; - required_device m_screen; - optional_ioport_array<4> m_inputs; - optional_ioport_array<4> m_dsw; - - void coin_w(int state); - void video_data_w(uint8_t data); - void video_command_w(uint8_t data); - uint8_t video_status_r(); - void video_command_trigger_w(int state); - uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - -private: - /* machine state */ - uint8_t m_current_port = 0; - uint8_t m_audio_reset = 0; - uint8_t m_audio_trigger = 0; - - /* video state */ - std::unique_ptr m_videoram; - uint8_t m_video_x = 0; - uint8_t m_video_y = 0; - uint8_t m_video_command = 0; - uint8_t m_video_command_trigger = 0; - uint8_t m_video_data = 0; - uint8_t m_video_previous = 0; - emu_timer *m_hblank_timer[2]; - - /* devices */ - optional_device m_audiocpu; - optional_device m_riot; - optional_device m_ay; - optional_device m_soundlatch; - - void io_select_w(uint8_t data); - uint8_t io_port_r(); - void audio_reset_w(int state); - void audio_reset_sync_w(int param); - void audio_trigger_w(int state); - void audio_trigger_sync_w(int param); - uint8_t soundlatch_r(); - - TIMER_CALLBACK_MEMBER(hblank_callback); - uint8_t leprechn_videoram_r(); - - void killcom_main_map(address_map &map); - void killcom_audio_map(address_map &map); - void leprechn_audio_map(address_map &map); - void piratetr_main_map(address_map &map); -}; diff --git a/src/mame/gameplan/toratora.cpp b/src/mame/gameplan/toratora.cpp deleted file mode 100644 index 4c423ff886e..00000000000 --- a/src/mame/gameplan/toratora.cpp +++ /dev/null @@ -1,526 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Nicola Salmoria -/******************************************************************************* - -Tora Tora (c) 1980 Game Plan - -driver by Nicola Salmoria, qwijibo - - -deviations from schematics verified on set 2 pcb: - -main pcb: -- U33.3 connected to /IRQ line via inverter U67.9, - providing timer IRQ for input polling. - -- U43 removed from timer circuit, U52.9 wired directly to - U32.5, increasing timer frequency to 250 Hz. - -audio pcb: -- U6.10 wired to U14.21, cut from R14/16 -- R16 wired to R1 in series, R1 cut from GND -- R14 wired to GND instead of U6.10 - -- U5.10 wired to U15.21, cut from R13/15 -- R15 wired to R2 in series, R2 cut from GND -- R13 wired to GND instead of U5.10 - -- EXT VCO DACs (U11, U12) and surrounding logic not placed -- Numerous changes to SN74677 timing component R & C values - - -TODO: -- The game reads some unmapped memory addresses, missing ROMs? There's an empty - socket for U3 on the board, which should map at 5000-57ff, however the game - reads mostly from 4800-4fff, which would be U6 according to the schematics. - -- The manual mentions dip switch settings and the schematics show the switches, - the game reads them but ignores them, forcing 1C/1C and 3 lives. - Maybe the dump is from a proto? - Set 2 dump does read dip switches, so likely not a proto. - -- Bullet and explosion audio frequencies seem incorrect - -- Who designed/developed the game? Taiyo System is mentioned online, but there's - no solid proof. It's more likely an American game. At the end of tora.u11, - there's "EMS INC.,1979". - -*******************************************************************************/ - -#include "emu.h" - -#include "cpu/m6800/m6800.h" -#include "machine/6821pia.h" -#include "machine/input_merger.h" -#include "sound/sn76477.h" - -#include "screen.h" -#include "speaker.h" - -#include "toratora.lh" - - -namespace { - -class toratora_state : public driver_device -{ -public: - toratora_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_irq(*this, "irq"), - m_pia(*this, "pia%u", 1U), - m_screen(*this, "screen"), - m_sn(*this, "sn%u", 1U), - m_videoram(*this, "videoram"), - m_dsw(*this, "DSW") - { } - - void toratora(machine_config &config); - -protected: - virtual void machine_start() override; - virtual void machine_reset() override; - -private: - required_device m_maincpu; - required_device m_irq; - required_device_array m_pia; - required_device m_screen; - required_device_array m_sn; - required_shared_ptr m_videoram; - required_ioport m_dsw; - - emu_timer *m_timer; - uint8_t m_timer_count = 0; - bool m_timer_clk = false; - bool m_clear_tv = false; - bool m_dsw_enable = true; - - void clear_tv_w(uint8_t data); - uint8_t timer_r(); - void clear_timer_w(uint8_t data); - uint8_t dsw_r(); - void dsw_enable_w(int state); - void coin_w(offs_t offset, uint8_t data, uint8_t mem_mask); - template void sn_vco_voltage_w(uint8_t data); - void sn1_w(uint8_t data); - void sn2_w(uint8_t data); - uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - TIMER_CALLBACK_MEMBER(toratora_timer); - - void main_map(address_map &map); -}; - - - -/************************************* - * - * Initialization - * - *************************************/ - -void toratora_state::machine_start() -{ - // 500Hz timer from 2*9602 - m_timer = timer_alloc(FUNC(toratora_state::toratora_timer), this); - m_timer->adjust(attotime::from_hz(500), 0, attotime::from_hz(500)); - - m_pia[0]->ca1_w(0); - m_pia[0]->ca2_w(0); - - save_item(NAME(m_timer_count)); - save_item(NAME(m_timer_clk)); - save_item(NAME(m_clear_tv)); - save_item(NAME(m_dsw_enable)); -} - -void toratora_state::machine_reset() -{ - m_timer_count = 0; - m_clear_tv = false; -} - - - -/************************************* - * - * Video hardware - * - *************************************/ - -uint32_t toratora_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) -{ - for (offs_t offs = 0; offs < m_videoram.bytes(); offs++) - { - uint8_t y = offs >> 5; - uint8_t x = offs << 3; - uint8_t data = m_videoram[offs]; - - for (int i = 0; i < 8; i++) - { - pen_t pen = (data & 0x80) ? rgb_t::white() : rgb_t::black(); - if (cliprect.contains(x, y)) - bitmap.pix(y, x) = pen; - - data = data << 1; - x = x + 1; - } - - // the video system clears as it writes out the pixels - if (m_clear_tv) - m_videoram[offs] = 0; - } - - m_clear_tv = false; - - return 0; -} - -void toratora_state::clear_tv_w(uint8_t data) -{ - m_clear_tv = true; -} - - - -/************************************* - * - * Audio hardware - * - *************************************/ - -template -void toratora_state::sn_vco_voltage_w(uint8_t data) -{ - m_sn[N]->vco_voltage_w(2.35 * (data & 0x7f) / 128.0); - m_sn[N]->enable_w(BIT(data, 7)); -} - -// U14 -void toratora_state::sn1_w(uint8_t data) -{ - static const double resistances[] = - { - RES_INF, // N/C - RES_INF, // R39 not placed - RES_K(10) + RES_K(10) + RES_K(24) + RES_K(51) + RES_K(100) + RES_K(240), - RES_K(10) + RES_K(10) + RES_K(24) + RES_K(51) + RES_K(100), - RES_K(10) + RES_K(10) + RES_K(24) + RES_K(51), - RES_K(10) + RES_K(10) + RES_K(24), - RES_K(10) + RES_K(10), - RES_INF - }; - - m_sn[0]->mixer_a_w(BIT(data, 0)); - m_sn[0]->mixer_b_w(BIT(data, 1)); - m_sn[0]->mixer_c_w(BIT(data, 2)); - m_sn[0]->envelope_1_w(BIT(data, 3)); - m_sn[0]->envelope_2_w(BIT(data, 4)); - - uint8_t res = data >> 5 & 0x7; - m_sn[0]->slf_res_w(resistances[res]); - m_sn[0]->slf_cap_voltage_w(res == 0x7 ? 2.5 : sn76477_device::EXTERNAL_VOLTAGE_DISCONNECT); - - // Seems like the output should be muted when res == 0, but unsure of exact mechanism - m_sn[0]->amplitude_res_w(resistances[res]); -} - -// U15 -void toratora_state::sn2_w(uint8_t data) -{ - static const double resistances[] = - { - RES_INF, // N/C - RES_K(10) + RES_K(10) + RES_K(24) + RES_K(51) + RES_K(100) + RES_M(240) + RES_M(2), - RES_K(10) + RES_K(10) + RES_K(24) + RES_K(51) + RES_K(100) + RES_K(240), - RES_K(10) + RES_K(10) + RES_K(24) + RES_K(51) + RES_K(100), - RES_K(10) + RES_K(10) + RES_K(24) + RES_K(51), - RES_K(10) + RES_K(10) + RES_K(24), - RES_K(10) + RES_K(10), - RES_INF - }; - - m_sn[1]->mixer_a_w(BIT(data, 0)); - m_sn[1]->mixer_b_w(BIT(data, 1)); - m_sn[1]->mixer_c_w(BIT(data, 2)); - m_sn[1]->envelope_1_w(BIT(data, 3)); - m_sn[1]->envelope_2_w(BIT(data, 4)); - - uint8_t res = data >> 5 & 0x7; - m_sn[1]->slf_res_w(resistances[res]); - - // TODO: Determine proper 7441 output voltage here. - // Datasheet lists 2.5 V max under worst conditions, probably much lower in reality? - // However, shot audio is muted if V < 1.0, as mixer state is set to SLF & VCO. - // Should SLF FF state be inverted? - m_sn[1]->slf_cap_voltage_w(res == 0x7 ? 2.5 : sn76477_device::EXTERNAL_VOLTAGE_DISCONNECT); -} - - - -/************************************* - * - * Timer - * - *************************************/ - -TIMER_CALLBACK_MEMBER(toratora_state::toratora_timer) -{ - // RAM refresh circuit halts the cpu for 64 cycles - m_maincpu->adjust_icount(-64); - - m_timer_clk = !m_timer_clk; - - if (m_timer_clk) - { - // timer counting at 250 Hz. (500 Hz / 2 via U52.9) - // U43 removed from circuit, U52.9 wired to U32.5) - m_timer_count++; - - // U33 bit 0 routed to /IRQ line after inverting through U67.9 - m_irq->in_w<0>(BIT(m_timer_count, 4)); - - // also, when the timer overflows, watchdog would kick in - if (m_timer_count == 0) - machine().schedule_soft_reset(); - } -} - -uint8_t toratora_state::timer_r() -{ - return m_timer_count; -} - -void toratora_state::clear_timer_w(uint8_t data) -{ - m_timer_count = 0; - m_irq->in_w<0>(0); -} - - - -/************************************* - * - * Misc. I/O - * - *************************************/ - -void toratora_state::dsw_enable_w(int state) -{ - m_dsw_enable = !state; -} - -uint8_t toratora_state::dsw_r() -{ - return m_dsw_enable ? m_dsw->read() : 0; -} - -void toratora_state::coin_w(offs_t offset, uint8_t data, uint8_t mem_mask) -{ - data |= ~mem_mask; - machine().bookkeeping().coin_counter_w(0, data & 0x20); -} - - - -/************************************* - * - * Memory handlers - * - * No mirrors, all addresses are - * fully decoded by the hardware! - * - *************************************/ - -void toratora_state::main_map(address_map &map) -{ - map(0x0000, 0x0fff).ram(); - map(0x1000, 0x7fff).rom(); // not fully populated - map(0x8000, 0x9fff).ram().share(m_videoram); - map(0xa000, 0xf047).noprw(); - map(0xf048, 0xf049).noprw(); - map(0xf04a, 0xf04a).w(FUNC(toratora_state::clear_tv_w)); // the read is mark !LEDEN, but not used - map(0xf04b, 0xf04b).rw(FUNC(toratora_state::timer_r), FUNC(toratora_state::clear_timer_w)); - map(0xf04c, 0xf09f).noprw(); - map(0xf0a0, 0xf0a3).rw(m_pia[0], FUNC(pia6821_device::read), FUNC(pia6821_device::write)); - map(0xf0a4, 0xf0a7).rw(m_pia[1], FUNC(pia6821_device::read), FUNC(pia6821_device::write)); - map(0xf0a8, 0xf0ab).rw(m_pia[2], FUNC(pia6821_device::read), FUNC(pia6821_device::write)); - map(0xf0ac, 0xf7ff).noprw(); - map(0xf800, 0xffff).rom(); -} - - - -/************************************* - * - * Port definition - * - *************************************/ - -static INPUT_PORTS_START( toratora ) - PORT_START("INPUT") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_16WAY - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_16WAY - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 ) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START1 ) - PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED ) - - PORT_START("COIN") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_WRITE_LINE_DEVICE_MEMBER("pia1", pia6821_device, ca2_w) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_WRITE_LINE_DEVICE_MEMBER("pia1", pia6821_device, ca1_w) - - PORT_START("DSW") - PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("U13:!1,!2") - PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) ) - PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x02, DEF_STR( 1C_3C ) ) - PORT_DIPSETTING( 0x03, DEF_STR( 1C_5C ) ) - PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("U13:!3,!4") - PORT_DIPSETTING( 0x04, DEF_STR( 2C_1C ) ) - PORT_DIPSETTING( 0x02, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x08, DEF_STR( 1C_3C ) ) - PORT_DIPSETTING( 0x0c, DEF_STR( 1C_5C ) ) - PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("U13:!5") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x10, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("U13:!6") - PORT_DIPSETTING( 0x00, "3" ) - PORT_DIPSETTING( 0x20, "4" ) - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) -INPUT_PORTS_END - - - -/************************************* - * - * Machine driver - * - *************************************/ - -void toratora_state::toratora(machine_config &config) -{ - // basic machine hardware - M6800(config, m_maincpu, 5.185_MHz_XTAL / 8); // 5.185 MHz XTAL divided by 8 (@ U94.12) - m_maincpu->set_addrmap(AS_PROGRAM, &toratora_state::main_map); - - INPUT_MERGER_ANY_HIGH(config, m_irq); - m_irq->output_handler().set_inputline(m_maincpu, 0); - - PIA6821(config, m_pia[0]); // U1 - m_pia[0]->readpa_handler().set_ioport("INPUT"); - m_pia[0]->writepb_handler().set(FUNC(toratora_state::coin_w)); - m_pia[0]->irqa_handler().set(m_irq, FUNC(input_merger_device::in_w<1>)); - m_pia[0]->irqb_handler().set(m_irq, FUNC(input_merger_device::in_w<2>)); - - PIA6821(config, m_pia[1]); // U2 - m_pia[1]->writepa_handler().set(FUNC(toratora_state::sn_vco_voltage_w<0>)); - m_pia[1]->readpb_handler().set(FUNC(toratora_state::dsw_r)); - m_pia[1]->writepb_handler().set(FUNC(toratora_state::sn1_w)); - m_pia[1]->ca2_handler().set(m_sn[0], FUNC(sn76477_device::vco_w)); - m_pia[1]->cb2_handler().set(FUNC(toratora_state::dsw_enable_w)); - - PIA6821(config, m_pia[2]); // U3 - m_pia[2]->writepa_handler().set(FUNC(toratora_state::sn_vco_voltage_w<1>)); - m_pia[2]->writepb_handler().set(FUNC(toratora_state::sn2_w)); - m_pia[2]->ca2_handler().set(m_sn[1], FUNC(sn76477_device::vco_w)); - - // video hardware - SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_video_attributes(VIDEO_ALWAYS_UPDATE); - m_screen->set_raw(5.185_MHz_XTAL, 256+40, 0, 256, 256+31+4, 8, 248); - m_screen->set_screen_update(FUNC(toratora_state::screen_update)); - - // audio hardware - SPEAKER(config, "mono").front_center(); - - for (int i = 0; i < 2; i++) - { - SN76477(config, m_sn[i]); - m_sn[i]->set_noise_params(RES_K(47), RES_K(470), CAP_P(470)); - m_sn[i]->set_decay_res(RES_M(2)); - m_sn[i]->set_attack_params(CAP_U(0.2), RES_K(3.3)); - m_sn[i]->set_amp_res(RES_K(47)); - m_sn[i]->set_feedback_res(RES_K(50)); - m_sn[i]->set_vco_params(0, CAP_U(0.1), RES_K(51)); - m_sn[i]->set_pitch_voltage(5.0); - m_sn[i]->set_slf_params(CAP_U(1.0), RES_K(10)); - m_sn[i]->set_oneshot_params(CAP_U(0.1), RES_K(100)); - m_sn[i]->set_vco_mode(0); - m_sn[i]->set_mixer_params(0, 0, 0); - m_sn[i]->set_envelope_params(0, 0); - m_sn[i]->set_enable(1); - m_sn[i]->add_route(ALL_OUTPUTS, "mono", 0.50); - } -} - - - -/************************************* - * - * ROM definition - * - *************************************/ - -ROM_START( toratora ) - ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "tora.u1", 0x1000, 0x0800, CRC(413c743a) SHA1(a887dfaaee557327a1699bb424488b934dab8612) ) - ROM_LOAD( "tora.u10", 0x1800, 0x0800, CRC(dc771b1c) SHA1(1bd81decb4d0a854878227c52d45ac0eea0602ec) ) - ROM_LOAD( "tora.u2", 0x2000, 0x0800, CRC(c574c664) SHA1(9f41a53ca51d04e5bec7525fe83c5f4bdfcf128d) ) - ROM_LOAD( "tora.u9", 0x2800, 0x0800, CRC(b67aa11f) SHA1(da9e77255640a4b32eed2be89b686b98a248bd72) ) - ROM_LOAD( "tora.u11", 0xf800, 0x0800, CRC(55135d6f) SHA1(c48f180a9d6e894aafe87b2daf74e9a082f4600e) ) -ROM_END - - -/* Tora Tora? Game Plan? -Etched in copper on top of board 20-00047C - 20-10051A - -Etched in copper on back of daughter board 20-00048C - 20-10052A - -ROM text showed TORA TOR* * was A with bit 7 set - 1980 GAME PLAN,INC - -and war stuff (PLANE, BOMB, SQUAD, etc) - -.u2 2716 handwritten sticker U-2 -.u9 2716 handwritten sticker U-9 -.u10 2716 handwritten sticker U-10 -.u11 2716 handwritten sticker U-11 - -open 24 pin socket @ U1 and U3 -open 40 pin socket @ U42 - -Main board -crystal with 5 185 on the top -5280 x8 -socketed ds8833 x2 -socketed ds8t28 x2 - -Daughter board -open 40 pin socket @ U3 @ U2 -76477 x2 */ - -ROM_START( toratorab ) - ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "1027.u1", 0x1000, 0x0800, BAD_DUMP CRC(413c743a) SHA1(a887dfaaee557327a1699bb424488b934dab8612) ) // rom u1 is missing in this set, using the toratora one - ROM_LOAD( "1027.u10", 0x1800, 0x0800, CRC(6a906292) SHA1(4ceff91b7dcd398e57cd19a91d2199c09cb37c39) ) - ROM_LOAD( "1027.u2", 0x2000, 0x0800, CRC(c1331648) SHA1(379101c6c1b8dab3e043ece01579cc96f6bb18a9) ) - ROM_LOAD( "1027.u9", 0x2800, 0x0800, CRC(59b021b5) SHA1(ea5a0c1f58c0e08231969ad161b79af6e1ae4431) ) - ROM_LOAD( "1027.u11", 0xf800, 0x0800, CRC(336f6659) SHA1(ea1151db54b68316908874da6983d6de5c94c29e) ) -ROM_END - -} // anonymous namespace - - - -/************************************* - * - * Game driver - * - *************************************/ - -GAMEL( 1980, toratora, 0, toratora, toratora, toratora_state, empty_init, ROT90, "Game Plan", "Tora Tora (prototype?)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE, layout_toratora ) -GAMEL( 1980, toratorab, toratora, toratora, toratora, toratora_state, empty_init, ROT90, "Game Plan", "Tora Tora (set 2)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE, layout_toratora ) diff --git a/src/mame/gameplan/trvquest.cpp b/src/mame/gameplan/trvquest.cpp deleted file mode 100644 index 3de3af9fe10..00000000000 --- a/src/mame/gameplan/trvquest.cpp +++ /dev/null @@ -1,274 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Pierpaolo Prazzoli -/* - -Trivia Quest -Sunn/Techstar 1984 - -CPU: 6809 -Three SY6522 - for flashing lighted buttons? - -Sound: Two AY-3-8910 - -Forty eight! MK4027 4K Rams - -Six 6116 Rams with battery backup - -Two Crystals: -11.6688 Mhz -6 Mhz - -Two 8 position DIPS - -rom3 through rom7 - Main pcb PRG. - -roma through romi - Sub pcb Questions. - -The main pcb had empty sockets for -rom0, rom1 and rom2. -This pcb has been tested and works -as is. - - driver by Pierpaolo Prazzoli - -Notes: -- Hardware is similar to the one in killcom.cpp - -*/ - -#include "emu.h" -#include "gameplan.h" - -#include "cpu/m6809/m6809.h" -#include "machine/6522via.h" -#include "machine/nvram.h" -#include "sound/ay8910.h" - -#include "speaker.h" - - -namespace { - -class trvquest_state : public killcom_state -{ -public: - trvquest_state(const machine_config &mconfig, device_type type, const char *tag) : - killcom_state(mconfig, type, tag), - m_bank(*this, "bank") - { } - - void trvquest(machine_config &config); - -protected: - virtual void machine_start() override; - -private: - required_memory_bank m_bank; - - void bankswitch_w(uint8_t data); - - void main_map(address_map &map); -}; - - - -/************************************* - * - * Bankswitch - * - *************************************/ - -void trvquest_state::machine_start() -{ - m_bank->configure_entries(0, 16, memregion("questions")->base(), 0x2000); -} - -void trvquest_state::bankswitch_w(uint8_t data) -{ - m_bank->set_entry(data & 0xf); -} - - - -/************************************* - * - * Address map - * - *************************************/ - -void trvquest_state::main_map(address_map &map) -{ - map(0x0000, 0x1fff).ram().share("nvram"); // cmos ram - map(0x2000, 0x27ff).ram(); // main ram - map(0x2800, 0x2800).nopr(); // ? - map(0x3800, 0x380f).m(m_via[1], FUNC(via6522_device::map)); - map(0x3810, 0x381f).m(m_via[2], FUNC(via6522_device::map)); - map(0x3820, 0x382f).m(m_via[0], FUNC(via6522_device::map)); - map(0x3830, 0x3831).w("ay1", FUNC(ay8910_device::address_data_w)); - map(0x3840, 0x3841).w("ay2", FUNC(ay8910_device::address_data_w)); - map(0x3850, 0x3850).nopr(); // watchdog_reset_r ? - map(0x8000, 0x9fff).bankr(m_bank); - map(0xa000, 0xa000).w(FUNC(trvquest_state::bankswitch_w)).nopr(); - map(0xb000, 0xffff).rom(); -} - - - -/************************************* - * - * Input ports - * - *************************************/ - -static INPUT_PORTS_START( trvquest ) - PORT_START("IN0") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Reset") - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(1) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) - - 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_UNKNOWN ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) - - PORT_START("UNK") - 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, 0x40, 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 ) ) - - PORT_START("DSW0") - PORT_DIPNAME( 0x07, 0x01, DEF_STR( Coinage ) ) - PORT_DIPSETTING( 0x06, DEF_STR( 4C_1C ) ) - PORT_DIPSETTING( 0x05, DEF_STR( 3C_1C ) ) - PORT_DIPSETTING( 0x04, DEF_STR( 2C_1C ) ) - PORT_DIPSETTING( 0x01, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) ) - PORT_DIPSETTING( 0x03, DEF_STR( 1C_3C ) ) -// PORT_DIPSETTING( 0x07, DEF_STR( Free_Play ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) - 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, 0x40, 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 - - - -/************************************* - * - * Machine config - * - *************************************/ - -void trvquest_state::trvquest(machine_config &config) -{ - M6809(config, m_maincpu, 6_MHz_XTAL/4); - m_maincpu->set_addrmap(AS_PROGRAM, &trvquest_state::main_map); - - NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1); - - // via - MOS6522(config, m_via[0], 6_MHz_XTAL/4); - m_via[0]->writepa_handler().set(FUNC(trvquest_state::video_data_w)); - m_via[0]->writepb_handler().set(FUNC(trvquest_state::video_command_w)); - m_via[0]->readpb_handler().set(FUNC(trvquest_state::video_status_r)); - m_via[0]->ca2_handler().set(FUNC(trvquest_state::video_command_trigger_w)); - - MOS6522(config, m_via[1], 6_MHz_XTAL/4); - m_via[1]->readpa_handler().set_ioport("IN0"); - m_via[1]->readpb_handler().set_ioport("IN1"); - m_via[1]->ca2_handler().set(FUNC(trvquest_state::coin_w)); - - MOS6522(config, m_via[2], 6_MHz_XTAL/4); - m_via[2]->readpa_handler().set_ioport("UNK"); - m_via[2]->readpb_handler().set_ioport("DSW0"); - m_via[2]->irq_handler().set_inputline(m_maincpu, 0); - - // video hardware - killcom_video(config); - m_screen->screen_vblank().set(m_via[2], FUNC(via6522_device::write_ca1)); - - // sound hardware - SPEAKER(config, "mono").front_center(); - - AY8910(config, "ay1", 6_MHz_XTAL/2).add_route(ALL_OUTPUTS, "mono", 0.25); - AY8910(config, "ay2", 6_MHz_XTAL/2).add_route(ALL_OUTPUTS, "mono", 0.25); -} - - - -/************************************* - * - * ROM defintions - * - *************************************/ - -ROM_START( trvquest ) - ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "rom3", 0xb000, 0x1000, CRC(2ff7f370) SHA1(66f40426ed02ee44235e17a49d9054ede42b83b9) ) - ROM_LOAD( "rom4", 0xc000, 0x1000, CRC(b1adebcb) SHA1(661cabc92b1defce5c2edb8e873a80d5032084d0) ) - ROM_LOAD( "rom5", 0xd000, 0x1000, CRC(2fc10a15) SHA1(8ecce32a5a167056c8fb48554a8907ae6299921e) ) - ROM_LOAD( "rom6", 0xe000, 0x1000, CRC(fabf4846) SHA1(862cac32de78f2ff4afef398b864d5533d302a4f) ) - ROM_LOAD( "rom7", 0xf000, 0x1000, CRC(a9f56551) SHA1(fb6fc3b17a6e66571a5ba837befbfac1ac26cc39) ) - - ROM_REGION( 0x20000, "questions", ROMREGION_ERASEFF ) // Question roms - // 0x00000 - 0x05fff empty - ROM_LOAD( "romi", 0x06000, 0x2000, CRC(c8368f69) SHA1(c1dfb701482c5ae922df0a93665a519995a2f4f1) ) - ROM_LOAD( "romh", 0x08000, 0x2000, CRC(f3aa8a08) SHA1(2bf8f878cc1df84806a6fb8e7be2656c422d61b9) ) - ROM_LOAD( "romg", 0x0a000, 0x2000, CRC(f85f8e48) SHA1(38c9142181a8ee5c0bc80cf2a06d4137fcb2a8b9) ) - ROM_LOAD( "romf", 0x0c000, 0x2000, CRC(2bffdcab) SHA1(96bd9aede5a76f9ddcf29e8df2c632075d21b8f6) ) - ROM_LOAD( "rome", 0x0e000, 0x2000, CRC(3ff66402) SHA1(da13fe6b99d7517ad2ecd0e42d0c306d4e49563a) ) - ROM_LOAD( "romd", 0x10000, 0x2000, CRC(4e21653f) SHA1(719a8dda9b81963a6b6d7d3e4966ecde676b9ecf) ) - ROM_LOAD( "romc", 0x12000, 0x2000, CRC(081a5322) SHA1(09e7ea5f1ee1dc35ec00bcea1550c6fe0bbdf60d) ) - ROM_LOAD( "romb", 0x14000, 0x2000, CRC(819ab451) SHA1(78c181eae63d55d1d0643bb7be07ca3cdbe14285) ) - ROM_LOAD( "roma", 0x16000, 0x2000, CRC(b4bcaf33) SHA1(c6b08fb8d55b2834d0c6c5baff9f544c795e4c15) ) -ROM_END - -} // anonymous namespace - - - -// YEAR NAME PARENT MACHINE INPUT CLASS INIT SCREEN COMPANY FULLNAME FLAGS -GAME( 1984, trvquest, 0, trvquest, trvquest, trvquest_state, empty_init, ROT90, "Techstar / Sunn", "Trivia Quest", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/mame.lst b/src/mame/mame.lst index c3a7beb1423..b3eff7b3cfe 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -460,9 +460,26 @@ ace // [1976 Allied Leisure] @source:alliedleisure/aleisttl.cpp sburners // (c) 1975 Allied Leisure +@source:alliedleisure/aztarac.cpp +aztarac // (c) 1983 Centuri (vector game) + @source:alliedleisure/clayshoo.cpp clayshoo // [1979 Allied Leisure] +@source:alliedleisure/killcom.cpp +challeng // (c) 1981 Centuri +kaos // (c) 1981 +killcom // (c) 1980 Centuri +leprechn // (c) 1982 +leprechna // (c) 1982 +megatack // (c) 1980 Centuri +megatacka // (c) 1980 Centuri +piratetr // (c) 1982 +potogold // (c) 1982 + +@source:alliedleisure/trvquest.cpp +trvquest // (c) 1984 Techstar / Sunn + @source:alpha/alpha68k.cpp btlfield // Alpha-68K96II 'BT' (c) 1987 btlfieldb // bootleg @@ -18592,29 +18609,6 @@ gp2x // GP2X 2005 @source:gamepark/gp32.cpp gp32 // GP32 2001 -@source:gameplan/enigma2.cpp -enigma2 // (c) 1981 Game Plan (Zilec Electronics license) -enigma2a // (c) 1984 Zilec Electronics (bootleg?) -enigma2b // (c) 1981 Zilec Electronics - -@source:gameplan/gameplan.cpp -challeng // (c) 1981 Centuri -kaos // (c) 1981 -killcom // (c) 1980 Centuri -leprechn // (c) 1982 -leprechna // (c) 1982 -megatack // (c) 1980 Centuri -megatacka // (c) 1980 Centuri -piratetr // (c) 1982 -potogold // (c) 1982 - -@source:gameplan/toratora.cpp -toratora // (c) 1980 Game Plan -toratorab // (c) 1980 Game Plan - -@source:gameplan/trvquest.cpp -trvquest // (c) 1984 Sunn / Techstar - @source:gametron/gatron.cpp bingo // Game-A-Tron? poker41 // (c) 1983 Game-A-Tron @@ -28473,9 +28467,6 @@ avtnfl // (c) 1989 AVT avtsym14 // (c) 1985 AVT avtsym25 // (c) 1985 AVT -@source:misc/aztarac.cpp -aztarac // (c) 1983 Centuri (vector game) - @source:misc/babysuprem.cpp bsuprem // (c) 198? Andra / Vifico @@ -29433,6 +29424,11 @@ foolrace avenger // (c) 1975 Electra flyingf // (c) 1976 Electra +@source:misc/enigma2.cpp +enigma2 // (c) 1981 Zilec Electronics (Game Plan license) +enigma2a // (c) 1984 Zilec Electronics (bootleg?) +enigma2b // (c) 1981 Zilec Electronics + @source:misc/epos.cpp catapult // (c) 1982 dealer // (c) 198? @@ -31684,6 +31680,10 @@ tmspoker // icecoldice // (c) ICE tomsadvs // +@source:misc/toratora.cpp +toratora // (c) 1980 Game Plan +toratorab // (c) 1980 Game Plan + @source:misc/triton.cpp triton41 // 1978 Transam Triton L4.1 triton51 // 1979 Transam Triton L5.1 diff --git a/src/mame/misc/aztarac.cpp b/src/mame/misc/aztarac.cpp deleted file mode 100644 index 43d03bea62b..00000000000 --- a/src/mame/misc/aztarac.cpp +++ /dev/null @@ -1,435 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Mathis Rosenhauer -/*************************************************************************** - - Centuri Aztarac hardware - - driver by Mathis Rosenhauer - Thanks to David Fish for additional hardware information. - - Games supported: - * Aztarac - - Known bugs: - * none at this time - -***************************************************************************/ - -#include "emu.h" - -#include "cpu/m68000/m68000.h" -#include "cpu/z80/z80.h" -#include "machine/gen_latch.h" -#include "machine/watchdog.h" -#include "machine/x2212.h" -#include "sound/ay8910.h" -#include "video/vector.h" - -#include "screen.h" -#include "speaker.h" - - -namespace { - -class aztarac_state : public driver_device -{ -public: - aztarac_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_audiocpu(*this, "audiocpu"), - m_nvram(*this, "nvram"), - m_vector(*this, "vector"), - m_screen(*this, "screen"), - m_soundlatch(*this, "soundlatch"), - m_vectorram(*this, "vectorram"), - m_sticky(*this, "STICKY"), - m_stickz(*this, "STICKZ") { } - - void aztarac(machine_config &config); - -protected: - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; - -private: - required_device m_maincpu; - required_device m_audiocpu; - required_device m_nvram; - required_device m_vector; - required_device m_screen; - required_device m_soundlatch; - - required_shared_ptr m_vectorram; - - required_ioport m_sticky; - required_ioport m_stickz; - - uint8_t m_sound_status = 0; - uint32_t m_xcenter = 0; - uint32_t m_ycenter = 0; - - void nvram_store_w(uint16_t data); - uint16_t joystick_r(); - void ubr_w(uint8_t data); - uint8_t sound_r(); - void sound_w(uint8_t data); - uint8_t snd_command_r(); - uint8_t snd_status_r(); - void snd_status_w(uint8_t data); - - void video_interrupt(int state); - INTERRUPT_GEN_MEMBER(snd_timed_irq); - - inline void read_vectorram(int addr, int *x, int *y, int *c); - void main_map(address_map &map); - void sound_map(address_map &map); -}; - - -// audio - -uint8_t aztarac_state::sound_r() -{ - return m_sound_status & 0x01; -} - -void aztarac_state::sound_w(uint8_t data) -{ - m_soundlatch->write(data); - m_sound_status ^= 0x21; - if (m_sound_status & 0x20) - m_audiocpu->set_input_line(0, HOLD_LINE); -} - -uint8_t aztarac_state::snd_command_r() -{ - m_sound_status |= 0x01; - m_sound_status &= ~0x20; - return m_soundlatch->read(); -} - -uint8_t aztarac_state::snd_status_r() -{ - return m_sound_status & ~0x01; -} - -void aztarac_state::snd_status_w(uint8_t data) -{ - m_sound_status &= ~0x10; -} - -INTERRUPT_GEN_MEMBER(aztarac_state::snd_timed_irq) -{ - m_sound_status ^= 0x10; - - if (m_sound_status & 0x10) - device.execute().set_input_line(0,HOLD_LINE); -} - - -// video - -#define AVECTOR(x, y, color, intensity) \ -m_vector->add_point(m_xcenter + ((x) << 16), m_ycenter - ((y) << 16), color, intensity) - - - -void aztarac_state::video_interrupt(int state) -{ - if (state) - m_maincpu->set_input_line(M68K_IRQ_4, ASSERT_LINE); -} - -inline void aztarac_state::read_vectorram(int addr, int *x, int *y, int *c) -{ - *c = m_vectorram[addr] & 0xffff; - *x = m_vectorram[addr + 0x800] & 0x03ff; - *y = m_vectorram[addr + 0x1000] & 0x03ff; - if (*x & 0x200) *x |= 0xfffffc00; - if (*y & 0x200) *y |= 0xfffffc00; -} - -void aztarac_state::ubr_w(uint8_t data) -{ - int x, y, c, intensity, xoffset, yoffset, color; - int defaddr, objaddr = 0, ndefs; - - m_maincpu->set_input_line(M68K_IRQ_4, CLEAR_LINE); - - if (data) // data is the global intensity (always 0xff in Aztarac). - { - m_vector->clear_list(); - - while (1) - { - read_vectorram(objaddr, &xoffset, &yoffset, &c); - objaddr++; - - if (c & 0x4000) - break; - - if ((c & 0x2000) == 0) - { - defaddr = (c >> 1) & 0x7ff; - AVECTOR(xoffset, yoffset, 0, 0); - - read_vectorram(defaddr, &x, &ndefs, &c); - ndefs++; - - if (c & 0xff00) - { - // latch color only once - intensity = (c >> 8); - color = vector_device::color222(c & 0x3f); - while (ndefs--) - { - defaddr++; - read_vectorram(defaddr, &x, &y, &c); - if ((c & 0xff00) == 0) - AVECTOR(x + xoffset, y + yoffset, 0, 0); - else - AVECTOR(x + xoffset, y + yoffset, color, intensity); - } - } - else - { - // latch color for every definition - while (ndefs--) - { - defaddr++; - read_vectorram(defaddr, &x, &y, &c); - color = vector_device::color222(c & 0x3f); - AVECTOR(x + xoffset, y + yoffset, color, c >> 8); - } - } - } - } - } -} - - -void aztarac_state::video_start() -{ - const rectangle &visarea = m_screen->visible_area(); - - int xmin = visarea.min_x; - int ymin = visarea.min_y; - int xmax = visarea.max_x; - int ymax = visarea.max_y; - - m_xcenter = ((xmax + xmin) / 2) << 16; - m_ycenter = ((ymax + ymin) / 2) << 16; -} - - -// machine - -/************************************* - * - * Machine init - * - *************************************/ - -void aztarac_state::machine_start() -{ - save_item(NAME(m_sound_status)); -} - -void aztarac_state::machine_reset() -{ - m_nvram->recall(1); - m_nvram->recall(0); -} - - - -/************************************* - * - * NVRAM handler - * - *************************************/ - -void aztarac_state::nvram_store_w(uint16_t data) -{ - m_nvram->store(1); - m_nvram->store(0); -} - - - -/************************************* - * - * Input ports - * - *************************************/ - -uint16_t aztarac_state::joystick_r() -{ - return (((m_stickz->read() - 0xf) << 8) | - ((m_sticky->read() - 0xf) & 0xff)); -} - - - -/************************************* - * - * Main CPU memory handlers - * - *************************************/ - -void aztarac_state::main_map(address_map &map) -{ - map(0x000000, 0x00bfff).rom(); - map(0x021000, 0x021001).w(FUNC(aztarac_state::nvram_store_w)); - map(0x022000, 0x0221ff).rw(m_nvram, FUNC(x2212_device::read), FUNC(x2212_device::write)).umask16(0x00ff); - map(0x027000, 0x027001).r(FUNC(aztarac_state::joystick_r)); - map(0x027004, 0x027005).portr("INPUTS"); - map(0x027009, 0x027009).rw(FUNC(aztarac_state::sound_r), FUNC(aztarac_state::sound_w)); - map(0x02700c, 0x02700d).portr("DIAL"); - map(0x02700e, 0x02700f).r("watchdog", FUNC(watchdog_timer_device::reset16_r)); - map(0xff8000, 0xffafff).ram().share(m_vectorram); - map(0xffb000, 0xffb001).nopr(); - map(0xffb001, 0xffb001).w(FUNC(aztarac_state::ubr_w)); - map(0xffe000, 0xffffff).ram(); -} - - - -/************************************* - * - * Sound CPU memory handlers - * - *************************************/ - -void aztarac_state::sound_map(address_map &map) -{ - map(0x0000, 0x1fff).rom(); - map(0x8000, 0x87ff).ram(); - map(0x8800, 0x8800).r(FUNC(aztarac_state::snd_command_r)); - map(0x8c00, 0x8c01).rw("ay1", FUNC(ay8910_device::data_r), FUNC(ay8910_device::data_address_w)); - map(0x8c02, 0x8c03).rw("ay2", FUNC(ay8910_device::data_r), FUNC(ay8910_device::data_address_w)); - map(0x8c04, 0x8c05).rw("ay3", FUNC(ay8910_device::data_r), FUNC(ay8910_device::data_address_w)); - map(0x8c06, 0x8c07).rw("ay4", FUNC(ay8910_device::data_r), FUNC(ay8910_device::data_address_w)); - map(0x9000, 0x9000).rw(FUNC(aztarac_state::snd_status_r), FUNC(aztarac_state::snd_status_w)); -} - - - -/************************************* - * - * Port definitions - * - *************************************/ - -static INPUT_PORTS_START( aztarac ) - PORT_START("STICKZ") - PORT_BIT( 0x1f, 0xf, IPT_AD_STICK_Z ) PORT_MINMAX(0, 0x1e) PORT_SENSITIVITY(100) PORT_KEYDELTA(1) - - PORT_START("STICKY") - PORT_BIT( 0x1f, 0xf, IPT_AD_STICK_Y ) PORT_MINMAX(0, 0x1e) PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_REVERSE - - PORT_START("DIAL") - PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X) PORT_REVERSE - - PORT_START("INPUTS") - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_LOW) -INPUT_PORTS_END - - - -/************************************* - * - * Machine drivers - * - *************************************/ - -void aztarac_state::aztarac(machine_config &config) -{ - // basic machine hardware - m68000_device &maincpu(M68000(config, m_maincpu, 16_MHz_XTAL / 2)); - maincpu.set_addrmap(AS_PROGRAM, &aztarac_state::main_map); - maincpu.set_cpu_space(AS_PROGRAM); - - Z80(config, m_audiocpu, 16_MHz_XTAL / 8); - m_audiocpu->set_addrmap(AS_PROGRAM, &aztarac_state::sound_map); - m_audiocpu->set_periodic_int(FUNC(aztarac_state::snd_timed_irq), attotime::from_hz(100)); - - X2212(config, m_nvram); - - WATCHDOG_TIMER(config, "watchdog"); - - // video hardware - VECTOR(config, m_vector, 0); - SCREEN(config, m_screen, SCREEN_TYPE_VECTOR); - m_screen->set_refresh_hz(40); - m_screen->set_size(400, 300); - m_screen->set_visarea(0, 1024-1, 0, 768-1); - m_screen->set_screen_update("vector", FUNC(vector_device::screen_update)); - m_screen->screen_vblank().set(FUNC(aztarac_state::video_interrupt)); - - // sound hardware - SPEAKER(config, "mono").front_center(); - - GENERIC_LATCH_8(config, m_soundlatch); - - AY8910(config, "ay1", 16_MHz_XTAL / 8).add_route(ALL_OUTPUTS, "mono", 0.15); - - AY8910(config, "ay2", 16_MHz_XTAL / 8).add_route(ALL_OUTPUTS, "mono", 0.15); - - AY8910(config, "ay3", 16_MHz_XTAL / 8).add_route(ALL_OUTPUTS, "mono", 0.15); - - AY8910(config, "ay4", 16_MHz_XTAL / 8).add_route(ALL_OUTPUTS, "mono", 0.15); -} - - - -/************************************* - * - * ROM definitions - * - *************************************/ - -ROM_START( aztarac ) - ROM_REGION( 0xc000, "maincpu", 0 ) - ROM_LOAD16_BYTE( "6.l8", 0x000000, 0x001000, CRC(25f8da18) SHA1(e8179ba3683e39c8225b549ead74c8af2d0a0b3e) ) - ROM_LOAD16_BYTE( "0.n8", 0x000001, 0x001000, CRC(04e20626) SHA1(2b6a04992037257830df2c01a6da748fb4449f79) ) - ROM_LOAD16_BYTE( "7.l7", 0x002000, 0x001000, CRC(230e244c) SHA1(42283a368144acf2aad2ef390e312e0951c3ea64) ) - ROM_LOAD16_BYTE( "1.n7", 0x002001, 0x001000, CRC(37b12697) SHA1(da288b077902e3205600a021c3fac5730f9fb832) ) - ROM_LOAD16_BYTE( "8.l6", 0x004000, 0x001000, CRC(1293fb9d) SHA1(5a8d512372fd38f1a55f990f5c3eb51833c463d8) ) - ROM_LOAD16_BYTE( "2.n6", 0x004001, 0x001000, CRC(712c206a) SHA1(eb29f161189c14d84896502940e3ab6cc3bd1cd0) ) - ROM_LOAD16_BYTE( "9.l5", 0x006000, 0x001000, CRC(743a6501) SHA1(da83a8f756466bcd94d4b0cc28a1a1858e9532f3) ) - ROM_LOAD16_BYTE( "3.n5", 0x006001, 0x001000, CRC(a65cbf99) SHA1(dd06f98c0989604bd4ac6317e545e1fcf6722e75) ) - ROM_LOAD16_BYTE( "a.l4", 0x008000, 0x001000, CRC(9cf1b0a1) SHA1(dd644026f49d8430c0b4cf4c750dc33c013c19fc) ) - ROM_LOAD16_BYTE( "4.n4", 0x008001, 0x001000, CRC(5f0080d5) SHA1(fb1303f9a02067faea2ac4d523051c416de9cf35) ) - ROM_LOAD16_BYTE( "b.l3", 0x00a000, 0x001000, CRC(8cc7f7fa) SHA1(fefb9a4fdd63878bc5d8138e3e8456cb6638425a) ) - ROM_LOAD16_BYTE( "5.n3", 0x00a001, 0x001000, CRC(40452376) SHA1(1d058b7ecd2bbff3393950aab9215b262908475b) ) - - ROM_REGION( 0x10000, "audiocpu", 0 ) - ROM_LOAD( "c.j4", 0x0000, 0x1000, CRC(e897dfcd) SHA1(750df3d08512d8098a13ec62677831efa164c126) ) - ROM_LOAD( "d.j3", 0x1000, 0x1000, CRC(4016de77) SHA1(7232ec003f1b9d3623d762f3270108a1d1837846) ) - - ROM_REGION( 0x3000, "proms", 0 ) // not hooked up - ROM_LOAD( "l5.l5", 0x0000, 0x0020, CRC(317fb438) SHA1(3130e1dbde06228707ba46ae85d8df8cc8f32b67) ) - ROM_LOAD( "k8.k8", 0x0000, 0x1000, CRC(596ad8d9) SHA1(7e2d2d3e02712911ef5ef55d1df5740f6ec28bcb) ) - ROM_LOAD( "k9.k9", 0x0000, 0x1000, CRC(b8544823) SHA1(78ff1fcb7e640929765533592015cfccef690179) ) -ROM_END - -} // anonymous namespace - - -/************************************* - * - * Game drivers - * - *************************************/ - -GAME( 1983, aztarac, 0, aztarac, aztarac, aztarac_state, empty_init, ROT0, "Centuri", "Aztarac", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/misc/enigma2.cpp b/src/mame/misc/enigma2.cpp new file mode 100644 index 00000000000..5e47aeacbe1 --- /dev/null +++ b/src/mame/misc/enigma2.cpp @@ -0,0 +1,829 @@ +// license:BSD-3-Clause +// copyright-holders:Pierpaolo Prazzoli, Tomasz Slanina +/******************************************************************** + +Enigma 2 (C) Zilec Electronics / Game Plan + +driver by Pierpaolo Prazzoli and Tomasz Slanina + + +enigma2 (1981) + 2xZ80 + AY8910 + Original dedicated board + +enigma2a (1984?) + Conversion applied to a Taito Space Invaders Part II board set with 1984 copyright. hack / Bootleg ? + +enigma2b (1981) + Conversion like enigma2a, but boots with 1981 copyright and Phantoms II title + +TODO: + - enigma2 - Star blinking frequency + - enigma2 - Sound is incorrectly emulated (see MT07777) + - enigma2a + enigma2b - bad sound ROM? + + +********************************************************************* +Enigma II, Game Plan, 1981 +PCB hardware notes by Guru + +GAME PLAN (C) 1981 +|------------------------------------------------------------------------------------------------------------| +| 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 | +| LS157 LS32 LS283 LS86 LS86 LS86 LS86 LS27 LS32 LS02 LS161 LS161 LS161 LS161 LS74 LS107 LS04 A| +| 10MHz| +| |---| | +| LS165 LS10 LS157 LS157 LS157 LS157 LS42 2114 2114 2114 2114 2114 2114 2114 2114 | | B| +| |Z80| LS161 | +| | | | +| LS08 2114 2114 2114 2114 2114 2114 2114 2114 | | C| +| LS165 |---| LS161 | +| | +| LS74 6.13D 5.11D 4.10D 3.8D 2.7D 1.5D LS138 LS244 LS04 D| +| LS245 | +| | +| LS42 |---| LS32 E| +| DIPSW(8) | A | | +| | Y | 9.2F | +|2 LS240 LS21 LS04 LS08 8.13F 7.11F LS244 | 3 | F| +|2 | 8 | 2114 | +|W LS175 LS04 | 9 | | +|A LS240 LS07 LS08 LS157 LS08 LS174 | 1 | 2114 G| +|Y | 0 | LS42 | +| |---| |----------| | +| LS164 | Z80 | H| +| LM380N VOLUME LS02 4040 |----------| | +| | +|------------------------------------------------------------------------------------------------------------| +Notes: (all IC's shown) + Z80 - Clock 2.5MHz (both) [10/4] + AY3-8910 - Clock 1.25MHz [10/8] + LM380N - 2.5w Audio Power Amp IC (DIP14) + 2114 - 1kx4-bit SRAM + 1.xx to 8.xx - 2716 EPROM + 9.2F - 2532 EPROM + HSync - 15.0539kHz + VSync - measured between 52Hz and 53Hz (moving) + + +Edge Connector +-------------- + + Parts Solder + ------|------ + +5V 1 | A +5V + +5V 2 | B +5V + - 3 | C - + 2P THRUST 4 | D - + - 5 | E - + - 6 | F 2P RIGHT + 2P LEFT 7 | H 2P FIRE + 1P THRUST 8 | J 1P START + 2P START 9 | K COIN + - 10 | L 1P RIGHT + 1P LEFT 11 | M 1P FIRE + BLUE 12 | N GREEN + SYNC 13 | P RED +COMPOSITE VIDEO 14 | R - + - 15 | S - + - 16 | T - + SLAM 17 | U - + - 18 | V - + SPEAKER+ 19 | W SPEAKER- + +12V 20 | X +12V + GND 21 | Y GND + GND 22 | Z GND + +DIP Switches +------------ + ++-----------------+---+---+---+---+---+---+---+---+ +| Default=* | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | ++-----------------+---+---+---+---+---+---+---+---+ +|Coinage 1C 1P* | |ON | | +| 2C 1P | |OFF| | ++-----------------+-------+---+---+---------------+ +|Cabinet Upright* | |ON | | +| Cocktail | |OFF| | ++-----------------+---+---+---+-------------------+ +|Lives 3* |ON |ON | | +| 4 |OFF|ON | | +| 5 |ON |OFF| | +| 6 |OFF|OFF| | ++-----------------+---+---+-----------+---+---+---+ +|Difficulty 1 | |OFF|ON |OFF| +| 2 | |OFF|ON |ON | +| 3* | |OFF|OFF|OFF| +| 4 | |OFF|OFF|ON | +| 5 | |ON |OFF|OFF| +| 6 | |ON |OFF|ON | ++-----------------+---------------+---+---+---+---+ +|# OF INVADERS 16*| |OFF| | +| 32 | |ON | | ++-----------------+---------------+---+-----------+ + +*********************************************************************/ + +#include "emu.h" +#include "cpu/i8085/i8085.h" +#include "cpu/z80/z80.h" +#include "sound/ay8910.h" +#include "emupal.h" +#include "screen.h" +#include "speaker.h" + +#define LOG_PROT (1U << 1) + +#define VERBOSE (0) +#include "logmacro.h" + + +namespace { + +/* these values provide a fairly low refresh rate of around 53Hz, but + they were derived from the schematics. The horizontal synch chain + counts from 0x0c0-0x1ff and the vertical one from 0x0d8-0x1ff. */ + +#define MASTER_CLOCK (10000000) +#define CPU_CLOCK (MASTER_CLOCK / 4) +#define PIXEL_CLOCK (MASTER_CLOCK / 2) +#define AY8910_CLOCK (MASTER_CLOCK / 8) +#define HCOUNTER_START (0x0c0) +#define HCOUNTER_END (0x1ff) +#define HTOTAL (HCOUNTER_END + 1 - HCOUNTER_START) +#define HBEND (0x000) +#define HBSTART (0x100) +#define VCOUNTER_START (0x0d8) +#define VCOUNTER_END (0x1ff) +#define VTOTAL (VCOUNTER_END + 1 - VCOUNTER_START) +#define VBEND (0x048) +#define VBSTART (VTOTAL) + +/* the IRQ line is cleared (active LO) at these vertical sync counter + values and raised one scan line later */ +#define INT_TRIGGER_COUNT_1 (0x10f) +#define INT_TRIGGER_COUNT_2 (0x18f) + + +class enigma2_state : public driver_device +{ +public: + enigma2_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_audiocpu(*this, "audiocpu"), + m_screen(*this, "screen"), + m_palette(*this, "palette"), + m_colors(*this, "colors"), + m_stars(*this, "stars"), + m_videoram(*this, "videoram") + { } + + void enigma2(machine_config &config); + void enigma2a(machine_config &config); + + void init_enigma2(); + + DECLARE_CUSTOM_INPUT_MEMBER(p1_controls_r); + DECLARE_CUSTOM_INPUT_MEMBER(p2_controls_r); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + +private: + required_device m_maincpu; + required_device m_audiocpu; + required_device m_screen; + optional_device m_palette; + optional_region_ptr m_colors; + optional_region_ptr m_stars; + required_shared_ptr m_videoram; + + int m_blink_count = 0; + uint8_t m_sound_latch = 0; + uint8_t m_last_sound_data = 0; + uint8_t m_protection_data = 0; + uint8_t m_flip_screen = 0; + + emu_timer *m_interrupt_clear_timer = nullptr; + emu_timer *m_interrupt_assert_timer = nullptr; + + uint8_t dip_switch_r(offs_t offset); + void sound_data_w(uint8_t data); + void enigma2_flip_screen_w(uint8_t data); + uint8_t sound_latch_r(); + void protection_data_w(uint8_t data); + uint32_t screen_update_enigma2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_enigma2a(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + TIMER_CALLBACK_MEMBER(interrupt_clear_callback); + TIMER_CALLBACK_MEMBER(interrupt_assert_callback); + inline uint16_t vpos_to_vysnc_chain_counter( int vpos ); + inline int vysnc_chain_counter_to_vpos( uint16_t counter ); + void create_interrupt_timers(); + void start_interrupt_timers(); + + void enigma2_audio_cpu_map(address_map &map); + void enigma2_main_cpu_map(address_map &map); + void enigma2a_main_cpu_io_map(address_map &map); + void enigma2a_main_cpu_map(address_map &map); +}; + + +/************************************* + * + * Interrupt generation + * + *************************************/ + + +uint16_t enigma2_state::vpos_to_vysnc_chain_counter( int vpos ) +{ + return vpos + VCOUNTER_START; +} + + +int enigma2_state::vysnc_chain_counter_to_vpos( uint16_t counter ) +{ + return counter - VCOUNTER_START; +} + + +TIMER_CALLBACK_MEMBER(enigma2_state::interrupt_clear_callback) +{ + m_maincpu->set_input_line(0, CLEAR_LINE); +} + + +TIMER_CALLBACK_MEMBER(enigma2_state::interrupt_assert_callback) +{ + uint16_t next_counter; + int next_vpos; + + /* compute vector and set the interrupt line */ + int vpos = m_screen->vpos(); + uint16_t counter = vpos_to_vysnc_chain_counter(vpos); + uint8_t vector = 0xc7 | ((counter & 0x80) >> 3) | ((~counter & 0x80) >> 4); + m_maincpu->set_input_line_and_vector(0, ASSERT_LINE, vector); // Z80 + + /* set up for next interrupt */ + if (counter == INT_TRIGGER_COUNT_1) + next_counter = INT_TRIGGER_COUNT_2; + else + next_counter = INT_TRIGGER_COUNT_1; + + next_vpos = vysnc_chain_counter_to_vpos(next_counter); + m_interrupt_assert_timer->adjust(m_screen->time_until_pos(next_vpos)); + m_interrupt_clear_timer->adjust(m_screen->time_until_pos(vpos + 1)); +} + + +void enigma2_state::create_interrupt_timers( ) +{ + m_interrupt_clear_timer = timer_alloc(FUNC(enigma2_state::interrupt_clear_callback), this); + m_interrupt_assert_timer = timer_alloc(FUNC(enigma2_state::interrupt_assert_callback), this); +} + + +void enigma2_state::start_interrupt_timers( ) +{ + int vpos = vysnc_chain_counter_to_vpos(INT_TRIGGER_COUNT_1); + m_interrupt_assert_timer->adjust(m_screen->time_until_pos(vpos)); +} + + + +void enigma2_state::machine_start() +{ + create_interrupt_timers(); + + save_item(NAME(m_blink_count)); + save_item(NAME(m_sound_latch)); + save_item(NAME(m_last_sound_data)); + save_item(NAME(m_protection_data)); + save_item(NAME(m_flip_screen)); +} + + +void enigma2_state::machine_reset() +{ + m_audiocpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); + + m_last_sound_data = 0; + m_flip_screen = 0; + m_sound_latch = 0; + m_blink_count = 0; + + start_interrupt_timers(); +} + + +/************************************* + * + * Video system + * + *************************************/ + +uint32_t enigma2_state::screen_update_enigma2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + const rectangle &visarea = screen.visible_area(); + + uint8_t x = 0; + uint16_t bitmap_y = visarea.min_y; + uint8_t y = (uint8_t)vpos_to_vysnc_chain_counter(bitmap_y); + uint8_t video_data = 0; + uint8_t fore_color = 0; + uint8_t star_color = 0; + + while (1) + { + uint8_t bit; + uint8_t color; + + /* read the video RAM */ + if ((x & 0x07) == 0x00) + { + offs_t color_map_address = (y >> 3 << 5) | (x >> 3); + + /* the schematics shows it like this, but it doesn't work as this would + produce no stars, due to the contents of the PROM -- maybe there is + a star disabled bit somewhere that's connected here instead of flip_screen() */ + /* star_map_address = (y >> 4 << 6) | (enigma2_flip_screen_get() << 5) | (x >> 3); */ + offs_t star_map_address = (y >> 4 << 6) | 0x20 | (x >> 3); + if (m_blink_count & 0x08) + star_map_address |= 0x400; + + offs_t videoram_address = (y << 5) | (x >> 3); + + /* when the screen is flipped, all the video address bits are inverted, + and the adder at 16A is activated */ + if (m_flip_screen) + { + color_map_address |= 0x400; + videoram_address = (~videoram_address + 0x0400) & 0x1fff; + } + + video_data = m_videoram[videoram_address]; + + fore_color = m_colors[color_map_address] & 0x07; + star_color = m_stars[star_map_address] & 0x07; + } + + /* plot the current pixel */ + if (m_flip_screen) + { + bit = video_data & 0x80; + video_data = video_data << 1; + } + else + { + bit = video_data & 0x01; + video_data = video_data >> 1; + } + + if (bit) + color = fore_color; + else + /* stars only appear at certain positions */ + color = ((x & y & 0x0f) == 0x0f) ? star_color : 0; + + bitmap.pix(bitmap_y, x) = m_palette->pen_color(color); + + /* next pixel */ + x = x + 1; + + /* end of line? */ + if (x == 0) + { + /* end of screen? */ + if (bitmap_y == visarea.max_y) + break; + + /* next row */ + y = y + 1; + bitmap_y = bitmap_y + 1; + } + } + + m_blink_count++; + + return 0; +} + + +uint32_t enigma2_state::screen_update_enigma2a(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + uint8_t x = 0; + const rectangle &visarea = screen.visible_area(); + uint16_t bitmap_y = visarea.min_y; + uint8_t y = (uint8_t)vpos_to_vysnc_chain_counter(bitmap_y); + uint8_t video_data = 0; + + while (1) + { + uint8_t bit; + pen_t pen; + + /* read the video RAM */ + if ((x & 0x07) == 0x00) + { + offs_t videoram_address = (y << 5) | (x >> 3); + + /* when the screen is flipped, all the video address bits are inverted, + and the adder at 16A is activated */ + if (m_flip_screen) videoram_address = (~videoram_address + 0x0400) & 0x1fff; + + video_data = m_videoram[videoram_address]; + } + + /* plot the current pixel */ + if (m_flip_screen) + { + bit = video_data & 0x80; + video_data = video_data << 1; + } + else + { + bit = video_data & 0x01; + video_data = video_data >> 1; + } + + pen = bit ? rgb_t::white() : rgb_t::black(); + bitmap.pix(bitmap_y, x) = pen; + + /* next pixel */ + x = x + 1; + + /* end of line? */ + if (x == 0) + { + /* end of screen? */ + if (bitmap_y == visarea.max_y) + break; + + /* next row */ + y = y + 1; + bitmap_y = bitmap_y + 1; + } + } + + return 0; +} + + + +uint8_t enigma2_state::dip_switch_r(offs_t offset) +{ + uint8_t ret = 0x00; + + LOGMASKED(LOG_PROT, "DIP SW Read: %x at %x (prot data %x)\n", offset, m_maincpu->pc(), m_protection_data); + switch (offset) + { + case 0x01: + /* For the DIP switches to be read, protection_data must be + 0xff on reset. The AY8910 reset ensures this. */ + if (m_protection_data != 0xff) + ret = m_protection_data ^ 0x88; + else + ret = ioport("DSW")->read(); + break; + + case 0x02: + if (m_maincpu->pc() == 0x07e5) + ret = 0xaa; + else + ret = 0xf4; + break; + + case 0x35: ret = 0x38; break; + case 0x51: ret = 0xaa; break; + case 0x79: ret = 0x38; break; + } + + return ret; +} + + +void enigma2_state::sound_data_w(uint8_t data) +{ + /* clock sound latch shift register on rising edge of D2 */ + if (!(data & 0x04) && (m_last_sound_data & 0x04)) + m_sound_latch = (m_sound_latch << 1) | (~data & 0x01); + + m_audiocpu->set_input_line(INPUT_LINE_NMI, (data & 0x02) ? ASSERT_LINE : CLEAR_LINE); + + m_last_sound_data = data; +} + + +uint8_t enigma2_state::sound_latch_r() +{ + return bitswap<8>(m_sound_latch,0,1,2,3,4,5,6,7); +} + + +void enigma2_state::protection_data_w(uint8_t data) +{ + LOGMASKED(LOG_PROT, "%s: Protection Data Write: %x\n", machine().describe_context(), data); + m_protection_data = data; +} + + +void enigma2_state::enigma2_flip_screen_w(uint8_t data) +{ + m_flip_screen = ((data >> 5) & 0x01) && ((ioport("DSW")->read() & 0x20) == 0x20); +} + + +CUSTOM_INPUT_MEMBER(enigma2_state::p1_controls_r) +{ + return ioport("P1CONTROLS")->read(); +} + + +CUSTOM_INPUT_MEMBER(enigma2_state::p2_controls_r) +{ + if (m_flip_screen) + return ioport("P2CONTROLS")->read(); + else + return ioport("P1CONTROLS")->read(); +} + +void enigma2_state::enigma2_main_cpu_map(address_map &map) +{ + map.global_mask(0x7fff); + map(0x0000, 0x1fff).rom().nopw(); + map(0x2000, 0x3fff).mirror(0x4000).ram().share("videoram"); + map(0x4000, 0x4fff).rom().nopw(); + map(0x5000, 0x57ff).r(FUNC(enigma2_state::dip_switch_r)).nopw(); + map(0x5800, 0x5800).mirror(0x07f8).noprw(); + map(0x5801, 0x5801).mirror(0x07f8).portr("IN0").nopw(); + map(0x5802, 0x5802).mirror(0x07f8).portr("IN1").nopw(); + map(0x5803, 0x5803).mirror(0x07f8).nopr().w(FUNC(enigma2_state::sound_data_w)); + map(0x5804, 0x5804).mirror(0x07f8).noprw(); + map(0x5805, 0x5805).mirror(0x07f8).nopr().w(FUNC(enigma2_state::enigma2_flip_screen_w)); + map(0x5806, 0x5807).mirror(0x07f8).noprw(); +} + + +void enigma2_state::enigma2a_main_cpu_map(address_map &map) +{ + map(0x0000, 0x1fff).rom().nopw(); + map(0x2000, 0x3fff).mirror(0x4000).ram().share("videoram"); + map(0x4000, 0x4fff).rom().nopw(); + map(0x5000, 0x57ff).r(FUNC(enigma2_state::dip_switch_r)).nopw(); + map(0x5800, 0x5fff).noprw(); +} + + +void enigma2_state::enigma2a_main_cpu_io_map(address_map &map) +{ + map.global_mask(0x7); + map(0x00, 0x00).noprw(); + map(0x01, 0x01).portr("IN0").nopw(); + map(0x02, 0x02).portr("IN1").nopw(); + map(0x03, 0x03).nopr().w(FUNC(enigma2_state::sound_data_w)); + map(0x04, 0x04).noprw(); + map(0x05, 0x05).nopr().w(FUNC(enigma2_state::enigma2_flip_screen_w)); + map(0x06, 0x07).noprw(); +} + + +void enigma2_state::enigma2_audio_cpu_map(address_map &map) +{ + map(0x0000, 0x0fff).mirror(0x1000).rom().nopw(); + map(0x2000, 0x7fff).noprw(); + map(0x8000, 0x83ff).mirror(0x1c00).ram(); + map(0xa000, 0xa001).mirror(0x1ffc).w("aysnd", FUNC(ay8910_device::address_data_w)); + map(0xa002, 0xa002).mirror(0x1ffc).r("aysnd", FUNC(ay8910_device::data_r)); + map(0xa003, 0xa003).mirror(0x1ffc).noprw(); + map(0xc000, 0xffff).noprw(); +} + + + +static INPUT_PORTS_START( enigma2 ) + PORT_START("IN0") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 ) + PORT_BIT( 0x78, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(enigma2_state, p1_controls_r) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("IN1") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x78, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(enigma2_state, p2_controls_r) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("DSW") + PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("DSW:!1,!2") + PORT_DIPSETTING( 0x00, "3" ) + PORT_DIPSETTING( 0x01, "4" ) + PORT_DIPSETTING( 0x02, "5" ) + PORT_DIPSETTING( 0x03, "6" ) + PORT_DIPNAME( 0x1c, 0x00, "Skill Level" ) PORT_DIPLOCATION("DSW:!6,!7,!8") + PORT_DIPSETTING( 0x00, "1" ) + PORT_DIPSETTING( 0x04, "2" ) + PORT_DIPSETTING( 0x0c, "3" ) + PORT_DIPSETTING( 0x08, "4" ) + PORT_DIPSETTING( 0x10, "5" ) + PORT_DIPSETTING( 0x14, "6" ) + PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("DSW:!3") + PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) + PORT_DIPSETTING( 0x20, DEF_STR( Cocktail ) ) + PORT_DIPNAME( 0x40, 0x40, "Number of Invaders" ) PORT_DIPLOCATION("DSW:!5") + PORT_DIPSETTING( 0x40, "16" ) + PORT_DIPSETTING( 0x00, "32" ) + PORT_DIPNAME( 0x80, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("DSW:!4") + PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) + + PORT_START("P1CONTROLS") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(1) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(1) + PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("P2CONTROLS") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2) + PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED ) +INPUT_PORTS_END + + +static INPUT_PORTS_START( enigma2a ) + PORT_START("IN0") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 ) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(enigma2_state, p1_controls_r) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("IN1") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(enigma2_state, p2_controls_r) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("DSW") + PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("DSW:1,2") + PORT_DIPSETTING( 0x00, "3" ) + PORT_DIPSETTING( 0x01, "4" ) + PORT_DIPSETTING( 0x02, "5" ) + PORT_DIPSETTING( 0x03, "6" ) + PORT_DIPNAME( 0x1c, 0x00, "Skill Level" ) PORT_DIPLOCATION("DSW:6,7,8") + PORT_DIPSETTING( 0x00, "1" ) + PORT_DIPSETTING( 0x04, "2" ) + PORT_DIPSETTING( 0x0c, "3" ) + PORT_DIPSETTING( 0x08, "4" ) + PORT_DIPSETTING( 0x10, "5" ) + PORT_DIPSETTING( 0x14, "6" ) + PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("DSW:3") + PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) + PORT_DIPSETTING( 0x20, DEF_STR( Cocktail ) ) + PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW:5") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x40, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("DSW:4") + PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) + + PORT_START("P1CONTROLS") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(1) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(1) + PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("P2CONTROLS") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2) + PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNUSED ) +INPUT_PORTS_END + + +void enigma2_state::enigma2(machine_config &config) +{ + /* basic machine hardware */ + Z80(config, m_maincpu, CPU_CLOCK); + m_maincpu->set_addrmap(AS_PROGRAM, &enigma2_state::enigma2_main_cpu_map); + + Z80(config, m_audiocpu, 2500000); + m_audiocpu->set_addrmap(AS_PROGRAM, &enigma2_state::enigma2_audio_cpu_map); + m_audiocpu->set_periodic_int(FUNC(enigma2_state::irq0_line_hold), attotime::from_hz(8*52)); + + /* video hardware */ + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_raw(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART); + m_screen->set_screen_update(FUNC(enigma2_state::screen_update_enigma2)); + + PALETTE(config, m_palette, palette_device::GBR_3BIT); + + /* audio hardware */ + SPEAKER(config, "mono").front_center(); + + ay8910_device &aysnd(AY8910(config, "aysnd", AY8910_CLOCK)); + aysnd.port_a_read_callback().set(FUNC(enigma2_state::sound_latch_r)); + aysnd.port_b_write_callback().set(FUNC(enigma2_state::protection_data_w)); + aysnd.add_route(ALL_OUTPUTS, "mono", 1.0); +} + + +void enigma2_state::enigma2a(machine_config &config) +{ + /* basic machine hardware */ + I8080(config, m_maincpu, CPU_CLOCK); + m_maincpu->set_addrmap(AS_PROGRAM, &enigma2_state::enigma2a_main_cpu_map); + m_maincpu->set_addrmap(AS_IO, &enigma2_state::enigma2a_main_cpu_io_map); + + Z80(config, m_audiocpu, 2500000); + m_audiocpu->set_addrmap(AS_PROGRAM, &enigma2_state::enigma2_audio_cpu_map); + m_audiocpu->set_periodic_int(FUNC(enigma2_state::irq0_line_hold), attotime::from_hz(8*52)); + + /* video hardware */ + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_raw(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART); + m_screen->set_screen_update(FUNC(enigma2_state::screen_update_enigma2a)); + + /* audio hardware */ + SPEAKER(config, "mono").front_center(); + + ay8910_device &aysnd(AY8910(config, "aysnd", AY8910_CLOCK)); + aysnd.port_a_read_callback().set(FUNC(enigma2_state::sound_latch_r)); + aysnd.port_b_write_callback().set(FUNC(enigma2_state::protection_data_w)); + aysnd.add_route(ALL_OUTPUTS, "mono", 1.0); +} + + + +ROM_START( enigma2 ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "1.5d", 0x0000, 0x0800, CRC(499749de) SHA1(401928ff41d3b4cbb68e6ad3bf3be4a10ae1781f) ) + ROM_LOAD( "2.7d", 0x0800, 0x0800, CRC(173c1329) SHA1(3f1ad46d0e58ab236e4ff2b385d09fbf113627da) ) + ROM_LOAD( "3.8d", 0x1000, 0x0800, CRC(c7d3e6b1) SHA1(43f7c3a02b46747998260d5469248f21714fe12b) ) + ROM_LOAD( "4.10d", 0x1800, 0x0800, CRC(c6a7428c) SHA1(3503f09856655c5973fb89f60d1045fe41012aa9) ) + ROM_LOAD( "5.11d", 0x4000, 0x0800, CRC(098ac15b) SHA1(cce28a2540a9eabb473391fff92895129ae41751) ) + ROM_LOAD( "6.13d", 0x4800, 0x0800, CRC(240a9d4b) SHA1(ca1c69fafec0471141ce1254ddfaef54fecfcbf0) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) + ROM_LOAD( "9.2f", 0x0000, 0x1000, CRC(68fd8c54) SHA1(69996d5dfd996f0aacb26e397bef314204a2a88a) ) + + ROM_REGION( 0x0800, "colors", 0 ) + ROM_LOAD( "7.11f", 0x0000, 0x0800, CRC(409b5aad) SHA1(1b774a70f725637458ed68df9ed42476291b0e43) ) + + ROM_REGION( 0x0800, "stars", 0 ) + ROM_LOAD( "8.13f", 0x0000, 0x0800, CRC(e9cb116d) SHA1(41da4f46c5614ec3345c233467ebad022c6b0bf5) ) +ROM_END + + +ROM_START( enigma2a ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "36_en1.bin", 0x0000, 0x0800, CRC(15f44806) SHA1(4a2f7bc91d4edf7a069e0865d964371c97af0a0a) ) + ROM_LOAD( "35_en2.bin", 0x0800, 0x0800, CRC(e841072f) SHA1(6ab02fd9fdeac5ab887cd25eee3d6b70ab01f849) ) + ROM_LOAD( "34_en3.bin", 0x1000, 0x0800, CRC(43d06cf4) SHA1(495af05d54c0325efb67347f691e64d194645d85) ) + ROM_LOAD( "33_en4.bin", 0x1800, 0x0800, CRC(8879a430) SHA1(c97f44bef3741eef74e137d2459e79f1b3a90457) ) + ROM_LOAD( "5.11d", 0x4000, 0x0800, CRC(098ac15b) SHA1(cce28a2540a9eabb473391fff92895129ae41751) ) + ROM_LOAD( "6.13d", 0x4800, 0x0800, CRC(240a9d4b) SHA1(ca1c69fafec0471141ce1254ddfaef54fecfcbf0) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) + ROM_LOAD( "sound.bin", 0x0000, 0x0800, BAD_DUMP CRC(5f092d3c) SHA1(17c70f6af1b5560a45e6b1bdb330a98b27570fe9) ) +ROM_END + +ROM_START( enigma2b ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "ic36.bin", 0x0000, 0x0800, CRC(71dc9ecc) SHA1(a41260259cf0a36b01b5e8ad35cf968e920d22d9) ) + ROM_LOAD( "ic35.bin", 0x0800, 0x0800, CRC(e841072f) SHA1(6ab02fd9fdeac5ab887cd25eee3d6b70ab01f849) ) + ROM_LOAD( "ic34.bin", 0x1000, 0x0800, CRC(1384073d) SHA1(7a3a910c0431e680cc952a10a040b02f3df0532a) ) + ROM_LOAD( "ic33.bin", 0x1800, 0x0800, CRC(ac6c2410) SHA1(d35565a5ffe795d0c36970bd9c2f948bf79e0ed8) ) + ROM_LOAD( "ic32.bin", 0x4000, 0x0800, CRC(098ac15b) SHA1(cce28a2540a9eabb473391fff92895129ae41751) ) + ROM_LOAD( "ic42.bin", 0x4800, 0x0800, CRC(240a9d4b) SHA1(ca1c69fafec0471141ce1254ddfaef54fecfcbf0) ) + + /* this rom was completely broken on this pcb.. */ + ROM_REGION( 0x10000, "audiocpu", 0 ) + ROM_LOAD( "sound.bin", 0x0000, 0x0800, BAD_DUMP CRC(5f092d3c) SHA1(17c70f6af1b5560a45e6b1bdb330a98b27570fe9) ) +ROM_END + + +void enigma2_state::init_enigma2() +{ + uint8_t *rom = memregion("audiocpu")->base(); + for (offs_t i = 0; i < 0x2000; i++) + { + rom[i] = bitswap<8>(rom[i],4,5,6,0,7,1,3,2); + } +} + +} // Anonymous namespace + + +GAME( 1981, enigma2, 0, enigma2, enigma2, enigma2_state, init_enigma2, ROT270, "Zilec Electronics (Game Plan license)", "Enigma II", MACHINE_SUPPORTS_SAVE ) +GAME( 1984, enigma2a, enigma2, enigma2a, enigma2a, enigma2_state, init_enigma2, ROT270, "Zilec Electronics", "Enigma II (Space Invaders hardware)", MACHINE_SUPPORTS_SAVE ) +GAME( 1981, enigma2b, enigma2, enigma2a, enigma2a, enigma2_state, init_enigma2, ROT270, "Zilec Electronics", "Phantoms II (Space Invaders hardware)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/misc/toratora.cpp b/src/mame/misc/toratora.cpp new file mode 100644 index 00000000000..4c423ff886e --- /dev/null +++ b/src/mame/misc/toratora.cpp @@ -0,0 +1,526 @@ +// license:BSD-3-Clause +// copyright-holders:Nicola Salmoria +/******************************************************************************* + +Tora Tora (c) 1980 Game Plan + +driver by Nicola Salmoria, qwijibo + + +deviations from schematics verified on set 2 pcb: + +main pcb: +- U33.3 connected to /IRQ line via inverter U67.9, + providing timer IRQ for input polling. + +- U43 removed from timer circuit, U52.9 wired directly to + U32.5, increasing timer frequency to 250 Hz. + +audio pcb: +- U6.10 wired to U14.21, cut from R14/16 +- R16 wired to R1 in series, R1 cut from GND +- R14 wired to GND instead of U6.10 + +- U5.10 wired to U15.21, cut from R13/15 +- R15 wired to R2 in series, R2 cut from GND +- R13 wired to GND instead of U5.10 + +- EXT VCO DACs (U11, U12) and surrounding logic not placed +- Numerous changes to SN74677 timing component R & C values + + +TODO: +- The game reads some unmapped memory addresses, missing ROMs? There's an empty + socket for U3 on the board, which should map at 5000-57ff, however the game + reads mostly from 4800-4fff, which would be U6 according to the schematics. + +- The manual mentions dip switch settings and the schematics show the switches, + the game reads them but ignores them, forcing 1C/1C and 3 lives. + Maybe the dump is from a proto? + Set 2 dump does read dip switches, so likely not a proto. + +- Bullet and explosion audio frequencies seem incorrect + +- Who designed/developed the game? Taiyo System is mentioned online, but there's + no solid proof. It's more likely an American game. At the end of tora.u11, + there's "EMS INC.,1979". + +*******************************************************************************/ + +#include "emu.h" + +#include "cpu/m6800/m6800.h" +#include "machine/6821pia.h" +#include "machine/input_merger.h" +#include "sound/sn76477.h" + +#include "screen.h" +#include "speaker.h" + +#include "toratora.lh" + + +namespace { + +class toratora_state : public driver_device +{ +public: + toratora_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_irq(*this, "irq"), + m_pia(*this, "pia%u", 1U), + m_screen(*this, "screen"), + m_sn(*this, "sn%u", 1U), + m_videoram(*this, "videoram"), + m_dsw(*this, "DSW") + { } + + void toratora(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + +private: + required_device m_maincpu; + required_device m_irq; + required_device_array m_pia; + required_device m_screen; + required_device_array m_sn; + required_shared_ptr m_videoram; + required_ioport m_dsw; + + emu_timer *m_timer; + uint8_t m_timer_count = 0; + bool m_timer_clk = false; + bool m_clear_tv = false; + bool m_dsw_enable = true; + + void clear_tv_w(uint8_t data); + uint8_t timer_r(); + void clear_timer_w(uint8_t data); + uint8_t dsw_r(); + void dsw_enable_w(int state); + void coin_w(offs_t offset, uint8_t data, uint8_t mem_mask); + template void sn_vco_voltage_w(uint8_t data); + void sn1_w(uint8_t data); + void sn2_w(uint8_t data); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + TIMER_CALLBACK_MEMBER(toratora_timer); + + void main_map(address_map &map); +}; + + + +/************************************* + * + * Initialization + * + *************************************/ + +void toratora_state::machine_start() +{ + // 500Hz timer from 2*9602 + m_timer = timer_alloc(FUNC(toratora_state::toratora_timer), this); + m_timer->adjust(attotime::from_hz(500), 0, attotime::from_hz(500)); + + m_pia[0]->ca1_w(0); + m_pia[0]->ca2_w(0); + + save_item(NAME(m_timer_count)); + save_item(NAME(m_timer_clk)); + save_item(NAME(m_clear_tv)); + save_item(NAME(m_dsw_enable)); +} + +void toratora_state::machine_reset() +{ + m_timer_count = 0; + m_clear_tv = false; +} + + + +/************************************* + * + * Video hardware + * + *************************************/ + +uint32_t toratora_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + for (offs_t offs = 0; offs < m_videoram.bytes(); offs++) + { + uint8_t y = offs >> 5; + uint8_t x = offs << 3; + uint8_t data = m_videoram[offs]; + + for (int i = 0; i < 8; i++) + { + pen_t pen = (data & 0x80) ? rgb_t::white() : rgb_t::black(); + if (cliprect.contains(x, y)) + bitmap.pix(y, x) = pen; + + data = data << 1; + x = x + 1; + } + + // the video system clears as it writes out the pixels + if (m_clear_tv) + m_videoram[offs] = 0; + } + + m_clear_tv = false; + + return 0; +} + +void toratora_state::clear_tv_w(uint8_t data) +{ + m_clear_tv = true; +} + + + +/************************************* + * + * Audio hardware + * + *************************************/ + +template +void toratora_state::sn_vco_voltage_w(uint8_t data) +{ + m_sn[N]->vco_voltage_w(2.35 * (data & 0x7f) / 128.0); + m_sn[N]->enable_w(BIT(data, 7)); +} + +// U14 +void toratora_state::sn1_w(uint8_t data) +{ + static const double resistances[] = + { + RES_INF, // N/C + RES_INF, // R39 not placed + RES_K(10) + RES_K(10) + RES_K(24) + RES_K(51) + RES_K(100) + RES_K(240), + RES_K(10) + RES_K(10) + RES_K(24) + RES_K(51) + RES_K(100), + RES_K(10) + RES_K(10) + RES_K(24) + RES_K(51), + RES_K(10) + RES_K(10) + RES_K(24), + RES_K(10) + RES_K(10), + RES_INF + }; + + m_sn[0]->mixer_a_w(BIT(data, 0)); + m_sn[0]->mixer_b_w(BIT(data, 1)); + m_sn[0]->mixer_c_w(BIT(data, 2)); + m_sn[0]->envelope_1_w(BIT(data, 3)); + m_sn[0]->envelope_2_w(BIT(data, 4)); + + uint8_t res = data >> 5 & 0x7; + m_sn[0]->slf_res_w(resistances[res]); + m_sn[0]->slf_cap_voltage_w(res == 0x7 ? 2.5 : sn76477_device::EXTERNAL_VOLTAGE_DISCONNECT); + + // Seems like the output should be muted when res == 0, but unsure of exact mechanism + m_sn[0]->amplitude_res_w(resistances[res]); +} + +// U15 +void toratora_state::sn2_w(uint8_t data) +{ + static const double resistances[] = + { + RES_INF, // N/C + RES_K(10) + RES_K(10) + RES_K(24) + RES_K(51) + RES_K(100) + RES_M(240) + RES_M(2), + RES_K(10) + RES_K(10) + RES_K(24) + RES_K(51) + RES_K(100) + RES_K(240), + RES_K(10) + RES_K(10) + RES_K(24) + RES_K(51) + RES_K(100), + RES_K(10) + RES_K(10) + RES_K(24) + RES_K(51), + RES_K(10) + RES_K(10) + RES_K(24), + RES_K(10) + RES_K(10), + RES_INF + }; + + m_sn[1]->mixer_a_w(BIT(data, 0)); + m_sn[1]->mixer_b_w(BIT(data, 1)); + m_sn[1]->mixer_c_w(BIT(data, 2)); + m_sn[1]->envelope_1_w(BIT(data, 3)); + m_sn[1]->envelope_2_w(BIT(data, 4)); + + uint8_t res = data >> 5 & 0x7; + m_sn[1]->slf_res_w(resistances[res]); + + // TODO: Determine proper 7441 output voltage here. + // Datasheet lists 2.5 V max under worst conditions, probably much lower in reality? + // However, shot audio is muted if V < 1.0, as mixer state is set to SLF & VCO. + // Should SLF FF state be inverted? + m_sn[1]->slf_cap_voltage_w(res == 0x7 ? 2.5 : sn76477_device::EXTERNAL_VOLTAGE_DISCONNECT); +} + + + +/************************************* + * + * Timer + * + *************************************/ + +TIMER_CALLBACK_MEMBER(toratora_state::toratora_timer) +{ + // RAM refresh circuit halts the cpu for 64 cycles + m_maincpu->adjust_icount(-64); + + m_timer_clk = !m_timer_clk; + + if (m_timer_clk) + { + // timer counting at 250 Hz. (500 Hz / 2 via U52.9) + // U43 removed from circuit, U52.9 wired to U32.5) + m_timer_count++; + + // U33 bit 0 routed to /IRQ line after inverting through U67.9 + m_irq->in_w<0>(BIT(m_timer_count, 4)); + + // also, when the timer overflows, watchdog would kick in + if (m_timer_count == 0) + machine().schedule_soft_reset(); + } +} + +uint8_t toratora_state::timer_r() +{ + return m_timer_count; +} + +void toratora_state::clear_timer_w(uint8_t data) +{ + m_timer_count = 0; + m_irq->in_w<0>(0); +} + + + +/************************************* + * + * Misc. I/O + * + *************************************/ + +void toratora_state::dsw_enable_w(int state) +{ + m_dsw_enable = !state; +} + +uint8_t toratora_state::dsw_r() +{ + return m_dsw_enable ? m_dsw->read() : 0; +} + +void toratora_state::coin_w(offs_t offset, uint8_t data, uint8_t mem_mask) +{ + data |= ~mem_mask; + machine().bookkeeping().coin_counter_w(0, data & 0x20); +} + + + +/************************************* + * + * Memory handlers + * + * No mirrors, all addresses are + * fully decoded by the hardware! + * + *************************************/ + +void toratora_state::main_map(address_map &map) +{ + map(0x0000, 0x0fff).ram(); + map(0x1000, 0x7fff).rom(); // not fully populated + map(0x8000, 0x9fff).ram().share(m_videoram); + map(0xa000, 0xf047).noprw(); + map(0xf048, 0xf049).noprw(); + map(0xf04a, 0xf04a).w(FUNC(toratora_state::clear_tv_w)); // the read is mark !LEDEN, but not used + map(0xf04b, 0xf04b).rw(FUNC(toratora_state::timer_r), FUNC(toratora_state::clear_timer_w)); + map(0xf04c, 0xf09f).noprw(); + map(0xf0a0, 0xf0a3).rw(m_pia[0], FUNC(pia6821_device::read), FUNC(pia6821_device::write)); + map(0xf0a4, 0xf0a7).rw(m_pia[1], FUNC(pia6821_device::read), FUNC(pia6821_device::write)); + map(0xf0a8, 0xf0ab).rw(m_pia[2], FUNC(pia6821_device::read), FUNC(pia6821_device::write)); + map(0xf0ac, 0xf7ff).noprw(); + map(0xf800, 0xffff).rom(); +} + + + +/************************************* + * + * Port definition + * + *************************************/ + +static INPUT_PORTS_START( toratora ) + PORT_START("INPUT") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_16WAY + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_16WAY + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 ) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START1 ) + PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("COIN") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_WRITE_LINE_DEVICE_MEMBER("pia1", pia6821_device, ca2_w) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_WRITE_LINE_DEVICE_MEMBER("pia1", pia6821_device, ca1_w) + + PORT_START("DSW") + PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("U13:!1,!2") + PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x02, DEF_STR( 1C_3C ) ) + PORT_DIPSETTING( 0x03, DEF_STR( 1C_5C ) ) + PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("U13:!3,!4") + PORT_DIPSETTING( 0x04, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x02, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x08, DEF_STR( 1C_3C ) ) + PORT_DIPSETTING( 0x0c, DEF_STR( 1C_5C ) ) + PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("U13:!5") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x10, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("U13:!6") + PORT_DIPSETTING( 0x00, "3" ) + PORT_DIPSETTING( 0x20, "4" ) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) +INPUT_PORTS_END + + + +/************************************* + * + * Machine driver + * + *************************************/ + +void toratora_state::toratora(machine_config &config) +{ + // basic machine hardware + M6800(config, m_maincpu, 5.185_MHz_XTAL / 8); // 5.185 MHz XTAL divided by 8 (@ U94.12) + m_maincpu->set_addrmap(AS_PROGRAM, &toratora_state::main_map); + + INPUT_MERGER_ANY_HIGH(config, m_irq); + m_irq->output_handler().set_inputline(m_maincpu, 0); + + PIA6821(config, m_pia[0]); // U1 + m_pia[0]->readpa_handler().set_ioport("INPUT"); + m_pia[0]->writepb_handler().set(FUNC(toratora_state::coin_w)); + m_pia[0]->irqa_handler().set(m_irq, FUNC(input_merger_device::in_w<1>)); + m_pia[0]->irqb_handler().set(m_irq, FUNC(input_merger_device::in_w<2>)); + + PIA6821(config, m_pia[1]); // U2 + m_pia[1]->writepa_handler().set(FUNC(toratora_state::sn_vco_voltage_w<0>)); + m_pia[1]->readpb_handler().set(FUNC(toratora_state::dsw_r)); + m_pia[1]->writepb_handler().set(FUNC(toratora_state::sn1_w)); + m_pia[1]->ca2_handler().set(m_sn[0], FUNC(sn76477_device::vco_w)); + m_pia[1]->cb2_handler().set(FUNC(toratora_state::dsw_enable_w)); + + PIA6821(config, m_pia[2]); // U3 + m_pia[2]->writepa_handler().set(FUNC(toratora_state::sn_vco_voltage_w<1>)); + m_pia[2]->writepb_handler().set(FUNC(toratora_state::sn2_w)); + m_pia[2]->ca2_handler().set(m_sn[1], FUNC(sn76477_device::vco_w)); + + // video hardware + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_video_attributes(VIDEO_ALWAYS_UPDATE); + m_screen->set_raw(5.185_MHz_XTAL, 256+40, 0, 256, 256+31+4, 8, 248); + m_screen->set_screen_update(FUNC(toratora_state::screen_update)); + + // audio hardware + SPEAKER(config, "mono").front_center(); + + for (int i = 0; i < 2; i++) + { + SN76477(config, m_sn[i]); + m_sn[i]->set_noise_params(RES_K(47), RES_K(470), CAP_P(470)); + m_sn[i]->set_decay_res(RES_M(2)); + m_sn[i]->set_attack_params(CAP_U(0.2), RES_K(3.3)); + m_sn[i]->set_amp_res(RES_K(47)); + m_sn[i]->set_feedback_res(RES_K(50)); + m_sn[i]->set_vco_params(0, CAP_U(0.1), RES_K(51)); + m_sn[i]->set_pitch_voltage(5.0); + m_sn[i]->set_slf_params(CAP_U(1.0), RES_K(10)); + m_sn[i]->set_oneshot_params(CAP_U(0.1), RES_K(100)); + m_sn[i]->set_vco_mode(0); + m_sn[i]->set_mixer_params(0, 0, 0); + m_sn[i]->set_envelope_params(0, 0); + m_sn[i]->set_enable(1); + m_sn[i]->add_route(ALL_OUTPUTS, "mono", 0.50); + } +} + + + +/************************************* + * + * ROM definition + * + *************************************/ + +ROM_START( toratora ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "tora.u1", 0x1000, 0x0800, CRC(413c743a) SHA1(a887dfaaee557327a1699bb424488b934dab8612) ) + ROM_LOAD( "tora.u10", 0x1800, 0x0800, CRC(dc771b1c) SHA1(1bd81decb4d0a854878227c52d45ac0eea0602ec) ) + ROM_LOAD( "tora.u2", 0x2000, 0x0800, CRC(c574c664) SHA1(9f41a53ca51d04e5bec7525fe83c5f4bdfcf128d) ) + ROM_LOAD( "tora.u9", 0x2800, 0x0800, CRC(b67aa11f) SHA1(da9e77255640a4b32eed2be89b686b98a248bd72) ) + ROM_LOAD( "tora.u11", 0xf800, 0x0800, CRC(55135d6f) SHA1(c48f180a9d6e894aafe87b2daf74e9a082f4600e) ) +ROM_END + + +/* Tora Tora? Game Plan? +Etched in copper on top of board 20-00047C + 20-10051A + +Etched in copper on back of daughter board 20-00048C + 20-10052A + +ROM text showed TORA TOR* * was A with bit 7 set + 1980 GAME PLAN,INC + +and war stuff (PLANE, BOMB, SQUAD, etc) + +.u2 2716 handwritten sticker U-2 +.u9 2716 handwritten sticker U-9 +.u10 2716 handwritten sticker U-10 +.u11 2716 handwritten sticker U-11 + +open 24 pin socket @ U1 and U3 +open 40 pin socket @ U42 + +Main board +crystal with 5 185 on the top +5280 x8 +socketed ds8833 x2 +socketed ds8t28 x2 + +Daughter board +open 40 pin socket @ U3 @ U2 +76477 x2 */ + +ROM_START( toratorab ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "1027.u1", 0x1000, 0x0800, BAD_DUMP CRC(413c743a) SHA1(a887dfaaee557327a1699bb424488b934dab8612) ) // rom u1 is missing in this set, using the toratora one + ROM_LOAD( "1027.u10", 0x1800, 0x0800, CRC(6a906292) SHA1(4ceff91b7dcd398e57cd19a91d2199c09cb37c39) ) + ROM_LOAD( "1027.u2", 0x2000, 0x0800, CRC(c1331648) SHA1(379101c6c1b8dab3e043ece01579cc96f6bb18a9) ) + ROM_LOAD( "1027.u9", 0x2800, 0x0800, CRC(59b021b5) SHA1(ea5a0c1f58c0e08231969ad161b79af6e1ae4431) ) + ROM_LOAD( "1027.u11", 0xf800, 0x0800, CRC(336f6659) SHA1(ea1151db54b68316908874da6983d6de5c94c29e) ) +ROM_END + +} // anonymous namespace + + + +/************************************* + * + * Game driver + * + *************************************/ + +GAMEL( 1980, toratora, 0, toratora, toratora, toratora_state, empty_init, ROT90, "Game Plan", "Tora Tora (prototype?)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE, layout_toratora ) +GAMEL( 1980, toratorab, toratora, toratora, toratora, toratora_state, empty_init, ROT90, "Game Plan", "Tora Tora (set 2)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE, layout_toratora ) -- cgit v1.2.3