summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/formats/os9_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/os9_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/os9_dsk.h')
-rw-r--r--src/lib/formats/os9_dsk.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/formats/os9_dsk.h b/src/lib/formats/os9_dsk.h
index 47f3521f85d..338e290e07b 100644
--- a/src/lib/formats/os9_dsk.h
+++ b/src/lib/formats/os9_dsk.h
@@ -1,5 +1,5 @@
// license:BSD-3-Clause
-// copyright-holders:tim lindner
+// copyright-holders:tim lindner, 68bit
/*********************************************************************
formats/os9_dsk.h
@@ -18,14 +18,16 @@ class os9_format : public wd177x_format {
public:
os9_format();
- virtual int identify(io_generic *io, uint32_t form_factor) override;
- virtual int find_size(io_generic *io, uint32_t form_factor) override;
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 const wd177x_format::format &get_track_format(const format &f, int head, int track) override;
private:
static const format formats[];
+ static const format formats_track0[];
};
extern const floppy_format_type FLOPPY_OS9_FORMAT;