Previous 15994 Revisions Next

r2252 Friday 4th April, 2008 at 16:14:45 UTC by Dirk Best
[COUPE] Fixed SAD image creation
[src/mess/formats]coupedsk.c

src/mess/formats/coupedsk.c
r2251r2252
1111
1212
1313#define SAD_HEADER_LEN  22
14#define SAD_SIGNATURE   "Aley's disk backup"
1415
1516
1617
r2251r2252
135136   if (params)
136137   {
137138      /* create */
139      UINT8 header[SAD_HEADER_LEN];
140
141      /* get format options */
138142      heads = option_resolution_lookup_int(params, PARAM_HEADS);
139143      tracks = option_resolution_lookup_int(params, PARAM_TRACKS);
140144      sectors = option_resolution_lookup_int(params, PARAM_SECTORS);
141145      sector_length = option_resolution_lookup_int(params, PARAM_SECTOR_LENGTH);
146
147      /* build the header */
148      memset(header, 0, SAD_HEADER_LEN);
149      memcpy(header, SAD_SIGNATURE, 18);
150      header[18] = heads;
151      header[19] = tracks;
152      header[20] = sectors;
153      header[21] = sector_length >> 6;
154
155      /* and write it to disk */
156      floppy_image_write(floppy, header, 0, sizeof(header));
142157   }
143158   else
144159   {

Previous 15994 Revisions Next


© 1998-2018 The MESS Team