1 /* Mug Smashers (c)199? Electronic Devices (Italy) / 3D Games (England)
2 	driver by David Haywood - Dip Switches and Inputs by Stephane Humbert
3 
4  a side scrolling beat-em-up, borrows ideas from Combatribes, including
5  the music (apparently) and sound hardware!
6 
7  there is also a Spanish company logo in the graphic roms
8 
9  a 1990 copyright can be found in the sound program so its 1990 at the
10  earliest
11 
12 */
13 
14 /* working notes:
15 
16 68k interrupts
17 lev 1 : 0x64 : 0000 0100 - just rte
18 lev 2 : 0x68 : 0000 0100 - just rte
19 lev 3 : 0x6c : 0000 0100 - just rte
20 lev 4 : 0x70 : 0000 0100 - just rte
21 lev 5 : 0x74 : 0000 0100 - just rte
22 lev 6 : 0x78 : 0000 0102 - vblank?
23 lev 7 : 0x7c : 0000 0100 - just rte
24 
25 to fix:
26 
27 attribute bits on bg tiles - what are they for?
28 
29 is scrolling / bg placement 100% correct?
30 
31 
32 dsw note:
33 
34 the DSW ports are a bit odd, from reading the test mode it appears the
35 board has 2 physical dipswitches, however these are mapped over multiple
36 real addresses, obviously this gives us two ways of dealing with them,
37 USE_FAKE_INPUT_PORTS is used at compile time to give an option of which
38 behavior we use .
39 
40 */
41 
42 #include "driver.h"
43 
44 data16_t *mugsmash_videoram1, *mugsmash_videoram2, *mugs_spriteram;
45 data16_t *mugsmash_regs1, *mugsmash_regs2;
46 
47 VIDEO_START( mugsmash );
48 VIDEO_UPDATE( mugsmash );
49 
50 WRITE16_HANDLER( mugsmash_reg_w );
51 WRITE16_HANDLER( mugsmash_videoram2_w );
52 WRITE16_HANDLER( mugsmash_videoram1_w );
53 
WRITE16_HANDLER(mugsmash_reg2_w)54 static WRITE16_HANDLER( mugsmash_reg2_w )
55 {
56 	mugsmash_regs2[offset] = data;
57 /*	usrintf_showmessage	("Regs2 %04x, %04x, %04x, %04x", mugsmash_regs2[0], mugsmash_regs2[1],mugsmash_regs2[2], mugsmash_regs2[3]);*/
58 
59 	switch (offset)
60 	{
61 	case 1:
62 		soundlatch_w(1,data&0xff);
63 		cpu_set_irq_line( 1, IRQ_LINE_NMI, PULSE_LINE );
64 		break;
65 
66 	default:
67 		break;
68 	}
69 
70 }
71 
72 
73 /* Ports mapping :
74 
75 	$180000.w : 0123456789ABCDEF
76 	            x---------------	right     (player 1)
77 	            -x--------------	left      (player 1)
78 	            --x-------------	up        (player 1)
79 	            ---x------------	down      (player 1)
80 	            ----x-----------	button 1  (player 1)
81 	            -----x----------	button 2  (player 1)
82 	            ------x---------	button 3  (player 1)
83 	            -------x--------	start     (player 1)
84 	            --------x-------	coin 1
85 	            ---------x------	coin 2
86 	            ----------x-----	unused
87 	            -----------x----	unused
88 	            ------------x---	SW1-7     ("Color Test")     *
89 	            -------------x--	SW1-8     ("Draw SF.")       *
90 	            --------------x-	unused
91 	            ---------------x	unused
92 
93 	$180002.w : 0123456789ABCDEF
94 	            x---------------	right     (player 2)
95 	            -x--------------	left      (player 2)
96 	            --x-------------	up        (player 2)
97 	            ---x------------	down      (player 2)
98 	            ----x-----------	button 1  (player 2)
99 	            -----x----------	button 2  (player 2)
100 	            ------x---------	button 3  (player 2)
101 	            -------x--------	start     (player 2)
102 	            --------x-------	SW1-1     ("Test Mode")
103 	            ---------x------	SW1-2     ("Coin/Credit")
104 	            ----------x-----	SW1-3     ("Coin/Credit")
105 	            -----------x----	SW1-4     ("Coin/Credit")
106 	            ------------x---	SW1-5     ("Continue")
107 	            -------------x--	SW1-6     ("Sound Test")     *
108 	            --------------x-	unused
109 	            ---------------x	unused
110 
111 	$180004.w : 0123456789ABCDEF
112 	            x---------------	unused
113 	            -x--------------	unused
114 	            --x-------------	unused
115 	            ---x------------	unused
116 	            ----x-----------	unused
117 	            -----x----------	unused
118 	            ------x---------	unused
119 	            -------x--------	unused
120 	            --------x-------	SW2-1     ("Sound Demo")
121 	            ---------x------	SW2-2     ("Lives Num")
122 	            ----------x-----	SW2-3     ("Lives Num")
123 	            -----------x----	SW2-4     ("Not Used")
124 	            ------------x---	SW2-5     ("Diff Level")
125 	            -------------x--	SW2-6     ("Diff Level")
126 	            --------------x-	unused
127 	            ---------------x	unused
128 
129 	$180006.w : 0123456789ABCDEF
130 	            x---------------	unused
131 	            -x--------------	unused
132 	            --x-------------	unused
133 	            ---x------------	unused
134 	            ----x-----------	unused
135 	            -----x----------	unused
136 	            ------x---------	unused
137 	            -------x--------	unused
138 	            --------x-------	SW2-7     ("Draw Obj")       *
139 	            ---------x------	SW2-8     ("Screen Pause")
140 	            ----------x-----	unused
141 	            -----------x----	unused
142 	            ------------x---	unused
143 	            -------------x--	unused
144 	            --------------x-	unused
145 	            ---------------x	unused
146 
147 	* only available when you are in "test mode"
148 
149 */
150 
151 #define USE_FAKE_INPUT_PORTS	0
152 
153 #if USE_FAKE_INPUT_PORTS
READ16_HANDLER(mugsmash_input_ports_r)154 static READ16_HANDLER ( mugsmash_input_ports_r )
155 {
156 	UINT16 data = 0xffff;
157 
158 	switch (offset)
159 	{
160 		case 0 :
161 			data = (readinputport(0) & 0xff) | ((readinputport(3) & 0xc0) << 6) | ((readinputport(2) & 0x03) << 8);
162 			break;
163 		case 1 :
164 			data = (readinputport(1) & 0xff) | ((readinputport(3) & 0x3f) << 8);
165 			break;
166 		case 2 :
167 			data = ((readinputport(4) & 0x3f) << 8);
168 			break;
169 		case 3 :
170 			data = ((readinputport(4) & 0xc0) << 2);
171 			break;
172 	}
173 
174 	return (data);
175 }
176 #endif
177 
MEMORY_READ16_START(mugsmash_readmem)178 static MEMORY_READ16_START( mugsmash_readmem )
179 	{ 0x000000, 0x07ffff, MRA16_ROM },
180 	{ 0x080000, 0x080fff, MRA16_RAM },
181 	{ 0x082000, 0x082fff, MRA16_RAM },
182 	{ 0x100000, 0x1001ff, MRA16_RAM },
183 	{ 0x100200, 0x1005ff, MRA16_RAM },
184 	{ 0x1c0000, 0x1c3fff, MRA16_RAM },
185 	{ 0x1c4000, 0x1cffff, MRA16_RAM },
186 	{ 0x200000, 0x201fff, MRA16_RAM },
187 	{ 0x202000, 0x203fff, MRA16_RAM },
188 #if USE_FAKE_INPUT_PORTS
189 	{ 0x180000, 0x180007, mugsmash_input_ports_r },
190 #else
191 	{ 0x180000, 0x180001, input_port_0_word_r },
192 	{ 0x180002, 0x180003, input_port_1_word_r },
193 	{ 0x180004, 0x180005, input_port_2_word_r },
194 	{ 0x180006, 0x180007, input_port_3_word_r },
195 #endif
196 MEMORY_END
197 
198 static MEMORY_WRITE16_START( mugsmash_writemem )
199 	{ 0x000000, 0x07ffff, MWA16_ROM },
200 	{ 0x080000, 0x080fff, mugsmash_videoram1_w , &mugsmash_videoram1 },
201 	{ 0x082000, 0x082fff, mugsmash_videoram2_w , &mugsmash_videoram2 },
202 	{ 0x0C0000, 0x0C0007, mugsmash_reg_w, &mugsmash_regs1 }, 	/* video registers*/
203 	{ 0x100000, 0x1005ff, paletteram16_xRRRRRGGGGGBBBBB_word_w, &paletteram16 },
204 	{ 0x140000, 0x140007, mugsmash_reg2_w, &mugsmash_regs2  }, /* sound + ? */
205 	{ 0x1c0000, 0x1c3fff, MWA16_RAM }, /* main ram? */
206 	{ 0x1c4000, 0x1cffff, MWA16_RAM },
207 	{ 0x200000, 0x203fff, MWA16_RAM, &mugs_spriteram }, /* sprite ram */
208 MEMORY_END
209 
210 static MEMORY_READ_START( snd_readmem )
211 	{ 0x0000, 0x7fff, MRA_ROM },
212 	{ 0x8000, 0x87ff, MRA_RAM },
213 	{ 0x8801, 0x8801, YM2151_status_port_0_r },
214 	{ 0x9800, 0x9800, OKIM6295_status_0_r },
215 	{ 0xa000, 0xa000, soundlatch_r },
216 MEMORY_END
217 
218 static MEMORY_WRITE_START( snd_writemem )
219 	{ 0x0000, 0x7fff, MWA_ROM },
220 	{ 0x8000, 0x87ff, MWA_RAM },
221 	{ 0x8800, 0x8800, YM2151_register_port_0_w },
222 	{ 0x8801, 0x8801, YM2151_data_port_0_w },
223 	{ 0x9800, 0x9800, OKIM6295_data_0_w },
224 MEMORY_END
225 
226 
227 #define MUGSMASH_PLAYER_INPUT( player, start ) \
228 	PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | player ) \
229 	PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | player ) \
230 	PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | player ) \
231 	PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | player ) \
232 	PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 | player ) \
233 	PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 | player ) \
234 	PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 | player ) \
235 	PORT_BIT( 0x0080, IP_ACTIVE_LOW, start )
236 
237 
238 #if USE_FAKE_INPUT_PORTS
239 INPUT_PORTS_START( mugsmash )
240 	PORT_START	/* Fake IN0 (player 1 inputs) */
241 	MUGSMASH_PLAYER_INPUT( IPF_PLAYER1, IPT_START1 )
242 
243 	PORT_START	/* Fake IN1 (player 2 inputs) */
244 	MUGSMASH_PLAYER_INPUT( IPF_PLAYER2, IPT_START2 )
245 
246 	PORT_START	/* Fake IN2 (system inputs) */
247 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
248 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
249 	PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED )
250 
251 	PORT_START	/* Fake IN3 (SW1) */
252 	PORT_SERVICE( 0x01, IP_ACTIVE_LOW )					/* SW1-1*/
253 	PORT_DIPNAME( 0x0e, 0x00, DEF_STR( Coinage ) )			/* SW1-2 to SW1-4*/
254 	PORT_DIPSETTING(    0x0c, DEF_STR( 4C_1C ) )
255 	PORT_DIPSETTING(    0x0a, DEF_STR( 3C_1C ) )
256 	PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
257 	PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
258 	PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
259 	PORT_DIPSETTING(    0x04, DEF_STR( 1C_3C ) )
260 	PORT_DIPSETTING(    0x06, DEF_STR( 1C_4C ) )
261 	PORT_DIPSETTING(    0x0e, DEF_STR( Free_Play ) )
262 	PORT_DIPNAME( 0x10, 0x00, "Allow Continue" )			/* SW1-5*/
263 	PORT_DIPSETTING(    0x10, DEF_STR( No ) )
264 	PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
265 	PORT_DIPNAME( 0x20, 0x20, "Sound Test" )				/* SW1-6 (in "test mode" only)*/
266 	PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
267 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
268 	PORT_DIPNAME( 0x40, 0x40, "Color Test" )				/* SW1-7 (in "test mode" only)*/
269 	PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
270 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
271 	PORT_DIPNAME( 0x80, 0x80, "Draw SF." )				/* SW1-8 (in "test mode" only)*/
272 	PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
273 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
274 
275 	PORT_START	/* Fake IN4 (SW2) */
276 	PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) )		/* SW2-1*/
277 	PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
278 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
279 	PORT_DIPNAME( 0x06, 0x02, DEF_STR( Lives ) )			/* SW2-2 and SW2-3*/
280 	PORT_DIPSETTING(    0x00, "1" )
281 	PORT_DIPSETTING(    0x02, "2" )
282 	PORT_DIPSETTING(    0x04, "3" )
283 	PORT_DIPSETTING(    0x06, "4" )
284 	PORT_DIPNAME( 0x08, 0x08, "Unused SW 2-4" )			/* SW2-4*/
285 	PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
286 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
287 	PORT_DIPNAME( 0x30, 0x10, DEF_STR( Difficulty ) )		/* SW2-5 and SW2-6*/
288 	PORT_DIPSETTING(    0x00, "Very Easy" )
289 	PORT_DIPSETTING(    0x10, "Easy" )
290 	PORT_DIPSETTING(    0x20, "Hard" )
291 	PORT_DIPSETTING(    0x30, "Very Hard" )
292 	PORT_DIPNAME( 0x40, 0x40, "Draw Objects" )			/* SW2-7 (in "test mode" only)*/
293 	PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
294 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
295 	PORT_DIPNAME( 0x80, 0x80, "Freeze" )				/* SW2-8 (= "Screen Pause" in "test mode")*/
296 	PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
297 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
298 INPUT_PORTS_END
299 #else
300 INPUT_PORTS_START( mugsmash )
301 	PORT_START	/* IN0 - $180000.w */
302 	MUGSMASH_PLAYER_INPUT( IPF_PLAYER1, IPT_START1 )
303 	PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN1 )
304 	PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_COIN2 )
305 	PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNUSED )
306 	PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNUSED )
307 	PORT_DIPNAME( 0x1000, 0x1000, "Color Test" )			/* SW1-7 (in "test mode" only)*/
308 	PORT_DIPSETTING(      0x1000, DEF_STR( Off ) )
309 	PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
310 	PORT_DIPNAME( 0x2000, 0x2000, "Draw SF." )			/* SW1-8 (in "test mode" only)*/
311 	PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
312 	PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
313 	PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNUSED )
314 	PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
315 
316 	PORT_START	/* IN1 - $180002.w */
317 	MUGSMASH_PLAYER_INPUT( IPF_PLAYER2, IPT_START2 )
318 	PORT_SERVICE( 0x0100, IP_ACTIVE_LOW )				/* SW1-1*/
319 	PORT_DIPNAME( 0x0e00, 0x0000, DEF_STR( Coinage ) )		/* SW1-2 to SW1-4*/
320 	PORT_DIPSETTING(      0x0c00, DEF_STR( 4C_1C ) )
321 	PORT_DIPSETTING(      0x0a00, DEF_STR( 3C_1C ) )
322 	PORT_DIPSETTING(      0x0800, DEF_STR( 2C_1C ) )
323 	PORT_DIPSETTING(      0x0000, DEF_STR( 1C_1C ) )
324 	PORT_DIPSETTING(      0x0200, DEF_STR( 1C_2C ) )
325 	PORT_DIPSETTING(      0x0400, DEF_STR( 1C_3C ) )
326 	PORT_DIPSETTING(      0x0600, DEF_STR( 1C_4C ) )
327 	PORT_DIPSETTING(      0x0e00, DEF_STR( Free_Play ) )
328 	PORT_DIPNAME( 0x1000, 0x0000, "Allow Continue" )		/* SW1-5*/
329 	PORT_DIPSETTING(      0x1000, DEF_STR( No ) )
330 	PORT_DIPSETTING(      0x0000, DEF_STR( Yes ) )
331 	PORT_DIPNAME( 0x2000, 0x2000, "Sound Test" )			/* SW1-6 (in "test mode" only)*/
332 	PORT_DIPSETTING(      0x2000, DEF_STR( Off ) )
333 	PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
334 	PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNUSED )
335 	PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
336 
337 	PORT_START	/* IN2 - $180004.w */
338 	PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNUSED )
339 	PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNUSED )
340 	PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNUSED )
341 	PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED )
342 	PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNUSED )
343 	PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
344 	PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )
345 	PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
346 	PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Demo_Sounds ) )	/* SW2-1*/
347 	PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
348 	PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
349 	PORT_DIPNAME( 0x0600, 0x0200, DEF_STR( Lives ) )		/* SW2-2 and SW2-3*/
350 	PORT_DIPSETTING(      0x0000, "1" )
351 	PORT_DIPSETTING(      0x0200, "2" )
352 	PORT_DIPSETTING(      0x0400, "3" )
353 	PORT_DIPSETTING(      0x0600, "4" )
354 	PORT_DIPNAME( 0x0800, 0x0800, "Unused SW 2-4" )			/* SW2-4*/
355 	PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
356 	PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
357 	PORT_DIPNAME( 0x3000, 0x1000, DEF_STR( Difficulty ) )		/* SW2-5 and SW2-6*/
358 	PORT_DIPSETTING(      0x0000, "Very Easy" )
359 	PORT_DIPSETTING(      0x1000, "Easy" )
360 	PORT_DIPSETTING(      0x2000, "Hard" )
361 	PORT_DIPSETTING(      0x3000, "Very Hard" )
362 	PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNUSED )
363 	PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
364 
365 	PORT_START	/* IN3 - $180006.w */
366 	PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNUSED )
367 	PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNUSED )
368 	PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNUSED )
369 	PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED )
370 	PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNUSED )
371 	PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
372 	PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )
373 	PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
374 	PORT_DIPNAME( 0x0100, 0x0100, "Draw Objects" )			/* SW2-7 (in "test mode" only)*/
375 	PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
376 	PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
377 	PORT_DIPNAME( 0x0200, 0x0200, "Freeze" )				/* SW2-8 (= "Screen Pause" in "test mode")*/
378 	PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
379 	PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
380 	PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNUSED )
381 	PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNUSED )
382 	PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNUSED )
383 	PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNUSED )
384 	PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNUSED )
385 	PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
386 INPUT_PORTS_END
387 #endif
388 
389 static struct GfxLayout mugsmash_layout =
390 {
391 	16,16,
392 	RGN_FRAC(1,1),
393 	4,
394 	{ 0,1,2,3 },
395 	{ 16,20,24,28,0,4,8,12,48,52,56,60,32,36,40,44 },
396 	{ 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64,
397 	 8*64, 9*64, 10*64, 11*64, 12*64, 13*64, 14*64, 15*64},
398 	16*64
399 };
400 
401 static struct GfxLayout mugsmash2_layout =
402 {
403 	16,16,
404 	RGN_FRAC(1,4),
405 	4,
406 	{ 	0x080000*3*8, 	0x080000*2*8, 	0x080000*1*8,	0x080000*0*8 },
407 	{ 0, 1, 2, 3, 4, 5, 6, 7, 16*8+0,16*8+1,16*8+2,16*8+3,16*8+4,16*8+5,16*8+6,16*8+7  },
408 	{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
409 	32*8
410 };
411 
412 static struct GfxDecodeInfo gfxdecodeinfo[] =
413 {
414 	{ REGION_GFX1, 0, &mugsmash_layout,   0x00, 16  }, /* sprites */
415 	{ REGION_GFX2, 0, &mugsmash2_layout,  0x100, 256  }, /* bg tiles */
416 	{ -1 } /* end of array */
417 };
418 
irq_handler(int irq)419 static void irq_handler(int irq)
420 {
421 	cpu_set_irq_line( 1, 0 , irq ? ASSERT_LINE : CLEAR_LINE );
422 }
423 
424 static struct YM2151interface ym2151_interface =
425 {
426 	1,			/* 1 chip */
427 	3579545,	/* Guess */
428 	{ YM3012_VOL(45,MIXER_PAN_LEFT,45,MIXER_PAN_RIGHT) },
429 	{ irq_handler }
430 };
431 
432 static struct OKIM6295interface okim6295_interface =
433 {
434 	1,				/* 1 chip */
435 	{ 8500 },		/* frequency (Hz) */
436 	{ REGION_SOUND1 },	/* memory region */
437 	{ 47 }
438 };
439 
440 static MACHINE_DRIVER_START( mugsmash )
441 	MDRV_CPU_ADD(M68000, 12000000)
442 	MDRV_CPU_MEMORY(mugsmash_readmem,mugsmash_writemem)
443 	MDRV_CPU_VBLANK_INT(irq6_line_hold,1)
444 
445 	MDRV_CPU_ADD(Z80, 4000000)
446 	MDRV_CPU_FLAGS(CPU_AUDIO_CPU)	/* Guess */
447 	MDRV_CPU_MEMORY(snd_readmem,snd_writemem)
448 
449 	MDRV_FRAMES_PER_SECOND(60)
450 	MDRV_VBLANK_DURATION(DEFAULT_60HZ_VBLANK_DURATION)
451 
452 	MDRV_GFXDECODE(gfxdecodeinfo)
453 
454 	MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
455 	MDRV_SCREEN_SIZE(40*8, 32*8)
456 	MDRV_VISIBLE_AREA(0*8, 40*8-1, 1*8, 30*8-1)
457 	MDRV_PALETTE_LENGTH(0x300)
458 
459 	MDRV_VIDEO_START(mugsmash)
460 	MDRV_VIDEO_UPDATE(mugsmash)
461 
462 	MDRV_SOUND_ATTRIBUTES(SOUND_SUPPORTS_STEREO)
463 	MDRV_SOUND_ADD(YM2151, ym2151_interface)
464 	MDRV_SOUND_ADD(OKIM6295, okim6295_interface)
465 MACHINE_DRIVER_END
466 
467 ROM_START( mugsmash )
468 	ROM_REGION( 0x80000, REGION_CPU1, 0 ) /* 68000 Code */
469 	ROM_LOAD16_BYTE( "mugs_04.bin", 0x00000, 0x40000, CRC(2498fd27) SHA1(7b746efe8aaf346e4489118ac2a3fc9929a55b83) )
470 	ROM_LOAD16_BYTE( "mugs_05.bin", 0x00001, 0x40000, CRC(95efb40b) SHA1(878c0a3754aa728f58044c6a7f243724b718fe1b) )
471 
472 	ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* Z80 Code */
473 	ROM_LOAD( "mugs_03.bin", 0x00000, 0x10000 , CRC(0101df2d) SHA1(35e1efa4a11c0f9d9db5ee057926e5de29c3a4c1) )
474 
475 	ROM_REGION( 0x040000, REGION_SOUND1, 0 ) /* Samples */
476 	ROM_LOAD( "mugs_02.bin", 0x00000, 0x20000, CRC(f92a7f4a) SHA1(3717ef64876be9ada378b449749918ce9072073a) )
477 	ROM_LOAD( "mugs_01.bin", 0x20000, 0x20000, CRC(1a3a0b39) SHA1(8847530027cf4be03ffbc6d78dee97b459d03a04) )
478 
479 	ROM_REGION( 0x300000, REGION_GFX1, 0 ) /* Sprites */
480 	ROM_LOAD16_BYTE( "mugs_11.bin", 0x000000, 0x080000, CRC(1c9f5acf) SHA1(dd8329ed05a3467844c26d3f89ffb6213aba2034) )
481 	ROM_LOAD16_BYTE( "mugs_10.bin", 0x000001, 0x080000, CRC(6b3c22d9) SHA1(7ba6d754c08ed5b2be282ffd6a674c3a4aa0e9b2) )
482 	ROM_LOAD16_BYTE( "mugs_09.bin", 0x100000, 0x080000, CRC(4e9490f3) SHA1(e5f195c9bee3b92c559d1100c1019473a30ba28e) )
483 	ROM_LOAD16_BYTE( "mugs_08.bin", 0x100001, 0x080000, CRC(716328d5) SHA1(d1b84a25985acfb7ccb1582ef9ac8267250888c0) )
484 	ROM_LOAD16_BYTE( "mugs_07.bin", 0x200000, 0x080000, CRC(9e3167fd) SHA1(8c73c26e8e50e8f2ee3307f5aef23caba90c22eb) )
485 	ROM_LOAD16_BYTE( "mugs_06.bin", 0x200001, 0x080000, CRC(8df75d29) SHA1(d0add24ac974da4636d2631f5590516de0f8df4a) )
486 
487 	ROM_REGION( 0x200000, REGION_GFX2, 0 ) /* BG Tiles */
488 	ROM_LOAD( "mugs_12.bin", 0x000000, 0x080000, CRC(c0a6ed98) SHA1(13850c6bcca65bdc782040c470c4966aee19551d) )
489 	ROM_LOAD( "mugs_13.bin", 0x080000, 0x080000, CRC(e2be8595) SHA1(077b1a262c54acf74e6ec37702bcfed41bc31000) )
490 	ROM_LOAD( "mugs_14.bin", 0x100000, 0x080000, CRC(24e81068) SHA1(1e33aa7d2b873dd13d5823880c46d3d3e867d6b6) )
491 	ROM_LOAD( "mugs_15.bin", 0x180000, 0x080000, CRC(82e8187c) SHA1(c7a0e1b3d90dbbe2588886a27a07a9c336447ae3) )
492 ROM_END
493 
494 GAME( 1990?, mugsmash, 0, mugsmash, mugsmash, 0, ROT0, "Electronic Devices Italy / 3D Games England", "Mug Smashers" )
495