summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/formats
diff options
context:
space:
mode:
author 68bit <info@68bit.org>2020-02-09 10:35:25 +1100
committer 68bit <info@68bit.org>2020-02-09 11:45:52 +1100
commit17f30b20f2123cb56b29ee10cb11004b709b50e7 (patch)
tree599f3259122aec2e73a8ad3cac610dbf10fb0c94 /src/lib/formats
parente2ed5d10085861af5cee459fd85ab49e280fe09b (diff)
flex_dsk: include an identify() method.
It is necessary to return a higher score on success, higher than returned by the default method, in order for a general 'identify' to succeed over competitive matches.
Diffstat (limited to 'src/lib/formats')
-rw-r--r--src/lib/formats/flex_dsk.cpp9
-rw-r--r--src/lib/formats/flex_dsk.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/src/lib/formats/flex_dsk.cpp b/src/lib/formats/flex_dsk.cpp
index 5944c1ca3bd..ee3750b6101 100644
--- a/src/lib/formats/flex_dsk.cpp
+++ b/src/lib/formats/flex_dsk.cpp
@@ -71,6 +71,15 @@ const char *flex_format::extensions() const
return "dsk";
}
+int flex_format::identify(io_generic *io, uint32_t form_factor)
+{
+ int type = find_size(io, form_factor);
+
+ if (type != -1)
+ return 75;
+ return 0;
+}
+
int flex_format::find_size(io_generic *io, uint32_t form_factor)
{
uint64_t size = io_generic_size(io);
diff --git a/src/lib/formats/flex_dsk.h b/src/lib/formats/flex_dsk.h
index 628da71178c..9df0d1b24b8 100644
--- a/src/lib/formats/flex_dsk.h
+++ b/src/lib/formats/flex_dsk.h
@@ -21,6 +21,7 @@ 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 const wd177x_format::format &get_track_format(const format &f, int head, int track) override;