1 // license:BSD-3-Clause
2 // copyright-holders:Sergey Svishchev
3 
4 #ifndef MAME_BUS_ISA_PGC_H
5 #define MAME_BUS_ISA_PGC_H
6 
7 #pragma once
8 
9 
10 #include "cpu/i86/i86.h"
11 #include "machine/timer.h"
12 #include "isa.h"
13 #include "emupal.h"
14 
15 //**************************************************************************
16 //  TYPE DEFINITIONS
17 //**************************************************************************
18 
19 // ======================> isa8_pgc_device
20 
21 class isa8_pgc_device :
22 	public device_t,
23 	public device_isa8_card_interface
24 {
25 public:
26 	// construction/destruction
27 	isa8_pgc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
28 
29 protected:
30 	isa8_pgc_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
31 
32 	// device-level overrides
33 	virtual void device_start() override;
34 	virtual void device_reset() override;
35 
36 	// optional information overrides
37 	virtual void device_add_mconfig(machine_config &config) override;
38 	virtual const tiny_rom_entry *device_rom_region() const override;
39 	virtual ioport_constructor device_input_ports() const override;
40 
41 private:
42 	uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
43 
44 	DECLARE_WRITE_LINE_MEMBER(vblank_irq);
45 	IRQ_CALLBACK_MEMBER(irq_callback);
46 
47 	void vram_w(offs_t offset, uint8_t data);
48 	uint8_t vram_r(offs_t offset);
49 	void stateparam_w(offs_t offset, uint8_t data);
50 	uint8_t stateparam_r(offs_t offset);
51 	void lut_w(offs_t offset, uint8_t data);
52 	uint8_t init_r();
53 	void accel_w(offs_t offset, uint8_t data);
54 
55 	void reset_common();
56 
57 	void pgc_io(address_map &map);
58 	void pgc_map(address_map &map);
59 
60 	required_device<i8088_cpu_device> m_cpu;
61 	required_device<screen_device> m_screen;
62 	required_device<palette_device> m_palette;
63 
64 	uint8_t *m_commarea;
65 	std::unique_ptr<uint8_t[]> m_vram;
66 	std::unique_ptr<uint8_t[]> m_eram;
67 	uint8_t m_stateparam[16];
68 	uint8_t m_lut[256 * 3];
69 	int m_accel;
70 };
71 
72 
73 // device type definition
74 DECLARE_DEVICE_TYPE(ISA8_PGC, isa8_pgc_device)
75 
76 #endif // MAME_BUS_ISA_PGC_H
77