summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/includes/deco32.h
blob: cf8ef87aa185a93f9d0ef4253a1b301f7fe652ad (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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
#include "audio/decobsmt.h"
#include "video/bufsprite.h"

class deco32_state : public driver_device
{
public:
	deco32_state(const machine_config &mconfig, device_type type, const char *tag)
		: driver_device(mconfig, type, tag),
		m_maincpu(*this, "maincpu"),
		m_decobsmt(*this, "decobsmt"),
		m_spriteram(*this, "spriteram"),
		m_ram(*this, "ram"),
		m_pf1_rowscroll32(*this, "pf1_rowscroll32"),
		m_pf2_rowscroll32(*this, "pf2_rowscroll32"),
		m_pf3_rowscroll32(*this, "pf3_rowscroll32"),
		m_pf4_rowscroll32(*this, "pf4_rowscroll32"),
		m_ace_ram(*this, "ace_ram"){ }

	required_device<cpu_device> m_maincpu;
	optional_device<decobsmt_device> m_decobsmt;
	optional_device<buffered_spriteram32_device> m_spriteram;
	required_shared_ptr<UINT32> m_ram;
	// we use the pointers below to store a 32-bit copy..
	required_shared_ptr<UINT32> m_pf1_rowscroll32;
	required_shared_ptr<UINT32> m_pf2_rowscroll32;
	required_shared_ptr<UINT32> m_pf3_rowscroll32;
	required_shared_ptr<UINT32> m_pf4_rowscroll32;

	optional_shared_ptr<UINT32> m_ace_ram;

	int m_raster_enable;
	timer_device *m_raster_irq_timer;
	UINT8 m_nslasher_sound_irq;
	int m_strobe;
	int m_tattass_eprom_bit;
	int m_lastClock;
	char m_buffer[32];
	int m_bufPtr;
	int m_pendingCommand;
	int m_readBitCount;
	int m_byteAddr;

	int m_ace_ram_dirty;
	int m_has_ace_ram;

	UINT8 *m_dirty_palette;

	int m_pri;
	bitmap_ind16 *m_tilemap_alpha_bitmap;


	UINT16 m_spriteram16[0x1000];
	UINT16 m_spriteram16_buffered[0x1000];
	UINT16 m_spriteram16_2[0x1000];
	UINT16 m_spriteram16_2_buffered[0x1000];
	UINT16    m_pf1_rowscroll[0x1000];
	UINT16    m_pf2_rowscroll[0x1000];
	UINT16    m_pf3_rowscroll[0x1000];
	UINT16    m_pf4_rowscroll[0x1000];

	device_t *m_deco_tilegen1;
	device_t *m_deco_tilegen2;
	UINT8 m_irq_source;
	DECLARE_READ32_MEMBER(deco32_irq_controller_r);
	DECLARE_WRITE32_MEMBER(deco32_irq_controller_w);
	DECLARE_WRITE32_MEMBER(deco32_sound_w);
	DECLARE_READ32_MEMBER(deco32_71_r);
	DECLARE_READ32_MEMBER(captaven_prot_r);
	DECLARE_READ32_MEMBER(captaven_soundcpu_r);
	DECLARE_READ32_MEMBER(fghthist_control_r);
	DECLARE_WRITE32_MEMBER(fghthist_eeprom_w);
	DECLARE_READ32_MEMBER(dragngun_service_r);
	DECLARE_READ32_MEMBER(lockload_gun_mirror_r);
	DECLARE_READ32_MEMBER(dragngun_prot_r);
	DECLARE_READ32_MEMBER(tattass_prot_r);
	DECLARE_WRITE32_MEMBER(tattass_prot_w);
	DECLARE_WRITE32_MEMBER(tattass_control_w);
	DECLARE_READ32_MEMBER(nslasher_prot_r);
	DECLARE_WRITE32_MEMBER(nslasher_eeprom_w);
	DECLARE_WRITE32_MEMBER(nslasher_prot_w);
	DECLARE_READ32_MEMBER(deco32_spriteram_r);
	DECLARE_WRITE32_MEMBER(deco32_spriteram_w);
	DECLARE_WRITE32_MEMBER(deco32_buffer_spriteram_w);
	DECLARE_READ32_MEMBER(deco32_spriteram2_r);
	DECLARE_WRITE32_MEMBER(deco32_spriteram2_w);
	DECLARE_WRITE32_MEMBER(deco32_buffer_spriteram2_w);
	DECLARE_WRITE32_MEMBER(deco32_pf1_rowscroll_w);
	DECLARE_WRITE32_MEMBER(deco32_pf2_rowscroll_w);
	DECLARE_WRITE32_MEMBER(deco32_pf3_rowscroll_w);
	DECLARE_WRITE32_MEMBER(deco32_pf4_rowscroll_w);
	DECLARE_READ8_MEMBER(latch_r);
	DECLARE_WRITE32_MEMBER(deco32_pri_w);
	DECLARE_WRITE32_MEMBER(deco32_ace_ram_w);
	DECLARE_WRITE32_MEMBER(deco32_nonbuffered_palette_w);
	DECLARE_WRITE32_MEMBER(deco32_buffered_palette_w);
	DECLARE_WRITE32_MEMBER(deco32_palette_dma_w);
	DECLARE_READ32_MEMBER(dragngun_eeprom_r);
	DECLARE_WRITE32_MEMBER(dragngun_eeprom_w);
	DECLARE_WRITE8_MEMBER(sound_bankswitch_w);
	DECLARE_DRIVER_INIT(tattass);
	DECLARE_DRIVER_INIT(nslasher);
	DECLARE_DRIVER_INIT(captaven);
	DECLARE_DRIVER_INIT(fghthist);
	DECLARE_MACHINE_RESET(deco32);
	DECLARE_VIDEO_START(captaven);
	DECLARE_VIDEO_START(fghthist);
	DECLARE_VIDEO_START(nslasher);
	UINT32 screen_update_captaven(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
	UINT32 screen_update_fghthist(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
	UINT32 screen_update_nslasher(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);	
	void screen_eof_captaven(screen_device &screen, bool state);
	INTERRUPT_GEN_MEMBER(deco32_vbl_interrupt);
	TIMER_DEVICE_CALLBACK_MEMBER(interrupt_gen);
	TIMER_DEVICE_CALLBACK_MEMBER(lockload_vbl_irq);
};

class dragngun_state : public deco32_state
{
public:
	dragngun_state(const machine_config &mconfig, device_type type, const char *tag)
		: deco32_state(mconfig, type, tag),
		  m_dragngun_sprite_layout_0_ram(*this, "dragngun_lay0"),
		  m_dragngun_sprite_layout_1_ram(*this, "dragngun_lay1"),
		  m_dragngun_sprite_lookup_0_ram(*this, "dragngun_look0"),
		  m_dragngun_sprite_lookup_1_ram(*this, "dragngun_look1") { }

	required_shared_ptr<UINT32> m_dragngun_sprite_layout_0_ram;
	required_shared_ptr<UINT32> m_dragngun_sprite_layout_1_ram;
	required_shared_ptr<UINT32> m_dragngun_sprite_lookup_0_ram;
	required_shared_ptr<UINT32> m_dragngun_sprite_lookup_1_ram;
	UINT32 m_dragngun_sprite_ctrl;
	int m_dragngun_lightgun_port;
	DECLARE_READ32_MEMBER(dragngun_lightgun_r);
	DECLARE_WRITE32_MEMBER(dragngun_lightgun_w);
	DECLARE_WRITE32_MEMBER(dragngun_sprite_control_w);
	DECLARE_WRITE32_MEMBER(dragngun_spriteram_dma_w);
	DECLARE_DRIVER_INIT(dragngun);
	DECLARE_DRIVER_INIT(lockload);
	DECLARE_VIDEO_START(dragngun);
	DECLARE_VIDEO_START(lockload);
	UINT32 screen_update_dragngun(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
	void screen_eof_dragngun(screen_device &screen, bool state);
};

/*----------- defined in video/deco32.c -----------*/
DECLARE_WRITE32_HANDLER( deco32_pf1_data_w );
DECLARE_WRITE32_HANDLER( deco32_pf2_data_w );
DECLARE_WRITE32_HANDLER( deco32_pf3_data_w );
DECLARE_WRITE32_HANDLER( deco32_pf4_data_w );