(MESS) pc: Added support for NASLite 1.72MB disk images. [Curt Coder]

This commit is contained in:
Curt Coder 2014-02-18 21:30:36 +00:00
parent 64d9280eb6
commit 2e7bf618a5
13 changed files with 174 additions and 11 deletions

2
.gitattributes vendored
View File

@ -2897,6 +2897,8 @@ src/lib/formats/mz_cas.c svneol=native#text/plain
src/lib/formats/mz_cas.h svneol=native#text/plain
src/lib/formats/nanos_dsk.c svneol=native#text/plain
src/lib/formats/nanos_dsk.h svneol=native#text/plain
src/lib/formats/naslite_dsk.c svneol=native#text/plain
src/lib/formats/naslite_dsk.h svneol=native#text/plain
src/lib/formats/nes_dsk.c svneol=native#text/plain
src/lib/formats/nes_dsk.h svneol=native#text/plain
src/lib/formats/orao_cas.c svneol=native#text/plain

View File

@ -2937,6 +2937,54 @@ Missing files come here
</part>
</software>
<software name="naslite">
<description>NASLite NAS Server Operating System (v1.x)</description>
<year>2004</year>
<publisher>Server Elements</publisher>
<part name="flop1" interface="floppy_3_5">
<feature name="part_id" value="NASLite-FTP v1.1" />
<dataarea name="flop" size="1763328">
<rom name="naslite-ftp-v1.1.img" size="1763328" crc="b8677a3f" sha1="f1b3b6e11ae0f6d2a6092fe3f7a59affebaf9468" offset="0" />
</dataarea>
</part>
<part name="flop2" interface="floppy_3_5">
<feature name="part_id" value="NASLite-FTPG v1.1" />
<dataarea name="flop" size="1763328">
<rom name="naslite-ftpg-v1.1.img" size="1763328" crc="cbe53dd4" sha1="ff4bb09ea4125597cbe055923111ae0219340fb8" offset="0" />
</dataarea>
</part>
<part name="flop3" interface="floppy_3_5">
<feature name="part_id" value="NASLite-NFS v1.0" />
<dataarea name="flop" size="1763328">
<rom name="naslite-nfs-v1.0.img" size="1763328" crc="4eb327ee" sha1="dea54f8373ef15bd4088c68ba4456c7f6381df07" offset="0" />
</dataarea>
</part>
<part name="flop4" interface="floppy_3_5">
<feature name="part_id" value="NASLite-NFSG v1.1" />
<dataarea name="flop" size="1763328">
<rom name="naslite-nfsg-v1.1.img" size="1763328" crc="a9290112" sha1="824ef40f29d638f78cb929d32a344ddbb1b6b6a0" offset="0" />
</dataarea>
</part>
<part name="flop5" interface="floppy_3_5">
<feature name="part_id" value="NASLite-SMB v1.3" />
<dataarea name="flop" size="1763328">
<rom name="naslite-smb-v1.3.img" size="1763328" crc="207ef71e" sha1="5b7814d700596223f812e17a1fe2ac1d716a9f23" offset="0" />
</dataarea>
</part>
<part name="flop6" interface="floppy_3_5">
<feature name="part_id" value="NASLite-SMBG v1.4" />
<dataarea name="flop" size="1763328">
<rom name="naslite-smbg-v1.4.img.img" size="1763328" crc="bfdbca0a" sha1="7a975040a2c50c20efa6f0fa63dc15f9f17338e2" offset="0" />
</dataarea>
</part>
</software>
<!-- Driver Disks -->
<software name="scrlmous">

View File

@ -62,4 +62,16 @@
</part>
</software>
<software name="nasfdu12">
<description>NASLite NAS Server Operating System (v1.x)</description>
<year>2004</year>
<publisher>Server Elements</publisher>
<part name="cdrom" interface="cdrom">
<diskarea name="cdrom">
<disk name="naslite-fdu-v1.2" sha1="cb996013c327fd6d5c323fd03f8e9c8061cb4820" />
</diskarea>
</part>
</software>
</softwarelist>

View File

