summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/video/seta001.h
blob: 344b13c9d4a9a2cb0925d9c123547a923825a592 (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
typedef int (*seta001_gfxbank_callback_func)(running_machine &machine, UINT16 code, UINT8 color);

class seta001_device : public device_t
{
public:
	seta001_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);


	void seta001_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int bank_size, int setac);

	void setac_eof( void );
	void tnzs_eof( void );

	UINT8 m_bgflag;

	UINT8 m_spritectrl[4];
	UINT8 m_spriteylow[0x300]; // 0x200 low y + 0x100 bg stuff

	UINT8 m_spritecodelow[0x2000]; // tnzs.c stuff only uses half?
	UINT8 m_spritecodehigh[0x2000]; // ^

	// position kludges for seta.c & srmp2.c
	void set_fg_xoffsets( int flip, int noflip ) { m_fg_flipxoffs = flip; m_fg_noflipxoffs = noflip; };
	int m_fg_flipxoffs, m_fg_noflipxoffs;
	void set_fg_yoffsets( int flip, int noflip ) { m_fg_flipyoffs = flip; m_fg_noflipyoffs = noflip; };
	int m_fg_flipyoffs, m_fg_noflipyoffs;
	void set_bg_yoffsets( int flip, int noflip ) { m_bg_flipyoffs = flip; m_bg_noflipyoffs = noflip; };
	int m_bg_flipyoffs, m_bg_noflipyoffs;
	void set_bg_xoffsets( int flip, int noflip ) { m_bg_flipxoffs = flip; m_bg_noflipxoffs = noflip; };
	int m_bg_flipxoffs, m_bg_noflipxoffs;

	void set_transpen ( int pen ) { m_transpen = pen; };
	int m_transpen;

	int is_flipped() { return ((m_spritectrl[ 0 ] & 0x40) >> 6); };

	void set_gfxbank_callback(seta001_gfxbank_callback_func callback) { m_bankcallback = callback; };
	seta001_gfxbank_callback_func m_bankcallback;

	void set_colorbase(int base) { m_colorbase = base; };
	int m_colorbase;

	void set_spritelimit(int limit) { m_spritelimit = limit; };
	int m_spritelimit;


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

private:

	void seta001_draw_background( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int bank_size, int setac_type);
	void seta001_draw_foreground( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int bank_size);

};

WRITE8_DEVICE_HANDLER( spritebgflag_w8 );


READ16_DEVICE_HANDLER( spritectrl_r16 );
WRITE16_DEVICE_HANDLER( spritectrl_w16 );
READ8_DEVICE_HANDLER( spritectrl_r8 );
WRITE8_DEVICE_HANDLER( spritectrl_w8 );

READ16_DEVICE_HANDLER( spriteylow_r16 );
WRITE16_DEVICE_HANDLER( spriteylow_w16 );
READ8_DEVICE_HANDLER( spriteylow_r8 );
WRITE8_DEVICE_HANDLER( spriteylow_w8 );

READ8_DEVICE_HANDLER( spritecodelow_r8 );
WRITE8_DEVICE_HANDLER( spritecodelow_w8 );
READ8_DEVICE_HANDLER( spritecodehigh_r8 );
WRITE8_DEVICE_HANDLER( spritecodehigh_w8 );
READ16_DEVICE_HANDLER( spritecode_r16 );
WRITE16_DEVICE_HANDLER( spritecode_w16 );

extern const device_type SETA001_SPRITE;