summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/ms6102.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/ms6102.cpp')
-rw-r--r--src/mame/drivers/ms6102.cpp40
1 files changed, 26 insertions, 14 deletions
diff --git a/src/mame/drivers/ms6102.cpp b/src/mame/drivers/ms6102.cpp
index 1806d6e013d..d14dd877154 100644
--- a/src/mame/drivers/ms6102.cpp
+++ b/src/mame/drivers/ms6102.cpp
@@ -11,14 +11,13 @@
Photos
To do:
- - why DMA stops after 2nd char on each row?
- - what does second 8275 do?
+ - character attributes
- keyboard (MS7002)
Chips:
- DD5 - KR580WM80A (8080 clone) - CPU
- DD7 - KR580WT57 (8257 clone) - DMAC
- - DD9 - KR1601RR1 (ER2401 clone) - NVRAM
+ - DD9 - KR1601RR1 (1024x4 bit NVRAM)
- DD21 - KR581WA1A (TR6402 clone) - UART
- DD55, DD56 - KR580WG75 (8275 clone) - CRTC
- DD59 - KR556RT5 - alternate chargen ROM
@@ -40,7 +39,7 @@
#include "machine/i8251.h"
#include "machine/i8257.h"
#include "machine/keyboard.h"
-#include "machine/nvram.h"
+#include "machine/kr1601rr1.h"
#include "machine/pit8253.h"
#include "video/i8275.h"
@@ -48,7 +47,7 @@
#define LOG_GENERAL (1U << 0)
-//#define VERBOSE (LOG_GENERAL)
+#define VERBOSE (LOG_GENERAL)
//#define LOG_OUTPUT_FUNC printf
#include "logmacro.h"
@@ -60,7 +59,7 @@ public:
: driver_device(mconfig, type, tag)
, m_p_videoram(*this, "videoram")
, m_maincpu(*this, "maincpu")
- , m_nvram(*this, "nvram")
+ , m_earom(*this, "earom")
, m_pic(*this, "i8214")
, m_dma8257(*this, "dma8257")
, m_i8251(*this, "i8251")
@@ -76,9 +75,11 @@ public:
void ms6102(machine_config &config);
void ms6102_io(address_map &map);
void ms6102_mem(address_map &map);
+
protected:
virtual void machine_reset() override;
virtual void machine_start() override;
+
private:
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
@@ -99,6 +100,8 @@ private:
DECLARE_READ8_MEMBER(crtc_r);
DECLARE_WRITE8_MEMBER(crtc_w);
+ DECLARE_WRITE_LINE_MEMBER(write_line_clock);
+
DECLARE_READ8_MEMBER(misc_r);
DECLARE_READ8_MEMBER(kbd_get);
void kbd_put(u8 data);
@@ -108,7 +111,7 @@ private:
required_shared_ptr<uint8_t> m_p_videoram;
required_device<i8080_cpu_device> m_maincpu;
- required_device<nvram_device> m_nvram;
+ required_device<kr1601rr1_device> m_earom;
required_device<i8214_device> m_pic;
required_device<i8257_device> m_dma8257;
required_device<i8251_device> m_i8251;
@@ -125,7 +128,7 @@ void ms6102_state::ms6102_mem(address_map &map)
{
map.unmap_value_high();
map(0x0000, 0x2fff).rom();
- map(0x3800, 0x3bff).ram().share("nvram");
+ map(0x3800, 0x3bff).rw(m_earom, FUNC(kr1601rr1_device::read), FUNC(kr1601rr1_device::write));
map(0xc000, 0xffff).ram().share("videoram");
}
@@ -137,7 +140,7 @@ void ms6102_state::ms6102_io(address_map &map)
map(0x10, 0x18).rw(m_dma8257, FUNC(i8257_device::read), FUNC(i8257_device::write));
map(0x20, 0x23).rw("pit8253", FUNC(pit8253_device::read), FUNC(pit8253_device::write));
//AM_RANGE(0x30, 0x3f) AM_DEVREADWRITE("589wa1", ay31015_device, receive, transmit)
- map(0x30, 0x3f).r(this, FUNC(ms6102_state::kbd_get));
+ map(0x30, 0x3f).r(this, FUNC(ms6102_state::kbd_get)).nopw();
map(0x40, 0x41).rw(this, FUNC(ms6102_state::crtc_r), FUNC(ms6102_state::crtc_w));
map(0x50, 0x5f).noprw(); // video disable?
map(0x60, 0x6f).w(this, FUNC(ms6102_state::pic_w));
@@ -218,11 +221,15 @@ READ8_MEMBER(ms6102_state::misc_r)
READ8_MEMBER(ms6102_state::kbd_get)
{
+ m_kbd_ready = false;
+ LOG("kbd_get %02x\n", m_kbd_data);
+ m_pic->r_w(1, 1);
return m_kbd_data;
}
void ms6102_state::kbd_put(u8 data)
{
+ LOG("kbd_put %02x\n", data);
m_kbd_ready = true;
m_kbd_data = data;
m_pic->r_w(1, 0);
@@ -250,6 +257,13 @@ IRQ_CALLBACK_MEMBER(ms6102_state::ms6102_int_ack)
}
+WRITE_LINE_MEMBER(ms6102_state::write_line_clock)
+{
+ m_i8251->write_txc(state);
+ m_i8251->write_rxc(state);
+}
+
+
void ms6102_state::machine_reset()
{
m_kbd_ready = false;
@@ -307,17 +321,15 @@ MACHINE_CONFIG_START(ms6102_state::ms6102)
MCFG_I8085A_INTE(DEVWRITELINE("i8214", i8214_device, inte_w))
MCFG_CPU_IRQ_ACKNOWLEDGE_DRIVER(ms6102_state, ms6102_int_ack)
- MCFG_NVRAM_ADD_0FILL("nvram")
-
MCFG_DEVICE_ADD("i8214", I8214, XTAL(18'432'000) / 9)
MCFG_I8214_INT_CALLBACK(WRITELINE(ms6102_state, irq_w))
+ MCFG_DEVICE_ADD("earom", KR1601RR1, 0)
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_UPDATE_DEVICE("i8275_1", i8275_device, screen_update)
- MCFG_SCREEN_REFRESH_RATE(50)
- MCFG_SCREEN_SIZE(784, 375)
- MCFG_SCREEN_VISIBLE_AREA(100, 100+80*8-1, 7, 7+24*15-1)
+ MCFG_SCREEN_RAW_PARAMS(XTAL(16'400'000), 784, 0, 80*8, 375, 0, 25*12)
MCFG_GFXDECODE_ADD("gfxdecode", "palette", ms6102)
MCFG_PALETTE_ADD_MONOCHROME_HIGHLIGHT("palette")