1 // license:GPL-2.0+
2 // copyright-holders:Peter Trauner
3 /*****************************************************************************
4  *
5  * includes/pc1251.h
6  *
7  * Pocket Computer 1251
8  *
9  ****************************************************************************/
10 
11 #ifndef MAME_INCLUDES_PC1251_H
12 #define MAME_INCLUDES_PC1251_H
13 
14 #include "pocketc.h"
15 
16 class pc1251_state : public pocketc_state
17 {
18 public:
pc1251_state(const machine_config & mconfig,device_type type,const char * tag)19 	pc1251_state(const machine_config &mconfig, device_type type, const char *tag)
20 		: pocketc_state(mconfig, type, tag)
21 		, m_keys(*this, "KEY%u", 0U)
22 		, m_mode(*this, "MODE")
23 	{ }
24 
25 	void init_pc1251();
26 
27 	void pc1255(machine_config &config);
28 	void pc1251(machine_config &config);
29 	void pc1250(machine_config &config);
30 
31 protected:
32 	virtual void machine_start() override;
33 
34 	uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
35 
36 	void pc1250_mem(address_map &map);
37 	void pc1251_mem(address_map &map);
38 	void pc1255_mem(address_map &map);
39 	void pc1260_mem(address_map &map);
40 	void pc1261_mem(address_map &map);
41 
42 	void out_b_w(uint8_t data);
43 	void out_c_w(uint8_t data);
44 
45 	DECLARE_READ_LINE_MEMBER(reset_r);
46 	uint8_t in_a_r();
47 	uint8_t in_b_r();
48 	uint8_t lcd_read(offs_t offset);
49 	void lcd_write(offs_t offset, uint8_t data);
50 
51 private:
52 	required_ioport_array<10> m_keys;
53 	required_ioport m_mode;
54 
55 	uint8_t m_reg[0x100];
56 
57 	static const char *const s_def[5];
58 	static const char *const s_shift[5];
59 	static const char *const s_de[5];
60 	static const char *const s_g[5];
61 	static const char *const s_rad[5];
62 	static const char *const s_run[5];
63 	static const char *const s_pro[5];
64 	static const char *const s_rsv[5];
65 };
66 
67 class pc1260_state : public pc1251_state
68 {
69 public:
pc1260_state(const machine_config & mconfig,device_type type,const char * tag)70 	pc1260_state(const machine_config &mconfig, device_type type, const char *tag)
71 		: pc1251_state(mconfig, type, tag)
72 	{ }
73 
74 	void pc1260(machine_config &config);
75 	void pc1261(machine_config &config);
76 
77 protected:
78 	virtual void machine_start() override;
79 };
80 
81 #endif // MAME_INCLUDES_PC1251_H
82