summaryrefslogtreecommitdiffstats
path: root/src/mame/drivers/hp2620.cpp
blob: 376d2056c5163ab5c21b6570b7af623e4aa00e54 (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
136
// license:BSD-3-Clause
// copyright-holders:AJR
/***********************************************************************************************************************************

Skeleton driver for HP-2620 series display terminals.

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

#include "emu.h"
#include "cpu/z80/z80.h"
#include "machine/mos6551.h"
#include "machine/nvram.h"
//#include "video/dp8350.h"
#include "screen.h"

class hp2620_state : public driver_device
{
public:
	hp2620_state(const machine_config &mconfig, device_type type, const char *tag)
		: driver_device(mconfig, type, tag)
		, m_maincpu(*this, "maincpu")
		, m_p_chargen(*this, "chargen")
		, m_nvram(*this, "nvram")
	{ }

	DECLARE_READ8_MEMBER(nvram_r);
	DECLARE_WRITE8_MEMBER(nvram_w);
	DECLARE_READ8_MEMBER(keystat_r);
	DECLARE_WRITE8_MEMBER(keydisp_w);
	DECLARE_READ8_MEMBER(sysstat_r);
	DECLARE_WRITE8_MEMBER(modem_w);

	u32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);

	void hp2622(machine_config &config);
	void io_map(address_map &map);
	void mem_map(address_map &map);
private:
	required_device<cpu_device> m_maincpu;
	required_region_ptr<u8> m_p_chargen;
	required_shared_ptr<u8> m_nvram;
};


u32 hp2620_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
	return 0;
}

READ8_MEMBER(hp2620_state::nvram_r)
{
	return 0xf0 | m_nvram[offset];
}

WRITE8_MEMBER(hp2620_state::nvram_w)
{
	m_nvram[offset] = data & 0x0f;
}

READ8_MEMBER(hp2620_state::keystat_r)
{
	return 0xff;
}

WRITE8_MEMBER(hp2620_state::keydisp_w)
{
}

READ8_MEMBER(hp2620_state::sysstat_r)
{
	return 0xff;
}

WRITE8_MEMBER(hp2620_state::modem_w)
{
}

void hp2620_state::mem_map(address_map &map)
{
	map(0x0000, 0xbfff).rom().region("maincpu", 0);
	map(0xc000, 0xffff).ram();
}

void hp2620_state::io_map(address_map &map)
{
	map.global_mask(0xff);
	map(0x00, 0x7f).rw(this, FUNC(hp2620_state::nvram_r), FUNC(hp2620_state::nvram_w)).share("nvram");
	map(0x80, 0x80).r(this, FUNC(hp2620_state::keystat_r));
	map(0x90, 0x90).r(this, FUNC(hp2620_state::sysstat_r));
	map(0xa0, 0xa3).w("acia", FUNC(mos6551_device::write));
	map(0xa4, 0xa7).r("acia", FUNC(mos6551_device::read));
	map(0xa8, 0xa8).w(this, FUNC(hp2620_state::modem_w));
	map(0xb8, 0xb8).w(this, FUNC(hp2620_state::keydisp_w));
}

static INPUT_PORTS_START( hp2622 )
INPUT_PORTS_END

MACHINE_CONFIG_START(hp2620_state::hp2622)
	MCFG_DEVICE_ADD("maincpu", Z80, XTAL(25'771'500) / 7) // 3.68 MHz
	MCFG_DEVICE_PROGRAM_MAP(mem_map)
	MCFG_DEVICE_IO_MAP(io_map)

	MCFG_NVRAM_ADD_0FILL("nvram") // 5101 (A7 tied to GND) + battery (+ wait states)

	MCFG_SCREEN_ADD("screen", RASTER)
	MCFG_SCREEN_RAW_PARAMS(XTAL(25'771'500), 1035, 0, 720, 415, 0, 390) // 498 total lines in 50 Hz mode
	MCFG_SCREEN_UPDATE_DRIVER(hp2620_state, screen_update)

	//MCFG_DEVICE_ADD("crtc", DP8367, XTAL(25'771'500))

	MCFG_DEVICE_ADD("acia", MOS6551, 0) // SY6551
	MCFG_MOS6551_XTAL(XTAL(25'771'500) / 14) // 1.84 MHz
	MCFG_MOS6551_IRQ_HANDLER(INPUTLINE("maincpu", 0))
MACHINE_CONFIG_END

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

Hewlett-Packard HP-2622A.
Chips: National 8367 CRTC (labeled B8250), SY6551 (labeled 8251), Z8400A (Z80)
Crystal: 25.7715

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

ROM_START( hp2622a )
	ROM_REGION(0xc000, "maincpu", 0)
	ROM_LOAD( "1818-1685.xu63", 0x0000, 0x2000, CRC(a57ffe5e) SHA1(4d7844320deba916d9ec289927af987fea025b02) )
	ROM_LOAD( "1818-1686.xu64", 0x2000, 0x2000, CRC(bee9274c) SHA1(20796c559031a91cb2666776fcf7ffdb52a0a318) )
	ROM_LOAD( "1818-1687.xu65", 0x4000, 0x2000, CRC(e9ecd489) SHA1(9b249b8d066d256069ccdb8809bb808c414f106a) )
	// XU66-XU68 are empty

	ROM_REGION(0x2000, "chargen", 0)
	ROM_LOAD( "1818-1489.xu311", 0x0000, 0x2000, CRC(9879b153) SHA1(fc1705d6de38eb6d3a67f1ae439e359e5124d028) )
ROM_END

COMP( 1982, hp2622a, 0, 0, hp2622, hp2622, hp2620_state, empty_init, "HP", "HP-2622A", MACHINE_IS_SKELETON )