1 /**********************************************************************************************************************
2  Championship VBall
3  Driver by Paul "TBBle" Hampson
4 
5  TODO:
6  Needs to be tilemapped. The background layer and sprite layer are identical to spdodgeb, except for the
7   back-switched graphics roms and the size of the pallete banks.
8  Someone needs to look at Naz's board, and see what PCM sound chips are present.
9  And get whatever's in the dip package on Naz's board. (BG/FG Roms, I hope)
10  I'd also love to know whether Naz's is a bootleg or is missing the story for a different reason (US release?)
11 
12  03/28/03 - Additions by Steve Ellenoff
13  ---------------------------------------
14 
15  -Corrected background tiles (tiles are really 512x512 not 256x256 as previously setup)
16  -Converted rendering to tilemap system
17  -Implemented Scroll Y registers
18  -Implemented X Line Scrolling (only seems to be used for displaying Hawaii and Airfield Map Screen)
19  -Adjusted visible screen size to match more closely the real game
20  -Added support for cocktail mode/flip screen
21  -Adjusted Difficulty Dip settings based on some game testing I did
22  -Confirmed the US version uses the oki6295 and does not display the story in attract mode like the JP version
23  -Confirmed the Background graphics are contained in that unusual looking dip package on the US board,
24   (need help figuring out the pinout so I can try and dump it)
25 
26 
27  Remaining Issues:
28  -1) IRQ & NMI code is totally guessed, and needs to be solved properly
29 
30 Measurements from Guru (someone needs to rewrite INTERRUPT_GEN() in vidhrdw/vball.c):
31 6502 /IRQ = 1.720kHz
32 6202 /NMI = 58 Hz
33 VBlank = 58Hz
34 
35 
36  -2) X Line Scrolling doesn't work 100% when Flip Screen Dip is set
37  -3) 2 Player Version - Dips for difficulty don't seem to work or just need more testing
38 
39  -4) 2 Player Version - sound ROM is different and the adpmc chip is addressed differently
40                         Changed it to use a rom that was dumped from original PCB (readme below),
41                         this makes the non-working ROM not used - i don't know where it come from.
42 
43 
44 
45   U.S. Championship V'Ball (Japan)
46   Technos, 1988
47 
48   PCB Layout
49   ----------
50 
51 
52   TA-0025-P1-02 (M6100357A BEACH VOLLEY 880050B04)
53   |---------------------------------------------------------------------|
54   |          YM3014  M6295             25J1-0.47   YM2151   3.579545MHz |
55   |                1.056MHz  25J0-0.78   Z80       6116                 |
56   |                                                                     |
57   |                                                                     |
58   |                                                                     |
59   |                                                                     |
60   |    6502 25J2-2-5.124 6116                                           |
61   |                                                                     |
62   |                    2016                                     12MHz   |
63   |J                                                                    |
64   |A                                             2016  2016             |
65   |M                                                                    |
66   |M                                                                    |
67   |A                                                                    |
68   |  DSW1                              6264     25J4-0.35  25J3-0.5     |
69   |  DSW2                                                               |
70   |       25J6-0.144                                                    |
71   |       25J5-0.143 2016                                               |
72   |                       -------------------                           |
73   |25J7-0.160             |                 |                           |
74   |                       | TOSHIBA  0615   |                           |
75   |                  2016 |                 |                           |
76   |                       | T5324   TRJ-101 |                           |
77   |                       |                 |                           |
78   |-----------------------|-----------------|---------------------------|
79 
80 
81   Notes:
82         6502 clock: 2.000MHz
83          Z80 clock: 3.579545MHz
84       YM2151 clock: 3.579545MHz
85        M6295 clock: 1.056MHz, sample rate = 8kHz (i.e. 1056000/132)
86 
87 
88   *********************************************************************************************************************/
89 
90 #include "driver.h"
91 #include "vidhrdw/generic.h"
92 #include "cpu/m6502/m6502.h"
93 #include "cpu/z80/z80.h"
94 
95 /* from vidhrdw */
96 extern unsigned char *vb_attribram;
97 extern unsigned char *vb_spriteram;
98 extern unsigned char *vb_videoram;
99 extern unsigned char *vb_scrolly_lo;
100 extern int vb_scrollx_hi;
101 extern int vb_scrolly_hi;
102 extern int vb_scrollx_lo;
103 extern int vball_gfxset;
104 
105 VIDEO_START( vb );
106 VIDEO_UPDATE( vb );
107 extern void vb_bgprombank_w(int bank);
108 extern void vb_spprombank_w(int bank);
109 extern WRITE_HANDLER( vb_attrib_w );
110 extern WRITE_HANDLER( vb_videoram_w );
111 extern void vb_mark_all_dirty(void);
112 
113 INTERRUPT_GEN( vball_interrupt );
114 
115 /* end of extern code & data */
116 
117 
118 
119 /* bit 0 = bank switch
120    bit 1 = ?
121    bit 2 = ?
122    bit 3 = ?
123    bit 4 = ?
124    bit 5 = graphics tile offset
125    bit 6 = scroll y hi
126    bit 7 = ?
127 */
WRITE_HANDLER(vb_bankswitch_w)128 static WRITE_HANDLER( vb_bankswitch_w )
129 {
130 	unsigned char *RAM = memory_region(REGION_CPU1);
131 	cpu_setbank( 1,&RAM[ 0x10000 + ( 0x4000 * ( data & 1 ) ) ] );
132 
133 	if (vball_gfxset != ((data  & 0x20) ^ 0x20)) {
134 		vball_gfxset = (data  & 0x20) ^ 0x20;
135 			vb_mark_all_dirty();
136 	}
137 	vb_scrolly_hi = (data & 0x40)<<2;
138 }
139 
140 /* The sound system comes all but verbatim from Double Dragon */
141 
142 
WRITE_HANDLER(cpu_sound_command_w)143 WRITE_HANDLER( cpu_sound_command_w ) {
144 	soundlatch_w( offset, data );
145 	cpu_set_irq_line( 1, IRQ_LINE_NMI, PULSE_LINE );
146 }
147 
148 
149 /* bit 0 = flip screen
150    bit 1 = scrollx hi
151    bit 2 = bg prom bank
152    bit 3 = bg prom bank
153    bit 4 = bg prom bank
154    bit 5 = sp prom bank
155    bit 6 = sp prom bank
156    bit 7 = sp prom bank
157 */
WRITE_HANDLER(vb_scrollx_hi_w)158 WRITE_HANDLER( vb_scrollx_hi_w )
159 {
160 	flip_screen_set(~data&1);
161 	vb_scrollx_hi = (data & 0x02) << 7;
162 	vb_bgprombank_w((data >> 2)&0x07);
163 	vb_spprombank_w((data >> 5)&0x07);
164 	/*logerror("%04x: vb_scrollx_hi = %d\n",activecpu_get_previouspc(), vb_scrollx_hi);*/
165 }
166 
MEMORY_READ_START(readmem)167 static MEMORY_READ_START( readmem )
168 	{ 0x0000, 0x0fff, MRA_RAM },
169 	{ 0x1000, 0x1000, input_port_0_r },
170 	{ 0x1001, 0x1001, input_port_1_r },
171 	{ 0x1002, 0x1002, input_port_2_r },
172 	{ 0x1003, 0x1003, input_port_3_r },
173 	{ 0x1004, 0x1004, input_port_4_r },
174 	{ 0x1005, 0x1005, input_port_5_r },
175 	{ 0x1006, 0x1006, input_port_6_r },
176 	{ 0x4000, 0x7fff, MRA_BANK1 },
177 	{ 0x8000, 0xffff, MRA_ROM },
178 MEMORY_END
179 
180 static MEMORY_READ_START( vball2pj_readmem )
181 	{ 0x0000, 0x0fff, MRA_RAM },
182 	{ 0x1000, 0x1000, input_port_0_r },
183 	{ 0x1001, 0x1001, input_port_1_r },
184 	{ 0x1002, 0x1002, input_port_2_r },
185 	{ 0x1003, 0x1003, input_port_3_r },
186 	{ 0x1004, 0x1004, input_port_4_r },
187 	{ 0x1005, 0x1005, MRA_RAM },		/*Strange, that these are read!*/
188 	{ 0x1006, 0x1006, MRA_RAM },		/*Strange, that these are read!*/
189 	{ 0x4000, 0x7fff, MRA_BANK1 },
190 	{ 0x8000, 0xffff, MRA_ROM },
191 MEMORY_END
192 
193 WRITE_HANDLER(vb_scrollx_lo_w)
194 {
195 	vb_scrollx_lo = data;
196 	/*logerror("%04x: vb_scrollx_lo =%d\n",activecpu_get_previouspc(), vb_scrollx_lo);*/
197 }
198 
199 /*Cheaters note: Scores are stored in ram @ 0x57-0x58 (though the space is used for other things between matches)*/
MEMORY_WRITE_START(writemem)200 static MEMORY_WRITE_START( writemem )
201 	{ 0x0000, 0x07ff, MWA_RAM },
202 	{ 0x0800, 0x08ff, MWA_RAM, &spriteram, &spriteram_size },
203 	{ 0x1008, 0x1008, vb_scrollx_hi_w },
204 	{ 0x1009, 0x1009, vb_bankswitch_w },
205 	{ 0x100a, 0x100a, MWA_RAM },
206 	{ 0x100b, 0x100b, MWA_RAM },		/*Counts from 0 to 7 continuously*/
207 	{ 0x100c, 0x100c, vb_scrollx_lo_w },
208 	{ 0x100d, 0x100d, cpu_sound_command_w },
209 	{ 0x100e, 0x100e, MWA_RAM, &vb_scrolly_lo },
210 	{ 0x2000, 0x2fff, vb_videoram_w, &vb_videoram },
211 	{ 0x3000, 0x3fff, vb_attrib_w, &vb_attribram },
212 	{ 0x4000, 0xffff, MWA_ROM },
213 MEMORY_END
214 
215 static MEMORY_READ_START( sound_readmem )
216 	{ 0x0000, 0x7fff, MRA_ROM },
217 	{ 0x8000, 0x87ff, MRA_RAM },
218 	{ 0x8801, 0x8801, YM2151_status_port_0_r },
219 	{ 0x9800, 0x9800, OKIM6295_status_0_r },
220 	{ 0xA000, 0xA000, soundlatch_r },
221 MEMORY_END
222 
223 static MEMORY_WRITE_START( sound_writemem )
224 	{ 0x0000, 0x7fff, MWA_ROM },
225 	{ 0x8000, 0x87ff, MWA_RAM },
226 	{ 0x8800, 0x8800, YM2151_register_port_0_w },
227 	{ 0x8801, 0x8801, YM2151_data_port_0_w },
228 	{ 0x9800, 0x9803, OKIM6295_data_0_w },
229 MEMORY_END
230 
231 #define COMMON_PORTS_BEFORE  PORT_START \
232 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER1 ) \
233 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER1 ) \
234 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER1 ) \
235 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER1 ) \
236 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER1 ) \
237 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER1 ) \
238 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) \
239 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) \
240 	PORT_START \
241 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER2 ) \
242 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER2 ) \
243 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER2 ) \
244 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER2 ) \
245 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 ) \
246 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 ) \
247 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) \
248 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 ) \
249 	PORT_START \
250 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) \
251 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) \
252 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) \
253 	PORT_BIT( 0x08, IP_ACTIVE_HIGH,IPT_VBLANK ) \
254 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) \
255 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) \
256 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) \
257 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) \
258 
259 #define COMMON_PORTS_COINS  PORT_START \
260 	PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A )) \
261 	PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C )) \
262 	PORT_DIPSETTING(    0x01, DEF_STR( 3C_1C )) \
263 	PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C )) \
264 	PORT_DIPSETTING(    0x07, DEF_STR( 1C_1C )) \
265 	PORT_DIPSETTING(    0x06, DEF_STR( 1C_2C )) \
266 	PORT_DIPSETTING(    0x05, DEF_STR( 1C_3C )) \
267 	PORT_DIPSETTING(    0x04, DEF_STR( 1C_4C )) \
268 	PORT_DIPSETTING(    0x03, DEF_STR( 1C_5C )) \
269 	PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coin_B )) \
270 	PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C )) \
271 	PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C )) \
272 	PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C )) \
273 	PORT_DIPSETTING(    0x38, DEF_STR( 1C_1C )) \
274 	PORT_DIPSETTING(    0x30, DEF_STR( 1C_2C )) \
275 	PORT_DIPSETTING(    0x28, DEF_STR( 1C_3C )) \
276 	PORT_DIPSETTING(    0x20, DEF_STR( 1C_4C )) \
277 	PORT_DIPSETTING(    0x18, DEF_STR( 1C_5C )) \
278 	PORT_DIPNAME( 0x40, 0x00, DEF_STR( Flip_Screen )) \
279 	PORT_DIPSETTING(    0x00, DEF_STR( Off )) \
280 	PORT_DIPSETTING(    0x40, DEF_STR( On )) \
281 	PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds )) \
282 	PORT_DIPSETTING(    0x00, DEF_STR( Off )) \
283 	PORT_DIPSETTING(    0x80, DEF_STR( On )) \
284 
285 INPUT_PORTS_START (vball)
286 	COMMON_PORTS_BEFORE
287 	/* The dipswitch instructions in naz's dump (vball) don't quite sync here) */
288 	/* Looks like the pins from the dips to the board were mixed up a little. */
289 
290 	PORT_START
291 	PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ))
292 /* I've adjusted these to what I think is correct from gameplay testing - SJE - 03/28/03*/
293 	PORT_DIPSETTING(    0x02, "Easy")
294 	PORT_DIPSETTING(    0x03, "Medium")
295 	PORT_DIPSETTING(    0x01, "Hard")
296 	PORT_DIPSETTING(    0x00, "Very Hard")
297 	PORT_DIPNAME( 0x0c, 0x00, "Single Player Game Time")
298 	PORT_DIPSETTING(    0x00, "1:15")
299 	PORT_DIPSETTING(    0x04, "1:30")
300 	PORT_DIPSETTING(    0x0c, "1:45")
301 	PORT_DIPSETTING(    0x08, "2:00")
302 	PORT_DIPNAME( 0x30, 0x00, "Start Buttons (4-player)")
303 	PORT_DIPSETTING(    0x00, "Normal")
304 	PORT_DIPSETTING(    0x20, "Button A")
305 	PORT_DIPSETTING(    0x10, "Button B")
306 	PORT_DIPSETTING(    0x30, "Normal")
307 	PORT_DIPNAME( 0x40, 0x40, "PL 1&4 (4-player)")
308 	PORT_DIPSETTING(    0x40, "Normal")
309 	PORT_DIPSETTING(    0x00, "Rot 90")
310 	PORT_DIPNAME( 0x80, 0x00, "Player Mode")
311 	PORT_DIPSETTING(    0x80, "2")
312 	PORT_DIPSETTING(    0x00, "4")
313 
314 	COMMON_PORTS_COINS
315 
316 	PORT_START
317 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER3 )
318 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER3 )
319 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER3 )
320 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER3 )
321 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER3 )
322 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER3 )
323 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
324 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START3 )
325 	PORT_START
326 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER4 )
327 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER4 )
328 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER4 )
329 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER4 )
330 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER4 )
331 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER4 )
332 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
333 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START4 )
334 INPUT_PORTS_END
335 
336 INPUT_PORTS_START (vball2pj)
337 	COMMON_PORTS_BEFORE
338 
339 /* The 2-player roms have the game-time in the difficulty spot, and
340    I've assumed vice-versa. (VS the instructions scanned in Naz's dump)
341 */
342 	PORT_START
343 	PORT_DIPNAME( 0x03, 0x00, "Single Player Game Time")
344 	PORT_DIPSETTING(    0x00, "1:30")
345 	PORT_DIPSETTING(    0x01, "1:45")
346 	PORT_DIPSETTING(    0x03, "2:00")
347 	PORT_DIPSETTING(    0x02, "2:15")
348 	PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ))
349 /* This ordering is assumed. Someone has to play it a lot and find out.*/
350 	PORT_DIPSETTING(    0x04, "Easy")
351 	PORT_DIPSETTING(    0x00, "Medium")
352 	PORT_DIPSETTING(    0x08, "Hard")
353 	PORT_DIPSETTING(    0x0c, "Very Hard")
354 	COMMON_PORTS_COINS
355 INPUT_PORTS_END
356 
357 
358 static struct GfxLayout charlayout =
359 {
360 	8,8,
361 	RGN_FRAC(1,1),
362 	4,
363 	{ 0, 2, 4, 6 },
364 	{ 0*8*8+1, 0*8*8+0, 1*8*8+1, 1*8*8+0, 2*8*8+1, 2*8*8+0, 3*8*8+1, 3*8*8+0 },
365 	{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
366 	32*8
367 };
368 
369 static struct GfxLayout spritelayout =
370 {
371 	16,16,
372 	RGN_FRAC(1,2),
373 	4,
374 	{ RGN_FRAC(1,2)+0, RGN_FRAC(1,2)+4, 0, 4 },
375 	{ 3, 2, 1, 0, 16*8+3, 16*8+2, 16*8+1, 16*8+0,
376 		  32*8+3, 32*8+2, 32*8+1, 32*8+0, 48*8+3, 48*8+2, 48*8+1, 48*8+0 },
377 	{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
378 		  8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
379 	64*8
380 };
381 
382 
383 static struct GfxDecodeInfo vb_gfxdecodeinfo[] =
384 {
385 	{ REGION_GFX1, 0, &charlayout,     0, 8 },	/* 8x8 chars */
386 	{ REGION_GFX2, 0, &spritelayout, 128, 8 },	/* 16x16 sprites */
387 	{ -1 } /* end of array */
388 };
389 
vball_irq_handler(int irq)390 static void vball_irq_handler(int irq)
391 {
392 	cpu_set_irq_line( 1, 0 , irq ? ASSERT_LINE : CLEAR_LINE );
393 }
394 
395 static struct YM2151interface ym2151_interface =
396 {
397 	1,			/* 1 chip */
398 	3579545,	/* 3579545 Hz */
399 	{ YM3012_VOL(60,MIXER_PAN_LEFT,60,MIXER_PAN_RIGHT) },
400 	{ vball_irq_handler }
401 };
402 
403 static struct OKIM6295interface okim6295_interface =
404 {
405 	1,              /* 1 chip */
406 	{ 1056000/132 },           /* frequency (Hz) */
407 	{ REGION_SOUND1 },  /* memory region */
408 	{ 100 }
409 };
410 
411 static MACHINE_DRIVER_START( vball )
412 
413 	/* basic machine hardware */
414  	MDRV_CPU_ADD(M6502, 2000000)	/* 2 MHz - measured by guru but it makes the game far far too slow ?! */
415 	MDRV_CPU_MEMORY(readmem,writemem)
416 	MDRV_CPU_VBLANK_INT(vball_interrupt,32)	/* ??1 IRQ every 8 visible scanlines, plus NMI for vblank?? */
417 
418 	MDRV_CPU_ADD(Z80, 3579545)
419 	MDRV_CPU_FLAGS(CPU_AUDIO_CPU)	/* 3.579545 MHz */
420 	MDRV_CPU_MEMORY(sound_readmem,sound_writemem)
421 
422 	MDRV_FRAMES_PER_SECOND(60)
423 	MDRV_VBLANK_DURATION(DEFAULT_REAL_60HZ_VBLANK_DURATION)
424 
425 	/* video hardware */
426 	MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
427 	MDRV_SCREEN_SIZE(32*8, 32*8)
428 	MDRV_VISIBLE_AREA(1*8, 31*8-1, 1*8, 31*8-1)	/* 240 x 240 */
429 	MDRV_GFXDECODE(vb_gfxdecodeinfo)
430 	MDRV_PALETTE_LENGTH(256)
431 
432 	MDRV_VIDEO_START(vb)
433 	MDRV_VIDEO_UPDATE(vb)
434 
435 	/* sound hardware */
436 	MDRV_SOUND_ATTRIBUTES(SOUND_SUPPORTS_STEREO)
437 	MDRV_SOUND_ADD(YM2151, ym2151_interface)
438 	MDRV_SOUND_ADD(OKIM6295, okim6295_interface)
439 MACHINE_DRIVER_END
440 
441 static MACHINE_DRIVER_START( vball2pj )
442 
443 	/* basic machine hardware */
444  	MDRV_CPU_ADD(M6502, 2000000)	/* 2.0 MHz */
445 	MDRV_CPU_MEMORY(vball2pj_readmem,writemem)
446 	MDRV_CPU_VBLANK_INT(vball_interrupt,32)	/* ??1 IRQ every 8 visible scanlines, plus NMI for vblank?? */
447 
448 	MDRV_CPU_ADD(Z80, 3579545)
449 	MDRV_CPU_FLAGS(CPU_AUDIO_CPU)	/* 3.579545 MHz */
450 	MDRV_CPU_MEMORY(sound_readmem,sound_writemem)
451 
452 	MDRV_FRAMES_PER_SECOND(60)
453 	MDRV_VBLANK_DURATION(DEFAULT_REAL_60HZ_VBLANK_DURATION)
454 
455 	/* video hardware */
456 	MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
457 	MDRV_SCREEN_SIZE(32*8, 32*8)
458 	MDRV_VISIBLE_AREA(1*8, 31*8-1, 1*8, 31*8-1)	/* 240 x 240 */
459 	MDRV_GFXDECODE(vb_gfxdecodeinfo)
460 	MDRV_PALETTE_LENGTH(256)
461 
462 	MDRV_VIDEO_START(vb)
463 	MDRV_VIDEO_UPDATE(vb)
464 
465 	/* sound hardware */
466 	MDRV_SOUND_ATTRIBUTES(SOUND_SUPPORTS_STEREO)
467 	MDRV_SOUND_ADD(YM2151, ym2151_interface)
468 	MDRV_SOUND_ADD(OKIM6295, okim6295_interface)
469 MACHINE_DRIVER_END
470 
471 
472 /***************************************************************************
473 
474   Game driver(s)
475 
476 ***************************************************************************/
477 
478 ROM_START( vball )
479 	ROM_REGION( 0x18000, REGION_CPU1, 0 )	/* Main CPU: 64k for code */
480 	ROM_LOAD( "vball.124",  0x10000, 0x08000, CRC(be04c2b5) SHA1(40fed4ae272719e940f1796ef35420ab451ab7b6) )/* Bankswitched */
481 	ROM_CONTINUE(		0x08000, 0x08000 )		 /* Static code  */
482 
483 	ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* region#2: music CPU, 64kb */
484 	ROM_LOAD( "vball.47",  0x00000, 0x8000,  CRC(10ca79ad) SHA1(aad4a09d6745ca0b5665cb00ff7a4e08ea434068) )
485 
486 	/* These are from the bootleg; the original has the image data stored in a special dip rom */
487 	ROM_REGION(0x80000, REGION_GFX1, ROMREGION_DISPOSE )	 /* fg tiles */
488 	ROM_LOAD( "vball13.bin",  0x00000, 0x10000, CRC(f26df8e1) SHA1(72186c1430d07c7fd9211245b539f05a0660bebe) ) /* 0,1,2,3 */
489 	ROM_LOAD( "vball14.bin",  0x10000, 0x10000, CRC(c9798d0e) SHA1(ec156f6c7ecccaa216ce8076f75ad7627ee90945) ) /* 0,1,2,3 */
490 	ROM_LOAD( "vball15.bin",  0x20000, 0x10000, CRC(68e69c4b) SHA1(9870674c91cab7215ad8ed40eb82facdee478fde) ) /* 0,1,2,3 */
491 	ROM_LOAD( "vball16.bin",  0x30000, 0x10000, CRC(936457ba) SHA1(1662bbd777fcd33a298d192a3f06681809b9d049) ) /* 0,1,2,3 */
492 	ROM_LOAD( "vball09.bin",  0x40000, 0x10000, CRC(42874924) SHA1(a75eed7934e089f035000b7f35f6ba8dd96f1e98) ) /* 0,1,2,3 */
493 	ROM_LOAD( "vball10.bin",  0x50000, 0x10000, CRC(6cc676ee) SHA1(6e8c590946211baa9266b19b871f252829057696) ) /* 0,1,2,3 */
494 	ROM_LOAD( "vball11.bin",  0x60000, 0x10000, CRC(4754b303) SHA1(8630f077b542590ef1340a2f0a6b94086ff91c40) ) /* 0,1,2,3 */
495 	ROM_LOAD( "vball12.bin",  0x70000, 0x10000, CRC(21294a84) SHA1(b36ea9ddf6879443d3104241997fa0f916856528) ) /* 0,1,2,3 */
496 
497 	ROM_REGION(0x40000, REGION_GFX2, ROMREGION_DISPOSE )	 /* sprites */
498 	ROM_LOAD( "vball.35",  0x00000, 0x20000, CRC(877826d8) SHA1(fd77298f9343051f66259dad9127f40afb95f385) ) /* 0,1,2,3 */
499 	ROM_LOAD( "vball.5",   0x20000, 0x20000, CRC(c6afb4fa) SHA1(6d7c966300ce5fb2094476b393434486965d62b4) ) /* 0,1,2,3 */
500 
501 	ROM_REGION(0x20000, REGION_SOUND1, 0 ) /* Sound region#1: adpcm */
502 	ROM_LOAD( "vball.78a",  0x00000, 0x10000, CRC(f3e63b76) SHA1(da54d1d7d7d55b73e49991e4363bc6f46e0f70eb) )
503 	ROM_LOAD( "vball.78b",  0x10000, 0x10000, CRC(7ad9d338) SHA1(3e3c270fa69bda93b03f07a54145eb5e211ec8ba) )
504 
505 	ROM_REGION(0x1000, REGION_PROMS, 0 )	/* color PROMs */
506 	ROM_LOAD_NIB_LOW ( "vball.44",   0x0000, 0x00800, CRC(a317240f) SHA1(bd57ad516f7a8ff774276fd26b02dd34659d41ad) )
507 	ROM_LOAD_NIB_HIGH( "vball.43",   0x0000, 0x00800, CRC(1ff70b4f) SHA1(a469baa0dda844ba307c09ddefb23f239cfe7b5f) )
508 	ROM_LOAD( "vball.160",  0x0800, 0x00800, CRC(2ffb68b3) SHA1(d560fdcd5e5c79d37e5b5bde22fbaf662fe89252) )
509 ROM_END
510 
511 ROM_START( vball2pj )
512 	ROM_REGION( 0x18000, REGION_CPU1, 0 )	/* Main CPU */
513 	ROM_LOAD( "25j2-2-5.124",  0x10000, 0x08000,  CRC(432509c4) SHA1(6de50e21d279f4ac9674bc91990ba9535e80908c) )/* Bankswitched */
514 	ROM_CONTINUE(		  0x08000, 0x08000 )		 /* Static code  */
515 
516 	ROM_REGION( 0x10000, REGION_CPU2, 0 ) /* region#2: music CPU, 64kb */
517 	ROM_LOAD( "25j1-0.47",  0x00000, 0x8000,  CRC(10ca79ad) SHA1(aad4a09d6745ca0b5665cb00ff7a4e08ea434068) )
518 /*ROM_LOAD( "vball04.bin",  0x00000, 0x8000,  CRC(534dfbd9) SHA1(d0cb37caf94fa85da4ebdfe15e7a78109084bf91) )*/
519 
520    /* the original has the image data stored in a special ceramic embedded package made by Toshiba
521      with part number 'TOSHIBA TRJ-101' (which has been dumped using a custom made adapter)
522      there are a few bytes different between the bootleg and the original (the original is correct though!) */
523     ROM_REGION(0x80000, REGION_GFX1, ROMREGION_DISPOSE ) /* fg tiles */
524     ROM_LOAD( "trj-101.96",  0x00000, 0x80000, CRC(f343eee4) SHA1(1ce95285631f7ec91fe3f6c3d62b13f565d3816a) )
525 
526 	ROM_REGION(0x40000, REGION_GFX2, ROMREGION_DISPOSE )	 /* sprites */
527 	ROM_LOAD( "25j4-0.35",  0x00000, 0x20000, CRC(877826d8) SHA1(fd77298f9343051f66259dad9127f40afb95f385) ) /* 0,1,2,3 */
528 	ROM_LOAD( "25j3-0.5",   0x20000, 0x20000, CRC(c6afb4fa) SHA1(6d7c966300ce5fb2094476b393434486965d62b4) ) /* 0,1,2,3 */
529 
530 	ROM_REGION(0x20000, REGION_SOUND1, 0 ) /* Sound region#1: adpcm */
531 	ROM_LOAD( "25j0-0.78",  0x00000, 0x20000, CRC(8e04bdbf) SHA1(baafc5033c9442b83cb332c2c453c13117b31a3b) )
532 
533 	ROM_REGION(0x1000, REGION_PROMS, 0 )	/* color PROMs */
534 	ROM_LOAD_NIB_LOW ( "vball.44",   0x0000, 0x00800, CRC(a317240f) SHA1(bd57ad516f7a8ff774276fd26b02dd34659d41ad) )
535 	ROM_LOAD_NIB_HIGH( "vball.43",   0x0000, 0x00800, CRC(1ff70b4f) SHA1(a469baa0dda844ba307c09ddefb23f239cfe7b5f) )
536 	ROM_LOAD( "vball.160",  0x0800, 0x00800, CRC(2ffb68b3) SHA1(d560fdcd5e5c79d37e5b5bde22fbaf662fe89252) )
537 ROM_END
538 
539 
540 GAME( 1988, vball,    0,     vball,    vball,    0, ROT0, "Technos", "U.S. Championship V'ball (set 1)" )
541 GAME( 1988, vball2pj, vball, vball2pj, vball2pj, 0, ROT0, "Technos", "U.S. Championship V'ball (Japan)" )
542