@ -0,0 +1,54 @@
// license:BSD-3-Clause
// copyright-holders:Curt Coder
/*********************************************************************
formats/naslite_dsk.c
NASLite 1.72MB with funky interleaving format
*********************************************************************/
#include "emu.h"
#include "formats/naslite_dsk.h"
naslite_format::naslite_format() : upd765_format(formats)
{
}
const char *naslite_format::name() const
{
return "NASLite";
}
const char *naslite_format::description() const
{
return "NASLite disk image";
}
const char *naslite_format::extensions() const
{
return "img";
}
const naslite_format::format naslite_format::formats[] = {
{
floppy_image::FF_35, floppy_image::DSHD, floppy_image::MFM,
1000, 21, 82, 2, 512, {}, -1, { 0x01, 0x0c, 0x02, 0x0d, 0x03, 0x0e, 0x04, 0x0f, 0x05, 0x10, 0x06, 0x11, 0x07, 0x12, 0x08, 0x13, 0x09, 0x14, 0x0a, 0x15, 0x0b }, 80, 50, 22, 0xc
},
{}
};
void naslite_format::build_sector_description(const format &f, UINT8 *sectdata, desc_s *sectors, int track, int head) const
{
for(int i=0; i<f.sector_count; i++) {
int cur_offset = 0;
for(int j=0; j<f.sector_count; j++)
if(f.per_sector_id[j] < f.per_sector_id[i])
cur_offset += f.sector_base_size ? f.sector_base_size : f.per_sector_size[j];
sectors[i].data = sectdata + cur_offset;
sectors[i].size = f.sector_base_size ? f.sector_base_size : f.per_sector_size[i];
sectors[i].sector_id = f.per_sector_id[(i + (track * 0x0a) + (head * 0x11)) % f.sector_count];
}
}
const floppy_format_type FLOPPY_NASLITE_FORMAT = &floppy_image_format_creator<naslite_format>;

View File

@ -0,0 +1,32 @@
// license:BSD-3-Clause
// copyright-holders:Curt Coder
/*********************************************************************
formats/naslite_dsk.h
NASLite 1.72MB with funky interleaving format
*********************************************************************/
#ifndef NASLITE_DSK_H_
#define NASLITE_DSK_H_
#include "upd765_dsk.h"
class naslite_format : public upd765_format {
public:
naslite_format();
virtual const char *name() const;
virtual const char *description() const;
virtual const char *extensions() const;
protected:
static const format formats[];
virtual void build_sector_description(const format &d, UINT8 *sectdata, desc_s *sectors, int track, int head) const;
};
extern const floppy_format_type FLOPPY_NASLITE_FORMAT;
#endif

View File

