summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/video/kaneko_tmap.h
blob: 6c31cd1e528280d0d690c9062b16bbbd8d78bd91 (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
64
65
66
67
class kaneko_view2_tilemap_device : public device_t
{
public:
	kaneko_view2_tilemap_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);

	// used to set values when creating device
	static void set_gfx_region(device_t &device, int region);
	static void set_offset(device_t &device, int dx, int dy, int xdim, int ydim);
	static void set_invert_flip(device_t &device, int invert_flip); // for fantasia (bootleg)

	// set when creating device
	int m_tilebase;
	int m_dx, m_dy, m_xdim, m_ydim;
	int m_invert_flip;

	UINT16* m_vram[2];
	UINT16* m_vscroll[2];
	UINT16* m_regs;
	tilemap_t* m_tmap[2];
	UINT16 m_vram_tile_addition[2]; // galsnew

	void get_tile_info(kaneko_view2_tilemap_device *device, tile_data &tileinfo, tilemap_memory_index tile_index, int _N_);
	void kaneko16_vram_w(offs_t offset, UINT16 data, UINT16 mem_mask, int _N_);

	// call to do the rendering etc.
	void kaneko16_prepare(bitmap_ind16 &bitmap, const rectangle &cliprect);
	void render_tilemap_chip(bitmap_ind16 &bitmap, const rectangle &cliprect, int pri);
	void render_tilemap_chip_alt(bitmap_ind16 &bitmap, const rectangle &cliprect, int pri, int v2pri);

	// access
	DECLARE_READ16_MEMBER( kaneko_tmap_vram_r );
	DECLARE_WRITE16_MEMBER( kaneko_tmap_vram_w );

	DECLARE_READ16_MEMBER( kaneko_tmap_regs_r );
	DECLARE_WRITE16_MEMBER( kaneko_tmap_regs_w );

	DECLARE_WRITE16_MEMBER(kaneko16_vram_0_w);
	DECLARE_WRITE16_MEMBER(kaneko16_vram_1_w);

	DECLARE_READ16_MEMBER(kaneko16_vram_0_r);
	DECLARE_READ16_MEMBER(kaneko16_vram_1_r);

	DECLARE_READ16_MEMBER(kaneko16_scroll_0_r);
	DECLARE_READ16_MEMBER(kaneko16_scroll_1_r);

	DECLARE_WRITE16_MEMBER( kaneko16_scroll_0_w );
	DECLARE_WRITE16_MEMBER( kaneko16_scroll_1_w );

	DECLARE_WRITE16_MEMBER(galsnew_vram_0_tilebank_w);
	DECLARE_WRITE16_MEMBER(galsnew_vram_1_tilebank_w);



protected:
	virtual void device_start();
	virtual void device_reset();

private:


};


extern const device_type KANEKO_TMAP;