From f1ab5c69a6bb06d83a302772ed682f3674fc6852 Mon Sep 17 00:00:00 2001 From: cracyc Date: Wed, 21 Aug 2013 13:40:43 +0000 Subject: [PATCH] (mess) support raw compis images (nw) --- src/lib/formats/cpis_dsk.c | 94 ++++++++++++++++++++++++++++++++++++++ src/lib/formats/cpis_dsk.h | 17 +++++++ src/mess/drivers/compis.c | 19 ++++++-- 3 files changed, 126 insertions(+), 4 deletions(-) diff --git a/src/lib/formats/cpis_dsk.c b/src/lib/formats/cpis_dsk.c index f355e024580..f42dec457d0 100644 --- a/src/lib/formats/cpis_dsk.c +++ b/src/lib/formats/cpis_dsk.c @@ -91,3 +91,97 @@ LEGACY_FLOPPY_OPTIONS_START( compis ) TRACKS(40/[80]) SECTORS(8/[9]/15)) LEGACY_FLOPPY_OPTIONS_END + + + + +/*************************************************************************** + + Copyright Olivier Galibert + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name 'MAME' nor the names of its contributors may be + used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +****************************************************************************/ + +/********************************************************************* + + formats/cpis_dsk.c + + cpis format + +*********************************************************************/ + +#include "emu.h" +#include "formats/cpis_dsk.h" + +cpis_format::cpis_format() : upd765_format(formats) +{ +} + +const char *cpis_format::name() const +{ + return "cpis"; +} + +const char *cpis_format::description() const +{ + return "COMPIS disk image"; +} + +const char *cpis_format::extensions() const +{ + return "dsk,img"; +} + +// Unverified gap sizes +const cpis_format::format cpis_format::formats[] = { + { /* 320K 5 1/4 inch double density */ + floppy_image::FF_525, floppy_image::DSDD, floppy_image::MFM, + 2000, 8, 40, 2, 512, {}, 1, {}, 80, 50, 22, 80 + }, + { /* 360K 5 1/4 inch double density */ + floppy_image::FF_525, floppy_image::DSDD, floppy_image::MFM, + 2000, 9, 40, 2, 512, {}, 1, {}, 80, 50, 22, 80 + }, + { /* 640K 5 1/4 inch quad density - gaps unverified */ + floppy_image::FF_525, floppy_image::DSQD, floppy_image::MFM, + 2000, 8, 80, 2, 512, {}, 1, {}, 80, 50, 22, 80 + }, + { /* 720K 5 1/4 inch quad density - gaps unverified */ + floppy_image::FF_525, floppy_image::DSQD, floppy_image::MFM, + 2000, 9, 80, 2, 512, {}, 1, {}, 80, 50, 22, 80 + }, + { /* 1200K 5 1/4 inch quad density */ + floppy_image::FF_525, floppy_image::DSQD, floppy_image::MFM, + 1200, 15, 80, 2, 512, {}, 1, {}, 80, 50, 22, 84 + }, + {} +}; + +const floppy_format_type FLOPPY_CPIS_FORMAT = &floppy_image_format_creator; + diff --git a/src/lib/formats/cpis_dsk.h b/src/lib/formats/cpis_dsk.h index 4b654b5002e..002f5dd2e54 100644 --- a/src/lib/formats/cpis_dsk.h +++ b/src/lib/formats/cpis_dsk.h @@ -16,4 +16,21 @@ LEGACY_FLOPPY_OPTIONS_EXTERN(compis); + +#include "upd765_dsk.h" + +class cpis_format : public upd765_format { +public: + cpis_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_CPIS_FORMAT; + #endif /* CPIS_DSK_H */ diff --git a/src/mess/drivers/compis.c b/src/mess/drivers/compis.c index 7014a81509a..a3b89932f65 100644 --- a/src/mess/drivers/compis.c +++ b/src/mess/drivers/compis.c @@ -335,6 +335,17 @@ static const mm58274c_interface compis_mm58274c_interface = 1 /* first day of week */ }; +const floppy_format_type compis_floppy_formats[] = { + FLOPPY_D88_FORMAT, + FLOPPY_DFI_FORMAT, + FLOPPY_IMD_FORMAT, + FLOPPY_IPF_FORMAT, + FLOPPY_MFI_FORMAT, + FLOPPY_MFM_FORMAT, + FLOPPY_TD0_FORMAT, + FLOPPY_CPIS_FORMAT, + NULL +}; static SLOT_INTERFACE_START( compis_floppies ) SLOT_INTERFACE( "525qd", FLOPPY_525_QD ) SLOT_INTERFACE_END @@ -381,8 +392,8 @@ static MACHINE_CONFIG_START( compis, compis_state ) MCFG_I8251_ADD("uart", compis_usart_interface) MCFG_MM58274C_ADD("mm58274c", compis_mm58274c_interface) MCFG_I8272A_ADD("i8272a", true) - MCFG_FLOPPY_DRIVE_ADD("i8272a:0", compis_floppies, "525qd", floppy_image_device::default_floppy_formats) - MCFG_FLOPPY_DRIVE_ADD("i8272a:1", compis_floppies, "525qd", floppy_image_device::default_floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("i8272a:0", compis_floppies, "525qd", compis_floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("i8272a:1", compis_floppies, "525qd", compis_floppy_formats) MCFG_COMPIS_KEYBOARD_ADD(NULL) /* software lists */ @@ -422,8 +433,8 @@ static MACHINE_CONFIG_START( compis2, compis_state ) MCFG_I8251_ADD("uart", compis_usart_interface) MCFG_MM58274C_ADD("mm58274c", compis_mm58274c_interface) MCFG_I8272A_ADD("i8272a", true) - MCFG_FLOPPY_DRIVE_ADD("i8272a:0", compis_floppies, "525qd", floppy_image_device::default_floppy_formats) - MCFG_FLOPPY_DRIVE_ADD("i8272a:1", compis_floppies, "525qd", floppy_image_device::default_floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("i8272a:0", compis_floppies, "525qd", compis_floppy_formats) + MCFG_FLOPPY_DRIVE_ADD("i8272a:1", compis_floppies, "525qd", compis_floppy_formats) MCFG_COMPIS_KEYBOARD_ADD(NULL) /* software lists */