From e4ea1303b344515c49ae451e0accc7f4a079d41e Mon Sep 17 00:00:00 2001 From: Nigel Barnes Date: Mon, 30 May 2016 01:58:14 +0100 Subject: [PATCH] e01: added acorn filestore floppy format and softlist --- hash/e01_flop.xml | 30 +++++++++++++++++ scripts/src/lib.lua | 2 ++ src/devices/bus/econet/e01.cpp | 11 +++++-- src/devices/bus/econet/e01.h | 3 ++ src/lib/formats/afs_dsk.cpp | 60 ++++++++++++++++++++++++++++++++++ src/lib/formats/afs_dsk.h | 37 +++++++++++++++++++++ 6 files changed, 140 insertions(+), 3 deletions(-) create mode 100644 hash/e01_flop.xml create mode 100644 src/lib/formats/afs_dsk.cpp create mode 100644 src/lib/formats/afs_dsk.h diff --git a/hash/e01_flop.xml b/hash/e01_flop.xml new file mode 100644 index 00000000000..c7dcdadd700 --- /dev/null +++ b/hash/e01_flop.xml @@ -0,0 +1,30 @@ + + + + + + + + + FileStore Initial Disc + 198? + Acorn + + + + + + + + + FileStore Utility Disc + 198? + Acorn + + + + + + + + diff --git a/scripts/src/lib.lua b/scripts/src/lib.lua index 080aa707153..77f6f4344dd 100644 --- a/scripts/src/lib.lua +++ b/scripts/src/lib.lua @@ -145,6 +145,8 @@ project "formats" MAME_DIR .. "src/lib/formats/adam_cas.h", MAME_DIR .. "src/lib/formats/adam_dsk.cpp", MAME_DIR .. "src/lib/formats/adam_dsk.h", + MAME_DIR .. "src/lib/formats/afs_dsk.cpp", + MAME_DIR .. "src/lib/formats/afs_dsk.h", MAME_DIR .. "src/lib/formats/ami_dsk.cpp", MAME_DIR .. "src/lib/formats/ami_dsk.h", MAME_DIR .. "src/lib/formats/ap2_dsk.cpp", diff --git a/src/devices/bus/econet/e01.cpp b/src/devices/bus/econet/e01.cpp index ed60ccc2d28..6176268d6d7 100644 --- a/src/devices/bus/econet/e01.cpp +++ b/src/devices/bus/econet/e01.cpp @@ -53,7 +53,7 @@ #include "e01.h" #include "bus/scsi/scsihd.h" - +#include "softlist.h" //************************************************************************** @@ -166,6 +166,10 @@ WRITE_LINE_MEMBER( e01_device::clk_en_w ) m_clk_en = state; } +FLOPPY_FORMATS_MEMBER( floppy_formats_afs ) + FLOPPY_AFS_FORMAT +FLOPPY_FORMATS_END0 + static SLOT_INTERFACE_START( e01_floppies ) SLOT_INTERFACE( "35dd", FLOPPY_35_DD ) // NEC FD1036 A SLOT_INTERFACE_END @@ -253,8 +257,9 @@ static MACHINE_CONFIG_FRAGMENT( e01 ) MCFG_WD2793_ADD(WD2793_TAG, XTAL_8MHz/4) MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(e01_device, fdc_irq_w)) MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(e01_device, fdc_drq_w)) - MCFG_FLOPPY_DRIVE_ADD(WD2793_TAG":0", e01_floppies, "35dd", floppy_image_device::default_floppy_formats) - MCFG_FLOPPY_DRIVE_ADD(WD2793_TAG":1", e01_floppies, "35dd", floppy_image_device::default_floppy_formats) + MCFG_FLOPPY_DRIVE_ADD(WD2793_TAG":0", e01_floppies, "35dd", floppy_formats_afs) + MCFG_FLOPPY_DRIVE_ADD(WD2793_TAG":1", e01_floppies, "35dd", floppy_formats_afs) + MCFG_SOFTWARE_LIST_ADD("flop_ls_e01", "e01_flop") MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_devices, "printer") MCFG_CENTRONICS_ACK_HANDLER(DEVWRITELINE(R6522_TAG, via6522_device, write_ca1)) diff --git a/src/devices/bus/econet/e01.h b/src/devices/bus/econet/e01.h index e83b9a0b6bd..02a432c936d 100644 --- a/src/devices/bus/econet/e01.h +++ b/src/devices/bus/econet/e01.h @@ -22,6 +22,7 @@ #include "machine/mc6854.h" #include "machine/ram.h" #include "machine/wd_fdc.h" +#include "formats/afs_dsk.h" class e01_device : public device_t, public device_econet_interface @@ -37,6 +38,8 @@ public: TYPE_E01S }; + DECLARE_FLOPPY_FORMATS(floppy_formats_afs); + DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); DECLARE_READ8_MEMBER( ram_select_r ); diff --git a/src/lib/formats/afs_dsk.cpp b/src/lib/formats/afs_dsk.cpp new file mode 100644 index 00000000000..5e1ff5aa66c --- /dev/null +++ b/src/lib/formats/afs_dsk.cpp @@ -0,0 +1,60 @@ +// license:GPL-2.0+ +// copyright-holders:Nigel Barnes +/*************************************************************************** + + Acorn FileStore + + Disk image formats + +***************************************************************************/ + +#include "afs_dsk.h" + + +afs_format::afs_format() : wd177x_format(formats) +{ +} + +const char *afs_format::name() const +{ + return "afs"; +} + +const char *afs_format::description() const +{ + return "Acorn FileStore disk image"; +} + +const char *afs_format::extensions() const +{ + return "adl,img"; +} + +int afs_format::identify(io_generic *io, UINT32 form_factor) +{ + int type = find_size(io, form_factor); + + if (type != -1) + return 50; + return 0; +} + +int afs_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 afs_format::format afs_format::formats[] = +{ + { // 640K 3 1/2 inch 80 track double sided double density (interleaved) - gaps unverified + floppy_image::FF_35, floppy_image::DSQD, floppy_image::MFM, + 2000, 16, 80, 2, 256, {}, -1, { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 }, 60, 22, 43 + }, + {} +}; + + +const floppy_format_type FLOPPY_AFS_FORMAT = &floppy_image_format_creator; diff --git a/src/lib/formats/afs_dsk.h b/src/lib/formats/afs_dsk.h new file mode 100644 index 00000000000..e8e7190f7cd --- /dev/null +++ b/src/lib/formats/afs_dsk.h @@ -0,0 +1,37 @@ +// license:GPL-2.0+ +// copyright-holders:Nigel Barnes +/*************************************************************************** + + Acorn FileStore + + Disk image formats + +***************************************************************************/ + +#pragma once + +#ifndef __AFS_DSK_H__ +#define __AFS_DSK_H__ + +#include "wd177x_dsk.h" + + +class afs_format : public wd177x_format +{ +public: + afs_format(); + + virtual int identify(io_generic *io, UINT32 form_factor) override; + virtual int get_image_offset(const format &f, int head, int track) override; + virtual const char *name() const override; + virtual const char *description() const override; + virtual const char *extensions() const override; + +private: + static const format formats[]; +}; + + +extern const floppy_format_type FLOPPY_AFS_FORMAT; + +#endif // __AFS_DSK_H__