1 // license:GPL-2.0+
2 // copyright-holders:Peter Trauner
3 /*****************************************************************************
4  *
5  * includes/pc1350.h
6  *
7  * Pocket Computer 1350
8  *
9  ****************************************************************************/
10 
11 #ifndef MAME_INCLUDES_PC1350_H
12 #define MAME_INCLUDES_PC1350_H
13 
14 #include "pocketc.h"
15 #include "machine/ram.h"
16 
17 class pc1350_state : public pocketc_state
18 {
19 public:
pc1350_state(const machine_config & mconfig,device_type type,const char * tag)20 	pc1350_state(const machine_config &mconfig, device_type type, const char *tag)
21 		: pocketc_state(mconfig, type, tag)
22 		, m_ram(*this, RAM_TAG)
23 		, m_keys(*this, "KEY%u", 0U)
24 	{ }
25 
26 	void pc1350(machine_config &config);
27 
28 protected:
29 	virtual void machine_start() override;
30 
31 	uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
32 
33 	void pc1350_mem(address_map &map);
34 
35 	void out_b_w(uint8_t data);
36 	void out_c_w(uint8_t data);
37 
38 	uint8_t in_a_r();
39 	uint8_t in_b_r();
40 	uint8_t lcd_read(offs_t offset);
41 	void lcd_write(offs_t offset, uint8_t data);
42 	uint8_t keyboard_line_r();
43 
44 private:
45 	required_device<ram_device> m_ram;
46 	required_ioport_array<12> m_keys;
47 
48 	uint8_t m_reg[0x1000];
49 
50 	static const char* const s_def[5];
51 	static const char* const s_shift[5];
52 	static const char* const s_run[5];
53 	static const char* const s_pro[5];
54 	static const char* const s_japan[5];
55 	static const char* const s_sml[5];
56 };
57 
58 #endif // MAME_INCLUDES_PC1350_H
59