Previous 199869 Revisions Next

r34415 Friday 16th January, 2015 at 13:10:56 UTC by David Haywood
just something I used in testing (nw)
[hash]apple3.xml*
[src/mess/drivers]apple3.c
[src/regtests/chdman/input/createhd_4]in.params
[src/regtests/chdman/input/createhd_5]in.params
[src/regtests/chdman/output/createhd_4]out.chd
[src/regtests/chdman/output/createhd_5]out.chd
[src/tools]chdman.c

trunk/hash/apple3.xml
r0r242927
1<?xml version="1.0"?>
2<!DOCTYPE softwarelist SYSTEM "softwarelist.dtd">
3
4<softwarelist name="apple3" description="Apple III 5.25 disks">
5
6   <software name="magneto">
7      <description>Capt'n Magneto (PD release APPLE-3-WAP-GAM-03)</description> <!-- was also released commercially - need those images, original game is 1983, this is a PD release of it from 1995 -->
8      <year>1995</year>
9      <publisher>Al Evans / WAP</publisher>
10
11      <part name="flop1" interface="floppy_5_25">
12         <dataarea name="flop" size="143360">
13            <rom name="apple-3-wap-gam-03a.dsk" size="143360" crc="fec20dbb" sha1="5ee6b1610649ad32df8ab00a2a272c3b79a92f26" offset="0x0000" />
14         </dataarea>
15      </part>
16      <part name="flop2" interface="floppy_5_25">
17         <dataarea name="flop" size="143360">
18            <rom name="apple-3-wap-gam-03b.dsk" size="143360" crc="a489f0b3" sha1="82c369ffec141b551732522edbe6d726b28da181" offset="0x0000" />
19         </dataarea>
20      </part>
21   </software>
22
23
24</softwarelist>
trunk/src/mess/drivers/apple3.c
r242926r242927
102102   MCFG_FLOPPY_DRIVE_ADD("2", a3_floppies, "525", apple3_state::floppy_formats)
103103   MCFG_FLOPPY_DRIVE_ADD("3", a3_floppies, "525", apple3_state::floppy_formats)
104104
105   /* softlist for fdc */
106   MCFG_SOFTWARE_LIST_ADD("flop525_list","apple3")
107
105108   /* acia */
106109   MCFG_DEVICE_ADD("acia", MOS6551, 0)
107110   MCFG_MOS6551_XTAL(XTAL_1_8432MHz) // HACK: The schematic shows an external clock generator but using a XTAL is faster to emulate.
trunk/src/tools/chdman.c
r242926r242927
8787#define OPTION_VERBOSE "verbose"
8888#define OPTION_FIX "fix"
8989#define OPTION_NUMPROCESSORS "numprocessors"
90#define OPTION_SIZE "size"
9190
9291
9392//**************************************************************************
r242926r242927
529528   { OPTION_NO_CHECKSUM,           "nocs", false, ": do not include this metadata information in the overall SHA-1" },
530529   { OPTION_FIX,                   "f",    false, ": fix the SHA-1 if it is incorrect" },
531530   { OPTION_VERBOSE,               "v",    false, ": output additional information" },
532   { OPTION_SIZE,                  "s",    true, ": <bytes>: size of the output file" },
533531};
534532
535533
r242926r242927
581579         OPTION_COMPRESSION,
582580         OPTION_IDENT,
583581         OPTION_CHS,
584         OPTION_SIZE,
585582         OPTION_SECTOR_SIZE,
586583         OPTION_NUMPROCESSORS
587584      }
r242926r242927
904901   if (filesize == 0)
905902      report_error(1, "Can't guess CHS values because there is no input file");
906903
904   // validate the size
905   if (filesize % sectorsize != 0)
906      report_error(1, "Can't guess CHS values because data size is not divisible by %d", sectorsize);
907   ;
908
907909   // now find a valid value
908910   for (UINT32 totalsectors = filesize / sectorsize; ; totalsectors++)
909911      for (UINT32 cursectors = 63; cursectors > 1; cursectors--)
r242926r242927
16851687   parse_hunk_size(params, sector_size, hunk_size);
16861688
16871689   // process input start/end (needs to know hunk_size)
1688   UINT64 filesize = 0;
16891690   UINT64 input_start = 0;
16901691   UINT64 input_end = 0;
16911692   if (input_file != NULL)
1692   {
16931693      parse_input_start_end(params, core_fsize(input_file), hunk_size, hunk_size, input_start, input_end);
1694      filesize = input_end - input_start;
1695   }
1696   else
1697   {
1698      astring *size_str = params.find(OPTION_SIZE);
1699      if (size_str != NULL)
1700      {
1701         if (sscanf(*size_str, "%"I64FMT"d", &filesize) != 1)
1702            report_error(1, "Invalid size string");
1703      }
1704   }
1705   
1694
17061695   // process compression
17071696   chd_codec_type compression[4];
17081697   memcpy(compression, s_default_hd_compression, sizeof(compression));
r242926r242927
17571746      if (sscanf(metadata, HARD_DISK_METADATA_FORMAT, &cylinders, &heads, &sectors, &sector_size) != 4)
17581747         report_error(1, "Error parsing hard disk metadata in parent CHD");
17591748   }
1760     
1761   // validate the size
1762   if (filesize % sector_size != 0)
1763      report_error(1, "Data size is not divisible by sector size %d", sector_size);
17641749
17651750   // if no CHS values, try to guess them
17661751   if (cylinders == 0)
17671752   {
1768      if (input_file == NULL && filesize == 0)
1753      if (input_file == NULL && input_end - input_start == 0)
17691754         report_error(1, "Blank hard drives must specify either a length or a set of CHS values");
1770      guess_chs(input_file_str, filesize, sector_size, cylinders, heads, sectors, sector_size);
1755      guess_chs(input_file_str, input_end - input_start, sector_size, cylinders, heads, sectors, sector_size);
17711756   }
17721757   UINT32 totalsectors = cylinders * heads * sectors;
17731758
r242926r242927
17821767      if (input_start != 0 || input_end != core_fsize(input_file))
17831768      {
17841769         printf("Input start:  %s\n", big_int_string(tempstr, input_start));
1785         printf("Input length: %s\n", big_int_string(tempstr, filesize));
1770         printf("Input length: %s\n", big_int_string(tempstr, input_end - input_start));
17861771      }
17871772   }
17881773   printf("Compression:  %s\n", compression_string(tempstr, compression));


Previous 199869 Revisions Next


© 1997-2024 The MAME Team