Previous 15994 Revisions Next

r1625 Monday 28th January, 2008 at 16:45:36 UTC by PeT
changed cartridge loading to cartslot device
[src/mess/drivers]apf.c

src/mess/drivers/apf.c
r1624r1625
666666   ROM_REGION(0x10000+0x0800,REGION_CPU1,0)
667667   ROM_LOAD("apf_4000.rom",0x010000, 0x0800, CRC(2a331a33) SHA1(387b90882cd0b66c192d9cbaa3bec250f897e4f1))
668668//   ROM_LOAD("apf-m1000rom.bin",0x010000, 0x0800, CRC(cc6ac840) SHA1(1110a234bcad99bd0894ad44c591389d16376ca4))
669   ROM_CART_LOAD(0, "bin", 0x8000, 0x2000, ROM_OPTIONAL)
669670ROM_END
670671
671672static void apfimag_cassette_getinfo(const device_class *devclass, UINT32 state, union devinfo *info)
r1624r1625
701702   }
702703}
703704
704static int device_load_apfm1000_cart(mess_image *image)
705{
706   UINT8 *rom = memory_region(REGION_CPU1)+0x8000;
707   int size;
708705
709   size = image_length(image);
710
711   if (image_fread(image, rom, size) != size)
712   {
713      logerror("%s load error\n", image_filename(image));
714      return 1;
715   }
716
717
718   return 0;
719}
720
721static void apfm1000_cartslot_getinfo(const device_class *devclass, UINT32 state, union devinfo *info)
722{
723   /* cartslot */
724   switch(state)
725   {
726      /* --- the following bits of info are returned as 64-bit signed integers --- */
727      case DEVINFO_INT_COUNT:                     info->i = 1; break;
728
729      /* --- the following bits of info are returned as pointers to data or functions --- */
730      case DEVINFO_PTR_LOAD:                     info->load = device_load_apfm1000_cart; break;
731        //      case DEVINFO_PTR_PARTIAL_HASH:               info->partialhash = lynx_partialhash; break;
732
733      /* --- the following bits of info are returned as NULL-terminated strings --- */
734      case DEVINFO_STR_FILE_EXTENSIONS:            strcpy(info->s = device_temp_str(), "bin"); break;
735
736      default:                              cartslot_device_getinfo(devclass, state, info); break;
737   }
738}
739
740706SYSTEM_CONFIG_START( apfimag )
741707   CONFIG_DEVICE(apfimag_cassette_getinfo)
742708   CONFIG_DEVICE(apfimag_floppy_getinfo)
743709SYSTEM_CONFIG_END
744710
745711SYSTEM_CONFIG_START(apfm1000)
746   CONFIG_DEVICE(apfm1000_cartslot_getinfo)
712   CONFIG_DEVICE(cartslot_device_getinfo)
747713SYSTEM_CONFIG_END
748714
749715/***************************************************************************

Previous 15994 Revisions Next


© 1998-2018 The MESS Team