summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/includes/pc1350.h
blob: 5c206b9bb7f4ec801314102e43b76968febd570d (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
// license:GPL-2.0+
// copyright-holders:Peter Trauner
/*****************************************************************************
 *
 * includes/pc1350.h
 *
 * Pocket Computer 1350
 *
 ****************************************************************************/

#ifndef MAME_INCLUDES_PC1350_H
#define MAME_INCLUDES_PC1350_H

#include "pocketc.h"
#include "machine/ram.h"

class pc1350_state : public pocketc_state
{
public:
	pc1350_state(const machine_config &mconfig, device_type type, const char *tag)
		: pocketc_state(mconfig, type, tag)
		, m_ram(*this, RAM_TAG)
		, m_keys(*this, "KEY%u", 0U)
	{ }

	void pc1350(machine_config &config);

protected:
	virtual void machine_start() override;

	uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);

	void pc1350_mem(address_map &map);

	DECLARE_WRITE8_MEMBER(out_b_w);
	DECLARE_WRITE8_MEMBER(out_c_w);

	DECLARE_READ8_MEMBER(in_a_r);
	DECLARE_READ8_MEMBER(in_b_r);
	DECLARE_READ8_MEMBER(lcd_read);
	DECLARE_WRITE8_MEMBER(lcd_write);
	DECLARE_READ8_MEMBER(keyboard_line_r);

private:
	required_device<ram_device> m_ram;
	required_ioport_array<12> m_keys;

	uint8_t m_reg[0x1000];

	static const char* const s_def[5];
	static const char* const s_shift[5];
	static const char* const s_run[5];
	static const char* const s_pro[5];
	static const char* const s_japan[5];
	static const char* const s_sml[5];
};

#endif // MAME_INCLUDES_PC1350_H