summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/formats/flex_dsk.h
diff options
context:
space:
mode:
author 68bit <info@68bit.org>2020-02-04 16:14:07 +1100
committer 68bit <info@68bit.org>2020-02-08 00:12:05 +1100
commita87c3b6f7a988271974d38d0fd445a85dde7c09b (patch)
tree98a5ac7cd3daa9bd9bfbef03b60f5ba0c07cce37 /src/lib/formats/flex_dsk.h
parent927906163401b32433f18d2d92c72f196bc1f7f8 (diff)
wd177x_dsk: generalize to allow custom track format variations
Add a get_track_format() method that can be overridden to supply format variations for any track and head. The code is generalised to account for such variations. The default method returns the passed format, so this change is neutral for existing formats. Simplify the FLEX DSK format code. There are now simply format variation descriptions for the second track that have the sector ID continuing in sequence from the first track, rather than specialized code. Extend the FLEX format to support variations in the sectors ID of the first two sectors. The FLEX 6800 boot sectors have IDs based at zero rather than one. Extend the FLEX format to support variations for which the first track, on both sides, is single density on an otherwise double density disk which was historically a common format. Extend the OS9 disk format to support variations for which the first track, on only the first side, is single density on an otherwise double density disk. OS9 for the SWTPC and Gimix typically used such formats. Extend the OS9 disk format to support variations with a base sector ID of zero in contrast to the existing COCO OS9 format which uses a based sector ID of one. The OS9 format identification code is extended to rely on the optional information stored in the OS9 LSN0 header to identify COCO format disks, and all COCO format disks appear to have this optional information in a regular enough format.
Diffstat (limited to 'src/lib/formats/flex_dsk.h')
-rw-r--r--src/lib/formats/flex_dsk.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/formats/flex_dsk.h b/src/lib/formats/flex_dsk.h
index 3c61bdd4243..628da71178c 100644
--- a/src/lib/formats/flex_dsk.h
+++ b/src/lib/formats/flex_dsk.h
@@ -21,10 +21,8 @@ public:
virtual const char *name() const override;
virtual const char *description() const override;
virtual const char *extensions() const override;
- virtual int identify(io_generic *io, uint32_t form_factor) override;
virtual int find_size(io_generic *io, uint32_t form_factor) override;
- virtual void build_sector_description(const format &f, uint8_t *sectdata, desc_s *sectors, int track, int head) const override;
- virtual void check_compatibility(floppy_image *image, std::vector<int> &candidates) override;
+ virtual const wd177x_format::format &get_track_format(const format &f, int head, int track) override;
private:
struct sysinfo_sector
@@ -46,6 +44,9 @@ private:
uint8_t unused2[216];
} info;
static const format formats[];
+ static const format formats_head1[];
+ static const format formats_track0[];
+ static const format formats_head1_track0[];
uint8_t boot0_sector_id;
uint8_t boot1_sector_id;