1 /***************************************************************************
2 
3 							-=  SunA 16 Bit Games =-
4 
5 					driver by	Luca Elia (l.elia@tin.it)
6 
7 
8 CPU:	68000   +  Z80 [Music]  +  Z80 x 2 [4 Bit PCM]
9 Sound:	YM2151  +  DAC x 4
10 
11 
12 ---------------------------------------------------------------------------
13 Year + Game					By		Hardware
14 ---------------------------------------------------------------------------
15 96	Back Street Soccer		SunA	68000 + Z80 x 3 + YM2151 + DAC x 4
16 96	Ultra Balloon			SunA	68000 + Z80 x 2 + YM2151 + DAC x 2
17 ---------------------------------------------------------------------------
18 
19 
20 ***************************************************************************/
21 
22 #include "driver.h"
23 #include "vidhrdw/generic.h"
24 
25 /* Variables and functions defined in vidhrdw: */
26 
27 WRITE16_HANDLER( suna16_flipscreen_w );
28 
29 READ16_HANDLER ( suna16_paletteram16_r );
30 WRITE16_HANDLER( suna16_paletteram16_w );
31 
32 VIDEO_START( suna16 );
33 VIDEO_UPDATE( suna16 );
34 
35 
36 /***************************************************************************
37 
38 
39 								Main CPU
40 
41 
42 ***************************************************************************/
43 
WRITE16_HANDLER(suna16_soundlatch_w)44 WRITE16_HANDLER( suna16_soundlatch_w )
45 {
46 	if (ACCESSING_LSB)
47 	{
48 		if (Machine->sample_rate != 0)
49 			soundlatch_w( 0, data & 0xff );
50 	}
51 	if (data & ~0xff)	log_cb(RETRO_LOG_DEBUG, LOGPRE "CPU#0 PC %06X - Sound latch unknown bits: %04X\n", activecpu_get_pc(), data);
52 }
53 
54 
WRITE16_HANDLER(bssoccer_leds_w)55 WRITE16_HANDLER( bssoccer_leds_w )
56 {
57 	if (ACCESSING_LSB)
58 	{
59 		set_led_status(0, data & 0x01);
60 		set_led_status(1, data & 0x02);
61 		set_led_status(2, data & 0x04);
62 		set_led_status(3, data & 0x08);
63 		coin_counter_w(0, data & 0x10);
64 	}
65 	if (data & ~0x1f)	log_cb(RETRO_LOG_DEBUG, LOGPRE "CPU#0 PC %06X - Leds unknown bits: %04X\n", activecpu_get_pc(), data);
66 }
67 
68 
WRITE16_HANDLER(uballoon_leds_w)69 WRITE16_HANDLER( uballoon_leds_w )
70 {
71 	if (ACCESSING_LSB)
72 	{
73 		coin_counter_w(0, data & 0x01);
74 		set_led_status(0, data & 0x02);
75 		set_led_status(1, data & 0x04);
76 	}
77 	if (data & ~0x07)	log_cb(RETRO_LOG_DEBUG, LOGPRE "CPU#0 PC %06X - Leds unknown bits: %04X\n", activecpu_get_pc(), data);
78 }
79 
80 
81 /***************************************************************************
82 							Back Street Soccer
83 ***************************************************************************/
84 
MEMORY_READ16_START(bssoccer_readmem)85 static MEMORY_READ16_START( bssoccer_readmem )
86 	{ 0x000000, 0x1fffff, MRA16_ROM 				},	/* ROM*/
87 	{ 0x200000, 0x203fff, MRA16_RAM 				},	/* RAM*/
88 	{ 0x400000, 0x4001ff, suna16_paletteram16_r	},	/* Banked Palette*/
89 	{ 0x400200, 0x400fff, MRA16_RAM 				},	/**/
90 	{ 0x600000, 0x61ffff, MRA16_RAM 				},	/* Sprites*/
91 	{ 0xa00000, 0xa00001, input_port_0_word_r		},	/* P1 (Inputs)*/
92 	{ 0xa00002, 0xa00003, input_port_1_word_r		},	/* P2*/
93 	{ 0xa00004, 0xa00005, input_port_2_word_r		},	/* P3*/
94 	{ 0xa00006, 0xa00007, input_port_3_word_r		},	/* P4*/
95 	{ 0xa00008, 0xa00009, input_port_4_word_r		},	/* DSWs*/
96 	{ 0xa0000a, 0xa0000b, input_port_5_word_r		},	/* Coins*/
97 MEMORY_END
98 
99 static MEMORY_WRITE16_START( bssoccer_writemem )
100 	{ 0x000000, 0x1fffff, MWA16_ROM 				},	/* ROM*/
101 	{ 0x200000, 0x203fff, MWA16_RAM 				},	/* RAM*/
102 	{ 0x400000, 0x4001ff, suna16_paletteram16_w, &paletteram16 },  /* Banked Palette*/
103 	{ 0x400200, 0x400fff, MWA16_RAM 				},	/**/
104 	{ 0x600000, 0x61ffff, MWA16_RAM, &spriteram16	},	/* Sprites*/
105 	{ 0xa00000, 0xa00001, suna16_soundlatch_w		},	/* To Sound CPU*/
106 	{ 0xa00002, 0xa00003, suna16_flipscreen_w		},	/* Flip Screen*/
107 	{ 0xa00004, 0xa00005, bssoccer_leds_w			},	/* Leds*/
108 	{ 0xa00006, 0xa00007, MWA16_NOP					},	/* ? IRQ 1 Ack*/
109 	{ 0xa00008, 0xa00009, MWA16_NOP					},	/* ? IRQ 2 Ack*/
110 MEMORY_END
111 
112 
113 /***************************************************************************
114 								Ultra Balloon
115 ***************************************************************************/
116 
117 WRITE16_HANDLER( uballoon_spriteram16_w )
118 {
119 	COMBINE_DATA( &spriteram16[offset] );
120 }
121 
MEMORY_READ16_START(uballoon_readmem)122 static MEMORY_READ16_START( uballoon_readmem )
123 	{ 0x000000, 0x0fffff, MRA16_ROM 				},	/* ROM*/
124 	{ 0x800000, 0x803fff, MRA16_RAM 				},	/* RAM*/
125 	{ 0x200000, 0x2001ff, suna16_paletteram16_r	},	/* Banked Palette*/
126 	{ 0x200200, 0x200fff, MRA16_RAM 				},	/**/
127 	{ 0x400000, 0x41ffff, MRA16_RAM 				},	/* Sprites*/
128 	{ 0x600000, 0x600001, input_port_0_word_r		},	/* P1 + Coins(Inputs)*/
129 	{ 0x600002, 0x600003, input_port_1_word_r		},	/* P2 + Coins*/
130 	{ 0x600004, 0x600005, input_port_2_word_r		},	/* DSW 1*/
131 	{ 0x600006, 0x600007, input_port_3_word_r		},	/* DSW 2*/
132 	{ 0xa00000, 0xa0ffff, MRA16_NOP					},	/* Protection*/
133 MEMORY_END
134 
135 static MEMORY_WRITE16_START( uballoon_writemem )
136 	{ 0x000000, 0x0fffff, MWA16_ROM 				},	/* ROM*/
137 	{ 0x800000, 0x803fff, MWA16_RAM 				},	/* RAM*/
138 	{ 0x200000, 0x2001ff, suna16_paletteram16_w, &paletteram16 },  /* Banked Palette*/
139 	{ 0x200200, 0x200fff, MWA16_RAM 				},	/**/
140 	{ 0x400000, 0x41ffff, MWA16_RAM, &spriteram16	},	/* Sprites*/
141 	{ 0x5c0000, 0x5dffff, uballoon_spriteram16_w	},	/* Sprites (Mirror?)*/
142 	{ 0x600000, 0x600001, suna16_soundlatch_w		},	/* To Sound CPU*/
143 	{ 0x600004, 0x600005, suna16_flipscreen_w		},	/* Flip Screen*/
144 	{ 0x600008, 0x600009, uballoon_leds_w			},	/* Leds*/
145 	{ 0x60000c, 0x60000d, MWA16_NOP					},	/* ? IRQ 1 Ack*/
146 	{ 0x600010, 0x600011, MWA16_NOP					},	/* ? IRQ 1 Ack*/
147 	{ 0xa00000, 0xa0ffff, MWA16_NOP					},	/* Protection*/
148 MEMORY_END
149 
150 
151 
152 /***************************************************************************
153 
154 
155 									Z80 #1
156 
157 		Plays the music (YM2151) and controls the 2 Z80s in charge
158 		of playing the PCM samples
159 
160 
161 ***************************************************************************/
162 
163 /***************************************************************************
164 							Back Street Soccer
165 ***************************************************************************/
166 
167 static MEMORY_READ_START( bssoccer_sound_readmem )
168 	{ 0x0000, 0x7fff, MRA_ROM					},	/* ROM*/
169 	{ 0xf000, 0xf7ff, MRA_RAM					},	/* RAM*/
170 	{ 0xf801, 0xf801, YM2151_status_port_0_r	},	/* YM2151*/
171 	{ 0xfc00, 0xfc00, soundlatch_r				},	/* From Main CPU*/
172 MEMORY_END
173 
174 static MEMORY_WRITE_START( bssoccer_sound_writemem )
175 	{ 0x0000, 0x7fff, MWA_ROM					},	/* ROM*/
176 	{ 0xf000, 0xf7ff, MWA_RAM					},	/* RAM*/
177 	{ 0xf800, 0xf800, YM2151_register_port_0_w	},	/* YM2151*/
178 	{ 0xf801, 0xf801, YM2151_data_port_0_w		},	/**/
179 	{ 0xfd00, 0xfd00, soundlatch2_w 			},	/* To PCM Z80 #1*/
180 	{ 0xfe00, 0xfe00, soundlatch3_w 			},	/* To PCM Z80 #2*/
181 MEMORY_END
182 
183 /***************************************************************************
184 								Ultra Balloon
185 ***************************************************************************/
186 
187 static MEMORY_READ_START( uballoon_sound_readmem )
188 	{ 0x0000, 0xefff, MRA_ROM					},	/* ROM*/
189 	{ 0xf000, 0xf7ff, MRA_RAM					},	/* RAM*/
190 	{ 0xf801, 0xf801, YM2151_status_port_0_r	},	/* YM2151*/
191 	{ 0xfc00, 0xfc00, soundlatch_r				},	/* From Main CPU*/
192 MEMORY_END
193 
194 static MEMORY_WRITE_START( uballoon_sound_writemem )
195 	{ 0x0000, 0xefff, MWA_ROM					},	/* ROM*/
196 	{ 0xf000, 0xf7ff, MWA_RAM					},	/* RAM*/
197 	{ 0xf800, 0xf800, YM2151_register_port_0_w	},	/* YM2151*/
198 	{ 0xf801, 0xf801, YM2151_data_port_0_w		},	/**/
199 	{ 0xfc00, 0xfc00, soundlatch2_w				},	/* To PCM Z80*/
200 MEMORY_END
201 
202 
203 
204 /***************************************************************************
205 
206 
207 								Z80 #2 & #3
208 
209 		Dumb PCM samples players (e.g they don't even have RAM!)
210 
211 
212 ***************************************************************************/
213 
214 /***************************************************************************
215 							Back Street Soccer
216 ***************************************************************************/
217 
218 /* Bank Switching */
219 
220 static WRITE_HANDLER( bssoccer_pcm_1_bankswitch_w )
221 {
222 	unsigned char *RAM = memory_region(REGION_CPU3);
223 	int bank = data & 7;
224 	if (bank & ~7)	log_cb(RETRO_LOG_DEBUG, LOGPRE "CPU#2 PC %06X - ROM bank unknown bits: %02X\n", activecpu_get_pc(), data);
225 	cpu_setbank(1, &RAM[bank * 0x10000 + 0x1000]);
226 }
227 
WRITE_HANDLER(bssoccer_pcm_2_bankswitch_w)228 static WRITE_HANDLER( bssoccer_pcm_2_bankswitch_w )
229 {
230 	unsigned char *RAM = memory_region(REGION_CPU4);
231 	int bank = data & 7;
232 	if (bank & ~7)	log_cb(RETRO_LOG_DEBUG, LOGPRE "CPU#3 PC %06X - ROM bank unknown bits: %02X\n", activecpu_get_pc(), data);
233 	cpu_setbank(2, &RAM[bank * 0x10000 + 0x1000]);
234 }
235 
236 
237 
238 /* Memory maps: Yes, *no* RAM */
239 
MEMORY_READ_START(bssoccer_pcm_1_readmem)240 static MEMORY_READ_START( bssoccer_pcm_1_readmem )
241 	{ 0x0000, 0x0fff, MRA_ROM			},	/* ROM*/
242 	{ 0x1000, 0xffff, MRA_BANK1 		},	/* Banked ROM*/
243 MEMORY_END
244 static MEMORY_WRITE_START( bssoccer_pcm_1_writemem )
245 	{ 0x0000, 0xffff, MWA_ROM			},	/* ROM*/
246 MEMORY_END
247 
248 
249 static MEMORY_READ_START( bssoccer_pcm_2_readmem )
250 	{ 0x0000, 0x0fff, MRA_ROM			},	/* ROM*/
251 	{ 0x1000, 0xffff, MRA_BANK2 		},	/* Banked ROM*/
252 MEMORY_END
253 static MEMORY_WRITE_START( bssoccer_pcm_2_writemem )
254 	{ 0x0000, 0xffff, MWA_ROM			},	/* ROM*/
255 MEMORY_END
256 
257 
258 
259 /* 2 DACs per CPU - 4 bits per sample */
260 
261 static WRITE_HANDLER( bssoccer_DAC_1_w )
262 {
263 	DAC_data_w( 0 + (offset & 1), (data & 0xf) * 0x11 );
264 }
265 
WRITE_HANDLER(bssoccer_DAC_2_w)266 static WRITE_HANDLER( bssoccer_DAC_2_w )
267 {
268 	DAC_data_w( 2 + (offset & 1), (data & 0xf) * 0x11 );
269 }
270 
271 
272 
PORT_READ_START(bssoccer_pcm_1_readport)273 static PORT_READ_START( bssoccer_pcm_1_readport )
274 	{ 0x00, 0x00, soundlatch2_r 				},	/* From The Sound Z80*/
275 PORT_END
276 static PORT_WRITE_START( bssoccer_pcm_1_writeport )
277 	{ 0x00, 0x01, bssoccer_DAC_1_w				},	/* 2 x DAC*/
278 	{ 0x03, 0x03, bssoccer_pcm_1_bankswitch_w	},	/* Rom Bank*/
279 PORT_END
280 
281 static PORT_READ_START( bssoccer_pcm_2_readport )
282 	{ 0x00, 0x00, soundlatch3_r 				},	/* From The Sound Z80*/
283 PORT_END
284 static PORT_WRITE_START( bssoccer_pcm_2_writeport )
285 	{ 0x00, 0x01, bssoccer_DAC_2_w				},	/* 2 x DAC*/
286 	{ 0x03, 0x03, bssoccer_pcm_2_bankswitch_w	},	/* Rom Bank*/
287 PORT_END
288 
289 
290 
291 /***************************************************************************
292 								Ultra Balloon
293 ***************************************************************************/
294 
295 /* Bank Switching */
296 
297 static WRITE_HANDLER( uballoon_pcm_1_bankswitch_w )
298 {
299 	unsigned char *RAM = memory_region(REGION_CPU3);
300 	int bank = data & 1;
301 	if (bank & ~1)	log_cb(RETRO_LOG_DEBUG, LOGPRE "CPU#2 PC %06X - ROM bank unknown bits: %02X\n", activecpu_get_pc(), data);
302 	cpu_setbank(1, &RAM[bank * 0x10000 + 0x400]);
303 }
304 
305 /* Memory maps: Yes, *no* RAM */
306 
MEMORY_READ_START(uballoon_pcm_1_readmem)307 static MEMORY_READ_START( uballoon_pcm_1_readmem )
308 	{ 0x0000, 0x03ff, MRA_ROM			},	/* ROM*/
309 	{ 0x0400, 0xffff, MRA_BANK1 		},	/* Banked ROM*/
310 MEMORY_END
311 static MEMORY_WRITE_START( uballoon_pcm_1_writemem )
312 	{ 0x0000, 0xffff, MWA_ROM			},	/* ROM*/
313 MEMORY_END
314 
315 
316 static PORT_READ_START( uballoon_pcm_1_readport )
317 	{ 0x00, 0x00, soundlatch2_r 				},	/* From The Sound Z80*/
318 PORT_END
319 static PORT_WRITE_START( uballoon_pcm_1_writeport )
320 	{ 0x00, 0x01, bssoccer_DAC_1_w				},	/* 2 x DAC*/
321 	{ 0x03, 0x03, uballoon_pcm_1_bankswitch_w	},	/* Rom Bank*/
322 PORT_END
323 
324 /***************************************************************************
325 
326 
327 								Input Ports
328 
329 
330 ***************************************************************************/
331 
332 #define JOY(_n_) \
333 	PORT_BIT(  0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP	  |  IPF_PLAYER##_n_ ) \
334 	PORT_BIT(  0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN   |  IPF_PLAYER##_n_ ) \
335 	PORT_BIT(  0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT   |  IPF_PLAYER##_n_ ) \
336 	PORT_BIT(  0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT  |  IPF_PLAYER##_n_ ) \
337 	PORT_BIT(  0x0010, IP_ACTIVE_LOW, IPT_BUTTON1		  |  IPF_PLAYER##_n_ ) \
338 	PORT_BIT(  0x0020, IP_ACTIVE_LOW, IPT_BUTTON2		  |  IPF_PLAYER##_n_ ) \
339 	PORT_BIT(  0x0040, IP_ACTIVE_LOW, IPT_BUTTON3		  |  IPF_PLAYER##_n_ ) \
340 	PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_START##_n_						 )
341 
342 
343 /***************************************************************************
344 							Back Street Soccer
345 ***************************************************************************/
346 
347 INPUT_PORTS_START( bssoccer )
348 
349 	PORT_START	/* IN0 - $a00001.b - Player 1*/
350 	JOY(1)
351 
352 	PORT_START	/* IN1 - $a00003.b - Player 2*/
353 	JOY(2)
354 
355 	PORT_START	/* IN2 - $a00005.b - Player 3*/
356 	JOY(3)
357 
358 	PORT_START	/* IN3 - $a00007.b - Player 4*/
359 	JOY(4)
360 
361 	PORT_START	/* IN4 - $a00008.w - DSW x 2*/
362 	PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coinage ) )
363 	PORT_DIPSETTING(	  0x0000, DEF_STR( 4C_1C ) )
364 	PORT_DIPSETTING(	  0x0001, DEF_STR( 3C_1C ) )
365 	PORT_DIPSETTING(	  0x0002, DEF_STR( 2C_1C ) )
366 	PORT_DIPSETTING(	  0x0007, DEF_STR( 1C_1C ) )
367 	PORT_DIPSETTING(	  0x0006, DEF_STR( 1C_2C ) )
368 	PORT_DIPSETTING(	  0x0005, DEF_STR( 1C_3C ) )
369 	PORT_DIPSETTING(	  0x0004, DEF_STR( 1C_4C ) )
370 	PORT_DIPSETTING(	  0x0003, DEF_STR( 1C_5C ) )
371 	PORT_DIPNAME( 0x0018, 0x0018, DEF_STR( Difficulty ) )
372 	PORT_DIPSETTING(	  0x0010, "Easy"     )
373 	PORT_DIPSETTING(	  0x0018, "Normal"   )
374 	PORT_DIPSETTING(	  0x0008, "Hard"     )
375 	PORT_DIPSETTING(	  0x0000, "Hardest?" )
376 	PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Demo_Sounds ) )
377 	PORT_DIPSETTING(	  0x0000, DEF_STR( Off ) )
378 	PORT_DIPSETTING(	  0x0020, DEF_STR( On ) )
379 	PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) )
380 	PORT_DIPSETTING(	  0x0040, DEF_STR( Off ) )
381 	PORT_DIPSETTING(	  0x0000, DEF_STR( On ) )
382 	PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
383 
384 	PORT_DIPNAME( 0x0300, 0x0300, "Play Time P1" )
385 	PORT_DIPSETTING(	  0x0300, "1:30" )
386 	PORT_DIPSETTING(	  0x0200, "1:45" )
387 	PORT_DIPSETTING(	  0x0100, "2:00" )
388 	PORT_DIPSETTING(	  0x0000, "2:15" )
389 	PORT_DIPNAME( 0x0c00, 0x0c00, "Play Time P2" )
390 	PORT_DIPSETTING(	  0x0c00, "1:30" )
391 	PORT_DIPSETTING(	  0x0800, "1:45" )
392 	PORT_DIPSETTING(	  0x0400, "2:00" )
393 	PORT_DIPSETTING(	  0x0000, "2:15" )
394 	PORT_DIPNAME( 0x3000, 0x3000, "Play Time P3" )
395 	PORT_DIPSETTING(	  0x3000, "1:30" )
396 	PORT_DIPSETTING(	  0x2000, "1:45" )
397 	PORT_DIPSETTING(	  0x1000, "2:00" )
398 	PORT_DIPSETTING(	  0x0000, "2:15" )
399 	PORT_DIPNAME( 0xc000, 0xc000, "Play Time P4" )
400 	PORT_DIPSETTING(	  0xc000, "1:30" )
401 	PORT_DIPSETTING(	  0x8000, "1:45" )
402 	PORT_DIPSETTING(	  0x4000, "2:00" )
403 	PORT_DIPSETTING(	  0x0000, "2:15" )
404 
405 	PORT_START	/* IN5 - $a0000b.b - Coins*/
406 	PORT_DIPNAME( 0x0001, 0x0001, "Copyright" )         /* these 4 are shown in test mode*/
407 	PORT_DIPSETTING(	  0x0001, "Distributer Unico" )
408 	PORT_DIPSETTING(	  0x0000, "All Rights Reserved" )
409 	PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) )	/* used!*/
410 	PORT_DIPSETTING(	  0x0002, DEF_STR( Off ) )
411 	PORT_DIPSETTING(	  0x0000, DEF_STR( On ) )
412 	PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) )
413 	PORT_DIPSETTING(	  0x0004, DEF_STR( Off ) )
414 	PORT_DIPSETTING(	  0x0000, DEF_STR( On ) )
415 	PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) )
416 	PORT_DIPSETTING(	  0x0008, DEF_STR( Off ) )
417 	PORT_DIPSETTING(	  0x0000, DEF_STR( On ) )
418 	PORT_BIT(  0x0010, IP_ACTIVE_LOW,  IPT_COIN1   )
419 	PORT_BIT(  0x0020, IP_ACTIVE_LOW,  IPT_COIN2   )
420 	PORT_BIT(  0x0040, IP_ACTIVE_LOW,  IPT_COIN3   )
421 	PORT_BIT(  0x0080, IP_ACTIVE_LOW,  IPT_COIN4   )
422 
423 INPUT_PORTS_END
424 
425 
426 /***************************************************************************
427 								Ultra Balloon
428 ***************************************************************************/
429 
430 INPUT_PORTS_START( uballoon )
431 
432 	PORT_START	/* IN0 - $600000.w - Player 1*/
433 	PORT_BIT(  0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP     | IPF_PLAYER1 )
434 	PORT_BIT(  0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN   | IPF_PLAYER1 )
435 	PORT_BIT(  0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT   | IPF_PLAYER1 )
436 	PORT_BIT(  0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT  | IPF_PLAYER1 )
437 	PORT_BIT(  0x0010, IP_ACTIVE_LOW, IPT_BUTTON1         | IPF_PLAYER1 )
438 	PORT_BIT(  0x0020, IP_ACTIVE_LOW, IPT_BUTTON2         | IPF_PLAYER1 )
439 	PORT_BIT(  0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN  )
440 	PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN  )
441 	PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN  )
442 	PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN  )
443 	PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN  )
444 	PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN  )
445 	PORT_BIT(  0x1000, IP_ACTIVE_LOW, IPT_SERVICE1 )
446 	PORT_BIT(  0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN  )
447 	PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_START1   )
448 	PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_COIN1    )
449 
450 	PORT_START	/* IN1 - $600002.w - Player 2*/
451 	PORT_BIT(  0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP     | IPF_PLAYER2 )
452 	PORT_BIT(  0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN   | IPF_PLAYER2 )
453 	PORT_BIT(  0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT   | IPF_PLAYER2 )
454 	PORT_BIT(  0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT  | IPF_PLAYER2 )
455 	PORT_BIT(  0x0010, IP_ACTIVE_LOW, IPT_BUTTON1         | IPF_PLAYER2 )
456 	PORT_BIT(  0x0020, IP_ACTIVE_LOW, IPT_BUTTON2         | IPF_PLAYER2 )
457 	PORT_BIT(  0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN  )
458 	PORT_BIT(  0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN  )
459 	PORT_BIT(  0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN  )
460 	PORT_BIT(  0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN  )
461 	PORT_BIT(  0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN  )
462 	PORT_BIT(  0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN  )
463 	PORT_DIPNAME( 0x3000, 0x3000, "Copyright" )	/* Jumpers*/
464 	PORT_DIPSETTING(	  0x3000, "Distributer Unico" )
465 	PORT_DIPSETTING(	  0x2000, "All Rights Reserved" )
466 /*	PORT_DIPSETTING(	  0x1000, "Distributer Unico" )*/
467 /*	PORT_DIPSETTING(	  0x0000, "All Rights Reserved" )*/
468 	PORT_BIT(  0x4000, IP_ACTIVE_LOW, IPT_START2   )
469 	PORT_BIT(  0x8000, IP_ACTIVE_LOW, IPT_COIN2    )
470 
471 	PORT_START	/* IN2 - $600005.b - DSW 1*/
472 	PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coinage ) )
473 	PORT_DIPSETTING(	  0x0000, DEF_STR( 5C_1C ) )
474 	PORT_DIPSETTING(	  0x0001, DEF_STR( 4C_1C ) )
475 	PORT_DIPSETTING(	  0x0002, DEF_STR( 3C_1C ) )
476 	PORT_DIPSETTING(	  0x0003, DEF_STR( 2C_1C ) )
477 	PORT_DIPSETTING(	  0x0007, DEF_STR( 1C_1C ) )
478 	PORT_DIPSETTING(	  0x0006, DEF_STR( 1C_2C ) )
479 	PORT_DIPSETTING(	  0x0005, DEF_STR( 1C_3C ) )
480 	PORT_DIPSETTING(	  0x0004, DEF_STR( 1C_4C ) )
481 	PORT_DIPNAME( 0x0018, 0x0018, DEF_STR( Lives ) )
482 	PORT_DIPSETTING(	  0x0010, "2" )
483 	PORT_DIPSETTING(	  0x0018, "3" )
484 	PORT_DIPSETTING(	  0x0008, "4" )
485 	PORT_DIPSETTING(	  0x0000, "5" )
486 	PORT_DIPNAME( 0x0060, 0x0060, DEF_STR( Difficulty ) )
487 	PORT_DIPSETTING(	  0x0040, "Easy"    )
488 	PORT_DIPSETTING(	  0x0060, "Normal"  )
489 	PORT_DIPSETTING(	  0x0020, "Hard"    )
490 	PORT_DIPSETTING(	  0x0000, "Hardest" )
491 	PORT_SERVICE( 0x0080, IP_ACTIVE_LOW )
492 
493 	PORT_START	/* IN3 - $600007.b - DSW 2*/
494 	PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) )
495 	PORT_DIPSETTING(	  0x0001, DEF_STR( Off ) )
496 	PORT_DIPSETTING(	  0x0000, DEF_STR( On ) )
497 	PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Cabinet ) )
498 	PORT_DIPSETTING(	  0x0002, DEF_STR( Upright ) )
499 	PORT_DIPSETTING(	  0x0000, DEF_STR( Cocktail ) )
500 	PORT_DIPNAME( 0x001c, 0x001c, DEF_STR( Bonus_Life ) )
501 	PORT_DIPSETTING(	  0x001c, "200K" )
502 	PORT_DIPSETTING(	  0x0010, "300K, 1000K" )
503 	PORT_DIPSETTING(	  0x0018, "400K" )
504 	PORT_DIPSETTING(	  0x000c, "500K, 1500K" )
505 	PORT_DIPSETTING(	  0x0008, "500K, 2000K" )
506 	PORT_DIPSETTING(	  0x0004, "500K, 3000K" )
507 	PORT_DIPSETTING(	  0x0014, "600K" )
508 	PORT_DIPSETTING(	  0x0000, "None" )
509 	PORT_DIPNAME( 0x0020, 0x0020, "Unknown 1-5*" )
510 	PORT_DIPSETTING(	  0x0020, DEF_STR( Off ) )
511 	PORT_DIPSETTING(	  0x0000, DEF_STR( On ) )
512 	PORT_DIPNAME( 0x0040, 0x0040, "Unknown 1-6*" )
513 	PORT_DIPSETTING(	  0x0040, DEF_STR( Off ) )
514 	PORT_DIPSETTING(	  0x0000, DEF_STR( On ) )
515 	PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Demo_Sounds ) )
516 	PORT_DIPSETTING(	  0x0080, DEF_STR( Off ) )
517 	PORT_DIPSETTING(	  0x0000, DEF_STR( On ) )
518 
519 INPUT_PORTS_END
520 
521 
522 
523 /***************************************************************************
524 
525 
526 								Graphics Layouts
527 
528 
529 ***************************************************************************/
530 
531 /* Tiles are 8x8x4 but the minimum sprite size is 2x2 tiles */
532 
533 static struct GfxLayout layout_8x8x4 =
534 {
535 	8,8,
536 	RGN_FRAC(1,2),
537 	4,
538 	{ RGN_FRAC(1,2)+0,RGN_FRAC(1,2)+4,	0,4 },
539 	{ 3,2,1,0, 11,10,9,8 },
540 	{ STEP8(0,16) },
541 	8*8*4/2
542 };
543 
544 static struct GfxDecodeInfo suna16_gfxdecodeinfo[] =
545 {
546 	{ REGION_GFX1, 0, &layout_8x8x4, 0, 16*2 }, /* [0] Sprites*/
547 	{ -1 }
548 };
549 
550 
551 
552 
553 /***************************************************************************
554 
555 
556 								Machine drivers
557 
558 
559 ***************************************************************************/
560 
561 
562 /***************************************************************************
563 							Back Street Soccer
564 ***************************************************************************/
565 
566 static struct YM2151interface bssoccer_ym2151_interface =
567 {
568 	1,
569 	3579545,	/* ? */
570 	{ YM3012_VOL(20,MIXER_PAN_LEFT, 20,MIXER_PAN_RIGHT) },
571 	{ 0 },		/* irq handler */
572 	{ 0 }		/* port write handler */
573 };
574 
575 static struct DACinterface bssoccer_dac_interface =
576 {
577 	4,
578 	{	MIXER(40,MIXER_PAN_LEFT), MIXER(40,MIXER_PAN_RIGHT),
579 		MIXER(40,MIXER_PAN_LEFT), MIXER(40,MIXER_PAN_RIGHT)	}
580 };
581 
INTERRUPT_GEN(bssoccer_interrupt)582 INTERRUPT_GEN( bssoccer_interrupt )
583 {
584 	switch (cpu_getiloops())
585 	{
586 		case 0: 	cpu_set_irq_line(0, 1, HOLD_LINE);	break;
587 		case 1: 	cpu_set_irq_line(0, 2, HOLD_LINE);	break;
588 	}
589 }
590 
591 static MACHINE_DRIVER_START( bssoccer )
592 
593 	/* basic machine hardware */
594 	MDRV_CPU_ADD(M68000, 8000000)	/* ? */
595 	MDRV_CPU_MEMORY(bssoccer_readmem,bssoccer_writemem)
596 	MDRV_CPU_VBLANK_INT(bssoccer_interrupt,2)
597 
598 	MDRV_CPU_ADD(Z80, 3579545)		/* Z80B */
599 	MDRV_CPU_FLAGS(CPU_AUDIO_CPU)
600 	MDRV_CPU_MEMORY(bssoccer_sound_readmem,bssoccer_sound_writemem)
601 
602 	MDRV_CPU_ADD(Z80, 5000000)		/* Z80B */
603 	MDRV_CPU_FLAGS(CPU_AUDIO_CPU)
604 	MDRV_CPU_MEMORY(bssoccer_pcm_1_readmem,bssoccer_pcm_1_writemem)
605 	MDRV_CPU_PORTS(bssoccer_pcm_1_readport,bssoccer_pcm_1_writeport)
606 
607 	MDRV_CPU_ADD(Z80, 5000000)		/* Z80B */
608 	MDRV_CPU_FLAGS(CPU_AUDIO_CPU)
609 	MDRV_CPU_MEMORY(bssoccer_pcm_2_readmem,bssoccer_pcm_2_writemem)
610 	MDRV_CPU_PORTS(bssoccer_pcm_2_readport,bssoccer_pcm_2_writeport)
611 
612 	MDRV_FRAMES_PER_SECOND(60)
613 	MDRV_VBLANK_DURATION(DEFAULT_60HZ_VBLANK_DURATION)
614 	MDRV_INTERLEAVE(100)
615 
616 	/* video hardware */
617 	MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
618 	MDRV_SCREEN_SIZE(256, 256)
619 	MDRV_VISIBLE_AREA(0, 256-1, 0+16, 256-16-1)
620 	MDRV_GFXDECODE(suna16_gfxdecodeinfo)
621 	MDRV_PALETTE_LENGTH(512)
622 
623 	MDRV_VIDEO_START(suna16)
624 	MDRV_VIDEO_UPDATE(suna16)
625 
626 	/* sound hardware */
627 	MDRV_SOUND_ATTRIBUTES(SOUND_SUPPORTS_STEREO)
628 	MDRV_SOUND_ADD(YM2151, bssoccer_ym2151_interface)
629 	MDRV_SOUND_ADD(DAC, bssoccer_dac_interface)
630 MACHINE_DRIVER_END
631 
632 
633 
634 /***************************************************************************
635 								Ultra Balloon
636 ***************************************************************************/
637 
638 static struct YM2151interface uballoon_ym2151_interface =
639 {
640 	1,
641 	3579545,	/* ? */
642 	{ YM3012_VOL(50,MIXER_PAN_LEFT,50,MIXER_PAN_RIGHT) },
643 	{ 0 },		/* irq handler */
644 	{ 0 }		/* port write handler */
645 };
646 
647 static struct DACinterface uballoon_dac_interface =
648 {
649 	2,
650 	{ MIXER(50,MIXER_PAN_LEFT), MIXER(50,MIXER_PAN_RIGHT) }
651 };
652 
653 static MACHINE_DRIVER_START( uballoon )
654 
655 	/* basic machine hardware */
656 	MDRV_CPU_ADD(M68000, 8000000)
MDRV_CPU_MEMORY(uballoon_readmem,uballoon_writemem)657 	MDRV_CPU_MEMORY(uballoon_readmem,uballoon_writemem)
658 	MDRV_CPU_VBLANK_INT(irq1_line_hold,1)
659 
660 	MDRV_CPU_ADD(Z80, 3579545)
661 	MDRV_CPU_FLAGS(CPU_AUDIO_CPU)	/* ? */
662 	MDRV_CPU_MEMORY(uballoon_sound_readmem,uballoon_sound_writemem)
663 
664 	MDRV_CPU_ADD(Z80, 5000000)
665 	MDRV_CPU_FLAGS(CPU_AUDIO_CPU)	/* ? */
666 	MDRV_CPU_MEMORY(uballoon_pcm_1_readmem,uballoon_pcm_1_writemem)
667 	MDRV_CPU_PORTS(uballoon_pcm_1_readport,uballoon_pcm_1_writeport)
668 
669 	/* 2nd PCM Z80 missing */
670 
671 	MDRV_FRAMES_PER_SECOND(60)
672 	MDRV_VBLANK_DURATION(DEFAULT_60HZ_VBLANK_DURATION)
673 	MDRV_INTERLEAVE(100)
674 
675 	/* video hardware */
676 	MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
677 	MDRV_SCREEN_SIZE(256, 256)
678 	MDRV_VISIBLE_AREA(0, 256-1, 0+16, 256-16-1)
679 	MDRV_GFXDECODE(suna16_gfxdecodeinfo)
680 	MDRV_PALETTE_LENGTH(512)
681 
682 	MDRV_VIDEO_START(suna16)
683 	MDRV_VIDEO_UPDATE(suna16)
684 
685 	/* sound hardware */
686 	MDRV_SOUND_ATTRIBUTES(SOUND_SUPPORTS_STEREO)
687 	MDRV_SOUND_ADD(YM2151, uballoon_ym2151_interface)
688 	MDRV_SOUND_ADD(DAC, uballoon_dac_interface)
689 MACHINE_DRIVER_END
690 
691 /***************************************************************************
692 
693 
694 								ROMs Loading
695 
696 
697 ***************************************************************************/
698 
699 
700 /***************************************************************************
701 
702 							[ Back Street Soccer ]
703 
704   68000-10	32MHz
705 			14.318MHz
706   01   02					 12
707   03   04					Z80B
708   6264 6264 	  YM2151
709 				  6116
710 				   11	   13
711   62256 		  Z80B	  Z80B
712   62256
713   62256   05 06 				 SW2
714 		  07 08 				 SW1
715 		  09 10 		 6116-45
716 									 6116-45
717 						 6116-45	 6116-45
718 
719 ***************************************************************************/
720 
721 ROM_START( bssoccer )
722 
723 	ROM_REGION( 0x200000, REGION_CPU1, 0 ) 	/* 68000 Code */
724 	ROM_LOAD16_BYTE( "02", 0x000000, 0x080000, CRC(32871005) SHA1(b094ee3f4fc24c0521915d565f6e203d51e51f6d) )
725 	ROM_LOAD16_BYTE( "01", 0x000001, 0x080000, CRC(ace00db6) SHA1(6bd146f9b44c97be77578b4f0ffa28cbf66283c2) )
726 	ROM_LOAD16_BYTE( "04", 0x100000, 0x080000, CRC(25ee404d) SHA1(1ab7cb1b4836caa05be73ea441deed80f1e1ba81) )
727 	ROM_LOAD16_BYTE( "03", 0x100001, 0x080000, CRC(1a131014) SHA1(4d21264da3ee9b9912d1205999a555657ba33bd7) )
728 
729 	ROM_REGION( 0x010000, REGION_CPU2, 0 ) 	/* Z80 #1 - Music */
730 	ROM_LOAD( "11", 0x000000, 0x010000, CRC(df7ae9bc) SHA1(86660e723b0712c131dc57645b6a659d5100e962) ) /* 1xxxxxxxxxxxxxxx = 0xFF*/
731 
732 	ROM_REGION( 0x080000, REGION_CPU3, 0 ) 	/* Z80 #2 - PCM */
733 	ROM_LOAD( "13", 0x000000, 0x080000, CRC(2b273dca) SHA1(86e1bac9d1e39457c565390b9053986453db95ab) )
734 
735 	ROM_REGION( 0x080000, REGION_CPU4, 0 ) 	/* Z80 #3 - PCM */
736 	ROM_LOAD( "12", 0x000000, 0x080000, CRC(6b73b87b) SHA1(52c7dc7da6c21eb7e0dad13deadb1faa94a87bb3) )
737 
738 	ROM_REGION( 0x300000, REGION_GFX1, ROMREGION_DISPOSE | ROMREGION_INVERT )	/* Sprites */
739 	ROM_LOAD( "05", 0x000000, 0x080000, CRC(a5245bd4) SHA1(d46a8db437e49158c020661536eb0be8a6e2e8b0) )
740 	ROM_LOAD( "07", 0x080000, 0x080000, CRC(fdb765c2) SHA1(f9852fd3734d10e18c91cd572ca62e66d74ccb72) )
741 	ROM_LOAD( "09", 0x100000, 0x080000, CRC(0e82277f) SHA1(4bdfd0ff310bf8326806a83767a6c98905debbd0) )
742 	ROM_LOAD( "06", 0x180000, 0x080000, CRC(d42ce84b) SHA1(3a3d07d571793ecf4c936d3af244c63b9e4b4bb9) )
743 	ROM_LOAD( "08", 0x200000, 0x080000, CRC(96cd2136) SHA1(1241859d6c5e64de73898763f0358171ea4aeae3) )
744 	ROM_LOAD( "10", 0x280000, 0x080000, CRC(1ca94d21) SHA1(23d892b840e37064a175584f955f25f990d9179d) )
745 
746 ROM_END
747 
748 
749 
750 /***************************************************************************
751 
752 							[ Ultra Ballon ]
753 
754 the gameplay on this game a like bubble bobble in many ways,it uses a
755 68k@8MHz as the main cpu,2 z80's and a ym2151,the names of the rom files
756 are just my guess.
757 
758 prg1.rom      27c040
759 prg2.rom      27c040
760 gfx1.rom	  27c040
761 gfx2.rom	  27c040
762 gfx3.rom	  27c040
763 gfx4.rom	  27c040
764 audio1.rom	  27c512
765 audio2.rom	  27c010
766 
767 ***************************************************************************/
768 
769 ROM_START( uballoon )
770 
771 	ROM_REGION( 0x100000, REGION_CPU1, 0 ) 	/* 68000 Code */
772 	ROM_LOAD16_BYTE( "prg2.rom", 0x000000, 0x080000, CRC(72ab80ea) SHA1(b755940877cf286559208106dd5e6933aeb72242) )
773 	ROM_LOAD16_BYTE( "prg1.rom", 0x000001, 0x080000, CRC(27a04f55) SHA1(a530294b000654db8d84efe4835b72e0dca62819) )
774 
775 	ROM_REGION( 0x010000, REGION_CPU2, 0 ) 	/* Z80 #1 - Music */
776 	ROM_LOAD( "audio1.rom", 0x000000, 0x010000, CRC(c771f2b4) SHA1(6da4c526c0ea3be5d5bb055a31bf1171a6ddb51d) )
777 
778 	ROM_REGION( 0x020000, REGION_CPU3, 0 ) 	/* Z80 #2 - PCM */
779 	ROM_LOAD( "audio2.rom", 0x000000, 0x020000, CRC(c7f75347) SHA1(5bbbd39285c593441c6da6a12f3632d60b103216) )
780 
781 	/* There's no Z80 #3 - PCM */
782 
783 	ROM_REGION( 0x200000, REGION_GFX1, ROMREGION_DISPOSE | ROMREGION_INVERT )	/* Sprites */
784 	ROM_LOAD( "gfx1.rom", 0x000000, 0x080000, CRC(fd2ec297) SHA1(885834d9b58ccfd9a32ecaa51c45e70fbbe935db) )
785 	ROM_LOAD( "gfx2.rom", 0x080000, 0x080000, CRC(6307aa60) SHA1(00406eba98ec368e72ee53c08b9111dec4f2552f) )
786 	ROM_LOAD( "gfx3.rom", 0x100000, 0x080000, CRC(718f3150) SHA1(5971f006203f86743ebc825e4ab1ed1f811e3165) )
787 	ROM_LOAD( "gfx4.rom", 0x180000, 0x080000, CRC(af7e057e) SHA1(67a03b54ffa1483c8ed044f27287b7f3f1150455) )
788 
789 ROM_END
790 
791 
792 DRIVER_INIT( uballoon )
793 {
794 	data16_t *RAM = (data16_t *) memory_region(REGION_CPU1);
795 
796 	/* Patch out the protection checks */
797 	RAM[0x0113c/2] = 0x4e71;	/* bne $646*/
798 	RAM[0x0113e/2] = 0x4e71;	/* ""*/
799 	RAM[0x01784/2] = 0x600c;	/* beq $1792*/
800 	RAM[0x018e2/2] = 0x600c;	/* beq $18f0*/
801 	RAM[0x03c54/2] = 0x600C;	/* beq $3c62*/
802 	RAM[0x126a0/2] = 0x4e71;	/* bne $1267a (ROM test)*/
803 }
804 
805 
806 
807 /***************************************************************************
808 
809 
810 								Games Drivers
811 
812 
813 ***************************************************************************/
814 
815 GAME( 1996, bssoccer, 0, bssoccer, bssoccer, 0,        ROT0, "SunA", "Back Street Soccer" )
816 GAME( 1996, uballoon, 0, uballoon, uballoon, uballoon, ROT0, "SunA", "Ultra Balloon" )
817