1 /*----------------------------------------------------------------
2    Psikyo PS3/PS5/PS5v2 SH-2 Based Systems
3    driver by David Haywood (+ Paul Priest)
4    thanks to Farfetch'd for information about the sprite zoom table.
5 ------------------------------------------------------------------
6 
7 Moving on from the 68020 based system used for the first Strikers
8 1945 game Psikyo introduced a system using Hitachi's SH-2 CPU
9 
10 This driver is for the single-screen PS3/PS5/PS5v2 boards
11 
12 There appear to be multiple revisions of this board
13 
14  Board PS3-V1 (Custom Chip PS6406B)
15  -----------------------------------
16  Sol Divide (c)1997
17  Strikers 1945 II (c)1997
18  Space Bomber Ver.B (c)1998
19  Daraku Tenshi - The Fallen Angels (c)1998
20 
21  Board PS5 (Custom Chip PS6406B)
22  -------------------------------
23  Gunbird 2 (c)1998
24  Strikers 1999 / Strikers 1945 III (c)1999
25 
26  The PS5 board appears to just have a different memory map to PS3
27  Otherwise identical.
28 
29  Board PS5V2 (Custom Chip PS6406B)
30  ---------------------------------
31  Dragon Blaze (c)2000
32  Tetris The Grand Master 2 (c)2000
33  Tetris The Grand Master 2 Plus (c)2000 (Confirmed by Japump to be a Dragon Blaze upgraded board)
34  GunBarich (c)2001 (Appears to be a Dragon Blaze upgraded board, easily replaced chips have been swapped)
35 
36  The PS5v2 board is only different physically.
37 
38 All the boards have
39 
40 YMF278B-F (80 pin PQFP) & YAC513 (16 pin SOIC)
41 ( YMF278B-F is OPL4 == OPL3 plus a sample playback engine. )
42 
43 93C56 EEPROM
44 ( 93c56 is a 93c46 with double the address space. )
45 
46 To Do:
47 
48   - see notes in vidhrdw file -
49 
50   Sol Divid's music is not correct, related to sh-2 timers.
51 
52 
53 *-----------------------------------*
54 |         Tips and Tricks           |
55 *-----------------------------------*
56 
57 Hold Button during booting to test roms (Checksum 16-bit, on Words for gfx and Bytes for sound) for:
58 
59 Daraku:           PL1 Button 1 (passes, doesn't test sound)
60 Space Bomber:     PL1 Start (passes all, only if bit 0x40 is set. But then EEPROM resets?)
61 Gunbird 2:        PL1 Start (passes all, only if bit 0x40 is set. But then EEPROM resets)
62 Strikers 1945III: PL1 Start (passes all, only if bit 0x40 is set)
63 Dragon Blaze:     PL1 Start (fails on undumped sample rom, bit 0x40 has to be set anyway)
64 Gunbarich:        PL1 Start (passes all, only if bit 0x40 is set)
65 
66 
67 Hold PL1 Button 1 and Test Mode button to get Maintenance mode for:
68 
69 Space Bomber, Strikers 1945 II, Sol Divide, Daraku
70 (this works for earlier Psikyo games as well)
71 
72 --- Space Bomber ---
73 
74 Keywords, what are these for???, you earn them when you complete the game
75 with different points.:
76 
77 DOG-1
78 CAT-2
79 BUTA-3
80 KAME-4
81 IKA-5
82 RABBIT-6
83 FROG-7
84 TAKO-8
85 
86 --- Gunbird 2 ---
87 
88 5-2-0-4-8 Maintenance Mode
89 5-3-5-7-3 All Data Initialised
90 
91 [Aine]
92 5-1-0-2-4 Secret Command Enabled ["Down" on ?]
93 5-3-7-6-5 Secret Random Enabled
94 5-3-1-5-7 Secret All Disabled
95 
96 --- Strikers 1945 III / S1999 ---
97 
98 8-1-6-5-0 Maintenance Mode
99 8-1-6-1-0 All Data Initialised
100 1-2-3-4-5 Best Score Erased
101 
102 [X-36]
103 0-1-9-9-9 Secret Command Enabled ["Up" on ?]
104 8-1-6-3-0 Secret Random Enabled
105 8-1-6-2-0 Secret All Disabled
106 
107 --- Dragon Blaze ---
108 
109 9-2-2-2-0 Maintenance Mode
110 9-2-2-1-0 All Data Initialised
111 1-2-3-4-5 Best Score Erased
112 
113 --- Gunbarich ---
114 
115 0-2-9-2-0 Maintainance Mode
116 0-2-9-1-0 All Data Initialised
117 1-2-3-4-5 Best Score Erased
118 
119 ----------------------------------------------------------------*/
120 
121 #include "driver.h"
122 #include "state.h"
123 #include "cpuintrf.h"
124 
125 #include "vidhrdw/generic.h"
126 #include "cpu/sh2/sh2.h"
127 #include "machine/eeprom.h"
128 
129 #include "psikyosh.h"
130 
131 #define ROMTEST 0 /* Does necessary stuff to perform rom test, uses RAM as it doesn't dispose of GFX after decoding */
132 
133 static data8_t factory_eeprom[16]  = { 0x00,0x02,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00 };
134 static data8_t daraku_eeprom[16]   = { 0x03,0x02,0x00,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 };
135 static data8_t s1945iii_eeprom[16] = { 0x00,0x00,0x00,0x00,0x00,0x01,0x11,0x70,0x25,0x25,0x25,0x00,0x01,0x00,0x11,0xe0 };
136 static data8_t dragnblz_eeprom[16] = { 0x00,0x01,0x11,0x70,0x25,0x25,0x25,0x00,0x01,0x00,0x11,0xe0,0x00,0x00,0x00,0x00 };
137 
138 int use_factory_eeprom;
139 
140 data32_t *psikyosh_bgram, *psikyosh_zoomram, *psikyosh_vidregs, *psh_ram;
141 
142 static struct GfxLayout layout_16x16x4 =
143 {
144 	16,16,
145 	RGN_FRAC(1,1),
146 	4,
147 	{STEP4(0,1)},
148 	{STEP16(0,4)},
149 	{STEP16(0,16*4)},
150 	16*16*4
151 };
152 
153 static struct GfxLayout layout_16x16x8 =
154 {
155 	16,16,
156 	RGN_FRAC(1,1),
157 	8,
158 	{STEP8(0,1)},
159 	{STEP16(0,8)},
160 	{STEP16(0,16*8)},
161 	16*16*8
162 };
163 
164 static struct GfxDecodeInfo gfxdecodeinfo[] =
165 {
166 	{ REGION_GFX1, 0, &layout_16x16x4, 0x000, 0x100 }, // 4bpp tiles
167 	{ REGION_GFX1, 0, &layout_16x16x8, 0x000, 0x100 }, // 8bpp tiles
168 	{ -1 }
169 };
170 
171 static struct EEPROM_interface eeprom_interface_93C56 =
172 {
173 	8,		// address bits	8
174 	8,		// data bits	8
175 	"*110x",	// read			110x aaaaaaaa
176 	"*101x",	// write		101x aaaaaaaa dddddddd
177 	"*111x",	// erase		111x aaaaaaaa
178 	"*10000xxxxxxx",// lock			100x 00xxxx
179 	"*10011xxxxxxx",// unlock		100x 11xxxx
180 //	"*10001xxxx",	// write all	1 00 01xxxx dddddddddddddddd
181 //	"*10010xxxx"	// erase all	1 00 10xxxx
182 };
183 
184 static NVRAM_HANDLER(93C56)
185 {
186 	if (read_or_write)
187 	{
188 		EEPROM_save(file);
189 	}
190 	else
191 	{
192 		EEPROM_init(&eeprom_interface_93C56);
193 		if (file)
194 		{
195 			EEPROM_load(file);
196 		}
197 		else	// these games want the eeprom all zeros by default
198 		{
199 			int length;
200 			UINT8 *dat;
201 
202 			dat = EEPROM_get_data_pointer(&length);
203 			memset(dat, 0, length);
204 
205  			if (use_factory_eeprom!=EEPROM_0) /* Set the EEPROM to Factory Defaults for games needing them*/
206  			{
207 				data8_t eeprom_data[0x100];
208 				int i;
209 
210 				for(i=0; i<0x100; i++) eeprom_data[i] = 0;
211 
212 				memcpy(eeprom_data, factory_eeprom, 0x10);
213 
214   				if (use_factory_eeprom==EEPROM_DARAKU) /* Daraku, replace top 10 bytes with defaults (different to other games) */
215  					memcpy(eeprom_data, daraku_eeprom, 0x10);
216 
217 				if (use_factory_eeprom==EEPROM_S1945III) /* S1945iii suffers from corruption on highscore unless properly initialised at the end of the eeprom */
218  					memcpy(eeprom_data+0xf0, s1945iii_eeprom, 0x10);
219 
220  				if (use_factory_eeprom==EEPROM_DRAGNBLZ) /* Dragnblz too */
221  					memcpy(eeprom_data+0xf0, dragnblz_eeprom, 0x10);
222 
223 				EEPROM_set_data(eeprom_data,0x100);
224 			}
225 		}
226 	}
227 }
228 
WRITE32_HANDLER(psh_eeprom_w)229 static WRITE32_HANDLER( psh_eeprom_w )
230 {
231 	if (ACCESSING_MSB32)
232 	{
233 		EEPROM_write_bit((data & 0x20000000) ? 1 : 0);
234 		EEPROM_set_cs_line((data & 0x80000000) ? CLEAR_LINE : ASSERT_LINE);
235 		EEPROM_set_clock_line((data & 0x40000000) ? ASSERT_LINE : CLEAR_LINE);
236 
237 		return;
238 	}
239 
240 	logerror("Unk EEPROM write %x mask %x\n", data, mem_mask);
241 }
242 
READ32_HANDLER(psh_eeprom_r)243 static READ32_HANDLER( psh_eeprom_r )
244 {
245 	if (ACCESSING_MSB32)
246 	{
247 		return ((EEPROM_read_bit() << 28) | (readinputport(4) << 24)); /* EEPROM | Region */
248 	}
249 
250 	logerror("Unk EEPROM read mask %x\n", mem_mask);
251 
252 	return 0;
253 }
254 
INTERRUPT_GEN(psikyosh_interrupt)255 static INTERRUPT_GEN(psikyosh_interrupt)
256 {
257 	cpu_set_irq_line(0, 4, HOLD_LINE);
258 }
259 
READ32_HANDLER(io32_r)260 static READ32_HANDLER(io32_r)
261 {
262 	return ((readinputport(0) << 24) | (readinputport(1) << 16) | (readinputport(2) << 8) | (readinputport(3) << 0));
263 }
264 
WRITE32_HANDLER(paletteram32_RRRRRRRRGGGGGGGGBBBBBBBBxxxxxxxx_dword_w)265 static WRITE32_HANDLER( paletteram32_RRRRRRRRGGGGGGGGBBBBBBBBxxxxxxxx_dword_w )
266 {
267 	int r,g,b;
268 	COMBINE_DATA(&paletteram32[offset]); /* is this ok .. */
269 
270 	b = ((paletteram32[offset] & 0x0000ff00) >>8);
271 	g = ((paletteram32[offset] & 0x00ff0000) >>16);
272 	r = ((paletteram32[offset] & 0xff000000) >>24);
273 
274 	palette_set_color(offset,r,g,b);
275 }
276 
WRITE32_HANDLER(psikyosh_vidregs_w)277 static WRITE32_HANDLER( psikyosh_vidregs_w )
278 {
279 	COMBINE_DATA(&psikyosh_vidregs[offset]);
280 
281 #if ROMTEST
282 	if(offset==4) /* Configure bank for gfx test */
283 	{
284 		if (!(mem_mask & 0x000000ff) || !(mem_mask & 0x0000ff00))	// Bank
285 		{
286 			unsigned char *ROM = memory_region(REGION_GFX1);
287 			cpu_setbank(2,&ROM[0x20000 * (psikyosh_vidregs[offset]&0xfff)]); /* Bank comes from vidregs */
288 		}
289 	}
290 #endif
291 }
292 
293 #if ROMTEST
294 static UINT32 sample_offs = 0;
295 
READ32_HANDLER(psh_sample_r)296 static READ32_HANDLER( psh_sample_r ) /* Send sample data for test */
297 {
298 	unsigned char *ROM = memory_region(REGION_SOUND1);
299 
300 	return ROM[sample_offs++]<<16;
301 }
302 #endif
303 
READ32_HANDLER(psh_ymf_fm_r)304 static READ32_HANDLER( psh_ymf_fm_r )
305 {
306 	return YMF278B_status_port_0_r(0)<<24; /* Also, bit 0 being high indicates not ready to send sample data for test */
307 }
308 
WRITE32_HANDLER(psh_ymf_fm_w)309 static WRITE32_HANDLER( psh_ymf_fm_w )
310 {
311 	if (!(mem_mask & 0xff000000))	// FM bank 1 address (OPL2/OPL3 compatible)
312 	{
313 		YMF278B_control_port_0_A_w(0, data>>24);
314 	}
315 
316 	if (!(mem_mask & 0x00ff0000))	// FM bank 1 data
317 	{
318 		YMF278B_data_port_0_A_w(0, data>>16);
319 	}
320 
321 	if (!(mem_mask & 0x0000ff00))	// FM bank 2 address (OPL3/YMF 262 extended)
322 	{
323 		YMF278B_control_port_0_B_w(0, data>>8);
324 	}
325 
326 	if (!(mem_mask & 0x000000ff))	// FM bank 2 data
327 	{
328 		YMF278B_data_port_0_B_w(0, data);
329 	}
330 }
331 
WRITE32_HANDLER(psh_ymf_pcm_w)332 static WRITE32_HANDLER( psh_ymf_pcm_w )
333 {
334 	if (!(mem_mask & 0xff000000))	// PCM address (OPL4/YMF 278B extended)
335 	{
336 		YMF278B_control_port_0_C_w(0, data>>24);
337 
338 #if ROMTEST
339 		if (data>>24 == 0x06)	// Reset Sample reading (They always write this code immediately before reading data)
340 		{
341 			sample_offs = 0;
342 		}
343 #endif
344 	}
345 
346 	if (!(mem_mask & 0x00ff0000))	// PCM data
347 	{
348 		YMF278B_data_port_0_C_w(0, data>>16);
349 	}
350 }
351 
MEMORY_READ32_START(ps3v1_readmem)352 static MEMORY_READ32_START( ps3v1_readmem )
353 	{ 0x00000000, 0x000fffff, MRA32_ROM },	// program ROM (1 meg)
354 	{ 0x02000000, 0x021fffff, MRA32_BANK1 }, // data ROM
355 	{ 0x03000000, 0x03003fff, MRA32_RAM },	// sprites
356 	{ 0x03004000, 0x0300ffff, MRA32_RAM },
357 	{ 0x03040000, 0x03044fff, MRA32_RAM },
358 	{ 0x03050000, 0x030501ff, MRA32_RAM },
359 	{ 0x0305ffdc, 0x0305ffdf, MRA32_NOP }, // also writes to this address - might be vblank reads?
360 	{ 0x0305ffe0, 0x0305ffff, MRA32_RAM }, //  video registers
361 	{ 0x05000000, 0x05000003, psh_ymf_fm_r }, // read YMF status
362 	{ 0x05800000, 0x05800003, io32_r },
363 	{ 0x05800004, 0x05800007, psh_eeprom_r },
364 	{ 0x06000000, 0x060fffff, MRA32_RAM }, // main RAM (1 meg)
365 
366 #if ROMTEST
367 	{ 0x05000004, 0x05000007, psh_sample_r }, // data for rom tests (Used to verify Sample rom)
368 	{ 0x03060000, 0x0307ffff, MRA32_BANK2 }, // data for rom tests (gfx), data is controlled by vidreg
369 	{ 0x04060000, 0x0407ffff, MRA32_BANK2 }, // data for rom tests (gfx) (Mirrored?)
370 #endif
371 MEMORY_END
372 
373 static MEMORY_WRITE32_START( ps3v1_writemem )
374 	{ 0x00000000, 0x000fffff, MWA32_ROM },	// program ROM (1 meg)
375 	{ 0x02000000, 0x021fffff, MWA32_ROM }, // data ROM
376 	{ 0x03000000, 0x03003fff, MWA32_RAM, &spriteram32, &spriteram_size },	// sprites (might be a bit longer)
377 	{ 0x03004000, 0x0300ffff, MWA32_RAM, &psikyosh_bgram }, // backgrounds
378 	{ 0x03040000, 0x03044fff, paletteram32_RRRRRRRRGGGGGGGGBBBBBBBBxxxxxxxx_dword_w, &paletteram32 }, // palette..
379 	{ 0x03050000, 0x030501ff, MWA32_RAM, &psikyosh_zoomram }, // a gradient sometimes ...
380 	{ 0x0305ffdc, 0x0305ffdf, MWA32_RAM }, // also reads from this address
381 	{ 0x0305ffe0, 0x0305ffff, psikyosh_vidregs_w, &psikyosh_vidregs }, //  video registers
382 	{ 0x05000000, 0x05000003, psh_ymf_fm_w }, // first 2 OPL4 register banks
383 	{ 0x05000004, 0x05000007, psh_ymf_pcm_w }, // third OPL4 register bank
384 	{ 0x05800004, 0x05800007, psh_eeprom_w },
385 	{ 0x06000000, 0x060fffff, MWA32_RAM, &psh_ram }, // work RAM
386 MEMORY_END
387 
388 static MEMORY_READ32_START( ps5_readmem )
389 	{ 0x00000000, 0x000fffff, MRA32_ROM }, // program ROM (1 meg)
390 	{ 0x03000000, 0x03000003, io32_r },
391 	{ 0x03000004, 0x03000007, psh_eeprom_r },
392 	{ 0x03100000, 0x03100003, psh_ymf_fm_r },
393 	{ 0x04000000, 0x04003fff, MRA32_RAM },	// sprites
394 	{ 0x04004000, 0x0400ffff, MRA32_RAM },
395 	{ 0x04040000, 0x04044fff, MRA32_RAM },
396 	{ 0x04050000, 0x040501ff, MRA32_RAM },
397 	{ 0x0405ffdc, 0x0405ffdf, MRA32_NOP }, // also writes to this address - might be vblank reads?
398 	{ 0x0405ffe0, 0x0405ffff, MRA32_RAM }, // video registers
399 	{ 0x05000000, 0x0507ffff, MRA32_BANK1 }, // data ROM
400 	{ 0x06000000, 0x060fffff, MRA32_RAM },
401 
402 #if ROMTEST
403 	{ 0x03100004, 0x03100007, psh_sample_r }, // data for rom tests (Used to verify Sample rom)
404 	{ 0x04060000, 0x0407ffff, MRA32_BANK2 }, // data for rom tests (gfx), data is controlled by vidreg
405 #endif
406 MEMORY_END
407 
408 static MEMORY_WRITE32_START( ps5_writemem )
409 	{ 0x00000000, 0x000fffff, MWA32_ROM },	// program ROM (1 meg)
410 	{ 0x03000004, 0x03000007, psh_eeprom_w },
411 	{ 0x03100000, 0x03100003, psh_ymf_fm_w }, // first 2 OPL4 register banks
412 	{ 0x03100004, 0x03100007, psh_ymf_pcm_w }, // third OPL4 register bank
413 	{ 0x04000000, 0x04003fff, MWA32_RAM, &spriteram32, &spriteram_size },
414 	{ 0x04004000, 0x0400ffff, MWA32_RAM, &psikyosh_bgram }, // backgrounds
415 	{ 0x04040000, 0x04044fff, paletteram32_RRRRRRRRGGGGGGGGBBBBBBBBxxxxxxxx_dword_w, &paletteram32 },
416 	{ 0x04050000, 0x040501ff, MWA32_RAM, &psikyosh_zoomram },
417 	{ 0x0405ffdc, 0x0405ffdf, MWA32_RAM }, // also reads from this address
418 	{ 0x0405ffe0, 0x0405ffff, psikyosh_vidregs_w, &psikyosh_vidregs }, // video registers
419 	{ 0x05000000, 0x0507ffff, MWA32_ROM }, // data ROM
420 	{ 0x06000000, 0x060fffff, MWA32_RAM, &psh_ram },
421 MEMORY_END
422 
423 static void irqhandler(int linestate)
424 {
425 	if (linestate)
426 		cpu_set_irq_line(0, 12, ASSERT_LINE);
427 	else
428 		cpu_set_irq_line(0, 12, CLEAR_LINE);
429 }
430 
431 static struct YMF278B_interface ymf278b_interface =
432 {
433 	1,
434 	{ MASTER_CLOCK/2 },
435 	{ REGION_SOUND1 },
436 	{ YM3012_VOL(100, MIXER_PAN_CENTER, 100, MIXER_PAN_CENTER) },
437 	{ irqhandler }
438 };
439 
440 static MACHINE_DRIVER_START( psikyo3v1 )
441 	/* basic machine hardware */
442 	MDRV_CPU_ADD_TAG("main", SH2, MASTER_CLOCK/2)
MDRV_CPU_MEMORY(ps3v1_readmem,ps3v1_writemem)443 	MDRV_CPU_MEMORY(ps3v1_readmem,ps3v1_writemem)
444 	MDRV_CPU_VBLANK_INT(psikyosh_interrupt,1)
445 
446 	MDRV_FRAMES_PER_SECOND(60)
447 	MDRV_VBLANK_DURATION(DEFAULT_60HZ_VBLANK_DURATION)
448 
449 	MDRV_NVRAM_HANDLER(93C56)
450 
451 	/* video hardware */
452 	MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER | VIDEO_NEEDS_6BITS_PER_GUN | VIDEO_BUFFERS_SPRITERAM | VIDEO_RGB_DIRECT) /* If using alpha */
453 	MDRV_SCREEN_SIZE(64*8, 32*8)
454 	MDRV_VISIBLE_AREA(0, 40*8-1, 0, 28*8-1)
455 	MDRV_GFXDECODE(gfxdecodeinfo)
456 	MDRV_PALETTE_LENGTH(0x5000/4)
457 
458 	MDRV_VIDEO_START(psikyosh)
459 	MDRV_VIDEO_EOF(psikyosh)
460 	MDRV_VIDEO_UPDATE(psikyosh)
461 
462 	/* sound hardware */
463 	MDRV_SOUND_ATTRIBUTES(SOUND_SUPPORTS_STEREO)
464 	MDRV_SOUND_ADD(YMF278B, ymf278b_interface)
465 MACHINE_DRIVER_END
466 
467 static MACHINE_DRIVER_START( psikyo5 )
468 	/* basic machine hardware */
469 	MDRV_IMPORT_FROM(psikyo3v1)
470 
471 	MDRV_CPU_MODIFY("main")
472 	MDRV_CPU_MEMORY(ps5_readmem,ps5_writemem)
473 MACHINE_DRIVER_END
474 
475 #define UNUSED_PORT \
476 	PORT_START	/* not read? */ \
477 	PORT_BIT(  0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) \
478 	PORT_BIT(  0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) \
479 	PORT_BIT(  0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) \
480 	PORT_BIT(  0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) \
481 	PORT_BIT(  0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) \
482 	PORT_BIT(  0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) \
483 	PORT_BIT(  0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) \
484 	PORT_BIT(  0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
485 
486 #define PORT_COIN( debug ) \
487 	PORT_START /* IN3 system inputs */ \
488 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1    ) \
489 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2    ) \
490 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN  ) \
491 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN  ) \
492 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 ) \
493 	PORT_BITX(0x20, IP_ACTIVE_LOW, IPT_SERVICE, DEF_STR( Service_Mode ), KEYCODE_F2, IP_JOY_NONE ) \
494 	PORT_DIPNAME( 0x40, debug ? 0x00 : 0x40, "Debug" ) /* Must be high for dragnblz, low for others (Resets EEPROM?). Debug stuff */ \
495 	PORT_DIPSETTING(    0x40, DEF_STR( Off ) ) \
496 	PORT_DIPSETTING(    0x00, DEF_STR( On ) ) \
497 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN  )
498 
499 #define PORT_PLAYER( player, start, buttons ) \
500 	PORT_START \
501 	PORT_BIT(  0x01, IP_ACTIVE_LOW, start ) \
502 	PORT_BIT(  0x02, IP_ACTIVE_LOW, (buttons>=3)?(IPT_BUTTON3 | player):IPT_UNKNOWN ) \
503 	PORT_BIT(  0x04, IP_ACTIVE_LOW, (buttons>=2)?(IPT_BUTTON2 | player):IPT_UNKNOWN ) \
504 	PORT_BIT(  0x08, IP_ACTIVE_LOW, (buttons>=1)?(IPT_BUTTON1 | player):IPT_UNKNOWN ) \
505 	PORT_BIT(  0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | player ) \
506 	PORT_BIT(  0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | player ) \
507 	PORT_BIT(  0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | player ) \
508 	PORT_BIT(  0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | player )
509 
510 INPUT_PORTS_START( s1945ii )
511 	PORT_PLAYER( IPF_PLAYER1, IPT_START1, 2 )
512 	PORT_PLAYER( IPF_PLAYER2, IPT_START2, 2 )
513 	UNUSED_PORT /* IN2 unused? */
514 	PORT_COIN( 0 )
515 
516 	PORT_START /* IN4 jumper pads on the PCB */
517 	PORT_DIPNAME( 0x01, 0x01, "Region" )
518 	PORT_DIPSETTING(    0x00, "Japan" )
519 	PORT_DIPSETTING(    0x01, "World" )
520 INPUT_PORTS_END
521 
522 INPUT_PORTS_START( soldivid )
523 	PORT_PLAYER( IPF_PLAYER1, IPT_START1, 3 )
524 	PORT_PLAYER( IPF_PLAYER2, IPT_START2, 3 )
525 	UNUSED_PORT /* IN2 unused? */
526 	PORT_COIN( 0 )
527 
528 	PORT_START /* IN4 jumper pads on the PCB */
529 	PORT_DIPNAME( 0x01, 0x01, "Region" )
530 	PORT_DIPSETTING(    0x00, "Japan" )
531 	PORT_DIPSETTING(    0x01, "World" )
532 INPUT_PORTS_END
533 
534 INPUT_PORTS_START( daraku )
535 	PORT_PLAYER( IPF_PLAYER1, IPT_START1, 2 )
536 	PORT_PLAYER( IPF_PLAYER2, IPT_START2, 2 )
537 
538 	PORT_START  /* IN2 more controls */
539 	PORT_BIT(  0x01, IP_ACTIVE_LOW, IPT_UNKNOWN                      )
540 	PORT_BIT(  0x02, IP_ACTIVE_LOW, IPT_UNKNOWN                      )
541 	PORT_BIT(  0x04, IP_ACTIVE_LOW, IPT_BUTTON4        | IPF_PLAYER2 )
542 	PORT_BIT(  0x08, IP_ACTIVE_LOW, IPT_BUTTON3        | IPF_PLAYER2 )
543 	PORT_BIT(  0x10, IP_ACTIVE_LOW, IPT_UNKNOWN                      )
544 	PORT_BIT(  0x20, IP_ACTIVE_LOW, IPT_UNKNOWN                      )
545 	PORT_BIT(  0x40, IP_ACTIVE_LOW, IPT_BUTTON4        | IPF_PLAYER1 )
546 	PORT_BIT(  0x80, IP_ACTIVE_LOW, IPT_BUTTON3        | IPF_PLAYER1 )
547 
548 	PORT_COIN( 0 )
549 
550 	PORT_START /* IN4 jumper pads on the PCB */
551 	PORT_DIPNAME( 0x01, 0x01, "Region" )
552 	PORT_DIPSETTING(    0x00, "Japan" )
553 	PORT_DIPSETTING(    0x01, "World" ) /* Title screen is different, English is default now */
554 INPUT_PORTS_END
555 
556 INPUT_PORTS_START( sbomberb )
557 	PORT_PLAYER( IPF_PLAYER1, IPT_START1, 2 )
558 	PORT_PLAYER( IPF_PLAYER2, IPT_START2, 2 )
559 	UNUSED_PORT /* IN2 unused? */
560 	PORT_COIN( 0 ) /* If HIGH then you can perform rom test, but EEPROM resets? */
561 
562 	PORT_START /* IN4 jumper pads on the PCB */
563 	PORT_DIPNAME( 0x01, 0x01, "Region" )
564 	PORT_DIPSETTING(    0x00, "Japan" )
565 	PORT_DIPSETTING(    0x01, "World" )
566 INPUT_PORTS_END
567 
568 INPUT_PORTS_START( gunbird2 ) /* Different Region */
569 	PORT_PLAYER( IPF_PLAYER1, IPT_START1, 3 )
570 	PORT_PLAYER( IPF_PLAYER2, IPT_START2, 3 )
571 	UNUSED_PORT /* IN2 unused? */
572 	PORT_COIN( 0 ) /* If HIGH then you can perform rom test, but EEPROM resets */
573 
574 	PORT_START /* IN4 jumper pads on the PCB */
575 	PORT_DIPNAME( 0x03, 0x02, "Region" )
576 	PORT_DIPSETTING(    0x00, "Japan" )
577 	PORT_DIPSETTING(    0x01, "International Ver A." )
578 	PORT_DIPSETTING(    0x02, "International Ver B." )
579 INPUT_PORTS_END
580 
581 INPUT_PORTS_START( s1945iii ) /* Different Region again */
582 	PORT_PLAYER( IPF_PLAYER1, IPT_START1, 3 )
583 	PORT_PLAYER( IPF_PLAYER2, IPT_START2, 3 )
584 	UNUSED_PORT /* IN2 unused? */
585 	PORT_COIN( 0 ) /* If HIGH then you can perform rom test, EEPROM doesn't reset */
586 
587 	PORT_START /* IN4 jumper pads on the PCB */
588 	PORT_DIPNAME( 0x03, 0x01, "Region" )
589 	PORT_DIPSETTING(    0x00, "Japan" )
590 	PORT_DIPSETTING(    0x02, "International Ver A." )
591 	PORT_DIPSETTING(    0x01, "International Ver B." )
592 INPUT_PORTS_END
593 
594 INPUT_PORTS_START( dragnblz ) /* Security requires bit high */
595 	PORT_PLAYER( IPF_PLAYER1, IPT_START1, 3 )
596 	PORT_PLAYER( IPF_PLAYER2, IPT_START2, 3 )
597 	UNUSED_PORT /* IN2 unused? */
598 	PORT_COIN( 1 ) /* Must be HIGH (Or Security Error), so can perform test */
599 
600 	PORT_START /* IN4 jumper pads on the PCB */
601 	PORT_DIPNAME( 0x03, 0x01, "Region" )
602 	PORT_DIPSETTING(    0x00, "Japan" )
603 	PORT_DIPSETTING(    0x02, "International Ver A." )
604 	PORT_DIPSETTING(    0x01, "International Ver B." )
605 INPUT_PORTS_END
606 
607 #if ROMTEST
608 #define ROMTEST_GFX 0
609 #else
610 #define ROMTEST_GFX ROMREGION_DISPOSE
611 #endif
612 
613 /* PS3 */
614 
615 ROM_START( soldivid )
616 	ROM_REGION( 0x100000, REGION_CPU1, 0)
617 	ROM_LOAD32_WORD_SWAP( "2-prog_l.u18", 0x000002, 0x080000, CRC(cf179b04) SHA1(343f00a81cffd44334a4db81b6b828b7cf73c1e8) )
618 	ROM_LOAD32_WORD_SWAP( "1-prog_h.u17", 0x000000, 0x080000, CRC(f467d1c4) SHA1(a011e6f310a54f09efa0bf4597783cd78c05ad6f) )
619 
620 	ROM_REGION( 0x3800000, REGION_GFX1, ROMTEST_GFX )
621 	/* This Space Empty! */
622 	ROM_LOAD32_WORD_SWAP( "4l.u10", 0x2000000, 0x400000, CRC(9eb9f269) SHA1(4a4d90eefe62b5462f5ed5e062eea7b6b4900f85) )
623 	ROM_LOAD32_WORD_SWAP( "4h.u31", 0x2000002, 0x400000, CRC(7c76cfe7) SHA1(14e291e840a4afe3802fe1847615c5e806d7492a) )
624 	ROM_LOAD32_WORD_SWAP( "5l.u9",  0x2800000, 0x400000, CRC(c59c6858) SHA1(bd580b57e432ef42295060c5a84c8129d9b995f7) )
625 	ROM_LOAD32_WORD_SWAP( "5h.u30", 0x2800002, 0x400000, CRC(73bc66d0) SHA1(7988ce81ff43235a3b30ddd8fd9419530a07b6ba) )
626 	ROM_LOAD32_WORD_SWAP( "6l.u8",  0x3000000, 0x400000, CRC(f01b816e) SHA1(2a0d86c1c106eef539028aa9ebe49d13216a6b9c) )
627 	ROM_LOAD32_WORD_SWAP( "6h.u37", 0x3000002, 0x400000, CRC(fdd57361) SHA1(f58d91acde1f4e6d4f0e8dcd1b23aa5092d89916) )
628 
629 	ROM_REGION( 0x400000, REGION_SOUND1, 0 )
630 	ROM_LOAD( "sound.bin", 0x000000, 0x400000, CRC(e98f8d45) SHA1(7791c0f31d08f37c6ec65e7cecf8ef54ca73b1fd) )
631 ROM_END
632 
633 ROM_START( s1945ii )
634 	ROM_REGION( 0x100000, REGION_CPU1, 0) /* Code */
635 	ROM_LOAD32_WORD_SWAP( "2_prog_l.u18", 0x000002, 0x080000, CRC(20a911b8) SHA1(82ba7b93bd621fc45a4dc2722752077b59a0a233) )
636 	ROM_LOAD32_WORD_SWAP( "1_prog_h.u17", 0x000000, 0x080000, CRC(4c0fe85e) SHA1(74f810a1c3e9d629c8b190f68d73ce07b11f77b7) )
637 
638 	ROM_REGION( 0x2000000, REGION_GFX1, ROMTEST_GFX )	/* Tiles */
639 	ROM_LOAD32_WORD( "0l.u4",    0x0000000, 0x400000, CRC(bfacf98d) SHA1(19954f12881e6e95e808bd1f2c2f5a425786727f) )
640 	ROM_LOAD32_WORD( "0h.u13",   0x0000002, 0x400000, CRC(1266f67c) SHA1(cf93423a827aa92aa54afbbecf8509d2590edc9b) )
641 	ROM_LOAD32_WORD( "1l.u3",    0x0800000, 0x400000, CRC(2d3332c9) SHA1(f2e54100a48061bfd589e8765f59ca051176a38b) )
642 	ROM_LOAD32_WORD( "1h.u12",   0x0800002, 0x400000, CRC(27b32c3e) SHA1(17a80b3c919d8a282169c019ede8a22d2079c018) )
643 	ROM_LOAD32_WORD( "2l.u2",    0x1000000, 0x400000, CRC(91ba6d23) SHA1(fd016a90204b2de43bb709971f7cd891f839de1a) )
644 	ROM_LOAD32_WORD( "2h.u20",   0x1000002, 0x400000, CRC(fabf4334) SHA1(f8ec43e083b674700f532575f0d067bd49c5aaf7) )
645 	ROM_LOAD32_WORD( "3l.u1",    0x1800000, 0x400000, CRC(a6c3704e) SHA1(cb9881e4235cc8e4bcca4c6ccbd8d8d8634e3624) )
646 	ROM_LOAD32_WORD( "3h.u19",   0x1800002, 0x400000, CRC(4cd3ca70) SHA1(5b0a6ea4fe0e821cebe6e840596f648e24dded51) )
647 
648 	ROM_REGION( 0x800000, REGION_SOUND1, 0 ) /* Samples */
649 	ROM_LOAD( "sound.u32", 0x000000, 0x400000, CRC(ba680ca7) SHA1(b645896e297aad426784aa656bff738e1b33c2a2) )
650 	ROM_RELOAD ( 0x400000, 0x400000 )
651 	/* 0x400000 - 0x7fffff allocated but left blank, it randomly reads from here on the
652 	    Iron Casket level causing a crash otherwise, not sure why, bug in the sound emulation? */
653 ROM_END
654 
655 ROM_START( daraku )
656 	/* main program */
657 	ROM_REGION( 0x200000, REGION_CPU1, 0)
658 	ROM_LOAD32_WORD_SWAP( "4_prog_l.u18", 0x000002, 0x080000, CRC(660b4609) SHA1(ee6b5606fae41881c3e671ee642baae5c03331ca) )
659 	ROM_LOAD32_WORD_SWAP( "3_prog_h.u17", 0x000000, 0x080000, CRC(7a9cf601) SHA1(8df464ce3fd02b30dd2ab77828594f4916375fd5) )
660 	ROM_LOAD16_WORD_SWAP( "prog.u16",     0x100000, 0x100000, CRC(3742e990) SHA1(dd4b8777e57245151b3d520ed1bdab207530420b) )
661 
662 	ROM_REGION( 0x3400000, REGION_GFX1, ROMTEST_GFX )
663 	ROM_LOAD32_WORD( "0l.u4",  0x0000000, 0x400000, CRC(565d8427) SHA1(090ce9213c530d29e488cfb89bb39fd7169985d5) )
664 	ROM_LOAD32_WORD( "0h.u13", 0x0000002, 0x400000, CRC(9a602630) SHA1(ab176490b36aec7ce30d1cf20b57c02c926c59d3) )
665 	ROM_LOAD32_WORD( "1l.u3",  0x0800000, 0x400000, CRC(ac5ce8e1) SHA1(7df6a04ea2530cc669581474e8b8ee6f59caae1b) )
666 	ROM_LOAD32_WORD( "1h.u12", 0x0800002, 0x400000, CRC(b0a59f7b) SHA1(8704705aa0977f11da8bcdafae6e2531190878d0) )
667 	ROM_LOAD32_WORD( "2l.u2",  0x1000000, 0x400000, CRC(2daa03b2) SHA1(475badc60cbd26786242d685a3d7dbaf385862a8) )
668 	ROM_LOAD32_WORD( "2h.u20", 0x1000002, 0x400000, CRC(e98e185a) SHA1(124d5fcf6cfb1faf70d665b687564bf6589d17c4) )
669 	ROM_LOAD32_WORD( "3l.u1",  0x1800000, 0x400000, CRC(1d372aa1) SHA1(e5965a1d8919409a314dfd56482a848d6ab9f5ac) )
670 	ROM_LOAD32_WORD( "3h.u19", 0x1800002, 0x400000, CRC(597f3f15) SHA1(62bf74ed29732e6cc1979458745cdb53a8edddf3) )
671 	ROM_LOAD32_WORD( "4l.u10", 0x2000000, 0x400000, CRC(e3d58cd8) SHA1(9482d0b71f840d72b20029804cfc8dca207462de) )
672 	ROM_LOAD32_WORD( "4h.u31", 0x2000002, 0x400000, CRC(aebc9cd0) SHA1(c20a1f9851ace74e00f1a0746e0c9e751ccec336) )
673 	ROM_LOAD32_WORD( "5l.u9",  0x2800000, 0x400000, CRC(eab5a50b) SHA1(76ce96e89afc438bafb9f8caa86eb48fb7e4e154) )
674 	ROM_LOAD32_WORD( "5h.u30", 0x2800002, 0x400000, CRC(f157474f) SHA1(89509f0772a40829070cea708c21438ff61d1019) )
675 	ROM_LOAD32_WORD( "6l.u8",  0x3000000, 0x200000, CRC(9f008d1b) SHA1(9607e09bde430eefe126569a6e251114bc8f754b) )
676 	ROM_LOAD32_WORD( "6h.u37", 0x3000002, 0x200000, CRC(acd2d0e3) SHA1(dee96bdf3b8efde1298b73c5e7dd62abcdc101cf) )
677 
678 	ROM_REGION( 0x400000, REGION_SOUND1, 0 ) /* Samples */
679 	ROM_LOAD( "sound.u32", 0x000000, 0x400000, CRC(ef2c781d) SHA1(1313f082f6dbe4da0efaf261226085eb7325667f) )
680 ROM_END
681 
682 ROM_START( sbomberb )
683 	ROM_REGION( 0x100000, REGION_CPU1, 0)
684 	ROM_LOAD32_WORD_SWAP( "1-b_pr_l.u18", 0x000002, 0x080000, CRC(52d12225) SHA1(0a31a5d557414e7bf51dc6f7fbdd417a20b78df1) )
685 	ROM_LOAD32_WORD_SWAP( "1-b_pr_h.u17", 0x000000, 0x080000, CRC(1bbd0345) SHA1(c6ccb7c97cc9e9ea298c1883d1dd5563907a7255) )
686 
687 	ROM_REGION( 0x2800000, REGION_GFX1, ROMTEST_GFX )
688 	ROM_LOAD32_WORD( "0l.u4",  0x0000000, 0x400000, CRC(b7e4ac51) SHA1(70e802b6235932116496a77ee0c78a256e85aff3) )
689 	ROM_LOAD32_WORD( "0h.u13", 0x0000002, 0x400000, CRC(235e6c27) SHA1(c597d7b5bef4edac1474ad0024cfb33eb1257106) )
690 	ROM_LOAD32_WORD( "1l.u3",  0x0800000, 0x400000, CRC(3c88c48c) SHA1(d1ce4ab60ba18449bbd96e29c310e060a0bb6de6) )
691 	ROM_LOAD32_WORD( "1h.u12", 0x0800002, 0x400000, CRC(15626a6e) SHA1(5493e92c9724982938591d758bee7d86cf96fd19) )
692 	ROM_LOAD32_WORD( "2l.u2",  0x1000000, 0x400000, CRC(41e92f64) SHA1(ea121c7cb35266ed0c21af4bb958fe5d73d84977) )
693 	ROM_LOAD32_WORD( "2h.u20", 0x1000002, 0x400000, CRC(4ae62e84) SHA1(adc1dab2f09aa4f5665d7bb7603a9b75c978031e) )
694 	ROM_LOAD32_WORD( "3l.u1",  0x1800000, 0x400000, CRC(43ba5f0f) SHA1(b8f93ed055441fd06b68103c9fd62b6aa3f3da7d) )
695 	ROM_LOAD32_WORD( "3h.u19", 0x1800002, 0x400000, CRC(ff01bb12) SHA1(df6fab898356c02f34ee7a45fdcc265218f2f20e) )
696 	ROM_LOAD32_WORD( "4l.u10", 0x2000000, 0x400000, CRC(e491d593) SHA1(12a7f6c282969be342b70443b8c802a399571245) )
697 	ROM_LOAD32_WORD( "4h.u31", 0x2000002, 0x400000, CRC(7bdd377a) SHA1(e357c98f82b8ea3ae4fd8eae6c1ad2dfb500db9c) )
698 
699 	ROM_REGION( 0x400000, REGION_SOUND1, 0 ) /* Samples */
700 	ROM_LOAD( "sound.u32", 0x000000, 0x400000, CRC(85cbff69) SHA1(34c7f4d337111de2064f84214294b6bdc37bf16c) )
701 ROM_END
702 
703 /* PS5 */
704 
705 ROM_START( gunbird2 )
706 	ROM_REGION( 0x180000, REGION_CPU1, 0)
707 	ROM_LOAD32_WORD_SWAP( "2_prog_l.u16", 0x000002, 0x080000, CRC(76f934f0) SHA1(cf197796d66f15639a6b3d5311c18da33cefd06b) )
708 	ROM_LOAD32_WORD_SWAP( "1_prog_h.u17", 0x000000, 0x080000, CRC(7328d8bf) SHA1(c640de1ab5b32400b2d77e0dc6e3ee0f78ab7803) )
709 	ROM_LOAD16_WORD_SWAP( "3_pdata.u1",   0x100000, 0x080000, CRC(a5b697e6) SHA1(947f124fa585c2cf77c6571af7559bd652897b89) )
710 
711 	ROM_REGION( 0x3800000, REGION_GFX1, ROMTEST_GFX )
712 	ROM_LOAD32_WORD( "0l.u3",  0x0000000, 0x800000, CRC(5c826bc8) SHA1(74fb6b242b4c5fe5365cfcc3029ed6da4cf3a621) )
713 	ROM_LOAD32_WORD( "0h.u10", 0x0000002, 0x800000, CRC(3df0cb6c) SHA1(271d276fa0f63d84e458223316a9517865fc2255) )
714 	ROM_LOAD32_WORD( "1l.u4",  0x1000000, 0x800000, CRC(1558358d) SHA1(e3b9c3da4e9b29ffa9568b57d14fe2b600aead68) )
715 	ROM_LOAD32_WORD( "1h.u11", 0x1000002, 0x800000, CRC(4ee0103b) SHA1(29bbe0162dda39919fcd188ea4a6b7b5f20366ff) )
716 	ROM_LOAD32_WORD( "2l.u5",  0x2000000, 0x800000, CRC(e1c7a7b8) SHA1(b5f6e5d53e21928197773df7dde0e7c83f4082af) )
717 	ROM_LOAD32_WORD( "2h.u12", 0x2000002, 0x800000, CRC(bc8a41df) SHA1(90460b11eea778f17cf8be67430e2ab149680686) )
718 	ROM_LOAD32_WORD( "3l.u6",  0x3000000, 0x400000, CRC(0229d37f) SHA1(f9d98d1d2dda2d552b2a46c76b4c7fc84b1aa4c6) )
719 	ROM_LOAD32_WORD( "3h.u13", 0x3000002, 0x400000, CRC(f41bbf2b) SHA1(b705274e392541e2f513a4ae4bae543c03be0913) )
720 
721 	ROM_REGION( 0x400000, REGION_SOUND1, 0 ) /* Samples */
722 	ROM_LOAD( "sound.u9", 0x000000, 0x400000, CRC(f19796ab) SHA1(b978f0550ebd675e8ce9d9edcfcc3f6214e49e8b) )
723 ROM_END
724 
725 ROM_START( s1945iii )
726 	ROM_REGION( 0x180000, REGION_CPU1, 0)
727 	ROM_LOAD32_WORD_SWAP( "2_progl.u16", 0x000002, 0x080000, CRC(5d5d385f) SHA1(67b3bcabd71cf084bcea7a59939281a8d6257059) )
728 	ROM_LOAD32_WORD_SWAP( "1_progh.u17", 0x000000, 0x080000, CRC(1b8a5a18) SHA1(718a176bd48e16f964fcb07c568b5227cfc0515f) )
729 	ROM_LOAD16_WORD_SWAP( "3_data.u1",   0x100000, 0x080000, CRC(8ff5f7d3) SHA1(420a3d7f2d5ab6a56789d36b418431f12f5f73f5) )
730 
731 	ROM_REGION( 0x3800000, REGION_GFX1, ROMTEST_GFX )
732 	ROM_LOAD32_WORD( "0l.u3",  0x0000000, 0x800000, CRC(70a0d52c) SHA1(c9d9534da59123b577dc22020273b94ccdeeb67d) )
733 	ROM_LOAD32_WORD( "0h.u10", 0x0000002, 0x800000, CRC(4dcd22b4) SHA1(2df7a7d08df17d2a62d574fccc8ba40aaae21a13) )
734 	ROM_LOAD32_WORD( "1l.u4",  0x1000000, 0x800000, CRC(de1042ff) SHA1(468f6dfd5c1f2084c573b6851e314ff2826dc350) )
735 	ROM_LOAD32_WORD( "1h.u11", 0x1000002, 0x800000, CRC(b51a4430) SHA1(b51117591b0e351e922f9a6a7930e8b50237e54e) )
736 	ROM_LOAD32_WORD( "2l.u5",  0x2000000, 0x800000, CRC(23b02dca) SHA1(0249dceca02b312301a917d98fac481b6a0a9122) )
737 	ROM_LOAD32_WORD( "2h.u12", 0x2000002, 0x800000, CRC(9933ab04) SHA1(710e6b20e111c1898666b4466554d039309883cc) )
738 	ROM_LOAD32_WORD( "3l.u6",  0x3000000, 0x400000, CRC(f693438c) SHA1(d70e25a3f56aae6575c696d9b7b6d7a9d04f0104) )
739 	ROM_LOAD32_WORD( "3h.u13", 0x3000002, 0x400000, CRC(2d0c334f) SHA1(74d94abb34484c7b79dbb989645f53124e53e3b7) )
740 
741 	ROM_REGION( 0x800000, REGION_SOUND1, 0 ) /* Samples */
742 	ROM_LOAD( "sound.u9", 0x000000, 0x400000, CRC(c5374beb) SHA1(d13e12cbd249246d953c45bb3bfa576a0ec75595) )
743 	ROM_RELOAD ( 0x400000, 0x400000 )
744 ROM_END
745 
746 /* PS5v2 */
747 
748 ROM_START( dragnblz )
749 	ROM_REGION( 0x100000, REGION_CPU1, 0)
750 	ROM_LOAD32_WORD_SWAP( "2prog_h.u21",   0x000000, 0x080000, CRC(fc5eade8) SHA1(e5d05543641e4a3900b0d42e0d5f75734683d635) )
751 	ROM_LOAD32_WORD_SWAP( "1prog_l.u22",   0x000002, 0x080000, CRC(95d6fd02) SHA1(2b2830e7fa66cbd13666191762bfddc40571caec) )
752 
753 	ROM_REGION( 0x2c00000, REGION_GFX1, ROMTEST_GFX )	/* Sprites */
754 	ROM_LOAD32_WORD( "1l.u4",  0x0400000, 0x200000, CRC(c2eb565c) SHA1(07e41b36cc03a87f28d091754fdb0d1a7316a532) )
755 	ROM_LOAD32_WORD( "1h.u12", 0x0400002, 0x200000, CRC(23cb46b7) SHA1(005b7cc40eea103688a64a72c219c7535970dbfb) )
756 	ROM_LOAD32_WORD( "2l.u5",  0x0800000, 0x200000, CRC(bc256aea) SHA1(1f1d678e8a63513a95f296b8a07d2ea485d1e53f) )
757 	ROM_LOAD32_WORD( "2h.u13", 0x0800002, 0x200000, CRC(b75f59ec) SHA1(a6cde94bc972e46e54c962fde49fc2174b312882) )
758 	ROM_LOAD32_WORD( "3l.u6",  0x0c00000, 0x200000, CRC(4284f008) SHA1(610b13304043411b3088fd4299b3cb0a4d8b0cc2) )
759 	ROM_LOAD32_WORD( "3h.u14", 0x0c00002, 0x200000, CRC(abe5cbbf) SHA1(c2fb1d8ea8772572c08b36496cf9fc5b91cf848b) )
760 	ROM_LOAD32_WORD( "4l.u7",  0x1000000, 0x200000, CRC(c9fcf2e5) SHA1(7cecdf3406da11289b54aaf58d12883ddfdc5e6b) )
761 	ROM_LOAD32_WORD( "4h.u15", 0x1000002, 0x200000, CRC(0ab0a12a) SHA1(1b29b6dc79e69edb56634517365d0ee8e6ea78ae) )
762 	ROM_LOAD32_WORD( "5l.u8",  0x1400000, 0x200000, CRC(68d03ccf) SHA1(d2bf6da5fa6e346b05872ed9616ffe51c3768f50) )
763 	ROM_LOAD32_WORD( "5h.u16", 0x1400002, 0x200000, CRC(5450fbca) SHA1(7a804263549cea951782a67855e69cb8cb417e98) )
764 	ROM_LOAD32_WORD( "6l.u1",  0x1800000, 0x200000, CRC(8b52c90b) SHA1(e1067ef252870787e46c62015e5778b4e641e68d) )
765 	ROM_LOAD32_WORD( "6h.u2",  0x1800002, 0x200000, CRC(7362f929) SHA1(9ced06202e3f104d30377aeef489021d26e87f73) )
766 	ROM_LOAD32_WORD( "7l.u19", 0x1c00000, 0x200000, CRC(b4f4d86e) SHA1(2ad786c5626c98e6943ae05688a1b66307ceac84) )
767 	ROM_LOAD32_WORD( "7h.u20", 0x1c00002, 0x200000, CRC(44b7b9cc) SHA1(3f8122b62ea1183d9fb3aad32d0e47bd32244f87) )
768 	ROM_LOAD32_WORD( "8l.u28", 0x2000000, 0x200000, CRC(cd079f89) SHA1(49c46eb36bc0458428a7fad3fe622f5ed974073b) )
769 	ROM_LOAD32_WORD( "8h.u29", 0x2000002, 0x200000, CRC(3edb508a) SHA1(72b07fb34a94cc127de02070604b1ff31f3d46c7) )
770 	ROM_LOAD32_WORD( "9l.u41", 0x2400000, 0x200000, CRC(0b53cd78) SHA1(e2071d9fe6c7be4e289b491587ab431c164e59da) )
771 	ROM_LOAD32_WORD( "9h.u42", 0x2400002, 0x200000, CRC(bc61998a) SHA1(75dbefe712104c64576196c27c25dbed59ae3923) )
772 	ROM_LOAD32_WORD( "10l.u58",0x2800000, 0x200000, CRC(a3f5c7f8) SHA1(d17478ca3e7ef46270f350ffa35d43acb05b1185) )
773 	ROM_LOAD32_WORD( "10h.u59",0x2800002, 0x200000, CRC(30e304c4) SHA1(1d866276bfe7f7524306a880d225aaf11ac2e5dd) )
774 
775 	ROM_REGION( 0x800000, REGION_SOUND1, 0 ) /* Samples - Not Dumped */
776 	ROM_LOAD( "snd0.u52", 0x000000, 0x200000, CRC(7fd1b225) SHA1(6aa61021ada51393bbb34fd1aea00b8feccc8197) )
777 ROM_END
778 
779 
780 /* are these right? should i fake the counter return?
781    'speedups / idle skipping isn't needed for 'hotgmck, hgkairak'
782    as the core catches and skips the idle loops automatically'
783 */
784 
785 static READ32_HANDLER( soldivid_speedup_r )
786 {
787  /*
788 PC  : 0001AE74: MOV.L   @R14,R1
789 PC  : 0001AE76: ADD     #$01,R1
790 PC  : 0001AE78: MOV.L   R1,@R14
791 PC  : 0001AE7A: MOV.L   @($7C,PC),R3
792 PC  : 0001AE7C: MOV.L   @R3,R0
793 PC  : 0001AE7E: TST     R0,R0
794 PC  : 0001AE80: BT      $0001AE74
795 */
796 	if (activecpu_get_pc()==0x0001AFAC) cpu_spinuntil_int(); // Character Select + InGame
797 	if (activecpu_get_pc()==0x0001AE76) cpu_spinuntil_int(); // Everything Else?
798 
799 	return psh_ram[0x00000C/4];
800 }
801 
READ32_HANDLER(s1945ii_speedup_r)802 static READ32_HANDLER( s1945ii_speedup_r )
803 {
804 /*
805 PC  : 0609FC68: MOV.L   @R13,R1  // R13 is 600000C  R1 is counter  (read from r13)
806 PC  : 0609FC6A: ADD     #$01,R1  // add 1 to counter
807 PC  : 0609FC6C: MOV.L   R1,@R13  // write it back
808 PC  : 0609FC6E: MOV.L   @($3C,PC),R3 // 609fdac into r3
809 PC  : 0609FC70: MOV.L   @R3,R0  // whats there into r0
810 PC  : 0609FC72: TST     R0,R0 // test
811 PC  : 0609FC74: BT      $0609FC68
812 */
813 	if (activecpu_get_pc()==0x609FC6A) cpu_spinuntil_int(); // Title Screens
814 	if (activecpu_get_pc()==0x609FED4) cpu_spinuntil_int(); // In Game
815 	if (activecpu_get_pc()==0x60A0172) cpu_spinuntil_int(); // Attract Demo
816 
817 	return psh_ram[0x00000C/4];
818 }
819 
READ32_HANDLER(daraku_speedup_r)820 static READ32_HANDLER( daraku_speedup_r )
821 {
822 /*
823 PC  : 00047618: MOV.L   @($BC,PC),R0
824 PC  : 0004761A: MOV.L   @R0,R1
825 PC  : 0004761C: ADD     #$01,R1
826 PC  : 0004761E: MOV.L   R1,@R0
827 PC  : 00047620: MOV.L   @($BC,PC),R3
828 PC  : 00047622: MOV.L   @R3,R0
829 PC  : 00047624: TST     R0,R0
830 PC  : 00047626: BT      $00047618
831 */
832 	if (activecpu_get_pc()==0x0004761C) cpu_spinuntil_int(); // title
833 	if (activecpu_get_pc()==0x00047978) cpu_spinuntil_int(); // ingame
834 
835 	return psh_ram[0x00000C/4];
836 }
837 
READ32_HANDLER(sbomberb_speedup_r)838 static READ32_HANDLER( sbomberb_speedup_r )
839 {
840 /*
841 PC  : 060A10EC: MOV.L   @R13,R3
842 PC  : 060A10EE: ADD     #$01,R3
843 PC  : 060A10F0: MOV.L   R3,@R13
844 PC  : 060A10F2: MOV.L   @($34,PC),R1
845 PC  : 060A10F4: MOV.L   @R1,R2
846 PC  : 060A10F6: TST     R2,R2
847 PC  : 060A10F8: BT      $060A10EC
848 */
849 	if (activecpu_get_pc()==0x060A10EE) cpu_spinuntil_int(); // title
850 	if (activecpu_get_pc()==0x060A165A) cpu_spinuntil_int(); // attract
851 	if (activecpu_get_pc()==0x060A1382) cpu_spinuntil_int(); // game
852 
853 	return psh_ram[0x00000C/4];
854 }
855 
READ32_HANDLER(gunbird2_speedup_r)856 static READ32_HANDLER( gunbird2_speedup_r )
857 {
858 /*
859 PC  : 06028972: MOV.L   @R14,R3   // r14 is 604000c on this one
860 PC  : 06028974: MOV.L   @($D4,PC),R1
861 PC  : 06028976: ADD     #$01,R3
862 PC  : 06028978: MOV.L   R3,@R14
863 PC  : 0602897A: MOV.L   @R1,R2
864 PC  : 0602897C: TST     R2,R2
865 PC  : 0602897E: BT      $06028972
866 */
867 	if (activecpu_get_pc()==0x06028974) cpu_spinuntil_int();
868 	if (activecpu_get_pc()==0x06028E64) cpu_spinuntil_int();
869 	if (activecpu_get_pc()==0x06028BE6) cpu_spinuntil_int();
870 
871 	return psh_ram[0x04000C/4];
872 }
873 
READ32_HANDLER(s1945iii_speedup_r)874 static READ32_HANDLER( s1945iii_speedup_r )
875 {
876 	if (activecpu_get_pc()==0x0602B464) cpu_spinuntil_int(); // start up text
877 	if (activecpu_get_pc()==0x0602B6E2) cpu_spinuntil_int(); // intro attract
878 	if (activecpu_get_pc()==0x0602BC1E) cpu_spinuntil_int(); // game attract
879 	if (activecpu_get_pc()==0x0602B97C) cpu_spinuntil_int(); // game
880 
881 	return psh_ram[0x06000C/4];
882 }
883 
884 
READ32_HANDLER(dragnblz_speedup_r)885 static READ32_HANDLER( dragnblz_speedup_r )
886 {
887 	if (activecpu_get_pc()==0x06027440) cpu_spinuntil_int(); // startup texts
888 	if (activecpu_get_pc()==0x060276E6) cpu_spinuntil_int(); // attract intro
889 	if (activecpu_get_pc()==0x06027C74) cpu_spinuntil_int(); // attract game
890 	if (activecpu_get_pc()==0x060279A8) cpu_spinuntil_int(); // game
891 
892 	return psh_ram[0x006000C/4];
893 }
894 
DRIVER_INIT(soldivid)895 static DRIVER_INIT( soldivid )
896 {
897 	install_mem_read32_handler(0, 0x600000c, 0x600000f, soldivid_speedup_r );
898 	use_factory_eeprom=EEPROM_0;
899 }
900 
DRIVER_INIT(s1945ii)901 static DRIVER_INIT( s1945ii )
902 {
903 	install_mem_read32_handler(0, 0x600000c, 0x600000f, s1945ii_speedup_r );
904 	use_factory_eeprom=EEPROM_DEFAULT;
905 }
906 
DRIVER_INIT(daraku)907 static DRIVER_INIT( daraku )
908 {
909 	unsigned char *RAM = memory_region(REGION_CPU1);
910 	cpu_setbank(1,&RAM[0x100000]);
911 	install_mem_read32_handler(0, 0x600000c, 0x600000f, daraku_speedup_r );
912 	use_factory_eeprom=EEPROM_DARAKU;
913 }
914 
DRIVER_INIT(sbomberb)915 static DRIVER_INIT( sbomberb )
916 {
917 	install_mem_read32_handler(0, 0x600000c, 0x600000f, sbomberb_speedup_r );
918 	use_factory_eeprom=EEPROM_DEFAULT;
919 }
920 
DRIVER_INIT(gunbird2)921 static DRIVER_INIT( gunbird2 )
922 {
923 	unsigned char *RAM = memory_region(REGION_CPU1);
924 	cpu_setbank(1,&RAM[0x100000]);
925 	install_mem_read32_handler(0, 0x604000c, 0x604000f, gunbird2_speedup_r );
926 	use_factory_eeprom=EEPROM_DEFAULT;
927 }
928 
DRIVER_INIT(s1945iii)929 static DRIVER_INIT( s1945iii )
930 {
931 	unsigned char *RAM = memory_region(REGION_CPU1);
932 	cpu_setbank(1,&RAM[0x100000]);
933 	install_mem_read32_handler(0, 0x606000c, 0x606000f, s1945iii_speedup_r );
934 	use_factory_eeprom=EEPROM_S1945III;
935 }
936 
DRIVER_INIT(dragnblz)937 static DRIVER_INIT( dragnblz )
938 {
939 	install_mem_read32_handler(0, 0x606000c, 0x606000f, dragnblz_speedup_r );
940 	use_factory_eeprom=EEPROM_DRAGNBLZ;
941 }
942 
943 /*     YEAR  NAME      PARENT    MACHINE    INPUT     INIT      MONITOR COMPANY   FULLNAME FLAGS */
944 
945 /* ps3-v1 */
946 GAMEX( 1997, soldivid, 0,        psikyo3v1, soldivid, soldivid, ROT0,   "Psikyo", "Sol Divide - The Sword Of Darkness", GAME_IMPERFECT_SOUND ) // Music Tempo
947 GAMEX( 1997, s1945ii,  0,        psikyo3v1, s1945ii,  s1945ii,  ROT270, "Psikyo", "Strikers 1945 II", GAME_IMPERFECT_GRAPHICS ) // linescroll/zoom
948 GAME ( 1998, daraku,   0,        psikyo3v1, daraku,   daraku,   ROT0,   "Psikyo", "Daraku Tenshi - The Fallen Angels" )
949 GAME ( 1998, sbomberb, 0,        psikyo3v1, sbomberb, sbomberb, ROT270, "Psikyo", "Space Bomber (ver. B)" )
950 
951 /* ps5 */
952 GAME ( 1998, gunbird2, 0,        psikyo5,   gunbird2, gunbird2, ROT270, "Psikyo", "Gunbird 2" )
953 GAMEX( 1999, s1945iii, 0,        psikyo5,   s1945iii, s1945iii, ROT270, "Psikyo", "Strikers 1945 III (World) / Strikers 1999 (Japan)", GAME_IMPERFECT_GRAPHICS ) // linescroll/zoom
954 
955 /* ps5v2 */
956 GAMEX( 2000, dragnblz, 0,        psikyo5,   dragnblz, dragnblz, ROT270, "Psikyo", "Dragon Blaze", GAME_IMPERFECT_GRAPHICS )
957