Previous 15994 Revisions Next

r2811 Wednesday 4th June, 2008 at 13:49:02 UTC by R. Belmont
[SATURN] Use ROM_CART_LOAD for cart, add 1.003 Japan BIOS, bump up directory size in CD handling (MAME component also submitted to MAME).
[src/mame/machine]stvcd.c
[src/mess/drivers]saturn.c

src/mame/machine/stvcd.c
r2810r2811
4444
4545#define MAX_FILTERS   (24)
4646#define MAX_BLOCKS   (200)
47#define MAX_DIR_SIZE   (16384)
4748
4849typedef struct
4950{
r2810r2811
309310{
310311   INT32 i;
311312
312   CDROM_LOG(("cd_free_block: %x\n", (UINT32)blktofree))
313   CDROM_LOG(("cd_free_block: %x\n", (UINT32)(FPTR)blktofree))
313314
314315   for (i = 0; i < 200; i++)
315316   {
r2810r2811
14641465         curroot.name[i] = '\0';   // terminate
14651466
14661467         // easy to fix, but make sure we *need* to first
1467         if (curroot.length > 14336)
1468         if (curroot.length > MAX_DIR_SIZE)
14681469         {
14691470            mame_printf_error("ERROR: root directory too big (%d)\n", curroot.length);
14701471         }
r2810r2811
14751476   }
14761477   else
14771478   {
1478      if (curdir[fileno].length > 14336)
1479      if (curdir[fileno].length > MAX_DIR_SIZE)
14791480      {
14801481         mame_printf_error("ERROR: new directory too big (%d)!\n", curdir[fileno].length);
14811482      }
r2810r2811
14881489{
14891490   int i;
14901491   UINT32 nextent, numentries;
1491   UINT8 sect[14336];
1492   UINT8 sect[MAX_DIR_SIZE];
14921493   direntryT *curentry;
14931494
1494   memset(sect, 0, 14336);
1495   memset(sect, 0, MAX_DIR_SIZE);
14951496   for (i = 0; i < (curroot.length/2048); i++)
14961497   {
14971498      cd_readblock(fad+i, &sect[2048*i]);
r2810r2811
14991500
15001501   nextent = 0;
15011502   numentries = 0;
1502   while (nextent < 14336)
1503   while (nextent < MAX_DIR_SIZE)
15031504   {
15041505      if (sect[nextent])
15051506      {
r2810r2811
15081509      }
15091510      else
15101511      {
1511         nextent = 14336;
1512         nextent = MAX_DIR_SIZE;
15121513      }
15131514   }
15141515
src/mess/drivers/saturn.c
r2810r2811
23282328   ROM_REGION( 0x480000, REGION_CPU1, 0 ) /* SH2 code */
23292329   ROM_SYSTEM_BIOS(0, "101", "Japan v1.01 (941228)")
23302330   ROMX_LOAD("sega_101.bin", 0x00000000, 0x00080000, CRC(224b752c) SHA1(df94c5b4d47eb3cc404d88b33a8fda237eaf4720), ROM_BIOS(1))
2331   ROM_SYSTEM_BIOS(1, "100", "Japan v1.00 (940921)")
2332   ROMX_LOAD("sega_100.bin", 0x00000000, 0x00080000, CRC(2aba43c2) SHA1(2b8cb4f87580683eb4d760e4ed210813d667f0a2), ROM_BIOS(2))
2331   ROM_SYSTEM_BIOS(1, "1003", "Japan v1.003 (941012)")
2332   ROMX_LOAD("sega1003.bin", 0x00000000, 0x00080000, CRC(b3c63c25) SHA1(7b23b53d62de0f29a23e423d0fe751dfb469c2fa), ROM_BIOS(2))
2333   ROM_SYSTEM_BIOS(2, "100", "Japan v1.00 (940921)")
2334   ROMX_LOAD("sega_100.bin", 0x00000000, 0x00080000, CRC(2aba43c2) SHA1(2b8cb4f87580683eb4d760e4ed210813d667f0a2), ROM_BIOS(3))
2335   ROM_CART_LOAD(0, "bin", 0x080000, 0x400000, ROM_NOMIRROR | ROM_FILL_FF | ROM_OPTIONAL)
23332336   ROM_REGION( 0x080000, REGION_CPU2, 0 ) /* SH2 code */
23342337   ROM_COPY( REGION_CPU1,0,0,0x080000)
23352338   ROM_REGION( 0x100000, REGION_CPU3, ROMREGION_ERASE00 ) /* 68000 code */
r2810r2811
23442347   ROMX_LOAD("sega_101a.bin", 0x00000000, 0x00080000, CRC(4afcf0fa) SHA1(faa8ea183a6d7bbe5d4e03bb1332519800d3fbc3), ROM_BIOS(1))
23452348   ROM_SYSTEM_BIOS(1, "100a", "Overseas v1.00a (941115)")
23462349   ROMX_LOAD("sega_100a.bin", 0x00000000, 0x00080000, CRC(f90f0089) SHA1(3bb41feb82838ab9a35601ac666de5aacfd17a58), ROM_BIOS(2))
2350   ROM_CART_LOAD(0, "bin", 0x080000, 0x400000, ROM_NOMIRROR | ROM_FILL_FF | ROM_OPTIONAL)
23472351   ROM_REGION( 0x080000, REGION_CPU2, 0 ) /* SH2 code */
23482352   ROM_COPY( REGION_CPU1,0,0,0x080000)
23492353   ROM_REGION( 0x100000, REGION_CPU3, ROMREGION_ERASE00 ) /* 68000 code */
r2810r2811
23572361   ROMX_LOAD("sega_101a.bin", 0x00000000, 0x00080000, CRC(4afcf0fa) SHA1(faa8ea183a6d7bbe5d4e03bb1332519800d3fbc3), ROM_BIOS(1))
23582362   ROM_SYSTEM_BIOS(1, "100a", "Overseas v1.00a (941115)")
23592363   ROMX_LOAD("sega_100a.bin", 0x00000000, 0x00080000, CRC(f90f0089) SHA1(3bb41feb82838ab9a35601ac666de5aacfd17a58), ROM_BIOS(2))
2364   ROM_CART_LOAD(0, "bin", 0x080000, 0x400000, ROM_NOMIRROR | ROM_FILL_FF | ROM_OPTIONAL)
23602365   ROM_REGION( 0x080000, REGION_CPU2, 0 ) /* SH2 code */
23612366   ROM_COPY( REGION_CPU1,0,0,0x080000)
23622367   ROM_REGION( 0x100000, REGION_CPU3, ROMREGION_ERASE00 ) /* 68000 code */
r2810r2811
23672372ROM_START(vsaturn)
23682373   ROM_REGION( 0x480000, REGION_CPU1, 0 ) /* SH2 code */
23692374   ROM_LOAD("vsaturn.bin", 0x00000000, 0x00080000, CRC(e4d61811) SHA1(4154e11959f3d5639b11d7902b3a393a99fb5776))
2375   ROM_CART_LOAD(0, "bin", 0x080000, 0x400000, ROM_NOMIRROR | ROM_FILL_FF | ROM_OPTIONAL)
23702376   ROM_REGION( 0x080000, REGION_CPU2, 0 ) /* SH2 code */
23712377   ROM_COPY( REGION_CPU1,0,0,0x080000)
23722378   ROM_REGION( 0x100000, REGION_CPU3, ROMREGION_ERASE00 ) /* 68000 code */
r2810r2811
23772383ROM_START(hisaturn)
23782384   ROM_REGION( 0x480000, REGION_CPU1, 0 ) /* SH2 code */
23792385   ROM_LOAD("hisaturn.bin", 0x00000000, 0x00080000, CRC(721e1b60) SHA1(49d8493008fa715ca0c94d99817a5439d6f2c796))
2386   ROM_CART_LOAD(0, "bin", 0x080000, 0x400000, ROM_NOMIRROR | ROM_FILL_FF | ROM_OPTIONAL)
23802387   ROM_REGION( 0x080000, REGION_CPU2, 0 ) /* SH2 code */
23812388   ROM_COPY( REGION_CPU1,0,0,0x080000)
23822389   ROM_REGION( 0x100000, REGION_CPU3, ROMREGION_ERASE00 ) /* 68000 code */
r2810r2811
23972404   }
23982405}
23992406
2400static DEVICE_IMAGE_LOAD( saturn_cart )
2401{
2402   UINT8 *ROM = memory_region(REGION_CPU1)+0x80000;
2403   UINT8 *tmp;
2404   int i;
2405
2406   tmp = malloc(image_length(image));
2407
2408   image_fread(image, tmp, image_length(image));
2409
2410   // now assemble the image in memory in the right order
2411   for (i = 0; i < image_length(image); i++)
2412   {
2413      ROM[i] = tmp[BYTE4_XOR_BE(i)];
2414   }
2415
2416   free(tmp);
2417
2418   return INIT_PASS;
2419}
2420
2421static void saturn_cart_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
2422{
2423   /* cartslot */
2424   switch(state)
2425   {
2426      /* --- the following bits of info are returned as 64-bit signed integers --- */
2427      case MESS_DEVINFO_INT_COUNT:             info->i = 1; break;
2428      case MESS_DEVINFO_INT_MUST_BE_LOADED:      info->i = 0; break;
2429
2430      /* --- the following bits of info are returned as pointers to data or functions --- */
2431      case MESS_DEVINFO_PTR_LOAD:          info->load = device_load_saturn_cart; break;
2432
2433      /* --- the following bits of info are returned as NULL-terminated strings --- */
2434      case MESS_DEVINFO_STR_FILE_EXTENSIONS:      strcpy(info->s = device_temp_str(), "bin"); break;
2435
2436      default:                  cartslot_device_getinfo(devclass, state, info); break;
2437   }
2438}
2439
24402407SYSTEM_CONFIG_START( saturn )
24412408   CONFIG_DEVICE(saturn_chdcd_getinfo)
2442   CONFIG_DEVICE(saturn_cart_getinfo)
2409   CONFIG_DEVICE(cartslot_device_getinfo)
24432410SYSTEM_CONFIG_END
24442411
24452412/***************************************************************************

Previous 15994 Revisions Next


© 1998-2018 The MESS Team