Cleaned up the MO struct and some fixed to the new image dialpg.
This commit is contained in:
@@ -373,7 +373,7 @@ mo_load(mo_t *dev, wchar_t *fn)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < KNOWN_MO_TYPES; i++) {
|
for (i = 0; i < KNOWN_MO_TYPES; i++) {
|
||||||
if (size == mo_types[i].disk_size) {
|
if (size == (mo_types[i].sectors * mo_types[i].bytes_per_sector)) {
|
||||||
found = 1;
|
found = 1;
|
||||||
dev->drv->medium_size = mo_types[i].sectors;
|
dev->drv->medium_size = mo_types[i].sectors;
|
||||||
dev->drv->sector_size = mo_types[i].bytes_per_sector;
|
dev->drv->sector_size = mo_types[i].bytes_per_sector;
|
||||||
|
@@ -31,31 +31,29 @@
|
|||||||
typedef struct {
|
typedef struct {
|
||||||
uint32_t sectors;
|
uint32_t sectors;
|
||||||
uint16_t bytes_per_sector;
|
uint16_t bytes_per_sector;
|
||||||
int64_t disk_size;
|
|
||||||
char name[255];
|
|
||||||
} mo_type_t;
|
} mo_type_t;
|
||||||
|
|
||||||
#define KNOWN_MO_TYPES 10
|
#define KNOWN_MO_TYPES 10
|
||||||
static const mo_type_t mo_types[KNOWN_MO_TYPES] = {
|
static const mo_type_t mo_types[KNOWN_MO_TYPES] = {
|
||||||
// 3.5" standard M.O. disks
|
// 3.5" standard M.O. disks
|
||||||
{ 248826, 512, 127398912, "3.5\" 128Mb M.O. (ISO 10090)" },
|
{ 248826, 512 },
|
||||||
{ 446325, 512, 228518400, "3.5\" 230Mb M.O. (ISO 13963)" },
|
{ 446325, 512 },
|
||||||
{ 1041500, 512, 533248000, "3.5\" 540Mb M.O. (ISO 15498)" },
|
{ 1041500, 512 },
|
||||||
{ 310352, 2048, 635600896, "3.5\" 640Mb M.O. (ISO 15498)" },
|
{ 310352, 2048 },
|
||||||
{ 605846, 2048, 1240772608, "3.5\" 1.3Gb M.O. (GigaMO)" },
|
{ 605846, 2048 },
|
||||||
{ 1063146, 2048, 2177323008, "3.5\" 2.3Gb M.O. (GigaMO 2)" },
|
{ 1063146, 2048 },
|
||||||
// 5.25" M.O. disks
|
// 5.25" M.O. disks
|
||||||
{573624, 512, 293695488, "5.25\" 600Mb M.O."},
|
{573624, 512 },
|
||||||
{314568, 1024, 322117632, "5.25\" 650Mb M.O."},
|
{314568, 1024 },
|
||||||
{904995, 512, 463357440, "5.25\" 1Gb M.O."},
|
{904995, 512 },
|
||||||
{637041, 1024, 652329984, "5.25\" 1.3Gb M.O."},
|
{637041, 1024 },
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
char vendor[8];
|
const char vendor[8];
|
||||||
char model[16];
|
const char model[16];
|
||||||
char revision[4];
|
const char revision[4];
|
||||||
int8_t supported_media[KNOWN_MO_TYPES];
|
int8_t supported_media[KNOWN_MO_TYPES];
|
||||||
} mo_drive_type_t;
|
} mo_drive_type_t;
|
||||||
|
|
||||||
|
@@ -543,7 +543,7 @@ create_mo_sector_image(WCHAR *file_name, int8_t disk_size, uint8_t is_mdi, HWND
|
|||||||
total_sectors = dp->sectors;
|
total_sectors = dp->sectors;
|
||||||
total_size = total_sectors * sector_bytes;
|
total_size = total_sectors * sector_bytes;
|
||||||
|
|
||||||
pbar_max = dp->sectors >> 11;
|
pbar_max = total_size;
|
||||||
if (is_mdi)
|
if (is_mdi)
|
||||||
pbar_max += base;
|
pbar_max += base;
|
||||||
pbar_max >>= 11;
|
pbar_max >>= 11;
|
||||||
|
Reference in New Issue
Block a user