1
/*********************************************************************
5
Telenova Compis disk images
7
*********************************************************************/
11
#include "formats/cpis_dsk.h"
12
#include "formats/basicdsk.h"
15
static int compis_get_tracks_and_sectors(floppy_image *floppy, int *tracks, int *sectors)
17
switch(floppy_image_size(floppy)) {
18
case 0x50000: /* 320 KB */
23
case 0x5a000: /* 360 KB */
28
case 0xa0000: /* 640 KB */
33
case 0xb4000: /* 720 KB */
38
case 0x12c000: /* 1200 KB */
51
static FLOPPY_IDENTIFY(compis_dsk_identify)
54
*vote = compis_get_tracks_and_sectors(floppy, &dummy, &dummy) ? 100 : 0;
55
return FLOPPY_ERROR_SUCCESS;
60
static FLOPPY_CONSTRUCT(compis_dsk_construct)
62
struct basicdsk_geometry geometry;
64
memset(&geometry, 0, sizeof(geometry));
66
geometry.first_sector_id = 1;
67
geometry.sector_length = 512;
72
geometry.tracks = option_resolution_lookup_int(params, PARAM_TRACKS);
73
geometry.sectors = option_resolution_lookup_int(params, PARAM_SECTORS);
78
if (!compis_get_tracks_and_sectors(floppy, &geometry.tracks, &geometry.sectors))
79
return FLOPPY_ERROR_INVALIDIMAGE;
82
return basicdsk_construct(floppy, &geometry);
87
/* ----------------------------------------------------------------------- */
89
FLOPPY_OPTIONS_START( compis )
90
FLOPPY_OPTION( compis_dsk, "dsk", "Compis floppy disk image", compis_dsk_identify, compis_dsk_construct, NULL,