mirror of
https://github.com/holub/mame
synced 2025-04-23 17:00:53 +03:00
floppy_image to floppy_image_legacy rename (no whatsnew)
This commit is contained in:
parent
f3a2397a09
commit
70c76783e2
@ -82,7 +82,7 @@ struct _floppy_drive
|
||||
|
||||
device_t *controller;
|
||||
|
||||
floppy_image *floppy;
|
||||
floppy_image_legacy *floppy;
|
||||
int track;
|
||||
void (*load_proc)(device_image_interface &image);
|
||||
void (*unload_proc)(device_image_interface &image);
|
||||
@ -127,7 +127,7 @@ INLINE floppy_drive *get_safe_token(device_t *device)
|
||||
return (floppy_drive *) downcast<legacy_device_base *>(device)->token();
|
||||
}
|
||||
|
||||
floppy_image *flopimg_get_image(device_t *image)
|
||||
floppy_image_legacy *flopimg_get_image(device_t *image)
|
||||
{
|
||||
return get_safe_token(image)->floppy;
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ void floppy_drive_set_rpm(device_t *image, float rpm);
|
||||
|
||||
void floppy_drive_set_controller(device_t *img, device_t *controller);
|
||||
|
||||
floppy_image *flopimg_get_image(device_t *image);
|
||||
floppy_image_legacy *flopimg_get_image(device_t *image);
|
||||
|
||||
/* hack for apple II; replace this when we think of something better */
|
||||
void floppy_install_unload_proc(device_t *image, void (*proc)(device_image_interface &image));
|
||||
|
@ -658,7 +658,7 @@ static void wd17xx_command_restore(device_t *device)
|
||||
static void write_track(device_t *device)
|
||||
{
|
||||
wd1770_state *w = get_safe_token(device);
|
||||
floppy_image *floppy;
|
||||
floppy_image_legacy *floppy;
|
||||
#if 0
|
||||
int i;
|
||||
for (i=0;i+4<w->data_offset;)
|
||||
@ -719,7 +719,7 @@ static void write_track(device_t *device)
|
||||
static void read_track(device_t *device)
|
||||
{
|
||||
wd1770_state *w = get_safe_token(device);
|
||||
floppy_image *floppy;
|
||||
floppy_image_legacy *floppy;
|
||||
#if 0
|
||||
UINT8 *psrc; /* pointer to track format structure */
|
||||
UINT8 *pdst; /* pointer to track buffer */
|
||||
|
@ -20,22 +20,22 @@
|
||||
|
||||
|
||||
/* used in for all Apple II images */
|
||||
static UINT32 apple2_get_track_size(floppy_image *floppy, int head, int track);
|
||||
static UINT32 apple2_get_track_size(floppy_image_legacy *floppy, int head, int track);
|
||||
static int disk_decode_nib(UINT8 *data, const UINT8 *nibble, int *volume, int *track, int *sector);
|
||||
static void disk_encode_nib(UINT8 *nibble, const UINT8 *data, int volume, int track, int sector);
|
||||
|
||||
/* used in DOS/ProDOS order images */
|
||||
static int apple2_do_translate_sector(floppy_image *floppy, int sector);
|
||||
static int apple2_po_translate_sector(floppy_image *floppy, int sector);
|
||||
static floperr_t apple2_dsk_read_track(floppy_image *floppy, int head, int track, UINT64 offset, void *buffer, size_t buflen);
|
||||
static floperr_t apple2_dsk_write_track(floppy_image *floppy, int head, int track, UINT64 offset, const void *buffer, size_t buflen);
|
||||
static int apple2_do_translate_sector(floppy_image_legacy *floppy, int sector);
|
||||
static int apple2_po_translate_sector(floppy_image_legacy *floppy, int sector);
|
||||
static floperr_t apple2_dsk_read_track(floppy_image_legacy *floppy, int head, int track, UINT64 offset, void *buffer, size_t buflen);
|
||||
static floperr_t apple2_dsk_write_track(floppy_image_legacy *floppy, int head, int track, UINT64 offset, const void *buffer, size_t buflen);
|
||||
|
||||
/* used in nibble order images */
|
||||
static floperr_t apple2_nib_read_track(floppy_image *floppy, int head, int track, UINT64 offset, void *buffer, size_t buflen);
|
||||
static floperr_t apple2_nib_write_track(floppy_image *floppy, int head, int track, UINT64 offset, const void *buffer, size_t buflen);
|
||||
static floperr_t apple2_nib_read_sector(floppy_image *floppy, int head, int track, int sector, void *buffer, size_t buflen);
|
||||
static floperr_t apple2_nib_write_sector(floppy_image *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam);
|
||||
static floperr_t apple2_nib_get_sector_length(floppy_image *floppy, int head, int track, int sector, UINT32 *sector_length);
|
||||
static floperr_t apple2_nib_read_track(floppy_image_legacy *floppy, int head, int track, UINT64 offset, void *buffer, size_t buflen);
|
||||
static floperr_t apple2_nib_write_track(floppy_image_legacy *floppy, int head, int track, UINT64 offset, const void *buffer, size_t buflen);
|
||||
static floperr_t apple2_nib_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen);
|
||||
static floperr_t apple2_nib_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam);
|
||||
static floperr_t apple2_nib_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length);
|
||||
|
||||
|
||||
static const UINT8 translate6[0x40] =
|
||||
@ -79,7 +79,7 @@ static const UINT8 *get_untranslate6_map(void)
|
||||
* ----------------------------------------------------------------------- */
|
||||
|
||||
|
||||
static floperr_t apple2_general_construct(floppy_image *floppy, int floppy_type)
|
||||
static floperr_t apple2_general_construct(floppy_image_legacy *floppy, int floppy_type)
|
||||
{
|
||||
floperr_t err;
|
||||
struct basicdsk_geometry geometry;
|
||||
@ -148,7 +148,7 @@ static FLOPPY_IDENTIFY(apple2_dsk_identify)
|
||||
|
||||
|
||||
|
||||
static int apple2_do_translate_sector(floppy_image *floppy, int sector)
|
||||
static int apple2_do_translate_sector(floppy_image_legacy *floppy, int sector)
|
||||
{
|
||||
static const UINT8 skewing[] =
|
||||
{
|
||||
@ -161,7 +161,7 @@ static int apple2_do_translate_sector(floppy_image *floppy, int sector)
|
||||
|
||||
|
||||
|
||||
static int apple2_po_translate_sector(floppy_image *floppy, int sector)
|
||||
static int apple2_po_translate_sector(floppy_image_legacy *floppy, int sector)
|
||||
{
|
||||
static const UINT8 skewing[] =
|
||||
{
|
||||
@ -188,7 +188,7 @@ static FLOPPY_CONSTRUCT(apple2_po_construct)
|
||||
|
||||
|
||||
|
||||
static floperr_t apple2_dsk_read_track(floppy_image *floppy, int head, int track, UINT64 offset, void *buffer, size_t buflen)
|
||||
static floperr_t apple2_dsk_read_track(floppy_image_legacy *floppy, int head, int track, UINT64 offset, void *buffer, size_t buflen)
|
||||
{
|
||||
UINT8 sector_buffer[APPLE2_SECTOR_SIZE];
|
||||
int sector;
|
||||
@ -214,7 +214,7 @@ static floperr_t apple2_dsk_read_track(floppy_image *floppy, int head, int track
|
||||
|
||||
|
||||
|
||||
static floperr_t apple2_dsk_write_track(floppy_image *floppy, int head, int track, UINT64 offset, const void *buffer, size_t buflen)
|
||||
static floperr_t apple2_dsk_write_track(floppy_image_legacy *floppy, int head, int track, UINT64 offset, const void *buffer, size_t buflen)
|
||||
{
|
||||
int sector;
|
||||
UINT8 sector_buffer[APPLE2_SECTOR_SIZE];
|
||||
@ -258,7 +258,7 @@ static FLOPPY_CONSTRUCT(apple2_nib_construct)
|
||||
|
||||
|
||||
|
||||
static floperr_t apple2_nib_read_track(floppy_image *floppy, int head, int track, UINT64 offset, void *buffer, size_t buflen)
|
||||
static floperr_t apple2_nib_read_track(floppy_image_legacy *floppy, int head, int track, UINT64 offset, void *buffer, size_t buflen)
|
||||
{
|
||||
if ((head != 0) || (track < 0) || (track >= APPLE2_TRACK_COUNT))
|
||||
return FLOPPY_ERROR_SEEKERROR;
|
||||
@ -270,7 +270,7 @@ static floperr_t apple2_nib_read_track(floppy_image *floppy, int head, int track
|
||||
|
||||
|
||||
|
||||
static floperr_t apple2_nib_write_track(floppy_image *floppy, int head, int track, UINT64 offset, const void *buffer, size_t buflen)
|
||||
static floperr_t apple2_nib_write_track(floppy_image_legacy *floppy, int head, int track, UINT64 offset, const void *buffer, size_t buflen)
|
||||
{
|
||||
if ((head != 0) || (track < 0) || (track >= APPLE2_TRACK_COUNT))
|
||||
return FLOPPY_ERROR_SEEKERROR;
|
||||
@ -360,7 +360,7 @@ static int disk_decode_nib(UINT8 *data, const UINT8 *nibble, int *volume, int *t
|
||||
|
||||
|
||||
|
||||
static floperr_t apple2_nib_read_sector(floppy_image *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
static floperr_t apple2_nib_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
{
|
||||
floperr_t err;
|
||||
const UINT8 *nibble;
|
||||
@ -450,7 +450,7 @@ static void disk_encode_nib(UINT8 *nibble, const UINT8 *data, int volume, int tr
|
||||
|
||||
|
||||
|
||||
static floperr_t apple2_nib_write_sector(floppy_image *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
static floperr_t apple2_nib_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
{
|
||||
floperr_t err;
|
||||
UINT8 *track_data;
|
||||
@ -472,7 +472,7 @@ static floperr_t apple2_nib_write_sector(floppy_image *floppy, int head, int tra
|
||||
|
||||
|
||||
|
||||
static floperr_t apple2_nib_get_sector_length(floppy_image *floppy, int head, int track, int sector, UINT32 *sector_length)
|
||||
static floperr_t apple2_nib_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length)
|
||||
{
|
||||
*sector_length = APPLE2_SECTOR_SIZE;
|
||||
return FLOPPY_ERROR_SUCCESS;
|
||||
@ -480,7 +480,7 @@ static floperr_t apple2_nib_get_sector_length(floppy_image *floppy, int head, in
|
||||
|
||||
|
||||
|
||||
static UINT32 apple2_get_track_size(floppy_image *floppy, int head, int track)
|
||||
static UINT32 apple2_get_track_size(floppy_image_legacy *floppy, int head, int track)
|
||||
{
|
||||
return APPLE2_NIBBLE_SIZE * APPLE2_SECTOR_COUNT;
|
||||
}
|
||||
|
@ -208,7 +208,7 @@ static const UINT8 blk3[] =
|
||||
|
||||
|
||||
|
||||
static struct apple35_tag *get_apple35_tag(floppy_image *floppy)
|
||||
static struct apple35_tag *get_apple35_tag(floppy_image_legacy *floppy)
|
||||
{
|
||||
struct apple35_tag *tag;
|
||||
tag = (struct apple35_tag *) floppy_tag(floppy);
|
||||
@ -217,7 +217,7 @@ static struct apple35_tag *get_apple35_tag(floppy_image *floppy)
|
||||
|
||||
|
||||
|
||||
int apple35_sectors_per_track(floppy_image *image, int track)
|
||||
int apple35_sectors_per_track(floppy_image_legacy *image, int track)
|
||||
{
|
||||
int sectors;
|
||||
|
||||
@ -440,7 +440,7 @@ UINT8 sony_fetchtrack(const UINT8 *buffer, size_t buffer_len, size_t *pos)
|
||||
|
||||
|
||||
|
||||
static UINT32 apple35_get_offset(floppy_image *floppy, int head, int track, int sector, UINT32 *tag_offset)
|
||||
static UINT32 apple35_get_offset(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *tag_offset)
|
||||
{
|
||||
int i;
|
||||
UINT32 sector_index = 0;
|
||||
@ -473,7 +473,7 @@ static UINT32 apple35_get_offset(floppy_image *floppy, int head, int track, int
|
||||
|
||||
|
||||
|
||||
static floperr_t apple35_read_sector(floppy_image *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
static floperr_t apple35_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
{
|
||||
UINT32 data_offset;
|
||||
// printf("Read sector: T %d S %d H %d\n", track, sector, head);
|
||||
@ -486,7 +486,7 @@ static floperr_t apple35_read_sector(floppy_image *floppy, int head, int track,
|
||||
|
||||
|
||||
|
||||
static floperr_t apple35_write_sector(floppy_image *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
static floperr_t apple35_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
{
|
||||
UINT32 data_offset;
|
||||
|
||||
@ -499,7 +499,7 @@ static floperr_t apple35_write_sector(floppy_image *floppy, int head, int track,
|
||||
|
||||
|
||||
|
||||
static floperr_t apple35_read_sector_td(floppy_image *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
static floperr_t apple35_read_sector_td(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
{
|
||||
floperr_t err;
|
||||
UINT32 tag_offset = 0;
|
||||
@ -524,7 +524,7 @@ static floperr_t apple35_read_sector_td(floppy_image *floppy, int head, int trac
|
||||
|
||||
|
||||
|
||||
static floperr_t apple35_write_sector_td(floppy_image *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
static floperr_t apple35_write_sector_td(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
{
|
||||
floperr_t err;
|
||||
UINT32 tag_offset = 0;
|
||||
@ -546,7 +546,7 @@ static floperr_t apple35_write_sector_td(floppy_image *floppy, int head, int tra
|
||||
|
||||
|
||||
|
||||
static floperr_t apple35_get_sector_length(floppy_image *floppy, int head, int track, int sector, UINT32 *sector_length)
|
||||
static floperr_t apple35_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length)
|
||||
{
|
||||
*sector_length = 512;
|
||||
return FLOPPY_ERROR_SUCCESS;
|
||||
@ -554,21 +554,21 @@ static floperr_t apple35_get_sector_length(floppy_image *floppy, int head, int t
|
||||
|
||||
|
||||
|
||||
static int apple35_get_heads_per_disk(floppy_image *floppy)
|
||||
static int apple35_get_heads_per_disk(floppy_image_legacy *floppy)
|
||||
{
|
||||
return get_apple35_tag(floppy)->sides;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static int apple35_get_tracks_per_disk(floppy_image *floppy)
|
||||
static int apple35_get_tracks_per_disk(floppy_image_legacy *floppy)
|
||||
{
|
||||
return 80;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static UINT32 apple35_get_track_size(floppy_image *floppy, int head, int track)
|
||||
static UINT32 apple35_get_track_size(floppy_image_legacy *floppy, int head, int track)
|
||||
{
|
||||
if ((track < 0) || (track >= 80))
|
||||
return 0;
|
||||
@ -588,7 +588,7 @@ static UINT8 calculate_side(int head, int track)
|
||||
|
||||
|
||||
|
||||
static floperr_t apple35_read_track(floppy_image *floppy, int head, int track, UINT64 offset, void *buffer, size_t buflen)
|
||||
static floperr_t apple35_read_track(floppy_image_legacy *floppy, int head, int track, UINT64 offset, void *buffer, size_t buflen)
|
||||
{
|
||||
floperr_t err;
|
||||
size_t pos = 0;
|
||||
@ -648,7 +648,7 @@ static floperr_t apple35_read_track(floppy_image *floppy, int head, int track, U
|
||||
|
||||
|
||||
|
||||
static floperr_t apple35_write_track(floppy_image *floppy, int head, int track, UINT64 offset, const void *buffer, size_t buflen)
|
||||
static floperr_t apple35_write_track(floppy_image_legacy *floppy, int head, int track, UINT64 offset, const void *buffer, size_t buflen)
|
||||
{
|
||||
floperr_t err;
|
||||
size_t pos = 0;
|
||||
@ -771,7 +771,7 @@ static floperr_t apple35_write_track(floppy_image *floppy, int head, int track,
|
||||
|
||||
|
||||
|
||||
static floperr_t apple35_construct(floppy_image *floppy, UINT32 data_offset, UINT32 data_size,
|
||||
static floperr_t apple35_construct(floppy_image_legacy *floppy, UINT32 data_offset, UINT32 data_size,
|
||||
UINT32 tag_offset, UINT32 tag_size, INT16 format_byte, UINT8 sides, int is_1440k)
|
||||
{
|
||||
struct apple35_tag *tag;
|
||||
@ -889,7 +889,7 @@ struct header_diskcopy
|
||||
|
||||
|
||||
|
||||
static floperr_t apple35_diskcopy_headerdecode(floppy_image *floppy, UINT32 *data_offset,
|
||||
static floperr_t apple35_diskcopy_headerdecode(floppy_image_legacy *floppy, UINT32 *data_offset,
|
||||
UINT32 *data_size, UINT32 *tag_offset, UINT32 *tag_size, UINT8 *format_byte, UINT8 *sides)
|
||||
{
|
||||
UINT64 size;
|
||||
@ -1032,7 +1032,7 @@ struct header_2img
|
||||
|
||||
|
||||
|
||||
static floperr_t apple35_2img_decode(floppy_image *floppy, UINT32 *image_format,
|
||||
static floperr_t apple35_2img_decode(floppy_image_legacy *floppy, UINT32 *image_format,
|
||||
UINT32 *data_offset, UINT32 *data_length)
|
||||
{
|
||||
struct header_2img header;
|
||||
|
@ -14,7 +14,7 @@
|
||||
void sony_filltrack(UINT8 *buffer, size_t buffer_len, size_t *pos, UINT8 data);
|
||||
UINT8 sony_fetchtrack(const UINT8 *buffer, size_t buffer_len, size_t *pos);
|
||||
|
||||
int apple35_sectors_per_track(floppy_image *image, int track);
|
||||
int apple35_sectors_per_track(floppy_image_legacy *image, int track);
|
||||
|
||||
/**************************************************************************/
|
||||
|
||||
|
@ -63,7 +63,7 @@ struct apr_tag
|
||||
* 15: sector
|
||||
*/
|
||||
|
||||
static floperr_t apr_read_sector(floppy_image *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
static floperr_t apr_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
{
|
||||
struct apr_tag *tag = (apr_tag *)floppy_tag(floppy);
|
||||
// printf("apr_read_sector %d %d %d\n", head, track, sector);
|
||||
@ -71,7 +71,7 @@ static floperr_t apr_read_sector(floppy_image *floppy, int head, int track, int
|
||||
return FLOPPY_ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
static floperr_t apr_read_indexed_sector(floppy_image *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
static floperr_t apr_read_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
{
|
||||
struct apr_tag *tag = (apr_tag *)floppy_tag(floppy);
|
||||
// printf("apr_read_indexed_sector %d %d %d\n", head, track, sector);
|
||||
@ -80,25 +80,25 @@ static floperr_t apr_read_indexed_sector(floppy_image *floppy, int head, int tra
|
||||
}
|
||||
|
||||
/* sector length is always 512 byte */
|
||||
static floperr_t apr_get_sector_length(floppy_image *floppy, int head, int track, int sector, UINT32 *sector_length)
|
||||
static floperr_t apr_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length)
|
||||
{
|
||||
*sector_length = 512;
|
||||
return FLOPPY_ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
static int apr_get_heads_per_disk(floppy_image *floppy)
|
||||
static int apr_get_heads_per_disk(floppy_image_legacy *floppy)
|
||||
{
|
||||
struct apr_tag *tag = (apr_tag *)floppy_tag(floppy);
|
||||
return tag->heads;
|
||||
}
|
||||
|
||||
static int apr_get_tracks_per_disk(floppy_image *floppy)
|
||||
static int apr_get_tracks_per_disk(floppy_image_legacy *floppy)
|
||||
{
|
||||
struct apr_tag *tag = (apr_tag *)floppy_tag(floppy);
|
||||
return tag->tracks;
|
||||
}
|
||||
|
||||
static floperr_t apr_get_indexed_sector_info(floppy_image *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags)
|
||||
static floperr_t apr_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags)
|
||||
{
|
||||
struct apr_tag *tag = (apr_tag *)floppy_tag(floppy);
|
||||
|
||||
|
@ -12,15 +12,15 @@
|
||||
|
||||
#include "basicdsk.h"
|
||||
|
||||
static floperr_t basicdsk_read_sector(floppy_image *floppy, int head, int track, int sector, void *buffer, size_t buflen);
|
||||
static floperr_t basicdsk_write_sector(floppy_image *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam);
|
||||
static floperr_t basicdsk_read_indexed_sector(floppy_image *floppy, int head, int track, int sector, void *buffer, size_t buflen);
|
||||
static floperr_t basicdsk_write_indexed_sector(floppy_image *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam);
|
||||
static floperr_t basicdsk_get_sector_length(floppy_image *floppy, int head, int track, int sector, UINT32 *sector_length);
|
||||
static floperr_t basicdsk_get_indexed_sector_info(floppy_image *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags);
|
||||
static int basicdsk_get_heads_per_disk(floppy_image *floppy);
|
||||
static int basicdsk_get_tracks_per_disk(floppy_image *floppy);
|
||||
static floperr_t basicdsk_format_track(floppy_image *floppy, int head, int track, option_resolution *params);
|
||||
static floperr_t basicdsk_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen);
|
||||
static floperr_t basicdsk_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam);
|
||||
static floperr_t basicdsk_read_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen);
|
||||
static floperr_t basicdsk_write_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam);
|
||||
static floperr_t basicdsk_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length);
|
||||
static floperr_t basicdsk_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags);
|
||||
static int basicdsk_get_heads_per_disk(floppy_image_legacy *floppy);
|
||||
static int basicdsk_get_tracks_per_disk(floppy_image_legacy *floppy);
|
||||
static floperr_t basicdsk_format_track(floppy_image_legacy *floppy, int head, int track, option_resolution *params);
|
||||
|
||||
|
||||
|
||||
@ -35,7 +35,7 @@ struct basicdsk_tag
|
||||
|
||||
/********************************************************************/
|
||||
|
||||
static const struct basicdsk_geometry *get_geometry(floppy_image *floppy)
|
||||
static const struct basicdsk_geometry *get_geometry(floppy_image_legacy *floppy)
|
||||
{
|
||||
const struct basicdsk_tag *tag;
|
||||
tag = (const basicdsk_tag *)floppy_tag(floppy);
|
||||
@ -44,7 +44,7 @@ static const struct basicdsk_geometry *get_geometry(floppy_image *floppy)
|
||||
|
||||
|
||||
|
||||
floperr_t basicdsk_construct(floppy_image *floppy, const struct basicdsk_geometry *geometry)
|
||||
floperr_t basicdsk_construct(floppy_image_legacy *floppy, const struct basicdsk_geometry *geometry)
|
||||
{
|
||||
struct basicdsk_tag *tag;
|
||||
struct FloppyCallbacks *format;
|
||||
@ -75,7 +75,7 @@ floperr_t basicdsk_construct(floppy_image *floppy, const struct basicdsk_geometr
|
||||
|
||||
|
||||
|
||||
static floperr_t get_offset(floppy_image *floppy, int head, int track, int sector, int sector_is_index, UINT64 *offset)
|
||||
static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, UINT64 *offset)
|
||||
{
|
||||
const struct basicdsk_geometry *geom;
|
||||
UINT64 offs;
|
||||
@ -117,7 +117,7 @@ static floperr_t get_offset(floppy_image *floppy, int head, int track, int secto
|
||||
|
||||
|
||||
|
||||
static int internal_basicdsk_translate_sector_interleave(floppy_image *floppy, int sector)
|
||||
static int internal_basicdsk_translate_sector_interleave(floppy_image_legacy *floppy, int sector)
|
||||
{
|
||||
const struct basicdsk_geometry *geom = get_geometry(floppy);
|
||||
if (sector >= geom->sectors)
|
||||
@ -127,7 +127,7 @@ static int internal_basicdsk_translate_sector_interleave(floppy_image *floppy, i
|
||||
|
||||
|
||||
|
||||
static floperr_t internal_basicdsk_read_sector(floppy_image *floppy, int head, int track, int sector, int sector_is_index, void *buffer, size_t buflen)
|
||||
static floperr_t internal_basicdsk_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, void *buffer, size_t buflen)
|
||||
{
|
||||
UINT64 offset;
|
||||
floperr_t err;
|
||||
@ -141,7 +141,7 @@ static floperr_t internal_basicdsk_read_sector(floppy_image *floppy, int head, i
|
||||
|
||||
|
||||
|
||||
static floperr_t internal_basicdsk_write_sector(floppy_image *floppy, int head, int track, int sector, int sector_is_index, const void *buffer, size_t buflen, int ddam)
|
||||
static floperr_t internal_basicdsk_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, const void *buffer, size_t buflen, int ddam)
|
||||
{
|
||||
UINT64 offset;
|
||||
floperr_t err;
|
||||
@ -156,29 +156,29 @@ static floperr_t internal_basicdsk_write_sector(floppy_image *floppy, int head,
|
||||
|
||||
|
||||
|
||||
static floperr_t basicdsk_read_sector(floppy_image *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
static floperr_t basicdsk_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
{
|
||||
return internal_basicdsk_read_sector(floppy, head, track, sector, FALSE, buffer, buflen);
|
||||
}
|
||||
|
||||
static floperr_t basicdsk_write_sector(floppy_image *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
static floperr_t basicdsk_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
{
|
||||
return internal_basicdsk_write_sector(floppy, head, track, sector, FALSE, buffer, buflen, ddam);
|
||||
}
|
||||
|
||||
static floperr_t basicdsk_read_indexed_sector(floppy_image *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
static floperr_t basicdsk_read_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
{
|
||||
return internal_basicdsk_read_sector(floppy, head, track, sector, TRUE, buffer, buflen);
|
||||
}
|
||||
|
||||
static floperr_t basicdsk_write_indexed_sector(floppy_image *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
static floperr_t basicdsk_write_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
{
|
||||
return internal_basicdsk_write_sector(floppy, head, track, sector, TRUE, buffer, buflen, ddam);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static floperr_t basicdsk_format_track(floppy_image *floppy, int head, int track, option_resolution *params)
|
||||
static floperr_t basicdsk_format_track(floppy_image_legacy *floppy, int head, int track, option_resolution *params)
|
||||
{
|
||||
floperr_t err = FLOPPY_ERROR_SUCCESS;
|
||||
UINT8 local_buffer[512];
|
||||
@ -225,21 +225,21 @@ done:
|
||||
|
||||
|
||||
|
||||
static int basicdsk_get_heads_per_disk(floppy_image *floppy)
|
||||
static int basicdsk_get_heads_per_disk(floppy_image_legacy *floppy)
|
||||
{
|
||||
return get_geometry(floppy)->heads;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static int basicdsk_get_tracks_per_disk(floppy_image *floppy)
|
||||
static int basicdsk_get_tracks_per_disk(floppy_image_legacy *floppy)
|
||||
{
|
||||
return get_geometry(floppy)->tracks;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static floperr_t basicdsk_get_sector_length(floppy_image *floppy, int head, int track, int sector, UINT32 *sector_length)
|
||||
static floperr_t basicdsk_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length)
|
||||
{
|
||||
floperr_t err;
|
||||
|
||||
@ -254,7 +254,7 @@ static floperr_t basicdsk_get_sector_length(floppy_image *floppy, int head, int
|
||||
|
||||
|
||||
|
||||
static floperr_t basicdsk_get_indexed_sector_info(floppy_image *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags)
|
||||
static floperr_t basicdsk_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags)
|
||||
{
|
||||
const struct basicdsk_geometry *geom = get_geometry(floppy);
|
||||
|
||||
|
@ -22,12 +22,12 @@ struct basicdsk_geometry
|
||||
UINT32 sector_length;
|
||||
UINT64 offset;
|
||||
|
||||
int (*translate_sector)(floppy_image *floppy, int sector);
|
||||
UINT64 (*translate_offset)(floppy_image *floppy, const struct basicdsk_geometry *geom, int track, int head, int sector);
|
||||
UINT64 (*get_ddam)(floppy_image *floppy, const struct basicdsk_geometry *geom, int track, int head, int sector);
|
||||
int (*translate_sector)(floppy_image_legacy *floppy, int sector);
|
||||
UINT64 (*translate_offset)(floppy_image_legacy *floppy, const struct basicdsk_geometry *geom, int track, int head, int sector);
|
||||
UINT64 (*get_ddam)(floppy_image_legacy *floppy, const struct basicdsk_geometry *geom, int track, int head, int sector);
|
||||
};
|
||||
|
||||
floperr_t basicdsk_construct(floppy_image *floppy, const struct basicdsk_geometry *geometry);
|
||||
floperr_t basicdsk_construct(floppy_image_legacy *floppy, const struct basicdsk_geometry *geometry);
|
||||
|
||||
FLOPPY_IDENTIFY(basicdsk_identify_default);
|
||||
FLOPPY_CONSTRUCT(basicdsk_construct_default);
|
||||
|
@ -112,7 +112,7 @@
|
||||
*
|
||||
* ----------------------------------------------------------------------- */
|
||||
|
||||
static int coco_jvc_decode_header(floppy_image *floppy, UINT64 size,
|
||||
static int coco_jvc_decode_header(floppy_image_legacy *floppy, UINT64 size,
|
||||
struct basicdsk_geometry *geometry)
|
||||
{
|
||||
UINT8 header[256];
|
||||
@ -294,7 +294,7 @@ static FLOPPY_CONSTRUCT(coco_jvc_construct)
|
||||
* $3F 1 value $02 LSN for start of this directory
|
||||
* ----------------------------------------------------------------------- */
|
||||
|
||||
static floperr_t coco_os9_readheader(floppy_image *floppy, struct basicdsk_geometry *geometry)
|
||||
static floperr_t coco_os9_readheader(floppy_image_legacy *floppy, struct basicdsk_geometry *geometry)
|
||||
{
|
||||
UINT8 header[0x20];
|
||||
int total_sectors;
|
||||
@ -322,7 +322,7 @@ static floperr_t coco_os9_readheader(floppy_image *floppy, struct basicdsk_geome
|
||||
|
||||
|
||||
|
||||
static floperr_t coco_os9_post_format(floppy_image *floppy, option_resolution *params)
|
||||
static floperr_t coco_os9_post_format(floppy_image_legacy *floppy, option_resolution *params)
|
||||
{
|
||||
UINT8 header[0x0400];
|
||||
floperr_t err;
|
||||
@ -484,7 +484,7 @@ static FLOPPY_CONSTRUCT(coco_os9_construct)
|
||||
|
||||
|
||||
|
||||
static int coco_vdk_decode_header(floppy_image *floppy, struct basicdsk_geometry *geometry)
|
||||
static int coco_vdk_decode_header(floppy_image_legacy *floppy, struct basicdsk_geometry *geometry)
|
||||
{
|
||||
UINT8 header[12];
|
||||
int heads, tracks, sectors, sector_length, offset;
|
||||
@ -633,13 +633,13 @@ struct dmk_tag
|
||||
#define dmk_idam_set_crc(x, crc) (x)[5] = ((crc) >> 8); (x)[6] = ((crc) >> 0);
|
||||
|
||||
|
||||
static struct dmk_tag *get_dmk_tag(floppy_image *floppy)
|
||||
static struct dmk_tag *get_dmk_tag(floppy_image_legacy *floppy)
|
||||
{
|
||||
return (dmk_tag *)floppy_tag(floppy);
|
||||
}
|
||||
|
||||
|
||||
static floperr_t coco_dmk_get_offset(floppy_image *floppy, int head, int track, UINT64 *offset)
|
||||
static floperr_t coco_dmk_get_offset(floppy_image_legacy *floppy, int head, int track, UINT64 *offset)
|
||||
{
|
||||
struct dmk_tag *tag = get_dmk_tag(floppy);
|
||||
|
||||
@ -665,7 +665,7 @@ static UINT32 coco_dmk_min_track_size(int sectors, int sector_length)
|
||||
|
||||
|
||||
|
||||
static floperr_t coco_dmk_read_track(floppy_image *floppy, int head, int track, UINT64 offset, void *buffer, size_t buflen)
|
||||
static floperr_t coco_dmk_read_track(floppy_image_legacy *floppy, int head, int track, UINT64 offset, void *buffer, size_t buflen)
|
||||
{
|
||||
floperr_t err;
|
||||
UINT64 track_offset;
|
||||
@ -680,7 +680,7 @@ static floperr_t coco_dmk_read_track(floppy_image *floppy, int head, int track,
|
||||
|
||||
|
||||
|
||||
static floperr_t coco_dmk_write_track(floppy_image *floppy, int head, int track, UINT64 offset, const void *buffer, size_t buflen)
|
||||
static floperr_t coco_dmk_write_track(floppy_image_legacy *floppy, int head, int track, UINT64 offset, const void *buffer, size_t buflen)
|
||||
{
|
||||
floperr_t err;
|
||||
UINT64 track_offset;
|
||||
@ -695,7 +695,7 @@ static floperr_t coco_dmk_write_track(floppy_image *floppy, int head, int track,
|
||||
|
||||
|
||||
|
||||
static floperr_t coco_dmk_get_track_data_offset(floppy_image *floppy, int head, int track, UINT64 *offset)
|
||||
static floperr_t coco_dmk_get_track_data_offset(floppy_image_legacy *floppy, int head, int track, UINT64 *offset)
|
||||
{
|
||||
*offset = DMK_TOC_LEN + 1;
|
||||
return FLOPPY_ERROR_SUCCESS;
|
||||
@ -703,7 +703,7 @@ static floperr_t coco_dmk_get_track_data_offset(floppy_image *floppy, int head,
|
||||
|
||||
|
||||
|
||||
static floperr_t coco_dmk_format_track(floppy_image *floppy, int head, int track, option_resolution *params)
|
||||
static floperr_t coco_dmk_format_track(floppy_image_legacy *floppy, int head, int track, option_resolution *params)
|
||||
{
|
||||
int sectors;
|
||||
int sector_length;
|
||||
@ -843,28 +843,28 @@ done:
|
||||
|
||||
|
||||
|
||||
static int coco_dmk_get_heads_per_disk(floppy_image *floppy)
|
||||
static int coco_dmk_get_heads_per_disk(floppy_image_legacy *floppy)
|
||||
{
|
||||
return get_dmk_tag(floppy)->heads;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static int coco_dmk_get_tracks_per_disk(floppy_image *floppy)
|
||||
static int coco_dmk_get_tracks_per_disk(floppy_image_legacy *floppy)
|
||||
{
|
||||
return get_dmk_tag(floppy)->tracks;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static UINT32 coco_dmk_get_track_size(floppy_image *floppy, int head, int track)
|
||||
static UINT32 coco_dmk_get_track_size(floppy_image_legacy *floppy, int head, int track)
|
||||
{
|
||||
return get_dmk_tag(floppy)->track_size;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static floperr_t coco_dmk_seek_sector_in_track(floppy_image *floppy, int head, int track, int sector, int sector_is_index, int dirtify, UINT8 **sector_data, UINT32 *sector_length)
|
||||
static floperr_t coco_dmk_seek_sector_in_track(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, int dirtify, UINT8 **sector_data, UINT32 *sector_length)
|
||||
{
|
||||
struct dmk_tag *tag = get_dmk_tag(floppy);
|
||||
floperr_t err;
|
||||
@ -962,14 +962,14 @@ static floperr_t coco_dmk_seek_sector_in_track(floppy_image *floppy, int head, i
|
||||
|
||||
|
||||
|
||||
static floperr_t coco_dmk_get_sector_length(floppy_image *floppy, int head, int track, int sector, UINT32 *sector_length)
|
||||
static floperr_t coco_dmk_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length)
|
||||
{
|
||||
return coco_dmk_seek_sector_in_track(floppy, head, track, sector, FALSE, FALSE, NULL, sector_length);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static floperr_t coco_dmk_get_indexed_sector_info(floppy_image *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags)
|
||||
static floperr_t coco_dmk_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags)
|
||||
{
|
||||
floperr_t err;
|
||||
UINT32 idam_offset;
|
||||
@ -1008,7 +1008,7 @@ static floperr_t coco_dmk_get_indexed_sector_info(floppy_image *floppy, int head
|
||||
|
||||
|
||||
|
||||
static floperr_t internal_coco_dmk_read_sector(floppy_image *floppy, int head, int track, int sector, int sector_is_index, void *buffer, size_t buflen)
|
||||
static floperr_t internal_coco_dmk_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, void *buffer, size_t buflen)
|
||||
{
|
||||
floperr_t err;
|
||||
UINT32 sector_length;
|
||||
@ -1035,7 +1035,7 @@ static floperr_t internal_coco_dmk_read_sector(floppy_image *floppy, int head, i
|
||||
|
||||
|
||||
|
||||
static floperr_t internal_coco_dmk_write_sector(floppy_image *floppy, int head, int track, int sector, int sector_is_index, const void *buffer, size_t buflen, int ddam)
|
||||
static floperr_t internal_coco_dmk_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, const void *buffer, size_t buflen, int ddam)
|
||||
{
|
||||
floperr_t err;
|
||||
UINT32 sector_length;
|
||||
@ -1059,29 +1059,29 @@ static floperr_t internal_coco_dmk_write_sector(floppy_image *floppy, int head,
|
||||
|
||||
|
||||
|
||||
static floperr_t coco_dmk_read_sector(floppy_image *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
static floperr_t coco_dmk_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
{
|
||||
return internal_coco_dmk_read_sector(floppy, head, track, sector, FALSE, buffer, buflen);
|
||||
}
|
||||
|
||||
static floperr_t coco_dmk_write_sector(floppy_image *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
static floperr_t coco_dmk_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
{
|
||||
return internal_coco_dmk_write_sector(floppy, head, track, sector, FALSE, buffer, buflen, ddam);
|
||||
}
|
||||
|
||||
static floperr_t coco_dmk_read_indexed_sector(floppy_image *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
static floperr_t coco_dmk_read_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
{
|
||||
return internal_coco_dmk_read_sector(floppy, head, track, sector, TRUE, buffer, buflen);
|
||||
}
|
||||
|
||||
static floperr_t coco_dmk_write_indexed_sector(floppy_image *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
static floperr_t coco_dmk_write_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
{
|
||||
return internal_coco_dmk_write_sector(floppy, head, track, sector, TRUE, buffer, buflen, ddam);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void coco_dmk_interpret_header(floppy_image *floppy, int *heads, int *tracks, int *track_size)
|
||||
static void coco_dmk_interpret_header(floppy_image_legacy *floppy, int *heads, int *tracks, int *track_size)
|
||||
{
|
||||
UINT8 header[DMK_HEADER_LEN];
|
||||
|
||||
|
@ -114,14 +114,14 @@ FLOPPY_IDENTIFY( coupe_mgt_identify )
|
||||
*/
|
||||
|
||||
|
||||
static UINT64 coupe_sad_translate_offset(floppy_image *floppy,
|
||||
static UINT64 coupe_sad_translate_offset(floppy_image_legacy *floppy,
|
||||
const struct basicdsk_geometry *geom, int track, int head, int sector)
|
||||
{
|
||||
return head * geom->tracks * geom->sectors + geom->sectors * track + sector;
|
||||
}
|
||||
|
||||
|
||||
static void coupe_sad_interpret_header(floppy_image *floppy,
|
||||
static void coupe_sad_interpret_header(floppy_image_legacy *floppy,
|
||||
int *heads, int *tracks, int *sectors, int *sector_size)
|
||||
{
|
||||
UINT8 header[SAD_HEADER_LEN];
|
||||
@ -211,27 +211,27 @@ FLOPPY_IDENTIFY( coupe_sad_identify )
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static int coupe_sdf_get_heads_per_disk(floppy_image *floppy)
|
||||
static int coupe_sdf_get_heads_per_disk(floppy_image_legacy *floppy)
|
||||
{
|
||||
struct sdf_tag *tag = (sdf_tag *)floppy_tag(floppy);
|
||||
return tag->heads;
|
||||
}
|
||||
|
||||
|
||||
static int coupe_sdf_get_tracks_per_disk(floppy_image *floppy)
|
||||
static int coupe_sdf_get_tracks_per_disk(floppy_image_legacy *floppy)
|
||||
{
|
||||
struct sdf_tag *tag = (sdf_tag *)floppy_tag(floppy);
|
||||
return tag->tracks;
|
||||
}
|
||||
|
||||
|
||||
static UINT32 coupe_sdf_get_track_size(floppy_image *floppy, int head, int track)
|
||||
static UINT32 coupe_sdf_get_track_size(floppy_image_legacy *floppy, int head, int track)
|
||||
{
|
||||
return SDF_TRACKSIZE;
|
||||
}
|
||||
|
||||
|
||||
static floperr_t coupe_sdf_get_offset(floppy_image *floppy,
|
||||
static floperr_t coupe_sdf_get_offset(floppy_image_legacy *floppy,
|
||||
int head, int track, UINT64 *offset)
|
||||
{
|
||||
struct sdf_tag *tag = (sdf_tag *)floppy_tag(floppy);
|
||||
@ -245,7 +245,7 @@ static floperr_t coupe_sdf_get_offset(floppy_image *floppy,
|
||||
}
|
||||
|
||||
|
||||
static floperr_t coupe_sdf_read_track(floppy_image *floppy,
|
||||
static floperr_t coupe_sdf_read_track(floppy_image_legacy *floppy,
|
||||
int head, int track, UINT64 offset, void *buffer, size_t buflen)
|
||||
{
|
||||
floperr_t err;
|
||||
@ -262,7 +262,7 @@ static floperr_t coupe_sdf_read_track(floppy_image *floppy,
|
||||
}
|
||||
|
||||
|
||||
static floperr_t coupe_sdf_write_track(floppy_image *floppy,
|
||||
static floperr_t coupe_sdf_write_track(floppy_image_legacy *floppy,
|
||||
int head, int track, UINT64 offset, const void *buffer, size_t buflen)
|
||||
{
|
||||
floperr_t err;
|
||||
@ -279,7 +279,7 @@ static floperr_t coupe_sdf_write_track(floppy_image *floppy,
|
||||
}
|
||||
|
||||
|
||||
static floperr_t coupe_sdf_get_sector_offset(floppy_image *floppy,
|
||||
static floperr_t coupe_sdf_get_sector_offset(floppy_image_legacy *floppy,
|
||||
int head, int track, int sector, UINT64 *offset)
|
||||
{
|
||||
floperr_t err;
|
||||
@ -312,7 +312,7 @@ static floperr_t coupe_sdf_get_sector_offset(floppy_image *floppy,
|
||||
}
|
||||
|
||||
|
||||
static floperr_t coupe_sdf_get_total_sector_offset(floppy_image *floppy,
|
||||
static floperr_t coupe_sdf_get_total_sector_offset(floppy_image_legacy *floppy,
|
||||
int head, int track, int sector, UINT64 *offset)
|
||||
{
|
||||
floperr_t err;
|
||||
@ -332,7 +332,7 @@ static floperr_t coupe_sdf_get_total_sector_offset(floppy_image *floppy,
|
||||
}
|
||||
|
||||
|
||||
static floperr_t coupe_sdf_get_sector_length(floppy_image *floppy,
|
||||
static floperr_t coupe_sdf_get_sector_length(floppy_image_legacy *floppy,
|
||||
int head, int track, int sector, UINT32 *sector_length)
|
||||
{
|
||||
floperr_t err;
|
||||
@ -354,7 +354,7 @@ static floperr_t coupe_sdf_get_sector_length(floppy_image *floppy,
|
||||
}
|
||||
|
||||
|
||||
static floperr_t coupe_sdf_get_indexed_sector_info(floppy_image *floppy,
|
||||
static floperr_t coupe_sdf_get_indexed_sector_info(floppy_image_legacy *floppy,
|
||||
int head, int track, int sector_index,
|
||||
int *cylinder, int *side, int *sector, UINT32 *sector_length,
|
||||
unsigned long *flags)
|
||||
@ -382,7 +382,7 @@ static floperr_t coupe_sdf_get_indexed_sector_info(floppy_image *floppy,
|
||||
}
|
||||
|
||||
|
||||
static floperr_t coupe_sdf_read_indexed_sector(floppy_image *floppy,
|
||||
static floperr_t coupe_sdf_read_indexed_sector(floppy_image_legacy *floppy,
|
||||
int head, int track, int sector, void *buffer, size_t buflen)
|
||||
{
|
||||
floperr_t err;
|
||||
@ -398,7 +398,7 @@ static floperr_t coupe_sdf_read_indexed_sector(floppy_image *floppy,
|
||||
}
|
||||
|
||||
|
||||
static floperr_t coupe_sdf_write_indexed_sector(floppy_image *floppy,
|
||||
static floperr_t coupe_sdf_write_indexed_sector(floppy_image_legacy *floppy,
|
||||
int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
{
|
||||
floperr_t err;
|
||||
@ -414,7 +414,7 @@ static floperr_t coupe_sdf_write_indexed_sector(floppy_image *floppy,
|
||||
}
|
||||
|
||||
|
||||
static void coupe_sdf_interpret_header(floppy_image *floppy, int *heads, int *tracks)
|
||||
static void coupe_sdf_interpret_header(floppy_image_legacy *floppy, int *heads, int *tracks)
|
||||
{
|
||||
UINT64 size = floppy_image_size(floppy);
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include "formats/basicdsk.h"
|
||||
|
||||
|
||||
static int compis_get_tracks_and_sectors(floppy_image *floppy, int *tracks, int *sectors)
|
||||
static int compis_get_tracks_and_sectors(floppy_image_legacy *floppy, int *tracks, int *sectors)
|
||||
{
|
||||
switch(floppy_image_size(floppy)) {
|
||||
case 0x50000: /* 320 KB */
|
||||
|
@ -26,7 +26,7 @@ struct cqmdsk_tag
|
||||
};
|
||||
|
||||
|
||||
static struct cqmdsk_tag *get_tag(floppy_image *floppy)
|
||||
static struct cqmdsk_tag *get_tag(floppy_image_legacy *floppy)
|
||||
{
|
||||
struct cqmdsk_tag *tag;
|
||||
tag = (cqmdsk_tag *)floppy_tag(floppy );
|
||||
@ -48,22 +48,22 @@ FLOPPY_IDENTIFY( cqm_dsk_identify )
|
||||
return FLOPPY_ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
static int cqm_get_heads_per_disk(floppy_image *floppy)
|
||||
static int cqm_get_heads_per_disk(floppy_image_legacy *floppy)
|
||||
{
|
||||
return get_tag(floppy)->heads;
|
||||
}
|
||||
|
||||
static int cqm_get_tracks_per_disk(floppy_image *floppy)
|
||||
static int cqm_get_tracks_per_disk(floppy_image_legacy *floppy)
|
||||
{
|
||||
return get_tag(floppy)->tracks;
|
||||
}
|
||||
|
||||
static UINT64 cqm_get_track_offset(floppy_image *floppy, int head, int track)
|
||||
static UINT64 cqm_get_track_offset(floppy_image_legacy *floppy, int head, int track)
|
||||
{
|
||||
return get_tag(floppy)->track_offsets[(track<<1) + head];
|
||||
}
|
||||
|
||||
static floperr_t get_offset(floppy_image *floppy, int head, int track, int sector, int sector_is_index, UINT64 *offset)
|
||||
static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, UINT64 *offset)
|
||||
{
|
||||
UINT64 pos = 0;
|
||||
UINT8 data;
|
||||
@ -98,7 +98,7 @@ static floperr_t get_offset(floppy_image *floppy, int head, int track, int secto
|
||||
|
||||
|
||||
|
||||
static floperr_t internal_cqm_read_sector(floppy_image *floppy, int head, int track, int sector, int sector_is_index, void *buffer, size_t buflen)
|
||||
static floperr_t internal_cqm_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, void *buffer, size_t buflen)
|
||||
{
|
||||
UINT64 offset;
|
||||
floperr_t err;
|
||||
@ -112,17 +112,17 @@ static floperr_t internal_cqm_read_sector(floppy_image *floppy, int head, int tr
|
||||
}
|
||||
|
||||
|
||||
static floperr_t cqm_read_sector(floppy_image *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
static floperr_t cqm_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
{
|
||||
return internal_cqm_read_sector(floppy, head, track, sector, FALSE, buffer, buflen);
|
||||
}
|
||||
|
||||
static floperr_t cqm_read_indexed_sector(floppy_image *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
static floperr_t cqm_read_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
{
|
||||
return internal_cqm_read_sector(floppy, head, track, sector, TRUE, buffer, buflen);
|
||||
}
|
||||
|
||||
static floperr_t cqm_get_sector_length(floppy_image *floppy, int head, int track, int sector, UINT32 *sector_length)
|
||||
static floperr_t cqm_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length)
|
||||
{
|
||||
floperr_t err;
|
||||
err = get_offset(floppy, head, track, sector, FALSE, NULL);
|
||||
@ -135,7 +135,7 @@ static floperr_t cqm_get_sector_length(floppy_image *floppy, int head, int track
|
||||
return FLOPPY_ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
static floperr_t cqm_get_indexed_sector_info(floppy_image *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags)
|
||||
static floperr_t cqm_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags)
|
||||
{
|
||||
if (sector_index >= get_tag(floppy)->sector_per_track) return FLOPPY_ERROR_SEEKERROR;
|
||||
|
||||
|
@ -170,7 +170,7 @@ struct d64dsk_tag
|
||||
INLINE FUNCTIONS
|
||||
***************************************************************************/
|
||||
|
||||
INLINE struct d64dsk_tag *get_tag(floppy_image *floppy)
|
||||
INLINE struct d64dsk_tag *get_tag(floppy_image_legacy *floppy)
|
||||
{
|
||||
return (d64dsk_tag *)floppy_tag(floppy);
|
||||
}
|
||||
@ -189,7 +189,7 @@ INLINE float get_dos_track(int track)
|
||||
of heads in the disk image
|
||||
-------------------------------------------------*/
|
||||
|
||||
static int d64_get_heads_per_disk(floppy_image *floppy)
|
||||
static int d64_get_heads_per_disk(floppy_image_legacy *floppy)
|
||||
{
|
||||
return get_tag(floppy)->heads;
|
||||
}
|
||||
@ -199,7 +199,7 @@ static int d64_get_heads_per_disk(floppy_image *floppy)
|
||||
of DOS tracks in the disk image
|
||||
-------------------------------------------------*/
|
||||
|
||||
static int d64_get_tracks_per_disk(floppy_image *floppy)
|
||||
static int d64_get_tracks_per_disk(floppy_image_legacy *floppy)
|
||||
{
|
||||
return get_tag(floppy)->tracks;
|
||||
}
|
||||
@ -209,7 +209,7 @@ static int d64_get_tracks_per_disk(floppy_image *floppy)
|
||||
of sectors per given track
|
||||
-------------------------------------------------*/
|
||||
|
||||
static int d64_get_sectors_per_track(floppy_image *floppy, int head, int track)
|
||||
static int d64_get_sectors_per_track(floppy_image_legacy *floppy, int head, int track)
|
||||
{
|
||||
int sectors_per_track = 0;
|
||||
|
||||
@ -228,7 +228,7 @@ static int d64_get_sectors_per_track(floppy_image *floppy, int head, int track)
|
||||
the disk image for a given track
|
||||
-------------------------------------------------*/
|
||||
|
||||
static floperr_t get_track_offset(floppy_image *floppy, int head, int track, UINT64 *offset)
|
||||
static floperr_t get_track_offset(floppy_image_legacy *floppy, int head, int track, UINT64 *offset)
|
||||
{
|
||||
struct d64dsk_tag *tag = get_tag(floppy);
|
||||
UINT64 offs = 0;
|
||||
@ -248,7 +248,7 @@ static floperr_t get_track_offset(floppy_image *floppy, int head, int track, UIN
|
||||
d64_get_track_size - returns the track size
|
||||
-------------------------------------------------*/
|
||||
|
||||
static UINT32 d64_get_track_size(floppy_image *floppy, int head, int track)
|
||||
static UINT32 d64_get_track_size(floppy_image_legacy *floppy, int head, int track)
|
||||
{
|
||||
struct d64dsk_tag *tag = get_tag(floppy);
|
||||
|
||||
@ -269,7 +269,7 @@ static UINT32 d64_get_track_size(floppy_image *floppy, int head, int track)
|
||||
code for the given sector
|
||||
-------------------------------------------------*/
|
||||
|
||||
static int get_sector_error_code(floppy_image *floppy, int head, int dos_track, int sector)
|
||||
static int get_sector_error_code(floppy_image_legacy *floppy, int head, int dos_track, int sector)
|
||||
{
|
||||
struct d64dsk_tag *tag = get_tag(floppy);
|
||||
|
||||
@ -375,7 +375,7 @@ static void gcr_double_2_gcr(UINT8 a, UINT8 b, UINT8 c, UINT8 d, UINT8 *dest)
|
||||
|
||||
*/
|
||||
|
||||
static floperr_t d64_read_track(floppy_image *floppy, int head, int track, UINT64 offset, void *buffer, size_t buflen)
|
||||
static floperr_t d64_read_track(floppy_image_legacy *floppy, int head, int track, UINT64 offset, void *buffer, size_t buflen)
|
||||
{
|
||||
struct d64dsk_tag *tag = get_tag(floppy);
|
||||
floperr_t err;
|
||||
@ -543,7 +543,7 @@ static floperr_t d64_read_track(floppy_image *floppy, int head, int track, UINT6
|
||||
disk image
|
||||
-------------------------------------------------*/
|
||||
|
||||
static floperr_t d64_write_track(floppy_image *floppy, int head, int track, UINT64 offset, const void *buffer, size_t buflen)
|
||||
static floperr_t d64_write_track(floppy_image_legacy *floppy, int head, int track, UINT64 offset, const void *buffer, size_t buflen)
|
||||
{
|
||||
return FLOPPY_ERROR_UNSUPPORTED;
|
||||
}
|
||||
@ -552,7 +552,7 @@ static floperr_t d64_write_track(floppy_image *floppy, int head, int track, UINT
|
||||
d64_identify - identifies the disk image
|
||||
-------------------------------------------------*/
|
||||
|
||||
static void d64_identify(floppy_image *floppy, int *dos, int *heads, int *tracks, bool *has_errors)
|
||||
static void d64_identify(floppy_image_legacy *floppy, int *dos, int *heads, int *tracks, bool *has_errors)
|
||||
{
|
||||
switch (floppy_image_size(floppy))
|
||||
{
|
||||
|
@ -67,7 +67,7 @@
|
||||
|
||||
*/
|
||||
|
||||
static UINT64 d81_translate_offset(floppy_image *floppy, const struct basicdsk_geometry *geom, int track, int head, int sector)
|
||||
static UINT64 d81_translate_offset(floppy_image_legacy *floppy, const struct basicdsk_geometry *geom, int track, int head, int sector)
|
||||
{
|
||||
UINT64 offset = (track * 20) + (!head * 10) + sector;
|
||||
|
||||
|
@ -41,12 +41,12 @@ struct d88_tag
|
||||
UINT8 heads;
|
||||
};
|
||||
|
||||
static struct d88_tag *get_d88_tag(floppy_image *floppy)
|
||||
static struct d88_tag *get_d88_tag(floppy_image_legacy *floppy)
|
||||
{
|
||||
return (d88_tag *)floppy_tag(floppy);
|
||||
}
|
||||
|
||||
static int d88_get_sector_id(floppy_image *floppy, int head, int track, int sector_index)
|
||||
static int d88_get_sector_id(floppy_image_legacy *floppy, int head, int track, int sector_index)
|
||||
{
|
||||
struct d88_tag* tag = get_d88_tag(floppy);
|
||||
UINT32 offset;
|
||||
@ -73,18 +73,18 @@ static int d88_get_sector_id(floppy_image *floppy, int head, int track, int sect
|
||||
return sector_hdr[2];
|
||||
}
|
||||
|
||||
static int d88_get_tracks_per_disk(floppy_image *floppy)
|
||||
static int d88_get_tracks_per_disk(floppy_image_legacy *floppy)
|
||||
{
|
||||
return 82; // 82 tracks per side
|
||||
}
|
||||
|
||||
static int d88_get_heads_per_disk(floppy_image *floppy)
|
||||
static int d88_get_heads_per_disk(floppy_image_legacy *floppy)
|
||||
{
|
||||
struct d88_tag* tag = get_d88_tag(floppy);
|
||||
return tag->heads;
|
||||
}
|
||||
|
||||
static int d88_get_sectors_per_track(floppy_image *floppy, int head, int track)
|
||||
static int d88_get_sectors_per_track(floppy_image_legacy *floppy, int head, int track)
|
||||
{
|
||||
struct d88_tag* tag = get_d88_tag(floppy);
|
||||
UINT32 offset;
|
||||
@ -97,7 +97,7 @@ static int d88_get_sectors_per_track(floppy_image *floppy, int head, int track)
|
||||
return sector_hdr[4];
|
||||
}
|
||||
|
||||
static floperr_t d88_get_sector_length(floppy_image *floppy, int head, int track, int sector, UINT32 *sector_length)
|
||||
static floperr_t d88_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length)
|
||||
{
|
||||
struct d88_tag* tag = get_d88_tag(floppy);
|
||||
UINT32 offset;
|
||||
@ -127,14 +127,14 @@ static floperr_t d88_get_sector_length(floppy_image *floppy, int head, int track
|
||||
return FLOPPY_ERROR_SEEKERROR;
|
||||
}
|
||||
|
||||
static floperr_t d88_read_track(floppy_image *floppy, int head, int track, UINT64 offset, void *buffer, size_t buflen)
|
||||
static floperr_t d88_read_track(floppy_image_legacy *floppy, int head, int track, UINT64 offset, void *buffer, size_t buflen)
|
||||
{
|
||||
// floperr_t err;
|
||||
|
||||
return FLOPPY_ERROR_UNSUPPORTED;
|
||||
}
|
||||
|
||||
static UINT32 d88_get_sector_offset(floppy_image* floppy, int head, int track, int sector)
|
||||
static UINT32 d88_get_sector_offset(floppy_image_legacy* floppy, int head, int track, int sector)
|
||||
{
|
||||
struct d88_tag* tag = get_d88_tag(floppy);
|
||||
UINT32 offset = 0;
|
||||
@ -165,7 +165,7 @@ static UINT32 d88_get_sector_offset(floppy_image* floppy, int head, int track, i
|
||||
return 0;
|
||||
}
|
||||
|
||||
static floperr_t d88_get_indexed_sector_info(floppy_image *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags)
|
||||
static floperr_t d88_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags)
|
||||
{
|
||||
struct d88_tag* tag = get_d88_tag(floppy);
|
||||
UINT32 offset;
|
||||
@ -210,7 +210,7 @@ static floperr_t d88_get_indexed_sector_info(floppy_image *floppy, int head, int
|
||||
return FLOPPY_ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
static floperr_t d88_read_sector(floppy_image *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
static floperr_t d88_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
{
|
||||
UINT64 offset;
|
||||
UINT32 sector_length;
|
||||
@ -231,7 +231,7 @@ static floperr_t d88_read_sector(floppy_image *floppy, int head, int track, int
|
||||
return FLOPPY_ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
static floperr_t d88_read_indexed_sector(floppy_image *floppy, int head, int track, int sector, void *buffer, size_t buffer_len)
|
||||
static floperr_t d88_read_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buffer_len)
|
||||
{
|
||||
int sec;
|
||||
|
||||
@ -239,7 +239,7 @@ static floperr_t d88_read_indexed_sector(floppy_image *floppy, int head, int tra
|
||||
return d88_read_sector(floppy,head,track,sec,buffer,buffer_len);
|
||||
}
|
||||
|
||||
static floperr_t d88_write_sector(floppy_image *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
static floperr_t d88_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
{
|
||||
UINT64 offset;
|
||||
UINT32 sector_length;
|
||||
@ -260,7 +260,7 @@ static floperr_t d88_write_sector(floppy_image *floppy, int head, int track, int
|
||||
return FLOPPY_ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
static floperr_t d88_write_indexed_sector(floppy_image *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
static floperr_t d88_write_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
{
|
||||
int sec;
|
||||
|
||||
@ -268,7 +268,7 @@ static floperr_t d88_write_indexed_sector(floppy_image *floppy, int head, int tr
|
||||
return d88_write_sector(floppy,head,track,sec,buffer,buflen,ddam);
|
||||
}
|
||||
|
||||
static void d88_get_header(floppy_image* floppy,UINT32* size, UINT8* prot, UINT8* type, UINT32* offsets)
|
||||
static void d88_get_header(floppy_image_legacy* floppy,UINT32* size, UINT8* prot, UINT8* type, UINT32* offsets)
|
||||
{
|
||||
UINT8 header[D88_HEADER_LEN];
|
||||
int x,s;
|
||||
|
@ -25,7 +25,7 @@ struct dskdsk_tag
|
||||
};
|
||||
|
||||
|
||||
static struct dskdsk_tag *get_tag(floppy_image *floppy)
|
||||
static struct dskdsk_tag *get_tag(floppy_image_legacy *floppy)
|
||||
{
|
||||
struct dskdsk_tag *tag;
|
||||
tag = (dskdsk_tag *)floppy_tag(floppy);
|
||||
@ -50,22 +50,22 @@ FLOPPY_IDENTIFY( dsk_dsk_identify )
|
||||
return FLOPPY_ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
static int dsk_get_heads_per_disk(floppy_image *floppy)
|
||||
static int dsk_get_heads_per_disk(floppy_image_legacy *floppy)
|
||||
{
|
||||
return get_tag(floppy)->heads;
|
||||
}
|
||||
|
||||
static int dsk_get_tracks_per_disk(floppy_image *floppy)
|
||||
static int dsk_get_tracks_per_disk(floppy_image_legacy *floppy)
|
||||
{
|
||||
return get_tag(floppy)->tracks;
|
||||
}
|
||||
|
||||
static UINT64 dsk_get_track_offset(floppy_image *floppy, int head, int track)
|
||||
static UINT64 dsk_get_track_offset(floppy_image_legacy *floppy, int head, int track)
|
||||
{
|
||||
return get_tag(floppy)->track_offsets[(track<<1) + head];
|
||||
}
|
||||
|
||||
static floperr_t get_offset(floppy_image *floppy, int head, int track, int sector, int sector_is_index, UINT64 *offset)
|
||||
static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, UINT64 *offset)
|
||||
{
|
||||
UINT64 offs;
|
||||
UINT64 track_offset;
|
||||
@ -108,7 +108,7 @@ static floperr_t get_offset(floppy_image *floppy, int head, int track, int secto
|
||||
|
||||
|
||||
|
||||
static floperr_t internal_dsk_read_sector(floppy_image *floppy, int head, int track, int sector, int sector_is_index, void *buffer, size_t buflen)
|
||||
static floperr_t internal_dsk_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, void *buffer, size_t buflen)
|
||||
{
|
||||
UINT64 offset;
|
||||
floperr_t err;
|
||||
@ -121,7 +121,7 @@ static floperr_t internal_dsk_read_sector(floppy_image *floppy, int head, int tr
|
||||
|
||||
|
||||
|
||||
static floperr_t internal_dsk_write_sector(floppy_image *floppy, int head, int track, int sector, int sector_is_index, const void *buffer, size_t buflen, int ddam)
|
||||
static floperr_t internal_dsk_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, const void *buffer, size_t buflen, int ddam)
|
||||
{
|
||||
UINT64 offset;
|
||||
floperr_t err;
|
||||
@ -136,27 +136,27 @@ static floperr_t internal_dsk_write_sector(floppy_image *floppy, int head, int t
|
||||
|
||||
|
||||
|
||||
static floperr_t dsk_read_sector(floppy_image *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
static floperr_t dsk_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
{
|
||||
return internal_dsk_read_sector(floppy, head, track, sector, FALSE, buffer, buflen);
|
||||
}
|
||||
|
||||
static floperr_t dsk_write_sector(floppy_image *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
static floperr_t dsk_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
{
|
||||
return internal_dsk_write_sector(floppy, head, track, sector, FALSE, buffer, buflen, ddam);
|
||||
}
|
||||
|
||||
static floperr_t dsk_read_indexed_sector(floppy_image *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
static floperr_t dsk_read_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
{
|
||||
return internal_dsk_read_sector(floppy, head, track, sector, TRUE, buffer, buflen);
|
||||
}
|
||||
|
||||
static floperr_t dsk_write_indexed_sector(floppy_image *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
static floperr_t dsk_write_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
{
|
||||
return internal_dsk_write_sector(floppy, head, track, sector, TRUE, buffer, buflen, ddam);
|
||||
}
|
||||
|
||||
static floperr_t dsk_get_sector_length(floppy_image *floppy, int head, int track, int sector, UINT32 *sector_length)
|
||||
static floperr_t dsk_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length)
|
||||
{
|
||||
floperr_t err;
|
||||
err = get_offset(floppy, head, track, sector, FALSE, NULL);
|
||||
@ -169,7 +169,7 @@ static floperr_t dsk_get_sector_length(floppy_image *floppy, int head, int track
|
||||
return FLOPPY_ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
static floperr_t dsk_get_indexed_sector_info(floppy_image *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags)
|
||||
static floperr_t dsk_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags)
|
||||
{
|
||||
floperr_t retVal;
|
||||
UINT64 offset;
|
||||
|
@ -128,7 +128,7 @@ struct fdi_pulse_track_header
|
||||
INLINE FUNCTIONS
|
||||
***************************************************************************/
|
||||
|
||||
INLINE struct fdidsk_tag *get_tag(floppy_image *floppy)
|
||||
INLINE struct fdidsk_tag *get_tag(floppy_image_legacy *floppy)
|
||||
{
|
||||
return (fdidsk_tag *)floppy_tag(floppy);
|
||||
}
|
||||
@ -137,57 +137,57 @@ INLINE struct fdidsk_tag *get_tag(floppy_image *floppy)
|
||||
IMPLEMENTATION
|
||||
***************************************************************************/
|
||||
|
||||
static int fdi_get_heads_per_disk(floppy_image *floppy)
|
||||
static int fdi_get_heads_per_disk(floppy_image_legacy *floppy)
|
||||
{
|
||||
return get_tag(floppy)->heads;
|
||||
}
|
||||
|
||||
static int fdi_get_tracks_per_disk(floppy_image *floppy)
|
||||
static int fdi_get_tracks_per_disk(floppy_image_legacy *floppy)
|
||||
{
|
||||
return get_tag(floppy)->tracks;
|
||||
}
|
||||
|
||||
static int fdi_get_sectors_per_track(floppy_image *floppy, int head, int track)
|
||||
static int fdi_get_sectors_per_track(floppy_image_legacy *floppy, int head, int track)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static floperr_t fdi_get_sector_length(floppy_image *floppy, int head, int track, int sector, UINT32 *sector_length)
|
||||
static floperr_t fdi_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length)
|
||||
{
|
||||
return FLOPPY_ERROR_SUCCESS;
|
||||
}
|
||||
/*
|
||||
static UINT32 fdi_get_sector_offset(floppy_image* floppy, int head, int track, int sector)
|
||||
static UINT32 fdi_get_sector_offset(floppy_image_legacy* floppy, int head, int track, int sector)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
*/
|
||||
static floperr_t fdi_get_indexed_sector_info(floppy_image *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags)
|
||||
static floperr_t fdi_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags)
|
||||
{
|
||||
return FLOPPY_ERROR_UNSUPPORTED;
|
||||
}
|
||||
|
||||
static floperr_t fdi_read_track(floppy_image *floppy, int head, int track, UINT64 offset, void *buffer, size_t buflen)
|
||||
static floperr_t fdi_read_track(floppy_image_legacy *floppy, int head, int track, UINT64 offset, void *buffer, size_t buflen)
|
||||
{
|
||||
return FLOPPY_ERROR_UNSUPPORTED;
|
||||
}
|
||||
|
||||
static floperr_t fdi_read_sector(floppy_image *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
static floperr_t fdi_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
{
|
||||
return FLOPPY_ERROR_UNSUPPORTED;
|
||||
}
|
||||
|
||||
static floperr_t fdi_read_indexed_sector(floppy_image *floppy, int head, int track, int sector, void *buffer, size_t buffer_len)
|
||||
static floperr_t fdi_read_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buffer_len)
|
||||
{
|
||||
return FLOPPY_ERROR_UNSUPPORTED;
|
||||
}
|
||||
|
||||
static floperr_t fdi_write_sector(floppy_image *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
static floperr_t fdi_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
{
|
||||
return FLOPPY_ERROR_UNSUPPORTED;
|
||||
}
|
||||
|
||||
static floperr_t fdi_write_indexed_sector(floppy_image *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
static floperr_t fdi_write_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
{
|
||||
return FLOPPY_ERROR_UNSUPPORTED;
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ struct _floppy_params
|
||||
|
||||
|
||||
|
||||
static floperr_t floppy_track_unload(floppy_image *floppy);
|
||||
static floperr_t floppy_track_unload(floppy_image_legacy *floppy);
|
||||
|
||||
OPTION_GUIDE_START(floppy_option_guide)
|
||||
OPTION_INT('H', "heads", "Heads")
|
||||
@ -65,18 +65,18 @@ OPTION_GUIDE_START(floppy_option_guide)
|
||||
OPTION_GUIDE_END
|
||||
|
||||
|
||||
static void floppy_close_internal(floppy_image *floppy, int close_file);
|
||||
static void floppy_close_internal(floppy_image_legacy *floppy, int close_file);
|
||||
|
||||
/*********************************************************************
|
||||
opening, closing and creating of floppy images
|
||||
*********************************************************************/
|
||||
|
||||
/* basic floppy_image initialization common to floppy_open() and floppy_create() */
|
||||
static floppy_image *floppy_init(void *fp, const struct io_procs *procs, int flags)
|
||||
/* basic floppy_image_legacy initialization common to floppy_open() and floppy_create() */
|
||||
static floppy_image_legacy *floppy_init(void *fp, const struct io_procs *procs, int flags)
|
||||
{
|
||||
floppy_image *floppy;
|
||||
floppy_image_legacy *floppy;
|
||||
|
||||
floppy = (floppy_image *)malloc(sizeof(struct _floppy_image));
|
||||
floppy = (floppy_image_legacy *)malloc(sizeof(struct _floppy_image));
|
||||
if (!floppy)
|
||||
return NULL;
|
||||
|
||||
@ -95,11 +95,11 @@ static floppy_image *floppy_init(void *fp, const struct io_procs *procs, int fla
|
||||
/* main code for identifying and maybe opening a disk image; not exposed
|
||||
* directly because this function is big and hideous */
|
||||
static floperr_t floppy_open_internal(void *fp, const struct io_procs *procs, const char *extension,
|
||||
const struct FloppyFormat *floppy_options, int max_options, int flags, floppy_image **outfloppy,
|
||||
const struct FloppyFormat *floppy_options, int max_options, int flags, floppy_image_legacy **outfloppy,
|
||||
int *outoption)
|
||||
{
|
||||
floperr_t err;
|
||||
floppy_image *floppy;
|
||||
floppy_image_legacy *floppy;
|
||||
int best_option = -1;
|
||||
int best_vote = 0;
|
||||
int vote;
|
||||
@ -183,7 +183,7 @@ floperr_t floppy_identify(void *fp, const struct io_procs *procs, const char *ex
|
||||
|
||||
|
||||
floperr_t floppy_open(void *fp, const struct io_procs *procs, const char *extension,
|
||||
const struct FloppyFormat *format, int flags, floppy_image **outfloppy)
|
||||
const struct FloppyFormat *format, int flags, floppy_image_legacy **outfloppy)
|
||||
{
|
||||
return floppy_open_internal(fp, procs, extension, format, 1, flags, outfloppy, NULL);
|
||||
}
|
||||
@ -191,7 +191,7 @@ floperr_t floppy_open(void *fp, const struct io_procs *procs, const char *extens
|
||||
|
||||
|
||||
floperr_t floppy_open_choices(void *fp, const struct io_procs *procs, const char *extension,
|
||||
const struct FloppyFormat *formats, int flags, floppy_image **outfloppy)
|
||||
const struct FloppyFormat *formats, int flags, floppy_image_legacy **outfloppy)
|
||||
{
|
||||
return floppy_open_internal(fp, procs, extension, formats, INT_MAX, flags, outfloppy, NULL);
|
||||
}
|
||||
@ -223,9 +223,9 @@ static floperr_t option_to_floppy_error(optreserr_t oerr)
|
||||
|
||||
|
||||
|
||||
floperr_t floppy_create(void *fp, const struct io_procs *procs, const struct FloppyFormat *format, option_resolution *parameters, floppy_image **outfloppy)
|
||||
floperr_t floppy_create(void *fp, const struct io_procs *procs, const struct FloppyFormat *format, option_resolution *parameters, floppy_image_legacy **outfloppy)
|
||||
{
|
||||
floppy_image *floppy = NULL;
|
||||
floppy_image_legacy *floppy = NULL;
|
||||
optreserr_t oerr;
|
||||
floperr_t err;
|
||||
int heads, tracks, h, t;
|
||||
@ -316,7 +316,7 @@ done:
|
||||
|
||||
|
||||
|
||||
static void floppy_close_internal(floppy_image *floppy, int close_file)
|
||||
static void floppy_close_internal(floppy_image_legacy *floppy, int close_file)
|
||||
{
|
||||
if (floppy) {
|
||||
floppy_track_unload(floppy);
|
||||
@ -335,7 +335,7 @@ static void floppy_close_internal(floppy_image *floppy, int close_file)
|
||||
|
||||
|
||||
|
||||
void floppy_close(floppy_image *floppy)
|
||||
void floppy_close(floppy_image_legacy *floppy)
|
||||
{
|
||||
floppy_close_internal(floppy, TRUE);
|
||||
}
|
||||
@ -346,7 +346,7 @@ void floppy_close(floppy_image *floppy)
|
||||
functions useful in format constructors
|
||||
*********************************************************************/
|
||||
|
||||
struct FloppyCallbacks *floppy_callbacks(floppy_image *floppy)
|
||||
struct FloppyCallbacks *floppy_callbacks(floppy_image_legacy *floppy)
|
||||
{
|
||||
assert(floppy);
|
||||
return &floppy->format;
|
||||
@ -354,7 +354,7 @@ struct FloppyCallbacks *floppy_callbacks(floppy_image *floppy)
|
||||
|
||||
|
||||
|
||||
void *floppy_tag(floppy_image *floppy)
|
||||
void *floppy_tag(floppy_image_legacy *floppy)
|
||||
{
|
||||
assert(floppy);
|
||||
return floppy->tag_data;
|
||||
@ -362,7 +362,7 @@ void *floppy_tag(floppy_image *floppy)
|
||||
|
||||
|
||||
|
||||
void *floppy_create_tag(floppy_image *floppy, size_t tagsize)
|
||||
void *floppy_create_tag(floppy_image_legacy *floppy, size_t tagsize)
|
||||
{
|
||||
floppy->tag_data = pool_malloc_lib(floppy->tags,tagsize);
|
||||
return floppy->tag_data;
|
||||
@ -370,14 +370,14 @@ void *floppy_create_tag(floppy_image *floppy, size_t tagsize)
|
||||
|
||||
|
||||
|
||||
UINT8 floppy_get_filler(floppy_image *floppy)
|
||||
UINT8 floppy_get_filler(floppy_image_legacy *floppy)
|
||||
{
|
||||
return floppy->io.filler;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void floppy_set_filler(floppy_image *floppy, UINT8 filler)
|
||||
void floppy_set_filler(floppy_image_legacy *floppy, UINT8 filler)
|
||||
{
|
||||
floppy->io.filler = filler;
|
||||
}
|
||||
@ -388,28 +388,28 @@ void floppy_set_filler(floppy_image *floppy, UINT8 filler)
|
||||
calls for accessing the raw disk image
|
||||
*********************************************************************/
|
||||
|
||||
void floppy_image_read(floppy_image *floppy, void *buffer, UINT64 offset, size_t length)
|
||||
void floppy_image_read(floppy_image_legacy *floppy, void *buffer, UINT64 offset, size_t length)
|
||||
{
|
||||
io_generic_read(&floppy->io, buffer, offset, length);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void floppy_image_write(floppy_image *floppy, const void *buffer, UINT64 offset, size_t length)
|
||||
void floppy_image_write(floppy_image_legacy *floppy, const void *buffer, UINT64 offset, size_t length)
|
||||
{
|
||||
io_generic_write(&floppy->io, buffer, offset, length);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void floppy_image_write_filler(floppy_image *floppy, UINT8 filler, UINT64 offset, size_t length)
|
||||
void floppy_image_write_filler(floppy_image_legacy *floppy, UINT8 filler, UINT64 offset, size_t length)
|
||||
{
|
||||
io_generic_write_filler(&floppy->io, filler, offset, length);
|
||||
}
|
||||
|
||||
|
||||
|
||||
UINT64 floppy_image_size(floppy_image *floppy)
|
||||
UINT64 floppy_image_size(floppy_image_legacy *floppy)
|
||||
{
|
||||
return io_generic_size(&floppy->io);
|
||||
}
|
||||
@ -420,7 +420,7 @@ UINT64 floppy_image_size(floppy_image *floppy)
|
||||
calls for accessing disk image data
|
||||
*********************************************************************/
|
||||
|
||||
static floperr_t floppy_readwrite_sector(floppy_image *floppy, int head, int track, int sector, int offset,
|
||||
static floperr_t floppy_readwrite_sector(floppy_image_legacy *floppy, int head, int track, int sector, int offset,
|
||||
void *buffer, size_t buffer_len, int writing, int indexed, int ddam)
|
||||
{
|
||||
floperr_t err;
|
||||
@ -429,8 +429,8 @@ static floperr_t floppy_readwrite_sector(floppy_image *floppy, int head, int tra
|
||||
UINT8 *alloc_buf = NULL;
|
||||
UINT32 sector_length;
|
||||
UINT8 *buffer_ptr = (UINT8 *)buffer;
|
||||
floperr_t (*read_sector)(floppy_image *floppy, int head, int track, int sector, void *buffer, size_t buflen);
|
||||
floperr_t (*write_sector)(floppy_image *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam);
|
||||
floperr_t (*read_sector)(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen);
|
||||
floperr_t (*write_sector)(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam);
|
||||
|
||||
fmt = floppy_callbacks(floppy);
|
||||
|
||||
@ -546,34 +546,34 @@ done:
|
||||
|
||||
|
||||
|
||||
floperr_t floppy_read_sector(floppy_image *floppy, int head, int track, int sector, int offset, void *buffer, size_t buffer_len)
|
||||
floperr_t floppy_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, int offset, void *buffer, size_t buffer_len)
|
||||
{
|
||||
return floppy_readwrite_sector(floppy, head, track, sector, offset, buffer, buffer_len, FALSE, FALSE, 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
floperr_t floppy_write_sector(floppy_image *floppy, int head, int track, int sector, int offset, const void *buffer, size_t buffer_len, int ddam)
|
||||
floperr_t floppy_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, int offset, const void *buffer, size_t buffer_len, int ddam)
|
||||
{
|
||||
return floppy_readwrite_sector(floppy, head, track, sector, offset, (void *) buffer, buffer_len, TRUE, FALSE, ddam);
|
||||
}
|
||||
|
||||
|
||||
|
||||
floperr_t floppy_read_indexed_sector(floppy_image *floppy, int head, int track, int sector_index, int offset, void *buffer, size_t buffer_len)
|
||||
floperr_t floppy_read_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector_index, int offset, void *buffer, size_t buffer_len)
|
||||
{
|
||||
return floppy_readwrite_sector(floppy, head, track, sector_index, offset, buffer, buffer_len, FALSE, TRUE, 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
floperr_t floppy_write_indexed_sector(floppy_image *floppy, int head, int track, int sector_index, int offset, const void *buffer, size_t buffer_len, int ddam)
|
||||
floperr_t floppy_write_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector_index, int offset, const void *buffer, size_t buffer_len, int ddam)
|
||||
{
|
||||
return floppy_readwrite_sector(floppy, head, track, sector_index, offset, (void *) buffer, buffer_len, TRUE, TRUE, ddam);
|
||||
}
|
||||
|
||||
|
||||
static floperr_t floppy_get_track_data_offset(floppy_image *floppy, int head, int track, UINT64 *offset)
|
||||
static floperr_t floppy_get_track_data_offset(floppy_image_legacy *floppy, int head, int track, UINT64 *offset)
|
||||
{
|
||||
floperr_t err;
|
||||
const struct FloppyCallbacks *callbacks;
|
||||
@ -591,7 +591,7 @@ static floperr_t floppy_get_track_data_offset(floppy_image *floppy, int head, in
|
||||
|
||||
|
||||
|
||||
static floperr_t floppy_read_track_offset(floppy_image *floppy, int head, int track, UINT64 offset, void *buffer, size_t buffer_len)
|
||||
static floperr_t floppy_read_track_offset(floppy_image_legacy *floppy, int head, int track, UINT64 offset, void *buffer, size_t buffer_len)
|
||||
{
|
||||
floperr_t err;
|
||||
const struct FloppyCallbacks *format;
|
||||
@ -614,14 +614,14 @@ static floperr_t floppy_read_track_offset(floppy_image *floppy, int head, int tr
|
||||
|
||||
|
||||
|
||||
floperr_t floppy_read_track(floppy_image *floppy, int head, int track, void *buffer, size_t buffer_len)
|
||||
floperr_t floppy_read_track(floppy_image_legacy *floppy, int head, int track, void *buffer, size_t buffer_len)
|
||||
{
|
||||
return floppy_read_track_offset(floppy, head, track, 0, buffer, buffer_len);
|
||||
}
|
||||
|
||||
|
||||
|
||||
floperr_t floppy_read_track_data(floppy_image *floppy, int head, int track, void *buffer, size_t buffer_len)
|
||||
floperr_t floppy_read_track_data(floppy_image_legacy *floppy, int head, int track, void *buffer, size_t buffer_len)
|
||||
{
|
||||
floperr_t err;
|
||||
UINT64 offset;
|
||||
@ -635,7 +635,7 @@ floperr_t floppy_read_track_data(floppy_image *floppy, int head, int track, void
|
||||
|
||||
|
||||
|
||||
static floperr_t floppy_write_track_offset(floppy_image *floppy, int head, int track, UINT64 offset, const void *buffer, size_t buffer_len)
|
||||
static floperr_t floppy_write_track_offset(floppy_image_legacy *floppy, int head, int track, UINT64 offset, const void *buffer, size_t buffer_len)
|
||||
{
|
||||
floperr_t err;
|
||||
|
||||
@ -660,14 +660,14 @@ static floperr_t floppy_write_track_offset(floppy_image *floppy, int head, int t
|
||||
|
||||
|
||||
|
||||
floperr_t floppy_write_track(floppy_image *floppy, int head, int track, const void *buffer, size_t buffer_len)
|
||||
floperr_t floppy_write_track(floppy_image_legacy *floppy, int head, int track, const void *buffer, size_t buffer_len)
|
||||
{
|
||||
return floppy_write_track_offset(floppy, head, track, 0, buffer, buffer_len);
|
||||
}
|
||||
|
||||
|
||||
|
||||
floperr_t floppy_write_track_data(floppy_image *floppy, int head, int track, const void *buffer, size_t buffer_len)
|
||||
floperr_t floppy_write_track_data(floppy_image_legacy *floppy, int head, int track, const void *buffer, size_t buffer_len)
|
||||
{
|
||||
floperr_t err;
|
||||
UINT64 offset;
|
||||
@ -681,7 +681,7 @@ floperr_t floppy_write_track_data(floppy_image *floppy, int head, int track, con
|
||||
|
||||
|
||||
|
||||
floperr_t floppy_format_track(floppy_image *floppy, int head, int track, option_resolution *parameters)
|
||||
floperr_t floppy_format_track(floppy_image_legacy *floppy, int head, int track, option_resolution *parameters)
|
||||
{
|
||||
floperr_t err;
|
||||
struct FloppyCallbacks *format;
|
||||
@ -727,21 +727,21 @@ done:
|
||||
|
||||
|
||||
|
||||
int floppy_get_tracks_per_disk(floppy_image *floppy)
|
||||
int floppy_get_tracks_per_disk(floppy_image_legacy *floppy)
|
||||
{
|
||||
return floppy_callbacks(floppy)->get_tracks_per_disk(floppy);
|
||||
}
|
||||
|
||||
|
||||
|
||||
int floppy_get_heads_per_disk(floppy_image *floppy)
|
||||
int floppy_get_heads_per_disk(floppy_image_legacy *floppy)
|
||||
{
|
||||
return floppy_callbacks(floppy)->get_heads_per_disk(floppy);
|
||||
}
|
||||
|
||||
|
||||
|
||||
UINT32 floppy_get_track_size(floppy_image *floppy, int head, int track)
|
||||
UINT32 floppy_get_track_size(floppy_image_legacy *floppy, int head, int track)
|
||||
{
|
||||
const struct FloppyCallbacks *fmt;
|
||||
|
||||
@ -754,7 +754,7 @@ UINT32 floppy_get_track_size(floppy_image *floppy, int head, int track)
|
||||
|
||||
|
||||
|
||||
floperr_t floppy_get_sector_length(floppy_image *floppy, int head, int track, int sector, UINT32 *sector_length)
|
||||
floperr_t floppy_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length)
|
||||
{
|
||||
const struct FloppyCallbacks *fmt;
|
||||
|
||||
@ -767,7 +767,7 @@ floperr_t floppy_get_sector_length(floppy_image *floppy, int head, int track, in
|
||||
|
||||
|
||||
|
||||
floperr_t floppy_get_indexed_sector_info(floppy_image *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags)
|
||||
floperr_t floppy_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags)
|
||||
{
|
||||
const struct FloppyCallbacks *fmt;
|
||||
|
||||
@ -780,7 +780,7 @@ floperr_t floppy_get_indexed_sector_info(floppy_image *floppy, int head, int tra
|
||||
|
||||
|
||||
|
||||
floperr_t floppy_get_sector_count(floppy_image *floppy, int head, int track, int *sector_count)
|
||||
floperr_t floppy_get_sector_count(floppy_image_legacy *floppy, int head, int track, int *sector_count)
|
||||
{
|
||||
floperr_t err;
|
||||
int sector_index = 0;
|
||||
@ -802,14 +802,14 @@ floperr_t floppy_get_sector_count(floppy_image *floppy, int head, int track, int
|
||||
|
||||
|
||||
|
||||
int floppy_is_read_only(floppy_image *floppy)
|
||||
int floppy_is_read_only(floppy_image_legacy *floppy)
|
||||
{
|
||||
return floppy->flags & FLOPPY_FLAGS_READONLY;
|
||||
}
|
||||
|
||||
|
||||
|
||||
UINT8 floppy_random_byte(floppy_image *floppy)
|
||||
UINT8 floppy_random_byte(floppy_image_legacy *floppy)
|
||||
{
|
||||
/* can't use mame_rand(); this might not be in the core */
|
||||
#ifdef rand
|
||||
@ -824,7 +824,7 @@ UINT8 floppy_random_byte(floppy_image *floppy)
|
||||
calls for track based IO
|
||||
*********************************************************************/
|
||||
|
||||
floperr_t floppy_load_track(floppy_image *floppy, int head, int track, int dirtify, void **track_data, size_t *track_length)
|
||||
floperr_t floppy_load_track(floppy_image_legacy *floppy, int head, int track, int dirtify, void **track_data, size_t *track_length)
|
||||
{
|
||||
floperr_t err;
|
||||
void *new_loaded_track_data;
|
||||
@ -877,7 +877,7 @@ error:
|
||||
|
||||
|
||||
|
||||
static floperr_t floppy_track_unload(floppy_image *floppy)
|
||||
static floperr_t floppy_track_unload(floppy_image_legacy *floppy)
|
||||
{
|
||||
int err;
|
||||
if (floppy->loaded_track_status & TRACK_DIRTY)
|
||||
@ -897,7 +897,7 @@ static floperr_t floppy_track_unload(floppy_image *floppy)
|
||||
accessors for meta information about the image
|
||||
*********************************************************************/
|
||||
|
||||
const char *floppy_format_description(floppy_image *floppy)
|
||||
const char *floppy_format_description(floppy_image_legacy *floppy)
|
||||
{
|
||||
return floppy->floppy_option->description;
|
||||
}
|
||||
|
@ -56,25 +56,25 @@ typedef enum
|
||||
}
|
||||
floperr_t;
|
||||
|
||||
typedef struct _floppy_image floppy_image;
|
||||
typedef struct _floppy_image floppy_image_legacy;
|
||||
|
||||
struct FloppyCallbacks
|
||||
{
|
||||
floperr_t (*read_sector)(floppy_image *floppy, int head, int track, int sector, void *buffer, size_t buflen);
|
||||
floperr_t (*write_sector)(floppy_image *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam);
|
||||
floperr_t (*read_indexed_sector)(floppy_image *floppy, int head, int track, int sector_index, void *buffer, size_t buflen);
|
||||
floperr_t (*write_indexed_sector)(floppy_image *floppy, int head, int track, int sector_index, const void *buffer, size_t buflen, int ddam);
|
||||
floperr_t (*read_track)(floppy_image *floppy, int head, int track, UINT64 offset, void *buffer, size_t buflen);
|
||||
floperr_t (*write_track)(floppy_image *floppy, int head, int track, UINT64 offset, const void *buffer, size_t buflen);
|
||||
floperr_t (*format_track)(floppy_image *floppy, int head, int track, option_resolution *params);
|
||||
floperr_t (*post_format)(floppy_image *floppy, option_resolution *params);
|
||||
int (*get_heads_per_disk)(floppy_image *floppy);
|
||||
int (*get_tracks_per_disk)(floppy_image *floppy);
|
||||
int (*get_sectors_per_track)(floppy_image *floppy, int head, int track);
|
||||
UINT32 (*get_track_size)(floppy_image *floppy, int head, int track);
|
||||
floperr_t (*get_sector_length)(floppy_image *floppy, int head, int track, int sector, UINT32 *sector_length);
|
||||
floperr_t (*get_indexed_sector_info)(floppy_image *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags);
|
||||
floperr_t (*get_track_data_offset)(floppy_image *floppy, int head, int track, UINT64 *offset);
|
||||
floperr_t (*read_sector)(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen);
|
||||
floperr_t (*write_sector)(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam);
|
||||
floperr_t (*read_indexed_sector)(floppy_image_legacy *floppy, int head, int track, int sector_index, void *buffer, size_t buflen);
|
||||
floperr_t (*write_indexed_sector)(floppy_image_legacy *floppy, int head, int track, int sector_index, const void *buffer, size_t buflen, int ddam);
|
||||
floperr_t (*read_track)(floppy_image_legacy *floppy, int head, int track, UINT64 offset, void *buffer, size_t buflen);
|
||||
floperr_t (*write_track)(floppy_image_legacy *floppy, int head, int track, UINT64 offset, const void *buffer, size_t buflen);
|
||||
floperr_t (*format_track)(floppy_image_legacy *floppy, int head, int track, option_resolution *params);
|
||||
floperr_t (*post_format)(floppy_image_legacy *floppy, option_resolution *params);
|
||||
int (*get_heads_per_disk)(floppy_image_legacy *floppy);
|
||||
int (*get_tracks_per_disk)(floppy_image_legacy *floppy);
|
||||
int (*get_sectors_per_track)(floppy_image_legacy *floppy, int head, int track);
|
||||
UINT32 (*get_track_size)(floppy_image_legacy *floppy, int head, int track);
|
||||
floperr_t (*get_sector_length)(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length);
|
||||
floperr_t (*get_indexed_sector_info)(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags);
|
||||
floperr_t (*get_track_data_offset)(floppy_image_legacy *floppy, int head, int track, UINT64 *offset);
|
||||
};
|
||||
|
||||
|
||||
@ -84,15 +84,15 @@ struct FloppyFormat
|
||||
const char *name;
|
||||
const char *extensions;
|
||||
const char *description;
|
||||
floperr_t (*identify)(floppy_image *floppy, const struct FloppyFormat *format, int *vote);
|
||||
floperr_t (*construct)(floppy_image *floppy, const struct FloppyFormat *format, option_resolution *params);
|
||||
floperr_t (*destruct)(floppy_image *floppy, const struct FloppyFormat *format);
|
||||
floperr_t (*identify)(floppy_image_legacy *floppy, const struct FloppyFormat *format, int *vote);
|
||||
floperr_t (*construct)(floppy_image_legacy *floppy, const struct FloppyFormat *format, option_resolution *params);
|
||||
floperr_t (*destruct)(floppy_image_legacy *floppy, const struct FloppyFormat *format);
|
||||
const char *param_guidelines;
|
||||
};
|
||||
|
||||
#define FLOPPY_IDENTIFY(name) floperr_t name(floppy_image *floppy, const struct FloppyFormat *format, int *vote)
|
||||
#define FLOPPY_CONSTRUCT(name) floperr_t name(floppy_image *floppy, const struct FloppyFormat *format, option_resolution *params)
|
||||
#define FLOPPY_DESTRUCT(name) floperr_t name(floppy_image *floppy, const struct FloppyFormat *format)
|
||||
#define FLOPPY_IDENTIFY(name) floperr_t name(floppy_image_legacy *floppy, const struct FloppyFormat *format, int *vote)
|
||||
#define FLOPPY_CONSTRUCT(name) floperr_t name(floppy_image_legacy *floppy, const struct FloppyFormat *format, option_resolution *params)
|
||||
#define FLOPPY_DESTRUCT(name) floperr_t name(floppy_image_legacy *floppy, const struct FloppyFormat *format)
|
||||
|
||||
FLOPPY_IDENTIFY(td0_dsk_identify);
|
||||
FLOPPY_CONSTRUCT(td0_dsk_construct);
|
||||
@ -165,50 +165,50 @@ FLOPPY_OPTIONS_EXTERN(default);
|
||||
OPTION_GUIDE_EXTERN(floppy_option_guide);
|
||||
|
||||
/* opening, closing and creating of floppy images */
|
||||
floperr_t floppy_open(void *fp, const struct io_procs *procs, const char *extension, const struct FloppyFormat *format, int flags, floppy_image **outfloppy);
|
||||
floperr_t floppy_open_choices(void *fp, const struct io_procs *procs, const char *extension, const struct FloppyFormat *formats, int flags, floppy_image **outfloppy);
|
||||
floperr_t floppy_create(void *fp, const struct io_procs *procs, const struct FloppyFormat *format, option_resolution *parameters, floppy_image **outfloppy);
|
||||
void floppy_close(floppy_image *floppy);
|
||||
floperr_t floppy_open(void *fp, const struct io_procs *procs, const char *extension, const struct FloppyFormat *format, int flags, floppy_image_legacy **outfloppy);
|
||||
floperr_t floppy_open_choices(void *fp, const struct io_procs *procs, const char *extension, const struct FloppyFormat *formats, int flags, floppy_image_legacy **outfloppy);
|
||||
floperr_t floppy_create(void *fp, const struct io_procs *procs, const struct FloppyFormat *format, option_resolution *parameters, floppy_image_legacy **outfloppy);
|
||||
void floppy_close(floppy_image_legacy *floppy);
|
||||
|
||||
/* useful for identifying a floppy image */
|
||||
floperr_t floppy_identify(void *fp, const struct io_procs *procs, const char *extension,
|
||||
const struct FloppyFormat *formats, int *identified_format);
|
||||
|
||||
/* functions useful within format constructors */
|
||||
void *floppy_tag(floppy_image *floppy);
|
||||
void *floppy_create_tag(floppy_image *floppy, size_t tagsize);
|
||||
struct FloppyCallbacks *floppy_callbacks(floppy_image *floppy);
|
||||
UINT8 floppy_get_filler(floppy_image *floppy);
|
||||
void floppy_set_filler(floppy_image *floppy, UINT8 filler);
|
||||
void *floppy_tag(floppy_image_legacy *floppy);
|
||||
void *floppy_create_tag(floppy_image_legacy *floppy, size_t tagsize);
|
||||
struct FloppyCallbacks *floppy_callbacks(floppy_image_legacy *floppy);
|
||||
UINT8 floppy_get_filler(floppy_image_legacy *floppy);
|
||||
void floppy_set_filler(floppy_image_legacy *floppy, UINT8 filler);
|
||||
|
||||
/* calls for accessing disk image data */
|
||||
floperr_t floppy_read_sector(floppy_image *floppy, int head, int track, int sector, int offset, void *buffer, size_t buffer_len);
|
||||
floperr_t floppy_write_sector(floppy_image *floppy, int head, int track, int sector, int offset, const void *buffer, size_t buffer_len, int ddam);
|
||||
floperr_t floppy_read_indexed_sector(floppy_image *floppy, int head, int track, int sector_index, int offset, void *buffer, size_t buffer_len);
|
||||
floperr_t floppy_write_indexed_sector(floppy_image *floppy, int head, int track, int sector_index, int offset, const void *buffer, size_t buffer_len, int ddam);
|
||||
floperr_t floppy_read_track(floppy_image *floppy, int head, int track, void *buffer, size_t buffer_len);
|
||||
floperr_t floppy_write_track(floppy_image *floppy, int head, int track, const void *buffer, size_t buffer_len);
|
||||
floperr_t floppy_read_track_data(floppy_image *floppy, int head, int track, void *buffer, size_t buffer_len);
|
||||
floperr_t floppy_write_track_data(floppy_image *floppy, int head, int track, const void *buffer, size_t buffer_len);
|
||||
floperr_t floppy_format_track(floppy_image *floppy, int head, int track, option_resolution *params);
|
||||
int floppy_get_tracks_per_disk(floppy_image *floppy);
|
||||
int floppy_get_heads_per_disk(floppy_image *floppy);
|
||||
UINT32 floppy_get_track_size(floppy_image *floppy, int head, int track);
|
||||
floperr_t floppy_get_sector_length(floppy_image *floppy, int head, int track, int sector, UINT32 *sector_length);
|
||||
floperr_t floppy_get_indexed_sector_info(floppy_image *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags);
|
||||
floperr_t floppy_get_sector_count(floppy_image *floppy, int head, int track, int *sector_count);
|
||||
floperr_t floppy_load_track(floppy_image *floppy, int head, int track, int dirtify, void **track_data, size_t *track_length);
|
||||
int floppy_is_read_only(floppy_image *floppy);
|
||||
UINT8 floppy_random_byte(floppy_image *floppy);
|
||||
floperr_t floppy_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, int offset, void *buffer, size_t buffer_len);
|
||||
floperr_t floppy_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, int offset, const void *buffer, size_t buffer_len, int ddam);
|
||||
floperr_t floppy_read_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector_index, int offset, void *buffer, size_t buffer_len);
|
||||
floperr_t floppy_write_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector_index, int offset, const void *buffer, size_t buffer_len, int ddam);
|
||||
floperr_t floppy_read_track(floppy_image_legacy *floppy, int head, int track, void *buffer, size_t buffer_len);
|
||||
floperr_t floppy_write_track(floppy_image_legacy *floppy, int head, int track, const void *buffer, size_t buffer_len);
|
||||
floperr_t floppy_read_track_data(floppy_image_legacy *floppy, int head, int track, void *buffer, size_t buffer_len);
|
||||
floperr_t floppy_write_track_data(floppy_image_legacy *floppy, int head, int track, const void *buffer, size_t buffer_len);
|
||||
floperr_t floppy_format_track(floppy_image_legacy *floppy, int head, int track, option_resolution *params);
|
||||
int floppy_get_tracks_per_disk(floppy_image_legacy *floppy);
|
||||
int floppy_get_heads_per_disk(floppy_image_legacy *floppy);
|
||||
UINT32 floppy_get_track_size(floppy_image_legacy *floppy, int head, int track);
|
||||
floperr_t floppy_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length);
|
||||
floperr_t floppy_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags);
|
||||
floperr_t floppy_get_sector_count(floppy_image_legacy *floppy, int head, int track, int *sector_count);
|
||||
floperr_t floppy_load_track(floppy_image_legacy *floppy, int head, int track, int dirtify, void **track_data, size_t *track_length);
|
||||
int floppy_is_read_only(floppy_image_legacy *floppy);
|
||||
UINT8 floppy_random_byte(floppy_image_legacy *floppy);
|
||||
|
||||
/* accessors for meta information about the image */
|
||||
const char *floppy_format_description(floppy_image *floppy);
|
||||
const char *floppy_format_description(floppy_image_legacy *floppy);
|
||||
|
||||
/* calls for accessing the raw disk image */
|
||||
void floppy_image_read(floppy_image *floppy, void *buffer, UINT64 offset, size_t length);
|
||||
void floppy_image_write(floppy_image *floppy, const void *buffer, UINT64 offset, size_t length);
|
||||
void floppy_image_write_filler(floppy_image *floppy, UINT8 filler, UINT64 offset, size_t length);
|
||||
UINT64 floppy_image_size(floppy_image *floppy);
|
||||
void floppy_image_read(floppy_image_legacy *floppy, void *buffer, UINT64 offset, size_t length);
|
||||
void floppy_image_write(floppy_image_legacy *floppy, const void *buffer, UINT64 offset, size_t length);
|
||||
void floppy_image_write_filler(floppy_image_legacy *floppy, UINT8 filler, UINT64 offset, size_t length);
|
||||
UINT64 floppy_image_size(floppy_image_legacy *floppy);
|
||||
|
||||
/* misc */
|
||||
const char *floppy_error(floperr_t err);
|
||||
|
@ -47,7 +47,7 @@ struct g64dsk_tag
|
||||
INLINE FUNCTIONS
|
||||
***************************************************************************/
|
||||
|
||||
INLINE struct g64dsk_tag *get_tag(floppy_image *floppy)
|
||||
INLINE struct g64dsk_tag *get_tag(floppy_image_legacy *floppy)
|
||||
{
|
||||
return (g64dsk_tag *)floppy_tag(floppy);
|
||||
}
|
||||
@ -66,7 +66,7 @@ INLINE float get_dos_track(int track)
|
||||
of heads in the disk image
|
||||
-------------------------------------------------*/
|
||||
|
||||
static int g64_get_heads_per_disk(floppy_image *floppy)
|
||||
static int g64_get_heads_per_disk(floppy_image_legacy *floppy)
|
||||
{
|
||||
return get_tag(floppy)->heads;
|
||||
}
|
||||
@ -76,7 +76,7 @@ static int g64_get_heads_per_disk(floppy_image *floppy)
|
||||
of DOS tracks in the disk image
|
||||
-------------------------------------------------*/
|
||||
|
||||
static int g64_get_tracks_per_disk(floppy_image *floppy)
|
||||
static int g64_get_tracks_per_disk(floppy_image_legacy *floppy)
|
||||
{
|
||||
return get_tag(floppy)->tracks;
|
||||
}
|
||||
@ -86,7 +86,7 @@ static int g64_get_tracks_per_disk(floppy_image *floppy)
|
||||
the disk image for a given track
|
||||
-------------------------------------------------*/
|
||||
|
||||
static floperr_t get_track_offset(floppy_image *floppy, int head, int track, UINT64 *offset)
|
||||
static floperr_t get_track_offset(floppy_image_legacy *floppy, int head, int track, UINT64 *offset)
|
||||
{
|
||||
struct g64dsk_tag *tag = get_tag(floppy);
|
||||
UINT64 offs = 0;
|
||||
@ -106,7 +106,7 @@ static floperr_t get_track_offset(floppy_image *floppy, int head, int track, UIN
|
||||
g64_get_track_size - returns the track size
|
||||
-------------------------------------------------*/
|
||||
|
||||
static UINT32 g64_get_track_size(floppy_image *floppy, int head, int track)
|
||||
static UINT32 g64_get_track_size(floppy_image_legacy *floppy, int head, int track)
|
||||
{
|
||||
/* get track offset */
|
||||
UINT64 track_offset;
|
||||
@ -128,7 +128,7 @@ static UINT32 g64_get_track_size(floppy_image *floppy, int head, int track)
|
||||
disk image
|
||||
-------------------------------------------------*/
|
||||
|
||||
static floperr_t g64_read_track(floppy_image *floppy, int head, int track, UINT64 offset, void *buffer, size_t buflen)
|
||||
static floperr_t g64_read_track(floppy_image_legacy *floppy, int head, int track, UINT64 offset, void *buffer, size_t buflen)
|
||||
{
|
||||
struct g64dsk_tag *tag = get_tag(floppy);
|
||||
floperr_t err;
|
||||
@ -164,7 +164,7 @@ static floperr_t g64_read_track(floppy_image *floppy, int head, int track, UINT6
|
||||
disk image
|
||||
-------------------------------------------------*/
|
||||
|
||||
static floperr_t g64_write_track(floppy_image *floppy, int head, int track, UINT64 offset, const void *buffer, size_t buflen)
|
||||
static floperr_t g64_write_track(floppy_image_legacy *floppy, int head, int track, UINT64 offset, const void *buffer, size_t buflen)
|
||||
{
|
||||
return FLOPPY_ERROR_UNSUPPORTED;
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ struct imddsk_tag
|
||||
};
|
||||
|
||||
|
||||
static struct imddsk_tag *get_tag(floppy_image *floppy)
|
||||
static struct imddsk_tag *get_tag(floppy_image_legacy *floppy)
|
||||
{
|
||||
struct imddsk_tag *tag;
|
||||
tag = (imddsk_tag *)floppy_tag(floppy);
|
||||
@ -40,22 +40,22 @@ FLOPPY_IDENTIFY( imd_dsk_identify )
|
||||
return FLOPPY_ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
static int imd_get_heads_per_disk(floppy_image *floppy)
|
||||
static int imd_get_heads_per_disk(floppy_image_legacy *floppy)
|
||||
{
|
||||
return get_tag(floppy)->heads;
|
||||
}
|
||||
|
||||
static int imd_get_tracks_per_disk(floppy_image *floppy)
|
||||
static int imd_get_tracks_per_disk(floppy_image_legacy *floppy)
|
||||
{
|
||||
return get_tag(floppy)->tracks;
|
||||
}
|
||||
|
||||
static UINT64 imd_get_track_offset(floppy_image *floppy, int head, int track)
|
||||
static UINT64 imd_get_track_offset(floppy_image_legacy *floppy, int head, int track)
|
||||
{
|
||||
return get_tag(floppy)->track_offsets[(track<<1) + head];
|
||||
}
|
||||
|
||||
static floperr_t get_offset(floppy_image *floppy, int head, int track, int sector, int sector_is_index, UINT64 *offset)
|
||||
static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, UINT64 *offset)
|
||||
{
|
||||
UINT64 offs = 0;
|
||||
UINT8 header[5];
|
||||
@ -93,7 +93,7 @@ static floperr_t get_offset(floppy_image *floppy, int head, int track, int secto
|
||||
|
||||
|
||||
|
||||
static floperr_t internal_imd_read_sector(floppy_image *floppy, int head, int track, int sector, int sector_is_index, void *buffer, size_t buflen)
|
||||
static floperr_t internal_imd_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, void *buffer, size_t buflen)
|
||||
{
|
||||
UINT64 offset;
|
||||
floperr_t err;
|
||||
@ -124,17 +124,17 @@ static floperr_t internal_imd_read_sector(floppy_image *floppy, int head, int tr
|
||||
}
|
||||
|
||||
|
||||
static floperr_t imd_read_sector(floppy_image *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
static floperr_t imd_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
{
|
||||
return internal_imd_read_sector(floppy, head, track, sector, FALSE, buffer, buflen);
|
||||
}
|
||||
|
||||
static floperr_t imd_read_indexed_sector(floppy_image *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
static floperr_t imd_read_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
{
|
||||
return internal_imd_read_sector(floppy, head, track, sector, TRUE, buffer, buflen);
|
||||
}
|
||||
|
||||
static floperr_t imd_get_sector_length(floppy_image *floppy, int head, int track, int sector, UINT32 *sector_length)
|
||||
static floperr_t imd_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length)
|
||||
{
|
||||
floperr_t err;
|
||||
err = get_offset(floppy, head, track, sector, FALSE, NULL);
|
||||
@ -147,7 +147,7 @@ static floperr_t imd_get_sector_length(floppy_image *floppy, int head, int track
|
||||
return FLOPPY_ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
static floperr_t imd_get_indexed_sector_info(floppy_image *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags)
|
||||
static floperr_t imd_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags)
|
||||
{
|
||||
UINT64 offset;
|
||||
UINT8 header[5];
|
||||
|
@ -38,7 +38,7 @@ struct oricdsk_tag
|
||||
};
|
||||
|
||||
|
||||
static struct oricdsk_tag *get_tag(floppy_image *floppy)
|
||||
static struct oricdsk_tag *get_tag(floppy_image_legacy *floppy)
|
||||
{
|
||||
struct oricdsk_tag *tag;
|
||||
tag = (oricdsk_tag *)floppy_tag(floppy);
|
||||
@ -65,7 +65,7 @@ static FLOPPY_IDENTIFY(oric_dsk_identify)
|
||||
}
|
||||
return FLOPPY_ERROR_SUCCESS;
|
||||
}
|
||||
static int oric_get_track_offset(floppy_image *floppy,int track, int head)
|
||||
static int oric_get_track_offset(floppy_image_legacy *floppy,int track, int head)
|
||||
{
|
||||
if (get_tag(floppy)->geometry==1) {
|
||||
return mfm_disk_header_size + (get_tag(floppy)->tracksize * track) + (head * get_tag(floppy)->tracksize * get_tag(floppy)->tracks);
|
||||
@ -74,17 +74,17 @@ static int oric_get_track_offset(floppy_image *floppy,int track, int head)
|
||||
}
|
||||
}
|
||||
|
||||
static int oric_get_heads_per_disk(floppy_image *floppy)
|
||||
static int oric_get_heads_per_disk(floppy_image_legacy *floppy)
|
||||
{
|
||||
return get_tag(floppy)->heads;
|
||||
}
|
||||
|
||||
static int oric_get_tracks_per_disk(floppy_image *floppy)
|
||||
static int oric_get_tracks_per_disk(floppy_image_legacy *floppy)
|
||||
{
|
||||
return get_tag(floppy)->tracks;
|
||||
}
|
||||
|
||||
static void mfm_info_cache_sector_info(floppy_image *floppy,int track,int head)
|
||||
static void mfm_info_cache_sector_info(floppy_image_legacy *floppy,int track,int head)
|
||||
{
|
||||
UINT8 track_data[TRACK_SIZE_MFM];
|
||||
|
||||
@ -165,7 +165,7 @@ static void mfm_info_cache_sector_info(floppy_image *floppy,int track,int head)
|
||||
|
||||
}
|
||||
|
||||
static floperr_t get_offset(floppy_image *floppy, int head, int track, int sector, int sector_is_index, UINT64 *offset)
|
||||
static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, UINT64 *offset)
|
||||
{
|
||||
UINT64 offs;
|
||||
|
||||
@ -189,7 +189,7 @@ static floperr_t get_offset(floppy_image *floppy, int head, int track, int secto
|
||||
|
||||
|
||||
|
||||
static floperr_t internal_oric_read_sector(floppy_image *floppy, int head, int track, int sector, int sector_is_index, void *buffer, size_t buflen)
|
||||
static floperr_t internal_oric_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, void *buffer, size_t buflen)
|
||||
{
|
||||
UINT64 offset;
|
||||
floperr_t err;
|
||||
@ -202,7 +202,7 @@ static floperr_t internal_oric_read_sector(floppy_image *floppy, int head, int t
|
||||
|
||||
|
||||
|
||||
static floperr_t internal_oric_write_sector(floppy_image *floppy, int head, int track, int sector, int sector_is_index, const void *buffer, size_t buflen, int ddam)
|
||||
static floperr_t internal_oric_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, const void *buffer, size_t buflen, int ddam)
|
||||
{
|
||||
UINT64 offset;
|
||||
floperr_t err;
|
||||
@ -217,27 +217,27 @@ static floperr_t internal_oric_write_sector(floppy_image *floppy, int head, int
|
||||
|
||||
|
||||
|
||||
static floperr_t oric_read_sector(floppy_image *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
static floperr_t oric_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
{
|
||||
return internal_oric_read_sector(floppy, head, track, sector, FALSE, buffer, buflen);
|
||||
}
|
||||
|
||||
static floperr_t oric_write_sector(floppy_image *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
static floperr_t oric_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
{
|
||||
return internal_oric_write_sector(floppy, head, track, sector, FALSE, buffer, buflen, ddam);
|
||||
}
|
||||
|
||||
static floperr_t oric_read_indexed_sector(floppy_image *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
static floperr_t oric_read_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
{
|
||||
return internal_oric_read_sector(floppy, head, track, sector, TRUE, buffer, buflen);
|
||||
}
|
||||
|
||||
static floperr_t oric_write_indexed_sector(floppy_image *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
static floperr_t oric_write_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
{
|
||||
return internal_oric_write_sector(floppy, head, track, sector, TRUE, buffer, buflen, ddam);
|
||||
}
|
||||
|
||||
static floperr_t oric_get_sector_length(floppy_image *floppy, int head, int track, int sector, UINT32 *sector_length)
|
||||
static floperr_t oric_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length)
|
||||
{
|
||||
floperr_t err;
|
||||
err = get_offset(floppy, head, track, sector, FALSE, NULL);
|
||||
@ -252,7 +252,7 @@ static floperr_t oric_get_sector_length(floppy_image *floppy, int head, int trac
|
||||
|
||||
|
||||
|
||||
static floperr_t oric_get_indexed_sector_info(floppy_image *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags)
|
||||
static floperr_t oric_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags)
|
||||
{
|
||||
floperr_t retVal;
|
||||
|
||||
|
@ -36,7 +36,7 @@ static const struct pc_disk_sizes disk_sizes[] =
|
||||
|
||||
|
||||
|
||||
static floperr_t pc_dsk_compute_geometry(floppy_image *floppy, struct basicdsk_geometry *geometry)
|
||||
static floperr_t pc_dsk_compute_geometry(floppy_image_legacy *floppy, struct basicdsk_geometry *geometry)
|
||||
{
|
||||
int i;
|
||||
UINT64 size;
|
||||
|
@ -17,23 +17,23 @@ static FLOPPY_IDENTIFY(smx_dsk_identify)
|
||||
return FLOPPY_ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
static int smx_get_heads_per_disk(floppy_image *floppy)
|
||||
static int smx_get_heads_per_disk(floppy_image_legacy *floppy)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
static int smx_get_tracks_per_disk(floppy_image *floppy)
|
||||
static int smx_get_tracks_per_disk(floppy_image_legacy *floppy)
|
||||
{
|
||||
return 80;
|
||||
}
|
||||
|
||||
static UINT64 smx_translate_offset(floppy_image *floppy,
|
||||
static UINT64 smx_translate_offset(floppy_image_legacy *floppy,
|
||||
int track, int head, int sector)
|
||||
{
|
||||
return (track * 1024 * 5 * 2) + (head * 1024 * 5) + 1024 * sector;
|
||||
}
|
||||
|
||||
static floperr_t get_offset(floppy_image *floppy, int head, int track, int sector, int sector_is_index, UINT64 *offset)
|
||||
static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, UINT64 *offset)
|
||||
{
|
||||
UINT64 offs;
|
||||
/* translate the sector to a raw sector */
|
||||
@ -54,7 +54,7 @@ static floperr_t get_offset(floppy_image *floppy, int head, int track, int secto
|
||||
|
||||
|
||||
|
||||
static floperr_t internal_smx_read_sector(floppy_image *floppy, int head, int track, int sector, int sector_is_index, void *buffer, size_t buflen)
|
||||
static floperr_t internal_smx_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, void *buffer, size_t buflen)
|
||||
{
|
||||
UINT64 offset;
|
||||
floperr_t err;
|
||||
@ -68,7 +68,7 @@ static floperr_t internal_smx_read_sector(floppy_image *floppy, int head, int tr
|
||||
|
||||
|
||||
|
||||
static floperr_t internal_smx_write_sector(floppy_image *floppy, int head, int track, int sector, int sector_is_index, const void *buffer, size_t buflen, int ddam)
|
||||
static floperr_t internal_smx_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, const void *buffer, size_t buflen, int ddam)
|
||||
{
|
||||
UINT64 offset;
|
||||
floperr_t err;
|
||||
@ -83,27 +83,27 @@ static floperr_t internal_smx_write_sector(floppy_image *floppy, int head, int t
|
||||
|
||||
|
||||
|
||||
static floperr_t smx_read_sector(floppy_image *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
static floperr_t smx_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
{
|
||||
return internal_smx_read_sector(floppy, head, track, sector, FALSE, buffer, buflen);
|
||||
}
|
||||
|
||||
static floperr_t smx_write_sector(floppy_image *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
static floperr_t smx_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
{
|
||||
return internal_smx_write_sector(floppy, head, track, sector, FALSE, buffer, buflen, ddam);
|
||||
}
|
||||
|
||||
static floperr_t smx_read_indexed_sector(floppy_image *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
static floperr_t smx_read_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
{
|
||||
return internal_smx_read_sector(floppy, head, track, sector, TRUE, buffer, buflen);
|
||||
}
|
||||
|
||||
static floperr_t smx_write_indexed_sector(floppy_image *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
static floperr_t smx_write_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
{
|
||||
return internal_smx_write_sector(floppy, head, track, sector, TRUE, buffer, buflen, ddam);
|
||||
}
|
||||
|
||||
static floperr_t smx_get_sector_length(floppy_image *floppy, int head, int track, int sector, UINT32 *sector_length)
|
||||
static floperr_t smx_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length)
|
||||
{
|
||||
floperr_t err;
|
||||
err = get_offset(floppy, head, track, sector, FALSE, NULL);
|
||||
@ -118,7 +118,7 @@ static floperr_t smx_get_sector_length(floppy_image *floppy, int head, int track
|
||||
|
||||
|
||||
|
||||
static floperr_t smx_get_indexed_sector_info(floppy_image *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags)
|
||||
static floperr_t smx_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags)
|
||||
{
|
||||
sector_index += 1;
|
||||
if (cylinder)
|
||||
|
@ -17,22 +17,22 @@ static FLOPPY_IDENTIFY(exi_dsk_identify)
|
||||
return FLOPPY_ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
static int exi_get_heads_per_disk(floppy_image *floppy)
|
||||
static int exi_get_heads_per_disk(floppy_image_legacy *floppy)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int exi_get_tracks_per_disk(floppy_image *floppy)
|
||||
static int exi_get_tracks_per_disk(floppy_image_legacy *floppy)
|
||||
{
|
||||
return 77;
|
||||
}
|
||||
|
||||
static UINT64 exi_translate_offset(floppy_image *floppy, int track, int head, int sector)
|
||||
static UINT64 exi_translate_offset(floppy_image_legacy *floppy, int track, int head, int sector)
|
||||
{
|
||||
return 13+270*(16*track+sector);
|
||||
}
|
||||
|
||||
static floperr_t get_offset(floppy_image *floppy, int head, int track, int sector, int sector_is_index, UINT64 *offset)
|
||||
static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, UINT64 *offset)
|
||||
{
|
||||
UINT64 offs;
|
||||
/* translate the sector to a raw sector */
|
||||
@ -52,7 +52,7 @@ static floperr_t get_offset(floppy_image *floppy, int head, int track, int secto
|
||||
|
||||
|
||||
|
||||
static floperr_t internal_exi_read_sector(floppy_image *floppy, int head, int track, int sector, int sector_is_index, void *buffer, size_t buflen)
|
||||
static floperr_t internal_exi_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, void *buffer, size_t buflen)
|
||||
{
|
||||
UINT64 offset;
|
||||
floperr_t err;
|
||||
@ -66,7 +66,7 @@ static floperr_t internal_exi_read_sector(floppy_image *floppy, int head, int tr
|
||||
|
||||
|
||||
|
||||
static floperr_t internal_exi_write_sector(floppy_image *floppy, int head, int track, int sector, int sector_is_index, const void *buffer, size_t buflen, int ddam)
|
||||
static floperr_t internal_exi_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, const void *buffer, size_t buflen, int ddam)
|
||||
{
|
||||
UINT64 offset;
|
||||
floperr_t err;
|
||||
@ -81,27 +81,27 @@ static floperr_t internal_exi_write_sector(floppy_image *floppy, int head, int t
|
||||
|
||||
|
||||
|
||||
static floperr_t exi_read_sector(floppy_image *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
static floperr_t exi_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
{
|
||||
return internal_exi_read_sector(floppy, head, track, sector, FALSE, buffer, buflen);
|
||||
}
|
||||
|
||||
static floperr_t exi_write_sector(floppy_image *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
static floperr_t exi_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
{
|
||||
return internal_exi_write_sector(floppy, head, track, sector, FALSE, buffer, buflen, ddam);
|
||||
}
|
||||
|
||||
static floperr_t exi_read_indexed_sector(floppy_image *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
static floperr_t exi_read_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
{
|
||||
return internal_exi_read_sector(floppy, head, track, sector, TRUE, buffer, buflen);
|
||||
}
|
||||
|
||||
static floperr_t exi_write_indexed_sector(floppy_image *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
static floperr_t exi_write_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
{
|
||||
return internal_exi_write_sector(floppy, head, track, sector, TRUE, buffer, buflen, ddam);
|
||||
}
|
||||
|
||||
static floperr_t exi_get_sector_length(floppy_image *floppy, int head, int track, int sector, UINT32 *sector_length)
|
||||
static floperr_t exi_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length)
|
||||
{
|
||||
floperr_t err;
|
||||
err = get_offset(floppy, head, track, sector, FALSE, NULL);
|
||||
@ -116,7 +116,7 @@ static floperr_t exi_get_sector_length(floppy_image *floppy, int head, int track
|
||||
|
||||
|
||||
|
||||
static floperr_t exi_get_indexed_sector_info(floppy_image *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags)
|
||||
static floperr_t exi_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags)
|
||||
{
|
||||
sector_index += 1;
|
||||
if (cylinder)
|
||||
|
@ -17,17 +17,17 @@ static FLOPPY_IDENTIFY(svi_dsk_identify)
|
||||
return FLOPPY_ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
static int svi_get_heads_per_disk(floppy_image *floppy)
|
||||
static int svi_get_heads_per_disk(floppy_image_legacy *floppy)
|
||||
{
|
||||
return (floppy_image_size(floppy) == (172032)) ? 1 : 2;
|
||||
}
|
||||
|
||||
static int svi_get_tracks_per_disk(floppy_image *floppy)
|
||||
static int svi_get_tracks_per_disk(floppy_image_legacy *floppy)
|
||||
{
|
||||
return 40;
|
||||
}
|
||||
|
||||
static UINT64 svi_translate_offset(floppy_image *floppy,
|
||||
static UINT64 svi_translate_offset(floppy_image_legacy *floppy,
|
||||
int track, int head, int sector)
|
||||
{
|
||||
UINT64 o;
|
||||
@ -39,7 +39,7 @@ static UINT64 svi_translate_offset(floppy_image *floppy,
|
||||
return o;
|
||||
}
|
||||
|
||||
static floperr_t get_offset(floppy_image *floppy, int head, int track, int sector, int sector_is_index, UINT64 *offset)
|
||||
static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, UINT64 *offset)
|
||||
{
|
||||
UINT64 offs;
|
||||
/* translate the sector to a raw sector */
|
||||
@ -60,7 +60,7 @@ static floperr_t get_offset(floppy_image *floppy, int head, int track, int secto
|
||||
|
||||
|
||||
|
||||
static floperr_t internal_svi_read_sector(floppy_image *floppy, int head, int track, int sector, int sector_is_index, void *buffer, size_t buflen)
|
||||
static floperr_t internal_svi_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, void *buffer, size_t buflen)
|
||||
{
|
||||
UINT64 offset;
|
||||
floperr_t err;
|
||||
@ -74,7 +74,7 @@ static floperr_t internal_svi_read_sector(floppy_image *floppy, int head, int tr
|
||||
|
||||
|
||||
|
||||
static floperr_t internal_svi_write_sector(floppy_image *floppy, int head, int track, int sector, int sector_is_index, const void *buffer, size_t buflen, int ddam)
|
||||
static floperr_t internal_svi_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, const void *buffer, size_t buflen, int ddam)
|
||||
{
|
||||
UINT64 offset;
|
||||
floperr_t err;
|
||||
@ -89,27 +89,27 @@ static floperr_t internal_svi_write_sector(floppy_image *floppy, int head, int t
|
||||
|
||||
|
||||
|
||||
static floperr_t svi_read_sector(floppy_image *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
static floperr_t svi_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
{
|
||||
return internal_svi_read_sector(floppy, head, track, sector, FALSE, buffer, buflen);
|
||||
}
|
||||
|
||||
static floperr_t svi_write_sector(floppy_image *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
static floperr_t svi_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
{
|
||||
return internal_svi_write_sector(floppy, head, track, sector, FALSE, buffer, buflen, ddam);
|
||||
}
|
||||
|
||||
static floperr_t svi_read_indexed_sector(floppy_image *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
static floperr_t svi_read_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
{
|
||||
return internal_svi_read_sector(floppy, head, track, sector, TRUE, buffer, buflen);
|
||||
}
|
||||
|
||||
static floperr_t svi_write_indexed_sector(floppy_image *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
static floperr_t svi_write_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
{
|
||||
return internal_svi_write_sector(floppy, head, track, sector, TRUE, buffer, buflen, ddam);
|
||||
}
|
||||
|
||||
static floperr_t svi_get_sector_length(floppy_image *floppy, int head, int track, int sector, UINT32 *sector_length)
|
||||
static floperr_t svi_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length)
|
||||
{
|
||||
floperr_t err;
|
||||
err = get_offset(floppy, head, track, sector, FALSE, NULL);
|
||||
@ -124,7 +124,7 @@ static floperr_t svi_get_sector_length(floppy_image *floppy, int head, int track
|
||||
|
||||
|
||||
|
||||
static floperr_t svi_get_indexed_sector_info(floppy_image *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags)
|
||||
static floperr_t svi_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags)
|
||||
{
|
||||
sector_index += 1;
|
||||
if (cylinder)
|
||||
|
@ -55,7 +55,7 @@ struct tdlzhuf {
|
||||
|
||||
struct td0dsk_t
|
||||
{
|
||||
floppy_image *floppy_file;
|
||||
floppy_image_legacy *floppy_file;
|
||||
UINT64 floppy_file_offset;
|
||||
|
||||
struct tdlzhuf tdctl;
|
||||
@ -90,7 +90,7 @@ struct td0dsk_t
|
||||
static td0dsk_t td0dsk;
|
||||
|
||||
|
||||
static struct td0dsk_tag *get_tag(floppy_image *floppy)
|
||||
static struct td0dsk_tag *get_tag(floppy_image_legacy *floppy)
|
||||
{
|
||||
struct td0dsk_tag *tag;
|
||||
tag = (td0dsk_tag *)floppy_tag(floppy);
|
||||
@ -114,22 +114,22 @@ FLOPPY_IDENTIFY( td0_dsk_identify )
|
||||
return FLOPPY_ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
static int td0_get_heads_per_disk(floppy_image *floppy)
|
||||
static int td0_get_heads_per_disk(floppy_image_legacy *floppy)
|
||||
{
|
||||
return get_tag(floppy)->heads;
|
||||
}
|
||||
|
||||
static int td0_get_tracks_per_disk(floppy_image *floppy)
|
||||
static int td0_get_tracks_per_disk(floppy_image_legacy *floppy)
|
||||
{
|
||||
return get_tag(floppy)->tracks;
|
||||
}
|
||||
|
||||
static UINT64 td0_get_track_offset(floppy_image *floppy, int head, int track)
|
||||
static UINT64 td0_get_track_offset(floppy_image_legacy *floppy, int head, int track)
|
||||
{
|
||||
return get_tag(floppy)->track_offsets[(track<<1) + head];
|
||||
}
|
||||
|
||||
static floperr_t get_offset(floppy_image *floppy, int head, int track, int sector, int sector_is_index, UINT64 *offset)
|
||||
static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, UINT64 *offset)
|
||||
{
|
||||
UINT64 offs;
|
||||
UINT8 *header;
|
||||
@ -176,7 +176,7 @@ static floperr_t get_offset(floppy_image *floppy, int head, int track, int secto
|
||||
|
||||
|
||||
|
||||
static floperr_t internal_td0_read_sector(floppy_image *floppy, int head, int track, int sector, int sector_is_index, void *buffer, size_t buflen)
|
||||
static floperr_t internal_td0_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, void *buffer, size_t buflen)
|
||||
{
|
||||
UINT64 offset;
|
||||
floperr_t err;
|
||||
@ -261,17 +261,17 @@ static floperr_t internal_td0_read_sector(floppy_image *floppy, int head, int tr
|
||||
}
|
||||
|
||||
|
||||
static floperr_t td0_read_sector(floppy_image *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
static floperr_t td0_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
{
|
||||
return internal_td0_read_sector(floppy, head, track, sector, FALSE, buffer, buflen);
|
||||
}
|
||||
|
||||
static floperr_t td0_read_indexed_sector(floppy_image *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
static floperr_t td0_read_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
{
|
||||
return internal_td0_read_sector(floppy, head, track, sector, TRUE, buffer, buflen);
|
||||
}
|
||||
|
||||
static floperr_t td0_get_sector_length(floppy_image *floppy, int head, int track, int sector, UINT32 *sector_length)
|
||||
static floperr_t td0_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length)
|
||||
{
|
||||
floperr_t err;
|
||||
err = get_offset(floppy, head, track, sector, FALSE, NULL);
|
||||
@ -284,7 +284,7 @@ static floperr_t td0_get_sector_length(floppy_image *floppy, int head, int track
|
||||
return FLOPPY_ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
static floperr_t td0_get_indexed_sector_info(floppy_image *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags)
|
||||
static floperr_t td0_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags)
|
||||
{
|
||||
floperr_t retVal;
|
||||
UINT64 offset;
|
||||
|
@ -45,7 +45,7 @@ static UINT16 thom_sap_crc( UINT8* data, int size )
|
||||
return crc;
|
||||
}
|
||||
|
||||
static struct sap_dsk_tag *get_tag(floppy_image *floppy)
|
||||
static struct sap_dsk_tag *get_tag(floppy_image_legacy *floppy)
|
||||
{
|
||||
struct sap_dsk_tag *tag;
|
||||
tag = (sap_dsk_tag *)floppy_tag(floppy);
|
||||
@ -65,18 +65,18 @@ static FLOPPY_IDENTIFY(sap_dsk_identify)
|
||||
}
|
||||
return FLOPPY_ERROR_SUCCESS;
|
||||
}
|
||||
static int sap_get_heads_per_disk(floppy_image *floppy)
|
||||
static int sap_get_heads_per_disk(floppy_image_legacy *floppy)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int sap_get_tracks_per_disk(floppy_image *floppy)
|
||||
static int sap_get_tracks_per_disk(floppy_image_legacy *floppy)
|
||||
{
|
||||
return get_tag(floppy)->tracks;
|
||||
}
|
||||
|
||||
|
||||
static floperr_t get_offset(floppy_image *floppy, int head, int track, int sector, int sector_is_index, UINT64 *offset)
|
||||
static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, UINT64 *offset)
|
||||
{
|
||||
UINT64 offs;
|
||||
struct sap_dsk_tag *tag = get_tag(floppy);
|
||||
@ -101,7 +101,7 @@ static floperr_t get_offset(floppy_image *floppy, int head, int track, int secto
|
||||
|
||||
|
||||
|
||||
static floperr_t internal_sap_read_sector(floppy_image *floppy, int head, int track, int sector, int sector_is_index, void *buffer, size_t buflen)
|
||||
static floperr_t internal_sap_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, void *buffer, size_t buflen)
|
||||
{
|
||||
UINT64 offset;
|
||||
floperr_t err;
|
||||
@ -121,7 +121,7 @@ static floperr_t internal_sap_read_sector(floppy_image *floppy, int head, int tr
|
||||
|
||||
|
||||
|
||||
static floperr_t internal_sap_write_sector(floppy_image *floppy, int head, int track, int sector, int sector_is_index, const void *buffer, size_t buflen, int ddam)
|
||||
static floperr_t internal_sap_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, const void *buffer, size_t buflen, int ddam)
|
||||
{
|
||||
UINT64 offset;
|
||||
floperr_t err;
|
||||
@ -149,27 +149,27 @@ static floperr_t internal_sap_write_sector(floppy_image *floppy, int head, int t
|
||||
}
|
||||
|
||||
|
||||
static floperr_t sap_read_sector(floppy_image *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
static floperr_t sap_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
{
|
||||
return internal_sap_read_sector(floppy, head, track, sector, FALSE, buffer, buflen);
|
||||
}
|
||||
|
||||
static floperr_t sap_write_sector(floppy_image *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
static floperr_t sap_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
{
|
||||
return internal_sap_write_sector(floppy, head, track, sector, FALSE, buffer, buflen, ddam);
|
||||
}
|
||||
|
||||
static floperr_t sap_read_indexed_sector(floppy_image *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
static floperr_t sap_read_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
{
|
||||
return internal_sap_read_sector(floppy, head, track, sector, TRUE, buffer, buflen);
|
||||
}
|
||||
|
||||
static floperr_t sap_write_indexed_sector(floppy_image *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
static floperr_t sap_write_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
{
|
||||
return internal_sap_write_sector(floppy, head, track, sector, TRUE, buffer, buflen, ddam);
|
||||
}
|
||||
|
||||
static floperr_t sap_get_sector_length(floppy_image *floppy, int head, int track, int sector, UINT32 *sector_length)
|
||||
static floperr_t sap_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length)
|
||||
{
|
||||
floperr_t err;
|
||||
err = get_offset(floppy, head, track, sector, FALSE, NULL);
|
||||
@ -184,7 +184,7 @@ static floperr_t sap_get_sector_length(floppy_image *floppy, int head, int track
|
||||
|
||||
|
||||
|
||||
static floperr_t sap_get_indexed_sector_info(floppy_image *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags)
|
||||
static floperr_t sap_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags)
|
||||
{
|
||||
floperr_t err;
|
||||
UINT8 header[4];
|
||||
@ -207,7 +207,7 @@ static floperr_t sap_get_indexed_sector_info(floppy_image *floppy, int head, int
|
||||
return err;
|
||||
}
|
||||
|
||||
static floperr_t sap_post_format(floppy_image *floppy, option_resolution *params)
|
||||
static floperr_t sap_post_format(floppy_image_legacy *floppy, option_resolution *params)
|
||||
{
|
||||
int track,sector;
|
||||
int pos;
|
||||
@ -300,7 +300,7 @@ static FLOPPY_IDENTIFY(qdd_dsk_identify)
|
||||
/* fixed interlacing map for QDDs */
|
||||
static int thom_qdd_map[400];
|
||||
|
||||
static int qdd_translate_sector(floppy_image *floppy, int sector)
|
||||
static int qdd_translate_sector(floppy_image_legacy *floppy, int sector)
|
||||
{
|
||||
return thom_qdd_map[sector-1];
|
||||
}
|
||||
|
@ -152,7 +152,7 @@ static int find_block(const UINT8 *buffer, int start, int stop, UINT8 byte, size
|
||||
Queried by flopdrv. Instead of the image tracks, we return the tracks
|
||||
of the floppy drive. We assume we always have two heads.
|
||||
*/
|
||||
static int ti99_get_heads_per_disk(floppy_image *floppy)
|
||||
static int ti99_get_heads_per_disk(floppy_image_legacy *floppy)
|
||||
{
|
||||
// struct ti99dsk_tag *tag = (ti99dsk_tag*)floppy_tag(floppy);
|
||||
// return tag->heads;
|
||||
@ -163,7 +163,7 @@ static int ti99_get_heads_per_disk(floppy_image *floppy)
|
||||
Queried by flopdrv. Instead of the image tracks, we return the tracks
|
||||
of the floppy drive.
|
||||
*/
|
||||
static int ti99_get_tracks_per_disk(floppy_image *floppy)
|
||||
static int ti99_get_tracks_per_disk(floppy_image_legacy *floppy)
|
||||
{
|
||||
int drivetracks = 42;
|
||||
|
||||
@ -176,7 +176,7 @@ static int ti99_get_tracks_per_disk(floppy_image *floppy)
|
||||
return drivetracks;
|
||||
}
|
||||
|
||||
static floperr_t ti99_get_sector_length(floppy_image *floppy, int head, int track, int sector, UINT32 *sector_length)
|
||||
static floperr_t ti99_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length)
|
||||
{
|
||||
*sector_length=SECTOR_SIZE;
|
||||
return FLOPPY_ERROR_SUCCESS;
|
||||
@ -186,7 +186,7 @@ static floperr_t ti99_get_sector_length(floppy_image *floppy, int head, int trac
|
||||
Return the track size. We do not allow different track
|
||||
sizes, so we store the track size in the tag.
|
||||
*/
|
||||
static UINT32 ti99_get_track_size(floppy_image *floppy, int head, int track)
|
||||
static UINT32 ti99_get_track_size(floppy_image_legacy *floppy, int head, int track)
|
||||
{
|
||||
struct ti99dsk_tag *tag = (ti99dsk_tag*)floppy_tag(floppy);
|
||||
return tag->track_size;
|
||||
@ -239,8 +239,8 @@ static void create_vib(UINT8 *sector0, option_resolution *params)
|
||||
Sector dump format
|
||||
=========================================================================*/
|
||||
|
||||
static floperr_t ti99_sdf_read_sector(floppy_image *floppy, int head, int track, int sector, void *buffer, size_t buflen);
|
||||
static floperr_t ti99_sdf_write_sector(floppy_image *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam);
|
||||
static floperr_t ti99_sdf_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen);
|
||||
static floperr_t ti99_sdf_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam);
|
||||
|
||||
/* -----------------------------------------------------------------------
|
||||
* Guess the geometry of the sector dump disk.
|
||||
@ -270,7 +270,7 @@ static floperr_t ti99_sdf_write_sector(floppy_image *floppy, int head, int track
|
||||
* returns 100 if recognized, 0 if not recognized
|
||||
* ----------------------------------------------------------------------- */
|
||||
|
||||
static int ti99_sdf_guess_geometry(floppy_image *floppy, UINT64 size,
|
||||
static int ti99_sdf_guess_geometry(floppy_image_legacy *floppy, UINT64 size,
|
||||
struct ti99dsk_geometry *geometry)
|
||||
{
|
||||
int totsecs;
|
||||
@ -478,7 +478,7 @@ static void guess_interleave(int sectors, int *step, int *initial)
|
||||
Total length (FM) = 247 + sectors*334; (sectors=8 or 9)
|
||||
Total length (MFM) = 752 + sectors*340; (sectors=16 or 18)
|
||||
*/
|
||||
static floperr_t ti99_sdf_read_track(floppy_image *floppy, int head, int track, UINT64 offset, void *buffer, size_t buflen)
|
||||
static floperr_t ti99_sdf_read_track(floppy_image_legacy *floppy, int head, int track, UINT64 offset, void *buffer, size_t buflen)
|
||||
{
|
||||
int sector;
|
||||
int startstep;
|
||||
@ -621,7 +621,7 @@ static floperr_t ti99_sdf_read_track(floppy_image *floppy, int head, int track,
|
||||
Bytes written to locations beyond the image end will be droppped
|
||||
silently (as if the medium is unwritable from that point).
|
||||
*/
|
||||
static floperr_t ti99_sdf_write_track(floppy_image *floppy, int head, int track, UINT64 offset, const void *buffer, size_t buflen)
|
||||
static floperr_t ti99_sdf_write_track(floppy_image_legacy *floppy, int head, int track, UINT64 offset, const void *buffer, size_t buflen)
|
||||
{
|
||||
int current_pos = 0;
|
||||
UINT8 *track_image;
|
||||
@ -763,7 +763,7 @@ static floperr_t ti99_sdf_write_track(floppy_image *floppy, int head, int track,
|
||||
sector 0 =
|
||||
sector 1 = 256* 0x00
|
||||
*/
|
||||
/* static floperr_t ti99_sdf_format_track(floppy_image *floppy, int head, int track, option_resolution *params)
|
||||
/* static floperr_t ti99_sdf_format_track(floppy_image_legacy *floppy, int head, int track, option_resolution *params)
|
||||
{
|
||||
UINT8 *sector0 = (UINT8*)malloc(SECTOR_SIZE);
|
||||
create_vib(sector0, params);
|
||||
@ -796,7 +796,7 @@ static floperr_t ti99_sdf_write_track(floppy_image *floppy, int head, int track,
|
||||
1-0
|
||||
Note that we take the imgtrack, which may be half of the drive track.
|
||||
*/
|
||||
static floperr_t ti99_sdf_get_offset(floppy_image *floppy, int head, int imgtrack, int sector, UINT64 *offset)
|
||||
static floperr_t ti99_sdf_get_offset(floppy_image_legacy *floppy, int head, int imgtrack, int sector, UINT64 *offset)
|
||||
{
|
||||
struct ti99dsk_tag *tag = (ti99dsk_tag*)floppy_tag(floppy);
|
||||
|
||||
@ -819,7 +819,7 @@ static floperr_t ti99_sdf_get_offset(floppy_image *floppy, int head, int imgtrac
|
||||
/*
|
||||
Read one sector at the specified position.
|
||||
*/
|
||||
static floperr_t ti99_sdf_read_sector(floppy_image *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
static floperr_t ti99_sdf_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
{
|
||||
floperr_t err;
|
||||
UINT64 offset;
|
||||
@ -846,7 +846,7 @@ static floperr_t ti99_sdf_read_sector(floppy_image *floppy, int head, int track,
|
||||
starting with the lowest numbered sector in each track. In other words,
|
||||
we have nothing to calculate here.
|
||||
*/
|
||||
static floperr_t ti99_sdf_read_indexed_sector(floppy_image *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
static floperr_t ti99_sdf_read_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
{
|
||||
return ti99_sdf_read_sector(floppy, head, track, sector, buffer, buflen);
|
||||
}
|
||||
@ -854,7 +854,7 @@ static floperr_t ti99_sdf_read_indexed_sector(floppy_image *floppy, int head, in
|
||||
/*
|
||||
Write one sector at the specified position.
|
||||
*/
|
||||
static floperr_t ti99_sdf_write_sector(floppy_image *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
static floperr_t ti99_sdf_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
{
|
||||
UINT64 offset;
|
||||
floperr_t err;
|
||||
@ -880,7 +880,7 @@ static floperr_t ti99_sdf_write_sector(floppy_image *floppy, int head, int track
|
||||
/*
|
||||
See above; indexing and numbering coincide.
|
||||
*/
|
||||
static floperr_t ti99_sdf_write_indexed_sector(floppy_image *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
static floperr_t ti99_sdf_write_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
{
|
||||
return ti99_sdf_write_sector(floppy, head, track, sector, buffer, buflen, ddam);
|
||||
}
|
||||
@ -888,7 +888,7 @@ static floperr_t ti99_sdf_write_indexed_sector(floppy_image *floppy, int head, i
|
||||
/*
|
||||
Required for ReadAddress command
|
||||
*/
|
||||
static floperr_t ti99_sdf_get_indexed_sector_info(floppy_image *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags)
|
||||
static floperr_t ti99_sdf_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags)
|
||||
{
|
||||
struct ti99dsk_tag *tag = (ti99dsk_tag*)floppy_tag(floppy);
|
||||
|
||||
@ -1222,7 +1222,7 @@ static int read_byte(int format, int first_idam, UINT8 *track, int position)
|
||||
/*
|
||||
Determine the position of this track in the image.
|
||||
*/
|
||||
static floperr_t ti99_tdf_get_offset(floppy_image *floppy, int head, int imgtrack, UINT64 *offset)
|
||||
static floperr_t ti99_tdf_get_offset(floppy_image_legacy *floppy, int head, int imgtrack, UINT64 *offset)
|
||||
{
|
||||
struct ti99dsk_tag *tag = (ti99dsk_tag*)floppy_tag(floppy);
|
||||
|
||||
@ -1241,7 +1241,7 @@ static floperr_t ti99_tdf_get_offset(floppy_image *floppy, int head, int imgtrac
|
||||
the CRC if it is the "blank" CRC as F7F7.
|
||||
This method assumes that the track division be done already.
|
||||
*/
|
||||
static floperr_t ti99_tdf_read_track_internal(floppy_image *floppy, int head, int imgtrack, UINT64 offset, void *buffer, size_t buflen)
|
||||
static floperr_t ti99_tdf_read_track_internal(floppy_image_legacy *floppy, int head, int imgtrack, UINT64 offset, void *buffer, size_t buflen)
|
||||
{
|
||||
floperr_t err;
|
||||
UINT64 track_offset;
|
||||
@ -1300,7 +1300,7 @@ static floperr_t ti99_tdf_read_track_internal(floppy_image *floppy, int head, in
|
||||
Reads a track. We just copy the contents from the format, without
|
||||
changes.
|
||||
*/
|
||||
static floperr_t ti99_tdf_read_track(floppy_image *floppy, int head, int track, UINT64 offset, void *buffer, size_t buflen)
|
||||
static floperr_t ti99_tdf_read_track(floppy_image_legacy *floppy, int head, int track, UINT64 offset, void *buffer, size_t buflen)
|
||||
{
|
||||
int imgtrack = track;
|
||||
|
||||
@ -1315,7 +1315,7 @@ static floperr_t ti99_tdf_read_track(floppy_image *floppy, int head, int track,
|
||||
/*
|
||||
Writes a track.
|
||||
*/
|
||||
static floperr_t ti99_tdf_write_track(floppy_image *floppy, int head, int track, UINT64 offset, const void *buffer, size_t buflen)
|
||||
static floperr_t ti99_tdf_write_track(floppy_image_legacy *floppy, int head, int track, UINT64 offset, const void *buffer, size_t buflen)
|
||||
{
|
||||
floperr_t err;
|
||||
UINT64 track_offset;
|
||||
@ -1339,7 +1339,7 @@ static floperr_t ti99_tdf_write_track(floppy_image *floppy, int head, int track,
|
||||
}
|
||||
|
||||
/*
|
||||
static floperr_t ti99_tdf_format_track(floppy_image *floppy, int head, int track, option_resolution *params)
|
||||
static floperr_t ti99_tdf_format_track(floppy_image_legacy *floppy, int head, int track, option_resolution *params)
|
||||
{
|
||||
int sectors;
|
||||
int sector_length;
|
||||
@ -1364,7 +1364,7 @@ static floperr_t ti99_tdf_format_track(floppy_image *floppy, int head, int track
|
||||
distinguish them from ordinary data, as we do not store the clock), we
|
||||
do not attempt to detect IDAM or DAM.
|
||||
*/
|
||||
static floperr_t ti99_tdf_seek_sector_in_track(floppy_image *floppy, int head, int track, int sector, UINT8 *track_data, UINT8 **sector_data)
|
||||
static floperr_t ti99_tdf_seek_sector_in_track(floppy_image_legacy *floppy, int head, int track, int sector, UINT8 *track_data, UINT8 **sector_data)
|
||||
{
|
||||
struct ti99dsk_tag *tag = (ti99dsk_tag*)floppy_tag(floppy);
|
||||
|
||||
@ -1411,7 +1411,7 @@ static floperr_t ti99_tdf_seek_sector_in_track(floppy_image *floppy, int head, i
|
||||
return FLOPPY_ERROR_SEEKERROR;
|
||||
}
|
||||
|
||||
static floperr_t ti99_tdf_read_sector(floppy_image *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
static floperr_t ti99_tdf_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
{
|
||||
floperr_t err;
|
||||
UINT8 *sector_data;
|
||||
@ -1445,7 +1445,7 @@ static floperr_t ti99_tdf_read_sector(floppy_image *floppy, int head, int track,
|
||||
may be used instead of this method, according to the implementation
|
||||
of flopimg/flopdrv.
|
||||
*/
|
||||
static floperr_t ti99_tdf_write_sector(floppy_image *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
static floperr_t ti99_tdf_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
{
|
||||
floperr_t err;
|
||||
UINT8 *sector_data;
|
||||
@ -1489,7 +1489,7 @@ static floperr_t ti99_tdf_write_sector(floppy_image *floppy, int head, int track
|
||||
return FLOPPY_ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
static floperr_t ti99_tdf_write_indexed_sector(floppy_image *floppy, int head, int track, int sector_index, const void *buffer, size_t buflen, int ddam)
|
||||
static floperr_t ti99_tdf_write_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector_index, const void *buffer, size_t buflen, int ddam)
|
||||
{
|
||||
/* Read track, head */
|
||||
int byte;
|
||||
@ -1594,7 +1594,7 @@ static floperr_t ti99_tdf_write_indexed_sector(floppy_image *floppy, int head, i
|
||||
}
|
||||
|
||||
|
||||
static floperr_t ti99_tdf_find_indexed_sector(floppy_image *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, void *buffer, unsigned long *flags)
|
||||
static floperr_t ti99_tdf_find_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, void *buffer, unsigned long *flags)
|
||||
{
|
||||
/* Read track, head */
|
||||
int byte = 0;
|
||||
@ -1699,12 +1699,12 @@ static floperr_t ti99_tdf_find_indexed_sector(floppy_image *floppy, int head, in
|
||||
sector (and so on) from the track, not sector 1, 2, 3. That is, the
|
||||
returned sector info depends on the interleave and the start sector.
|
||||
*/
|
||||
static floperr_t ti99_tdf_get_indexed_sector_info(floppy_image *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags)
|
||||
static floperr_t ti99_tdf_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags)
|
||||
{
|
||||
return ti99_tdf_find_indexed_sector(floppy, head, track, sector_index, cylinder, side, sector, sector_length, NULL, flags);
|
||||
}
|
||||
|
||||
static floperr_t ti99_tdf_read_indexed_sector(floppy_image *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
static floperr_t ti99_tdf_read_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
{
|
||||
return ti99_tdf_find_indexed_sector(floppy, head, track, sector, (int*)NULL, (int*)NULL, (int*)NULL, (UINT32*)NULL, buffer, (unsigned long*)NULL);
|
||||
}
|
||||
@ -1739,7 +1739,7 @@ static floperr_t ti99_tdf_read_indexed_sector(floppy_image *floppy, int head, in
|
||||
DSDD80 = 1099520
|
||||
DSHD80 = 2078720
|
||||
*/
|
||||
static int ti99_tdf_guess_geometry(floppy_image *floppy, UINT64 size,
|
||||
static int ti99_tdf_guess_geometry(floppy_image_legacy *floppy, UINT64 size,
|
||||
struct ti99dsk_geometry *geometry)
|
||||
{
|
||||
int idamcnt, state, track, head, i, totalseclen = 0, format = 0, byte, tracklength, trackadd = 0;
|
||||
|
@ -26,7 +26,7 @@ static FLOPPY_IDENTIFY( trs80_jv1_identify )
|
||||
}
|
||||
|
||||
|
||||
static UINT64 trs80_jv1_get_ddam(floppy_image *floppy, const struct basicdsk_geometry *geom, int track, int head, int sector)
|
||||
static UINT64 trs80_jv1_get_ddam(floppy_image_legacy *floppy, const struct basicdsk_geometry *geom, int track, int head, int sector)
|
||||
{
|
||||
// directory track is protected
|
||||
if ((track==17) && (head==0)) {
|
||||
|
@ -92,13 +92,13 @@ static const char needle_deleted_data_fa[] = "\x00\x00\x00\x00\x00\x00\x00\x00\x
|
||||
static const char needle_deleted_data_f8[] = "\x00\x00\x00\x00\x00\x00\x00\x00\xF8\xF8";
|
||||
|
||||
|
||||
static struct dmk_tag *get_dmk_tag(floppy_image *floppy)
|
||||
static struct dmk_tag *get_dmk_tag(floppy_image_legacy *floppy)
|
||||
{
|
||||
return (dmk_tag *)floppy_tag(floppy);
|
||||
}
|
||||
|
||||
|
||||
static floperr_t z80ne_dmk_get_track_offset(floppy_image *floppy, int head, int track, UINT64 *offset)
|
||||
static floperr_t z80ne_dmk_get_track_offset(floppy_image_legacy *floppy, int head, int track, UINT64 *offset)
|
||||
{
|
||||
struct dmk_tag *tag = get_dmk_tag(floppy);
|
||||
|
||||
@ -123,7 +123,7 @@ static UINT32 z80ne_dmk_min_track_size(int sectors, int sector_length)
|
||||
|
||||
|
||||
|
||||
static floperr_t z80ne_dmk_read_track(floppy_image *floppy, int head, int track, UINT64 offset, void *buffer, size_t buflen)
|
||||
static floperr_t z80ne_dmk_read_track(floppy_image_legacy *floppy, int head, int track, UINT64 offset, void *buffer, size_t buflen)
|
||||
{
|
||||
floperr_t err;
|
||||
UINT64 track_offset;
|
||||
@ -138,7 +138,7 @@ static floperr_t z80ne_dmk_read_track(floppy_image *floppy, int head, int track,
|
||||
|
||||
|
||||
|
||||
static floperr_t z80ne_dmk_write_track(floppy_image *floppy, int head, int track, UINT64 offset, const void *buffer, size_t buflen)
|
||||
static floperr_t z80ne_dmk_write_track(floppy_image_legacy *floppy, int head, int track, UINT64 offset, const void *buffer, size_t buflen)
|
||||
{
|
||||
floperr_t err;
|
||||
UINT64 track_offset;
|
||||
@ -153,14 +153,14 @@ static floperr_t z80ne_dmk_write_track(floppy_image *floppy, int head, int track
|
||||
|
||||
|
||||
|
||||
static floperr_t z80ne_dmk_get_track_data_offset(floppy_image *floppy, int head, int track, UINT64 *offset)
|
||||
static floperr_t z80ne_dmk_get_track_data_offset(floppy_image_legacy *floppy, int head, int track, UINT64 *offset)
|
||||
{
|
||||
*offset = DMK_TOC_LEN + 1;
|
||||
return FLOPPY_ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static floperr_t z80ne_dmk_format_track(floppy_image *floppy, int head, int track, option_resolution *params)
|
||||
static floperr_t z80ne_dmk_format_track(floppy_image_legacy *floppy, int head, int track, option_resolution *params)
|
||||
{
|
||||
int sectors;
|
||||
int sector_length;
|
||||
@ -338,21 +338,21 @@ done:
|
||||
|
||||
|
||||
|
||||
static int z80ne_dmk_get_heads_per_disk(floppy_image *floppy)
|
||||
static int z80ne_dmk_get_heads_per_disk(floppy_image_legacy *floppy)
|
||||
{
|
||||
return get_dmk_tag(floppy)->heads;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static int z80ne_dmk_get_tracks_per_disk(floppy_image *floppy)
|
||||
static int z80ne_dmk_get_tracks_per_disk(floppy_image_legacy *floppy)
|
||||
{
|
||||
return get_dmk_tag(floppy)->tracks;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static UINT32 z80ne_dmk_get_track_size(floppy_image *floppy, int head, int track)
|
||||
static UINT32 z80ne_dmk_get_track_size(floppy_image_legacy *floppy, int head, int track)
|
||||
{
|
||||
return get_dmk_tag(floppy)->track_size;
|
||||
}
|
||||
@ -381,7 +381,7 @@ static UINT8 * my_memmem(UINT8 *haystack, size_t haystacklen,
|
||||
|
||||
|
||||
|
||||
static floperr_t z80ne_dmk_seek_sector_in_track(floppy_image *floppy, int head, int track, int sector, int sector_is_index, int dirtify, UINT8 **sector_data, UINT32 *sector_length)
|
||||
static floperr_t z80ne_dmk_seek_sector_in_track(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, int dirtify, UINT8 **sector_data, UINT32 *sector_length)
|
||||
{
|
||||
struct dmk_tag *tag = get_dmk_tag(floppy);
|
||||
floperr_t err;
|
||||
@ -521,14 +521,14 @@ done:
|
||||
|
||||
|
||||
|
||||
static floperr_t z80ne_dmk_get_sector_length(floppy_image *floppy, int head, int track, int sector, UINT32 *sector_length)
|
||||
static floperr_t z80ne_dmk_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length)
|
||||
{
|
||||
return z80ne_dmk_seek_sector_in_track(floppy, head, track, sector, FALSE, FALSE, NULL, sector_length);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static floperr_t z80ne_dmk_get_indexed_sector_info(floppy_image *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags)
|
||||
static floperr_t z80ne_dmk_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags)
|
||||
{
|
||||
floperr_t err;
|
||||
size_t idam_offset;
|
||||
@ -580,7 +580,7 @@ static floperr_t z80ne_dmk_get_indexed_sector_info(floppy_image *floppy, int hea
|
||||
|
||||
|
||||
|
||||
static floperr_t internal_z80ne_dmk_read_sector(floppy_image *floppy, int head, int track, int sector, int sector_is_index, void *buffer, size_t buflen)
|
||||
static floperr_t internal_z80ne_dmk_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, void *buffer, size_t buflen)
|
||||
{
|
||||
floperr_t err;
|
||||
UINT32 sector_length;
|
||||
@ -636,7 +636,7 @@ static floperr_t internal_z80ne_dmk_read_sector(floppy_image *floppy, int head,
|
||||
|
||||
|
||||
|
||||
static floperr_t internal_z80ne_dmk_write_sector(floppy_image *floppy, int head, int track, int sector, int sector_is_index, const void *buffer, size_t buflen, int ddam)
|
||||
static floperr_t internal_z80ne_dmk_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, const void *buffer, size_t buflen, int ddam)
|
||||
{
|
||||
floperr_t err;
|
||||
UINT32 sector_length;
|
||||
@ -693,29 +693,29 @@ static floperr_t internal_z80ne_dmk_write_sector(floppy_image *floppy, int head,
|
||||
|
||||
|
||||
|
||||
static floperr_t z80ne_dmk_read_sector(floppy_image *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
static floperr_t z80ne_dmk_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
{
|
||||
return internal_z80ne_dmk_read_sector(floppy, head, track, sector, FALSE, buffer, buflen);
|
||||
}
|
||||
|
||||
static floperr_t z80ne_dmk_write_sector(floppy_image *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
static floperr_t z80ne_dmk_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
{
|
||||
return internal_z80ne_dmk_write_sector(floppy, head, track, sector, FALSE, buffer, buflen, ddam);
|
||||
}
|
||||
|
||||
static floperr_t z80ne_dmk_read_indexed_sector(floppy_image *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
static floperr_t z80ne_dmk_read_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
|
||||
{
|
||||
return internal_z80ne_dmk_read_sector(floppy, head, track, sector, TRUE, buffer, buflen);
|
||||
}
|
||||
|
||||
static floperr_t z80ne_dmk_write_indexed_sector(floppy_image *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
static floperr_t z80ne_dmk_write_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
|
||||
{
|
||||
return internal_z80ne_dmk_write_sector(floppy, head, track, sector, TRUE, buffer, buflen, ddam);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void z80ne_dmk_interpret_header(floppy_image *floppy, int *heads, int *tracks, int * sectors, int *track_size)
|
||||
static void z80ne_dmk_interpret_header(floppy_image_legacy *floppy, int *heads, int *tracks, int * sectors, int *track_size)
|
||||
{
|
||||
UINT8 header[DMK_HEADER_LEN + DMK_TOC_LEN];
|
||||
int i;
|
||||
|
Loading…
Reference in New Issue
Block a user