1 // license:GPL-2.0+
2 // copyright-holders:Peter Trauner
3 /*****************************************************************************
4  *
5  * includes/pc1401.h
6  *
7  * Pocket Computer 1401
8  *
9  ****************************************************************************/
10 
11 #ifndef MAME_INCLUDES_PC1401_H
12 #define MAME_INCLUDES_PC1401_H
13 
14 #include "pocketc.h"
15 
16 class pc1401_state : public pocketc_state
17 {
18 public:
pc1401_state(const machine_config & mconfig,device_type type,const char * tag)19 	pc1401_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 	{ }
23 
24 	void init_pc1401();
25 
26 	void pc1401(machine_config &config);
27 	void pc1402(machine_config &config);
28 
29 protected:
30 	virtual void machine_start() override;
31 
32 	uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
33 
34 	void pc1401_mem(address_map &map);
35 	void pc1402_mem(address_map &map);
36 
37 	DECLARE_READ_LINE_MEMBER(reset_r);
38 	void out_b_w(uint8_t data);
39 	void out_c_w(uint8_t data);
40 	uint8_t in_a_r();
41 	uint8_t in_b_r();
42 	uint8_t lcd_read(offs_t offset);
43 	void lcd_write(offs_t offset, uint8_t data);
44 
45 private:
46 	required_ioport_array<13> m_keys;
47 
48 	uint8_t m_portc;
49 	uint8_t m_reg[0x100];
50 
51 	static const char* const s_line[5];
52 	static const char* const s_busy[5];
53 	static const char* const s_def[5];
54 	static const char* const s_shift[5];
55 	static const char* const s_hyp[5];
56 	static const char* const s_de[5];
57 	static const char* const s_g[5];
58 	static const char* const s_rad[5];
59 	static const char* const s_braces[5];
60 	static const char* const s_m[5];
61 	static const char* const s_e[5];
62 };
63 
64 #endif // MAME_INCLUDES_PC1401_H
65