static void fd_revalidate(FDrive *drv)

{

    int rc;



    FLOPPY_DPRINTF("revalidate\n");

    if (drv->blk != NULL) {

        drv->ro = blk_is_read_only(drv->blk);

        if (!blk_is_inserted(drv->blk)) {

            FLOPPY_DPRINTF("No disk in drive\n");

            drv->disk = FLOPPY_DRIVE_TYPE_NONE;


        } else if (!drv->media_validated) {

            rc = pick_geometry(drv);

            if (rc) {

                FLOPPY_DPRINTF("Could not validate floppy drive media");

            } else {

                drv->media_validated = true;

                FLOPPY_DPRINTF("Floppy disk (%d h %d t %d s) %s\n",

                               (drv->flags & FDISK_DBL_SIDES) ? 2 : 1,

                               drv->max_track, drv->last_sect,

                               drv->ro ? "ro" : "rw");

            }

        }

    } else {

        FLOPPY_DPRINTF("No drive connected\n");

        drv->last_sect = 0;

        drv->max_track = 0;

        drv->flags &= ~FDISK_DBL_SIDES;

        drv->drive = FLOPPY_DRIVE_TYPE_NONE;

        drv->disk = FLOPPY_DRIVE_TYPE_NONE;

    }

}
static void fd_revalidate(FDrive *drv)

{

    int rc;



    FLOPPY_DPRINTF("revalidate\n");

    if (drv->blk != NULL) {

        drv->ro = blk_is_read_only(drv->blk);

        if (!blk_is_inserted(drv->blk)) {

            FLOPPY_DPRINTF("No disk in drive\n");

            drv->disk = FLOPPY_DRIVE_TYPE_NONE;


        } else if (!drv->media_validated) {

            rc = pick_geometry(drv);

            if (rc) {

                FLOPPY_DPRINTF("Could not validate floppy drive media");

            } else {

                drv->media_validated = true;

                FLOPPY_DPRINTF("Floppy disk (%d h %d t %d s) %s\n",

                               (drv->flags & FDISK_DBL_SIDES) ? 2 : 1,

                               drv->max_track, drv->last_sect,

                               drv->ro ? "ro" : "rw");

            }

        }

    } else {

        FLOPPY_DPRINTF("No drive connected\n");

        drv->last_sect = 0;

        drv->max_track = 0;

        drv->flags &= ~FDISK_DBL_SIDES;

        drv->drive = FLOPPY_DRIVE_TYPE_NONE;

        drv->disk = FLOPPY_DRIVE_TYPE_NONE;

    }

}
static void FUNC_0(FDrive *VAR_0)

{

    int VAR_1;



    FLOPPY_DPRINTF("revalidate\n");

    if (VAR_0->blk != NULL) {

        VAR_0->ro = blk_is_read_only(VAR_0->blk);

        if (!blk_is_inserted(VAR_0->blk)) {

            FLOPPY_DPRINTF("No disk in drive\n");

            VAR_0->disk = FLOPPY_DRIVE_TYPE_NONE;


        } else if (!VAR_0->media_validated) {

            VAR_1 = pick_geometry(VAR_0);

            if (VAR_1) {

                FLOPPY_DPRINTF("Could not validate floppy drive media");

            } else {

                VAR_0->media_validated = true;

                FLOPPY_DPRINTF("Floppy disk (%d h %d t %d s) %s\n",

                               (VAR_0->flags & FDISK_DBL_SIDES) ? 2 : 1,

                               VAR_0->max_track, VAR_0->last_sect,

                               VAR_0->ro ? "ro" : "rw");

            }

        }

    } else {

        FLOPPY_DPRINTF("No drive connected\n");

        VAR_0->last_sect = 0;

        VAR_0->max_track = 0;

        VAR_0->flags &= ~FDISK_DBL_SIDES;

        VAR_0->drive = FLOPPY_DRIVE_TYPE_NONE;

        VAR_0->disk = FLOPPY_DRIVE_TYPE_NONE;

    }

}
static void FUNC_0(FDrive *VAR_0)
{ int VAR_1; FLOPPY_DPRINTF("revalidate\n"); if (VAR_0->blk != NULL) { VAR_0->ro = blk_is_read_only(VAR_0->blk); if (!blk_is_inserted(VAR_0->blk)) { FLOPPY_DPRINTF("No disk in drive\n"); VAR_0->disk = FLOPPY_DRIVE_TYPE_NONE; } else if (!VAR_0->media_validated) { VAR_1 = pick_geometry(VAR_0); if (VAR_1) { FLOPPY_DPRINTF("Could not validate floppy drive media"); } else { VAR_0->media_validated = true; FLOPPY_DPRINTF("Floppy disk (%d h %d t %d s) %s\n",
(VAR_0->flags & FDISK_DBL_SIDES) ? 2 : 1,
VAR_0->max_track, VAR_0->last_sect,
VAR_0->ro ? "ro" : "rw"); } } } else { FLOPPY_DPRINTF("No drive connected\n"); VAR_0->last_sect = 0; VAR_0->max_track = 0; VAR_0->flags &= ~FDISK_DBL_SIDES; VAR_0->drive = FLOPPY_DRIVE_TYPE_NONE; VAR_0->disk = FLOPPY_DRIVE_TYPE_NONE; } }