1 // license:BSD-3-Clause
2 // copyright-holders:R. Belmont
3 
4 #ifndef MAME_BUS_HPDIO_98544_H
5 #define MAME_BUS_HPDIO_98544_H
6 
7 #pragma once
8 
9 #include "hp_dio.h"
10 #include "video/topcat.h"
11 //**************************************************************************
12 //  TYPE DEFINITIONS
13 //**************************************************************************
14 
15 // ======================> dio16_98544_device
16 
17 namespace bus {
18 	namespace hp_dio {
19 
20 class dio16_98544_device :
21 	public device_t,
22 	public device_dio16_card_interface,
23 	public device_memory_interface
24 {
25 public:
26 	// construction/destruction
27 	dio16_98544_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
28 
29 	uint16_t rom_r(offs_t offset);
30 	void rom_w(offs_t offset, uint16_t data);
31 
32 	required_device<topcat_device> m_topcat;
33 	uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
34  protected:
35 	dio16_98544_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
36 
37 	// device-level overrides
38 	virtual void device_start() override;
39 	virtual void device_reset() override;
40 
41 	// optional information overrides
42 	virtual void device_add_mconfig(machine_config &config) override;
43 	virtual const tiny_rom_entry *device_rom_region() const override;
44 	virtual space_config_vector memory_space_config() const override;
45 private:
46 
47 	WRITE_LINE_MEMBER(vblank_w);
48 	WRITE_LINE_MEMBER(int_w);
49 
50 	static constexpr int m_v_pix = 768;
51 	static constexpr int m_h_pix = 1024;
52 
53 	const address_space_config m_space_config;
54 	void map(address_map &map);
55 	required_region_ptr<uint8_t> m_rom;
56 	required_shared_ptr<uint8_t> m_vram;
57 
58 	uint8_t m_intreg;
59 };
60 
61 } // namespace bus::hp_dio
62 } // namespace bus
63 
64 // device type definition
65 DECLARE_DEVICE_TYPE_NS(HPDIO_98544, bus::hp_dio, dio16_98544_device)
66 
67 #endif // MAME_BUS_HPDIO_98544_H
68