Previous 15994 Revisions Next

r2098 Tuesday 25th March, 2008 at 02:18:11 UTC by Nathan Woods
[COCO] Added a quickload for .BIN files
[docs]messnew.txt
[src/mess/drivers]coco.c
[src/mess/includes]coco.h
[src/mess/machine]coco.c

src/mess/includes/coco.h
r2097r2098
6060
6161SNAPSHOT_LOAD ( coco_pak );
6262SNAPSHOT_LOAD ( coco3_pak );
63QUICKLOAD_LOAD ( coco );
6364READ8_HANDLER ( coco3_mmu_r );
6465WRITE8_HANDLER ( coco3_mmu_w );
6566READ8_HANDLER ( coco3_gime_r );
src/mess/machine/coco.c
r2097r2098
583583}
584584
585585/***************************************************************************
586  Quickloads
587***************************************************************************/
588
589QUICKLOAD_LOAD ( coco )
590{
591   UINT8 preamble;
592   UINT16 block_length;
593   UINT16 block_address;
594   const UINT8 *ptr;
595   UINT32 length;
596   UINT32 position = 0;
597   UINT32 i;
598   int done = FALSE;
599
600   /* access the pointer and the length */
601   ptr = image_ptr(image);
602   length = image_length(image);
603
604   while(!done && (position + 5 <= length))
605   {
606      /* read this block */
607      preamble      = ptr[position + 0];
608      block_length   = ((UINT16) ptr[position + 1]) << 8 | ((UINT16) ptr[position + 2]) << 0;
609      block_address   = ((UINT16) ptr[position + 3]) << 8 | ((UINT16) ptr[position + 4]) << 0;
610      position += 5;
611
612      if (preamble != 0)
613      {
614         /* start address - just set the address and return */
615         cpunum_set_reg(0, REG_PC, block_address);
616         done = TRUE;
617      }
618      else
619      {
620         /* data block - need to cap the maximum length of the block */
621         block_length = MIN(block_length, length - position);
622
623         /* read the block into memory */
624         for (i = 0; i < block_length; i++)
625         {
626            program_write_byte(block_address + i, ptr[position + i]);
627         }
628
629         /* and advance */
630         position += block_length;
631      }
632   }
633   return INIT_PASS;
634}
635
636/***************************************************************************
586637  ROM files
587638
588639  ROM files are simply raw dumps of cartridges.  I believe that they should
src/mess/drivers/coco.c
r2097r2098
998998
999999
10001000
1001static void coco_quickload_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
1002{
1003   /* quickload */
1004   switch(state)
1005   {
1006      /* --- the following bits of info are returned as NULL-terminated strings --- */
1007      case MESS_DEVINFO_STR_FILE_EXTENSIONS:   strcpy(info->s = device_temp_str(), "bin"); break;
1008
1009      /* --- the following bits of info are returned as pointers to data or functions --- */
1010      case MESS_DEVINFO_PTR_QUICKLOAD_LOAD:   info->f = (genf *) quickload_load_coco; break;
1011
1012      /* --- the following bits of info are returned as doubles --- */
1013      case MESS_DEVINFO_FLOAT_QUICKLOAD_DELAY:         info->d = 0.5; break;
1014
1015      default:            quickload_device_getinfo(devclass, state, info); break;
1016   }
1017}
1018
1019
1020
10011021static void coco_cartslot_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
10021022{
10031023   switch(state)
r2097r2098
10991119   CONFIG_DEVICE( coco_bitbanger_getinfo )
11001120   CONFIG_DEVICE( coco_cassette_getinfo )
11011121   CONFIG_DEVICE( coco_floppy_getinfo )
1122   CONFIG_DEVICE( coco_quickload_getinfo )
11021123SYSTEM_CONFIG_END
11031124
11041125SYSTEM_CONFIG_START( generic_coco12 )
docs/messnew.txt
r2097r2098
3434
3535- [COCO] Fixed bug that could cause joystick button presses to not be
3636  registered.  (bug #1532) [Nate Woods]
37 
38- [COCO] Added a quickload for .BIN files.  [Nate Woods]
3739
3840- [GALAXY] Fixed regressions.  [Miodrag Milanovic]
3941

Previous 15994 Revisions Next


© 1998-2018 The MESS Team