1 // license:BSD-3-Clause
2 // copyright-holders:Paul Hampson, Nicola Salmoria
3 /***************************************************************************
4 
5 Super Dodge Ball / Nekketsu Koukou Dodgeball Bu
6 
7 driver by Paul Hampson and Nicola Salmoria
8 
9 TODO:
10 - sprite lag (the real game has quite a bit of lag too)
11 
12 Notes:
13 - there's probably a 63701 on the board, used for protection. It is checked
14   on startup and then just used to read the input ports. It doesn't return
15   the ports verbatim, it adds further processing, setting flags when the
16   player double-taps in one direction to run.(updated to edge-triggering)
17 
18 - video timing is probably similar to Double Dragon and other Technos games
19   of that era.  The rowscroll of the title bar is done with raster IRQs, I've
20   removed the 'scroll value buffer' hack that the driver was using before and
21   used partial updates instead. (DH, 29 Sept 07)
22 
23 ***************************************************************************/
24 
25 #include "emu.h"
26 #include "includes/spdodgeb.h"
27 
28 #include "cpu/m6502/m6502.h"
29 #include "cpu/m6800/m6801.h"
30 #include "cpu/m6809/m6809.h"
31 #include "sound/3812intf.h"
32 #include "speaker.h"
33 
34 
spd_adpcm_w(offs_t offset,uint8_t data)35 void spdodgeb_state::spd_adpcm_w(offs_t offset, uint8_t data)
36 {
37 	int chip = offset & 1;
38 	msm5205_device *adpcm = chip ? m_msm2 : m_msm1;
39 
40 	switch (offset/2)
41 	{
42 		case 3:
43 			m_adpcm_idle[chip] = 1;
44 			adpcm->reset_w(1);
45 			break;
46 
47 		case 2:
48 			m_adpcm_pos[chip] = (data & 0x7f) * 0x200;
49 			break;
50 
51 		case 1:
52 			m_adpcm_end[chip] = (data & 0x7f) * 0x200;
53 			break;
54 
55 		case 0:
56 			m_adpcm_idle[chip] = 0;
57 			adpcm->reset_w(0);
58 			break;
59 	}
60 }
61 
spd_adpcm_int(msm5205_device * device,int chip)62 void spdodgeb_state::spd_adpcm_int( msm5205_device *device, int chip )
63 {
64 	if (m_adpcm_pos[chip] >= m_adpcm_end[chip] || m_adpcm_pos[chip] >= 0x10000)
65 	{
66 		m_adpcm_idle[chip] = 1;
67 		device->reset_w(1);
68 	}
69 	else if (m_adpcm_data[chip] != -1)
70 	{
71 		device->data_w(m_adpcm_data[chip] & 0x0f);
72 		m_adpcm_data[chip] = -1;
73 	}
74 	else
75 	{
76 		uint8_t *ROM = memregion("adpcm")->base() + 0x10000 * chip;
77 
78 		m_adpcm_data[chip] = ROM[m_adpcm_pos[chip]++];
79 		device->data_w(m_adpcm_data[chip] >> 4);
80 	}
81 }
82 
WRITE_LINE_MEMBER(spdodgeb_state::spd_adpcm_int_1)83 WRITE_LINE_MEMBER(spdodgeb_state::spd_adpcm_int_1)
84 {
85 	spd_adpcm_int(m_msm1, 0);
86 }
87 
WRITE_LINE_MEMBER(spdodgeb_state::spd_adpcm_int_2)88 WRITE_LINE_MEMBER(spdodgeb_state::spd_adpcm_int_2)
89 {
90 	spd_adpcm_int(m_msm2, 1);
91 }
92 
mcu63701_r(offs_t offset)93 uint8_t spdodgeb_state::mcu63701_r(offs_t offset)
94 {
95 //  logerror("CPU #0 PC %04x: read from port %02x of 63701 data address 3801\n",m_maincpu->pc(),offset);
96 
97 	return m_inputs[offset];
98 }
99 
mcu_data_w(offs_t offset,uint8_t data)100 void spdodgeb_state::mcu_data_w(offs_t offset, uint8_t data)
101 {
102 	m_inputs[offset] = data;
103 }
104 
mcu_status_w(uint8_t data)105 void spdodgeb_state::mcu_status_w(uint8_t data)
106 {
107 	m_mcu_status = data & 0xc0;
108 }
109 
mcu_nmi_w(uint8_t data)110 void spdodgeb_state::mcu_nmi_w(uint8_t data)
111 {
112 	m_mcu->pulse_input_line(INPUT_LINE_NMI, attotime::zero);
113 }
114 
115 
116 
spdodgeb_map(address_map & map)117 void spdodgeb_state::spdodgeb_map(address_map &map)
118 {
119 	map(0x0000, 0x0fff).ram();
120 	map(0x1000, 0x10ff).writeonly().share("spriteram");
121 	map(0x2000, 0x2fff).ram().w(FUNC(spdodgeb_state::videoram_w)).share("videoram");
122 	map(0x3000, 0x3000).portr("IN0"); //.nopw();
123 	map(0x3001, 0x3001).portr("DSW"); //.nopw();
124 	map(0x3002, 0x3002).w(m_soundlatch, FUNC(generic_latch_8_device::write));
125 //  map(0x3003, 0x3003).nopw();
126 	map(0x3004, 0x3004).w(FUNC(spdodgeb_state::scrollx_lo_w));
127 	map(0x3005, 0x3005).w(FUNC(spdodgeb_state::mcu_nmi_w));
128 	map(0x3006, 0x3006).w(FUNC(spdodgeb_state::ctrl_w));  /* scroll hi, flip screen, bank switch, palette select */
129 	map(0x3800, 0x3800).w("mculatch", FUNC(generic_latch_8_device::write));
130 	map(0x3801, 0x3805).r(FUNC(spdodgeb_state::mcu63701_r));
131 	map(0x4000, 0x7fff).bankr("mainbank");
132 	map(0x8000, 0xffff).rom();
133 }
134 
spdodgeb_sound_map(address_map & map)135 void spdodgeb_state::spdodgeb_sound_map(address_map &map)
136 {
137 	map(0x0000, 0x0fff).ram();
138 	map(0x1000, 0x1000).r(m_soundlatch, FUNC(generic_latch_8_device::read));
139 	map(0x2800, 0x2801).w("ymsnd", FUNC(ym3812_device::write));
140 	map(0x3800, 0x3807).w(FUNC(spdodgeb_state::spd_adpcm_w));
141 	map(0x8000, 0xffff).rom().region("audiocpu", 0);
142 }
143 
mcu_map(address_map & map)144 void spdodgeb_state::mcu_map(address_map &map)
145 {
146 	map(0x0000, 0x0027).m(m_mcu, FUNC(hd63701y0_cpu_device::hd6301y_io));
147 	map(0x0040, 0x013f).ram();
148 	map(0x8080, 0x8080).r("mculatch", FUNC(generic_latch_8_device::read));
149 	map(0x8081, 0x8085).w(FUNC(spdodgeb_state::mcu_data_w));
150 	map(0xc000, 0xffff).rom().region("mcu", 0);
151 }
152 
153 
READ_LINE_MEMBER(spdodgeb_state::mcu_busy_r)154 READ_LINE_MEMBER(spdodgeb_state::mcu_busy_r)
155 {
156 	return BIT(m_mcu_status, 7);
157 }
158 
159 static INPUT_PORTS_START( spdodgeb )
160 	PORT_START("IN0")
161 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
162 	PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(spdodgeb_state, mcu_busy_r) // mcu63701_busy flag
163 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
164 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
165 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
166 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 )
167 	PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) )
168 	PORT_DIPSETTING(    0x80, DEF_STR( Easy ))
169 	PORT_DIPSETTING(    0xc0, DEF_STR( Normal ))
170 	PORT_DIPSETTING(    0x40, DEF_STR( Hard ))
171 	PORT_DIPSETTING(    0x00, DEF_STR( Very_Hard ))
172 
173 	PORT_START("DSW")
174 	PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) )
175 	PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )
176 	PORT_DIPSETTING(    0x01, DEF_STR( 3C_1C ) )
177 	PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
178 	PORT_DIPSETTING(    0x07, DEF_STR( 1C_1C ) )
179 	PORT_DIPSETTING(    0x06, DEF_STR( 1C_2C ) )
180 	PORT_DIPSETTING(    0x05, DEF_STR( 1C_3C ) )
181 	PORT_DIPSETTING(    0x04, DEF_STR( 1C_4C ) )
182 	PORT_DIPSETTING(    0x03, DEF_STR( 1C_5C ) )
183 	PORT_DIPNAME( 0x38, 0x38, DEF_STR( Coin_B ) )
184 	PORT_DIPSETTING(    0x00, DEF_STR( 4C_1C ) )
185 	PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C ) )
186 	PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
187 	PORT_DIPSETTING(    0x38, DEF_STR( 1C_1C ) )
188 	PORT_DIPSETTING(    0x30, DEF_STR( 1C_2C ) )
189 	PORT_DIPSETTING(    0x28, DEF_STR( 1C_3C ) )
190 	PORT_DIPSETTING(    0x20, DEF_STR( 1C_4C ) )
191 	PORT_DIPSETTING(    0x18, DEF_STR( 1C_5C ) )
192 	PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) )
193 	PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
194 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
195 	PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) )
196 	PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
197 	PORT_DIPSETTING(    0x80, DEF_STR( On ) )
198 
199 	PORT_START("P1")
200 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
201 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
202 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
203 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
204 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
205 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
206 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
207 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
208 
209 	PORT_START("P2")
210 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
211 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
212 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
213 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
214 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
215 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
216 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
217 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
218 
219 	PORT_START("IN1")
220 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
221 	PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
222 	PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
223 	PORT_DIPSETTING(    0x00, DEF_STR( On ) )
224 	PORT_DIPNAME( 0x04, 0x04, DEF_STR( Allow_Continue ) )
225 	PORT_DIPSETTING(    0x00, DEF_STR( No ) )
226 	PORT_DIPSETTING(    0x04, DEF_STR( Yes ) )
227 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
228 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
229 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
230 INPUT_PORTS_END
231 
232 
233 
234 static const gfx_layout charlayout =
235 {
236 	8,8,
237 	RGN_FRAC(1,1),
238 	4,
239 	{ 0, 2, 4, 6 },
240 	{ 1, 0, 64+1, 64+0, 128+1, 128+0, 192+1, 192+0 },
241 	{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
242 	32*8
243 };
244 
245 static const gfx_layout spritelayout =
246 {
247 	16,16,
248 	RGN_FRAC(1,2),
249 	4,
250 	{ RGN_FRAC(1,2)+0, RGN_FRAC(1,2)+4, 0,4 },
251 	{ 3, 2, 1, 0, 16*8+3, 16*8+2, 16*8+1, 16*8+0,
252 			32*8+3, 32*8+2, 32*8+1, 32*8+0, 48*8+3, 48*8+2, 48*8+1, 48*8+0 },
253 	{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
254 			8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
255 	64*8
256 };
257 
258 static GFXDECODE_START( gfx_spdodgeb )
259 	GFXDECODE_ENTRY( "text", 0, charlayout,   0x000, 32 )   /* colors 0x000-0x1ff */
260 	GFXDECODE_ENTRY( "sprites", 0, spritelayout, 0x200, 32 )   /* colors 0x200-0x3ff */
261 GFXDECODE_END
262 
263 
machine_start()264 void spdodgeb_state::machine_start()
265 {
266 	save_item(NAME(m_adpcm_pos));
267 	save_item(NAME(m_adpcm_end));
268 	save_item(NAME(m_adpcm_idle));
269 	save_item(NAME(m_adpcm_data));
270 	save_item(NAME(m_mcu_status));
271 	save_item(NAME(m_inputs));
272 }
273 
machine_reset()274 void spdodgeb_state::machine_reset()
275 {
276 	m_adpcm_pos[0] = m_adpcm_pos[1] = 0;
277 	m_adpcm_end[0] = m_adpcm_end[1] = 0;
278 	m_adpcm_idle[0] = m_adpcm_data[1] = 0;
279 	m_adpcm_data[0] = m_adpcm_data[1] = -1;
280 	m_mcu_status = 0;
281 	memset(m_inputs, 0, sizeof(m_inputs));
282 }
283 
spdodgeb(machine_config & config)284 void spdodgeb_state::spdodgeb(machine_config &config)
285 {
286 	/* basic machine hardware */
287 	M6502(config, m_maincpu, XTAL(12'000'000)/6);   /* 2MHz ? */
288 	m_maincpu->set_addrmap(AS_PROGRAM, &spdodgeb_state::spdodgeb_map);
289 	TIMER(config, "scantimer").configure_scanline(FUNC(spdodgeb_state::interrupt), "screen", 0, 1); /* 1 IRQ every 8 visible scanlines, plus NMI for vblank */
290 
291 	MC6809(config, m_audiocpu, XTAL(12'000'000)/2); // HD68A09P (1.5MHz internally)
292 	m_audiocpu->set_addrmap(AS_PROGRAM, &spdodgeb_state::spdodgeb_sound_map);
293 
294 	hd63701y0_cpu_device &mcu(HD63701Y0(config, m_mcu, 4'000'000)); // unknown clock
295 	mcu.set_addrmap(AS_PROGRAM, &spdodgeb_state::mcu_map);
296 	mcu.in_p2_cb().set_ioport("P1");
297 	mcu.in_p6_cb().set_ioport("P2");
298 	mcu.in_p5_cb().set_ioport("IN1");
299 	mcu.out_p5_cb().set(FUNC(spdodgeb_state::mcu_status_w));
300 
301 	GENERIC_LATCH_8(config, "mculatch");
302 
303 	/* video hardware */
304 	SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
305 	m_screen->set_raw(XTAL(12'000'000)/2, 384, 0, 256, 272, 0, 240);
306 	m_screen->set_screen_update(FUNC(spdodgeb_state::screen_update));
307 	m_screen->set_palette(m_palette);
308 
309 	GFXDECODE(config, m_gfxdecode, m_palette, gfx_spdodgeb);
310 	PALETTE(config, m_palette, FUNC(spdodgeb_state::spdodgeb_palette), 1024);
311 
312 	/* sound hardware */
313 	SPEAKER(config, "lspeaker").front_left();
314 	SPEAKER(config, "rspeaker").front_right();
315 
316 	GENERIC_LATCH_8(config, m_soundlatch);
317 	m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, M6809_IRQ_LINE);
318 
319 	ym3812_device &ymsnd(YM3812(config, "ymsnd", XTAL(12'000'000)/4));
320 	ymsnd.irq_handler().set_inputline(m_audiocpu, M6809_FIRQ_LINE);
321 	ymsnd.add_route(ALL_OUTPUTS, "lspeaker", 1.0);
322 	ymsnd.add_route(ALL_OUTPUTS, "rspeaker", 1.0);
323 
324 	MSM5205(config, m_msm1, 384000);
325 	m_msm1->vck_legacy_callback().set(FUNC(spdodgeb_state::spd_adpcm_int_1));  /* interrupt function */
326 	m_msm1->set_prescaler_selector(msm5205_device::S48_4B);  /* 8kHz? */
327 	m_msm1->add_route(ALL_OUTPUTS, "lspeaker", 0.50);
328 	m_msm1->add_route(ALL_OUTPUTS, "rspeaker", 0.50);
329 
330 	MSM5205(config, m_msm2, 384000);
331 	m_msm2->vck_legacy_callback().set(FUNC(spdodgeb_state::spd_adpcm_int_2));  /* interrupt function */
332 	m_msm2->set_prescaler_selector(msm5205_device::S48_4B);  /* 8kHz? */
333 	m_msm2->add_route(ALL_OUTPUTS, "lspeaker", 0.50);
334 	m_msm2->add_route(ALL_OUTPUTS, "rspeaker", 0.50);
335 }
336 
337 
338 
339 ROM_START( spdodgeb )
340 	ROM_REGION( 0x10000, "maincpu", 0 )
341 	ROM_LOAD( "22a-04.139",   0x00000, 0x10000, CRC(66071fda) SHA1(4a239295900e6234a2a693321ca821671747a58e) )  /* First 0x8000: Two banks, second 0x8000: Static */
342 
343 	ROM_REGION( 0x08000, "audiocpu", 0 ) /* audio cpu */
344 	ROM_LOAD( "22j5-0.33",    0x00000, 0x08000, CRC(c31e264e) SHA1(0828a2094122e3934b784ec9ad7c2b89d91a83bb) )
345 
346 	ROM_REGION( 0x04000, "mcu", 0 ) /* I/O mcu */
347 	ROM_LOAD( "22ja-0.162",   0x00000, 0x04000, CRC(7162a97b) SHA1(d6d4ee025e73a340428345f08711cd32f9169a8c) )
348 
349 	ROM_REGION( 0x40000, "text", 0 ) /* text */
350 	ROM_LOAD( "22a-4.121",    0x00000, 0x20000, CRC(acc26051) SHA1(445224238cce420990894824d95447e3f63a9ef0) )
351 	ROM_LOAD( "22a-3.107",    0x20000, 0x20000, CRC(10bb800d) SHA1(265a3d67669034d17713b505ef55cd1c90f8d205) )
352 
353 	ROM_REGION( 0x40000, "sprites", 0 )
354 	ROM_LOAD( "22a-1.2",      0x00000, 0x20000, CRC(3bd1c3ec) SHA1(40f61552ea6f7a81915fe3e13f75dc1dc69da33e) )
355 	ROM_LOAD( "22a-2.35",     0x20000, 0x20000, CRC(409e1be1) SHA1(35a77fc8fe6fc212734e2f452dbde9b8cf696f61) )
356 
357 	ROM_REGION( 0x20000, "adpcm", 0 ) /* adpcm samples */
358 	ROM_LOAD( "22j6-0.83",    0x00000, 0x10000, CRC(744a26e3) SHA1(519f22f1e5cc417cb8f9ced97e959d23c711283b) )
359 	ROM_LOAD( "22j7-0.82",    0x10000, 0x10000, CRC(2fa1de21) SHA1(e8c7af6057b64ecadd3473b82abd8e9f873082fd) )
360 
361 	ROM_REGION( 0x0800, "proms", 0 )    /* color PROMs */
362 	ROM_LOAD( "mb7132e.158",  0x0000, 0x0400, CRC(7e623722) SHA1(e1fe60533237bd0aba5c8de9775df620ed5227c0) )
363 	ROM_LOAD( "mb7122e.159",  0x0400, 0x0400, CRC(69706e8d) SHA1(778ee88ff566aa38c80e0e61bb3fe8458f0e9450) )
364 ROM_END
365 
366 /*
367 
368 Nekketsu Koukou Dodgeball Bu
369 (c)1987 Technos Japan
370 
371 TA-0022-P1-04
372 M6100293A (PCB manufactured by Taito)
373 
374 CPU: 6502 (Labeled TJC-706002)
375 Sound: 68A09, YM3812, M5205x2
376 OSC: 12.000MHz
377 
378 ROMs:
379 22J4-0.139 - Main program
380 22J5-0.33  - Sound program
381 22JA-0.162 - HD63701Y0P
382 
383 TJ22J4-0.121 - Text
384 TJ22J3-0.107 /
385 
386 TJ22J1-0.2  - Graphics
387 TJ22J2-0.35 /
388 
389 22J6-0.83 - ADPCM Samples
390 22J7-0.82 /
391 
392 22J8-0.158 (7132)
393 22J9-0.159 (7122)
394 
395 */
396 
397 ROM_START( nkdodge )
398 	ROM_REGION( 0x10000, "maincpu", 0 )
399 	ROM_LOAD( "22j4-0.139",   0x00000, 0x10000, CRC(aa674fd8) SHA1(4e8d3e07b54d23b221cb39cf10389bc7a56c4021) )  /* First 0x8000: Two banks, second 0x8000: Static */
400 
401 	ROM_REGION( 0x08000, "audiocpu", 0 ) /* audio cpu */
402 	ROM_LOAD( "22j5-0.33",    0x00000, 0x08000, CRC(c31e264e) SHA1(0828a2094122e3934b784ec9ad7c2b89d91a83bb) )
403 
404 	ROM_REGION( 0x04000, "mcu", 0 ) /* I/O mcu */
405 	ROM_LOAD( "22ja-0.162",   0x00000, 0x04000, CRC(7162a97b) SHA1(d6d4ee025e73a340428345f08711cd32f9169a8c) )
406 
407 	ROM_REGION( 0x40000, "text", 0 ) /* text */
408 	ROM_LOAD( "tj22j4-0.121",    0x00000, 0x20000, CRC(d2922b3f) SHA1(30ad37f8355c732b545017c2fc56879256b650be) )
409 	ROM_LOAD( "tj22j3-0.107",    0x20000, 0x20000, CRC(79cd1315) SHA1(2d7a877e59f704b10b5f609e60fa565c68f5fdb0) )
410 
411 	ROM_REGION( 0x40000, "sprites", 0 )
412 	ROM_LOAD( "tj22j1-0.2",      0x00000, 0x20000, CRC(9ed27a8d) SHA1(d80d275bbe91f3e1bd0495a2d7a3be0280a7cda1) )
413 	ROM_LOAD( "tj22j2-0.35",     0x20000, 0x20000, CRC(768934f9) SHA1(922f3154dcfb29c2e5c1bebc53247136160f1229) )
414 
415 	ROM_REGION( 0x20000, "adpcm", 0 ) /* adpcm samples */
416 	ROM_LOAD( "22j6-0.83",    0x00000, 0x10000, CRC(744a26e3) SHA1(519f22f1e5cc417cb8f9ced97e959d23c711283b) )
417 	ROM_LOAD( "22j7-0.82",    0x10000, 0x10000, CRC(2fa1de21) SHA1(e8c7af6057b64ecadd3473b82abd8e9f873082fd) )
418 
419 	ROM_REGION( 0x0800, "proms", 0 )    /* color PROMs */
420 	ROM_LOAD( "22j8-0.158",  0x0000, 0x0400, CRC(c368440f) SHA1(39762d102a42211f24db16bc721b01230df1c4d6) )
421 	ROM_LOAD( "22j9-0.159",  0x0400, 0x0400, CRC(6059f401) SHA1(280b1bda3a55f2d8c2fd4552c4dcec7100f0170f) )
422 ROM_END
423 
424 /* the bootleg just seems to have the gfx roms in a different format, program is identical */
425 
426 ROM_START( nkdodgeb )
427 	ROM_REGION( 0x10000, "maincpu", 0 )
428 	ROM_LOAD( "12.bin",       0x00000, 0x10000, CRC(aa674fd8) SHA1(4e8d3e07b54d23b221cb39cf10389bc7a56c4021) )  /* First 0x8000: Two banks, second 0x8000: Static */
429 
430 	ROM_REGION( 0x08000, "audiocpu", 0 ) /* audio cpu */
431 	ROM_LOAD( "22j5-0.33",    0x00000, 0x08000, CRC(c31e264e) SHA1(0828a2094122e3934b784ec9ad7c2b89d91a83bb) )
432 
433 	ROM_REGION( 0x04000, "mcu", 0 ) /* I/O mcu */
434 	ROM_LOAD( "hd63701y0p.n12", 0x0000, 0x4000, CRC(7162a97b) SHA1(d6d4ee025e73a340428345f08711cd32f9169a8c) BAD_DUMP ) // missing from dump, but probably also identical
435 
436 	ROM_REGION( 0x40000, "text", 0 ) /* text */
437 	ROM_LOAD( "10.bin",       0x00000, 0x10000, CRC(442326fd) SHA1(e0e9e1dfdca3edd6e2522f55c191b40b81b8eaff) )
438 	ROM_LOAD( "11.bin",       0x10000, 0x10000, CRC(2140b070) SHA1(7a9d89eb6130b1dd21236fefaeb09a29c7f0d208) )
439 	ROM_LOAD( "9.bin",        0x20000, 0x10000, CRC(18660ac1) SHA1(be6a47eea9649d7b9ff8b30a4de643522c9869e6) )
440 	ROM_LOAD( "8.bin",        0x30000, 0x10000, CRC(5caae3c9) SHA1(f81a1c4ce2117d41e81542d417ff3573ea0f5313) )
441 
442 	ROM_REGION( 0x40000, "sprites", 0 )
443 	ROM_LOAD( "2.bin",        0x00000, 0x10000, CRC(1271583e) SHA1(98a597f2be1abdac6c4de811cfa8a53549bc6904) )
444 	ROM_LOAD( "1.bin",        0x10000, 0x10000, CRC(5ae6cccf) SHA1(6bd385d6559b54c681d05eed2e91bfc2aa3e6844) )
445 	ROM_LOAD( "4.bin",        0x20000, 0x10000, CRC(f5022822) SHA1(fa67b1f70da80365f14776b712df6f656e603fb0) )
446 	ROM_LOAD( "3.bin",        0x30000, 0x10000, CRC(05a71179) SHA1(7e5ed81b37ac458d7a40e89f83f1efb742e797a8) )
447 
448 	ROM_REGION( 0x20000, "adpcm", 0 ) /* adpcm samples */
449 	ROM_LOAD( "22j6-0.83",    0x00000, 0x10000, CRC(744a26e3) SHA1(519f22f1e5cc417cb8f9ced97e959d23c711283b) )
450 	ROM_LOAD( "22j7-0.82",    0x10000, 0x10000, CRC(2fa1de21) SHA1(e8c7af6057b64ecadd3473b82abd8e9f873082fd) )
451 
452 	ROM_REGION( 0x0800, "proms", 0 )    /* color PROMs */
453 	ROM_LOAD( "27s191.bin",  0x0000, 0x0800, CRC(317e42ea) SHA1(59caacc02fb7fb11604bd177f790fd68830ca7c1) )
454 	ROM_LOAD( "82s137.bin",  0x0400, 0x0400, CRC(6059f401) SHA1(280b1bda3a55f2d8c2fd4552c4dcec7100f0170f) )
455 ROM_END
456 
457 
458 
459 GAME( 1987, spdodgeb, 0,        spdodgeb, spdodgeb, spdodgeb_state, empty_init, ROT0, "Technos Japan", "Super Dodge Ball (US)",                         MACHINE_SUPPORTS_SAVE )
460 GAME( 1987, nkdodge,  spdodgeb, spdodgeb, spdodgeb, spdodgeb_state, empty_init, ROT0, "Technos Japan", "Nekketsu Koukou Dodgeball Bu (Japan)",          MACHINE_SUPPORTS_SAVE )
461 GAME( 1987, nkdodgeb, spdodgeb, spdodgeb, spdodgeb, spdodgeb_state, empty_init, ROT0, "bootleg",       "Nekketsu Koukou Dodgeball Bu (Japan, bootleg)", MACHINE_SUPPORTS_SAVE )
462