1 // license:BSD-3-Clause
2 // copyright-holders:Dirk Best
3 /**********************************************************************
4 
5     Epson LX-800 dot matrix printer emulation
6 
7 **********************************************************************/
8 
9 #ifndef MAME_BUS_CENTRONICS_EPSON_LX800_H
10 #define MAME_BUS_CENTRONICS_EPSON_LX800_H
11 
12 #pragma once
13 
14 #include "ctronics.h"
15 #include "cpu/upd7810/upd7810.h"
16 #include "machine/e05a03.h"
17 #include "sound/beep.h"
18 
19 
20 
21 //**************************************************************************
22 //  TYPE DEFINITIONS
23 //**************************************************************************
24 
25 // ======================> epson_lx800_device
26 
27 class epson_lx800_device :  public device_t, public device_centronics_peripheral_interface
28 {
29 public:
30 	// construction/destruction
31 	epson_lx800_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
32 
33 protected:
34 	epson_lx800_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
35 
36 	// device-level overrides
37 	virtual void device_start() override;
38 	virtual void device_reset() override;
39 
40 	// optional information overrides
41 	virtual const tiny_rom_entry *device_rom_region() const override;
42 	virtual void device_add_mconfig(machine_config &config) override;
43 	virtual ioport_constructor device_input_ports() const override;
44 
45 private:
46 	uint8_t porta_r(offs_t offset);
47 	void porta_w(offs_t offset, uint8_t data);
48 	uint8_t portc_r(offs_t offset);
49 	void portc_w(offs_t offset, uint8_t data);
50 
51 	DECLARE_READ_LINE_MEMBER(an0_r);
52 	DECLARE_READ_LINE_MEMBER(an1_r);
53 	DECLARE_READ_LINE_MEMBER(an2_r);
54 	DECLARE_READ_LINE_MEMBER(an3_r);
55 	DECLARE_READ_LINE_MEMBER(an4_r);
56 	DECLARE_READ_LINE_MEMBER(an5_r);
57 
58 	uint8_t centronics_data_r();
59 	DECLARE_WRITE_LINE_MEMBER(centronics_pe_w);
60 	DECLARE_WRITE_LINE_MEMBER(reset_w);
61 
62 	void lx800_mem(address_map &map);
63 
64 	required_device<cpu_device> m_maincpu;
65 	required_device<beep_device> m_beep;
66 	output_finder<> m_online_led;
67 };
68 
69 
70 
71 // device type definition
72 DECLARE_DEVICE_TYPE(EPSON_LX800, epson_lx800_device)
73 
74 #endif // MAME_BUS_CENTRONICS_EPSON_LX800_H
75