summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/video/namco_c116.h
blob: 7638b12b903dd75ba9462e3f31bd82efdbba6194 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// license:BSD-3-Clause
// copyright-holders:Alex W. Jackson
#ifndef MAME_VIDEO_NAMCO_C116_H
#define MAME_VIDEO_NAMCO_C116_H

#pragma once



//***************************************************************************
//  TYPE DEFINITIONS
//***************************************************************************

class namco_c116_device :
	public device_t,
	public device_palette_interface,
	public device_video_interface
{
public:
	//construction/destruction
	namco_c116_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);

	// configuration
	void enable_shadows() { m_enable_shadows = true; }

	//read/write handlers
	DECLARE_READ8_MEMBER( read );
	DECLARE_WRITE8_MEMBER( write );

	//getters
	uint16_t get_reg(int reg) { return m_regs[reg]; }

protected:
	// device-level overrides
	virtual void device_start() override;

	// device_palette_interface overrides
	virtual uint32_t palette_entries() const override { return 0x2000; }
	virtual bool palette_shadows_enabled() const override { return m_enable_shadows; }

private:
	// internal state
	std::vector<uint8_t> m_ram_r;
	std::vector<uint8_t> m_ram_g;
	std::vector<uint8_t> m_ram_b;
	uint16_t m_regs[8];
	bool                m_enable_shadows;       // are shadows enabled?
};

DECLARE_DEVICE_TYPE(NAMCO_C116, namco_c116_device)

#endif // MAME_VIDEO_NAMCO_C116_H