summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/ms9540.cpp
blob: 4476248e99999c91f42d4c704111ca5ff3208bed (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
135
// license:BSD-3-Clause
// copyright-holders:Robbbert
/***************************************************************************

Millennium Systems 9520 and 9540 Software Development systems.

2013-08-30 Skeleton driver

The only roms known to be dumped are the main roms of the 9540, and the disk
controller roms of the 9520.

There's no known documents for the 9540, so everything in here is a guess.

The 9520 is Z80-based, but is currently not emulated.
The 9540 is 68000-based.

Chips:
- Main board: MC68000L8, 2x SCN2661C, uPD8253C. Crystals: 5.0688, 16MHz
  ROMS: 0950-0131-01, 0950-0132-01, 0954-0133-01, 0954-0134-01,
        0954-0135-01, 0954-0135-02
- Disk board: FD1797A-02, AM9517A, 0954-0039-01
- Serial board: 6x SCN2661C, 2x AM9517A, 0954-0029-01. Crystal: 5.0688MHz

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

#include "emu.h"
#include "cpu/m68000/m68000.h"
#include "machine/terminal.h"


class ms9540_state : public driver_device
{
public:
	ms9540_state(const machine_config &mconfig, device_type type, const char *tag)
		: driver_device(mconfig, type, tag)
		, m_p_base(*this, "rambase")
		, m_maincpu(*this, "maincpu")
		, m_terminal(*this, "terminal")
	{ }

	void ms9540(machine_config &config);

private:
	uint8_t latch_1e001_r();
	void latch_1e001_w(u8 data);
	uint8_t latch_1f001_r();
	void latch_1f001_w(u8 data);
	void kbd_put(u8 data);
	void mem_map(address_map &map);
	uint8_t m_term_data;
	uint8_t m_latch_1e001;
	uint8_t m_latch_1f001;
	virtual void machine_reset() override;
	required_shared_ptr<uint16_t> m_p_base;
	required_device<cpu_device> m_maincpu;
	required_device<generic_terminal_device> m_terminal;
};


uint8_t ms9540_state::latch_1e001_r()
{
	return m_latch_1e001;
}

void ms9540_state::latch_1e001_w(uint8_t data)
{
	logerror("%s: $1e001 <- #$%02x\n", machine().describe_context(), data);
	m_latch_1e001 = data;
}

uint8_t ms9540_state::latch_1f001_r()
{
	return m_latch_1f001;
}

void ms9540_state::latch_1f001_w(uint8_t data)
{
	logerror("%s: $1f001 <- #$%02x\n", machine().describe_context(), data);
	m_latch_1f001 = data;
}

void ms9540_state::mem_map(address_map &map)
{
	map.unmap_value_high();
	map(0x000000, 0x00ffff).ram().share("rambase");
	map(0x010000, 0x013fff).rom().region("9540", 0);
	map(0x018000, 0x018fff).ram();
	map(0x01e001, 0x01e001).rw(FUNC(ms9540_state::latch_1e001_r), FUNC(ms9540_state::latch_1e001_w));
	map(0x01f001, 0x01f001).rw(FUNC(ms9540_state::latch_1f001_r), FUNC(ms9540_state::latch_1f001_w));
}


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


void ms9540_state::machine_reset()
{
	uint8_t* ROM = memregion("9540")->base();
	memcpy(m_p_base, ROM, 8);
}

void ms9540_state::kbd_put(u8 data)
{
	m_term_data = data;
}

void ms9540_state::ms9540(machine_config &config)
{
	/* basic machine hardware */
	M68000(config, m_maincpu, 8000000); // unknown clock
	m_maincpu->set_addrmap(AS_PROGRAM, &ms9540_state::mem_map);

	/* video hardware */
	GENERIC_TERMINAL(config, m_terminal, 0);
	m_terminal->set_keyboard_callback(FUNC(ms9540_state::kbd_put));
}

/* ROM definition */
ROM_START( ms9540 )
	ROM_REGION16_BE(0x4000, "9540", 0)
	ROM_LOAD16_BYTE("0954-0135-01.20n", 0x00001, 0x2000, CRC(93ee9363) SHA1(73bc09e0379e06e0da96279cb5cc1581a0f0bf77) )
	ROM_LOAD16_BYTE("0954-0135-02.16n", 0x00000, 0x2000, CRC(a21077c5) SHA1(51dcbe543317d2042fb1acb1885461ba1790721e) )

	ROM_REGION(0x1800, "9520", 0)
	ROM_LOAD( "z80-hd.bin",   0x0000, 0x1000, CRC(b1c37286) SHA1(36b38fec9ef46e3e594423bbd1c64c5e9a4bc74d) )
	ROM_LOAD( "z80-flp.bin",  0x1000, 0x0800, CRC(f256b8c3) SHA1(780b444e999c3149eb0f137733703682d65746b4) )
ROM_END


/* Driver */

//    YEAR  NAME    PARENT  COMPAT  MACHINE  INPUT   CLASS         INIT        COMPANY               FULLNAME  FLAGS
COMP( 198?, ms9540, 0,      0,      ms9540,  ms9540, ms9540_state, empty_init, "Millennium Systems", "ms9540", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW )