summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/includes/deco_mlc.h
blob: e4e5329a533c2d5d83c36c4f07141f42873c6ce3 (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
#include "machine/eeprom.h"
#include "machine/deco146.h"

class deco_mlc_state : public driver_device
{
public:
	deco_mlc_state(const machine_config &mconfig, device_type type, const char *tag)
		: driver_device(mconfig, type, tag),
		m_deco146(*this, "ioprot"),
		m_mlc_ram(*this, "mlc_ram"),
		m_irq_ram(*this, "irq_ram"),
		m_mlc_clip_ram(*this, "mlc_clip_ram"),
		m_mlc_vram(*this, "mlc_vram"),
		m_maincpu(*this, "maincpu"),
		m_eeprom(*this, "eeprom") { }

	optional_device<deco146_device> m_deco146;
	required_shared_ptr<UINT32> m_mlc_ram;
	required_shared_ptr<UINT32> m_irq_ram;
	required_shared_ptr<UINT32> m_mlc_clip_ram;
	required_shared_ptr<UINT32> m_mlc_vram;
	timer_device *m_raster_irq_timer;
	int m_mainCpuIsArm;
	UINT32 m_mlc_raster_table_1[4*256];
	UINT32 m_mlc_raster_table_2[4*256];
	UINT32 m_mlc_raster_table_3[4*256];
	UINT32 m_vbl_i;
	int m_lastScanline[9];
	UINT32 m_colour_mask;

	UINT16 *m_mlc_spriteram;
	UINT16 *m_mlc_spriteram_spare;
	UINT16 *m_mlc_buffered_spriteram;
	DECLARE_READ32_MEMBER(test2_r);
	DECLARE_READ32_MEMBER(mlc_440000_r);
	DECLARE_READ32_MEMBER(mlc_440004_r);
	DECLARE_READ32_MEMBER(mlc_440008_r);
	DECLARE_READ32_MEMBER(mlc_44001c_r);
	DECLARE_WRITE32_MEMBER(mlc_44001c_w);

	DECLARE_WRITE32_MEMBER(avengrs_palette_w);
	DECLARE_READ32_MEMBER(mlc_200000_r);
	DECLARE_READ32_MEMBER(mlc_200004_r);
	DECLARE_READ32_MEMBER(mlc_200070_r);
	DECLARE_READ32_MEMBER(mlc_20007c_r);
	DECLARE_READ32_MEMBER(mlc_scanline_r);
	DECLARE_WRITE32_MEMBER(mlc_irq_w);
	DECLARE_READ32_MEMBER(mlc_vram_r);
	DECLARE_READ32_MEMBER(avengrgs_speedup_r);
	DECLARE_WRITE32_MEMBER(avengrs_eprom_w);
	DECLARE_READ32_MEMBER(mlc_spriteram_r);
	DECLARE_WRITE32_MEMBER(mlc_spriteram_w);



	DECLARE_DRIVER_INIT(mlc);
	DECLARE_DRIVER_INIT(avengrgs);
	DECLARE_MACHINE_RESET(mlc);
	DECLARE_VIDEO_START(mlc);
	UINT32 screen_update_mlc(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
	void screen_eof_mlc(screen_device &screen, bool state);
	TIMER_DEVICE_CALLBACK_MEMBER(interrupt_gen);
	void blitRaster(bitmap_rgb32 &bitmap, int rasterMode);
	void draw_sprites( const rectangle &cliprect, int scanline, UINT32* dest);
	void descramble_sound(  );
	required_device<cpu_device> m_maincpu;
	required_device<eeprom_device> m_eeprom;

	DECLARE_READ16_MEMBER( sh96_protection_region_0_146_r );
	DECLARE_WRITE16_MEMBER( sh96_protection_region_0_146_w );
};