1 /* Miss Bubble 2
2 
3 A rather odd bootleg of Bubble Bobble with level select, redesigned levels,
4 redesigned (8bpp!) graphics and different sound hardware... Crazy
5 
6 -- where is oki?
7 
8 */
9 
10 #include "driver.h"
11 #include "vidhrdw/generic.h"
12 
13 static data8_t *bg_paletteram,*bg_vram;
14 
15 /* vidhrdw/bublbobl.c */
16 extern unsigned char *bublbobl_objectram;
17 extern size_t bublbobl_objectram_size;
18 VIDEO_UPDATE( bublbobl );
19 
20 /* machine/bublbobl.c */
21 extern unsigned char *bublbobl_sharedram1,*bublbobl_sharedram2;
22 READ_HANDLER( bublbobl_sharedram1_r );
23 READ_HANDLER( bublbobl_sharedram2_r );
24 WRITE_HANDLER( bublbobl_sharedram1_w );
25 WRITE_HANDLER( bublbobl_sharedram2_w );
26 INTERRUPT_GEN( bublbobl_m68705_interrupt );
27 READ_HANDLER( bublbobl_68705_portA_r );
28 WRITE_HANDLER( bublbobl_68705_portA_w );
29 WRITE_HANDLER( bublbobl_68705_ddrA_w );
30 READ_HANDLER( bublbobl_68705_portB_r );
31 WRITE_HANDLER( bublbobl_68705_portB_w );
32 WRITE_HANDLER( bublbobl_68705_ddrB_w );
33 WRITE_HANDLER( bublbobl_bankswitch_w );
34 WRITE_HANDLER( tokio_bankswitch_w );
35 WRITE_HANDLER( tokio_videoctrl_w );
36 WRITE_HANDLER( bublbobl_nmitrigger_w );
37 READ_HANDLER( tokio_fake_r );
38 WRITE_HANDLER( bublbobl_sound_command_w );
39 WRITE_HANDLER( bublbobl_sh_nmi_disable_w );
40 WRITE_HANDLER( bublbobl_sh_nmi_enable_w );
41 extern int bublbobl_video_enable;
42 
43 
VIDEO_UPDATE(missb2)44 VIDEO_UPDATE( missb2 )
45 {
46 	int offs;
47 	int sx,sy,xc,yc;
48 	int gfx_num,gfx_attr,gfx_offs;
49 	const UINT8 *prom_line;
50 	UINT16 bg_offs;
51 
52 	/* Bubble Bobble doesn't have a real video RAM. All graphics (characters */
53 	/* and sprites) are stored in the same memory region, and information on */
54 	/* the background character columns is stored in the area dd00-dd3f */
55 
56 	/* This clears & redraws the entire screen each pass */
57 	fillbitmap(bitmap,Machine->pens[255],&Machine->visible_area);
58 
59 	if (!bublbobl_video_enable) return;
60 
61 	/* background map register */
62 	/*usrintf_showmessage("%02x",(*bg_vram) & 0x1f);*/
63 	for(bg_offs = ((*bg_vram) << 4);bg_offs<(((*bg_vram)<< 4)|0xf);bg_offs++)
64 	{
65 		drawgfx(bitmap,Machine->gfx[1],
66 				bg_offs,
67 				1,
68 				0,0,
69 				0,(bg_offs & 0xf) * 0x10,
70 				&Machine->visible_area,TRANSPARENCY_NONE,0xff);
71 	}
72 
73 
74 	sx = 0;
75 
76 	for (offs = 0;offs < bublbobl_objectram_size;offs += 4)
77     {
78 		/* skip empty sprites */
79 		/* this is dword aligned so the UINT32 * cast shouldn't give problems */
80 		/* on any architecture */
81 		if (*(UINT32 *)(&bublbobl_objectram[offs]) == 0)
82 			continue;
83 
84 		gfx_num = bublbobl_objectram[offs + 1];
85 		gfx_attr = bublbobl_objectram[offs + 3];
86 		prom_line = memory_region(REGION_PROMS) + 0x80 + ((gfx_num & 0xe0) >> 1);
87 
88 		gfx_offs = ((gfx_num & 0x1f) * 0x80);
89 		if ((gfx_num & 0xa0) == 0xa0)
90 			gfx_offs |= 0x1000;
91 
92 		sy = -bublbobl_objectram[offs + 0];
93 
94 		for (yc = 0;yc < 32;yc++)
95 		{
96 			if (prom_line[yc/2] & 0x08)	continue;	/* NEXT */
97 
98 			if (!(prom_line[yc/2] & 0x04))	/* next column */
99 			{
100 				sx = bublbobl_objectram[offs + 2];
101 				if (gfx_attr & 0x40) sx -= 256;
102 			}
103 
104 			for (xc = 0;xc < 2;xc++)
105 			{
106 				int goffs,code,color,flipx,flipy,x,y;
107 
108 				goffs = gfx_offs + xc * 0x40 + (yc & 7) * 0x02 +
109 						(prom_line[yc/2] & 0x03) * 0x10;
110 				code = videoram[goffs] + 256 * (videoram[goffs + 1] & 0x03) + 1024 * (gfx_attr & 0x0f);
111 				color = (videoram[goffs + 1] & 0x3c) >> 2;
112 				flipx = videoram[goffs + 1] & 0x40;
113 				flipy = videoram[goffs + 1] & 0x80;
114 				x = sx + xc * 8;
115 				y = (sy + yc * 8) & 0xff;
116 
117 				if (flip_screen)
118 				{
119 					x = 248 - x;
120 					y = 248 - y;
121 					flipx = !flipx;
122 					flipy = !flipy;
123 				}
124 
125 				drawgfx(bitmap,Machine->gfx[0],
126 						code,
127 						0,
128 						flipx,flipy,
129 						x,y,
130 						&Machine->visible_area,TRANSPARENCY_PEN,0xff);
131 			}
132 		}
133 
134 		sx += 16;
135 	}
136 }
137 
bg_changecolor_RRRRGGGGBBBBxxxx(pen_t color,int data)138 static INLINE void bg_changecolor_RRRRGGGGBBBBxxxx(pen_t color,int data)
139 {
140 	int r,g,b;
141 
142 
143 	r = (data >> 12) & 0x0f;
144 	g = (data >>  8) & 0x0f;
145 	b = (data >>  4) & 0x0f;
146 
147 	r = (r << 4) | r;
148 	g = (g << 4) | g;
149 	b = (b << 4) | b;
150 
151 	palette_set_color(color+256,r,g,b);
152 }
153 
WRITE_HANDLER(bg_paletteram_RRRRGGGGBBBBxxxx_swap_w)154 WRITE_HANDLER( bg_paletteram_RRRRGGGGBBBBxxxx_swap_w )
155 {
156 	bg_paletteram[offset] = data;
157 	bg_changecolor_RRRRGGGGBBBBxxxx(offset / 2,bg_paletteram[offset | 1] | (bg_paletteram[offset & ~1] << 8));
158 }
159 
WRITE_HANDLER(bg_bank_w)160 WRITE_HANDLER( bg_bank_w )
161 {
162 	int bankaddress;
163 	unsigned char *RAM = memory_region(REGION_CPU2);
164 
165 	/*I don't know how this is really connected,bit 1 is always high afaik...*/
166 	bankaddress = ((data & 2) ? 0x1000 : 0x0000) | ((data & 1) ? 0x4000 : 0x0000) | (0x8000);
167 	cpu_setbank(2,&RAM[bankaddress]);
168 }
169 
170 
171 
MEMORY_READ_START(missb2_readmem)172 static MEMORY_READ_START( missb2_readmem )
173 	{ 0x0000, 0x7fff, MRA_ROM },
174 	{ 0x8000, 0xbfff, MRA_BANK1 },
175 	{ 0xc000, 0xdfff, MRA_RAM },
176 	{ 0xe000, 0xf7ff, bublbobl_sharedram1_r },
177 	{ 0xf800, 0xf9ff, MRA_RAM },
178 	{ 0xfc00, 0xfcff, bublbobl_sharedram2_r },
179 
180 	{ 0xfe00, 0xfe03, MRA_RAM }, /* ?*/
181 	{ 0xfe80, 0xfe83, MRA_RAM }, /* ?*/
182 
183 	{ 0xff00, 0xff00, input_port_0_r },
184 	{ 0xff01, 0xff01, input_port_1_r },
185 	{ 0xff02, 0xff02, input_port_2_r },
186 	{ 0xff03, 0xff03, input_port_3_r },
187 	{ 0xfd00, 0xfdff, MRA_RAM }, /* ? */
188 MEMORY_END
189 
190 static MEMORY_WRITE_START( missb2_writemem )
191 	{ 0x0000, 0xbfff, MWA_ROM },
192 	{ 0xc000, 0xdcff, MWA_RAM, &videoram, &videoram_size },
193 	{ 0xdd00, 0xdfff, MWA_RAM, &bublbobl_objectram, &bublbobl_objectram_size },
194 	{ 0xe000, 0xf7ff, bublbobl_sharedram1_w, &bublbobl_sharedram1 },
195 	{ 0xf800, 0xf9ff, paletteram_RRRRGGGGBBBBxxxx_swap_w, &paletteram  },
196 	{ 0xfa00, 0xfa00, bublbobl_sound_command_w },
197 	{ 0xfa80, 0xfa80, MWA_NOP },
198 	{ 0xfb00, 0xfb00, bublbobl_nmitrigger_w },	/* not used by Bubble Bobble, only by Tokio */
199 	{ 0xfb40, 0xfb40, bublbobl_bankswitch_w },
200 	{ 0xfc00, 0xfcff, bublbobl_sharedram2_w, &bublbobl_sharedram2 },
201 	{ 0xfd00, 0xfdff, MWA_RAM }, /* ? */
202 
203 	{ 0xfe00, 0xfe03, MWA_RAM }, /* ?*/
204 	{ 0xfe80, 0xfe83, MWA_RAM }, /* ?*/
205 
206 	{ 0xff94, 0xff94, MWA_NOP }, /* ?*/
207 MEMORY_END
208 
209 /*READ_HANDLER ( missb_random )*/
210 /*{*/
211 /*	return rand();*/
212 /*}*/
213 
214 static MEMORY_READ_START( missb2_readmem2 )
215 	{ 0x0000, 0x7fff, MRA_ROM },
216 
217 	{ 0x9000, 0xafff, MRA_BANK2 }, /* ROM data for the background palette ram*/
218 	{ 0xb000, 0xb1ff, MRA_ROM }, /* ? banked ?*/
219 
220 	{ 0xc800, 0xcfff, MRA_RAM }, /* main? */
221 	{ 0xe000, 0xf7ff, bublbobl_sharedram1_r },
222 MEMORY_END
223 
224 static MEMORY_WRITE_START( missb2_writemem2 )
225 	{ 0x0000, 0x7fff, MWA_ROM },
226 	{ 0xc000, 0xc1ff, bg_paletteram_RRRRGGGGBBBBxxxx_swap_w,&bg_paletteram  },
227 	{ 0xc800, 0xcfff, MWA_RAM }, /* main? */
228 
229 	{ 0xd000, 0xd000, bg_bank_w },
230 	{ 0xd002, 0xd002, MWA_NOP },
231 	{ 0xd003, 0xd003, MWA_RAM,&bg_vram },
232 	{ 0xe000, 0xf7ff, bublbobl_sharedram1_w },
233 MEMORY_END
234 
235 /* does it actually use the original sound hw or is it just leftover code .. */
236 
237 static MEMORY_READ_START( sound_readmem )
238 	{ 0x0000, 0x7fff, MRA_ROM },
239 	{ 0x8000, 0x8fff, MRA_RAM },
240 	{ 0x9000, 0x9000, YM2203_status_port_0_r },
241 	{ 0x9001, 0x9001, YM2203_read_port_0_r },
242 	{ 0xa000, 0xa000, YM3526_status_port_0_r },
243 	{ 0xb000, 0xb000, soundlatch_r },
244 	{ 0xb001, 0xb001, MRA_NOP },	/* bit 0: message pending for main cpu */
245 									/* bit 1: message pending for sound cpu */
246 	{ 0xe000, 0xefff, MRA_ROM },	/* space for diagnostic ROM? */
247 MEMORY_END
248 
249 static MEMORY_WRITE_START( sound_writemem )
250 	{ 0x0000, 0x7fff, MWA_ROM },
251 	{ 0x8000, 0x8fff, MWA_RAM },
252 	{ 0x9000, 0x9000, YM2203_control_port_0_w },
253 	{ 0x9001, 0x9001, YM2203_write_port_0_w },
254 	{ 0xa000, 0xa000, YM3526_control_port_0_w },
255 	{ 0xa001, 0xa001, YM3526_write_port_0_w },
256 	{ 0xb000, 0xb000, MWA_NOP },	/* message for main cpu */
257 	{ 0xb001, 0xb001, bublbobl_sh_nmi_enable_w },
258 	{ 0xb002, 0xb002, bublbobl_sh_nmi_disable_w },
259 	{ 0xe000, 0xefff, MWA_ROM },	/* space for diagnostic ROM? */
260 MEMORY_END
261 
262 
263 
264 INPUT_PORTS_START( missb2 )
265 	PORT_START      /* DSW0 */
266 	PORT_DIPNAME( 0x01, 0x00, "Language" )
267 	PORT_DIPSETTING(    0x00, "English" )
268 	PORT_DIPSETTING(    0x01, "Japanese" )
269 	PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) )
270 	PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
271 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
272 	PORT_SERVICE( 0x04, IP_ACTIVE_LOW )
273 	PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) )
274 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
275 	PORT_DIPSETTING(    0x08, DEF_STR( On ) )
276 	PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) )
277 	PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
278 	PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )
279 	PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) )
280 	PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) )
281 	PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) )
282 	PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
283 	PORT_DIPSETTING(    0xc0, DEF_STR( 1C_1C ) )
284 	PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) )
285 	PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )
286 
287 	PORT_START      /* DSW1 */
288 	PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
289 	PORT_DIPSETTING(    0x02, "Easy" )
290 	PORT_DIPSETTING(    0x03, "Medium" )
291 	PORT_DIPSETTING(    0x01, "Hard" )
292 	PORT_DIPSETTING(    0x00, "Hardest" )
293 	PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) )
294 	PORT_DIPSETTING(    0x08, "20000 80000" )
295 	PORT_DIPSETTING(    0x0c, "30000 100000" )
296 	PORT_DIPSETTING(    0x04, "40000 200000" )
297 	PORT_DIPSETTING(    0x00, "50000 250000" )
298 	PORT_DIPNAME( 0x30, 0x30, DEF_STR( Lives ) )
299 	PORT_DIPSETTING(    0x10, "1" )
300 	PORT_DIPSETTING(    0x00, "2" )
301 	PORT_DIPSETTING(    0x30, "3" )
302 	PORT_DIPSETTING(    0x20, "5" )
303 	PORT_DIPNAME( 0xc0, 0x00, "Monster Speed" )
304 	PORT_DIPSETTING(    0x00, "Normal" )
305 	PORT_DIPSETTING(    0x40, "Medium" )
306 	PORT_DIPSETTING(    0x80, "High" )
307 	PORT_DIPSETTING(    0xc0, "Very High" )
308 
309 	PORT_START      /* IN0 */
310 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_2WAY )
311 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_2WAY )
312 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
313 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
314 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 )
315 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
316 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
317 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
318 
319 	PORT_START      /* IN1 */
320 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_2WAY | IPF_PLAYER2 )
321 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_2WAY | IPF_PLAYER2 )
322 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) /* ?????*/
323 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 )
324 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
325 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
326 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
327 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
328 INPUT_PORTS_END
329 
330 
331 
332 static struct GfxLayout charlayout =
333 {
334 	8,8,
335 	RGN_FRAC(1,4),
336 	8,
337 	{ RGN_FRAC(0,4)+0, RGN_FRAC(0,4)+4, RGN_FRAC(1,4)+0, RGN_FRAC(1,4)+4, RGN_FRAC(2,4)+0, RGN_FRAC(2,4)+4, RGN_FRAC(3,4)+0, RGN_FRAC(3,4)+4 },
338 	{ 3, 2, 1, 0, 8+3, 8+2, 8+1, 8+0 },
339 	{ 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 },
340 	16*8
341 };
342 
343 
344 
345 
346 
347 static struct GfxLayout bglayout =
348 {
349 	256,16,
350 	RGN_FRAC(1,1),
351 	8,
352 	{ 0,1,2,3,4,5,6,7 },
353 	{
354 		0*8,      1*8, 2048*8, 2049*8,    8*8,    9*8, 2056*8, 2057*8,
355 		4*8,      5*8, 2052*8, 2053*8,   12*8,   13*8, 2060*8, 2061*8,
356 		256*8 , 257*8, 2304*8, 2305*8,  264*8,  265*8, 2312*8, 2313*8,
357 		260*8 , 261*8, 2308*8, 2309*8,  268*8,  269*8, 2316*8, 2317*8,
358        1024*8, 1025*8, 3072*8, 3073*8, 1032*8, 1033*8, 3080*8, 3081*8,
359 	   1028*8, 1029*8, 3076*8, 3077*8, 1036*8, 1037*8, 3084*8, 3085*8,
360 	   1280*8, 1281*8, 3328*8, 3329*8, 1288*8, 1289*8, 3336*8, 3337*8,
361        1284*8, 1285*8, 3332*8, 3333*8, 1292*8, 1293*8, 3340*8, 3341*8,
362 		512*8,  513*8, 2560*8, 2561*8,  520*8,  521*8, 2568*8, 2569*8,
363 		516*8,  517*8, 2564*8, 2565*8,	524*8,  525*8, 2572*8, 2573*8,
364         768*8,  769*8, 2816*8, 2817*8,  776*8,  777*8, 2824*8, 2825*8,
365         772*8,  773*8, 2820*8, 2821*8,  780*8,  781*8, 2828*8, 2829*8,
366 	   1536*8, 1537*8, 3584*8, 3585*8, 1544*8, 1545*8, 3592*8, 3593*8,
367        1540*8, 1541*8, 3588*8, 3589*8, 1548*8, 1549*8, 3596*8, 3597*8,
368 	   1792*8, 1793*8, 3840*8, 3841*8, 1800*8, 1801*8, 3848*8, 3849*8,
369 	   1796*8, 1797*8, 3844*8, 3845*8, 1804*8, 1805*8, 3852*8, 3853*8,
370           2*8,    3*8, 2050*8, 2051*8,   10*8,   11*8, 2058*8, 2059*8,
371 		  6*8,    7*8, 2054*8, 2055*8,	 14*8,   15*8, 2062*8, 2063*8,
372 	    258*8,  259*8, 2306*8, 2307*8,  266*8,  267*8, 2314*8, 2315*8,
373 		262*8,  263*8, 2310*8, 2311*8,	270*8,  271*8, 2318*8, 2319*8,
374        1026*8, 1027*8, 3074*8, 3075*8, 1034*8, 1035*8, 3082*8, 3083*8,
375        1030*8, 1031*8, 3078*8, 3079*8, 1038*8, 1039*8, 3086*8, 3087*8,
376        1282*8, 1283*8, 3330*8, 3331*8, 1290*8, 1291*8, 3338*8, 3339*8,
377        1286*8, 1287*8, 3334*8, 3335*8, 1294*8, 1295*8, 3342*8, 3343*8,
378         514*8,  515*8, 2562*8, 2563*8, 	522*8,  523*8, 2570*8, 2571*8,
379 		518*8,  519*8, 2566*8, 2567*8,  526*8,  527*8, 2574*8, 2575*8,
380 		770*8,  771*8, 2818*8, 2819*8,  778*8,  779*8, 2826*8, 2827*8,
381         774*8,  775*8, 2822*8, 2823*8,  782*8,  783*8, 2830*8, 2831*8,
382 	   1538*8, 1539*8, 3586*8, 3587*8, 1546*8, 1547*8, 3594*8, 3595*8,
383 	   1542*8, 1543*8, 3590*8, 3591*8, 1550*8, 1551*8, 3598*8, 3599*8,
384 	   1794*8, 1795*8, 3842*8, 3843*8, 1802*8, 1803*8, 3850*8, 3851*8,
385 	   1798*8, 1799*8, 3846*8, 3847*8, 1806*8, 1807*8, 3854*8, 3855*8
386 	  },
387 	{ 0*128, 1*128, 2*128, 3*128, 4*128, 5*128, 6*128, 7*128, 8*128, 9*128, 10*128, 11*128, 12*128, 13*128, 14*128, 15*128 },
388 	256*128
389 };
390 
391 static struct GfxDecodeInfo gfxdecodeinfo[] =
392 {
393 	{ REGION_GFX1, 0x00000, &charlayout, 0, 1 },
394 	{ REGION_GFX2, 0x00000, &bglayout, 0, 2 },
395 	{ -1 }	/* end of array */
396 };
397 
398 /* ?? not sure for this*/
399 #define MAIN_XTAL 24000000
400 
401 /* handler called by the 2203 emulator when the internal timers cause an IRQ */
irqhandler(int irq)402 static void irqhandler(int irq)
403 {
404 	cpu_set_irq_line(2,0,irq ? ASSERT_LINE : CLEAR_LINE);
405 }
406 
407 static struct YM2203interface ym2203_interface =
408 {
409 	1,			/* 1 chip */
410 	MAIN_XTAL/8,	/* 3 MHz */
411 	{ YM2203_VOL(25,25) },
412 	{ 0 },
413 	{ 0 },
414 	{ 0 },
415 	{ 0 },
416 	{ irqhandler }
417 };
418 
419 
420 static struct YM3526interface ym3526_interface =
421 {
422 	1,			/* 1 chip (no more supported) */
423 	MAIN_XTAL/8,	/* 3 MHz */
424 	{ 50 }		/* volume */
425 };
426 
427 
428 static struct OKIM6295interface okim6295_interface =
429 {
430 	1,                  /* 1 chip */
431 	{ 8000 },           /* ? frequency */
432 	{ REGION_SOUND1 },	/* memory region */
433 	{ 100 }
434 };
435 
436 
437 static MACHINE_DRIVER_START( missb2 )
438 
439 	/* basic machine hardware */
440 	MDRV_CPU_ADD(Z80, MAIN_XTAL/4)	/* 6 MHz */
MDRV_CPU_MEMORY(missb2_readmem,missb2_writemem)441 	MDRV_CPU_MEMORY(missb2_readmem,missb2_writemem)
442 	MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
443 
444 	MDRV_CPU_ADD(Z80, MAIN_XTAL/4)	/* 6 MHz */
445 	MDRV_CPU_MEMORY(missb2_readmem2,missb2_writemem2)
446 	MDRV_CPU_VBLANK_INT(irq0_line_hold,1)
447 
448 	MDRV_CPU_ADD(Z80, MAIN_XTAL/8)
449 	MDRV_CPU_FLAGS(CPU_AUDIO_CPU)	/* 3 MHz */
450 	MDRV_CPU_MEMORY(sound_readmem,sound_writemem)
451 								/* IRQs are triggered by the YM2203 */
452 	MDRV_FRAMES_PER_SECOND(60)
453 	MDRV_VBLANK_DURATION(DEFAULT_60HZ_VBLANK_DURATION)
454 	MDRV_INTERLEAVE(100)	/* 100 CPU slices per frame - an high value to ensure proper */
455 							/* synchronization of the CPUs */
456 
457 	/* video hardware */
458 	MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
459 	MDRV_SCREEN_SIZE(32*8, 32*8)
460 	MDRV_VISIBLE_AREA(0, 32*8-1, 2*8, 30*8-1)
461 	MDRV_GFXDECODE(gfxdecodeinfo)
462 	MDRV_PALETTE_LENGTH(512)
463 
464 	MDRV_VIDEO_UPDATE(missb2)
465 
466 	/* sound hardware */
467 	MDRV_SOUND_ADD(YM2203, ym2203_interface) /* ?*/
468 	MDRV_SOUND_ADD(YM3526, ym3526_interface) /* ?*/
469 	MDRV_SOUND_ADD(OKIM6295, okim6295_interface)
470 MACHINE_DRIVER_END
471 
472 
473 
474 ROM_START( missb2 )
475 	ROM_REGION( 0x30000, REGION_CPU1, 0 )
476 	ROM_LOAD( "msbub2-u.204", 0x00000, 0x10000, CRC(b633bdde) SHA1(29a389c52ff06718f1c4c39f6a854856c237356b) ) /* FIRST AND SECOND HALF IDENTICAL */
477 	/* ROMs banked at 8000-bfff */
478 	ROM_LOAD( "msbub2-u.203", 0x10000, 0x10000, CRC(29fd8afe) SHA1(94ead80d20cd3974dd4fb0358915e3bd8b793158) )
479 	/* 20000-2ffff empty */
480 
481 	ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* 64k for the second CPU */
482 	ROM_LOAD( "msbub2-u.11",  0x0000, 0x10000, CRC(003dc092) SHA1(dff3c2b31d0804a308e5c42cf9705cd3d6144ad7) )
483 
484 	ROM_REGION( 0x10000, REGION_CPU3, 0 ) /* 64k for the third CPU */
485 	ROM_LOAD( "msbub2-u.211", 0x0000, 0x08000, CRC(08e5d846) SHA1(8509a71df984f0348bdc6ab60eb2ba7ceb9b1246) )
486 
487 	ROM_REGION( 0x100000, REGION_GFX1, ROMREGION_DISPOSE | ROMREGION_INVERT )
488 	ROM_LOAD( "msbub2-u.14",  0x00000, 0x40000, CRC(b3164b47) SHA1(083a63010515b0aa43b482938ae302b2df985312) )
489 	ROM_LOAD( "msbub2-u.126", 0x40000, 0x40000, CRC(b0a9a353) SHA1(40d7f4c970d8571de319231c295fa0d2836efcf7) )
490 	ROM_LOAD( "msbub2-u.124", 0x80000, 0x40000, CRC(4b0d8e5b) SHA1(218da3edcfea228e6df1ac59bc24217713d79410) )
491 	ROM_LOAD( "msbub2-u.125", 0xc0000, 0x40000, CRC(77b710e2) SHA1(f6f46804a23de6c930bc40a3f45ac70e160f0645) )
492 
493 	ROM_REGION( 0x200000, REGION_GFX2, 0 ) /* background images */
494 	ROM_LOAD16_BYTE( "msbub2-u.ic1", 0x100001, 0x80000, CRC(d621cbc3) SHA1(36343d85bdde0e40dfe0f0e4e646546f175903f8) )
495 	ROM_LOAD16_BYTE( "msbub2-u.ic3", 0x100000, 0x80000, CRC(90e56035) SHA1(8fa18d97a05890178c52b97ff75aed300344a93e) )
496 	ROM_LOAD16_BYTE( "msbub2-u.ic2", 0x000001, 0x80000, CRC(694c2783) SHA1(401dc8713a02130289f364786c38e70c4c4f9b2e) )
497 	ROM_LOAD16_BYTE( "msbub2-u.ic4", 0x000000, 0x80000, CRC(be71c9f0) SHA1(1961e931017f644486cea0ce431d50973679c848) )
498 
499 	ROM_REGION( 0x20000, REGION_SOUND1, 0 ) /* samples */
500 	ROM_LOAD( "msbub2-u.13", 0x00000, 0x20000, CRC(14f07386) SHA1(097897d92226f900e11dbbdd853aff3ac46ff016) )
501 
502 	ROM_REGION( 0x0100, REGION_PROMS, 0 )
503 	ROM_LOAD( "a71-25.bin",  0x0000, 0x0100, CRC(2d0f8545) SHA1(089c31e2f614145ef2743164f7b52ae35bc06808) )	/* video timing - taken from bublbobl */
504 ROM_END
505 
506 static DRIVER_INIT( missb2 )
507 {
508 	unsigned char *ROM = memory_region(REGION_CPU1);
509 
510 	/* in Bubble Bobble, bank 0 has code falling from 7fff to 8000, */
511 	/* so I have to copy it there because bank switching wouldn't catch it */
512 	memcpy(ROM+0x08000,ROM+0x10000,0x4000);
513 
514 }
515 
516 GAMEX( 1996, missb2, bublbobl, missb2, missb2, missb2, ROT0,  "Alpha Co", "Miss Bubble 2", GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND )
517