summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/c900.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/c900.cpp')
-rw-r--r--src/mame/drivers/c900.cpp68
1 files changed, 22 insertions, 46 deletions
diff --git a/src/mame/drivers/c900.cpp b/src/mame/drivers/c900.cpp
index 3832685fd5c..4862b652741 100644
--- a/src/mame/drivers/c900.cpp
+++ b/src/mame/drivers/c900.cpp
@@ -17,18 +17,23 @@ It has a 6508 CPU.
Disk drive is a Matsushita JA-560-012
-Our implementation of z80scc is currently incomplete and therefore unusable.
-
Increasing the amount of RAM stops the error message, however it still keeps running
-into the weeds (jumps to 00000).
+into the weeds (jumps to 00000). Due to lack of banking, the stack is pointing at rom.
+
+To Do:
+- Banking
+- Pretty much everything
+- Need schematics, technical manuals and so on.
+- Eventually, will need software.
+- Disassembler needs fixing
*******************************************************************************************/
#include "emu.h"
#include "cpu/z8000/z8000.h"
-//#include "machine/z80scc.h"
-//#include "bus/rs232/rs232.h"
+#include "machine/z80scc.h"
+#include "bus/rs232/rs232.h"
#include "machine/terminal.h"
#include "machine/z8536.h"
#include "emupal.h"
@@ -40,21 +45,14 @@ public:
c900_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
- , m_terminal(*this, "terminal")
{ }
- DECLARE_READ16_MEMBER(key_r);
- DECLARE_READ16_MEMBER(stat_r);
- void kbd_put(u8 data);
-
void c900(machine_config &config);
void data_map(address_map &map);
void io_map(address_map &map);
void mem_map(address_map &map);
private:
- uint8_t m_term_data;
required_device<cpu_device> m_maincpu;
- required_device<generic_terminal_device> m_terminal;
};
void c900_state::mem_map(address_map &map)
@@ -71,32 +69,13 @@ void c900_state::data_map(address_map &map)
void c900_state::io_map(address_map &map)
{
map(0x0000, 0x007f).rw("cio", FUNC(z8036_device::read), FUNC(z8036_device::write)).umask16(0x00ff);
- //AM_RANGE(0x0100, 0x011f) AM_DEVREADWRITE8("scc", scc8030_device, zbus_r, zbus_w, 0x00ff) // range for one channel
- map(0x0100, 0x0101).r(FUNC(c900_state::stat_r));
- map(0x0110, 0x0111).r(FUNC(c900_state::key_r));
- map(0x0111, 0x0111).w(m_terminal, FUNC(generic_terminal_device::write));
+ map(0x0100, 0x013f).rw("scc", FUNC(scc8030_device::zbus_r), FUNC(scc8030_device::zbus_w)).umask16(0x00ff);
+ map(0x0ff8, 0x0ff9).nopw();
}
static INPUT_PORTS_START( c900 )
INPUT_PORTS_END
-READ16_MEMBER( c900_state::key_r )
-{
- uint8_t ret = m_term_data;
- m_term_data = 0;
- return ret;
-}
-
-READ16_MEMBER( c900_state::stat_r )
-{
- return (m_term_data) ? 5 : 4;
-}
-
-void c900_state::kbd_put(u8 data)
-{
- m_term_data = data;
-}
-
/* F4 Character Displayer */
static const gfx_layout c900_charlayout =
{
@@ -122,24 +101,21 @@ MACHINE_CONFIG_START(c900_state::c900)
MCFG_DEVICE_DATA_MAP(data_map)
MCFG_DEVICE_IO_MAP(io_map)
- MCFG_DEVICE_ADD("terminal", GENERIC_TERMINAL, 0)
- MCFG_GENERIC_TERMINAL_KEYBOARD_CB(PUT(c900_state, kbd_put))
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_c900)
MCFG_PALETTE_ADD_MONOCHROME("palette")
MCFG_DEVICE_ADD("cio", Z8036, 6'000'000)
- //MCFG_DEVICE_ADD("scc", SCC8030, 6'000'000)
- //MCFG_Z80SCC_OFFSETS(326400, 0, 326400, 0)
- /* Port A */
- //MCFG_Z80SCC_OUT_TXDA_CB(WRITELINE("rs232a", rs232_port_device, write_txd))
- //MCFG_Z80SCC_OUT_DTRA_CB(WRITELINE("rs232a", rs232_port_device, write_dtr))
- //MCFG_Z80SCC_OUT_RTSA_CB(WRITELINE("rs232a", rs232_port_device, write_rts))
- //MCFG_Z80SCC_OUT_INT_CB(WRITELINE(*this, lwriter_state, scc_int))
-
- //MCFG_RS232_PORT_ADD ("rs232a", default_rs232_devices, "terminal")
- //MCFG_RS232_RXD_HANDLER (WRITELINE ("scc", scc8030_device, rxa_w))
- //MCFG_RS232_CTS_HANDLER (WRITELINE ("scc", scc8030_device, ctsa_w))
+ MCFG_DEVICE_ADD("scc", SCC8030, 6'000'000) // 5'850'000 is the ideal figure
+ /* Port B */
+ MCFG_Z80SCC_OUT_TXDB_CB(WRITELINE("rs232", rs232_port_device, write_txd))
+ MCFG_Z80SCC_OUT_DTRB_CB(WRITELINE("rs232", rs232_port_device, write_dtr))
+ MCFG_Z80SCC_OUT_RTSB_CB(WRITELINE("rs232", rs232_port_device, write_rts))
+ //MCFG_Z80SCC_OUT_INT_CB(WRITELINE(*this, c900_state, scc_int))
+
+ MCFG_DEVICE_ADD("rs232", RS232_PORT, default_rs232_devices, "terminal")
+ MCFG_RS232_RXD_HANDLER (WRITELINE ("scc", scc8030_device, rxb_w))
+ MCFG_RS232_CTS_HANDLER (WRITELINE ("scc", scc8030_device, ctsb_w))
MACHINE_CONFIG_END
ROM_START( c900 )