1 #include "driver.h"
2 
3 /* The Legend of Silk Road - Unico 1999 */
4 
5 /* Preliminary Driver by David Haywood */
6 /* Inputs, DIPs by Stephh & R. Belmont */
7 /* and preliminary sound hookup by R. Belmont */
8 /* todo:
9 
10 Clean Up
11 
12 */
13 
14 /*
15 
16 68020 interrupts
17 lev 1 : 0x64 : 0000 01d6 - just rte
18 lev 2 : 0x68 : 0000 01d6 - just rte
19 lev 3 : 0x6c : 0000 01d6 - just rte
20 lev 4 : 0x70 : 0000 012c - vblank?
21 lev 5 : 0x74 : 0000 01d6 - just rte
22 lev 6 : 0x78 : 0000 01d6 - just rte
23 lev 7 : 0x7c : 0000 01d6 - just rte
24 
25 */
26 
27 /*
28 
29 The Legend of Silk Road
30 Unico, 1999
31 
32 PCB No.: SR2001A
33 CPU    : MC68EC020FG16 (68020, 100 pin PQFP)
34 SND    : YM2151, YM3012, OKI M6295 (x2) (Note: No sound CPU)
35 OSC    : 32.000MHz, 3.579545MHz
36 RAM    : 62256 (x8), 6116 (x2), KM681000BLG-7L (x4, SOP32, Surface-mounted)
37 Other  : 2x Actel A40MX04 (84 pin PLCC, same video chips as Multi Champ...ESD16.c)
38          15x PALs
39 
40 DIPs   : 8 position (x2)
41 
42 Typed from sheet supplied with PCB (* = Default)
43 
44 DIP SWA
45 			1	2	3	4	5	6	7	8
46 --------------------------------------------------------------------------------------
47 Lives		1	OFF
48 		2*	ON
49 
50 Special		OFF		OFF
51 Effect		ON*		ON
52 
53 Position 3-5	Not used		OFF	OFF	OFF
54 
55 Difficulty	1						OFF	OFF	ON
56 		2						ON	OFF	ON
57 		3						OFF	ON	ON
58 		4*						ON	ON	ON
59 		5						OFF	OFF	OFF
60 		6						ON	OFF	OFF
61 		7						OFF	ON	OFF
62 		8						ON	ON	OFF
63 --------------------------------------------------------------------------------------
64 
65 
66 DIP SWB
67 			1	2	3	4	5	6	7	8
68 --------------------------------------------------------------------------------------
69 Position 1    Not Used  OFF
70 
71 Freeplay	No*		OFF
72 		Yes		ON
73 
74 Position 3	Not Used		OFF
75 
76 Demo Sound	No				OFF
77 		Yes*				ON
78 
79 Chute Type	Single*					OFF
80 		Multi					ON
81 
82 Coin/Credit	1 Coin 1 Credit*				OFF	OFF	OFF
83 		1 Coin 2 Credit					ON	OFF	OFF
84 		1 Coin 3 Credit					OFF	ON	OFF
85 		1 Coin 4 Credit					ON	ON	OFF
86 		2 Coin 1 Credit					OFF	OFF	ON
87 		3 Coin 1 Credit					ON	OFF	ON
88 		4 Coin 1 Credit					OFF	ON	ON
89 		5 Coin 1 Credit					ON	ON	ON
90 --------------------------------------------------------------------------------------
91 
92 ROMs:
93 ROM00.BIN	32 pin 4M Mask, read as 27C4001			OKI Samples
94 ROM01.BIN	MX27C2000					Sound Program
95 
96 ROM02.BIN	42 pin 8M Mask, read as uPD27C8000        \
97 ROM03.BIN	42 pin 8M Mask, read as uPD27C8000        /	Main Program
98 
99 ROM04.BIN       MX29F1610, SOP44 Surface Mounted Mask ROM \
100 ROM05.BIN       MX29F1610, SOP44 Surface Mounted Mask ROM  |
101 ROM06.BIN       MX29F1610, SOP44 Surface Mounted Mask ROM  |
102 ROM07.BIN       MX29F1610, SOP44 Surface Mounted Mask ROM  |
103 ROM08.BIN       MX29F1610, SOP44 Surface Mounted Mask ROM  |
104 ROM09.BIN       MX29F1610, SOP44 Surface Mounted Mask ROM  |
105 ROM10.BIN       MX29F1610, SOP44 Surface Mounted Mask ROM  |	GFX
106 ROM11.BIN       MX29F1610, SOP44 Surface Mounted Mask ROM  |
107 ROM12.BIN       MX29F1610, SOP44 Surface Mounted Mask ROM  |
108 ROM13.BIN       MX29F1610, SOP44 Surface Mounted Mask ROM  |
109 ROM14.BIN       MX29F1610, SOP44 Surface Mounted Mask ROM  |
110 ROM15.BIN       MX29F1610, SOP44 Surface Mounted Mask ROM /
111 
112 */
113 
114 /* Stephh's notes :
115 
116      - Bit 7 of "system inputs" seems to freeze the inputs (and skip parts of code)
117        when it is active :
118          * at start, all inputs are read
119          * when pressed for the 1st time, the inputs are NOT read and some code is skipped
120          * when pressed for the 2nd time, the inputs are read and NO code is skipped
121        Here are the routines where this bit is involved :
122          * "initialization" at 0x000320
123          * test at 0x00014e
124      - Bit 7 of "misc inputs" freezes the game (code at 0x001570). VBLANK ?
125 
126      - 0xc00025 is read and written (code at 0x001724) but its effect is unknown
127      - 0xc00031 is read and written (code at 0x001a58) but its effect is unknown
128 
129 */
130 
131 data32_t *silkroad_vidram,*silkroad_vidram2,*silkroad_vidram3, *silkroad_sprram, *silkroad_regs;
132 
133 WRITE32_HANDLER( silkroad_fgram_w );
134 WRITE32_HANDLER( silkroad_fgram2_w );
135 WRITE32_HANDLER( silkroad_fgram3_w );
136 VIDEO_START(silkroad);
137 VIDEO_UPDATE(silkroad);
138 
WRITE32_HANDLER(paletteram32_xRRRRRGGGGGBBBBB_dword_w)139 static WRITE32_HANDLER( paletteram32_xRRRRRGGGGGBBBBB_dword_w )
140 {
141 	int r,g,b;
142 	COMBINE_DATA(&paletteram32[offset]);
143 
144 	r = (paletteram32[offset] & 0x7c000000) >> (10+16);
145 	g = (paletteram32[offset] & 0x03e00000) >> (5+16);
146 	b = (paletteram32[offset] & 0x001f0000) >> (0+16);
147 
148 	b = b << 3;
149 	r = r << 3;
150 	g = g << 3;
151 
152 	palette_set_color(offset,r,g,b);
153 }
154 
155 /* player inputs */
READ32_HANDLER(io32_r)156 static READ32_HANDLER(io32_r)
157 {
158 	return ((readinputport(0) << 16) |  (readinputport(1) << 0));
159 }
160 
161 /* dipswitches */
READ32_HANDLER(io32_1_r)162 static READ32_HANDLER(io32_1_r)
163 {
164 	return readinputport(2)<<16;
165 }
166 
167 /* sound I/O */
168 
READ32_HANDLER(silk_6295_0_r)169 static READ32_HANDLER(silk_6295_0_r)
170 {
171 	return OKIM6295_status_0_r(0)<<16;
172 }
173 
WRITE32_HANDLER(silk_6295_0_w)174 static WRITE32_HANDLER(silk_6295_0_w)
175 {
176 	if (!(mem_mask & 0x00ff0000))
177 	{
178 		log_cb(RETRO_LOG_DEBUG, LOGPRE "OKI0: write %x mem_mask %8x\n", data>>16, mem_mask);
179 		OKIM6295_data_0_w(0, (data>>16) & 0xff);
180 	}
181 }
182 
READ32_HANDLER(silk_6295_1_r)183 static READ32_HANDLER(silk_6295_1_r)
184 {
185 	return OKIM6295_status_1_r(0)<<16;
186 }
187 
WRITE32_HANDLER(silk_6295_1_w)188 static WRITE32_HANDLER(silk_6295_1_w)
189 {
190 	if (!(mem_mask & 0x00ff0000))
191 	{
192 		log_cb(RETRO_LOG_DEBUG, LOGPRE "OKI1: write %x mem_mask %8x\n", data>>16, mem_mask);
193 		OKIM6295_data_1_w(0, (data>>16) & 0xff);
194 	}
195 }
196 
READ32_HANDLER(silk_ym_r)197 static READ32_HANDLER(silk_ym_r)
198 {
199 	return YM2151_status_port_0_r(0)<<16;
200 }
201 
WRITE32_HANDLER(silk_ym_regport_w)202 static WRITE32_HANDLER(silk_ym_regport_w)
203 {
204 	if (!(mem_mask & 0x00ff0000))
205 	{
206 		YM2151_register_port_0_w(0, (data>>16) & 0xff);
207 	}
208 }
209 
WRITE32_HANDLER(silk_ym_dataport_w)210 static WRITE32_HANDLER(silk_ym_dataport_w)
211 {
212 	if (!(mem_mask & 0x00ff0000))
213 	{
214 		YM2151_data_port_0_w(0, (data>>16) & 0xff);
215 	}
216 }
217 
MEMORY_READ32_START(readmem)218 static MEMORY_READ32_START( readmem )
219 	{ 0x000000, 0x1fffff, MRA32_ROM },
220 	{ 0x40c000, 0x40cfff, MRA32_RAM },
221 	{ 0x600000, 0x603fff, MRA32_RAM },
222 
223 	{ 0x800000, 0x803fff, MRA32_RAM },
224 	{ 0x804000, 0x807fff, MRA32_RAM },
225 	{ 0x808000, 0x80bfff, MRA32_RAM },
226 
227 	{ 0xC00000, 0xC00003, io32_r },	/* player inputs*/
228 	{ 0xC00004, 0xC00007, io32_1_r }, /* dip switches*/
229 	{ 0xC00024, 0xC00027, silk_6295_0_r },
230 	{ 0xC0002C, 0xC0002f, silk_ym_r },
231 	{ 0xC00030, 0xC00033, silk_6295_1_r },
232 
233 	{ 0xfe0000, 0xffffff, MRA32_RAM },
234 MEMORY_END
235 
236 static MEMORY_WRITE32_START( writemem )
237 	{ 0x000000, 0x1fffff, MWA32_ROM },
238 	{ 0x40c000, 0x40cfff, MWA32_RAM, &silkroad_sprram }, /* sprites*/
239 	{ 0x600000, 0x603fff, paletteram32_xRRRRRGGGGGBBBBB_dword_w, &paletteram32 }, /* palette*/
240 
241 	{ 0x800000, 0x803fff, silkroad_fgram_w, &silkroad_vidram },  /* lower Layer*/
242 	{ 0x804000, 0x807fff, silkroad_fgram2_w, &silkroad_vidram2 },  /* higher layer*/
243 	{ 0x808000, 0x80bfff, silkroad_fgram3_w, &silkroad_vidram3 }, /* even higher layer*/
244 
245 
246 	{ 0xC00024, 0xC00027, silk_6295_0_w },
247 	{ 0xC00028, 0xC0002b, silk_ym_regport_w },
248 	{ 0xC0002C, 0xC0002f, silk_ym_dataport_w },
249 	{ 0xC00030, 0xC00033, silk_6295_1_w },
250 
251 	/* C00038 appears to be the coin counter, bit 0 is pulsed when a coin is inserted*/
252 /*
253 	{ 0xC00034, 0xC00037, MWA32_NOP },
254 */
255 
256 	{ 0xC0010c, 0xC00123, MWA32_RAM, &silkroad_regs },
257 /*
258 	{ 0xC0010C, 0xC0010f, MWA32_NOP }, // 0
259 	{ 0xC00110, 0xC00113, MWA32_NOP }, // 1
260 	{ 0xC00114, 0xC00117, MWA32_NOP }, // 2
261 
262 	{ 0xC0011c, 0xC0011f, MWA32_NOP }, // 4
263 	{ 0xC00120, 0xC00123, MWA32_NOP }, // 5
264 */
265 	{ 0xfe0000, 0xffffff, MWA32_RAM },
266 MEMORY_END
267 
268 
269 INPUT_PORTS_START( silkroad )
270 	PORT_START	/* Players inputs */
271 	PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNUSED )
272 	PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_PLAYER2 )
273 	PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
274 	PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
275 	PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER2 )
276 	PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER2 )
277 	PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER2 )
278 	PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER2 )
279 	PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNUSED )
280 	PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_PLAYER1 )
281 	PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER1 )
282 	PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER1 )
283 	PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER1 )
284 	PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER1 )
285 	PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER1 )
286 	PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER1 )
287 
288 	PORT_START	/* System inputs */
289 	PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
290 	PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
291 	PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
292 	PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_START2 )
293 	PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE1 )
294 	PORT_BITX(0x0020, IP_ACTIVE_LOW, IPT_SERVICE, DEF_STR( Service_Mode ), KEYCODE_F2, IP_JOY_NONE )
295 	PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE2 )	/* Not mentioned in the "test mode" */
296 	PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SPECIAL )	/* See notes - Stephh*/
297 	PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )	/* this input makes the 020 lock up...- RB*/
298 	PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
299 	PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
300 	PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
301 	PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
302 	PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
303 	PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
304 	PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
305 
306 	PORT_START	/* DSW */
307 	PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Lives ) )
308 	PORT_DIPSETTING(      0x0001, "1" )
309 	PORT_DIPSETTING(      0x0000, "2" )
310 	PORT_DIPNAME( 0x0002, 0x0000, "Special Effect" )
311 	PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
312 	PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
313 	PORT_DIPNAME( 0x0004, 0x0004, "Unused DIP A-2" )
314 	PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
315 	PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
316 	PORT_DIPNAME( 0x0008, 0x0008, "Unused DIP A-3" )
317 	PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
318 	PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
319 	PORT_DIPNAME( 0x0010, 0x0010, "Unused DIP A-4" )
320 	PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
321 	PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
322 	PORT_DIPNAME( 0x00e0, 0x0000, DEF_STR( Difficulty ) )
323 	PORT_DIPSETTING(      0x0060, "Easiest" )				/* "1"*/
324 	PORT_DIPSETTING(      0x0040, "Easier" )				/* "2"*/
325 	PORT_DIPSETTING(      0x0020, "Easy" )				/* "3"*/
326 	PORT_DIPSETTING(      0x0000, "Normal" )				/* "4"*/
327 	PORT_DIPSETTING(      0x00e0, "Medium" )				/* "5"*/
328 	PORT_DIPSETTING(      0x00c0, "Hard" )				/* "6"*/
329 	PORT_DIPSETTING(      0x00a0, "Harder" )				/* "7"*/
330 	PORT_DIPSETTING(      0x0080, "Hardest" )				/* "8"*/
331 	PORT_DIPNAME( 0x0100, 0x0100, "Unused DIP B-0" )
332 	PORT_DIPSETTING(      0x0100, DEF_STR( Off ) )
333 	PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
334 	PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Free_Play ) )
335 	PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
336 	PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
337 	PORT_DIPNAME( 0x0400, 0x0400, "Unused DIP B-2" )
338 	PORT_DIPSETTING(      0x0400, DEF_STR( Off ) )
339 	PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
340 	PORT_DIPNAME( 0x0800, 0x0000, DEF_STR( Demo_Sounds ) )
341 	PORT_DIPSETTING(      0x0800, DEF_STR( Off ) )
342 	PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
343 	PORT_DIPNAME( 0x1000, 0x1000, "Chute Type" )			/* "Coin Box"*/
344 	PORT_DIPSETTING(      0x1000, "Single" )				/* "1"*/
345 	PORT_DIPSETTING(      0x0000, "Multi" )			/* "2"*/
346 	PORT_DIPNAME( 0xe000, 0xe000, DEF_STR( Coin_A ) )
347 	PORT_DIPSETTING( 0x0000, DEF_STR(5C_1C))
348 	PORT_DIPSETTING( 0x2000, DEF_STR(4C_1C))
349 	PORT_DIPSETTING( 0x4000, DEF_STR(3C_1C))
350 	PORT_DIPSETTING( 0x6000, DEF_STR(2C_1C))
351 	PORT_DIPSETTING( 0xe000, DEF_STR(1C_1C))
352 	PORT_DIPSETTING( 0xc000, DEF_STR(1C_2C))
353 	PORT_DIPSETTING( 0xa000, DEF_STR(1C_3C))
354 	PORT_DIPSETTING( 0x8000, DEF_STR(1C_4C))
355 
356 /*	PORT_START	 // Misc inputs /*/
357 /*	PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL )	 // VBLANK ? /*/
358 /*	PORT_BIT( 0xff7f, IP_ACTIVE_LOW, IPT_UNUSED )  // unknown / unused /*/
359 INPUT_PORTS_END
360 
361 
362 /* BACKGROUNDS */
363 static struct GfxLayout tiles16x16x6_layout =
364 {
365 	16,16,
366 	RGN_FRAC(1,3),
367 	6,
368 	{ 0x0000000*8+8,0x0000000*8+0,  0x0800000*8+8, 0x0800000*8+0, 0x1000000*8+8,0x1000000*8+0 },
369 	{ 0, 1, 2, 3, 4, 5, 6, 7, 16, 17, 18, 19, 20, 21, 22, 23 },
370 	{ 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32, 8*32, 9*32, 10*32, 11*32, 12*32, 13*32, 14*32, 15*32 },
371 	16*32
372 };
373 
374 static struct GfxDecodeInfo gfxdecodeinfo[] =
375 {
376 	{ REGION_GFX1, 0, &tiles16x16x6_layout,  0x0000, 256 },
377 	{ -1 }
378 };
379 
380 static struct YM2151interface ym2151_interface =
381 {
382 	1,
383 	3579545,/* unknown, fixme */
384 	{ YM3012_VOL(100,MIXER_PAN_LEFT,100,MIXER_PAN_RIGHT) },
385 };
386 
387 static struct OKIM6295interface m6295_interface =
388 {
389 	2,  /* 2 chips */
390 	{ 8000, 16000 }, /* unknown, but sounds good */
391 	{ REGION_SOUND1, REGION_SOUND2 },
392 	{ 45,45 }
393 };
394 
395 static MACHINE_DRIVER_START( silkroad )
396 
397 	/* basic machine hardware */
398 	MDRV_CPU_ADD(M68EC020, 16000000)
MDRV_CPU_MEMORY(readmem,writemem)399 	MDRV_CPU_MEMORY(readmem,writemem)
400 	MDRV_CPU_VBLANK_INT(irq4_line_hold,1)
401 
402 	MDRV_FRAMES_PER_SECOND(60)
403 	MDRV_VBLANK_DURATION(DEFAULT_60HZ_VBLANK_DURATION)
404 
405 	/* video hardware */
406 	MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER )
407 	MDRV_SCREEN_SIZE(64*8, 32*8)
408 	MDRV_VISIBLE_AREA(6*8+2, 64*8-1-(10*8)-2, 2*8, 32*8-1-(2*8))
409 	MDRV_GFXDECODE(gfxdecodeinfo)
410 	MDRV_PALETTE_LENGTH(0x2000)
411 
412 	MDRV_VIDEO_START(silkroad)
413 	MDRV_VIDEO_UPDATE(silkroad)
414 
415 	/* sound hardware */
416 	MDRV_SOUND_ATTRIBUTES(SOUND_SUPPORTS_STEREO)
417 	MDRV_SOUND_ADD(YM2151, ym2151_interface)
418 	MDRV_SOUND_ADD(OKIM6295, m6295_interface)
419 MACHINE_DRIVER_END
420 
421 
422 /***************************************************************************
423 
424   Game driver(s)
425 
426 ***************************************************************************/
427 DRIVER_INIT( silkroad )
428 {
429 
430 	/* why? rom04.bin looks like a bad dump, but it seems not since it was
431 	   verified as correct... problem with the original which the gfx
432 	   hardware didn't care about? */
433 
434 	data8_t *src = memory_region(REGION_GFX1)+0x1000000;
435 	int len = 0x0200000;
436 	unsigned char *buffer;
437 
438 	int tileoffset = 0x1300*64; /* verify*/
439 
440 	src += tileoffset; len -=tileoffset;
441 
442 	if ((buffer = malloc(len)))
443 	{
444 		int i;
445 		for (i = 0;i < len; i++)
446 			buffer[i] = src[i-1];
447 		memcpy(src,buffer,len);
448 		free(buffer);
449 	}
450 }
451 
452 ROM_START( silkroad )
453 	ROM_REGION( 0x200000, REGION_CPU1, 0 )
454 	ROM_LOAD32_WORD_SWAP( "rom02.bin", 0x000000, 0x100000, CRC(4e5200fc) SHA1(4d4cab03a6ec4ad825001e1e92193940646141e5) )
455 	ROM_LOAD32_WORD_SWAP( "rom03.bin", 0x000002, 0x100000, CRC(73ccc78c) SHA1(2ac17aa8d7dac8636d29a4e4228a556334b51f1a) )
456 
457 	ROM_REGION( 0x1800000, REGION_GFX1, ROMREGION_DISPOSE | ROMREGION_INVERT )
458 	/* Sprites */
459 	ROM_LOAD( "rom12.bin",	0x0000000, 0x0200000, CRC(96393d04) SHA1(f512bb8603510d39e649f4ec1c5e2d0e4bf3a2cc) ) /* 0*/
460 	ROM_LOAD( "rom08.bin",	0x0800000, 0x0200000, CRC(23f1d462) SHA1(6ca8052b16ccc1fe59716e03f66bd33af5145b37) ) /* 0*/
461 	ROM_LOAD( "rom04.bin",	0x1000000, 0x0200000, CRC(2cf6ed30) SHA1(e96585cd109debc45960090d73b15db87e91ce0f) ) /* 0*/
462 
463 	ROM_LOAD( "rom13.bin",	0x0200000, 0x0200000, CRC(4ca1698e) SHA1(4fffc2f2a5fb434c42463ce904fd811866c53f81) ) /* 1*/
464 	ROM_LOAD( "rom09.bin",	0x0a00000, 0x0200000, CRC(ef0b5bf4) SHA1(acd3bc5070de84608c5da0d091094382853cb048) ) /* 1*/
465 	ROM_LOAD( "rom05.bin",	0x1200000, 0x0200000, CRC(512d6e25) SHA1(fc0a56663d77bbdfbd4242e14a55563073634582) ) /* 1*/
466 	ROM_LOAD( "rom14.bin",	0x0400000, 0x0200000, CRC(d00b19c4) SHA1(d5b955dca5d0d251166a7f35a0bbbda6a91ecbd0) ) /* 2*/
467 	ROM_LOAD( "rom10.bin",	0x0c00000, 0x0200000, CRC(7d324280) SHA1(cdf6d9342292f693cc5ec1b72816f2788963fcec) ) /* 2*/
468 	ROM_LOAD( "rom06.bin",	0x1400000, 0x0200000, CRC(3ac26060) SHA1(98ad8efbbf8020daf7469db3e0fda02af6c4c767) ) /* 2*/
469 	/* Backgrounds */
470 	ROM_LOAD( "rom07.bin",	0x0600000, 0x0200000, CRC(9fc6ff9d) SHA1(51c3ca9709a01e0ad6bc76c0d674ed03f9822598) ) /* 3*/
471 	ROM_LOAD( "rom11.bin",	0x0e00000, 0x0200000, CRC(11abaf1c) SHA1(19e86f3ebfec518a96c0520f36cfc1b525e7e55c) ) /* 3*/
472 	ROM_LOAD( "rom15.bin",	0x1600000, 0x0200000, CRC(26a3b168) SHA1(a4b7955cc4d4fbec7c975a9456f2219ef33f1166) ) /* 3*/
473 
474 	ROM_REGION( 0x080000, REGION_SOUND1, 0 )
475 	ROM_LOAD( "rom00.bin", 0x000000, 0x080000, CRC(b10ba7ab) SHA1(a6a3ae71b803af9c31d7e97dc86cfcc123ee9a40) )
476 
477 	ROM_REGION( 0x080000, REGION_SOUND2, 0 )
478 	ROM_LOAD( "rom01.bin", 0x000000, 0x040000, CRC(db8cb455) SHA1(6723b4018208d554bd1bf1e0640b72d2f4f47302) )
479 ROM_END
480 
481 
482 GAME( 1999, silkroad, 0, silkroad, silkroad, silkroad, ROT0, "Unico", "The Legend of Silkroad" )
483