summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib
diff options
context:
space:
mode:
author Robbbert <pac0446@bigpond.net.au>2015-10-19 13:33:27 +1100
committer Robbbert <pac0446@bigpond.net.au>2015-10-19 13:33:27 +1100
commitbc19234d3f7c53c2083d63adbb2311877dea8a90 (patch)
treef637f79a434ced2cac0aa30fe4254133d3c6313b /src/lib
parentfd5aaeee0c75a1efe36c2d7639c1b7744d0cb38f (diff)
Camputers Lynx: some work on floppy disk.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/formats/camplynx_dsk.c58
-rw-r--r--src/lib/formats/camplynx_dsk.h30
2 files changed, 88 insertions, 0 deletions
diff --git a/src/lib/formats/camplynx_dsk.c b/src/lib/formats/camplynx_dsk.c
new file mode 100644
index 00000000000..6bf87fe42b0
--- /dev/null
+++ b/src/lib/formats/camplynx_dsk.c
@@ -0,0 +1,58 @@
+// license:BSD-3-Clause
+// copyright-holders:Robbbert
+/*********************************************************************
+
+ formats/camplynx_dsk.c
+
+ Camputers Lynx disk image format
+
+ There is no inter-sector info on these disks. It is simply a
+ dump of the 512 bytes from each sector and track in order.
+
+ Extension is LDF as used by the Pale emulator
+
+ The disk is formatted with 512 bytes per sector, 10 sectors,
+ 6040 bytes per track. 200KB disks are single sided 40 tracks.
+ 800KB disks are double sided 80 tracks.
+
+ The numbers below are guesswork since there's no documentation.
+ Currently not working.
+
+*********************************************************************/
+
+#include <assert.h>
+
+#include "formats/camplynx_dsk.h"
+
+camplynx_format::camplynx_format() : wd177x_format(formats)
+{
+}
+
+const char *camplynx_format::name() const
+{
+ return "camplynx";
+}
+
+const char *camplynx_format::description() const
+{
+ return "Camputers Lynx disk image";
+}
+
+const char *camplynx_format::extensions() const
+{
+ return "ldf";
+}
+
+const camplynx_format::format camplynx_format::formats[] = {
+ { /* 200K 13cm double density single sided */
+ floppy_image::FF_525, floppy_image::SSDD, floppy_image::MFM,
+ 2000, 10, 40, 1, 512, {}, 1, {}, 100, 22, 30 // guesswork to stop it crashing
+ },
+ { /* 800K 13cm quad density double sided */
+ floppy_image::FF_525, floppy_image::DSQD, floppy_image::MFM,
+ 2000, 10, 80, 2, 512, {}, 1, {}, 100, 22, 30 // guesswork to stop it crashing
+ },
+ {}
+};
+
+const floppy_format_type FLOPPY_CAMPLYNX_FORMAT = &floppy_image_format_creator<camplynx_format>;
diff --git a/src/lib/formats/camplynx_dsk.h b/src/lib/formats/camplynx_dsk.h
new file mode 100644
index 00000000000..96efac0b60b
--- /dev/null
+++ b/src/lib/formats/camplynx_dsk.h
@@ -0,0 +1,30 @@
+// license:BSD-3-Clause
+// copyright-holders:Robbbert
+/*********************************************************************
+
+ formats/camplynx_dsk.h
+
+ Camputers Lynx disk image format
+
+*********************************************************************/
+
+#ifndef CAMPLYNX_DSK_H_
+#define CAMPLYNX_DSK_H_
+
+#include "wd177x_dsk.h"
+
+class camplynx_format : public wd177x_format {
+public:
+ camplynx_format();
+
+ virtual const char *name() const;
+ virtual const char *description() const;
+ virtual const char *extensions() const;
+
+private:
+ static const format formats[];
+};
+
+extern const floppy_format_type FLOPPY_CAMPLYNX_FORMAT;
+
+#endif