summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/video/k001006.h
blob: 67abc8b417ce27dbd9d8a0c19ff8dd9c8c053ba5 (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
// license:BSD-3-Clause
// copyright-holders:David Haywood
#ifndef MAME_VIDEO_K001006_H
#define MAME_VIDEO_K001006_H

#pragma once



class k001006_device : public device_t
{
public:
	k001006_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
	~k001006_device() {}

	// configuration
	void set_gfx_region(const char *tag) { m_gfx_region = tag; }
	void set_tex_layout(int layout) { m_tex_layout = layout; }

	uint32_t fetch_texel(int page, int pal_index, int u, int v);
	void preprocess_texture_data(uint8_t *dst, uint8_t *src, int length, int gticlub);

	DECLARE_READ32_MEMBER( read );
	DECLARE_WRITE32_MEMBER( write );

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

private:
	// internal state
	std::unique_ptr<uint16_t[]>      m_pal_ram;
	std::unique_ptr<uint16_t[]>     m_unknown_ram;
	uint32_t       m_addr;
	int          m_device_sel;

	std::unique_ptr<uint8_t[]>     m_texrom;

	std::unique_ptr<uint32_t[]>     m_palette;

	const char * m_gfx_region;
	uint8_t *      m_gfxrom;
	//int m_tex_width;
	//int m_tex_height;
	//int m_tex_mirror_x;
	//int m_tex_mirror_y;
	int m_tex_layout;
};


DECLARE_DEVICE_TYPE(K001006, k001006_device)


#define MCFG_K001006_GFX_REGION(_tag) \
	downcast<k001006_device &>(*device).set_gfx_region(_tag);

#define MCFG_K001006_TEX_LAYOUT(x) \
	downcast<k001006_device &>(*device).set_tex_layout(x);

#endif // MAME_VIDEO_K001006_H