1 #include "../vidhrdw/bloodbro.c"
2 
3 /**************************************************************************
4 Blood Bros, West Story.
5 TAD Corporation 1990/Datsu 1991
6 68000 + Z80 + YM3931 + YM3812
7 
8 driver by Carlos A. Lozano Baides
9 
10 TODO:
11 
12 (*) Global
13 - Sprites priorities/clip.
14 - Fix timing?? Foreground layer flickers during the game!!!!
15 - hiscore.
16 
17 (*) Blood Bros
18 
19 (*) West Story
20 - Sprites problems. (decode problems?)
21 
22 27.10.99:  Added sound - Bryan McPhail.
23 
24 **************************************************************************/
25 
26 #include "driver.h"
27 #include "vidhrdw/generic.h"
28 #include "cpu/z80/z80.h"
29 #include "sndhrdw/seibu.h"
30 
31 extern void bloodbro_vh_screenrefresh( struct osd_bitmap *bitmap, int fullrefresh );
32 extern void weststry_vh_screenrefresh( struct osd_bitmap *bitmap, int fullrefresh );
33 extern int bloodbro_vh_start(void);
34 extern void bloodbro_vh_stop(void);
35 
36 READ_HANDLER( bloodbro_background_r );
37 WRITE_HANDLER( bloodbro_background_w );
38 READ_HANDLER( bloodbro_foreground_r );
39 WRITE_HANDLER( bloodbro_foreground_w );
40 
41 extern unsigned char *bloodbro_videoram2;
42 extern unsigned char *textlayoutram;
43 extern unsigned char *bloodbro_scroll;
44 
45 /***************************************************************************/
46 
READ_HANDLER(bloodbro_ports_r)47 static READ_HANDLER( bloodbro_ports_r ) {
48      //logerror("INPUT e000[%x] \n", offset);
49      switch (offset) {
50        case 0x0: /* DIPSW 1&2 */
51                  return readinputport(4) + readinputport(5)*256;
52        case 0x2: /* IN1-IN2 */
53                  return readinputport(0) + readinputport(1)*256;
54        case 0x4: /* ???-??? */
55                  return readinputport(2) + readinputport(3)*256;
56        default: return (0xffff);
57      }
58 }
59 
WRITE_HANDLER(bloodbro_sound_w)60 static WRITE_HANDLER( bloodbro_sound_w )
61 {
62 	/* Slightly different interface in this game */
63 	if (offset==0) seibu_soundlatch_w(0,data&0xff); /* Convert 16 bit write to 8 bit */
64 	else if (offset==2) seibu_soundlatch_w(2,data&0xff); /* Convert 16 bit write to 8 bit */
65 	else if (offset!=2) seibu_soundlatch_w(offset,data&0xff);
66 }
67 
READ_HANDLER(bloodbro_sound_r)68 READ_HANDLER( bloodbro_sound_r )
69 {
70       return 0x0060; /* Always return sound cpu ready */
71 }
72 
73 
74 /**** Blood Bros Memory Map  *******************************************/
75 
76 static struct MemoryReadAddress readmem_cpu[] = {
77 	{ 0x00000, 0x7ffff, MRA_ROM },
78 	{ 0x80000, 0x8afff, MRA_RAM },
79 	{ 0x8b000, 0x8bfff, MRA_RAM },
80 	{ 0x8c000, 0x8c3ff, bloodbro_background_r },
81 	{ 0x8c400, 0x8cfff, MRA_RAM },
82 	{ 0x8d000, 0x8d3ff, bloodbro_foreground_r },
83 	{ 0x8d400, 0x8d7ff, MRA_RAM },
84 	{ 0x8d800, 0x8dfff, MRA_RAM },
85 	{ 0x8e000, 0x8e7ff, MRA_RAM },
86 	{ 0x8e800, 0x8f7ff, paletteram_word_r },
87 	{ 0x8f800, 0x8ffff, MRA_RAM },
88 	{ 0xa0000, 0xa001f, bloodbro_sound_r },
89 	{ 0xc0000, 0xc007f, MRA_BANK3 },
90 	{ 0xe0000, 0xe000f, bloodbro_ports_r },
91 	{ -1 }
92 };
93 
94 static struct MemoryWriteAddress writemem_cpu[] = {
95 	{ 0x00000, 0x7ffff, MWA_ROM },
96 	{ 0x80000, 0x8afff, MWA_RAM },
97 	{ 0x8b000, 0x8bfff, MWA_RAM, &spriteram },
98 	{ 0x8c000, 0x8c3ff, bloodbro_background_w, &videoram },   /* Background RAM */
99 	{ 0x8c400, 0x8cfff, MWA_RAM },
100 	{ 0x8d000, 0x8d3ff, bloodbro_foreground_w, &bloodbro_videoram2 }, /* Foreground RAM */
101 	{ 0x8d400, 0x8d7ff, MWA_RAM },
102 	{ 0x8d800, 0x8dfff, MWA_RAM, &textlayoutram },
103 	{ 0x8e000, 0x8e7ff, MWA_RAM },
104 	{ 0x8e800, 0x8f7ff, paletteram_xxxxBBBBGGGGRRRR_word_w, &paletteram },
105 	{ 0x8f800, 0x8ffff, MWA_RAM },
106 	{ 0xa0000, 0xa001f, bloodbro_sound_w, &seibu_shared_sound_ram },
107 	{ 0xc0000, 0xc007f, MWA_BANK3, &bloodbro_scroll },
108 	{ 0xc0080, 0xc0081, MWA_NOP }, /* IRQ Ack VBL? */
109 	{ 0xc00c0, 0xc00c1, MWA_NOP }, /* watchdog? */
110 	//{ 0xc0100, 0xc0100, MWA_NOP }, /* ?? Written 1 time */
111 	{ -1 }
112 };
113 
114 /**** West Story Memory Map ********************************************/
115 
116 static struct MemoryReadAddress weststry_readmem_cpu[] = {
117 	{ 0x000000, 0x07ffff, MRA_ROM },
118 	{ 0x080000, 0x08afff, MRA_RAM },
119 	{ 0x08b000, 0x08bfff, MRA_RAM },
120 	{ 0x08c000, 0x08c3ff, bloodbro_background_r },
121 	{ 0x08c400, 0x08cfff, MRA_RAM },
122 	{ 0x08d000, 0x08d3ff, bloodbro_foreground_r },
123 	{ 0x08d400, 0x08dfff, MRA_RAM },
124 	{ 0x08d800, 0x08dfff, MRA_RAM },
125 	{ 0x08e000, 0x08ffff, MRA_RAM },
126 	{ 0x0c1000, 0x0c100f, bloodbro_ports_r },
127 	{ 0x0c1010, 0x0c17ff, MRA_BANK3 },
128 	{ 0x128000, 0x1287ff, paletteram_word_r },
129 	{ 0x120000, 0x128fff, MRA_BANK2 },
130 	{ -1 }
131 };
132 
133 static struct MemoryWriteAddress weststry_writemem_cpu[] = {
134 	{ 0x000000, 0x07ffff, MWA_ROM },
135 	{ 0x080000, 0x08afff, MWA_RAM },
136 	{ 0x08b000, 0x08bfff, MWA_RAM, &spriteram },
137 	{ 0x08c000, 0x08c3ff, bloodbro_background_w, &videoram },   /* Background RAM */
138 	{ 0x08c400, 0x08cfff, MWA_RAM },
139 	{ 0x08d000, 0x08d3ff, bloodbro_foreground_w, &bloodbro_videoram2 }, /* Foreground RAM */
140 	{ 0x08d400, 0x08d7ff, MWA_RAM },
141 	{ 0x08d800, 0x08dfff, MWA_RAM, &textlayoutram },
142 	{ 0x08e000, 0x08ffff, MWA_RAM },
143 	{ 0x0c1010, 0x0c17ff, MWA_BANK3 },
144 	{ 0x128000, 0x1287ff, paletteram_xxxxBBBBGGGGRRRR_word_w, &paletteram },
145 	{ 0x120000, 0x128fff, MWA_BANK2 },
146 	{ -1 }
147 };
148 
149 /******************************************************************************/
150 
151 SEIBU_SOUND_SYSTEM_YM3812_MEMORY_MAP(MRA_NOP); /* No coin port in this game */
152 
153 /******************************************************************************/
154 
155 INPUT_PORTS_START( bloodbro )
156 	PORT_START	/* IN0 */
157 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY)
158 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY)
159 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY)
160 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY)
161 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
162 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
163 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 )
164 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
165 
166 	PORT_START	/* IN1 */
167 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY | IPF_PLAYER2 )
168 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY | IPF_PLAYER2 )
169 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY | IPF_PLAYER2 )
170 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER2 )
171 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
172 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
173 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_PLAYER2 )
174 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
175 
176 	PORT_START	/* IN */
177 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1)
178 	PORT_BIT( 0x0e, IP_ACTIVE_LOW, IPT_UNKNOWN )
179 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
180 	PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNKNOWN )
181 
182 	PORT_START	/* IN */
183 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
184 	PORT_BIT( 0x0e, IP_ACTIVE_LOW, IPT_UNKNOWN )
185 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
186 	PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNKNOWN )
187 
188 	PORT_START /* DSW1 */
189 	PORT_DIPNAME( 0x01, 0x00, "Coin Mode" )
190 	PORT_DIPSETTING(    0x00, "Normal" )
191 	PORT_DIPSETTING(    0x01, DEF_STR( Free_Play ) )
192 	PORT_DIPNAME( 0x06, 0x06, DEF_STR( Coin_A ) )
193 	PORT_DIPSETTING(	0x00, DEF_STR( 5C_1C ) )
194 	PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
195 	PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
196 	PORT_DIPSETTING(    0x06, DEF_STR( 1C_1C ) )
197 	PORT_DIPNAME( 0x18, 0x18, DEF_STR( Coin_B ) )
198 	PORT_DIPSETTING(    0x18, DEF_STR( 1C_2C ) )
199 	PORT_DIPSETTING(    0x10, DEF_STR( 1C_3C ) )
200 	PORT_DIPSETTING(    0x08, DEF_STR( 1C_5C ) )
201 	PORT_DIPSETTING(    0x00, DEF_STR( 1C_6C ) )
202 	PORT_DIPNAME( 0x20, 0x20, "Starting Coin" )
203 	PORT_DIPSETTING(    0x20, "Normal" )
204 	PORT_DIPSETTING(    0x00, "x2" )
205 	PORT_DIPNAME( 0x40, 0x40, "Unused 1" )
206 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
207 	PORT_DIPSETTING(    0x40, DEF_STR( On ) )
208 	PORT_DIPNAME( 0x80, 0x80, "Unused 2" )
209 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
210 	PORT_DIPSETTING(    0x80, DEF_STR( On ) )
211 
212 	PORT_START
213 	PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
214 	PORT_DIPSETTING(    0x00, "1" )
215 	PORT_DIPSETTING(    0x02, "2" )
216 	PORT_DIPSETTING(    0x03, "3" )
217 	PORT_DIPSETTING(    0x01, "5" )
218 	PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) )
219 	PORT_DIPSETTING(    0x0c, "300K 500K" )
220 	PORT_DIPSETTING(    0x08, "500K 500K" )
221 	PORT_DIPSETTING(    0x04, "500K" )
222 	PORT_DIPSETTING(    0x00, "None" )
223 	PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) )
224 	PORT_DIPSETTING(    0x20, "Easy" )
225 	PORT_DIPSETTING(    0x30, "Normal" )
226 	PORT_DIPSETTING(    0x10, "Hard" )
227 	PORT_DIPSETTING(    0x00, "Very Hard" )
228 	PORT_DIPNAME( 0x40, 0x40, "Allow Continue" )
229 	PORT_DIPSETTING(    0x00, DEF_STR( No ) )
230 	PORT_DIPSETTING(    0x40, DEF_STR( Yes ) )
231 	PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) )
232 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
233 	PORT_DIPSETTING(    0x80, DEF_STR( On ) )
234 INPUT_PORTS_END
235 
236 /**** West Story Input Ports *******************************************/
237 
238 INPUT_PORTS_START( weststry )
239 	PORT_START	/* IN0 */
240         PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY)
241 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY)
242 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY)
243 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY)
244 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
245 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
246 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 )
247 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
248 
249 	PORT_START	/* IN1 */
250         PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY | IPF_PLAYER2 )
251 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY | IPF_PLAYER2 )
252 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY | IPF_PLAYER2 )
253 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER2 )
254 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
255 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
256 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_PLAYER2 )
257 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
258 
259 	PORT_START	/* IN */
260         PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1)
261         PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2)
262 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
263 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
264 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
265 	PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNKNOWN )
266 
267 	PORT_START	/* IN */
268 	PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
269 INPUT_PORTS_END
270 
271 
272 /**** Blood Bros gfx decode ********************************************/
273 
274 static struct GfxLayout textlayout = {
275 	8,8,	/* 8*8 characters */
276 	4096,	/* 4096 characters */
277 	4,	/* 4 bits per pixel */
278 	{ 0, 4, 0x10000*8, 0x10000*8+4 },
279 	{ 3, 2, 1, 0, 8+3, 8+2, 8+1, 8+0},
280 	{ 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 },
281 	16*8	/* every char takes 16 consecutive bytes */
282 };
283 
284 static struct GfxLayout backlayout = {
285 	16,16,	/* 16*16 sprites  */
286 	4096,	/* 4096 sprites */
287 	4,	/* 4 bits per pixel */
288 	{ 8, 12, 0, 4 },
289 	{ 3, 2, 1, 0, 16+3, 16+2, 16+1, 16+0,
290              3+32*16, 2+32*16, 1+32*16, 0+32*16, 16+3+32*16, 16+2+32*16, 16+1+32*16, 16+0+32*16 },
291 	{ 0*16, 2*16, 4*16, 6*16, 8*16, 10*16, 12*16, 14*16,
292 			16*16, 18*16, 20*16, 22*16, 24*16, 26*16, 28*16, 30*16 },
293 	128*8	/* every sprite takes 128 consecutive bytes */
294 };
295 
296 static struct GfxLayout spritelayout = {
297 	16,16,	/* 16*16 sprites  */
298 	8192,	/* 8192 sprites */
299 	4,	/* 4 bits per pixel */
300 	{ 8, 12, 0, 4 },
301 	{ 3, 2, 1, 0, 16+3, 16+2, 16+1, 16+0,
302              3+32*16, 2+32*16, 1+32*16, 0+32*16, 16+3+32*16, 16+2+32*16, 16+1+32*16, 16+0+32*16 },
303 	{ 0*16, 2*16, 4*16, 6*16, 8*16, 10*16, 12*16, 14*16,
304 			16*16, 18*16, 20*16, 22*16, 24*16, 26*16, 28*16, 30*16 },
305 	128*8	/* every sprite takes 128 consecutive bytes */
306 };
307 
308 static struct GfxDecodeInfo bloodbro_gfxdecodeinfo[] =
309 {
310 	{ REGION_GFX1, 0x00000, &textlayout,   0x70*16,  0x10 }, /* Text */
311 	{ REGION_GFX2, 0x00000, &backlayout,   0x40*16,  0x10 }, /* Background */
312 	{ REGION_GFX2, 0x80000, &backlayout,   0x50*16,  0x10 }, /* Foreground */
313 	{ REGION_GFX3, 0x00000, &spritelayout, 0x00*16,  0x10 }, /* Sprites */
314 	{ -1 }
315 };
316 
317 /**** West Story gfx decode *********************************************/
318 
319 static struct GfxLayout weststry_textlayout = {
320 	8,8,	/* 8*8 sprites */
321 	4096,	/* 4096 sprites */
322 	4,	/* 4 bits per pixel */
323 	{ 0, 0x8000*8, 2*0x8000*8, 3*0x8000*8 },
324         { 0, 1, 2, 3, 4, 5, 6, 7 },
325         { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
326 	8*8	/* every sprite takes 8 consecutive bytes */
327 };
328 
329 static struct GfxLayout weststry_backlayout = {
330 	16,16,	/* 16*16 sprites */
331 	4096,	/* 4096 sprites */
332 	4,	/* 4 bits per pixel */
333 	{ 0*0x20000*8, 1*0x20000*8, 2*0x20000*8, 3*0x20000*8 },
334 	{ 0, 1, 2, 3, 4, 5, 6, 7,
335          	16*8+0, 16*8+1, 16*8+2, 16*8+3, 16*8+4, 16*8+5, 16*8+6, 16*8+7},
336 	{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
337 			8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
338 	32*8	/* every sprite takes 32 consecutive bytes */
339 };
340 
341 static struct GfxLayout weststry_spritelayout = {
342 	16,16,	/* 16*16 sprites */
343 	8192,	/* 8192 sprites */
344 	4,	/* 4 bits per pixel */
345 	{ 0*0x40000*8, 1*0x40000*8, 2*0x40000*8, 3*0x40000*8 },
346 	{ 0, 1, 2, 3, 4, 5, 6, 7,
347          	16*8+0, 16*8+1, 16*8+2, 16*8+3, 16*8+4, 16*8+5, 16*8+6, 16*8+7 },
348 	{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
349 			8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
350 	32*8	/* every sprite takes 32 consecutive bytes */
351 };
352 
353 static struct GfxDecodeInfo weststry_gfxdecodeinfo[] =
354 {
355 	{ REGION_GFX1, 0x00000, &weststry_textlayout,     16*16,  0x10 },
356 	{ REGION_GFX2, 0x00000, &weststry_backlayout,     48*16,  0x10 },
357 	{ REGION_GFX2, 0x80000, &weststry_backlayout,     32*16,  0x10 },
358 	{ REGION_GFX3, 0x00000, &weststry_spritelayout,    0*16,  0x10 },
359 	{ -1 }
360 };
361 
362 /**** Blood Bros Interrupt & Driver Machine  ****************************/
363 
364 /* Parameters: YM3812 frequency, Oki frequency, Oki memory region */
365 SEIBU_SOUND_SYSTEM_YM3812_HARDWARE(14318180/4,8000,REGION_SOUND1);
366 
367 static struct MachineDriver machine_driver_bloodbro =
368 {
369 	{
370 		{
371 			CPU_M68000,
372 			10000000, /* 10 Mhz */
373 			readmem_cpu,writemem_cpu,0,0,
374 			m68_level4_irq,1
375 		},
376 		{
377 			SEIBU_SOUND_SYSTEM_CPU(14318180/4)
378 		},
379 	},
380 	60, DEFAULT_REAL_60HZ_VBLANK_DURATION,
381 	1,	/* CPU slices per frame */
382 	seibu_sound_init_1, /* init machine */
383 
384 	/* video hardware */
385 	32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
386 	bloodbro_gfxdecodeinfo,
387 	2048,2048,
388 	0,
389 
390 	VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
391 
392 	0,
393 	bloodbro_vh_start,
394 	bloodbro_vh_stop,
395 	bloodbro_vh_screenrefresh,
396 
397 	/* sound hardware */
398 	0,0,0,0,
399 	{
400 		SEIBU_SOUND_SYSTEM_YM3812_INTERFACE
401 	}
402 };
403 
404 static struct MachineDriver machine_driver_weststry =
405 {
406 	{
407 		{
408 			CPU_M68000,
409 			10000000, /* 10 Mhz */
410 			weststry_readmem_cpu,weststry_writemem_cpu,0,0,
411 			m68_level6_irq,1
412 		},
413 		{
414 			SEIBU_SOUND_SYSTEM_CPU(14318180/4)
415 		},
416 	},
417 	60, DEFAULT_REAL_60HZ_VBLANK_DURATION,
418 	1,	/* CPU slices per frame */
419 	seibu_sound_init_1, /* init machine */
420 
421 	/* video hardware */
422 	256, 256, { 0, 255, 16, 239 },
423 
424 	weststry_gfxdecodeinfo,
425         1024,1024,
426         0,
427 
428 	VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
429 
430 	0,
431         bloodbro_vh_start,
432         bloodbro_vh_stop,
433 	weststry_vh_screenrefresh,
434 
435 	/* sound hardware */
436 	0,0,0,0,
437 	{
438 		SEIBU_SOUND_SYSTEM_YM3812_INTERFACE
439 	}
440 };
441 
442 
443 
444 ROM_START( bloodbro )
445 	ROM_REGION( 0x90000, REGION_CPU1 )
446 	ROM_LOAD_ODD ( "bb_02.bin" ,   0x00000, 0x20000, 0xc0fdc3e4 )
447 	ROM_LOAD_EVEN( "bb_01.bin" ,   0x00000, 0x20000, 0x2d7e0fdf )
448 	ROM_LOAD_ODD ( "bb_04.bin" ,   0x40000, 0x20000, 0xfd951c2c )
449 	ROM_LOAD_EVEN( "bb_03.bin" ,   0x40000, 0x20000, 0x18d3c460 )
450 
451 	ROM_REGION( 0x18000, REGION_CPU2 )
452 	ROM_LOAD( "bb_07.bin" ,   0x000000, 0x08000, 0x411b94e8 )
453 	ROM_CONTINUE(             0x010000, 0x08000 )
454 
455 	ROM_REGION( 0x20000, REGION_GFX1 | REGIONFLAG_DISPOSE )
456 	ROM_LOAD( "bb_05.bin" ,   0x00000, 0x10000, 0x04ba6d19 )	/* characters */
457 	ROM_LOAD( "bb_06.bin" ,   0x10000, 0x10000, 0x7092e35b )
458 
459 	ROM_REGION( 0x100000, REGION_GFX2 | REGIONFLAG_DISPOSE )
460 	ROM_LOAD( "bloodb.bk",   0x00000, 0x100000, 0x1aa87ee6 )	/* Background+Foreground */
461 
462 	ROM_REGION( 0x100000, REGION_GFX3 | REGIONFLAG_DISPOSE )
463 	ROM_LOAD( "bloodb.obj",   0x00000, 0x100000, 0xd27c3952 )	/* sprites */
464 
465 	ROM_REGION( 0x20000, REGION_SOUND1 )	/* ADPCM samples */
466 	ROM_LOAD( "bb_08.bin" ,   0x00000, 0x20000, 0xdeb1b975 )
467 ROM_END
468 
ROM_START(weststry)469 ROM_START( weststry )
470 	ROM_REGION( 0x90000, REGION_CPU1 )	/* 64k for cpu code */
471 	ROM_LOAD_ODD ( "ws13.bin" ,   0x00000, 0x20000, 0x158e302a )
472 	ROM_LOAD_EVEN( "ws15.bin" ,   0x00000, 0x20000, 0x672e9027 )
473 	ROM_LOAD_ODD ( "bb_04.bin" ,   0x40000, 0x20000, 0xfd951c2c )
474 	ROM_LOAD_EVEN( "bb_03.bin" ,   0x40000, 0x20000, 0x18d3c460 )
475 
476 	ROM_REGION( 0x18000, REGION_CPU2 )	/* 64k for sound cpu code */
477 	ROM_LOAD( "ws17.bin" ,   0x000000, 0x08000, 0xe00a8f09 )
478 	ROM_CONTINUE(            0x010000, 0x08000 )
479 
480 	ROM_REGION( 0x20000, REGION_GFX1 | REGIONFLAG_DISPOSE )
481 	ROM_LOAD( "ws09.bin" ,   0x00000, 0x08000, 0xf05b2b3e )	/* characters */
482 	ROM_CONTINUE(            0x00000, 0x8000 )
483 	ROM_LOAD( "ws11.bin" ,   0x08000, 0x08000, 0x2b10e3d2 )
484 	ROM_CONTINUE(            0x08000, 0x8000 )
485 	ROM_LOAD( "ws10.bin" ,   0x10000, 0x08000, 0xefdf7c82 )
486 	ROM_CONTINUE(            0x10000, 0x8000 )
487 	ROM_LOAD( "ws12.bin" ,   0x18000, 0x08000, 0xaf993578 )
488 	ROM_CONTINUE(            0x18000, 0x8000 )
489 
490 	ROM_REGION( 0x100000, REGION_GFX2 | REGIONFLAG_DISPOSE )
491 	ROM_LOAD( "ws05.bin" ,   0x00000, 0x20000, 0x007c8dc0 )	/* Background */
492 	ROM_LOAD( "ws07.bin" ,   0x20000, 0x20000, 0x0f0c8d9a )
493 	ROM_LOAD( "ws06.bin" ,   0x40000, 0x20000, 0x459d075e )
494 	ROM_LOAD( "ws08.bin" ,   0x60000, 0x20000, 0x4d6783b3 )
495 	ROM_LOAD( "ws01.bin" ,   0x80000, 0x20000, 0x32bda4bc )	/* Foreground */
496 	ROM_LOAD( "ws03.bin" ,   0xa0000, 0x20000, 0x046b51f8 )
497 	ROM_LOAD( "ws02.bin" ,   0xc0000, 0x20000, 0xed9d682e )
498 	ROM_LOAD( "ws04.bin" ,   0xe0000, 0x20000, 0x75f082e5 )
499 
500 	ROM_REGION( 0x100000, REGION_GFX3 | REGIONFLAG_DISPOSE )
501 	ROM_LOAD( "ws25.bin" ,   0x00000, 0x20000, 0x8092e8e9 )	/* sprites */
502 	ROM_LOAD( "ws26.bin" ,   0x20000, 0x20000, 0xf6a1f42c )
503 	ROM_LOAD( "ws23.bin" ,   0x40000, 0x20000, 0x43d58e24 )
504 	ROM_LOAD( "ws24.bin" ,   0x60000, 0x20000, 0x20a867ea )
505 	ROM_LOAD( "ws21.bin" ,   0x80000, 0x20000, 0xe23d7296 )
506 	ROM_LOAD( "ws22.bin" ,   0xa0000, 0x20000, 0x7150a060 )
507 	ROM_LOAD( "ws19.bin" ,   0xc0000, 0x20000, 0xc5dd0a96 )
508 	ROM_LOAD( "ws20.bin" ,   0xe0000, 0x20000, 0xf1245c16 )
509 
510 	ROM_REGION( 0x20000, REGION_SOUND1 )	/* ADPCM samples */
511 	ROM_LOAD( "bb_08.bin" ,   0x00000, 0x20000, 0xdeb1b975 )
512 ROM_END
513 
514 static void gfx_untangle( void )
515 {
516 	unsigned char *gfx = memory_region(REGION_GFX3);
517 	int i;
518 	for( i=0; i< 0x100000; i++ ){
519 		gfx[i] = ~gfx[i];
520 	}
521 }
522 
523 /***************************************************************************/
524 
init_bloodbro(void)525 static void init_bloodbro(void)
526 {
527 	install_seibu_sound_speedup(1);
528 }
529 
init_weststry(void)530 static void init_weststry(void)
531 {
532 	install_seibu_sound_speedup(1);
533 	gfx_untangle();
534 }
535 
536 /***************************************************************************/
537 
538 GAME( 1990, bloodbro, 0,        bloodbro, bloodbro, bloodbro, ROT0, "Tad", "Blood Bros." )
539 GAME( 1990, weststry, bloodbro, weststry, weststry, weststry, ROT0, "bootleg", "West Story" )
540