Previous 15994 Revisions Next

r2810 Wednesday 4th June, 2008 at 04:17:15 UTC by R. Belmont
[SATURN] Added ROM cartridge support. The recently leaked Sega diagnostic cart starts up but is not interactive; I will investigate.
[docs]messnew.txt
[src/mess/drivers]saturn.c

src/mess/drivers/saturn.c
r2809r2810
168168#include "machine/scudsp.h"
169169#include "sound/scsp.h"
170170#include "devices/chd_cd.h"
171#include "devices/cartslot.h"
171172
172173
173174extern UINT32* stv_vdp2_regs;
r2809r2810
19501951   AM_RANGE(0x01000000, 0x01000003) AM_WRITE(minit_w)
19511952   AM_RANGE(0x01406f40, 0x01406f43) AM_WRITE(minit_w) // prikura seems to write here ..
19521953   AM_RANGE(0x01800000, 0x01800003) AM_WRITE(sinit_w)
1953   AM_RANGE(0x02000000, 0x04ffffff) AM_READNOP AM_WRITENOP   // cartridge space
1954   AM_RANGE(0x02000000, 0x023fffff) AM_ROM AM_REGION(REGION_CPU1, 0x80000)   // cartridge space
19541955   AM_RANGE(0x05800000, 0x0589ffff) AM_READWRITE(stvcd_r, stvcd_w)
19551956   /* Sound */
19561957   AM_RANGE(0x05a00000, 0x05a7ffff) AM_READWRITE(stv_sh2_soundram_r, stv_sh2_soundram_w)
r2809r2810
23242325
23252326/* Japanese Saturn */
23262327ROM_START(saturnjp)
2327   ROM_REGION( 0x080000, REGION_CPU1, 0 ) /* SH2 code */
2328   ROM_REGION( 0x480000, REGION_CPU1, 0 ) /* SH2 code */
23282329   ROM_SYSTEM_BIOS(0, "101", "Japan v1.01 (941228)")
23292330   ROMX_LOAD("sega_101.bin", 0x00000000, 0x00080000, CRC(224b752c) SHA1(df94c5b4d47eb3cc404d88b33a8fda237eaf4720), ROM_BIOS(1))
23302331   ROM_SYSTEM_BIOS(1, "100", "Japan v1.00 (940921)")
r2809r2810
23382339
23392340/* Overseas Saturn */
23402341ROM_START(saturn)
2341   ROM_REGION( 0x080000, REGION_CPU1, 0 ) /* SH2 code */
2342   ROM_REGION( 0x480000, REGION_CPU1, 0 ) /* SH2 code */
23422343   ROM_SYSTEM_BIOS(0, "101a", "Overseas v1.01a (941115)")
23432344   ROMX_LOAD("sega_101a.bin", 0x00000000, 0x00080000, CRC(4afcf0fa) SHA1(faa8ea183a6d7bbe5d4e03bb1332519800d3fbc3), ROM_BIOS(1))
23442345   ROM_SYSTEM_BIOS(1, "100a", "Overseas v1.00a (941115)")
r2809r2810
23512352ROM_END
23522353
23532354ROM_START(saturneu)
2354   ROM_REGION( 0x080000, REGION_CPU1, 0 ) /* SH2 code */
2355   ROM_REGION( 0x480000, REGION_CPU1, 0 ) /* SH2 code */
23552356   ROM_SYSTEM_BIOS(0, "101a", "Overseas v1.01a (941115)")
23562357   ROMX_LOAD("sega_101a.bin", 0x00000000, 0x00080000, CRC(4afcf0fa) SHA1(faa8ea183a6d7bbe5d4e03bb1332519800d3fbc3), ROM_BIOS(1))
23572358   ROM_SYSTEM_BIOS(1, "100a", "Overseas v1.00a (941115)")
r2809r2810
23642365ROM_END
23652366
23662367ROM_START(vsaturn)
2367   ROM_REGION( 0x080000, REGION_CPU1, 0 ) /* SH2 code */
2368   ROM_REGION( 0x480000, REGION_CPU1, 0 ) /* SH2 code */
23682369   ROM_LOAD("vsaturn.bin", 0x00000000, 0x00080000, CRC(e4d61811) SHA1(4154e11959f3d5639b11d7902b3a393a99fb5776))
23692370   ROM_REGION( 0x080000, REGION_CPU2, 0 ) /* SH2 code */
23702371   ROM_COPY( REGION_CPU1,0,0,0x080000)
r2809r2810
23742375ROM_END
23752376
23762377ROM_START(hisaturn)
2377   ROM_REGION( 0x080000, REGION_CPU1, 0 ) /* SH2 code */
2378   ROM_REGION( 0x480000, REGION_CPU1, 0 ) /* SH2 code */
23782379   ROM_LOAD("hisaturn.bin", 0x00000000, 0x00080000, CRC(721e1b60) SHA1(49d8493008fa715ca0c94d99817a5439d6f2c796))
23792380   ROM_REGION( 0x080000, REGION_CPU2, 0 ) /* SH2 code */
23802381   ROM_COPY( REGION_CPU1,0,0,0x080000)
r2809r2810
23962397   }
23972398}
23982399
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
23992440SYSTEM_CONFIG_START( saturn )
24002441   CONFIG_DEVICE(saturn_chdcd_getinfo)
2442   CONFIG_DEVICE(saturn_cart_getinfo)
24012443SYSTEM_CONFIG_END
24022444
24032445/***************************************************************************
docs/messnew.txt
r2809r2810
8080
8181- [SATURN] Fixed mem_mask regressions.  [R. Belmont]
8282
83- [SATURN] Added ROM cartridge support. [R. Belmont]
84
8385- [SCORPION] Added SHA-1's.  [Fabio Priuli]
8486
8587- [SG1000] Added .bin extension.  [Fabio Priuli]

Previous 15994 Revisions Next


© 1998-2018 The MESS Team