summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/lft.cpp
blob: 6b27f06eb9c657015cff80884892dc0065f1f275 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
// license:BSD-3-Clause
// copyright-holders:Robbbert
/******************************************************************************************

2013-09-09 Skeleton of LFT computer system. A search on the net produces no finds.
Everything in here is a guess.


LFT1230 does extensive testing of devices at boot time. As they are mostly missing,
it gets caught in a loop. There's unknown devices in the i/o 008x, 00Ax, 00Cx range.
The devices at 008x and 00Cx would appear to be the same type.
BUG:If the rtc fails to clear the interrupt pin (first test), it cannot print the error
as the SCC hasn't yet been set up.
***Status: hangs at start


LFT1510 doesn't bother with the tests. The i/o ports seem to be the same.
***Status: mostly working


Note: Backspace/delete performs oddly.

******************************************************************************************/

#include "emu.h"
#include "cpu/i86/i186.h"
#include "machine/mm58167.h"
#include "machine/z80scc.h"
#include "bus/rs232/rs232.h"


class lft_state : public driver_device
{
public:
	lft_state(const machine_config &mconfig, device_type type, const char *tag)
		: driver_device(mconfig, type, tag)
		, m_maincpu(*this, "maincpu")
		, m_rtc(*this, "rtc")
		, m_scc(*this, "scc")
	{ }

	void lft(machine_config &config);

private:

	void io_map(address_map &map);
	void mem_map(address_map &map);

	virtual void machine_reset() override;
	required_device<cpu_device> m_maincpu;
	required_device<mm58167_device> m_rtc;
	required_device<scc85c30_device> m_scc;
};

void lft_state::mem_map(address_map &map)
{
	map.unmap_value_high();
	map(0x00000, 0x5ffff).ram();
	map(0xfc000, 0xfffff).rom().region("roms", 0);
}

void lft_state::io_map(address_map &map)
{
	map.unmap_value_high();
	//map.global_mask(0x3ff);
	//map(0x0080, 0x0087) // unknown device
	//map(0x00a0, 0x00a?) // unknown device
	//map(0x00c0, 0x00c7) // unknown device
	map(0x0100, 0x0107).rw(m_scc, FUNC(z80scc_device::cd_ab_r), FUNC(z80scc_device::cd_ab_w)).umask16(0x00ff);
	map(0x0180, 0x01bf).rw(m_rtc, FUNC(mm58167_device::read), FUNC(mm58167_device::write)).umask16(0x00ff);
	//map(0x0200, 0x0207) // unknown device
}


/* Input ports */
static INPUT_PORTS_START( lft )
INPUT_PORTS_END

void lft_state::machine_reset()
{
}

MACHINE_CONFIG_START(lft_state::lft)
	/* basic machine hardware */
	MCFG_DEVICE_ADD("maincpu", I80186, 4000000) // no idea
	MCFG_DEVICE_PROGRAM_MAP(mem_map)
	MCFG_DEVICE_IO_MAP(io_map)

	// Devices
	MM58167(config, m_rtc, XTAL(32'768));

	SCC85C30(config, m_scc, 4'915'200);   // required value for 9600 baud
	m_scc->out_txda_callback().set("rs232a", FUNC(rs232_port_device::write_txd));
	m_scc->out_dtra_callback().set("rs232a", FUNC(rs232_port_device::write_dtr));
	m_scc->out_rtsa_callback().set("rs232a", FUNC(rs232_port_device::write_rts));

	MCFG_DEVICE_ADD("rs232a", RS232_PORT, default_rs232_devices, nullptr)
	MCFG_RS232_RXD_HANDLER(WRITELINE(m_scc, scc85c30_device, rxa_w))
	MCFG_RS232_DCD_HANDLER(WRITELINE(m_scc, scc85c30_device, dcda_w))
	MCFG_RS232_CTS_HANDLER(WRITELINE(m_scc, scc85c30_device, ctsa_w))

	m_scc->out_txdb_callback().set("rs232b", FUNC(rs232_port_device::write_txd));
	m_scc->out_dtrb_callback().set("rs232b", FUNC(rs232_port_device::write_dtr));
	m_scc->out_rtsb_callback().set("rs232b", FUNC(rs232_port_device::write_rts));

	MCFG_DEVICE_ADD("rs232b", RS232_PORT, default_rs232_devices, "terminal")
	MCFG_RS232_RXD_HANDLER(WRITELINE(m_scc, scc85c30_device, rxb_w))
	MCFG_RS232_DCD_HANDLER(WRITELINE(m_scc, scc85c30_device, dcdb_w))
	MCFG_RS232_CTS_HANDLER(WRITELINE(m_scc, scc85c30_device, ctsb_w))
MACHINE_CONFIG_END


/* ROM definition */
ROM_START( lft1230 )
	ROM_REGION(0x4000, "roms", 0)
	ROM_LOAD16_BYTE( "1230lf29", 0x0000, 0x2000, CRC(11c87367) SHA1(0879650aa98e19a4e6ca7b6ee7874f81c9c8ccfa) )
	ROM_LOAD16_BYTE( "1230lf42", 0x0001, 0x2000, CRC(ab82b620) SHA1(8c7d93950703f348e5ce0f9e376d157dd6098c6a) )
ROM_END

ROM_START( lft1510 )
	ROM_REGION(0x4000, "roms", 0)
	ROM_LOAD16_BYTE( "1510lfev", 0x2000, 0x1000, CRC(47dbb290) SHA1(b557e9a54a30d9a16edfdef4a6b12a5393d30bf3) )
	ROM_IGNORE(0x1000)
	ROM_LOAD16_BYTE( "1510lfod", 0x2001, 0x1000, CRC(ba8c23fc) SHA1(d4b82f69fccd653b31e7bd05ee884b323ff0007b) )
	ROM_IGNORE(0x1000)
ROM_END


/* Driver */

//    YEAR  NAME     PARENT   COMPAT  MACHINE  INPUT  CLASS      INIT        COMPANY  FULLNAME    FLAGS
COMP( 198?, lft1510, 0,       0,      lft,     lft,   lft_state, empty_init, "LFT",   "LFT 1510", MACHINE_IS_SKELETON)
COMP( 198?, lft1230, lft1510, 0,      lft,     lft,   lft_state, empty_init, "LFT",   "LFT 1230", MACHINE_IS_SKELETON)