summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/video/decocomn.h
blob: f6ec0a0a54701fc4e2d779733bf4cf35ed594bc6 (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
53
54
55
56
57
58
59
60
61
62
63
// license:BSD-3-Clause
// copyright-holders:Bryan McPhail
/*************************************************************************

    decocomn.h

**************************************************************************/
#ifndef MAME_VIDEO_DECOCOMN_H
#define MAME_VIDEO_DECOCOMN_H

#pragma once

#include "emupal.h"


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


class decocomn_device : public device_t,
						public device_video_interface
{
public:
	decocomn_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);

	// configuration
	void set_palette_tag(const char *tag) { m_palette.set_tag(tag); }

	DECLARE_WRITE16_MEMBER( buffered_palette_w );
	DECLARE_WRITE16_MEMBER( palette_dma_w );
	DECLARE_WRITE16_MEMBER( priority_w );
	uint16_t priority_r();
	DECLARE_READ16_MEMBER( d_71_r );

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

private:
	// internal state
	std::unique_ptr<uint8_t[]> m_dirty_palette;
	uint16_t m_priority;
	required_device<palette_device> m_palette;
	required_shared_ptr<uint16_t> m_generic_paletteram_16;
};

DECLARE_DEVICE_TYPE(DECOCOMN, decocomn_device)



/***************************************************************************
    DEVICE CONFIGURATION MACROS
***************************************************************************/

#define MCFG_DECOCOMN_ADD(_tag) \
	MCFG_DEVICE_ADD(_tag, DECOCOMN, 0)

#define MCFG_DECOCOMN_PALETTE(_palette_tag) \
	downcast<decocomn_device &>(*device).set_palette_tag(_palette_tag);

#endif // MAME_VIDEO_DECOCOMN_H