From a8221fdf4b343a2982e444c5c226bff64306232a Mon Sep 17 00:00:00 2001 From: Robbbert Date: Fri, 19 Jul 2019 20:33:46 +1000 Subject: (nw) korvet: added cassette skeleton. Marked all 4 machines in this driver as MNW. --- src/mame/drivers/pk8020.cpp | 29 ++++++++++++++++++++--------- src/mame/includes/pk8020.h | 34 ++++++++++++++++++---------------- src/mame/machine/pk8020.cpp | 5 ++++- 3 files changed, 42 insertions(+), 26 deletions(-) diff --git a/src/mame/drivers/pk8020.cpp b/src/mame/drivers/pk8020.cpp index eb3bb7fb4e0..08c507743d9 100644 --- a/src/mame/drivers/pk8020.cpp +++ b/src/mame/drivers/pk8020.cpp @@ -2,10 +2,20 @@ // copyright-holders:Miodrag Milanovic, AJR /*************************************************************************** - PK-8020 driver by Miodrag Milanovic - based on work of Sergey Erokhin from pk8020.narod.ru +PK-8020 driver by Miodrag Milanovic + based on work of Sergey Erokhin from pk8020.narod.ru - 18/07/2008 Preliminary driver. +2008-07-18 Preliminary driver. + +Cassette is "best guess", as I was unable to locate any recordings, and +also do not know the commands to save and load. SAVE and LOAD appear when +F2 or shift-F2 pressed (in Korvet), but only produce errors. + +Status as at 2019-07-19: +Korvet - can boot CP/M, but the keyboard then doesn't work. +Neiva - keyboard not working +BK8T - keyboard not working, stuck at a "config" screen. +Kontur - needs to boot from a floppy and we don't have any that work ****************************************************************************/ @@ -306,8 +316,9 @@ void pk8020_state::pk8020(machine_config &config) SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.50); - //CASSETTE(config, m_cass).set_default_state(CASSETTE_PLAY); - //m_cass->add_route(ALL_OUTPUTS, "mono", 0.05); + CASSETTE(config, m_cass); + m_cass->set_default_state(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED); + m_cass->add_route(ALL_OUTPUTS, "mono", 0.05); CENTRONICS(config, m_printer, centronics_devices, nullptr); m_printer->busy_handler().set(m_inr, FUNC(pic8259_device::ir6_w)).invert(); @@ -378,7 +389,7 @@ ROM_END /* Driver */ /* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ -COMP( 1987, korvet, 0, 0, pk8020, pk8020, pk8020_state, empty_init, "", "PK8020 Korvet", MACHINE_SUPPORTS_SAVE) -COMP( 1987, neiva, korvet, 0, pk8020, pk8020, pk8020_state, empty_init, "", "PK8020 Neiva", MACHINE_SUPPORTS_SAVE) -COMP( 1987, kontur, korvet, 0, pk8020, pk8020, pk8020_state, empty_init, "", "PK8020 Kontur", MACHINE_SUPPORTS_SAVE) -COMP( 1987, bk8t, korvet, 0, pk8020, pk8020, pk8020_state, empty_init, "", "BK-8T", MACHINE_SUPPORTS_SAVE) +COMP( 1987, korvet, 0, 0, pk8020, pk8020, pk8020_state, empty_init, "", "PK8020 Korvet", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE) +COMP( 1987, neiva, korvet, 0, pk8020, pk8020, pk8020_state, empty_init, "", "PK8020 Neiva", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE) +COMP( 1987, kontur, korvet, 0, pk8020, pk8020, pk8020_state, empty_init, "", "PK8020 Kontur", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE) +COMP( 1987, bk8t, korvet, 0, pk8020, pk8020, pk8020_state, empty_init, "", "BK-8T", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE) diff --git a/src/mame/includes/pk8020.h b/src/mame/includes/pk8020.h index e6f2c2eb6f4..67c6299c292 100644 --- a/src/mame/includes/pk8020.h +++ b/src/mame/includes/pk8020.h @@ -26,22 +26,23 @@ class pk8020_state : public driver_device { public: - pk8020_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_decplm(*this, "decplm"), - m_devbank(*this, "devbank"), - m_ram(*this, RAM_TAG), - m_ios(*this, "ios%u", 1U), - m_fdc(*this, "fdc"), - m_floppy(*this, "fdc:%u", 0U), - m_inr(*this, "inr"), - m_speaker(*this, "speaker"), - m_printer(*this, "printer"), - m_region_maincpu(*this, "maincpu"), - m_region_gfx1(*this, "gfx1"), - m_io_port(*this, "LINE%u", 0U), - m_palette(*this, "palette") + pk8020_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_decplm(*this, "decplm") + , m_devbank(*this, "devbank") + , m_ram(*this, RAM_TAG) + , m_ios(*this, "ios%u", 1U) + , m_fdc(*this, "fdc") + , m_floppy(*this, "fdc:%u", 0U) + , m_cass(*this, "cassette") + , m_inr(*this, "inr") + , m_speaker(*this, "speaker") + , m_printer(*this, "printer") + , m_region_maincpu(*this, "maincpu") + , m_region_gfx1(*this, "gfx1") + , m_io_port(*this, "LINE%u", 0U) + , m_palette(*this, "palette") { } void pk8020(machine_config &config); @@ -101,6 +102,7 @@ private: required_device_array m_ios; required_device m_fdc; required_device_array m_floppy; + required_device m_cass; required_device m_inr; required_device m_speaker; required_device m_printer; diff --git a/src/mame/machine/pk8020.cpp b/src/mame/machine/pk8020.cpp index e81857cd095..57bcb5d9f08 100644 --- a/src/mame/machine/pk8020.cpp +++ b/src/mame/machine/pk8020.cpp @@ -95,7 +95,7 @@ void pk8020_state::memory_w(offs_t offset, uint8_t data) uint8_t pk8020_state::ppi_porta_r() { - return 0xf0 | (m_takt <<1) | (m_text_attr)<<3; + return 0xf0 | (m_takt <<1) | (m_text_attr<<3) | ((m_cass->input() > +0.04) ? 1 : 0); } void pk8020_state::floppy_control_w(uint8_t data) @@ -125,6 +125,9 @@ void pk8020_state::floppy_control_w(uint8_t data) void pk8020_state::ppi_2_portc_w(uint8_t data) { + static const double levels[4] = { 0.0, 1.0, -1.0, 0.0 }; + m_cass->output(levels[data & 3]); + m_sound_gate = BIT(data,3); m_speaker->level_w(m_sound_gate ? m_sound_level : 0); -- cgit v1.2.3