summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/cit101.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/cit101.cpp')
-rw-r--r--src/mame/drivers/cit101.cpp45
1 files changed, 42 insertions, 3 deletions
diff --git a/src/mame/drivers/cit101.cpp b/src/mame/drivers/cit101.cpp
index a743323e6f0..2425e05e31c 100644
--- a/src/mame/drivers/cit101.cpp
+++ b/src/mame/drivers/cit101.cpp
@@ -9,7 +9,7 @@ Skeleton driver for first-generation C. Itoh video terminals.
#include "emu.h"
//#include "bus/rs232/rs232.h"
#include "cpu/i8085/i8085.h"
-//#include "machine/er2055.h"
+#include "machine/er2055.h"
#include "machine/i8251.h"
#include "machine/pit8253.h"
#include "machine/i8255.h"
@@ -23,6 +23,7 @@ public:
: driver_device(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
, m_screen(*this, "screen")
+ , m_nvr(*this, "nvr")
, m_chargen(*this, "chargen")
{ }
@@ -30,11 +31,17 @@ public:
private:
u32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+ DECLARE_WRITE8_MEMBER(nvr_address_w);
+ DECLARE_READ8_MEMBER(nvr_data_r);
+ DECLARE_WRITE8_MEMBER(nvr_data_w);
+ DECLARE_WRITE8_MEMBER(nvr_control_w);
+
void mem_map(address_map &map);
void io_map(address_map &map);
required_device<cpu_device> m_maincpu;
required_device<screen_device> m_screen;
+ required_device<er2055_device> m_nvr;
required_region_ptr<u8> m_chargen;
};
@@ -45,6 +52,27 @@ u32 cit101_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, con
}
+WRITE8_MEMBER(cit101_state::nvr_address_w)
+{
+ m_nvr->set_address(data & 0x3f);
+ m_nvr->set_clk(BIT(data, 6));
+}
+
+READ8_MEMBER(cit101_state::nvr_data_r)
+{
+ return m_nvr->data();
+}
+
+WRITE8_MEMBER(cit101_state::nvr_data_w)
+{
+ m_nvr->set_data(data);
+}
+
+WRITE8_MEMBER(cit101_state::nvr_control_w)
+{
+ m_nvr->set_control(BIT(data, 5), !BIT(data, 4), BIT(data, 7), BIT(data, 6));
+}
+
void cit101_state::mem_map(address_map &map)
{
map(0x0000, 0x3fff).rom().region("maincpu", 0);
@@ -56,14 +84,21 @@ void cit101_state::mem_map(address_map &map)
map(0xfc21, 0xfc21).rw("usart1", FUNC(i8251_device::status_r), FUNC(i8251_device::control_w));
map(0xfc40, 0xfc40).rw("usart2", FUNC(i8251_device::data_r), FUNC(i8251_device::data_w));
map(0xfc41, 0xfc41).rw("usart2", FUNC(i8251_device::status_r), FUNC(i8251_device::control_w));
- map(0xfc60, 0xfc60).noprw(); // ER2055 data?
+ map(0xfc60, 0xfc63).rw("ppi", FUNC(i8255_device::read), FUNC(i8255_device::write));
map(0xfc80, 0xfc83).w("pit0", FUNC(pit8253_device::write));
map(0xfcc0, 0xfcc3).w("pit1", FUNC(pit8253_device::write));
}
void cit101_state::io_map(address_map &map)
{
+ map(0x00, 0x00).rw("usart0", FUNC(i8251_device::data_r), FUNC(i8251_device::data_w));
+ map(0x01, 0x01).rw("usart0", FUNC(i8251_device::status_r), FUNC(i8251_device::control_w));
+ map(0x20, 0x20).rw("usart1", FUNC(i8251_device::data_r), FUNC(i8251_device::data_w));
+ map(0x21, 0x21).rw("usart1", FUNC(i8251_device::status_r), FUNC(i8251_device::control_w));
+ map(0x40, 0x40).rw("usart2", FUNC(i8251_device::data_r), FUNC(i8251_device::data_w));
+ map(0x41, 0x41).rw("usart2", FUNC(i8251_device::status_r), FUNC(i8251_device::control_w));
map(0x60, 0x63).rw("ppi", FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0xa0, 0xa0).nopw(); // ?
map(0xe0, 0xe0).noprw(); // ?
}
@@ -93,8 +128,12 @@ MACHINE_CONFIG_START(cit101_state::cit101)
MCFG_DEVICE_ADD("pit1", PIT8253, 0) // NEC D8253C-2
MCFG_DEVICE_ADD("ppi", I8255A, 0) // NEC D8255AC-2
+ MCFG_I8255_OUT_PORTA_CB(WRITE8(cit101_state, nvr_address_w))
+ MCFG_I8255_IN_PORTB_CB(READ8(cit101_state, nvr_data_r))
+ MCFG_I8255_OUT_PORTB_CB(WRITE8(cit101_state, nvr_data_w))
+ MCFG_I8255_OUT_PORTC_CB(WRITE8(cit101_state, nvr_control_w))
- //MCFG_DEVICE_ADD("nvr", ER2055, 0)
+ MCFG_DEVICE_ADD("nvr", ER2055, 0)
MACHINE_CONFIG_END