Previous 15994 Revisions Next

r8039 Friday 14th May, 2010 at 16:29:20 UTC by Robbbert
[JAGUAR] Finished adding support for all known homebrew filetypes. Please read the forum for more info.
[src/mess/drivers]jaguar.c

src/mess/drivers/jaguar.c
r8038r8039
640640   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
641641
642642   /* quickload */
643   MDRV_QUICKLOAD_ADD("quickload", jaguar, "bin,bjl,prg,cof,abs", 0)
643   MDRV_QUICKLOAD_ADD("quickload", jaguar, "abs,bin,cof,jag,prg", 0)
644644
645645   /* cartridge */
646646   MDRV_CARTSLOT_ADD("cart")
647   MDRV_CARTSLOT_EXTENSION_LIST("jag,rom,j64")
647   MDRV_CARTSLOT_EXTENSION_LIST("j64,jag,rom")
648648   MDRV_CARTSLOT_INTERFACE("jaguar_cart")
649649   MDRV_CARTSLOT_LOAD(jaguar)
650650
r8038r8039
690690   UINT8 j[4], *RAM = memory_region(machine, "maincpu");
691691   UINT32 i;
692692   size += addr;
693   logerror("File Loaded to address range %X to %X\n",addr,size-1);
693694   for (i = addr; i < size; i+=4)
694695   {
695696      j[0] = RAM[i];
r8038r8039
710711
711712static QUICKLOAD_LOAD( jaguar )
712713{
713   offs_t quickload_begin = 0x4000;
714   offs_t quickload_begin = 0x4000, start = quickload_begin, skip = 0;
714715   memset(jaguar_shared_ram, 0, 0x200000);
715716   quickload_size = MIN(quickload_size, 0x200000 - quickload_begin);
716717
r8038r8039
722723      /* COF */
723724   if ((jaguar_shared_ram[0x1000] & 0xffff0000) == 0x01500000)
724725   {
725      UINT32 start = jaguar_shared_ram[0x100e];
726      UINT32 skip = jaguar_shared_ram[0x1011];
727      memset(jaguar_shared_ram, 0, 0x200000);
728      image_fseek(image, 0, SEEK_SET);
729      image_fread(image, &memory_region(image->machine, "maincpu")[start-skip], quickload_size);
730      quickload_begin = start;
731      jaguar_fix_endian(image->machine, (start-skip)&0xfffffc, quickload_size);
726      start = jaguar_shared_ram[0x100e];
727      skip = jaguar_shared_ram[0x1011];
732728   }
733729   else   /* PRG */
734730   if (((jaguar_shared_ram[0x1000] & 0xffff0000) == 0x601A0000) && (jaguar_shared_ram[0x1007] == 0x4A414752))
735731   {
736732      UINT32 type = jaguar_shared_ram[0x1008] >> 16;
737      UINT32 start = ((jaguar_shared_ram[0x1008] & 0xffff) << 16) | (jaguar_shared_ram[0x1009] >> 16);
738      UINT32 skip = 28;
733      start = ((jaguar_shared_ram[0x1008] & 0xffff) << 16) | (jaguar_shared_ram[0x1009] >> 16);
734      skip = 28;
739735      if (type == 2) skip = 42;
740      if (type == 3) skip = 46;
741      memset(jaguar_shared_ram, 0, 0x200000);
742      image_fseek(image, 0, SEEK_SET);
743      image_fread(image, &memory_region(image->machine, "maincpu")[start-skip], quickload_size);
744      quickload_begin = start;
745      jaguar_fix_endian(image->machine, (start-skip)&0xfffffc, quickload_size);
736      else if (type == 3) skip = 46;
746737   }
747   else   /* ABS */
738   else   /* ABS with header */
748739   if ((jaguar_shared_ram[0x1000] & 0xffff0000) == 0x601B0000)
749740   {
750      UINT32 start = ((jaguar_shared_ram[0x1005] & 0xffff) << 16) | (jaguar_shared_ram[0x1006] >> 16);
751      UINT32 skip = 0xd0;
741      start = ((jaguar_shared_ram[0x1005] & 0xffff) << 16) | (jaguar_shared_ram[0x1006] >> 16);
742      skip = 36;
743   }
744
745   else   /* ABS binary */
746   if (!mame_stricmp(image_filetype(image), "abs"))
747      start = 0xc000;
748
749   else   /* 0x5000 binary */
750   if (!mame_stricmp(image_filetype(image), "jag"))
751      start = 0x5000;
752
753   else   /* A header used by Badcoder */
754   if ((jaguar_shared_ram[0x1000] & 0xffff0000) == 0x72000000)
755      skip = 96;
756
757   /* Now that we have the info, reload the file */
758   if ((start != quickload_begin) || (skip))
759   {
752760      memset(jaguar_shared_ram, 0, 0x200000);
753761      image_fseek(image, 0, SEEK_SET);
754762      image_fread(image, &memory_region(image->machine, "maincpu")[start-skip], quickload_size);
r8038r8039
757765   }
758766
759767
768   /* Some programs are too lazy to set a stack pointer */
769   cpu_set_reg(devtag_get_device(image->machine, "maincpu"), REG_GENSP, 0x1000);
770   jaguar_shared_ram[0]=0x1000;
771
760772   /* Transfer control to image */
761773   cpu_set_reg(devtag_get_device(image->machine, "maincpu"), REG_GENPC, quickload_begin);
774   jaguar_shared_ram[1]=quickload_begin;
762775   return INIT_PASS;
763776}
764777

Previous 15994 Revisions Next


© 1998-2018 The MESS Team