static DEVICE_CREATE(mess_hd) { int err; char metadata[256]; UINT32 sectorsize, hunksize; UINT32 cylinders, heads, sectors, totalsectors; cylinders = option_resolution_lookup_int(create_args, 'C'); heads = option_resolution_lookup_int(create_args, 'H'); sectors = option_resolution_lookup_int(create_args, 'S'); sectorsize = option_resolution_lookup_int(create_args, 'L'); hunksize = option_resolution_lookup_int(create_args, 'K'); totalsectors = cylinders * heads * sectors; /* create the CHD file */ err = chd_create_ref(image, (UINT64)totalsectors * (UINT64)sectorsize, hunksize, CHDCOMPRESSION_NONE, NULL); if (err != CHDERR_NONE) goto error; sprintf(metadata, HARD_DISK_METADATA_FORMAT, cylinders, heads, sectors, sectorsize); return internal_load_mess_hd(image, metadata); error: return INIT_FAIL; }
int device_load_mess_hd(mess_image *image) { return internal_load_mess_hd(image, NULL); }