summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib
diff options
context:
space:
mode:
author Nigel Barnes <Pernod70@users.noreply.github.com>2015-12-29 19:51:53 +0000
committer Nigel Barnes <Pernod70@users.noreply.github.com>2015-12-29 21:28:57 +0000
commitbe27191a1aa308153e266f297cf53effc21adefa (patch)
tree274b541cc65f4dfe03b6ad027a323ebc96c08358 /src/lib
parentc5591b3010298a02f69d963c7e0a2d58afa32ade (diff)
bbc: added Torch computer (preliminary)
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/formats/bbc_dsk.cpp48
-rw-r--r--src/lib/formats/bbc_dsk.h16
2 files changed, 64 insertions, 0 deletions
diff --git a/src/lib/formats/bbc_dsk.cpp b/src/lib/formats/bbc_dsk.cpp
index 193ab435e69..8b39ed17b1f 100644
--- a/src/lib/formats/bbc_dsk.cpp
+++ b/src/lib/formats/bbc_dsk.cpp
@@ -352,7 +352,55 @@ const bbc_cpm_format::format bbc_cpm_format::formats[] =
{}
};
+
+bbc_cpn_format::bbc_cpn_format() : wd177x_format(formats)
+{
+}
+
+const char *bbc_cpn_format::name() const
+{
+ return "cpn";
+}
+
+const char *bbc_cpn_format::description() const
+{
+ return "Torch CPN disk image";
+}
+
+const char *bbc_cpn_format::extensions() const
+{
+ return "dsd";
+}
+
+int bbc_cpn_format::identify(io_generic *io, UINT32 form_factor)
+{
+ int type = find_size(io, form_factor);
+
+ if(type != -1)
+ return 50;
+ return 0;
+}
+
+int bbc_cpn_format::get_image_offset(const format &f, int head, int track)
+{
+ if (f.sector_base_id == -1)
+ return (track * f.head_count + head) * compute_track_size(f);
+ else
+ return (f.track_count * head + track) * compute_track_size(f);
+}
+
+const bbc_cpn_format::format bbc_cpn_format::formats[] =
+{
+ { // 400k 80 track double sided single density (interleaved) - gaps unverified
+ floppy_image::FF_525, floppy_image::DSQD, floppy_image::FM,
+ 4000, 10, 80, 2, 256, {}, -1, { 0,1,2,3,4,5,6,7,8,9 }, 40, 10, 10
+ },
+ {}
+};
+
+
const floppy_format_type FLOPPY_BBC_DFS_FORMAT = &floppy_image_format_creator<bbc_dfs_format>;
const floppy_format_type FLOPPY_BBC_ADFS_FORMAT = &floppy_image_format_creator<bbc_adfs_format>;
const floppy_format_type FLOPPY_BBC_DOS_FORMAT = &floppy_image_format_creator<bbc_dos_format>;
const floppy_format_type FLOPPY_BBC_CPM_FORMAT = &floppy_image_format_creator<bbc_cpm_format>;
+const floppy_format_type FLOPPY_BBC_CPN_FORMAT = &floppy_image_format_creator<bbc_cpn_format>;
diff --git a/src/lib/formats/bbc_dsk.h b/src/lib/formats/bbc_dsk.h
index 9378a25ec81..7801a636147 100644
--- a/src/lib/formats/bbc_dsk.h
+++ b/src/lib/formats/bbc_dsk.h
@@ -78,10 +78,26 @@ private:
static const format formats[];
};
+class bbc_cpn_format : public wd177x_format
+{
+public:
+ bbc_cpn_format();
+
+ virtual int identify(io_generic *io, UINT32 form_factor);
+ virtual int get_image_offset(const format &f, int head, int track);
+ 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_BBC_DFS_FORMAT;
extern const floppy_format_type FLOPPY_BBC_ADFS_FORMAT;
extern const floppy_format_type FLOPPY_BBC_DOS_FORMAT;
extern const floppy_format_type FLOPPY_BBC_CPM_FORMAT;
+extern const floppy_format_type FLOPPY_BBC_CPN_FORMAT;
#endif // __BBC_DSK_H__