Previous 15994 Revisions Next

r11200 Saturday 16th April, 2011 at 14:16:09 UTC by Fabio Priuli
[A5200] fixed crash when loading carts (bug #2047) [Fabio Priuli]

out of whatsnew: also removed floppies from a5200 (they got added to the wrong MACHINE_CONFIG)
[src/mess/drivers]atari.c
[src/mess/machine]ataricrt.c

src/mess/machine/ataricrt.c
r11199r11200
605605DEVICE_IMAGE_LOAD( a5200_cart )
606606{
607607   UINT8 *mem = image.device().machine().region("maincpu")->base();
608   int size;
608   UINT32 size;
609
609610   if (image.software_entry() == NULL)
610611   {
611612      /* load an optional (dual) cartidge */
612613      size = image.fread(&mem[0x4000], 0x8000);
613   } else {
614   }
615   else
616   {
614617      size = image.get_software_region_length("rom");
615618      memcpy(mem + 0x4000, image.get_software_region("rom"), size);
616619   }
620
617621   if (size<0x8000) memmove(mem+0x4000+0x8000-size, mem+0x4000, size);
618622   // mirroring of smaller cartridges
619623   if (size <= 0x1000) memcpy(mem+0xa000, mem+0xb000, 0x1000);
620624   if (size <= 0x2000) memcpy(mem+0x8000, mem+0xa000, 0x2000);
621625   if (size <= 0x4000)
622626   {
623      const char *info;
627      const char *info = hashfile_extrainfo(image);
624628      memcpy(&mem[0x4000], &mem[0x8000], 0x4000);
625      info = hashfile_extrainfo(image);     
626      if (strcmp(info, "") && !strcmp(info, "A13MIRRORING"))
629      if (info && !strcmp(info, "A13MIRRORING"))
627630      {
628631         memcpy(&mem[0x8000], &mem[0xa000], 0x2000);
629632         memcpy(&mem[0x6000], &mem[0x4000], 0x2000);
630633      }
631634   }
632   logerror("%s loaded cartridge '%s' size %dK\n",
633      image.device().machine().system().name, image.filename() , size/1024);
635   logerror("A5200 loaded cartridge '%s' size %dK\n", image.filename() , size/1024);
634636   return IMAGE_INIT_PASS;
635637}
636638
src/mess/drivers/atari.c
r11199r11200
10701070   /* internal ram */
10711071   MCFG_RAM_ADD(RAM_TAG)
10721072   MCFG_RAM_DEFAULT_SIZE("40K")
1073
1074   MCFG_ATARI_FDC_ADD("fdc")
10751073MACHINE_CONFIG_END
10761074
10771075
10781076static MACHINE_CONFIG_DERIVED( atari_common, atari_common_nodac )
10791077   MCFG_SOUND_ADD("dac", DAC, 0)
10801078   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
1079
1080   MCFG_ATARI_FDC_ADD("fdc")
10811081MACHINE_CONFIG_END
10821082
10831083

Previous 15994 Revisions Next


© 1998-2018 The MESS Team