1 #include "../vidhrdw/tagteam.c"
2 
3 /***************************************************************************
4 
5 Tag Team Wrestling hardware description:
6 
7 This hardware is very similar to the BurgerTime/Lock N Chase family of games
8 but there are just enough differences to make it a pain to share the
9 codebase. It looks like this hardware is a bridge between the BurgerTime
10 family and the later Technos games, like Mat Mania and Mysterious Stones.
11 
12 The video hardware supports 3 sprite banks instead of 1
13 The sound hardware appears nearly identical to Mat Mania
14 
15 TODO:
16         * fix hi-score (reset) bug
17 
18 ***************************************************************************/
19 
20 #include "driver.h"
21 #include "vidhrdw/generic.h"
22 #include "cpu/m6502/m6502.h"
23 
24 void tagteam_vh_convert_color_prom(unsigned char *palette, unsigned short *colortable,const unsigned char *color_prom);
25 
26 READ_HANDLER( tagteam_mirrorvideoram_r );
27 WRITE_HANDLER( tagteam_mirrorvideoram_w );
28 READ_HANDLER( tagteam_mirrorcolorram_r );
29 WRITE_HANDLER( tagteam_mirrorcolorram_w );
30 WRITE_HANDLER( tagteam_video_control_w );
31 WRITE_HANDLER( tagteam_control_w );
32 
33 int  tagteam_vh_start (void);
34 void tagteam_vh_stop (void);
35 void tagteam_vh_screenrefresh (struct osd_bitmap *bitmap, int full_refresh);
36 
WRITE_HANDLER(sound_command_w)37 static WRITE_HANDLER( sound_command_w )
38 {
39 	soundlatch_w(offset,data);
40 	cpu_cause_interrupt(1,M6502_INT_IRQ);
41 }
42 
43 
44 static struct MemoryReadAddress readmem[] =
45 {
46 	{ 0x0000, 0x07ff, MRA_RAM },
47 	{ 0x2000, 0x2000, input_port_1_r },     /* IN1 */
48 	{ 0x2001, 0x2001, input_port_0_r },     /* IN0 */
49 	{ 0x2002, 0x2002, input_port_2_r },     /* DSW2 */
50 	{ 0x2003, 0x2003, input_port_3_r },     /* DSW1 */
51 	{ 0x4000, 0x43ff, tagteam_mirrorvideoram_r },
52 	{ 0x4400, 0x47ff, tagteam_mirrorcolorram_r },
53 	{ 0x4800, 0x4fff, MRA_RAM },
54 	{ 0x8000, 0xffff, MRA_ROM },
55 	{ -1 }  /* end of table */
56 };
57 
58 static struct MemoryWriteAddress writemem[] =
59 {
60 	{ 0x0000, 0x07ff, MWA_RAM },
61 //	{ 0x2000, 0x2000, tagteam_unk_w },
62 	{ 0x2001, 0x2001, tagteam_control_w },
63 	{ 0x2002, 0x2002, sound_command_w },
64 //	{ 0x2003, 0x2003, MWA_NOP }, /* Appears to increment when you're out of the ring */
65 	{ 0x4000, 0x43ff, tagteam_mirrorvideoram_w },
66 	{ 0x4400, 0x47ff, tagteam_mirrorcolorram_w },
67 	{ 0x4800, 0x4bff, videoram_w, &videoram, &videoram_size },
68 	{ 0x4c00, 0x4fff, colorram_w, &colorram },
69 	{ 0x8000, 0xffff, MWA_ROM },
70 	{ -1 }  /* end of table */
71 };
72 
73 
74 static struct MemoryReadAddress sound_readmem[] =
75 {
76 	{ 0x0000, 0x03ff, MRA_RAM },
77 	{ 0x2007, 0x2007, soundlatch_r },
78 	{ 0x4000, 0xffff, MRA_ROM },
79 	{ -1 }  /* end of table */
80 };
81 
82 static struct MemoryWriteAddress sound_writemem[] =
83 {
84 	{ 0x0000, 0x03ff, MWA_RAM },
85 	{ 0x2000, 0x2000, AY8910_write_port_0_w },
86 	{ 0x2001, 0x2001, AY8910_control_port_0_w },
87 	{ 0x2002, 0x2002, AY8910_write_port_1_w },
88 	{ 0x2003, 0x2003, AY8910_control_port_1_w },
89 	{ 0x2004, 0x2004, DAC_0_data_w },
90 	{ 0x2005, 0x2005, interrupt_enable_w },
91 	{ -1 }  /* end of table */
92 };
93 
94 
95 
tagteam_interrupt(void)96 static int tagteam_interrupt(void)
97 {
98 	static int coin;
99 	int port;
100 
101 	port = readinputport(0) & 0xc0;
102 
103 	if (port != 0xc0)    /* Coin */
104 	{
105 		if (coin == 0)
106 		{
107 			coin = 1;
108 			return nmi_interrupt();
109 		}
110 	}
111 	else coin = 0;
112 
113         return ignore_interrupt();
114 }
115 
116 INPUT_PORTS_START( tagteam )
117 	PORT_START      /* IN0 */
118 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
119 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY )
120 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY )
121 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY )
122 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
123 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
124 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
125 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )
126 
127 	PORT_START      /* IN1 */
128 	PORT_BIT( 0x01, IP_ACTIVE_LOW,  IPT_UNKNOWN )
129 	PORT_BIT( 0x02, IP_ACTIVE_LOW,  IPT_UNKNOWN )
130 	PORT_BIT( 0x04, IP_ACTIVE_LOW,  IPT_TILT )
131 	PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_UNKNOWN )
132 	PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_UNUSED )
133 	PORT_BIT( 0x20, IP_ACTIVE_LOW,  IPT_UNUSED )
134 	PORT_BIT( 0x40, IP_ACTIVE_LOW,  IPT_START1 )
135 	PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_START2 )
136 
137 	PORT_START      /* DSW1 - 7 not used?, 8 = VBLANK! */
138 	PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coinage ) )
139 	PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
140 	PORT_DIPSETTING(    0x0c, "A 2C/1C B 1C/1C" )
141 	PORT_DIPSETTING(    0x08, "A 2C/1C B 1C/2C" )
142 	PORT_DIPSETTING(    0x04, "A 2C/1C B 1C/3C" )
143 	PORT_DIPSETTING(    0x03, "A 1C/1C B 2C/1C" )
144 	PORT_DIPSETTING(    0x0f, DEF_STR( 1C_1C ) )
145 	PORT_DIPSETTING(    0x0b, "A 1C/1C B 1C/2C" )
146 	PORT_DIPSETTING(    0x07, "A 1C/1C B 1C/3C" )
147 	PORT_DIPSETTING(    0x02, "A 1C/2C B 2C/1C" )
148 	PORT_DIPSETTING(    0x0a, DEF_STR( 1C_2C ) )
149 	PORT_DIPSETTING(    0x0e, "A 1C/2C B 1C/1C" )
150 	PORT_DIPSETTING(    0x06, "A 1C/2C B 1C/3C" )
151 	PORT_DIPSETTING(    0x01, "A 1C/3C B 2C/1C" )
152 	PORT_DIPSETTING(    0x0d, "A 1C/3C B 1C/1C" )
153 	PORT_DIPSETTING(    0x09, "A 1C/3C B 1C/2C" )
154 	PORT_DIPSETTING(    0x05, DEF_STR( 1C_3C ) )
155 	PORT_DIPNAME( 0x10, 0x00, DEF_STR( Cabinet ) )
156 	PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
157 	PORT_DIPSETTING(    0x10, DEF_STR( Cocktail ) )
158 	PORT_DIPNAME( 0x20, 0x00, "Control Panel" )
159 	PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
160 	PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
161 	PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
162 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
163 	PORT_DIPSETTING(    0x40, DEF_STR( On ) )
164 	PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK  )
165 
166 	PORT_START      /* DSW2 - 3,4,5,6,7,8 = not used? */
167 	PORT_DIPNAME( 0x01, 0x01, DEF_STR( Difficulty ) )
168 	PORT_DIPSETTING(    0x01, "Normal" )
169 	PORT_DIPSETTING(    0x00, "Hard" )
170 	PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
171 	PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
172 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
173 	PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
174 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
175 	PORT_DIPSETTING(    0x04, DEF_STR( On ) )
176 	PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
177 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
178 	PORT_DIPSETTING(    0x08, DEF_STR( On ) )
179 	PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
180 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
181 	PORT_DIPSETTING(    0x10, DEF_STR( On ) )
182 	PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
183 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
184 	PORT_DIPSETTING(    0x20, DEF_STR( On ) )
185 	PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
186 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
187 	PORT_DIPSETTING(    0x40, DEF_STR( On ) )
188 	PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
189 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
190 	PORT_DIPSETTING(    0x80, DEF_STR( On ) )
191 INPUT_PORTS_END
192 
193 
194 
195 static struct GfxLayout charlayout =
196 {
197 	8,8,    /* 8*8 characters */
198 	3072,   /* 3072 characters */
199 	3,      /* 3 bits per pixel */
200 	{ 2*3072*8*8, 3072*8*8, 0 },    /* the bitplanes are separated */
201 	{ 0, 1, 2, 3, 4, 5, 6, 7 },
202 	{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
203 	8*8     /* every char takes 8 consecutive bytes */
204 };
205 
206 
207 static struct GfxLayout spritelayout =
208 {
209 	16,16,  /* 16*16 sprites */
210 	768,    /* 768 sprites */
211 	3,      /* 3 bits per pixel */
212 	{ 2*768*16*16, 768*16*16, 0 },  /* the bitplanes are separated */
213 	{ 16*8+0, 16*8+1, 16*8+2, 16*8+3, 16*8+4, 16*8+5, 16*8+6, 16*8+7,
214 			0, 1, 2, 3, 4, 5, 6, 7 },
215 	{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
216 			8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
217 	32*8    /* every sprite takes 32 consecutive bytes */
218 };
219 
220 static struct GfxDecodeInfo tagteam_gfxdecodeinfo[] =
221 {
222 	{ REGION_GFX1, 0, &charlayout,   0, 4 }, /* chars */
223 	{ REGION_GFX1, 0, &spritelayout, 0, 4 }, /* sprites */
224 	{ -1 } /* end of array */
225 };
226 
227 
228 
229 static struct AY8910interface ay8910_interface =
230 {
231 	2,      /* 2 chips */
232 	1500000,        /* 1.5 MHz ?? */
233 	{ 25, 25 },
234 	{ 0 },
235 	{ 0 },
236 	{ 0 },
237 	{ 0 }
238 };
239 
240 static struct DACinterface dac_interface =
241 {
242 	1,
243 	{ 255 }
244 };
245 
246 static struct MachineDriver machine_driver_tagteam =
247 {
248 	/* basic machine hardware */
249 	{
250 		{
251 			CPU_M6502,
252 			1500000,	/* 1.5 Mhz ?? */
253 			readmem,writemem,0,0,
254 			tagteam_interrupt,1
255 		},
256 		{
257 			CPU_M6502 | CPU_AUDIO_CPU,
258 			975000,  /* 975 kHz ?? */
259 			sound_readmem,sound_writemem,0,0,
260 			nmi_interrupt,16   /* IRQs are triggered by the main CPU */
261 		}
262 	},
263 	57, 3072,	/* frames per second, vblank duration */
264 	1,	/* 1 CPU slice per frame - interleaving is forced when a sound command is written */
265 	0,
266 
267 	/* video hardware */
268 	32*8, 32*8, { 0*8, 32*8-1, 1*8, 31*8-1 },
269 	tagteam_gfxdecodeinfo,
270 	32, 32,
271 	tagteam_vh_convert_color_prom,
272 
273 	VIDEO_TYPE_RASTER|VIDEO_SUPPORTS_DIRTY,
274 	0,
275 	generic_vh_start,
276 	generic_vh_stop,
277 	tagteam_vh_screenrefresh,
278 
279 	/* sound hardware */
280 	0,0,0,0,
281 	{
282 		{
283 			SOUND_AY8910,
284 			&ay8910_interface
285 		},
286 		{
287 			SOUND_DAC,
288 			&dac_interface
289 		}
290 	}
291 };
292 
293 
294 
295 ROM_START( bigprowr )
296 	ROM_REGION( 0x10000, REGION_CPU1 )	/* 64k for code */
297 	ROM_LOAD( "bf00-1.20",    0x08000, 0x2000, 0x8aba32c9 )
298 	ROM_LOAD( "bf01.33",      0x0a000, 0x2000, 0x0a41f3ae )
299 	ROM_LOAD( "bf02.34",      0x0c000, 0x2000, 0xa28b0a0e )
300 	ROM_LOAD( "bf03.46",      0x0e000, 0x2000, 0xd4cf7ec7 )
301 
302 	ROM_REGION( 0x10000, REGION_CPU2 )	/* 64k for audio code */
303 	ROM_LOAD( "bf4.8",        0x04000, 0x2000, 0x0558e1d8 )
304 	ROM_LOAD( "bf5.7",        0x06000, 0x2000, 0xc1073f24 )
305 	ROM_LOAD( "bf6.6",        0x08000, 0x2000, 0x208cd081 )
306 	ROM_LOAD( "bf7.3",        0x0a000, 0x2000, 0x34a033dc )
307 	ROM_LOAD( "bf8.2",        0x0c000, 0x2000, 0xeafe8056 )
308 	ROM_LOAD( "bf9.1",        0x0e000, 0x2000, 0xd589ce1b )
309 
310 	ROM_REGION( 0x12000, REGION_GFX1 | REGIONFLAG_DISPOSE )
311 	ROM_LOAD( "bf10.89",      0x00000, 0x2000, 0xb1868746 )
312 	ROM_LOAD( "bf11.94",      0x02000, 0x2000, 0xc3fe99c1 )
313 	ROM_LOAD( "bf12.103",     0x04000, 0x2000, 0xc8717a46 )
314 	ROM_LOAD( "bf13.91",      0x06000, 0x2000, 0x23ee34d3 )
315 	ROM_LOAD( "bf14.95",      0x08000, 0x2000, 0xa6721142 )
316 	ROM_LOAD( "bf15.105",     0x0a000, 0x2000, 0x60ae1078 )
317 	ROM_LOAD( "bf16.93",      0x0c000, 0x2000, 0xd33dc245 )
318 	ROM_LOAD( "bf17.96",      0x0e000, 0x2000, 0xccf42380 )
319 	ROM_LOAD( "bf18.107",     0x10000, 0x2000, 0xfd6f006d )
320 
321 	ROM_REGION( 0x0040, REGION_PROMS )
322 	ROM_LOAD( "fko.8",        0x0000, 0x0020, 0xb6ee1483 )
323 	ROM_LOAD( "fjo.25",       0x0020, 0x0020, 0x24da2b63 ) /* What is this prom for? */
324 ROM_END
325 
326 ROM_START( tagteam )
327 	ROM_REGION( 0x10000, REGION_CPU1 )	/* 64k for code */
328 	ROM_LOAD( "prowbf0.bin",  0x08000, 0x2000, 0x6ec3afae )
329 	ROM_LOAD( "prowbf1.bin",  0x0a000, 0x2000, 0xb8fdd176 )
330 	ROM_LOAD( "prowbf2.bin",  0x0c000, 0x2000, 0x3d33a923 )
331 	ROM_LOAD( "prowbf3.bin",  0x0e000, 0x2000, 0x518475d2 )
332 
333 	ROM_REGION( 0x10000, REGION_CPU2 )	/* 64k for audio code */
334 	ROM_LOAD( "bf4.8",        0x04000, 0x2000, 0x0558e1d8 )
335 	ROM_LOAD( "bf5.7",        0x06000, 0x2000, 0xc1073f24 )
336 	ROM_LOAD( "bf6.6",        0x08000, 0x2000, 0x208cd081 )
337 	ROM_LOAD( "bf7.3",        0x0a000, 0x2000, 0x34a033dc )
338 	ROM_LOAD( "bf8.2",        0x0c000, 0x2000, 0xeafe8056 )
339 	ROM_LOAD( "bf9.1",        0x0e000, 0x2000, 0xd589ce1b )
340 
341 	ROM_REGION( 0x12000, REGION_GFX1 | REGIONFLAG_DISPOSE )
342 	ROM_LOAD( "prowbf10.bin", 0x00000, 0x2000, 0x48165902 )
343 	ROM_LOAD( "bf11.94",      0x02000, 0x2000, 0xc3fe99c1 )
344 	ROM_LOAD( "prowbf12.bin", 0x04000, 0x2000, 0x69de1ea2 )
345 	ROM_LOAD( "prowbf13.bin", 0x06000, 0x2000, 0xecfa581d )
346 	ROM_LOAD( "bf14.95",      0x08000, 0x2000, 0xa6721142 )
347 	ROM_LOAD( "prowbf15.bin", 0x0a000, 0x2000, 0xd0de7e03 )
348 	ROM_LOAD( "prowbf16.bin", 0x0c000, 0x2000, 0x75ee5705 )
349 	ROM_LOAD( "bf17.96",      0x0e000, 0x2000, 0xccf42380 )
350 	ROM_LOAD( "prowbf18.bin", 0x10000, 0x2000, 0xe73a4bba )
351 
352 	ROM_REGION( 0x0040, REGION_PROMS )
353 	ROM_LOAD( "fko.8",        0x0000, 0x0020, 0xb6ee1483 )
354 	ROM_LOAD( "fjo.25",       0x0020, 0x0020, 0x24da2b63 ) /* What is this prom for? */
355 ROM_END
356 
357 
358 
359 GAME( 1983, bigprowr, 0,        tagteam, tagteam, 0, ROT270, "Technos", "The Big Pro Wrestling!" )
360 GAME( 1983, tagteam,  bigprowr, tagteam, tagteam, 0, ROT270, "Technos (Data East license)", "Tag Team Wrestling" )
361