1 // license:GPL-2.0+
2 // copyright-holders:Dirk Best
3 /***************************************************************************
4 
5     Nascom Advanced Video Card
6 
7 ***************************************************************************/
8 
9 #ifndef MAME_BUS_NASBUS_AVC_H
10 #define MAME_BUS_NASBUS_AVC_H
11 
12 #pragma once
13 
14 #include "nasbus.h"
15 #include "video/mc6845.h"
16 #include "emupal.h"
17 
18 
19 //**************************************************************************
20 //  TYPE DEFINITIONS
21 //**************************************************************************
22 
23 // ======================> nascom_avc_device
24 
25 class nascom_avc_device : public device_t, public device_nasbus_card_interface
26 {
27 public:
28 	// construction/destruction
29 	nascom_avc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
30 	void control_w(uint8_t data);
31 
32 	uint8_t vram_r(offs_t offset);
33 	void vram_w(offs_t offset, uint8_t data);
34 
35 protected:
36 	virtual void device_add_mconfig(machine_config &config) override;
37 	virtual void device_start() override;
38 	virtual void device_reset() override;
39 
40 private:
41 	MC6845_UPDATE_ROW(crtc_update_row);
42 
43 	required_device<mc6845_device> m_crtc;
44 	required_device<palette_device> m_palette;
45 
46 	std::vector<uint8_t> m_r_ram;
47 	std::vector<uint8_t> m_g_ram;
48 	std::vector<uint8_t> m_b_ram;
49 
50 	uint8_t m_control;
51 };
52 
53 // device type definition
54 DECLARE_DEVICE_TYPE(NASCOM_AVC, nascom_avc_device)
55 
56 #endif // MAME_BUS_NASBUS_AVC_H
57