1 /***************************************************************************
2 
3 King of Boxer - (c) 1985 Woodplace Inc.
4 Ring King - (c) 1985 Data East USA Inc.
5 
6 Preliminary driver by:
7 Ernesto Corvi
8 ernesto@imagina.com
9 
10 Notes:
11 -----
12 Main CPU:
13 - Theres a memory area from 0xf000 to 0xf7ff, which is clearly
14   initialized at startup and never used anymore.
15 
16 ***************************************************************************/
17 
18 #include "driver.h"
19 #include "vidhrdw/generic.h"
20 
21 /* from vidhrdw */
22 extern UINT8 *kingofb_videoram2;
23 extern UINT8 *kingofb_colorram2;
24 extern UINT8 *kingofb_scroll_y;
25 
26 extern WRITE_HANDLER( kingofb_videoram_w );
27 extern WRITE_HANDLER( kingofb_colorram_w );
28 extern WRITE_HANDLER( kingofb_videoram2_w );
29 extern WRITE_HANDLER( kingofb_colorram2_w );
30 
31 extern WRITE_HANDLER( kingofb_f800_w );
32 
33 extern PALETTE_INIT( kingofb );
34 extern VIDEO_START( kingofb );
35 extern VIDEO_UPDATE( kingofb );
36 
37 extern PALETTE_INIT( ringking );
38 extern VIDEO_START( ringking );
39 extern VIDEO_UPDATE( ringking );
40 
41 static UINT8 *video_shared;
42 static UINT8 *sprite_shared;
43 int kingofb_nmi_enable = 0;
44 
READ_HANDLER(video_shared_r)45 static READ_HANDLER( video_shared_r ) {
46 	return video_shared[offset];
47 }
48 
WRITE_HANDLER(video_shared_w)49 static WRITE_HANDLER( video_shared_w ) {
50 	video_shared[offset] = data;
51 }
52 
READ_HANDLER(sprite_shared_r)53 static READ_HANDLER( sprite_shared_r ) {
54 	return sprite_shared[offset];
55 }
56 
WRITE_HANDLER(sprite_shared_w)57 static WRITE_HANDLER( sprite_shared_w ) {
58 	sprite_shared[offset] = data;
59 }
60 
WRITE_HANDLER(video_interrupt_w)61 static WRITE_HANDLER( video_interrupt_w ) {
62 	cpu_set_irq_line_and_vector( 1, 0, HOLD_LINE, 0xff );
63 }
64 
WRITE_HANDLER(sprite_interrupt_w)65 static WRITE_HANDLER( sprite_interrupt_w ) {
66 	cpu_set_irq_line_and_vector( 2, 0, HOLD_LINE, 0xff );
67 }
68 
WRITE_HANDLER(scroll_interrupt_w)69 static WRITE_HANDLER( scroll_interrupt_w ) {
70 	sprite_interrupt_w( offset, data );
71 	*kingofb_scroll_y = data;
72 }
73 
WRITE_HANDLER(sound_command_w)74 static WRITE_HANDLER( sound_command_w ) {
75 	soundlatch_w( 0, data );
76 	cpu_set_irq_line_and_vector( 3, 0, HOLD_LINE, 0xff );
77 }
78 
79 
MEMORY_READ_START(main_readmem)80 static MEMORY_READ_START( main_readmem )
81     { 0x0000, 0x7fff, MRA_ROM },
82     { 0xc000, 0xc3ff, MRA_RAM }, /* work ram */
83     { 0xe000, 0xe7ff, sprite_shared_r },
84     { 0xe800, 0xefff, video_shared_r },
85     { 0xf000, 0xf7ff, MRA_RAM }, /* ???? */
86     { 0xfc00, 0xfc00, input_port_0_r }, /* DSW 0 */
87     { 0xfc01, 0xfc01, input_port_1_r }, /* DSW 1 */
88     { 0xfc02, 0xfc02, input_port_2_r }, /* Player 1 controls */
89     { 0xfc03, 0xfc03, input_port_3_r }, /* Player 2 controls */
90     { 0xfc04, 0xfc04, input_port_4_r }, /* Coin & Start */
91     { 0xfc05, 0xfc05, input_port_5_r }, /* Player 1 & 2 button 3 */
92 MEMORY_END
93 
94 static MEMORY_WRITE_START( main_writemem )
95     { 0x0000, 0x7fff, MWA_ROM },
96     { 0xc000, 0xc3ff, MWA_RAM }, /* work ram */
97     { 0xe000, 0xe7ff, sprite_shared_w }, /* shared with sprite cpu */
98     { 0xe800, 0xefff, video_shared_w }, /* shared with video cpu */
99     { 0xf000, 0xf7ff, MWA_RAM }, /* ???? */
100     { 0xf800, 0xf800, kingofb_f800_w },	/* NMI enable, palette bank */
101     { 0xf801, 0xf801, MWA_NOP }, /* ???? */
102     { 0xf802, 0xf802, MWA_RAM, &kingofb_scroll_y },
103     { 0xf803, 0xf803, scroll_interrupt_w  },
104     { 0xf804, 0xf804, video_interrupt_w },
105     { 0xf807, 0xf807, sound_command_w }, /* sound latch */
106 MEMORY_END
107 
108 static MEMORY_READ_START( video_readmem )
109     { 0x0000, 0x3fff, MRA_ROM },
110     { 0x8000, 0x87ff, MRA_RAM }, /* work ram */
111     { 0xa000, 0xa7ff, video_shared_r }, /* shared with main */
112     { 0xc000, 0xc0ff, videoram_r }, /* background vram */
113     { 0xc400, 0xc4ff, colorram_r }, /* background colorram */
114     { 0xc800, 0xcbff, MRA_RAM }, /* foreground vram */
115     { 0xcc00, 0xcfff, MRA_RAM }, /* foreground colorram */
116 MEMORY_END
117 
118 static MEMORY_WRITE_START( video_writemem )
119     { 0x0000, 0x3fff, MWA_ROM },
120     { 0x8000, 0x87ff, MWA_RAM }, /* work ram */
121     { 0xa000, 0xa7ff, video_shared_w, &video_shared }, /* shared with main */
122     { 0xc000, 0xc0ff, kingofb_videoram_w, &videoram }, /* background vram */
123     { 0xc400, 0xc4ff, kingofb_colorram_w, &colorram }, /* background colorram */
124     { 0xc800, 0xcbff, kingofb_videoram2_w, &kingofb_videoram2 }, /* foreground vram */
125     { 0xcc00, 0xcfff, kingofb_colorram2_w, &kingofb_colorram2 }, /* foreground colorram */
126 MEMORY_END
127 
128 static MEMORY_READ_START( sprite_readmem )
129     { 0x0000, 0x1fff, MRA_ROM },
130     { 0x8000, 0x87ff, MRA_RAM }, /* work ram */
131     { 0xa000, 0xa7ff, sprite_shared_r }, /* shared with main */
132     { 0xc000, 0xc3ff, spriteram_r }, /* sprite ram */
133     { 0xc400, 0xc43f, MRA_RAM }, /* something related to scroll? */
134 MEMORY_END
135 
136 static MEMORY_WRITE_START( sprite_writemem )
137     { 0x0000, 0x1fff, MWA_ROM },
138     { 0x8000, 0x87ff, MWA_RAM }, /* work ram */
139     { 0xa000, 0xa7ff, sprite_shared_w, &sprite_shared }, /* shared with main */
140     { 0xc000, 0xc3ff, spriteram_w, &spriteram, &spriteram_size }, /* sprite ram */
141     { 0xc400, 0xc43f, MWA_RAM },  /* something related to scroll? */
142 MEMORY_END
143 
144 static MEMORY_READ_START( sound_readmem )
145     { 0x0000, 0xbfff, MRA_ROM },
146     { 0xc000, 0xc3ff, MRA_RAM }, /* work ram */
147 MEMORY_END
148 
149 static MEMORY_WRITE_START( sound_writemem )
150     { 0x8000, 0x8000, MWA_NOP }, /* ??? */
151     { 0x0000, 0xbfff, MWA_ROM },
152     { 0xc000, 0xc3ff, MWA_RAM }, /* work ram */
153 MEMORY_END
154 
155 static PORT_READ_START( sound_readport )
156 	{ 0x08, 0x08, AY8910_read_port_0_r },
157 PORT_END
158 
159 static PORT_WRITE_START( sound_writeport )
160 	{ 0x00, 0x00, DAC_0_data_w },
161 	{ 0x08, 0x08, AY8910_write_port_0_w },
162 	{ 0x0c, 0x0c, AY8910_control_port_0_w },
163 PORT_END
164 
165 /* Ring King */
166 static MEMORY_READ_START( rk_main_readmem )
167     { 0x0000, 0xbfff, MRA_ROM },
168     { 0xc000, 0xc3ff, MRA_RAM }, /* work ram */
169     { 0xc800, 0xcfff, sprite_shared_r },
170     { 0xd000, 0xd7ff, video_shared_r },
171     { 0xe000, 0xe000, input_port_0_r }, /* DSW 0 */
172     { 0xe001, 0xe001, input_port_1_r }, /* DSW 1 */
173     { 0xe002, 0xe002, input_port_2_r }, /* Player 1 controls */
174     { 0xe003, 0xe003, input_port_3_r }, /* Player 2 controls */
175     { 0xe004, 0xe004, input_port_4_r }, /* Coin & Start */
176     { 0xe005, 0xe005, input_port_5_r }, /* Player 1 & 2 button 3 */
177     { 0xf000, 0xf7ff, MRA_RAM }, /* ???? */
178 MEMORY_END
179 
180 static MEMORY_WRITE_START( rk_main_writemem )
181     { 0x0000, 0xbfff, MWA_ROM },
182     { 0xc000, 0xc3ff, MWA_RAM }, /* work ram */
183     { 0xc800, 0xcfff, sprite_shared_w },
184     { 0xd000, 0xd7ff, video_shared_w },
185     { 0xd800, 0xd800, kingofb_f800_w },
186     { 0xd801, 0xd801, sprite_interrupt_w },
187     { 0xd802, 0xd802, video_interrupt_w },
188     { 0xd803, 0xd803, sound_command_w },
189     { 0xe800, 0xe800, MWA_RAM, &kingofb_scroll_y },
190     { 0xf000, 0xf7ff, MWA_RAM }, /* ???? */
191 MEMORY_END
192 
193 static MEMORY_READ_START( rk_video_readmem )
194     { 0x0000, 0x3fff, MRA_ROM },
195     { 0x8000, 0x87ff, MRA_RAM }, /* work ram */
196     { 0xc000, 0xc7ff, video_shared_r }, /* shared with main */
197     { 0xa800, 0xa8ff, videoram_r }, /* background vram */
198     { 0xac00, 0xacff, colorram_r }, /* background colorram */
199     { 0xa000, 0xa3ff, MRA_RAM }, /* foreground vram */
200     { 0xa400, 0xa7ff, MRA_RAM }, /* foreground colorram */
201 MEMORY_END
202 
203 static MEMORY_WRITE_START( rk_video_writemem )
204     { 0x0000, 0x3fff, MWA_ROM },
205     { 0x8000, 0x87ff, MWA_RAM }, /* work ram */
206     { 0xc000, 0xc7ff, video_shared_w, &video_shared }, /* shared with main */
207     { 0xa800, 0xa8ff, kingofb_videoram_w, &videoram }, /* background vram */
208     { 0xac00, 0xacff, kingofb_colorram_w, &colorram }, /* background colorram */
209     { 0xa000, 0xa3ff, kingofb_videoram2_w, &kingofb_videoram2 }, /* foreground vram */
210     { 0xa400, 0xa7ff, kingofb_colorram2_w, &kingofb_colorram2 }, /* foreground colorram */
211 MEMORY_END
212 
213 static MEMORY_READ_START( rk_sprite_readmem )
214     { 0x0000, 0x1fff, MRA_ROM },
215     { 0x8000, 0x87ff, MRA_RAM }, /* work ram */
216     { 0xc800, 0xcfff, sprite_shared_r }, /* shared with main */
217     { 0xa000, 0xa3ff, spriteram_r }, /* sprite ram */
218     { 0xa400, 0xa43f, MRA_RAM }, /* something related to scroll? */
219 MEMORY_END
220 
221 static MEMORY_WRITE_START( rk_sprite_writemem )
222     { 0x0000, 0x1fff, MWA_ROM },
223     { 0x8000, 0x87ff, MWA_RAM }, /* work ram */
224     { 0xc800, 0xcfff, sprite_shared_w, &sprite_shared }, /* shared with main */
225     { 0xa000, 0xa3ff, spriteram_w, &spriteram, &spriteram_size }, /* sprite ram */
226     { 0xa400, 0xa43f, MWA_RAM },  /* something related to scroll? */
227 MEMORY_END
228 
229 static PORT_READ_START( rk_sound_readport )
230 	{ 0x02, 0x02, AY8910_read_port_0_r },
231 PORT_END
232 
233 static PORT_WRITE_START( rk_sound_writeport )
234 	{ 0x00, 0x00, DAC_0_data_w },
235 	{ 0x02, 0x02, AY8910_write_port_0_w },
236 	{ 0x03, 0x03, AY8910_control_port_0_w },
237 PORT_END
238 
239 INPUT_PORTS_START( kingofb )
240     PORT_START /* DSW0 - 0xfc01 */
241     PORT_DIPNAME( 0x03, 0x01, "Rest Up Points" )
242     PORT_DIPSETTING(    0x02, "70000" )
243     PORT_DIPSETTING(    0x01, "100000" )
244     PORT_DIPSETTING(    0x03, "150000" )
245     PORT_DIPSETTING(    0x00, DEF_STR( No ) )
246     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Demo_Sounds ) )
247     PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
248     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
249     PORT_DIPNAME( 0x18, 0x00, DEF_STR( Difficulty ) )
250     PORT_DIPSETTING(    0x00, "Easy" )
251     PORT_DIPSETTING(    0x08, "Medium" )
252     PORT_DIPSETTING(    0x10, "Hard" )
253     PORT_DIPSETTING(    0x18, "Hardest" )
254 	PORT_DIPNAME( 0x20, 0x20, DEF_STR( Cabinet ) )
255     PORT_DIPSETTING(    0x20, DEF_STR( Upright ) )
256     PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
257     PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
258     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
259     PORT_DIPSETTING(    0x40, DEF_STR( On ) )
260 	PORT_SERVICE( 0x80, IP_ACTIVE_HIGH )
261 
262     PORT_START /* DSW1 - 0xfc01 */
263     PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) )
264     PORT_DIPSETTING(    0x07, DEF_STR( 4C_1C ) )
265     PORT_DIPSETTING(    0x06, DEF_STR( 3C_1C ) )
266     PORT_DIPSETTING(    0x05, DEF_STR( 2C_1C ) )
267     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
268     PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
269     PORT_DIPSETTING(    0x02, DEF_STR( 1C_3C ) )
270     PORT_DIPSETTING(    0x03, DEF_STR( 1C_4C ) )
271     PORT_DIPSETTING(    0x04, DEF_STR( 1C_5C ) )
272     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
273     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
274     PORT_DIPSETTING(    0x08, DEF_STR( On ) )
275     PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
276     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
277     PORT_DIPSETTING(    0x10, DEF_STR( On ) )
278     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
279     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
280     PORT_DIPSETTING(    0x20, DEF_STR( On ) )
281     PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
282     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
283     PORT_DIPSETTING(    0x40, DEF_STR( On ) )
284     PORT_DIPNAME( 0x80, 0x00, "Freeze" )
285     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
286     PORT_DIPSETTING(    0x80, DEF_STR( On ) )
287 
288     PORT_START /* IN 0 - 0xfc02 */
289 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
290 	PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )
291 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
292 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
293 	PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
294 	PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 )
295 	PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
296 	PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
297 
298     PORT_START /* IN 1 - 0xfc03 */
299 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP | IPF_COCKTAIL )
300 	PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN | IPF_COCKTAIL )
301 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_COCKTAIL )
302 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT | IPF_COCKTAIL )
303 	PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_COCKTAIL )
304 	PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 | IPF_COCKTAIL )
305 	PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
306 	PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
307 
308 	PORT_START /* IN 2 - 0xfc04 */
309 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
310 	PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
311 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
312 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START2 )
313 	PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
314 	PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
315 	PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
316 	PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
317 
318     PORT_START /* IN 3 - 0xfc05 */
319 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON3 )
320 	PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON3 | IPF_COCKTAIL )
321 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
322 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
323 	PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
324 	PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
325 	PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
326 	PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
327 INPUT_PORTS_END
328 
329 /* Ring King */
330 INPUT_PORTS_START( ringking )
331     PORT_START /* DSW0 - 0xe000 */
332     PORT_DIPNAME( 0x03, 0x03, "Replay" )
333     PORT_DIPSETTING(    0x01, "70000" )
334     PORT_DIPSETTING(    0x02, "100000" )
335     PORT_DIPSETTING(    0x00, "150000" )
336     PORT_DIPSETTING(    0x03, DEF_STR( No ) )
337     PORT_DIPNAME( 0x04, 0x04, DEF_STR( Demo_Sounds ) )
338     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
339     PORT_DIPSETTING(    0x04, DEF_STR( On ) )
340     PORT_DIPNAME( 0x18, 0x10, "Difficulty (2P)" )
341     PORT_DIPSETTING(    0x18, "Easy" )
342     PORT_DIPSETTING(    0x10, "Medium" )
343     PORT_DIPSETTING(    0x08, "Hard" )
344     PORT_DIPSETTING(    0x00, "Hardest" )
345 	PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
346     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
347     PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
348     PORT_BIT(			0x40, IP_ACTIVE_LOW, IPT_UNUSED )
349 	PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
350 
351     PORT_START /* DSW1 - 0xe001 */
352     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )
353     PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
354     PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
355     PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
356     PORT_DIPSETTING(    0x01, DEF_STR( 1C_3C ) )
357     PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_B ) )
358     PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
359     PORT_DIPSETTING(    0x0c, DEF_STR( 1C_1C ) )
360     PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )
361     PORT_DIPSETTING(    0x04, DEF_STR( 1C_3C ) )
362     PORT_DIPNAME( 0x30, 0x10, "Difficulty (1P)" )
363     PORT_DIPSETTING(    0x30, "Easy" )
364     PORT_DIPSETTING(    0x10, "Medium" )
365     PORT_DIPSETTING(    0x20, "Hard" )
366     PORT_DIPSETTING(    0x00, "Hardest" )
367     PORT_DIPNAME( 0x40, 0x40, "Boxing Match" )
368     PORT_DIPSETTING(    0x40, "2 Win, End" )
369     PORT_DIPSETTING(    0x00, "1 Win, End" )
370     PORT_DIPNAME( 0x80, 0x80, "Freeze" )
371     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
372     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
373 
374     PORT_START /* IN 0 - 0xe002 */
375 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
376 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
377 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
378 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
379 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
380 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
381 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
382 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
383 
384     PORT_START /* IN 1 - 0xe003 */
385 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_COCKTAIL )
386 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_COCKTAIL )
387 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_COCKTAIL )
388 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_COCKTAIL )
389 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
390 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_COCKTAIL )
391 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
392 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
393 
394 	PORT_START /* IN 2 - 0xe004 */
395 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
396 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )
397 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
398 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 )
399 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* Sound busy??? */
400 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_VBLANK )
401 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
402 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
403 
404     PORT_START /* IN 3 - 0xfc05 */
405 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 )
406 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_COCKTAIL )
407 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
408 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 )
409 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
410 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
411 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
412 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
413 INPUT_PORTS_END
414 
415 
416 
417 static struct GfxLayout charlayout =
418 {
419 	8,8,    /* 8*8 characters */
420 	512,   /* 1024 characters */
421 	1,      /* 1 bits per pixel */
422 	{ 0 },     /* only 1 plane */
423 	{ 0, 1, 2, 3, 4, 5, 6, 7 },
424 	{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
425 	8*8     /* every char takes 8 consecutive bytes */
426 };
427 
428 static struct GfxLayout spritelayout =
429 {
430 	16,16,	/* 16*16 chars */
431 	1024, 	/* 1024 characters */
432 	3,		/* bits per pixel */
433 	{ 2*0x4000*8, 1*0x4000*8, 0*0x4000*8 },
434 	{ 3*0x4000*8+0,3*0x4000*8+1,3*0x4000*8+2,3*0x4000*8+3,
435 			3*0x4000*8+4,3*0x4000*8+5,3*0x4000*8+6,3*0x4000*8+7,
436 			0, 1, 2, 3, 4, 5, 6, 7 },
437 	{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
438 			8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
439 	16*8
440 };
441 
442 static struct GfxLayout tilelayout =
443 {
444 	16,16,	/* 16*16 chars */
445 	512,	/* 512 characters */
446 	3,		/* bits per pixel */
447 	{ 2*0x2000*8, 1*0x2000*8, 0*0x2000*8 },
448 	{ 3*0x2000*8+0,3*0x2000*8+1,3*0x2000*8+2,3*0x2000*8+3,
449 			3*0x2000*8+4,3*0x2000*8+5,3*0x2000*8+6,3*0x2000*8+7,
450 			0, 1, 2, 3, 4, 5, 6, 7 },
451 	{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
452 			8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
453 	16*8
454 };
455 
456 static struct GfxDecodeInfo gfxdecodeinfo[] =
457 {
458 	{ REGION_GFX1, 0x00000, &charlayout,   256,  8 },	/* characters */
459 	{ REGION_GFX1, 0x01000, &charlayout,   256,  8 },	/* characters */
460 	{ REGION_GFX2, 0x00000, &spritelayout,   0, 32 },	/* sprites */
461 	{ REGION_GFX3, 0x00000, &tilelayout,     0, 32 },	/* bg tiles */
462 	{ -1 } /* end of array */
463 };
464 
465 /* Ring King */
466 static struct GfxLayout rk_charlayout1 =
467 {
468 	8,8,    /* 8*8 characters */
469 	512,   /* 1024 characters */
470 	1,      /* 1 bits per pixel */
471 	{ 0 },     /* only 1 plane */
472 	{ 7, 6, 5, 4, (0x1000*8)+7, (0x1000*8)+6, (0x1000*8)+5, (0x1000*8)+4 },
473 	{ 7*8, 6*8, 5*8, 4*8, 3*8, 2*8, 1*8, 0*8 },
474 	8*8     /* every char takes 8 consecutive bytes */
475 };
476 
477 static struct GfxLayout rk_charlayout2 =
478 {
479 	8,8,    /* 8*8 characters */
480 	512,   /* 1024 characters */
481 	1,      /* 1 bits per pixel */
482 	{ 0 },     /* only 1 plane */
483 	{ 3, 2, 1, 0, (0x1000*8)+3, (0x1000*8)+2, (0x1000*8)+1, (0x1000*8)+0 },
484 	{ 7*8, 6*8, 5*8, 4*8, 3*8, 2*8, 1*8, 0*8 },
485 	8*8     /* every char takes 8 consecutive bytes */
486 };
487 
488 static struct GfxLayout rk_spritelayout =
489 {
490 	16,16,	/* 16*16 chars */
491 	1024, 	/* 1024 characters */
492 	3,		/* bits per pixel */
493 	{ 0*0x8000*8, 1*0x8000*8, 2*0x8000*8 },
494 	{ 7, 6, 5, 4, 3, 2, 1, 0,
495 		16*8+7, 16*8+6, 16*8+5, 16*8+4, 16*8+3, 16*8+2, 16*8+1, 16*8+0 },
496 	{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
497 			8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
498 	32*8
499 };
500 
501 static struct GfxLayout rk_tilelayout =
502 {
503 	16,16,	/* 16*16 chars */
504 	512, 	/* 1024 characters */
505 	3,		/* bits per pixel */
506 	{ 0*0x4000*8, 1*0x4000*8, 2*0x4000*8 },
507 	{ 7, 6, 5, 4, 3, 2, 1, 0,
508 		16*8+7, 16*8+6, 16*8+5, 16*8+4, 16*8+3, 16*8+2, 16*8+1, 16*8+0 },
509 	{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
510 			8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
511 	32*8
512 };
513 
514 static struct GfxLayout rk_bglayout =
515 {
516 	16,16,	/* 16*16 chars */
517 	256, 	/* 1024 characters */
518 	3,		/* bits per pixel */
519 	{ 0x4000*8+4, 0, 4 },
520 	{ 16*8+3, 16*8+2, 16*8+1, 16*8+0, 0x2000*8+3, 0x2000*8+2, 0x2000*8+1, 0x2000*8+0,
521 		3, 2, 1, 0, 0x2010*8+3, 0x2010*8+2, 0x2010*8+1, 0x2010*8+0 },
522 	{ 15*8, 14*8, 13*8, 12*8, 11*8, 10*8, 9*8, 8*8,
523 			7*8, 6*8, 5*8, 4*8, 3*8, 2*8, 1*8, 0*8 },
524 	32*8
525 };
526 
527 
528 static struct GfxDecodeInfo rk_gfxdecodeinfo[] =
529 {
530 	{ REGION_GFX1, 0x00000, &rk_charlayout1,  256,  8 },	/* characters */
531 	{ REGION_GFX1, 0x00000, &rk_charlayout2,  256,  8 },	/* characters */
532 	{ REGION_GFX2, 0x00000, &rk_spritelayout,   0, 32 },	/* sprites */
533 	{ REGION_GFX3, 0x00000, &rk_tilelayout,     0, 32 },	/* sprites/bg tiles */
534 	{ REGION_GFX4, 0x00000, &rk_bglayout,       0, 32 },	/* bg tiles */
535 	{ -1 } /* end of array */
536 };
537 
538 static struct AY8910interface ay8910_interface =
539 {
540 	1,	/* 1 chip */
541 	1500000,	/* 1.5 MHz ? */
542 	{ 25 },
543 	{ soundlatch_r },
544 	{ 0 },
545 	{ 0 },
546 	{ 0 }
547 };
548 
549 static struct DACinterface dac_interface =
550 {
551 	1,
552 	{ 25 }
553 };
554 
INTERRUPT_GEN(kingofb_interrupt)555 static INTERRUPT_GEN( kingofb_interrupt ) {
556 
557 	if ( kingofb_nmi_enable )
558 		cpu_set_irq_line(cpu_getactivecpu(), IRQ_LINE_NMI, PULSE_LINE);
559 }
560 
561 static MACHINE_DRIVER_START( kingofb )
562 
563 	/* basic machine hardware */
564 	MDRV_CPU_ADD(Z80, 4000000)        /* 4.0 MHz */
MDRV_CPU_MEMORY(main_readmem,main_writemem)565 	MDRV_CPU_MEMORY(main_readmem,main_writemem)
566 	MDRV_CPU_VBLANK_INT(kingofb_interrupt,1)
567 
568 	MDRV_CPU_ADD(Z80, 4000000)        /* 4.0 MHz */
569 	MDRV_CPU_MEMORY(video_readmem,video_writemem)
570 	MDRV_CPU_VBLANK_INT(kingofb_interrupt,1)
571 
572 	MDRV_CPU_ADD(Z80, 4000000)        /* 4.0 MHz */
573 	MDRV_CPU_MEMORY(sprite_readmem,sprite_writemem)
574 	MDRV_CPU_VBLANK_INT(kingofb_interrupt,1)
575 
576 	MDRV_CPU_ADD(Z80, 4000000)
577 	MDRV_CPU_FLAGS(CPU_AUDIO_CPU)        /* 4.0 MHz */
578 	MDRV_CPU_MEMORY(sound_readmem,sound_writemem)
579 	MDRV_CPU_PORTS(sound_readport,sound_writeport)
580 	MDRV_CPU_PERIODIC_INT(nmi_line_pulse,6000)	/* Hz */
581 
582 	MDRV_FRAMES_PER_SECOND(60)
583 	MDRV_VBLANK_DURATION(DEFAULT_REAL_60HZ_VBLANK_DURATION)
584 	MDRV_INTERLEAVE(100) /* We really need heavy synching among the processors */
585 
586 	/* video hardware */
587 	MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
588 	MDRV_SCREEN_SIZE(32*8, 32*8)
589 	MDRV_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
590 	MDRV_GFXDECODE(gfxdecodeinfo)
591 	MDRV_PALETTE_LENGTH(256+8)
592 	MDRV_COLORTABLE_LENGTH(256+8*2)
593 
594 	MDRV_PALETTE_INIT(kingofb)
595 	MDRV_VIDEO_START(kingofb)
596 	MDRV_VIDEO_UPDATE(kingofb)
597 
598 	/* sound hardware */
599 	MDRV_SOUND_ADD(AY8910, ay8910_interface)
600 	MDRV_SOUND_ADD(DAC, dac_interface)
601 MACHINE_DRIVER_END
602 
603 
604 /* Ring King */
605 static MACHINE_DRIVER_START( ringking )
606 
607 	/* basic machine hardware */
608 	MDRV_CPU_ADD(Z80, 4000000)        /* 4.0 MHz */
609 	MDRV_CPU_MEMORY(rk_main_readmem,rk_main_writemem)
610 	MDRV_CPU_VBLANK_INT(kingofb_interrupt,1)
611 
612 	MDRV_CPU_ADD(Z80, 4000000)        /* 4.0 MHz */
613 	MDRV_CPU_MEMORY(rk_video_readmem,rk_video_writemem)
614 	MDRV_CPU_VBLANK_INT(kingofb_interrupt,1)
615 
616 	MDRV_CPU_ADD(Z80, 4000000)        /* 4.0 MHz */
617 	MDRV_CPU_MEMORY(rk_sprite_readmem,rk_sprite_writemem)
618 	MDRV_CPU_VBLANK_INT(kingofb_interrupt,1)
619 
620 	MDRV_CPU_ADD(Z80, 4000000)
621 	MDRV_CPU_FLAGS(CPU_AUDIO_CPU)        /* 4.0 MHz */
622 	MDRV_CPU_MEMORY(sound_readmem,sound_writemem)
623 	MDRV_CPU_PORTS(rk_sound_readport,rk_sound_writeport)
624 	MDRV_CPU_PERIODIC_INT(nmi_line_pulse,6000)	/* Hz */
625 
626 	MDRV_FRAMES_PER_SECOND(60)
627 	MDRV_VBLANK_DURATION(DEFAULT_REAL_60HZ_VBLANK_DURATION)
628 	MDRV_INTERLEAVE(100) /* We really need heavy synching among the processors */
629 
630 	/* video hardware */
631 	MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
632 	MDRV_SCREEN_SIZE(32*8, 32*8)
633 	MDRV_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
634 	MDRV_GFXDECODE(rk_gfxdecodeinfo)
635 	MDRV_PALETTE_LENGTH(256+8)
636 	MDRV_COLORTABLE_LENGTH(256+8*2)
637 
638 	MDRV_PALETTE_INIT(ringking)
639 	MDRV_VIDEO_START(ringking)
640 	MDRV_VIDEO_UPDATE(ringking)
641 
642 	/* sound hardware */
643 	MDRV_SOUND_ADD(AY8910, ay8910_interface)
644 	MDRV_SOUND_ADD(DAC, dac_interface)
645 MACHINE_DRIVER_END
646 
647 
648 /***************************************************************************
649 
650   Game driver(s)
651 
652 ***************************************************************************/
653 
654 ROM_START( kingofb )
655 	ROM_REGION( 0x10000, REGION_CPU1, 0 )     /* 64k for code */
656 	ROM_LOAD( "d09_22.bin",   0x00000, 0x4000, CRC(6220bfa2) SHA1(cb329406ed07b71f9d2c40fc6c2c196daaa56fc8) )
657 	ROM_LOAD( "e09_23.bin",   0x04000, 0x4000, CRC(5782fdd8) SHA1(6c8c1114ce7863f9e8331796e2c5fb4928904b55) )
658 
659 	ROM_REGION( 0x10000, REGION_CPU2, 0 )     /* 64k for the video cpu */
660 	ROM_LOAD( "b09_21.bin",   0x00000, 0x4000, CRC(3fb39489) SHA1(cddd939cb57bb684427cf5c8538ad0e9f8f4586d) )
661 
662 	ROM_REGION( 0x10000, REGION_CPU3, 0 )     /* 64k for the sprite cpu */
663 	ROM_LOAD( "j09_dcr.bin",  0x00000, 0x2000, CRC(379f4f84) SHA1(c8171e15fe243857b6ca8f32c1cc09f12fa4c07c) )
664 
665 	ROM_REGION( 0x10000, REGION_CPU4, 0 )     /* 64k for the audio cpu */
666 	ROM_LOAD( "f05_18.bin",   0x00000, 0x4000, CRC(c057e28e) SHA1(714d8f14d55a070efcf205f8946269181bf2198b) )
667 	ROM_LOAD( "h05_19.bin",   0x04000, 0x4000, CRC(060253dd) SHA1(9a24fc6aca64262e935971f96b3a103df9711f20) )
668 	ROM_LOAD( "j05_20.bin",   0x08000, 0x4000, CRC(64c137a4) SHA1(e38adeb19e24357cc5581f0a3097c1d24914e25c) )
669 
670 	ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
671 	ROM_LOAD( "vd15_13.bin",  0x00000, 0x2000, CRC(e36d4f4f) SHA1(059799b04a7d3e02c1a7f9a5b878d06afef305df) ) /* characters */
672 
673 	ROM_REGION( 0x18000, REGION_GFX2, ROMREGION_DISPOSE )	/* sprites */
674 	ROM_LOAD( "vb01_01.bin",  0x00000, 0x4000, CRC(ce6580af) SHA1(9a94c681d4c54ca6c2f41ba1e51c61f54e844c77) )
675 	ROM_LOAD( "vb04_03.bin",  0x04000, 0x4000, CRC(cf74ea50) SHA1(9b0bdf636f9b31e6c7074d606d431a849a51e518) )
676 	ROM_LOAD( "vb07_05.bin",  0x08000, 0x4000, CRC(d8b53975) SHA1(52ad0b26fef7bb20d1bf953c5ebd519656682bac) )
677 	ROM_LOAD( "vb03_02.bin",  0x0c000, 0x4000, CRC(4ab506d2) SHA1(8c293d38429a1462f49462d623c47c402e3372f0) )
678 	ROM_LOAD( "vb05_04.bin",  0x10000, 0x4000, CRC(ecf95a2c) SHA1(b93d0ebdbde9311194a91fb3d6e5d5f33cc87e9d) )
679 	ROM_LOAD( "vb08_06.bin",  0x14000, 0x4000, CRC(8200cb2b) SHA1(c9e66027d796dd523eddf378d0e9a62ebcc8f6c8) )
680 
681 	ROM_REGION( 0xc000, REGION_GFX3, ROMREGION_DISPOSE )	/* tiles */
682 	ROM_LOAD( "vd01_07.bin",  0x00000, 0x2000, CRC(3d472a22) SHA1(85a2e25cee8f85ac0d2ee12f60f97e26539ebd52) )
683 	ROM_LOAD( "vd04_09.bin",  0x02000, 0x2000, CRC(cc002ea9) SHA1(194aa60809c2ae12be2d7533170988e47549c239) )
684 	ROM_LOAD( "vd07_11.bin",  0x04000, 0x2000, CRC(23c1b3ee) SHA1(8a8a187920243f3d3870a2fa71b0f6494e53107a) )
685 	ROM_LOAD( "vd03_08.bin",  0x06000, 0x2000, CRC(d6b1b8fe) SHA1(6bbe02a0a9e080f3ed3c32d64afb81905b42082f) )
686 	ROM_LOAD( "vd05_10.bin",  0x08000, 0x2000, CRC(fce71e5a) SHA1(a68ad30e8e207d24bc5543dcbcbc3e39260b6cc5) )
687 	ROM_LOAD( "vd08_12.bin",  0x0a000, 0x2000, CRC(3f68b991) SHA1(487e7d793fe6c1dbecd5f54f790105bbb44a21de) )
688 
689 	ROM_REGION( 0x0300, REGION_PROMS, 0 )
690 	ROM_LOAD( "vb14_col.bin", 0x0000, 0x0100, CRC(c58e5121) SHA1(2e6658e24c183d8dacf4ff84a38060e57d11f265) )	/* red component */
691 	ROM_LOAD( "vb15_col.bin", 0x0100, 0x0100, CRC(5ab06f25) SHA1(f5e0aabf40ce6d11771e0678fea248abd5b95b3c) )	/* green component */
692 	ROM_LOAD( "vb16_col.bin", 0x0200, 0x0100, CRC(1171743f) SHA1(ddfce0ff213381a2fc94337681e599cb28db840c) )	/* blue component */
693 ROM_END
694 
695 /* Ring King */
696 ROM_START( ringking )
697 	ROM_REGION( 0x10000, REGION_CPU1, 0 )     /* 64k for code */
698 	ROM_LOAD( "cx13.9f",      0x00000, 0x8000, CRC(93e38c02) SHA1(8f96f16f2904ef83101448fdf201b98b8e75e1d6) )
699 	ROM_LOAD( "cx14.11f",     0x08000, 0x4000, CRC(a435acb0) SHA1(2c9d4e8471d87ce148f9c2180769350401914fc0) )
700 
701 	ROM_REGION( 0x10000, REGION_CPU2, 0 )     /* 64k for the video cpu */
702 	ROM_LOAD( "cx07.10c",     0x00000, 0x4000, CRC(9f074746) SHA1(fc7cb0b1348b9a4ada9a99786a365ffacabbeed3) )
703 
704 	ROM_REGION( 0x10000, REGION_CPU3, 0 )     /* 64k for the sprite cpu */
705 	ROM_LOAD( "cx00.4c",      0x00000, 0x2000, CRC(880b8aa7) SHA1(e5ee80cac85a62ae5a677115a74c08e433cd4fc9) )
706 
707 	ROM_REGION( 0x10000, REGION_CPU4, 0 )     /* 64k for the audio cpu */
708 	ROM_LOAD( "cx12.4ef",     0x00000, 0x8000, CRC(1d5d6c6b) SHA1(ea771f3e25850319f2fecfc91400fc1b9df606ef) )
709 	ROM_LOAD( "j05_20.bin",   0x08000, 0x4000, CRC(64c137a4) SHA1(e38adeb19e24357cc5581f0a3097c1d24914e25c) )
710 
711 	ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
712 	ROM_LOAD( "cx08.13b",     0x00000, 0x2000, CRC(dbd7c1c2) SHA1(57cba817c4499a2677866911a8df5df26f899b8f) )	/* characters */
713 
714 	ROM_REGION( 0x18000, REGION_GFX2, ROMREGION_DISPOSE )
715 	ROM_LOAD( "cx04.11j",     0x00000, 0x8000, CRC(506a2ed9) SHA1(ee348925f6602dc8a1dbe66df5de615e413cb7af) )
716 	ROM_LOAD( "cx02.8j",      0x08000, 0x8000, CRC(009dde6a) SHA1(0b892229854c1b291ea923be8b11efee3afbf96e) )
717 	ROM_LOAD( "cx06.13j",     0x10000, 0x8000, CRC(d819a3b2) SHA1(342db49b807e9b8980dc0e3092fc1305050563be) )
718 
719 	ROM_REGION( 0xc000, REGION_GFX3, ROMREGION_DISPOSE )
720 	ROM_LOAD( "cx03.9j",      0x00000, 0x4000, CRC(682fd1c4) SHA1(ff98ec6f5166b0b1d10a98ca1c30992b6d0c53a6) )	/* sprites */
721 	ROM_LOAD( "cx01.7j",      0x04000, 0x4000, CRC(85130b46) SHA1(c4d123174bd107eb5ed6d869416d7d241a32c15e) )
722 	ROM_LOAD( "cx05.12j",     0x08000, 0x4000, CRC(f7c4f3dc) SHA1(8d99d952c93991038144098e19a1a75106d37821) )
723 
724 	ROM_REGION( 0x8000, REGION_GFX4, ROMREGION_DISPOSE )
725 	ROM_LOAD( "cx09.17d",     0x00000, 0x4000, CRC(37a082cf) SHA1(057cd3429b021827d14dce9f070c8e13008d6ef7) )	/* tiles */
726 	ROM_LOAD( "cx10.17e",     0x04000, 0x4000, CRC(ab9446c5) SHA1(9afdc830efb263e5a95c73359cf808d06f23f47a) )
727 
728 	ROM_REGION( 0x0200, REGION_PROMS, 0 )
729 	ROM_LOAD( "82s135.2a",    0x0000, 0x0100, CRC(0e723a83) SHA1(51d2274be70506308b3bfa9c2d23606290f8b3b5) )	/* red and green component */
730 	ROM_LOAD( "82s129.1a",    0x0100, 0x0100, CRC(d345cbb3) SHA1(6318022ebbbe59d4c0a207801fffed1167b98a66) )	/* blue component */
731 ROM_END
732 
733 ROM_START( ringkin2 )
734 	ROM_REGION( 0x10000, REGION_CPU1, 0 )     /* 64k for code */
735 	ROM_LOAD( "rkngm1.bin",   0x00000, 0x8000, CRC(086921ea) SHA1(c5a594be0738a80c5f912dc819332ff61aa6fc4b) )
736 	ROM_LOAD( "rkngm2.bin",   0x08000, 0x4000, CRC(c0b636a4) SHA1(c3640a5597242e735673e1dbf8bf866e9122a20f) )
737 
738 	ROM_REGION( 0x10000, REGION_CPU2, 0 )     /* 64k for the video cpu */
739 	ROM_LOAD( "rkngtram.bin", 0x00000, 0x4000, CRC(d9dc1a0a) SHA1(969608e6e8f3bed11721e657403bf961551a9e38) )
740 
741 	ROM_REGION( 0x10000, REGION_CPU3, 0 )     /* 64k for the sprite cpu */
742 	ROM_LOAD( "cx00.4c",      0x00000, 0x2000, CRC(880b8aa7) SHA1(e5ee80cac85a62ae5a677115a74c08e433cd4fc9) )
743 
744 	ROM_REGION( 0x10000, REGION_CPU4, 0 )     /* 64k for the audio cpu */
745 	ROM_LOAD( "cx12.4ef",     0x00000, 0x8000, CRC(1d5d6c6b) SHA1(ea771f3e25850319f2fecfc91400fc1b9df606ef) )
746 	ROM_LOAD( "j05_20.bin",   0x08000, 0x4000, CRC(64c137a4) SHA1(e38adeb19e24357cc5581f0a3097c1d24914e25c) )
747 
748 	ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
749 	ROM_LOAD( "cx08.13b",     0x00000, 0x2000, CRC(dbd7c1c2) SHA1(57cba817c4499a2677866911a8df5df26f899b8f) )	/* characters */
750 
751 	ROM_REGION( 0x18000, REGION_GFX2, ROMREGION_DISPOSE )
752 	ROM_LOAD( "cx04.11j",     0x00000, 0x8000, CRC(506a2ed9) SHA1(ee348925f6602dc8a1dbe66df5de615e413cb7af) )
753 	ROM_LOAD( "cx02.8j",      0x08000, 0x8000, CRC(009dde6a) SHA1(0b892229854c1b291ea923be8b11efee3afbf96e) )
754 	ROM_LOAD( "cx06.13j",     0x10000, 0x8000, CRC(d819a3b2) SHA1(342db49b807e9b8980dc0e3092fc1305050563be) )
755 
756 	ROM_REGION( 0xc000, REGION_GFX3, ROMREGION_DISPOSE )
757 	ROM_LOAD( "cx03.9j",      0x00000, 0x4000, CRC(682fd1c4) SHA1(ff98ec6f5166b0b1d10a98ca1c30992b6d0c53a6) )	/* sprites */
758 	ROM_LOAD( "cx01.7j",      0x04000, 0x4000, CRC(85130b46) SHA1(c4d123174bd107eb5ed6d869416d7d241a32c15e) )
759 	ROM_LOAD( "cx05.12j",     0x08000, 0x4000, CRC(f7c4f3dc) SHA1(8d99d952c93991038144098e19a1a75106d37821) )
760 
761 	ROM_REGION( 0x8000, REGION_GFX4, ROMREGION_DISPOSE )
762 	ROM_LOAD( "cx09.17d",     0x00000, 0x4000, CRC(37a082cf) SHA1(057cd3429b021827d14dce9f070c8e13008d6ef7) )	/* tiles */
763 	ROM_LOAD( "cx10.17e",     0x04000, 0x4000, CRC(ab9446c5) SHA1(9afdc830efb263e5a95c73359cf808d06f23f47a) )
764 
765 	ROM_REGION( 0x0200, REGION_PROMS, 0 )
766 	ROM_LOAD( "82s135.2a",    0x0000, 0x0100, CRC(0e723a83) SHA1(51d2274be70506308b3bfa9c2d23606290f8b3b5) )	/* red and green component */
767 	ROM_LOAD( "82s129.1a",    0x0100, 0x0100, CRC(d345cbb3) SHA1(6318022ebbbe59d4c0a207801fffed1167b98a66) )	/* blue component */
768 ROM_END
769 
770 ROM_START( ringkin3 )
771 	ROM_REGION( 0x10000, REGION_CPU1, 0 )     /* 64k for code */
772 	ROM_LOAD( "14.9d",        0x00000, 0x4000, CRC(63627b8b) SHA1(eea736c8eec59fa561b9d1b5aa43df5410d8dde7) )
773 	ROM_LOAD( "15.9e",        0x04000, 0x4000, CRC(e7557489) SHA1(49dce8f6ce26283fbdca17d75699de4d636a900a) )
774 	ROM_LOAD( "16.9f",        0x08000, 0x4000, CRC(a3b3bb16) SHA1(4b4cb95a6bf4608ada1669208d9cabc3f856585a) )
775 
776 	ROM_REGION( 0x10000, REGION_CPU2, 0 )     /* 64k for the video cpu */
777 	ROM_LOAD( "13.9b",        0x00000, 0x4000, CRC(f33f94a2) SHA1(58e9eef6525f6bbec4d9586e1fe5884a8af84739) )
778 
779 	ROM_REGION( 0x10000, REGION_CPU3, 0 )     /* 64k for the sprite cpu */
780 	ROM_LOAD( "j09_dcr.bin",  0x00000, 0x2000, CRC(379f4f84) SHA1(c8171e15fe243857b6ca8f32c1cc09f12fa4c07c) )
781 
782 	ROM_REGION( 0x10000, REGION_CPU4, 0 )     /* 64k for the audio cpu */
783 	ROM_LOAD( "f05_18.bin",   0x00000, 0x4000, CRC(c057e28e) SHA1(714d8f14d55a070efcf205f8946269181bf2198b) )
784 	ROM_LOAD( "h05_19.bin",   0x04000, 0x4000, CRC(060253dd) SHA1(9a24fc6aca64262e935971f96b3a103df9711f20) )
785 	ROM_LOAD( "j05_20.bin",   0x08000, 0x4000, CRC(64c137a4) SHA1(e38adeb19e24357cc5581f0a3097c1d24914e25c) )
786 
787 	ROM_REGION( 0x2000, REGION_GFX1, ROMREGION_DISPOSE )
788 	ROM_LOAD( "12.15d",       0x00000, 0x2000, CRC(988a77bf) SHA1(c047c076d47479448ce2454c10010b672a1b457d) ) /* characters (Japanese) */
789 
790 	ROM_REGION( 0x18000, REGION_GFX2, ROMREGION_DISPOSE )	/* sprites */
791 	ROM_LOAD( "vb01_01.bin",  0x00000, 0x4000, CRC(ce6580af) SHA1(9a94c681d4c54ca6c2f41ba1e51c61f54e844c77) )
792 	ROM_LOAD( "vb04_03.bin",  0x04000, 0x4000, CRC(cf74ea50) SHA1(9b0bdf636f9b31e6c7074d606d431a849a51e518) )
793 	ROM_LOAD( "vb07_05.bin",  0x08000, 0x4000, CRC(d8b53975) SHA1(52ad0b26fef7bb20d1bf953c5ebd519656682bac) )
794 	ROM_LOAD( "vb03_02.bin",  0x0c000, 0x4000, CRC(4ab506d2) SHA1(8c293d38429a1462f49462d623c47c402e3372f0) )
795 	ROM_LOAD( "vb05_04.bin",  0x10000, 0x4000, CRC(ecf95a2c) SHA1(b93d0ebdbde9311194a91fb3d6e5d5f33cc87e9d) )
796 	ROM_LOAD( "vb08_06.bin",  0x14000, 0x4000, CRC(8200cb2b) SHA1(c9e66027d796dd523eddf378d0e9a62ebcc8f6c8) )
797 
798 	ROM_REGION( 0xc000, REGION_GFX3, ROMREGION_DISPOSE )	/* tiles */
799 	ROM_LOAD( "7.1d",         0x00000, 0x2000, CRC(019a88b0) SHA1(9c2d4bb643b7bd14c4f347906707854d7a5cd340) )
800 	ROM_LOAD( "9.4d",         0x02000, 0x2000, CRC(bfdc741a) SHA1(2b874ef61eae8fab99d08a0273d69b90bb52b3f1) )
801 	ROM_LOAD( "11.7d",        0x04000, 0x2000, CRC(3cc7bdc5) SHA1(31f3fd5892232701f375822a146853b71bad804b) )
802 	ROM_LOAD( "8.3d",         0x06000, 0x2000, CRC(65f1281b) SHA1(a7db40464d52c615ffa40a577edf09fd6b1a677a) )
803 	ROM_LOAD( "10.5d",        0x08000, 0x2000, CRC(af5013e7) SHA1(26e737138ab0e8dc28bea1f81d1f83345419e611) )
804 	ROM_LOAD( "12.8d",        0x0a000, 0x2000, NO_DUMP )
805 
806 	ROM_REGION( 0x0300, REGION_PROMS, 0 )
807 	/* we load the ringking PROMs and then expand the first to look like the kingofb ones... */
808 	ROM_LOAD( "82s135.2a",    0x0100, 0x0100, CRC(0e723a83) SHA1(51d2274be70506308b3bfa9c2d23606290f8b3b5) )	/* red and green component */
809 	ROM_LOAD( "82s129.1a",    0x0200, 0x0100, CRC(d345cbb3) SHA1(6318022ebbbe59d4c0a207801fffed1167b98a66) )	/* blue component */
810 ROM_END
811 
812 
813 static DRIVER_INIT( ringkin3 )
814 {
815 	int i;
816 	UINT8 *RAM = memory_region(REGION_PROMS);
817 
818 	/* expand the first color PROM to look like the kingofb ones... */
819 	for (i = 0;i < 0x100;i++)
820 		RAM[i] = RAM[i + 0x100] >> 4;
821 }
822 
823 
824 
825 GAME( 1985, kingofb,  0,       kingofb,  kingofb,  0,        ROT90, "Woodplace", "King of Boxer (English)" )
826 GAME( 1985, ringking, kingofb, ringking, ringking, 0,        ROT90, "Data East USA", "Ring King (US set 1)" )
827 GAME( 1985, ringkin2, kingofb, ringking, ringking, 0,        ROT90, "Data East USA", "Ring King (US set 2)" )
828 GAME( 1985, ringkin3, kingofb, kingofb,  kingofb,  ringkin3, ROT90, "Data East USA", "Ring King (US set 3)" )
829