From 7bf06f6268e859a6f7dc939868337e7087a50245 Mon Sep 17 00:00:00 2001 From: hap Date: Fri, 27 May 2022 23:03:23 +0200 Subject: [PATCH] miconkit: added ppi8255 chip --- src/mame/drivers/miconkit.cpp | 53 ++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/src/mame/drivers/miconkit.cpp b/src/mame/drivers/miconkit.cpp index b9e56e4c307..806090b45eb 100644 --- a/src/mame/drivers/miconkit.cpp +++ b/src/mame/drivers/miconkit.cpp @@ -2,29 +2,29 @@ // copyright-holders:hap /****************************************************************************** -SNK Micon-Kit / Micon-Block +SNK Micon-Kit series Games on this hardware: - Micon-Kit - Micon-Kit Part II (aka Yamato) - Space Micon Kit -The upright cabinet versions were called Micon-Block. +The cocktail cabinets were called Table Micon, and the upright version of the +first game was apparently called Micon-Block. Micon-Kit was SNK's first arcade game, it's a simple Breakout clone. The sequel adds moving obstacles. The 3rd game in the series, Space Micon Kit, adds a 2nd row of bricks. Hardware notes: -- 8080 CPU -- 4KB ROM, 256 bytes RAM -- 4KB VRAM, 1bpp video with color overlay +- NEC 8080A, 18.432MHz XTAL +- NEC 8228, NEC 8255C +- 4KB ROM (4*MB8518), 256 bytes RAM, 4KB VRAM +- 1bpp video with color overlay, 11MHz XTAL - beeper TODO: -- unknown exact CPU type -- unknown XTAL/CPU clock -- any peripheral chips? +- verify CPU clock divider - correct video timing ******************************************************************************/ @@ -32,6 +32,7 @@ TODO: #include "emu.h" #include "cpu/i8085/i8085.h" +#include "machine/i8255.h" #include "sound/beep.h" #include "screen.h" @@ -48,6 +49,7 @@ public: miconkit_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), + m_ppi(*this, "ppi"), m_screen(*this, "screen"), m_vram(*this, "vram"), m_beeper(*this, "beeper"), @@ -61,6 +63,7 @@ protected: private: required_device m_maincpu; + required_device m_ppi; required_device m_screen; required_shared_ptr m_vram; required_device m_beeper; @@ -73,8 +76,7 @@ private: u8 paddle_r(); void sound_w(u8 data); - u8 port2_r(); - void port2_w(u8 data); + u8 vblank_r(); void select_w(u8 data); u8 input_r(); @@ -125,19 +127,14 @@ void miconkit_state::sound_w(u8 data) m_beeper->set_clock(248 * data); } -void miconkit_state::port2_w(u8 data) -{ - // ? -} - void miconkit_state::select_w(u8 data) { // d0: input select - // other: unused? + // other: ? m_select = data & 1; } -u8 miconkit_state::port2_r() +u8 miconkit_state::vblank_r() { // d6: vblank flag // other: ? @@ -166,10 +163,7 @@ void miconkit_state::main_map(address_map &map) void miconkit_state::io_map(address_map &map) { - map(0x00, 0x00).r(FUNC(miconkit_state::paddle_r)); - map(0x01, 0x01).w(FUNC(miconkit_state::sound_w)); - map(0x02, 0x02).rw(FUNC(miconkit_state::port2_r), FUNC(miconkit_state::port2_w)); - map(0x03, 0x03).w(FUNC(miconkit_state::select_w)); + map(0x00, 0x03).rw(m_ppi, FUNC(i8255_device::read), FUNC(i8255_device::write)); map(0x04, 0x04).r(FUNC(miconkit_state::input_r)); } @@ -221,10 +215,16 @@ INPUT_PORTS_END void miconkit_state::micon2(machine_config &config) { // basic machine hardware - I8080A(config, m_maincpu, 2000000); + I8080A(config, m_maincpu, 18.432_MHz_XTAL / 9); m_maincpu->set_addrmap(AS_PROGRAM, &miconkit_state::main_map); m_maincpu->set_addrmap(AS_IO, &miconkit_state::io_map); + I8255(config, m_ppi); + m_ppi->in_pa_callback().set(FUNC(miconkit_state::paddle_r)); + m_ppi->out_pb_callback().set(FUNC(miconkit_state::sound_w)); + m_ppi->out_pc_callback().set(FUNC(miconkit_state::select_w)); + m_ppi->in_pc_callback().set(FUNC(miconkit_state::vblank_r)); + // video hardware SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_refresh_hz(60); @@ -232,6 +232,7 @@ void miconkit_state::micon2(machine_config &config) m_screen->set_visarea(0, 240-1, 12, 128-12-1); m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); m_screen->set_screen_update(FUNC(miconkit_state::screen_update)); + m_screen->screen_vblank().set(m_ppi, FUNC(i8255_device::pc4_w)); // sound hardware SPEAKER(config, "mono").front_center(); @@ -246,10 +247,10 @@ void miconkit_state::micon2(machine_config &config) ROM_START( micon2 ) ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "ufo_0", 0x0000, 0x0400, CRC(3eb5a299) SHA1(5e7de4cb8312be8b84f7e5e035b61a6cb9798bc0) ) - ROM_LOAD( "ufo_1", 0x0400, 0x0400, CRC(e796338e) SHA1(86c5f283b4a41e19dd0b624d04e1a62ff2ffbf58) ) - ROM_LOAD( "ufo_2", 0x0800, 0x0400, CRC(bf246cd7) SHA1(147fb9b877ee108c9c09461ae7e0d72af9ab3275) ) - ROM_LOAD( "ufo_3", 0x0c00, 0x0400, CRC(0e93b4f0) SHA1(9405e85a7e005edd0043cb43ce2ef283b4c1b341) ) + ROM_LOAD( "ufo_n2_0", 0x0000, 0x0400, CRC(3eb5a299) SHA1(5e7de4cb8312be8b84f7e5e035b61a6cb9798bc0) ) + ROM_LOAD( "ufo_n2_1", 0x0400, 0x0400, CRC(e796338e) SHA1(86c5f283b4a41e19dd0b624d04e1a62ff2ffbf58) ) + ROM_LOAD( "ufo_n2_2", 0x0800, 0x0400, CRC(bf246cd7) SHA1(147fb9b877ee108c9c09461ae7e0d72af9ab3275) ) + ROM_LOAD( "ufo_n2_3", 0x0c00, 0x0400, CRC(0e93b4f0) SHA1(9405e85a7e005edd0043cb43ce2ef283b4c1b341) ) ROM_END } // anonymous namespace