@ -52,7 +52,7 @@ int upd765_format::compute_track_size(const format &f) const
return track_size;
}
void upd765_format::build_sector_description(const format &f, UINT8 *sectdata, desc_s *sectors) const
void upd765_format::build_sector_description(const format &f, UINT8 *sectdata, desc_s *sectors, int track, int head) const
{
if(f.sector_base_id == -1) {
for(int i=0; i<f.sector_count; i++) {
@ -210,10 +210,10 @@ bool upd765_format::load(io_generic *io, UINT32 form_factor, floppy_image *image
UINT8 sectdata[40*512];
desc_s sectors[40];
build_sector_description(f, sectdata, sectors);
for(int track=0; track < f.track_count; track++)
for(int head=0; head < f.head_count; head++) {
build_sector_description(f, sectdata, sectors, track, head);
io_generic_read(io, sectdata, (track*f.head_count + head)*track_size, track_size);
generate_track(desc, track, head, sectors, f.sector_count, total_size, image);
}
@ -333,14 +333,16 @@ bool upd765_format::save(io_generic *io, floppy_image *image)
UINT8 sectdata[40*512];
desc_s sectors[40];
build_sector_description(f, sectdata, sectors);
for(int track=0; track < f.track_count; track++)
for(int head=0; head < f.head_count; head++) {
build_sector_description(f, sectdata, sectors, track, head);
extract_sectors(image, f, sectors, track, head);
io_generic_write(io, sectdata, (track*f.head_count + head)*track_size, track_size);
}
global_free(candidates);
return true;
}

View File

@ -41,15 +41,17 @@ public:
virtual bool save(io_generic *io, floppy_image *image);
virtual bool supports_save() const;
private:
const format *formats;
protected:
floppy_image_format_t::desc_e* get_desc_fm(const format &f, int &current_size, int &end_gap_index);
floppy_image_format_t::desc_e* get_desc_mfm(const format &f, int &current_size, int &end_gap_index);
int find_size(io_generic *io, UINT32 form_factor);
int compute_track_size(const format &f) const;
void build_sector_description(const format &d, UINT8 *sectdata, desc_s *sectors) const;
virtual void build_sector_description(const format &d, UINT8 *sectdata, desc_s *sectors, int track, int head) const;
void check_compatibility(floppy_image *image, int *candidates, int &candidates_count);
void extract_sectors(floppy_image *image, const format &f, desc_s *sdesc, int track, int head);
private:
const format *formats;
};
#endif /* UPD765_DSK_H */

View File

@ -161,6 +161,7 @@ FORMATSOBJS = \
$(LIBOBJ)/formats/mfi_dsk.o \
$(LIBOBJ)/formats/mz_cas.o \
$(LIBOBJ)/formats/nanos_dsk.o \
$(LIBOBJ)/formats/naslite_dsk.o \
$(LIBOBJ)/formats/nes_dsk.o \
$(LIBOBJ)/formats/orao_cas.o \
$(LIBOBJ)/formats/oric_dsk.o \

View File

@ -575,6 +575,11 @@ static MACHINE_CONFIG_START( at386, at_state )
MCFG_RAM_DEFAULT_SIZE("1664K")
MCFG_RAM_EXTRA_OPTIONS("2M,4M,8M,15M,16M,32M,64M,128M,256M")
/* software lists */
MCFG_SOFTWARE_LIST_ADD("pc_disk_list","ibm5150")
MCFG_SOFTWARE_LIST_ADD("xt_disk_list","ibm5160_flop")
MCFG_SOFTWARE_LIST_ADD("at_disk_list","ibm5170")
MCFG_SOFTWARE_LIST_ADD("at_cdrom_list","ibm5170_cdrom")
MACHINE_CONFIG_END

View File

@ -90,7 +90,7 @@ video HW too.
#include "imagedev/harddriv.h"
#include "imagedev/cassette.h"
#include "imagedev/cartslot.h"
#include "formats/mfi_dsk.h"
#include "formats/naslite_dsk.h"
#include "formats/pc_dsk.h"
#include "formats/asst128_dsk.h"
@ -714,7 +714,8 @@ INPUT_PORTS_END
FLOPPY_FORMATS_MEMBER( pc_state::floppy_formats )
FLOPPY_PC_FORMAT
FLOPPY_PC_FORMAT,
FLOPPY_NASLITE_FORMAT
FLOPPY_FORMATS_END
FLOPPY_FORMATS_MEMBER( pc_state::asst128_formats )

View File

@ -9,11 +9,12 @@
#include "machine/pc_fdc.h"
#include "imagedev/flopdrv.h"
#include "formats/pc_dsk.h"
#include "formats/mfi_dsk.h"
#include "formats/naslite_dsk.h"
FLOPPY_FORMATS_MEMBER( isa8_fdc_device::floppy_formats )
FLOPPY_PC_FORMAT
FLOPPY_PC_FORMAT,
FLOPPY_NASLITE_FORMAT
FLOPPY_FORMATS_END
static SLOT_INTERFACE_START( pc_dd_floppies )

View File

@ -16,6 +16,7 @@
***************************************************************************/
#include "isa_mufdc.h"
#include "formats/naslite_dsk.h"
#include "formats/pc_dsk.h"
@ -32,7 +33,8 @@ const device_type ISA8_FDCMAG = &device_creator<fdcmag_device>;
//-------------------------------------------------
FLOPPY_FORMATS_MEMBER( mufdc_device::floppy_formats )
FLOPPY_PC_FORMAT
FLOPPY_PC_FORMAT,
FLOPPY_NASLITE_FORMAT
FLOPPY_FORMATS_END
static SLOT_INTERFACE_START( drives )

View File

@ -54,6 +54,7 @@ static floppy_format_type floppy_formats[] = {
FLOPPY_D88_FORMAT,
FLOPPY_PC_FORMAT,
FLOPPY_NASLITE_FORMAT,
FLOPPY_DC42_FORMAT,
FLOPPY_A216S_FORMAT,