summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Robbbert <Robbbert@users.noreply.github.com>2019-07-27 02:31:23 +1000
committer Robbbert <Robbbert@users.noreply.github.com>2019-07-27 02:31:23 +1000
commit7c6fe0d8049841544d100a1af4e0044d3c66dff7 (patch)
treea5e710bc49c696ae3d38ede048d5cc1b6b77d76b
parent330561ce1c89a5a8e989d0a303e4281545307562 (diff)
(nw) mp68a: added cassette interface.
-rw-r--r--src/mame/drivers/didact.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/mame/drivers/didact.cpp b/src/mame/drivers/didact.cpp
index 0fa835eb64f..683edb3e8e0 100644
--- a/src/mame/drivers/didact.cpp
+++ b/src/mame/drivers/didact.cpp
@@ -12,7 +12,7 @@
* "Modulab v2" appears to have been owned or licensed to Esselte and enhanced with more modular monitor routines
* in a project driven by Alf Karlsson.
*
- * The Esselte 1000 was an educational package based on Apple II plus software and litterature
+ * The Esselte 1000 was an educational package based on Apple II plus software and literature
* but the relation to Didact is at this point unknown so it is probably a pure Esselte software production.
*
* Misc links about the boards supported by this driver.
@@ -52,6 +52,7 @@
#include "imagedev/cassette.h"
#include "bus/rs232/rs232.h"
#include "screen.h"
+#include "speaker.h"
// Generated artwork includes
#include "mp68a.lh"
@@ -94,6 +95,7 @@ class didact_state : public driver_device
public:
didact_state(const machine_config &mconfig, device_type type, const char * tag)
: driver_device(mconfig, type, tag)
+ , m_cass(*this, "cassette")
, m_io_lines(*this, "LINE%u", 0U)
, m_lines{ 0, 0, 0, 0 }
, m_rs232(*this, "rs232")
@@ -105,6 +107,7 @@ class didact_state : public driver_device
protected:
virtual void machine_start() override { m_led.resolve(); }
+ optional_device<cassette_image_device> m_cass;
required_ioport_array<5> m_io_lines;
uint8_t m_lines[4];
uint8_t m_reset;
@@ -323,6 +326,7 @@ void md6802_state::md6802_map(address_map &map)
// Just a statement that the real mp68a hardware was designed with 6820 and not 6821
// They are functional equivalents BUT has different electrical characteristics.
+// 2019-07-27 Cassette added: saves ok, load is unreliable, probably an original design problem.
#define pia6820_device pia6821_device
#define PIA6820 PIA6821
class mp68a_state : public didact_state
@@ -434,6 +438,7 @@ READ8_MEMBER( mp68a_state::pia2_kbB_r )
LOGKBD(" SHIFT is released\n");
}
+ pb |= (m_cass->input() < 0.04) ? 0x20 : 0;
LOGKBD("%02x\n", pb);
return pb;
@@ -442,6 +447,7 @@ READ8_MEMBER( mp68a_state::pia2_kbB_r )
WRITE8_MEMBER( mp68a_state::pia2_kbB_w )
{
LOG("--->%s(%02x)\n", FUNCNAME, data);
+ m_cass->output(BIT(data, 4) ? -1.0 : +1.0);
}
READ_LINE_MEMBER( mp68a_state::pia2_cb1_r )
@@ -882,6 +888,12 @@ void mp68a_state::mp68a(machine_config &config)
DM9368(config, m_digits[3], 0).update_cb().set(FUNC(mp68a_state::digit_w<3>));
DM9368(config, m_digits[4], 0).update_cb().set(FUNC(mp68a_state::digit_w<4>));
DM9368(config, m_digits[5], 0).update_cb().set(FUNC(mp68a_state::digit_w<5>));
+
+ /* Cassette */
+ SPEAKER(config, "mono").front_center();
+ 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);
}
ROM_START( modulab )