mirror of
https://github.com/holub/mame
synced 2025-06-05 12:26:35 +03:00
Floppy format API refinements
- Add noexcept to format information overrides and several simple floppy_image accessors. - Be more const-correct and use references instead of raw pointers wherever applicable. In particular, floppy_image_device::load and floppy_image_device::save now take a reference to floppy_image rather than a pointer, const-qualified in the latter case.
This commit is contained in:
parent
db48a71d4f
commit
07b3bdd04f
@ -415,7 +415,7 @@ void floppy_image_device::commit_image()
|
||||
if (err)
|
||||
popmessage("Error, unable to truncate image: %s", err.message());
|
||||
|
||||
output_format->save(*io, variants, image.get());
|
||||
output_format->save(*io, variants, *image);
|
||||
}
|
||||
|
||||
void floppy_image_device::device_config_complete()
|
||||
@ -609,7 +609,7 @@ std::pair<std::error_condition, std::string> floppy_image_device::call_load()
|
||||
return std::make_pair(image_error::INVALIDIMAGE, "Unable to identify image file format");
|
||||
|
||||
image = std::make_unique<floppy_image>(tracks, sides, form_factor);
|
||||
if (!best_format->load(*io, form_factor, variants, image.get())) {
|
||||
if (!best_format->load(*io, form_factor, variants, *image)) {
|
||||
image.reset();
|
||||
return std::make_pair(image_error::INVALIDIMAGE, "Incompatible image file format or corrupted data");
|
||||
}
|
||||
@ -833,7 +833,7 @@ void floppy_image_device::init_fs(const fs_info *fs, const fs::meta_data &meta)
|
||||
cfs->format(meta);
|
||||
|
||||
auto io = util::ram_read(img.data(), img.size(), 0xff);
|
||||
fs->m_type->load(*io, floppy_image::FF_UNKNOWN, variants, image.get());
|
||||
fs->m_type->load(*io, floppy_image::FF_UNKNOWN, variants, *image);
|
||||
} else {
|
||||
fs::unformatted_image::format(fs->m_key, image.get());
|
||||
}
|
||||
|
@ -14,17 +14,17 @@ _2d_format::_2d_format() : wd177x_format(formats)
|
||||
{
|
||||
}
|
||||
|
||||
const char *_2d_format::name() const
|
||||
const char *_2d_format::name() const noexcept
|
||||
{
|
||||
return "2d";
|
||||
}
|
||||
|
||||
const char *_2d_format::description() const
|
||||
const char *_2d_format::description() const noexcept
|
||||
{
|
||||
return "2D disk image";
|
||||
}
|
||||
|
||||
const char *_2d_format::extensions() const
|
||||
const char *_2d_format::extensions() const noexcept
|
||||
{
|
||||
return "2d";
|
||||
}
|
||||
|
@ -19,9 +19,9 @@ class _2d_format : public wd177x_format
|
||||
public:
|
||||
_2d_format();
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
|
||||
private:
|
||||
static const format formats[];
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:Olivier Galibert
|
||||
/*********************************************************************
|
||||
|
||||
formats/a5105_dsk.c
|
||||
formats/a5105_dsk.cpp
|
||||
|
||||
a5105 format
|
||||
|
||||
@ -14,17 +14,17 @@ a5105_format::a5105_format() : upd765_format(formats)
|
||||
{
|
||||
}
|
||||
|
||||
const char *a5105_format::name() const
|
||||
const char *a5105_format::name() const noexcept
|
||||
{
|
||||
return "a5105";
|
||||
}
|
||||
|
||||
const char *a5105_format::description() const
|
||||
const char *a5105_format::description() const noexcept
|
||||
{
|
||||
return "A5105 disk image";
|
||||
}
|
||||
|
||||
const char *a5105_format::extensions() const
|
||||
const char *a5105_format::extensions() const noexcept
|
||||
{
|
||||
return "img";
|
||||
}
|
||||
|
@ -19,9 +19,9 @@ class a5105_format : public upd765_format
|
||||
public:
|
||||
a5105_format();
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
|
||||
private:
|
||||
static const format formats[];
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:Curt Coder
|
||||
/*********************************************************************
|
||||
|
||||
formats/abc1600_dsk.c
|
||||
formats/abc1600_dsk.cpp
|
||||
|
||||
Luxor ABC 1600 disk image formats
|
||||
|
||||
@ -14,17 +14,17 @@ abc1600_format::abc1600_format() : wd177x_format(formats)
|
||||
{
|
||||
}
|
||||
|
||||
const char *abc1600_format::name() const
|
||||
const char *abc1600_format::name() const noexcept
|
||||
{
|
||||
return "abc1600";
|
||||
}
|
||||
|
||||
const char *abc1600_format::description() const
|
||||
const char *abc1600_format::description() const noexcept
|
||||
{
|
||||
return "Luxor ABC 1600 disk image";
|
||||
}
|
||||
|
||||
const char *abc1600_format::extensions() const
|
||||
const char *abc1600_format::extensions() const noexcept
|
||||
{
|
||||
return "img";
|
||||
}
|
||||
|
@ -19,9 +19,9 @@ class abc1600_format : public wd177x_format
|
||||
public:
|
||||
abc1600_format();
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
|
||||
protected:
|
||||
virtual int get_image_offset(const format &f, int head, int track) const override;
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:Curt Coder
|
||||
/*********************************************************************
|
||||
|
||||
formats/abc800_dsk.c
|
||||
formats/abc800_dsk.cpp
|
||||
|
||||
Luxor ABC 830/832/834/838 disk image formats
|
||||
|
||||
@ -14,17 +14,17 @@ abc800_format::abc800_format() : wd177x_format(formats)
|
||||
{
|
||||
}
|
||||
|
||||
const char *abc800_format::name() const
|
||||
const char *abc800_format::name() const noexcept
|
||||
{
|
||||
return "abc800";
|
||||
}
|
||||
|
||||
const char *abc800_format::description() const
|
||||
const char *abc800_format::description() const noexcept
|
||||
{
|
||||
return "Luxor ABC 830/832/834/838 disk image";
|
||||
}
|
||||
|
||||
const char *abc800_format::extensions() const
|
||||
const char *abc800_format::extensions() const noexcept
|
||||
{
|
||||
return "img";
|
||||
}
|
||||
|
@ -19,9 +19,9 @@ class abc800_format : public wd177x_format
|
||||
public:
|
||||
abc800_format();
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
|
||||
protected:
|
||||
virtual int get_image_offset(const format &f, int head, int track) const override;
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:Curt Coder
|
||||
/*********************************************************************
|
||||
|
||||
formats/abc800i_dsk.c
|
||||
formats/abc800i_dsk.cpp
|
||||
|
||||
Luxor ABC 830 interleaved disk image formats
|
||||
|
||||
@ -17,17 +17,17 @@ abc800i_format::abc800i_format() : wd177x_format(formats)
|
||||
{
|
||||
}
|
||||
|
||||
const char *abc800i_format::name() const
|
||||
const char *abc800i_format::name() const noexcept
|
||||
{
|
||||
return "abc800i";
|
||||
}
|
||||
|
||||
const char *abc800i_format::description() const
|
||||
const char *abc800i_format::description() const noexcept
|
||||
{
|
||||
return "Luxor ABC 830 interleaved disk image";
|
||||
}
|
||||
|
||||
const char *abc800i_format::extensions() const
|
||||
const char *abc800i_format::extensions() const noexcept
|
||||
{
|
||||
return "dsk";
|
||||
}
|
||||
|
@ -19,9 +19,9 @@ class abc800i_format : public wd177x_format
|
||||
public:
|
||||
abc800i_format();
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
|
||||
virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants) const override;
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:Curt Coder
|
||||
/*********************************************************************
|
||||
|
||||
formats/abcfd2_dsk.c
|
||||
formats/abcfd2_dsk.cpp
|
||||
|
||||
Scandia Metric ABC FD2 disk image formats
|
||||
|
||||
@ -14,17 +14,17 @@ abc_fd2_format::abc_fd2_format() : wd177x_format(formats)
|
||||
{
|
||||
}
|
||||
|
||||
const char *abc_fd2_format::name() const
|
||||
const char *abc_fd2_format::name() const noexcept
|
||||
{
|
||||
return "abc_fd2";
|
||||
}
|
||||
|
||||
const char *abc_fd2_format::description() const
|
||||
const char *abc_fd2_format::description() const noexcept
|
||||
{
|
||||
return "Scandia Metric ABC FD2 disk image";
|
||||
}
|
||||
|
||||
const char *abc_fd2_format::extensions() const
|
||||
const char *abc_fd2_format::extensions() const noexcept
|
||||
{
|
||||
return "dsk";
|
||||
}
|
||||
|
@ -19,9 +19,9 @@ class abc_fd2_format : public wd177x_format
|
||||
public:
|
||||
abc_fd2_format();
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
|
||||
private:
|
||||
static const format formats[];
|
||||
|
@ -22,17 +22,17 @@ acorn_ssd_format::acorn_ssd_format() : wd177x_format(formats)
|
||||
{
|
||||
}
|
||||
|
||||
const char *acorn_ssd_format::name() const
|
||||
const char *acorn_ssd_format::name() const noexcept
|
||||
{
|
||||
return "ssd";
|
||||
}
|
||||
|
||||
const char *acorn_ssd_format::description() const
|
||||
const char *acorn_ssd_format::description() const noexcept
|
||||
{
|
||||
return "Acorn SSD disk image";
|
||||
}
|
||||
|
||||
const char *acorn_ssd_format::extensions() const
|
||||
const char *acorn_ssd_format::extensions() const noexcept
|
||||
{
|
||||
return "ssd,bbc,img";
|
||||
}
|
||||
@ -167,17 +167,17 @@ acorn_dsd_format::acorn_dsd_format() : wd177x_format(formats)
|
||||
{
|
||||
}
|
||||
|
||||
const char *acorn_dsd_format::name() const
|
||||
const char *acorn_dsd_format::name() const noexcept
|
||||
{
|
||||
return "dsd";
|
||||
}
|
||||
|
||||
const char *acorn_dsd_format::description() const
|
||||
const char *acorn_dsd_format::description() const noexcept
|
||||
{
|
||||
return "Acorn DSD disk image";
|
||||
}
|
||||
|
||||
const char *acorn_dsd_format::extensions() const
|
||||
const char *acorn_dsd_format::extensions() const noexcept
|
||||
{
|
||||
return "dsd";
|
||||
}
|
||||
@ -278,17 +278,17 @@ opus_ddos_format::opus_ddos_format() : wd177x_format(formats)
|
||||
{
|
||||
}
|
||||
|
||||
const char *opus_ddos_format::name() const
|
||||
const char *opus_ddos_format::name() const noexcept
|
||||
{
|
||||
return "ddos";
|
||||
}
|
||||
|
||||
const char *opus_ddos_format::description() const
|
||||
const char *opus_ddos_format::description() const noexcept
|
||||
{
|
||||
return "Opus DDOS disk image";
|
||||
}
|
||||
|
||||
const char *opus_ddos_format::extensions() const
|
||||
const char *opus_ddos_format::extensions() const noexcept
|
||||
{
|
||||
return "dds";
|
||||
}
|
||||
@ -376,17 +376,17 @@ acorn_adfs_old_format::acorn_adfs_old_format() : wd177x_format(formats)
|
||||
{
|
||||
}
|
||||
|
||||
const char *acorn_adfs_old_format::name() const
|
||||
const char *acorn_adfs_old_format::name() const noexcept
|
||||
{
|
||||
return "adfs_o";
|
||||
}
|
||||
|
||||
const char *acorn_adfs_old_format::description() const
|
||||
const char *acorn_adfs_old_format::description() const noexcept
|
||||
{
|
||||
return "Acorn ADFS (OldMap) disk image";
|
||||
}
|
||||
|
||||
const char *acorn_adfs_old_format::extensions() const
|
||||
const char *acorn_adfs_old_format::extensions() const noexcept
|
||||
{
|
||||
return "adf,ads,adm,adl";
|
||||
}
|
||||
@ -474,17 +474,17 @@ acorn_adfs_new_format::acorn_adfs_new_format() : wd177x_format(formats)
|
||||
{
|
||||
}
|
||||
|
||||
const char *acorn_adfs_new_format::name() const
|
||||
const char *acorn_adfs_new_format::name() const noexcept
|
||||
{
|
||||
return "adfs_n";
|
||||
}
|
||||
|
||||
const char *acorn_adfs_new_format::description() const
|
||||
const char *acorn_adfs_new_format::description() const noexcept
|
||||
{
|
||||
return "Acorn ADFS (NewMap) disk image";
|
||||
}
|
||||
|
||||
const char *acorn_adfs_new_format::extensions() const
|
||||
const char *acorn_adfs_new_format::extensions() const noexcept
|
||||
{
|
||||
return "adf";
|
||||
}
|
||||
@ -555,17 +555,17 @@ acorn_dos_format::acorn_dos_format() : wd177x_format(formats)
|
||||
{
|
||||
}
|
||||
|
||||
const char *acorn_dos_format::name() const
|
||||
const char *acorn_dos_format::name() const noexcept
|
||||
{
|
||||
return "dos";
|
||||
}
|
||||
|
||||
const char *acorn_dos_format::description() const
|
||||
const char *acorn_dos_format::description() const noexcept
|
||||
{
|
||||
return "Acorn DOS disk image";
|
||||
}
|
||||
|
||||
const char *acorn_dos_format::extensions() const
|
||||
const char *acorn_dos_format::extensions() const noexcept
|
||||
{
|
||||
return "img";
|
||||
}
|
||||
@ -625,22 +625,22 @@ opus_ddcpm_format::opus_ddcpm_format()
|
||||
{
|
||||
}
|
||||
|
||||
const char *opus_ddcpm_format::name() const
|
||||
const char *opus_ddcpm_format::name() const noexcept
|
||||
{
|
||||
return "ddcpm";
|
||||
}
|
||||
|
||||
const char *opus_ddcpm_format::description() const
|
||||
const char *opus_ddcpm_format::description() const noexcept
|
||||
{
|
||||
return "Opus DD CP/M disk image";
|
||||
}
|
||||
|
||||
const char *opus_ddcpm_format::extensions() const
|
||||
const char *opus_ddcpm_format::extensions() const noexcept
|
||||
{
|
||||
return "ssd";
|
||||
}
|
||||
|
||||
bool opus_ddcpm_format::supports_save() const
|
||||
bool opus_ddcpm_format::supports_save() const noexcept
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -662,7 +662,7 @@ int opus_ddcpm_format::identify(util::random_read &io, uint32_t form_factor, con
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool opus_ddcpm_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const
|
||||
bool opus_ddcpm_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const
|
||||
{
|
||||
// Double density discs formatted with DDCPM :
|
||||
//
|
||||
@ -711,7 +711,7 @@ bool opus_ddcpm_format::load(util::random_read &io, uint32_t form_factor, const
|
||||
return true;
|
||||
}
|
||||
|
||||
bool opus_ddcpm_format::save(util::random_read_write &io, const std::vector<uint32_t> &variants, floppy_image *image) const
|
||||
bool opus_ddcpm_format::save(util::random_read_write &io, const std::vector<uint32_t> &variants, const floppy_image &image) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -721,17 +721,17 @@ cumana_dfs_format::cumana_dfs_format() : wd177x_format(formats)
|
||||
{
|
||||
}
|
||||
|
||||
const char *cumana_dfs_format::name() const
|
||||
const char *cumana_dfs_format::name() const noexcept
|
||||
{
|
||||
return "cdfs";
|
||||
}
|
||||
|
||||
const char *cumana_dfs_format::description() const
|
||||
const char *cumana_dfs_format::description() const noexcept
|
||||
{
|
||||
return "Cumana DFS disk image";
|
||||
}
|
||||
|
||||
const char *cumana_dfs_format::extensions() const
|
||||
const char *cumana_dfs_format::extensions() const noexcept
|
||||
{
|
||||
return "img";
|
||||
}
|
||||
|
@ -24,9 +24,9 @@ public:
|
||||
virtual int find_size(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants) const override;
|
||||
virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants) const override;
|
||||
virtual int get_image_offset(const format &f, int head, int track) const override;
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
|
||||
private:
|
||||
static const format formats[];
|
||||
@ -41,9 +41,9 @@ public:
|
||||
virtual int find_size(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants) const override;
|
||||
virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants) const override;
|
||||
virtual int get_image_offset(const format &f, int head, int track) const override;
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
|
||||
private:
|
||||
static const format formats[];
|
||||
@ -58,9 +58,9 @@ public:
|
||||
virtual int find_size(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants) const override;
|
||||
virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants) const override;
|
||||
virtual int get_image_offset(const format &f, int head, int track) const override;
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
|
||||
private:
|
||||
static const format formats[];
|
||||
@ -75,9 +75,9 @@ public:
|
||||
virtual int find_size(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants) const override;
|
||||
virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants) const override;
|
||||
virtual int get_image_offset(const format &f, int head, int track) const override;
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
|
||||
private:
|
||||
static const format formats[];
|
||||
@ -92,9 +92,9 @@ public:
|
||||
virtual int find_size(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants) const override;
|
||||
virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants) const override;
|
||||
virtual int get_image_offset(const format &f, int head, int track) const override;
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
|
||||
private:
|
||||
static const format formats[];
|
||||
@ -109,9 +109,9 @@ public:
|
||||
virtual int find_size(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants) const override;
|
||||
virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants) const override;
|
||||
virtual int get_image_offset(const format &f, int head, int track) const override;
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
|
||||
private:
|
||||
static const format formats[];
|
||||
@ -124,13 +124,13 @@ public:
|
||||
opus_ddcpm_format();
|
||||
|
||||
virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants) const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const override;
|
||||
virtual bool save(util::random_read_write &io, const std::vector<uint32_t> &variants, floppy_image *image) const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const override;
|
||||
virtual bool save(util::random_read_write &io, const std::vector<uint32_t> &variants, const floppy_image &image) const override;
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual bool supports_save() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
virtual bool supports_save() const noexcept override;
|
||||
};
|
||||
|
||||
|
||||
@ -142,9 +142,9 @@ public:
|
||||
virtual int find_size(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants) const override;
|
||||
virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants) const override;
|
||||
virtual int get_image_offset(const format &f, int head, int track) const override;
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
|
||||
private:
|
||||
static const format formats[];
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:Curt Coder
|
||||
/*********************************************************************
|
||||
|
||||
formats/adam_dsk.c
|
||||
formats/adam_dsk.cpp
|
||||
|
||||
Coleco Adam disk image format
|
||||
|
||||
@ -14,17 +14,17 @@ adam_format::adam_format() : wd177x_format(formats)
|
||||
{
|
||||
}
|
||||
|
||||
const char *adam_format::name() const
|
||||
const char *adam_format::name() const noexcept
|
||||
{
|
||||
return "adam";
|
||||
}
|
||||
|
||||
const char *adam_format::description() const
|
||||
const char *adam_format::description() const noexcept
|
||||
{
|
||||
return "Coleco Adam disk image";
|
||||
}
|
||||
|
||||
const char *adam_format::extensions() const
|
||||
const char *adam_format::extensions() const noexcept
|
||||
{
|
||||
return "dsk";
|
||||
}
|
||||
|
@ -19,9 +19,9 @@ class adam_format : public wd177x_format
|
||||
public:
|
||||
adam_format();
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
|
||||
private:
|
||||
static const format formats[];
|
||||
|
@ -15,17 +15,17 @@ afs_format::afs_format() : wd177x_format(formats)
|
||||
{
|
||||
}
|
||||
|
||||
const char *afs_format::name() const
|
||||
const char *afs_format::name() const noexcept
|
||||
{
|
||||
return "afs";
|
||||
}
|
||||
|
||||
const char *afs_format::description() const
|
||||
const char *afs_format::description() const noexcept
|
||||
{
|
||||
return "Acorn FileStore disk image";
|
||||
}
|
||||
|
||||
const char *afs_format::extensions() const
|
||||
const char *afs_format::extensions() const noexcept
|
||||
{
|
||||
return "adl,img";
|
||||
}
|
||||
|
@ -22,9 +22,9 @@ public:
|
||||
|
||||
virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants) const override;
|
||||
virtual int get_image_offset(const format &f, int head, int track) const override;
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
|
||||
private:
|
||||
static const format formats[];
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:Sergey Svishchev
|
||||
/*********************************************************************
|
||||
|
||||
formats/aim_dsk.h
|
||||
formats/aim_dsk.cpp
|
||||
|
||||
AIM disk images
|
||||
|
||||
@ -22,19 +22,19 @@ aim_format::aim_format()
|
||||
}
|
||||
|
||||
|
||||
const char *aim_format::name() const
|
||||
const char *aim_format::name() const noexcept
|
||||
{
|
||||
return "aim";
|
||||
}
|
||||
|
||||
|
||||
const char *aim_format::description() const
|
||||
const char *aim_format::description() const noexcept
|
||||
{
|
||||
return "AIM disk image";
|
||||
}
|
||||
|
||||
|
||||
const char *aim_format::extensions() const
|
||||
const char *aim_format::extensions() const noexcept
|
||||
{
|
||||
return "aim";
|
||||
}
|
||||
@ -53,9 +53,9 @@ int aim_format::identify(util::random_read &io, uint32_t form_factor, const std:
|
||||
}
|
||||
|
||||
|
||||
bool aim_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const
|
||||
bool aim_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const
|
||||
{
|
||||
image->set_variant(floppy_image::DSQD);
|
||||
image.set_variant(floppy_image::DSQD);
|
||||
|
||||
const int tracks = 80;
|
||||
const int track_size = 6464 * 2;
|
||||
|
@ -22,12 +22,12 @@ public:
|
||||
aim_format();
|
||||
|
||||
virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants) const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const override;
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual bool supports_save() const override { return false; }
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
virtual bool supports_save() const noexcept override { return false; }
|
||||
};
|
||||
|
||||
extern const aim_format FLOPPY_AIM_FORMAT;
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:Olivier Galibert
|
||||
/*********************************************************************
|
||||
|
||||
formats/ami_dsk.c
|
||||
formats/ami_dsk.cpp
|
||||
|
||||
Amiga disk images
|
||||
|
||||
@ -17,22 +17,22 @@ adf_format::adf_format() : floppy_image_format_t()
|
||||
{
|
||||
}
|
||||
|
||||
const char *adf_format::name() const
|
||||
const char *adf_format::name() const noexcept
|
||||
{
|
||||
return "adf";
|
||||
}
|
||||
|
||||
const char *adf_format::description() const
|
||||
const char *adf_format::description() const noexcept
|
||||
{
|
||||
return "Amiga ADF floppy disk image";
|
||||
}
|
||||
|
||||
const char *adf_format::extensions() const
|
||||
const char *adf_format::extensions() const noexcept
|
||||
{
|
||||
return "adf";
|
||||
}
|
||||
|
||||
bool adf_format::supports_save() const
|
||||
bool adf_format::supports_save() const noexcept
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@ -49,7 +49,7 @@ int adf_format::identify(util::random_read &io, uint32_t form_factor, const std:
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool adf_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const
|
||||
bool adf_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const
|
||||
{
|
||||
desc_s sectors[22];
|
||||
uint8_t sectdata[512*22];
|
||||
@ -78,7 +78,7 @@ bool adf_format::load(util::random_read &io, uint32_t form_factor, const std::ve
|
||||
}
|
||||
|
||||
if (!is_hd) {
|
||||
image->set_variant(floppy_image::DSDD);
|
||||
image.set_variant(floppy_image::DSDD);
|
||||
for (int track=0; track < tracks; track++) {
|
||||
for (int side=0; side < 2; side++) {
|
||||
size_t actual;
|
||||
@ -87,7 +87,7 @@ bool adf_format::load(util::random_read &io, uint32_t form_factor, const std::ve
|
||||
}
|
||||
}
|
||||
} else {
|
||||
image->set_variant(floppy_image::DSHD);
|
||||
image.set_variant(floppy_image::DSHD);
|
||||
for (int track=0; track < tracks; track++) {
|
||||
for (int side=0; side < 2; side++) {
|
||||
size_t actual;
|
||||
@ -121,11 +121,11 @@ uint32_t adf_format::checksum(const std::vector<bool> &trackbuf, uint32_t pos, i
|
||||
return check & 0x55555555;
|
||||
}
|
||||
|
||||
bool adf_format::save(util::random_read_write &io, const std::vector<uint32_t> &variants, floppy_image *image) const
|
||||
bool adf_format::save(util::random_read_write &io, const std::vector<uint32_t> &variants, const floppy_image &image) const
|
||||
{
|
||||
uint8_t sectdata[512*22];
|
||||
|
||||
bool const hd = image->get_variant() == floppy_image::DSHD;
|
||||
bool const hd = image.get_variant() == floppy_image::DSHD;
|
||||
|
||||
int const data_track_size = hd ? 512*22 : 512*11;
|
||||
|
||||
|
@ -20,13 +20,13 @@ public:
|
||||
adf_format();
|
||||
|
||||
virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants) const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const override;
|
||||
virtual bool save(util::random_read_write &io, const std::vector<uint32_t> &variants, floppy_image *image) const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const override;
|
||||
virtual bool save(util::random_read_write &io, const std::vector<uint32_t> &variants, const floppy_image &image) const override;
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual bool supports_save() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
virtual bool supports_save() const noexcept override;
|
||||
|
||||
private:
|
||||
static uint32_t g32(const std::vector<bool> &bitsteam, uint32_t pos);
|
||||
|
@ -51,17 +51,17 @@ a2_16sect_dos_format::a2_16sect_dos_format() : a2_16sect_format(false)
|
||||
{
|
||||
}
|
||||
|
||||
const char *a2_16sect_dos_format::name() const
|
||||
const char *a2_16sect_dos_format::name() const noexcept
|
||||
{
|
||||
return "a2_16sect_dos";
|
||||
}
|
||||
|
||||
const char *a2_16sect_dos_format::description() const
|
||||
const char *a2_16sect_dos_format::description() const noexcept
|
||||
{
|
||||
return "Apple II 16-sector dsk image (DOS sector order)";
|
||||
}
|
||||
|
||||
const char *a2_16sect_dos_format::extensions() const
|
||||
const char *a2_16sect_dos_format::extensions() const noexcept
|
||||
{
|
||||
return "dsk,do";
|
||||
}
|
||||
@ -70,22 +70,22 @@ a2_16sect_prodos_format::a2_16sect_prodos_format() : a2_16sect_format(true)
|
||||
{
|
||||
}
|
||||
|
||||
const char *a2_16sect_prodos_format::name() const
|
||||
const char *a2_16sect_prodos_format::name() const noexcept
|
||||
{
|
||||
return "a2_16sect_prodos";
|
||||
}
|
||||
|
||||
const char *a2_16sect_prodos_format::description() const
|
||||
const char *a2_16sect_prodos_format::description() const noexcept
|
||||
{
|
||||
return "Apple II 16-sector dsk image (ProDos sector order)";
|
||||
}
|
||||
|
||||
const char *a2_16sect_prodos_format::extensions() const
|
||||
const char *a2_16sect_prodos_format::extensions() const noexcept
|
||||
{
|
||||
return "dsk,po";
|
||||
}
|
||||
|
||||
bool a2_16sect_format::supports_save() const
|
||||
bool a2_16sect_format::supports_save() const noexcept
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@ -173,13 +173,13 @@ int a2_16sect_format::identify(util::random_read &io, uint32_t form_factor, cons
|
||||
return FIFID_SIZE | (m_prodos_order == prodos_order ? FIFID_HINT : 0);
|
||||
}
|
||||
|
||||
bool a2_16sect_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const
|
||||
bool a2_16sect_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const
|
||||
{
|
||||
uint64_t size;
|
||||
if (io.length(size))
|
||||
return false;
|
||||
|
||||
image->set_form_variant(floppy_image::FF_525, floppy_image::SSSD);
|
||||
image.set_form_variant(floppy_image::FF_525, floppy_image::SSSD);
|
||||
|
||||
int tracks = (size == (40 * 16 * 256)) ? 40 : 35;
|
||||
|
||||
@ -271,7 +271,7 @@ uint8_t a2_16sect_format::gb(const std::vector<bool> &buf, int &pos, int &wrap)
|
||||
|
||||
//#define VERBOSE_SAVE
|
||||
|
||||
bool a2_16sect_format::save(util::random_read_write &io, const std::vector<uint32_t> &variants, floppy_image *image) const
|
||||
bool a2_16sect_format::save(util::random_read_write &io, const std::vector<uint32_t> &variants, const floppy_image &image) const
|
||||
{
|
||||
int g_tracks, g_heads;
|
||||
int visualgrid[16][APPLE2_TRACK_COUNT]; // visualizer grid, cleared/initialized below
|
||||
@ -299,7 +299,7 @@ bool a2_16sect_format::save(util::random_read_write &io, const std::vector<uint3
|
||||
elem[j] = 0;
|
||||
}
|
||||
}
|
||||
image->get_actual_geometry(g_tracks, g_heads);
|
||||
image.get_actual_geometry(g_tracks, g_heads);
|
||||
|
||||
int head = 0;
|
||||
|
||||
@ -529,22 +529,22 @@ a2_rwts18_format::a2_rwts18_format() : floppy_image_format_t()
|
||||
{
|
||||
}
|
||||
|
||||
const char *a2_rwts18_format::name() const
|
||||
const char *a2_rwts18_format::name() const noexcept
|
||||
{
|
||||
return "a2_rwts18";
|
||||
}
|
||||
|
||||
const char *a2_rwts18_format::description() const
|
||||
const char *a2_rwts18_format::description() const noexcept
|
||||
{
|
||||
return "Apple II RWTS18-type Image";
|
||||
}
|
||||
|
||||
const char *a2_rwts18_format::extensions() const
|
||||
const char *a2_rwts18_format::extensions() const noexcept
|
||||
{
|
||||
return "rti";
|
||||
}
|
||||
|
||||
bool a2_rwts18_format::supports_save() const
|
||||
bool a2_rwts18_format::supports_save() const noexcept
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@ -558,7 +558,7 @@ int a2_rwts18_format::identify(util::random_read &io, uint32_t form_factor, cons
|
||||
return size == expected_size ? FIFID_SIZE : 0;
|
||||
}
|
||||
|
||||
bool a2_rwts18_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const
|
||||
bool a2_rwts18_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const
|
||||
{
|
||||
/* TODO: rewrite me properly
|
||||
uint8_t sector_data[(256)*16];
|
||||
@ -604,7 +604,7 @@ uint8_t a2_rwts18_format::gb(const std::vector<bool> &buf, int &pos, int &wrap)
|
||||
return v;
|
||||
}
|
||||
|
||||
bool a2_rwts18_format::save(util::random_read_write &io, const std::vector<uint32_t> &variants, floppy_image *image) const
|
||||
bool a2_rwts18_format::save(util::random_read_write &io, const std::vector<uint32_t> &variants, const floppy_image &image) const
|
||||
{
|
||||
int g_tracks, g_heads;
|
||||
int visualgrid[18][APPLE2_TRACK_COUNT]; // visualizer grid, cleared/initialized below
|
||||
@ -633,7 +633,7 @@ bool a2_rwts18_format::save(util::random_read_write &io, const std::vector<uint3
|
||||
elem[j] = 0;
|
||||
}
|
||||
}
|
||||
image->get_actual_geometry(g_tracks, g_heads);
|
||||
image.get_actual_geometry(g_tracks, g_heads);
|
||||
|
||||
int head = 0;
|
||||
|
||||
@ -1011,22 +1011,22 @@ a2_edd_format::a2_edd_format() : floppy_image_format_t()
|
||||
{
|
||||
}
|
||||
|
||||
const char *a2_edd_format::name() const
|
||||
const char *a2_edd_format::name() const noexcept
|
||||
{
|
||||
return "a2_edd";
|
||||
}
|
||||
|
||||
const char *a2_edd_format::description() const
|
||||
const char *a2_edd_format::description() const noexcept
|
||||
{
|
||||
return "Apple II EDD Image";
|
||||
}
|
||||
|
||||
const char *a2_edd_format::extensions() const
|
||||
const char *a2_edd_format::extensions() const noexcept
|
||||
{
|
||||
return "edd";
|
||||
}
|
||||
|
||||
bool a2_edd_format::supports_save() const
|
||||
bool a2_edd_format::supports_save() const noexcept
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -1044,7 +1044,7 @@ uint8_t a2_edd_format::pick(const uint8_t *data, int pos)
|
||||
return get_u16be(&data[pos>>3]) >> (8-(pos & 7));
|
||||
}
|
||||
|
||||
bool a2_edd_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const
|
||||
bool a2_edd_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const
|
||||
{
|
||||
uint8_t nibble[16384], stream[16384];
|
||||
int npos[16384];
|
||||
@ -1119,11 +1119,11 @@ bool a2_edd_format::load(util::random_read &io, uint32_t form_factor, const std:
|
||||
stream[splice >> 3] ^= 0x80 >> (splice & 7);
|
||||
|
||||
generate_track_from_bitstream(i >> 2, 0, stream, len, image, i & 3);
|
||||
image->set_write_splice_position(i >> 2, 0, uint32_t(uint64_t(200'000'000)*splice/len), i & 3);
|
||||
image.set_write_splice_position(i >> 2, 0, uint32_t(uint64_t(200'000'000)*splice/len), i & 3);
|
||||
}
|
||||
img.reset();
|
||||
|
||||
image->set_form_variant(floppy_image::FF_525, floppy_image::SSSD);
|
||||
image.set_form_variant(floppy_image::FF_525, floppy_image::SSSD);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -1135,22 +1135,22 @@ a2_nib_format::a2_nib_format() : floppy_image_format_t()
|
||||
{
|
||||
}
|
||||
|
||||
const char *a2_nib_format::name() const
|
||||
const char *a2_nib_format::name() const noexcept
|
||||
{
|
||||
return "a2_nib";
|
||||
}
|
||||
|
||||
const char *a2_nib_format::description() const
|
||||
const char *a2_nib_format::description() const noexcept
|
||||
{
|
||||
return "Apple II NIB Image";
|
||||
}
|
||||
|
||||
const char *a2_nib_format::extensions() const
|
||||
const char *a2_nib_format::extensions() const noexcept
|
||||
{
|
||||
return "nib";
|
||||
}
|
||||
|
||||
bool a2_nib_format::supports_save() const
|
||||
bool a2_nib_format::supports_save() const noexcept
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -1278,7 +1278,7 @@ std::vector<uint32_t> a2_nib_format::generate_levels_from_nibbles(const std::vec
|
||||
return levels;
|
||||
}
|
||||
|
||||
bool a2_nib_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const
|
||||
bool a2_nib_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const
|
||||
{
|
||||
uint64_t size;
|
||||
if (io.length(size))
|
||||
@ -1298,7 +1298,7 @@ bool a2_nib_format::load(util::random_read &io, uint32_t form_factor, const std:
|
||||
0, image);
|
||||
}
|
||||
|
||||
image->set_form_variant(floppy_image::FF_525, floppy_image::SSSD);
|
||||
image.set_form_variant(floppy_image::FF_525, floppy_image::SSSD);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -35,10 +35,10 @@ public:
|
||||
a2_16sect_format(bool prodos_order);
|
||||
|
||||
virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants) const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const override;
|
||||
virtual bool save(util::random_read_write &io, const std::vector<uint32_t> &variants, floppy_image *image) const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const override;
|
||||
virtual bool save(util::random_read_write &io, const std::vector<uint32_t> &variants, const floppy_image &image) const override;
|
||||
|
||||
virtual bool supports_save() const override;
|
||||
virtual bool supports_save() const noexcept override;
|
||||
|
||||
private:
|
||||
const bool m_prodos_order;
|
||||
@ -50,18 +50,18 @@ class a2_16sect_dos_format : public a2_16sect_format
|
||||
{
|
||||
public:
|
||||
a2_16sect_dos_format();
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
};
|
||||
|
||||
class a2_16sect_prodos_format : public a2_16sect_format
|
||||
{
|
||||
public:
|
||||
a2_16sect_prodos_format();
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
};
|
||||
|
||||
extern const a2_16sect_dos_format FLOPPY_A216S_DOS_FORMAT;
|
||||
@ -73,13 +73,13 @@ public:
|
||||
a2_rwts18_format();
|
||||
|
||||
virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants) const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const override;
|
||||
virtual bool save(util::random_read_write &io, const std::vector<uint32_t> &variants, floppy_image *image) const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const override;
|
||||
virtual bool save(util::random_read_write &io, const std::vector<uint32_t> &variants, const floppy_image &image) const override;
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual bool supports_save() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
virtual bool supports_save() const noexcept override;
|
||||
|
||||
private:
|
||||
static const desc_e mac_gcr[];
|
||||
@ -96,12 +96,12 @@ public:
|
||||
a2_edd_format();
|
||||
|
||||
virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants) const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const override;
|
||||
virtual bool supports_save() const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const override;
|
||||
virtual bool supports_save() const noexcept override;
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
|
||||
private:
|
||||
static uint8_t pick(const uint8_t *data, int pos);
|
||||
@ -115,12 +115,12 @@ public:
|
||||
a2_nib_format();
|
||||
|
||||
virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants) const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const override;
|
||||
virtual bool supports_save() const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const override;
|
||||
virtual bool supports_save() const noexcept override;
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
|
||||
|
||||
private:
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:O. Galibert, R. Belmont
|
||||
/*********************************************************************
|
||||
|
||||
ap_dsk35.c
|
||||
ap_dsk35.cpp
|
||||
|
||||
Apple 3.5" disk images
|
||||
|
||||
@ -115,22 +115,22 @@ dc42_format::dc42_format() : floppy_image_format_t()
|
||||
{
|
||||
}
|
||||
|
||||
const char *dc42_format::name() const
|
||||
const char *dc42_format::name() const noexcept
|
||||
{
|
||||
return "dc42";
|
||||
}
|
||||
|
||||
const char *dc42_format::description() const
|
||||
const char *dc42_format::description() const noexcept
|
||||
{
|
||||
return "DiskCopy 4.2 image";
|
||||
}
|
||||
|
||||
const char *dc42_format::extensions() const
|
||||
const char *dc42_format::extensions() const noexcept
|
||||
{
|
||||
return "dc42";
|
||||
}
|
||||
|
||||
bool dc42_format::supports_save() const
|
||||
bool dc42_format::supports_save() const noexcept
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@ -158,7 +158,7 @@ int dc42_format::identify(util::random_read &io, uint32_t form_factor, const std
|
||||
return (size == 0x54+tsize+dsize && h[0] < 64 && h[0x52] == 1 && h[0x53] == 0) ? FIFID_STRUCT : 0;
|
||||
}
|
||||
|
||||
bool dc42_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const
|
||||
bool dc42_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const
|
||||
{
|
||||
size_t actual;
|
||||
uint8_t h[0x54];
|
||||
@ -176,20 +176,20 @@ bool dc42_format::load(util::random_read &io, uint32_t form_factor, const std::v
|
||||
|
||||
switch(dsize) {
|
||||
case 409600: // Mac 400K
|
||||
image->set_form_variant(floppy_image::FF_35, floppy_image::SSDD);
|
||||
image.set_form_variant(floppy_image::FF_35, floppy_image::SSDD);
|
||||
break;
|
||||
|
||||
case 737280: // PC 720K
|
||||
case 819200: // Mac/A2 800K
|
||||
image->set_form_variant(floppy_image::FF_35, floppy_image::DSDD);
|
||||
image.set_form_variant(floppy_image::FF_35, floppy_image::DSDD);
|
||||
break;
|
||||
|
||||
case 1474560: // PC or Mac 1.44M
|
||||
image->set_form_variant(floppy_image::FF_35, floppy_image::DSHD);
|
||||
image.set_form_variant(floppy_image::FF_35, floppy_image::DSHD);
|
||||
break;
|
||||
|
||||
case 871424: // Apple Twiggy 851KiB
|
||||
image->set_form_variant(floppy_image::FF_525, floppy_image::DSHD);
|
||||
image.set_form_variant(floppy_image::FF_525, floppy_image::DSHD);
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -245,10 +245,10 @@ void dc42_format::update_chk(const uint8_t *data, int size, uint32_t &chk)
|
||||
}
|
||||
}
|
||||
|
||||
bool dc42_format::save(util::random_read_write &io, const std::vector<uint32_t> &variants, floppy_image *image) const
|
||||
bool dc42_format::save(util::random_read_write &io, const std::vector<uint32_t> &variants, const floppy_image &image) const
|
||||
{
|
||||
int g_tracks, g_heads;
|
||||
image->get_actual_geometry(g_tracks, g_heads);
|
||||
image.get_actual_geometry(g_tracks, g_heads);
|
||||
|
||||
if(g_heads == 0)
|
||||
g_heads = 1;
|
||||
@ -312,22 +312,22 @@ apple_gcr_format::apple_gcr_format() : floppy_image_format_t()
|
||||
{
|
||||
}
|
||||
|
||||
const char *apple_gcr_format::name() const
|
||||
const char *apple_gcr_format::name() const noexcept
|
||||
{
|
||||
return "apple_gcr";
|
||||
}
|
||||
|
||||
const char *apple_gcr_format::description() const
|
||||
const char *apple_gcr_format::description() const noexcept
|
||||
{
|
||||
return "Apple GCR 400/800K raw sector image";
|
||||
}
|
||||
|
||||
const char *apple_gcr_format::extensions() const
|
||||
const char *apple_gcr_format::extensions() const noexcept
|
||||
{
|
||||
return "img";
|
||||
}
|
||||
|
||||
bool apple_gcr_format::supports_save() const
|
||||
bool apple_gcr_format::supports_save() const noexcept
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@ -344,7 +344,7 @@ int apple_gcr_format::identify(util::random_read &io, uint32_t form_factor, cons
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool apple_gcr_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const
|
||||
bool apple_gcr_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const
|
||||
{
|
||||
size_t actual;
|
||||
desc_gcr_sector sectors[12];
|
||||
@ -360,7 +360,7 @@ bool apple_gcr_format::load(util::random_read &io, uint32_t form_factor, const s
|
||||
return false;
|
||||
int head_count = size == 409600 ? 1 : size == 819200 ? 2 : 0;
|
||||
|
||||
image->set_form_variant(floppy_image::FF_35, head_count == 2 ? floppy_image::DSDD : floppy_image::SSDD);
|
||||
image.set_form_variant(floppy_image::FF_35, head_count == 2 ? floppy_image::DSDD : floppy_image::SSDD);
|
||||
|
||||
if(!head_count)
|
||||
return false;
|
||||
@ -388,10 +388,10 @@ bool apple_gcr_format::load(util::random_read &io, uint32_t form_factor, const s
|
||||
return true;
|
||||
}
|
||||
|
||||
bool apple_gcr_format::save(util::random_read_write &io, const std::vector<uint32_t> &variants, floppy_image *image) const
|
||||
bool apple_gcr_format::save(util::random_read_write &io, const std::vector<uint32_t> &variants, const floppy_image &image) const
|
||||
{
|
||||
int g_tracks, g_heads;
|
||||
image->get_actual_geometry(g_tracks, g_heads);
|
||||
image.get_actual_geometry(g_tracks, g_heads);
|
||||
|
||||
if(g_heads == 0)
|
||||
g_heads = 1;
|
||||
@ -421,22 +421,22 @@ apple_2mg_format::apple_2mg_format() : floppy_image_format_t()
|
||||
{
|
||||
}
|
||||
|
||||
const char *apple_2mg_format::name() const
|
||||
const char *apple_2mg_format::name() const noexcept
|
||||
{
|
||||
return "apple_2mg";
|
||||
}
|
||||
|
||||
const char *apple_2mg_format::description() const
|
||||
const char *apple_2mg_format::description() const noexcept
|
||||
{
|
||||
return "Apple II .2MG image";
|
||||
}
|
||||
|
||||
const char *apple_2mg_format::extensions() const
|
||||
const char *apple_2mg_format::extensions() const noexcept
|
||||
{
|
||||
return "2mg";
|
||||
}
|
||||
|
||||
bool apple_2mg_format::supports_save() const
|
||||
bool apple_2mg_format::supports_save() const noexcept
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@ -460,7 +460,7 @@ int apple_2mg_format::identify(util::random_read &io, uint32_t form_factor, cons
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool apple_2mg_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const
|
||||
bool apple_2mg_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const
|
||||
{
|
||||
size_t actual;
|
||||
desc_gcr_sector sectors[12];
|
||||
@ -472,7 +472,7 @@ bool apple_2mg_format::load(util::random_read &io, uint32_t form_factor, const s
|
||||
if(blocks != 1600 && blocks != 16390)
|
||||
return false;
|
||||
|
||||
image->set_form_variant(floppy_image::FF_35, (blocks > 800) ? floppy_image::DSDD : floppy_image::SSDD);
|
||||
image.set_form_variant(floppy_image::FF_35, (blocks > 800) ? floppy_image::DSDD : floppy_image::SSDD);
|
||||
|
||||
for(int track=0; track < 80; track++) {
|
||||
for(int head=0; head < 2; head++) {
|
||||
@ -498,7 +498,7 @@ bool apple_2mg_format::load(util::random_read &io, uint32_t form_factor, const s
|
||||
return true;
|
||||
}
|
||||
|
||||
bool apple_2mg_format::save(util::random_read_write &io, const std::vector<uint32_t> &variants, floppy_image *image) const
|
||||
bool apple_2mg_format::save(util::random_read_write &io, const std::vector<uint32_t> &variants, const floppy_image &image) const
|
||||
{
|
||||
size_t actual;
|
||||
|
||||
|
@ -20,13 +20,13 @@ public:
|
||||
dc42_format();
|
||||
|
||||
virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants) const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const override;
|
||||
virtual bool save(util::random_read_write &io, const std::vector<uint32_t> &variants, floppy_image *image) const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const override;
|
||||
virtual bool save(util::random_read_write &io, const std::vector<uint32_t> &variants, const floppy_image &image) const override;
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual bool supports_save() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
virtual bool supports_save() const noexcept override;
|
||||
|
||||
private:
|
||||
static void update_chk(const uint8_t *data, int size, uint32_t &chk);
|
||||
@ -40,13 +40,13 @@ public:
|
||||
apple_gcr_format();
|
||||
|
||||
virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants) const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const override;
|
||||
virtual bool save(util::random_read_write &io, const std::vector<uint32_t> &variants, floppy_image *image) const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const override;
|
||||
virtual bool save(util::random_read_write &io, const std::vector<uint32_t> &variants, const floppy_image &image) const override;
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual bool supports_save() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
virtual bool supports_save() const noexcept override;
|
||||
};
|
||||
|
||||
extern const apple_gcr_format FLOPPY_APPLE_GCR_FORMAT;
|
||||
@ -57,13 +57,13 @@ public:
|
||||
apple_2mg_format();
|
||||
|
||||
virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants) const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const override;
|
||||
virtual bool save(util::random_read_write &io, const std::vector<uint32_t> &variants, floppy_image *image) const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const override;
|
||||
virtual bool save(util::random_read_write &io, const std::vector<uint32_t> &variants, const floppy_image &image) const override;
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual bool supports_save() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
virtual bool supports_save() const noexcept override;
|
||||
};
|
||||
|
||||
extern const apple_2mg_format FLOPPY_APPLE_2MG_FORMAT;
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:Nigel Barnes
|
||||
/*********************************************************************
|
||||
|
||||
formats/apd_dsk.c
|
||||
formats/apd_dsk.cpp
|
||||
|
||||
Archimedes Protected Disk Image format
|
||||
|
||||
@ -79,17 +79,17 @@ apd_format::apd_format()
|
||||
{
|
||||
}
|
||||
|
||||
const char *apd_format::name() const
|
||||
const char *apd_format::name() const noexcept
|
||||
{
|
||||
return "apd";
|
||||
}
|
||||
|
||||
const char *apd_format::description() const
|
||||
const char *apd_format::description() const noexcept
|
||||
{
|
||||
return "Archimedes Protected Disk Image";
|
||||
}
|
||||
|
||||
const char *apd_format::extensions() const
|
||||
const char *apd_format::extensions() const noexcept
|
||||
{
|
||||
return "apd";
|
||||
}
|
||||
@ -136,7 +136,7 @@ int apd_format::identify(util::random_read &io, uint32_t form_factor, const std:
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool apd_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const
|
||||
bool apd_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const
|
||||
{
|
||||
uint64_t size;
|
||||
if (io.length(size))
|
||||
@ -201,12 +201,12 @@ bool apd_format::load(util::random_read &io, uint32_t form_factor, const std::ve
|
||||
data += (qdlen + 7) >> 3;
|
||||
}
|
||||
}
|
||||
image->set_variant(floppy_image::DSDD);
|
||||
image.set_variant(floppy_image::DSDD);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool apd_format::supports_save() const
|
||||
bool apd_format::supports_save() const noexcept
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -19,13 +19,13 @@ class apd_format : public floppy_image_format_t
|
||||
public:
|
||||
apd_format();
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
|
||||
virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants) const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const override;
|
||||
virtual bool supports_save() const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const override;
|
||||
virtual bool supports_save() const noexcept override;
|
||||
};
|
||||
|
||||
extern const apd_format FLOPPY_APD_FORMAT;
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:Olivier Galibert
|
||||
/*********************************************************************
|
||||
|
||||
formats/apollo_dsk.c
|
||||
formats/apollo_dsk.cpp
|
||||
|
||||
apollo format
|
||||
|
||||
@ -17,17 +17,17 @@ apollo_format::apollo_format() : upd765_format(formats)
|
||||
{
|
||||
}
|
||||
|
||||
const char *apollo_format::name() const
|
||||
const char *apollo_format::name() const noexcept
|
||||
{
|
||||
return "apollo";
|
||||
}
|
||||
|
||||
const char *apollo_format::description() const
|
||||
const char *apollo_format::description() const noexcept
|
||||
{
|
||||
return "APOLLO disk image";
|
||||
}
|
||||
|
||||
const char *apollo_format::extensions() const
|
||||
const char *apollo_format::extensions() const noexcept
|
||||
{
|
||||
return "afd";
|
||||
}
|
||||
|
@ -19,9 +19,9 @@ class apollo_format : public upd765_format
|
||||
public:
|
||||
apollo_format();
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
|
||||
private:
|
||||
static const format formats[];
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:Robbbert
|
||||
/*********************************************************************
|
||||
|
||||
formats/applix_dsk.c
|
||||
formats/applix_dsk.cpp
|
||||
|
||||
Applix disk image format
|
||||
|
||||
@ -14,17 +14,17 @@ applix_format::applix_format() : wd177x_format(formats)
|
||||
{
|
||||
}
|
||||
|
||||
const char *applix_format::name() const
|
||||
const char *applix_format::name() const noexcept
|
||||
{
|
||||
return "applix";
|
||||
}
|
||||
|
||||
const char *applix_format::description() const
|
||||
const char *applix_format::description() const noexcept
|
||||
{
|
||||
return "Applix disk image";
|
||||
}
|
||||
|
||||
const char *applix_format::extensions() const
|
||||
const char *applix_format::extensions() const noexcept
|
||||
{
|
||||
return "raw";
|
||||
}
|
||||
|
@ -19,9 +19,9 @@ class applix_format : public wd177x_format
|
||||
public:
|
||||
applix_format();
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
|
||||
private:
|
||||
static const format formats[];
|
||||
|
@ -20,17 +20,17 @@ apridisk_format::apridisk_format()
|
||||
{
|
||||
}
|
||||
|
||||
const char *apridisk_format::name() const
|
||||
const char *apridisk_format::name() const noexcept
|
||||
{
|
||||
return "apridisk";
|
||||
}
|
||||
|
||||
const char *apridisk_format::description() const
|
||||
const char *apridisk_format::description() const noexcept
|
||||
{
|
||||
return "APRIDISK disk image";
|
||||
}
|
||||
|
||||
const char *apridisk_format::extensions() const
|
||||
const char *apridisk_format::extensions() const noexcept
|
||||
{
|
||||
return "dsk";
|
||||
}
|
||||
@ -49,7 +49,7 @@ int apridisk_format::identify(util::random_read &io, uint32_t form_factor, const
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool apridisk_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const
|
||||
bool apridisk_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const
|
||||
{
|
||||
desc_pc_sector sectors[80][2][18];
|
||||
std::unique_ptr<uint8_t []> sector_data(new uint8_t [MAX_SECTORS * SECTOR_SIZE]);
|
||||
@ -149,7 +149,7 @@ bool apridisk_format::load(util::random_read &io, uint32_t form_factor, const st
|
||||
return true;
|
||||
}
|
||||
|
||||
bool apridisk_format::supports_save() const
|
||||
bool apridisk_format::supports_save() const noexcept
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -19,13 +19,13 @@ class apridisk_format : public floppy_image_format_t
|
||||
public:
|
||||
apridisk_format();
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
|
||||
virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants) const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const override;
|
||||
virtual bool supports_save() const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const override;
|
||||
virtual bool supports_save() const noexcept override;
|
||||
|
||||
private:
|
||||
static const int APR_HEADER_SIZE = 128;
|
||||
|
@ -67,7 +67,7 @@ uint32_t as_format::crc32r(const uint8_t *data, uint32_t size)
|
||||
return ~crc;
|
||||
}
|
||||
|
||||
bool as_format::load_bitstream_track(const std::vector<uint8_t> &img, floppy_image *image, int head, int track, int subtrack, uint8_t idx, uint32_t off_trks, bool may_be_short, bool set_variant)
|
||||
bool as_format::load_bitstream_track(const std::vector<uint8_t> &img, floppy_image &image, int head, int track, int subtrack, uint8_t idx, uint32_t off_trks, bool may_be_short, bool set_variant)
|
||||
{
|
||||
uint32_t trks_off = off_trks + (idx * 8);
|
||||
|
||||
@ -92,11 +92,11 @@ bool as_format::load_bitstream_track(const std::vector<uint8_t> &img, floppy_ima
|
||||
generate_track_from_bitstream(track, head, &img[boff], track_size, image, subtrack, 0xffff);
|
||||
|
||||
if(set_variant)
|
||||
image->set_variant(r32(img, trks_off + 4) >= 90000 ? floppy_image::DSHD : floppy_image::DSDD);
|
||||
image.set_variant(r32(img, trks_off + 4) >= 90000 ? floppy_image::DSHD : floppy_image::DSDD);
|
||||
return true;
|
||||
}
|
||||
|
||||
void as_format::load_flux_track(const std::vector<uint8_t> &img, floppy_image *image, int head, int track, int subtrack, uint8_t fidx, uint32_t off_trks)
|
||||
void as_format::load_flux_track(const std::vector<uint8_t> &img, floppy_image &image, int head, int track, int subtrack, uint8_t fidx, uint32_t off_trks)
|
||||
{
|
||||
uint32_t trks_off = off_trks + (fidx * 8);
|
||||
uint32_t boff = (uint32_t)r16(img, trks_off + 0) * 512;
|
||||
@ -108,7 +108,7 @@ void as_format::load_flux_track(const std::vector<uint8_t> &img, floppy_image *i
|
||||
|
||||
// There is always a pulse at index, and it's
|
||||
// the last one in the stream
|
||||
std::vector<uint32_t> &buf = image->get_buffer(track, head, subtrack);
|
||||
std::vector<uint32_t> &buf = image.get_buffer(track, head, subtrack);
|
||||
buf.push_back(floppy_image::MG_F | 0);
|
||||
uint32_t cpos = 0;
|
||||
for(uint32_t i=0; i != track_size; i++) {
|
||||
@ -120,7 +120,7 @@ void as_format::load_flux_track(const std::vector<uint8_t> &img, floppy_image *i
|
||||
}
|
||||
|
||||
|
||||
as_format::tdata as_format::analyze_for_save(floppy_image *image, int head, int track, int subtrack, int speed_zone)
|
||||
as_format::tdata as_format::analyze_for_save(const floppy_image &image, int head, int track, int subtrack, int speed_zone)
|
||||
{
|
||||
// 200000000 / 60.0 * 1.979e-6 ~= 6.5967
|
||||
static const int cell_size_per_speed_zone[7] = {
|
||||
@ -147,7 +147,7 @@ as_format::tdata as_format::analyze_for_save(floppy_image *image, int head, int
|
||||
|
||||
tdata result;
|
||||
|
||||
if(!image->track_is_formatted(track, head, subtrack))
|
||||
if(!image.track_is_formatted(track, head, subtrack))
|
||||
return result;
|
||||
|
||||
// Generate a bitstream to get the data and whether the phase is clean
|
||||
@ -167,7 +167,7 @@ as_format::tdata as_format::analyze_for_save(floppy_image *image, int head, int
|
||||
|
||||
result.flux = true;
|
||||
|
||||
const std::vector<uint32_t> &tbuf = image->get_buffer(track, head, subtrack);
|
||||
const std::vector<uint32_t> &tbuf = image.get_buffer(track, head, subtrack);
|
||||
uint32_t first_edge = 0, last_edge = 0;
|
||||
for(uint32_t fp : tbuf)
|
||||
if((fp & floppy_image::MG_MASK) == floppy_image::MG_F) {
|
||||
@ -290,22 +290,22 @@ woz_format::woz_format() : as_format()
|
||||
{
|
||||
}
|
||||
|
||||
const char *woz_format::name() const
|
||||
const char *woz_format::name() const noexcept
|
||||
{
|
||||
return "woz";
|
||||
}
|
||||
|
||||
const char *woz_format::description() const
|
||||
const char *woz_format::description() const noexcept
|
||||
{
|
||||
return "Apple II WOZ Image";
|
||||
}
|
||||
|
||||
const char *woz_format::extensions() const
|
||||
const char *woz_format::extensions() const noexcept
|
||||
{
|
||||
return "woz";
|
||||
}
|
||||
|
||||
bool woz_format::supports_save() const
|
||||
bool woz_format::supports_save() const noexcept
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@ -323,7 +323,7 @@ int woz_format::identify(util::random_read &io, uint32_t form_factor, const std:
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool woz_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const
|
||||
bool woz_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const
|
||||
{
|
||||
uint64_t image_size;
|
||||
if(io.length(image_size))
|
||||
@ -370,9 +370,9 @@ bool woz_format::load(util::random_read &io, uint32_t form_factor, const std::ve
|
||||
unsigned int limit = is_35 ? 160 : 141;
|
||||
|
||||
if(is_35)
|
||||
image->set_form_variant(floppy_image::FF_35, floppy_image::SSDD);
|
||||
image.set_form_variant(floppy_image::FF_35, floppy_image::SSDD);
|
||||
else
|
||||
image->set_form_variant(floppy_image::FF_525, floppy_image::SSSD);
|
||||
image.set_form_variant(floppy_image::FF_525, floppy_image::SSSD);
|
||||
|
||||
if (woz_vers == 1) {
|
||||
for (unsigned int trkid = 0; trkid != limit; trkid++) {
|
||||
@ -387,7 +387,7 @@ bool woz_format::load(util::random_read &io, uint32_t form_factor, const std::ve
|
||||
return false;
|
||||
generate_track_from_bitstream(track, head, &img[boff], r16(img, boff + 6648), image, subtrack, r16(img, boff + 6650));
|
||||
if(is_35 && !track && head)
|
||||
image->set_variant(floppy_image::DSDD);
|
||||
image.set_variant(floppy_image::DSDD);
|
||||
}
|
||||
}
|
||||
} else if (woz_vers == 2) {
|
||||
@ -414,16 +414,16 @@ bool woz_format::load(util::random_read &io, uint32_t form_factor, const std::ve
|
||||
}
|
||||
|
||||
|
||||
bool woz_format::save(util::random_read_write &io, const std::vector<uint32_t> &variants, floppy_image *image) const
|
||||
bool woz_format::save(util::random_read_write &io, const std::vector<uint32_t> &variants, const floppy_image &image) const
|
||||
{
|
||||
std::vector<tdata> tracks(160);
|
||||
bool twosided = false;
|
||||
|
||||
if(image->get_form_factor() == floppy_image::FF_525) {
|
||||
if(image.get_form_factor() == floppy_image::FF_525) {
|
||||
for(unsigned int i=0; i != 141; i++)
|
||||
tracks[i] = analyze_for_save(image, 0, i >> 2, i & 3, 5);
|
||||
|
||||
} else if(image->get_variant() == floppy_image::DSHD) {
|
||||
} else if(image.get_variant() == floppy_image::DSHD) {
|
||||
for(unsigned int i=0; i != 160; i++) {
|
||||
tracks[i] = analyze_for_save(image, i & 1, i >> 1, 0, 6);
|
||||
if((i & 1) && tracks[i].track_size)
|
||||
@ -448,7 +448,7 @@ bool woz_format::save(util::random_read_write &io, const std::vector<uint32_t> &
|
||||
w32(data, 12, 0x4F464E49); // INFO
|
||||
w32(data, 16, 60); // size
|
||||
data[20] = 3; // chunk version
|
||||
data[21] = image->get_form_factor() == floppy_image::FF_525 ? 1 : 2;
|
||||
data[21] = image.get_form_factor() == floppy_image::FF_525 ? 1 : 2;
|
||||
data[22] = 0; // not write protected
|
||||
data[23] = 1; // synchronized, since our internal format is
|
||||
data[24] = 1; // weak bits are generated, not stored
|
||||
@ -459,7 +459,7 @@ bool woz_format::save(util::random_read_write &io, const std::vector<uint32_t> &
|
||||
memset(&data[29], ' ', 32-4);
|
||||
data[57] = twosided ? 2 : 1;
|
||||
data[58] = 0; // boot sector unknown
|
||||
data[59] = image->get_form_factor() == floppy_image::FF_525 ? 32 : image->get_variant() == floppy_image::DSHD ? 8 : 16;
|
||||
data[59] = image.get_form_factor() == floppy_image::FF_525 ? 32 : image.get_variant() == floppy_image::DSHD ? 8 : 16;
|
||||
w16(data, 60, 0); // compatibility unknown
|
||||
w16(data, 62, 0); // needed ram unknown
|
||||
w16(data, 64, max_blocks);
|
||||
@ -480,22 +480,22 @@ moof_format::moof_format() : as_format()
|
||||
{
|
||||
}
|
||||
|
||||
const char *moof_format::name() const
|
||||
const char *moof_format::name() const noexcept
|
||||
{
|
||||
return "moof";
|
||||
}
|
||||
|
||||
const char *moof_format::description() const
|
||||
const char *moof_format::description() const noexcept
|
||||
{
|
||||
return "Macintosh MOOF Image";
|
||||
}
|
||||
|
||||
const char *moof_format::extensions() const
|
||||
const char *moof_format::extensions() const noexcept
|
||||
{
|
||||
return "moof";
|
||||
}
|
||||
|
||||
bool moof_format::supports_save() const
|
||||
bool moof_format::supports_save() const noexcept
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@ -511,7 +511,7 @@ int moof_format::identify(util::random_read &io, uint32_t form_factor, const std
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool moof_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const
|
||||
bool moof_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const
|
||||
{
|
||||
uint64_t image_size;
|
||||
if(io.length(image_size))
|
||||
@ -548,13 +548,13 @@ bool moof_format::load(util::random_read &io, uint32_t form_factor, const std::v
|
||||
|
||||
switch(r8(img, off_info + 1)) {
|
||||
case 1:
|
||||
image->set_form_variant(floppy_image::FF_35, floppy_image::SSDD);
|
||||
image.set_form_variant(floppy_image::FF_35, floppy_image::SSDD);
|
||||
break;
|
||||
case 2:
|
||||
image->set_form_variant(floppy_image::FF_35, floppy_image::DSDD);
|
||||
image.set_form_variant(floppy_image::FF_35, floppy_image::DSDD);
|
||||
break;
|
||||
case 3:
|
||||
image->set_form_variant(floppy_image::FF_35, floppy_image::DSHD);
|
||||
image.set_form_variant(floppy_image::FF_35, floppy_image::DSHD);
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
@ -579,13 +579,13 @@ bool moof_format::load(util::random_read &io, uint32_t form_factor, const std::v
|
||||
return true;
|
||||
}
|
||||
|
||||
bool moof_format::save(util::random_read_write &io, const std::vector<uint32_t> &variants, floppy_image *image) const
|
||||
bool moof_format::save(util::random_read_write &io, const std::vector<uint32_t> &variants, const floppy_image &image) const
|
||||
{
|
||||
std::vector<tdata> tracks(160);
|
||||
bool twosided = false;
|
||||
bool is_hd = false;
|
||||
|
||||
if(image->get_variant() == floppy_image::DSHD) {
|
||||
if(image.get_variant() == floppy_image::DSHD) {
|
||||
twosided = true;
|
||||
is_hd = true;
|
||||
for(unsigned int i=0; i != 160; i++)
|
||||
|
@ -9,6 +9,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "flopimg.h"
|
||||
#include <utility>
|
||||
|
||||
class as_format : public floppy_image_format_t
|
||||
{
|
||||
@ -30,10 +31,10 @@ protected:
|
||||
static uint32_t crc32r(const uint8_t *data, uint32_t size);
|
||||
static uint32_t find_tag(const std::vector<uint8_t> &data, uint32_t tag);
|
||||
|
||||
static bool load_bitstream_track(const std::vector<uint8_t> &img, floppy_image *image, int head, int track, int subtrack, uint8_t idx, uint32_t off_trks, bool may_be_short, bool set_variant);
|
||||
static void load_flux_track(const std::vector<uint8_t> &img, floppy_image *image, int head, int track, int subtrack, uint8_t fidx, uint32_t off_trks);
|
||||
static bool load_bitstream_track(const std::vector<uint8_t> &img, floppy_image &image, int head, int track, int subtrack, uint8_t idx, uint32_t off_trks, bool may_be_short, bool set_variant);
|
||||
static void load_flux_track(const std::vector<uint8_t> &img, floppy_image &image, int head, int track, int subtrack, uint8_t fidx, uint32_t off_trks);
|
||||
|
||||
static tdata analyze_for_save(floppy_image *image, int head, int track, int subtrack, int speed_zone);
|
||||
static tdata analyze_for_save(const floppy_image &image, int head, int track, int subtrack, int speed_zone);
|
||||
static std::pair<int, int> count_blocks(const std::vector<tdata> &tracks);
|
||||
static bool test_flux(const std::vector<tdata> &tracks);
|
||||
static void save_tracks(std::vector<uint8_t> &data, const std::vector<tdata> &tracks, uint32_t total_blocks, bool has_flux);
|
||||
@ -45,13 +46,13 @@ public:
|
||||
woz_format();
|
||||
|
||||
virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants) const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const override;
|
||||
virtual bool save(util::random_read_write &io, const std::vector<uint32_t> &variants, floppy_image *image) const override;
|
||||
virtual bool supports_save() const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const override;
|
||||
virtual bool save(util::random_read_write &io, const std::vector<uint32_t> &variants, const floppy_image &image) const override;
|
||||
virtual bool supports_save() const noexcept override;
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
|
||||
private:
|
||||
static const uint8_t signature[8];
|
||||
@ -66,13 +67,13 @@ public:
|
||||
moof_format();
|
||||
|
||||
virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants) const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const override;
|
||||
virtual bool save(util::random_read_write &io, const std::vector<uint32_t> &variants, floppy_image *image) const override;
|
||||
virtual bool supports_save() const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const override;
|
||||
virtual bool save(util::random_read_write &io, const std::vector<uint32_t> &variants, const floppy_image &image) const override;
|
||||
virtual bool supports_save() const noexcept override;
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
|
||||
private:
|
||||
static const uint8_t signature[8];
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:Olivier Galibert
|
||||
/*********************************************************************
|
||||
|
||||
formats/asst128_dsk.c
|
||||
formats/asst128_dsk.cpp
|
||||
|
||||
asst128 format
|
||||
|
||||
@ -14,17 +14,17 @@ asst128_format::asst128_format() : upd765_format(formats)
|
||||
{
|
||||
}
|
||||
|
||||
const char *asst128_format::name() const
|
||||
const char *asst128_format::name() const noexcept
|
||||
{
|
||||
return "asst128";
|
||||
}
|
||||
|
||||
const char *asst128_format::description() const
|
||||
const char *asst128_format::description() const noexcept
|
||||
{
|
||||
return "ASST128 disk image";
|
||||
}
|
||||
|
||||
const char *asst128_format::extensions() const
|
||||
const char *asst128_format::extensions() const noexcept
|
||||
{
|
||||
return "img";
|
||||
}
|
||||
|
@ -18,9 +18,9 @@ class asst128_format : public upd765_format {
|
||||
public:
|
||||
asst128_format();
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
|
||||
private:
|
||||
static const format formats[];
|
||||
|
@ -6,17 +6,17 @@ atom_format::atom_format() : wd177x_format(formats)
|
||||
{
|
||||
}
|
||||
|
||||
const char *atom_format::name() const
|
||||
const char *atom_format::name() const noexcept
|
||||
{
|
||||
return "atom";
|
||||
}
|
||||
|
||||
const char *atom_format::description() const
|
||||
const char *atom_format::description() const noexcept
|
||||
{
|
||||
return "Acorn Atom disk image";
|
||||
}
|
||||
|
||||
const char *atom_format::extensions() const
|
||||
const char *atom_format::extensions() const noexcept
|
||||
{
|
||||
return "40t,dsk";
|
||||
}
|
||||
|
@ -13,9 +13,9 @@ class atom_format : public wd177x_format
|
||||
public:
|
||||
atom_format();
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
|
||||
private:
|
||||
static const format formats[];
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:Olivier Galibert
|
||||
/*********************************************************************
|
||||
|
||||
formats/bw12_dsk.c
|
||||
formats/bw12_dsk.cpp
|
||||
|
||||
bw12 format
|
||||
|
||||
@ -14,17 +14,17 @@ bw12_format::bw12_format() : upd765_format(formats)
|
||||
{
|
||||
}
|
||||
|
||||
const char *bw12_format::name() const
|
||||
const char *bw12_format::name() const noexcept
|
||||
{
|
||||
return "bw12";
|
||||
}
|
||||
|
||||
const char *bw12_format::description() const
|
||||
const char *bw12_format::description() const noexcept
|
||||
{
|
||||
return "Bondwell 12/14 disk image";
|
||||
}
|
||||
|
||||
const char *bw12_format::extensions() const
|
||||
const char *bw12_format::extensions() const noexcept
|
||||
{
|
||||
return "dsk";
|
||||
}
|
||||
|
@ -19,9 +19,9 @@ class bw12_format : public upd765_format
|
||||
public:
|
||||
bw12_format();
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
|
||||
private:
|
||||
static const format formats[];
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:Olivier Galibert
|
||||
/*********************************************************************
|
||||
|
||||
formats/bw2_dsk.c
|
||||
formats/bw2_dsk.cpp
|
||||
|
||||
bw2 format
|
||||
|
||||
@ -14,17 +14,17 @@ bw2_format::bw2_format() : upd765_format(formats)
|
||||
{
|
||||
}
|
||||
|
||||
const char *bw2_format::name() const
|
||||
const char *bw2_format::name() const noexcept
|
||||
{
|
||||
return "bw2";
|
||||
}
|
||||
|
||||
const char *bw2_format::description() const
|
||||
const char *bw2_format::description() const noexcept
|
||||
{
|
||||
return "Bondwell 2 disk image";
|
||||
}
|
||||
|
||||
const char *bw2_format::extensions() const
|
||||
const char *bw2_format::extensions() const noexcept
|
||||
{
|
||||
return "dsk";
|
||||
}
|
||||
|
@ -19,9 +19,9 @@ class bw2_format : public upd765_format
|
||||
public:
|
||||
bw2_format();
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
|
||||
private:
|
||||
static const format formats[];
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:Curt Coder
|
||||
/*********************************************************************
|
||||
|
||||
formats/c3040_dsk.c
|
||||
formats/c3040_dsk.cpp
|
||||
|
||||
Commodore 3040 sector disk image format
|
||||
|
||||
@ -14,17 +14,17 @@ c3040_format::c3040_format() : d64_format(file_formats)
|
||||
{
|
||||
}
|
||||
|
||||
const char *c3040_format::name() const
|
||||
const char *c3040_format::name() const noexcept
|
||||
{
|
||||
return "c3040";
|
||||
}
|
||||
|
||||
const char *c3040_format::description() const
|
||||
const char *c3040_format::description() const noexcept
|
||||
{
|
||||
return "Commodore 3040 disk image";
|
||||
}
|
||||
|
||||
const char *c3040_format::extensions() const
|
||||
const char *c3040_format::extensions() const noexcept
|
||||
{
|
||||
return "d67";
|
||||
}
|
||||
|
@ -18,9 +18,9 @@ class c3040_format : public d64_format {
|
||||
public:
|
||||
c3040_format();
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
|
||||
protected:
|
||||
virtual int get_sectors_per_track(const format &f, int track) const override { return c3040_sectors_per_track[track]; }
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:Curt Coder
|
||||
/*********************************************************************
|
||||
|
||||
formats/c4040_dsk.c
|
||||
formats/c4040_dsk.cpp
|
||||
|
||||
Commodore 4040 sector disk image format
|
||||
|
||||
@ -14,17 +14,17 @@ c4040_format::c4040_format() : d64_format(file_formats)
|
||||
{
|
||||
}
|
||||
|
||||
const char *c4040_format::name() const
|
||||
const char *c4040_format::name() const noexcept
|
||||
{
|
||||
return "c4040";
|
||||
}
|
||||
|
||||
const char *c4040_format::description() const
|
||||
const char *c4040_format::description() const noexcept
|
||||
{
|
||||
return "Commodore 4040 disk image";
|
||||
}
|
||||
|
||||
const char *c4040_format::extensions() const
|
||||
const char *c4040_format::extensions() const noexcept
|
||||
{
|
||||
return "d64";
|
||||
}
|
||||
|
@ -18,9 +18,9 @@ class c4040_format : public d64_format {
|
||||
public:
|
||||
c4040_format();
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
|
||||
protected:
|
||||
virtual floppy_image_format_t::desc_e* get_sector_desc(const format &f, int ¤t_size, int sector_count, uint8_t id1, uint8_t id2, int gap_2) const override;
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:Curt Coder
|
||||
/*********************************************************************
|
||||
|
||||
formats/c8280_dsk.c
|
||||
formats/c8280_dsk.cpp
|
||||
|
||||
Commodore 8280 disk image format
|
||||
|
||||
@ -14,17 +14,17 @@ c8280_format::c8280_format() : wd177x_format(formats)
|
||||
{
|
||||
}
|
||||
|
||||
const char *c8280_format::name() const
|
||||
const char *c8280_format::name() const noexcept
|
||||
{
|
||||
return "c8280";
|
||||
}
|
||||
|
||||
const char *c8280_format::description() const
|
||||
const char *c8280_format::description() const noexcept
|
||||
{
|
||||
return "Commodore 8280 disk image";
|
||||
}
|
||||
|
||||
const char *c8280_format::extensions() const
|
||||
const char *c8280_format::extensions() const noexcept
|
||||
{
|
||||
return "dsk";
|
||||
}
|
||||
|
@ -19,9 +19,9 @@ class c8280_format : public wd177x_format
|
||||
public:
|
||||
c8280_format();
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
|
||||
private:
|
||||
static const format formats[];
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:Robbbert
|
||||
/*********************************************************************
|
||||
|
||||
formats/camplynx_dsk.c
|
||||
formats/camplynx_dsk.cpp
|
||||
|
||||
Camputers Lynx disk image format
|
||||
|
||||
@ -25,17 +25,17 @@ camplynx_format::camplynx_format() : wd177x_format(formats)
|
||||
{
|
||||
}
|
||||
|
||||
const char *camplynx_format::name() const
|
||||
const char *camplynx_format::name() const noexcept
|
||||
{
|
||||
return "camplynx";
|
||||
}
|
||||
|
||||
const char *camplynx_format::description() const
|
||||
const char *camplynx_format::description() const noexcept
|
||||
{
|
||||
return "Camputers Lynx disk image";
|
||||
}
|
||||
|
||||
const char *camplynx_format::extensions() const
|
||||
const char *camplynx_format::extensions() const noexcept
|
||||
{
|
||||
return "ldf";
|
||||
}
|
||||
|
@ -19,9 +19,9 @@ class camplynx_format : public wd177x_format
|
||||
public:
|
||||
camplynx_format();
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
|
||||
private:
|
||||
static const format formats[];
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:Curt Coder
|
||||
/*********************************************************************
|
||||
|
||||
formats/ccvf_dsk.c
|
||||
formats/ccvf_dsk.cpp
|
||||
|
||||
Compucolor Virtual Floppy Disk Image format
|
||||
|
||||
@ -24,17 +24,17 @@ ccvf_format::ccvf_format(const format *_formats)
|
||||
formats = _formats;
|
||||
}
|
||||
|
||||
const char *ccvf_format::name() const
|
||||
const char *ccvf_format::name() const noexcept
|
||||
{
|
||||
return "ccvf";
|
||||
}
|
||||
|
||||
const char *ccvf_format::description() const
|
||||
const char *ccvf_format::description() const noexcept
|
||||
{
|
||||
return "Compucolor Virtual Floppy Disk Image";
|
||||
}
|
||||
|
||||
const char *ccvf_format::extensions() const
|
||||
const char *ccvf_format::extensions() const noexcept
|
||||
{
|
||||
return "ccvf";
|
||||
}
|
||||
@ -88,7 +88,7 @@ floppy_image_format_t::desc_e* ccvf_format::get_desc_8n1(const format &f, int &c
|
||||
return desc;
|
||||
}
|
||||
|
||||
bool ccvf_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const
|
||||
bool ccvf_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const
|
||||
{
|
||||
const format &f = formats[0];
|
||||
|
||||
@ -146,12 +146,12 @@ bool ccvf_format::load(util::random_read &io, uint32_t form_factor, const std::v
|
||||
generate_track_from_levels(track, 0, buffer, 0, image);
|
||||
}
|
||||
|
||||
image->set_variant(f.variant);
|
||||
image.set_variant(f.variant);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ccvf_format::supports_save() const
|
||||
bool ccvf_format::supports_save() const noexcept
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -35,13 +35,13 @@ public:
|
||||
ccvf_format();
|
||||
ccvf_format(const format *formats);
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
|
||||
virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants) const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const override;
|
||||
virtual bool supports_save() const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const override;
|
||||
virtual bool supports_save() const noexcept override;
|
||||
|
||||
protected:
|
||||
const format *formats;
|
||||
|
@ -14,17 +14,17 @@ cgenie_format::cgenie_format() : wd177x_format(formats)
|
||||
{
|
||||
}
|
||||
|
||||
const char *cgenie_format::name() const
|
||||
const char *cgenie_format::name() const noexcept
|
||||
{
|
||||
return "cgenie";
|
||||
}
|
||||
|
||||
const char *cgenie_format::description() const
|
||||
const char *cgenie_format::description() const noexcept
|
||||
{
|
||||
return "Colour Genie disk image";
|
||||
}
|
||||
|
||||
const char *cgenie_format::extensions() const
|
||||
const char *cgenie_format::extensions() const noexcept
|
||||
{
|
||||
return "dsk";
|
||||
}
|
||||
|
@ -19,9 +19,9 @@ class cgenie_format : public wd177x_format
|
||||
public:
|
||||
cgenie_format();
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
|
||||
protected:
|
||||
virtual int get_track_dam_fm(const format &f, int head, int track) const override;
|
||||
|
@ -13,17 +13,17 @@ coco_rawdsk_format::coco_rawdsk_format() : wd177x_format(formats)
|
||||
{
|
||||
}
|
||||
|
||||
const char *coco_rawdsk_format::name() const
|
||||
const char *coco_rawdsk_format::name() const noexcept
|
||||
{
|
||||
return "coco_rawdsk";
|
||||
}
|
||||
|
||||
const char *coco_rawdsk_format::description() const
|
||||
const char *coco_rawdsk_format::description() const noexcept
|
||||
{
|
||||
return "CoCo Raw Disk";
|
||||
}
|
||||
|
||||
const char *coco_rawdsk_format::extensions() const
|
||||
const char *coco_rawdsk_format::extensions() const noexcept
|
||||
{
|
||||
return "raw";
|
||||
}
|
||||
|
@ -19,9 +19,9 @@ class coco_rawdsk_format : public wd177x_format
|
||||
public:
|
||||
coco_rawdsk_format();
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
|
||||
private:
|
||||
static const format formats[];
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:Curt Coder
|
||||
/*********************************************************************
|
||||
|
||||
formats/comx35_dsk.c
|
||||
formats/comx35_dsk.cpp
|
||||
|
||||
COMX-35 disk image format
|
||||
|
||||
@ -42,17 +42,17 @@ comx35_format::comx35_format() : wd177x_format(formats)
|
||||
{
|
||||
}
|
||||
|
||||
const char *comx35_format::name() const
|
||||
const char *comx35_format::name() const noexcept
|
||||
{
|
||||
return "comx35";
|
||||
}
|
||||
|
||||
const char *comx35_format::description() const
|
||||
const char *comx35_format::description() const noexcept
|
||||
{
|
||||
return "COMX-35 disk image";
|
||||
}
|
||||
|
||||
const char *comx35_format::extensions() const
|
||||
const char *comx35_format::extensions() const noexcept
|
||||
{
|
||||
return "img";
|
||||
}
|
||||
|
@ -19,9 +19,9 @@ class comx35_format : public wd177x_format
|
||||
public:
|
||||
comx35_format();
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
|
||||
private:
|
||||
static const format formats[];
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:Olivier Galibert, R. Belmont
|
||||
/*********************************************************************
|
||||
|
||||
formats/concept_dsk.c
|
||||
formats/concept_dsk.cpp
|
||||
|
||||
Formats for Corvus Concept
|
||||
|
||||
@ -52,22 +52,22 @@ cc525dsdd_format::cc525dsdd_format()
|
||||
{
|
||||
}
|
||||
|
||||
const char *cc525dsdd_format::name() const
|
||||
const char *cc525dsdd_format::name() const noexcept
|
||||
{
|
||||
return "concept";
|
||||
}
|
||||
|
||||
const char *cc525dsdd_format::description() const
|
||||
const char *cc525dsdd_format::description() const noexcept
|
||||
{
|
||||
return "Corvus Concept 5.25\" DSDD floppy disk image";
|
||||
}
|
||||
|
||||
const char *cc525dsdd_format::extensions() const
|
||||
const char *cc525dsdd_format::extensions() const noexcept
|
||||
{
|
||||
return "img";
|
||||
}
|
||||
|
||||
bool cc525dsdd_format::supports_save() const
|
||||
bool cc525dsdd_format::supports_save() const noexcept
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@ -98,7 +98,7 @@ int cc525dsdd_format::identify(util::random_read &io, uint32_t form_factor, cons
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool cc525dsdd_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const
|
||||
bool cc525dsdd_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const
|
||||
{
|
||||
uint8_t track_count, head_count, sector_count;
|
||||
find_size(io, track_count, head_count, sector_count);
|
||||
@ -120,12 +120,12 @@ bool cc525dsdd_format::load(util::random_read &io, uint32_t form_factor, const s
|
||||
}
|
||||
}
|
||||
|
||||
image->set_variant(floppy_image::DSDD);
|
||||
image.set_variant(floppy_image::DSDD);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool cc525dsdd_format::save(util::random_read_write &io, const std::vector<uint32_t> &variants, floppy_image *image) const
|
||||
bool cc525dsdd_format::save(util::random_read_write &io, const std::vector<uint32_t> &variants, const floppy_image &image) const
|
||||
{
|
||||
int track_count, head_count, sector_count;
|
||||
get_geometry_mfm_pc(image, 2000, track_count, head_count, sector_count);
|
||||
|
@ -18,13 +18,13 @@ public:
|
||||
cc525dsdd_format();
|
||||
|
||||
virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants) const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const override;
|
||||
virtual bool save(util::random_read_write &io, const std::vector<uint32_t> &variants, floppy_image *image) const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const override;
|
||||
virtual bool save(util::random_read_write &io, const std::vector<uint32_t> &variants, const floppy_image &image) const override;
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual bool supports_save() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
virtual bool supports_save() const noexcept override;
|
||||
|
||||
static const desc_e cc_9_desc[];
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:Olivier Galibert
|
||||
/*************************************************************************
|
||||
|
||||
formats/coupedsk.c
|
||||
formats/coupedsk.cpp
|
||||
|
||||
SAM Coupe disk image formats
|
||||
|
||||
@ -44,22 +44,22 @@ mgt_format::mgt_format()
|
||||
{
|
||||
}
|
||||
|
||||
const char *mgt_format::name() const
|
||||
const char *mgt_format::name() const noexcept
|
||||
{
|
||||
return "mgt";
|
||||
}
|
||||
|
||||
const char *mgt_format::description() const
|
||||
const char *mgt_format::description() const noexcept
|
||||
{
|
||||
return "Sam Coupe MGT image format";
|
||||
}
|
||||
|
||||
const char *mgt_format::extensions() const
|
||||
const char *mgt_format::extensions() const noexcept
|
||||
{
|
||||
return "mgt,dsk";
|
||||
}
|
||||
|
||||
bool mgt_format::supports_save() const
|
||||
bool mgt_format::supports_save() const noexcept
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@ -76,7 +76,7 @@ int mgt_format::identify(util::random_read &io, uint32_t form_factor, const std:
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool mgt_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const
|
||||
bool mgt_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const
|
||||
{
|
||||
uint64_t size;
|
||||
if(io.length(size))
|
||||
@ -100,11 +100,11 @@ bool mgt_format::load(util::random_read &io, uint32_t form_factor, const std::ve
|
||||
}
|
||||
}
|
||||
|
||||
image->set_variant(floppy_image::DSDD);
|
||||
image.set_variant(floppy_image::DSDD);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool mgt_format::save(util::random_read_write &io, const std::vector<uint32_t> &variants, floppy_image *image) const
|
||||
bool mgt_format::save(util::random_read_write &io, const std::vector<uint32_t> &variants, const floppy_image &image) const
|
||||
{
|
||||
int track_count, head_count, sector_count;
|
||||
get_geometry_mfm_pc(image, 2000, track_count, head_count, sector_count);
|
||||
|
@ -20,13 +20,13 @@ public:
|
||||
mgt_format();
|
||||
|
||||
virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants) const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const override;
|
||||
virtual bool save(util::random_read_write &io, const std::vector<uint32_t> &variants, floppy_image *image) const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const override;
|
||||
virtual bool save(util::random_read_write &io, const std::vector<uint32_t> &variants, const floppy_image &image) const override;
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual bool supports_save() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
virtual bool supports_save() const noexcept override;
|
||||
|
||||
static const floppy_image_format_t::desc_e desc_10[];
|
||||
};
|
||||
|
@ -78,17 +78,17 @@ cp68_format::cp68_format() : wd177x_format(cp68_formats::formats)
|
||||
{
|
||||
}
|
||||
|
||||
const char *cp68_format::name() const
|
||||
const char *cp68_format::name() const noexcept
|
||||
{
|
||||
return "cp68";
|
||||
}
|
||||
|
||||
const char *cp68_format::description() const
|
||||
const char *cp68_format::description() const noexcept
|
||||
{
|
||||
return "CP/68 compatible disk image";
|
||||
}
|
||||
|
||||
const char *cp68_format::extensions() const
|
||||
const char *cp68_format::extensions() const noexcept
|
||||
{
|
||||
return "dsk";
|
||||
}
|
||||
|
@ -18,9 +18,9 @@ class cp68_format : public wd177x_format
|
||||
public:
|
||||
cp68_format();
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants) const override;
|
||||
virtual int find_size(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants) const override;
|
||||
virtual const wd177x_format::format &get_track_format(const format &f, int head, int track) const override;
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:Olivier Galibert
|
||||
/*********************************************************************
|
||||
|
||||
formats/cpis_dsk.c
|
||||
formats/cpis_dsk.cpp
|
||||
|
||||
Telenova Compis disk images
|
||||
|
||||
@ -14,17 +14,17 @@ cpis_format::cpis_format() : upd765_format(formats)
|
||||
{
|
||||
}
|
||||
|
||||
const char *cpis_format::name() const
|
||||
const char *cpis_format::name() const noexcept
|
||||
{
|
||||
return "cpis";
|
||||
}
|
||||
|
||||
const char *cpis_format::description() const
|
||||
const char *cpis_format::description() const noexcept
|
||||
{
|
||||
return "COMPIS disk image";
|
||||
}
|
||||
|
||||
const char *cpis_format::extensions() const
|
||||
const char *cpis_format::extensions() const noexcept
|
||||
{
|
||||
return "dsk,img";
|
||||
}
|
||||
|
@ -18,9 +18,9 @@ class cpis_format : public upd765_format {
|
||||
public:
|
||||
cpis_format();
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
|
||||
private:
|
||||
static const format formats[];
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:Miodrag Milanovic
|
||||
/*********************************************************************
|
||||
|
||||
formats/cqm_dsk.c
|
||||
formats/cqm_dsk.cpp
|
||||
|
||||
CopyQM disk images
|
||||
|
||||
@ -240,17 +240,17 @@ cqm_format::cqm_format()
|
||||
{
|
||||
}
|
||||
|
||||
const char *cqm_format::name() const
|
||||
const char *cqm_format::name() const noexcept
|
||||
{
|
||||
return "cqm";
|
||||
}
|
||||
|
||||
const char *cqm_format::description() const
|
||||
const char *cqm_format::description() const noexcept
|
||||
{
|
||||
return "CopyQM disk image";
|
||||
}
|
||||
|
||||
const char *cqm_format::extensions() const
|
||||
const char *cqm_format::extensions() const noexcept
|
||||
{
|
||||
return "cqm,cqi,dsk";
|
||||
}
|
||||
@ -267,7 +267,7 @@ int cqm_format::identify(util::random_read &io, uint32_t form_factor, const std:
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool cqm_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const
|
||||
bool cqm_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const
|
||||
{
|
||||
size_t actual;
|
||||
const int max_size = 4*1024*1024; // 4MB ought to be large enough for any floppy
|
||||
@ -291,19 +291,19 @@ bool cqm_format::load(util::random_read &io, uint32_t form_factor, const std::ve
|
||||
{
|
||||
case 0:
|
||||
if (form_factor == floppy_image::FF_525 && tracks > 50)
|
||||
image->set_variant(heads == 1 ? floppy_image::SSQD : floppy_image::DSQD);
|
||||
image.set_variant(heads == 1 ? floppy_image::SSQD : floppy_image::DSQD);
|
||||
else
|
||||
image->set_variant(heads == 1 ? floppy_image::SSDD : floppy_image::DSDD);
|
||||
image.set_variant(heads == 1 ? floppy_image::SSDD : floppy_image::DSDD);
|
||||
break;
|
||||
case 1:
|
||||
if (heads == 1)
|
||||
return false; // single side HD ?
|
||||
image->set_variant(floppy_image::DSHD);
|
||||
image.set_variant(floppy_image::DSHD);
|
||||
break;
|
||||
case 2:
|
||||
if (heads == 1)
|
||||
return false; // single side ED ?
|
||||
image->set_variant(floppy_image::DSED);
|
||||
image.set_variant(floppy_image::DSED);
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
@ -367,12 +367,12 @@ bool cqm_format::load(util::random_read &io, uint32_t form_factor, const std::ve
|
||||
return true;
|
||||
}
|
||||
|
||||
bool cqm_format::save(util::random_read_write &io, const std::vector<uint32_t> &variants, floppy_image *image) const
|
||||
bool cqm_format::save(util::random_read_write &io, const std::vector<uint32_t> &variants, const floppy_image &image) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool cqm_format::supports_save() const
|
||||
bool cqm_format::supports_save() const noexcept
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -20,13 +20,13 @@ public:
|
||||
cqm_format();
|
||||
|
||||
virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants) const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const override;
|
||||
virtual bool save(util::random_read_write &io, const std::vector<uint32_t> &variants, floppy_image *image) const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const override;
|
||||
virtual bool save(util::random_read_write &io, const std::vector<uint32_t> &variants, const floppy_image &image) const override;
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual bool supports_save() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
virtual bool supports_save() const noexcept override;
|
||||
};
|
||||
|
||||
extern const cqm_format FLOPPY_CQM_FORMAT;
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:Curt Coder
|
||||
/*********************************************************************
|
||||
|
||||
formats/d64_dsk.c
|
||||
formats/d64_dsk.cpp
|
||||
|
||||
Commodore 4040/1541/1551 sector disk image format
|
||||
|
||||
@ -29,17 +29,17 @@ d64_format::d64_format(const format *_formats)
|
||||
formats = _formats;
|
||||
}
|
||||
|
||||
const char *d64_format::name() const
|
||||
const char *d64_format::name() const noexcept
|
||||
{
|
||||
return "d64";
|
||||
}
|
||||
|
||||
const char *d64_format::description() const
|
||||
const char *d64_format::description() const noexcept
|
||||
{
|
||||
return "Commodore 4040/1541/1551 disk image";
|
||||
}
|
||||
|
||||
const char *d64_format::extensions() const
|
||||
const char *d64_format::extensions() const noexcept
|
||||
{
|
||||
return "d64";
|
||||
}
|
||||
@ -217,7 +217,7 @@ void d64_format::fix_end_gap(floppy_image_format_t::desc_e* desc, int remaining_
|
||||
desc[22].p1 >>= remaining_size & 0x01;
|
||||
}
|
||||
|
||||
bool d64_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const
|
||||
bool d64_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const
|
||||
{
|
||||
int type = find_size(io, form_factor);
|
||||
if(type == -1)
|
||||
@ -275,12 +275,12 @@ bool d64_format::load(util::random_read &io, uint32_t form_factor, const std::ve
|
||||
}
|
||||
}
|
||||
|
||||
image->set_variant(f.variant);
|
||||
image.set_variant(f.variant);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool d64_format::save(util::random_read_write &io, const std::vector<uint32_t> &variants, floppy_image *image) const
|
||||
bool d64_format::save(util::random_read_write &io, const std::vector<uint32_t> &variants, const floppy_image &image) const
|
||||
{
|
||||
const format &f = formats[0];
|
||||
|
||||
@ -302,7 +302,7 @@ bool d64_format::save(util::random_read_write &io, const std::vector<uint32_t> &
|
||||
return true;
|
||||
}
|
||||
|
||||
void d64_format::extract_sectors(floppy_image *image, const format &f, desc_s *sdesc, int track, int head, int sector_count) const
|
||||
void d64_format::extract_sectors(const floppy_image &image, const format &f, desc_s *sdesc, int track, int head, int sector_count) const
|
||||
{
|
||||
int physical_track = this->get_physical_track(f, head, track);
|
||||
int cell_size = this->get_cell_size(f, track);
|
||||
|
@ -33,14 +33,14 @@ public:
|
||||
d64_format();
|
||||
d64_format(const format *formats);
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
|
||||
virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants) const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const override;
|
||||
virtual bool save(util::random_read_write &io, const std::vector<uint32_t> &variants, floppy_image *image) const override;
|
||||
virtual bool supports_save() const override { return true; }
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const override;
|
||||
virtual bool save(util::random_read_write &io, const std::vector<uint32_t> &variants, const floppy_image &image) const override;
|
||||
virtual bool supports_save() const noexcept override { return true; }
|
||||
|
||||
protected:
|
||||
enum
|
||||
@ -73,7 +73,7 @@ protected:
|
||||
virtual floppy_image_format_t::desc_e* get_sector_desc(const format &f, int ¤t_size, int sector_count, uint8_t id1, uint8_t id2, int gap_2) const;
|
||||
void build_sector_description(const format &f, uint8_t *sectdata, uint32_t sect_offs, uint32_t error_offs, desc_s *sectors, int sector_count) const;
|
||||
virtual void fix_end_gap(floppy_image_format_t::desc_e* desc, int remaining_size) const;
|
||||
void extract_sectors(floppy_image *image, const format &f, desc_s *sdesc, int track, int head, int sector_count) const;
|
||||
void extract_sectors(const floppy_image &image, const format &f, desc_s *sdesc, int track, int head, int sector_count) const;
|
||||
|
||||
static const format file_formats[];
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:Curt Coder
|
||||
/*********************************************************************
|
||||
|
||||
formats/d71_dsk.c
|
||||
formats/d71_dsk.cpp
|
||||
|
||||
Commodore 1571 sector disk image format
|
||||
|
||||
@ -14,17 +14,17 @@ d71_format::d71_format() : d64_format(formats)
|
||||
{
|
||||
}
|
||||
|
||||
const char *d71_format::name() const
|
||||
const char *d71_format::name() const noexcept
|
||||
{
|
||||
return "d71";
|
||||
}
|
||||
|
||||
const char *d71_format::description() const
|
||||
const char *d71_format::description() const noexcept
|
||||
{
|
||||
return "Commodore 1571 disk image";
|
||||
}
|
||||
|
||||
const char *d71_format::extensions() const
|
||||
const char *d71_format::extensions() const noexcept
|
||||
{
|
||||
return "d71";
|
||||
}
|
||||
|
@ -19,9 +19,9 @@ class d71_format : public d64_format
|
||||
public:
|
||||
d71_format();
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
|
||||
protected:
|
||||
static const format formats[];
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:Curt Coder
|
||||
/*********************************************************************
|
||||
|
||||
formats/d80_dsk.c
|
||||
formats/d80_dsk.cpp
|
||||
|
||||
Commodore 8050 sector disk image format
|
||||
|
||||
@ -21,17 +21,17 @@ d80_format::d80_format(const format *_formats) : d64_format(_formats), formats(n
|
||||
{
|
||||
}
|
||||
|
||||
const char *d80_format::name() const
|
||||
const char *d80_format::name() const noexcept
|
||||
{
|
||||
return "d80";
|
||||
}
|
||||
|
||||
const char *d80_format::description() const
|
||||
const char *d80_format::description() const noexcept
|
||||
{
|
||||
return "Commodore 8050 disk image";
|
||||
}
|
||||
|
||||
const char *d80_format::extensions() const
|
||||
const char *d80_format::extensions() const noexcept
|
||||
{
|
||||
return "d80";
|
||||
}
|
||||
|
@ -20,9 +20,9 @@ public:
|
||||
d80_format();
|
||||
d80_format(const format *formats);
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
|
||||
protected:
|
||||
const format *formats;
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:Curt Coder
|
||||
/*********************************************************************
|
||||
|
||||
formats/d81_dsk.c
|
||||
formats/d81_dsk.cpp
|
||||
|
||||
Commodore 1581 disk image format
|
||||
|
||||
@ -79,17 +79,17 @@ d81_format::d81_format() : wd177x_format(formats)
|
||||
{
|
||||
}
|
||||
|
||||
const char *d81_format::name() const
|
||||
const char *d81_format::name() const noexcept
|
||||
{
|
||||
return "d81";
|
||||
}
|
||||
|
||||
const char *d81_format::description() const
|
||||
const char *d81_format::description() const noexcept
|
||||
{
|
||||
return "Commodore 1581 disk image";
|
||||
}
|
||||
|
||||
const char *d81_format::extensions() const
|
||||
const char *d81_format::extensions() const noexcept
|
||||
{
|
||||
return "d81";
|
||||
}
|
||||
|
@ -19,9 +19,9 @@ class d81_format : public wd177x_format
|
||||
public:
|
||||
d81_format();
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
|
||||
virtual floppy_image_format_t::desc_e* get_desc_mfm(const format &f, int ¤t_size, int &end_gap_index) const override;
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:Curt Coder
|
||||
/*********************************************************************
|
||||
|
||||
formats/d82_dsk.c
|
||||
formats/d82_dsk.cpp
|
||||
|
||||
Commodore 8250/SFD-1001 sector disk image format
|
||||
|
||||
@ -14,17 +14,17 @@ d82_format::d82_format() : d80_format(file_formats)
|
||||
{
|
||||
}
|
||||
|
||||
const char *d82_format::name() const
|
||||
const char *d82_format::name() const noexcept
|
||||
{
|
||||
return "d82";
|
||||
}
|
||||
|
||||
const char *d82_format::description() const
|
||||
const char *d82_format::description() const noexcept
|
||||
{
|
||||
return "Commodore 8250/SFD-1001 disk image";
|
||||
}
|
||||
|
||||
const char *d82_format::extensions() const
|
||||
const char *d82_format::extensions() const noexcept
|
||||
{
|
||||
return "d82";
|
||||
}
|
||||
|
@ -19,9 +19,9 @@ class d82_format : public d80_format
|
||||
public:
|
||||
d82_format();
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
|
||||
protected:
|
||||
static const format file_formats[];
|
||||
|
@ -377,7 +377,7 @@ FLOPPY_CONSTRUCT(d88_dsk_construct)
|
||||
// copyright-holders:Olivier Galibert
|
||||
/*********************************************************************
|
||||
|
||||
formats/d88_dsk.h
|
||||
formats/d88_dsk.cpp
|
||||
|
||||
D88 disk images
|
||||
|
||||
@ -389,17 +389,17 @@ d88_format::d88_format()
|
||||
{
|
||||
}
|
||||
|
||||
const char *d88_format::name() const
|
||||
const char *d88_format::name() const noexcept
|
||||
{
|
||||
return "d88";
|
||||
}
|
||||
|
||||
const char *d88_format::description() const
|
||||
const char *d88_format::description() const noexcept
|
||||
{
|
||||
return "D88 disk image";
|
||||
}
|
||||
|
||||
const char *d88_format::extensions() const
|
||||
const char *d88_format::extensions() const noexcept
|
||||
{
|
||||
return "d77,d88,1dd";
|
||||
}
|
||||
@ -420,7 +420,7 @@ int d88_format::identify(util::random_read &io, uint32_t form_factor, const std:
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool d88_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const
|
||||
bool d88_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const
|
||||
{
|
||||
size_t actual;
|
||||
|
||||
@ -435,35 +435,35 @@ bool d88_format::load(util::random_read &io, uint32_t form_factor, const std::ve
|
||||
cell_count = 100000;
|
||||
track_count = 42;
|
||||
head_count = 2;
|
||||
image->set_variant(floppy_image::DSDD);
|
||||
image.set_variant(floppy_image::DSDD);
|
||||
break;
|
||||
|
||||
case 0x10:
|
||||
cell_count = 100000;
|
||||
track_count = 82;
|
||||
head_count = 2;
|
||||
image->set_variant(floppy_image::DSQD);
|
||||
image.set_variant(floppy_image::DSQD);
|
||||
break;
|
||||
|
||||
case 0x20:
|
||||
cell_count = form_factor == floppy_image::FF_35 ? 200000 : 166666;
|
||||
track_count = 82;
|
||||
head_count = 2;
|
||||
image->set_variant(floppy_image::DSHD);
|
||||
image.set_variant(floppy_image::DSHD);
|
||||
break;
|
||||
|
||||
case 0x30:
|
||||
cell_count = 100000;
|
||||
track_count = 42;
|
||||
head_count = 1;
|
||||
image->set_variant(floppy_image::SSDD);
|
||||
image.set_variant(floppy_image::SSDD);
|
||||
break;
|
||||
|
||||
case 0x40:
|
||||
cell_count = 100000;
|
||||
track_count = 82;
|
||||
head_count = 1;
|
||||
image->set_variant(floppy_image::SSQD);
|
||||
image.set_variant(floppy_image::SSQD);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -537,7 +537,7 @@ bool d88_format::load(util::random_read &io, uint32_t form_factor, const std::ve
|
||||
return true;
|
||||
}
|
||||
|
||||
bool d88_format::supports_save() const
|
||||
bool d88_format::supports_save() const noexcept
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -21,12 +21,12 @@ public:
|
||||
d88_format();
|
||||
|
||||
virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants) const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const override;
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual bool supports_save() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
virtual bool supports_save() const noexcept override;
|
||||
};
|
||||
|
||||
extern const d88_format FLOPPY_D88_FORMAT;
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:Fabio Priuli
|
||||
/*********************************************************************
|
||||
|
||||
formats/dcp_dsk.h
|
||||
formats/dcp_dsk.cpp
|
||||
|
||||
PC98 DCP & DCU disk images
|
||||
|
||||
@ -29,17 +29,17 @@ dcp_format::dcp_format()
|
||||
{
|
||||
}
|
||||
|
||||
const char *dcp_format::name() const
|
||||
const char *dcp_format::name() const noexcept
|
||||
{
|
||||
return "dcx";
|
||||
}
|
||||
|
||||
const char *dcp_format::description() const
|
||||
const char *dcp_format::description() const noexcept
|
||||
{
|
||||
return "DCP/DCU disk image";
|
||||
}
|
||||
|
||||
const char *dcp_format::extensions() const
|
||||
const char *dcp_format::extensions() const noexcept
|
||||
{
|
||||
return "dcp,dcu";
|
||||
}
|
||||
@ -117,7 +117,7 @@ int dcp_format::identify(util::random_read &io, uint32_t form_factor, const std:
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool dcp_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const
|
||||
bool dcp_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const
|
||||
{
|
||||
size_t actual;
|
||||
uint8_t h[0xa2];
|
||||
@ -300,7 +300,7 @@ bool dcp_format::load(util::random_read &io, uint32_t form_factor, const std::ve
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dcp_format::supports_save() const
|
||||
bool dcp_format::supports_save() const noexcept
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -21,12 +21,12 @@ public:
|
||||
dcp_format();
|
||||
|
||||
virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants) const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const override;
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual bool supports_save() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
virtual bool supports_save() const noexcept override;
|
||||
};
|
||||
|
||||
extern const dcp_format FLOPPY_DCP_FORMAT;
|
||||
|
@ -40,22 +40,22 @@ dfi_format::dfi_format() : floppy_image_format_t()
|
||||
{
|
||||
}
|
||||
|
||||
const char *dfi_format::name() const
|
||||
const char *dfi_format::name() const noexcept
|
||||
{
|
||||
return "dfi";
|
||||
}
|
||||
|
||||
const char *dfi_format::description() const
|
||||
const char *dfi_format::description() const noexcept
|
||||
{
|
||||
return "DiscFerret flux dump format";
|
||||
}
|
||||
|
||||
const char *dfi_format::extensions() const
|
||||
const char *dfi_format::extensions() const noexcept
|
||||
{
|
||||
return "dfi";
|
||||
}
|
||||
|
||||
bool dfi_format::supports_save() const
|
||||
bool dfi_format::supports_save() const noexcept
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -68,7 +68,7 @@ int dfi_format::identify(util::random_read &io, uint32_t form_factor, const std:
|
||||
return memcmp(sign, "DFE2", 4) ? 0 : FIFID_SIGN;
|
||||
}
|
||||
|
||||
bool dfi_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const
|
||||
bool dfi_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const
|
||||
{
|
||||
size_t actual;
|
||||
char sign[4];
|
||||
@ -165,7 +165,7 @@ bool dfi_format::load(util::random_read &io, uint32_t form_factor, const std::ve
|
||||
if(!index_time)
|
||||
index_time = total_time;
|
||||
|
||||
std::vector<uint32_t> &buf = image->get_buffer(track, head);
|
||||
std::vector<uint32_t> &buf = image.get_buffer(track, head);
|
||||
buf.resize(tsize);
|
||||
|
||||
int cur_time = 0;
|
||||
|
@ -13,12 +13,12 @@ public:
|
||||
dfi_format();
|
||||
|
||||
virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants) const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const override;
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual bool supports_save() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
virtual bool supports_save() const noexcept override;
|
||||
};
|
||||
|
||||
extern const dfi_format FLOPPY_DFI_FORMAT;
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:Olivier Galibert
|
||||
/*********************************************************************
|
||||
|
||||
formats/dim_dsk.c
|
||||
formats/dim_dsk.cpp
|
||||
|
||||
DIM disk images
|
||||
|
||||
@ -18,17 +18,17 @@ dim_format::dim_format()
|
||||
{
|
||||
}
|
||||
|
||||
const char *dim_format::name() const
|
||||
const char *dim_format::name() const noexcept
|
||||
{
|
||||
return "dim";
|
||||
}
|
||||
|
||||
const char *dim_format::description() const
|
||||
const char *dim_format::description() const noexcept
|
||||
{
|
||||
return "DIM disk image";
|
||||
}
|
||||
|
||||
const char *dim_format::extensions() const
|
||||
const char *dim_format::extensions() const noexcept
|
||||
{
|
||||
return "dim";
|
||||
}
|
||||
@ -46,7 +46,7 @@ int dim_format::identify(util::random_read &io, uint32_t form_factor, const std:
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool dim_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const
|
||||
bool dim_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const
|
||||
{
|
||||
size_t actual;
|
||||
int offset = 0x100;
|
||||
@ -126,7 +126,7 @@ bool dim_format::load(util::random_read &io, uint32_t form_factor, const std::ve
|
||||
}
|
||||
|
||||
|
||||
bool dim_format::supports_save() const
|
||||
bool dim_format::supports_save() const noexcept
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -22,12 +22,12 @@ public:
|
||||
dim_format();
|
||||
|
||||
virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants) const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const override;
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual bool supports_save() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
virtual bool supports_save() const noexcept override;
|
||||
};
|
||||
|
||||
extern const dim_format FLOPPY_DIM_FORMAT;
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:Fabio Priuli
|
||||
/*********************************************************************
|
||||
|
||||
formats/dip_dsk.h
|
||||
formats/dip_dsk.cpp
|
||||
|
||||
PC98 DIP disk images
|
||||
|
||||
@ -23,17 +23,17 @@ dip_format::dip_format()
|
||||
{
|
||||
}
|
||||
|
||||
const char *dip_format::name() const
|
||||
const char *dip_format::name() const noexcept
|
||||
{
|
||||
return "dip";
|
||||
}
|
||||
|
||||
const char *dip_format::description() const
|
||||
const char *dip_format::description() const noexcept
|
||||
{
|
||||
return "DIP disk image";
|
||||
}
|
||||
|
||||
const char *dip_format::extensions() const
|
||||
const char *dip_format::extensions() const noexcept
|
||||
{
|
||||
return "dip";
|
||||
}
|
||||
@ -50,7 +50,7 @@ int dip_format::identify(util::random_read &io, uint32_t form_factor, const std:
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool dip_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const
|
||||
bool dip_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const
|
||||
{
|
||||
int heads, tracks, spt, bps;
|
||||
|
||||
@ -93,7 +93,7 @@ bool dip_format::load(util::random_read &io, uint32_t form_factor, const std::ve
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dip_format::supports_save() const
|
||||
bool dip_format::supports_save() const noexcept
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -21,12 +21,12 @@ public:
|
||||
dip_format();
|
||||
|
||||
virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants) const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const override;
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual bool supports_save() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
virtual bool supports_save() const noexcept override;
|
||||
};
|
||||
|
||||
extern const dip_format FLOPPY_DIP_FORMAT;
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:Wilbert Pol
|
||||
/*********************************************************************
|
||||
|
||||
formats/dmk_dsk.h
|
||||
formats/dmk_dsk.cpp
|
||||
|
||||
DMK disk images
|
||||
|
||||
@ -48,19 +48,19 @@ dmk_format::dmk_format()
|
||||
}
|
||||
|
||||
|
||||
const char *dmk_format::name() const
|
||||
const char *dmk_format::name() const noexcept
|
||||
{
|
||||
return "dmk";
|
||||
}
|
||||
|
||||
|
||||
const char *dmk_format::description() const
|
||||
const char *dmk_format::description() const noexcept
|
||||
{
|
||||
return "DMK disk image";
|
||||
}
|
||||
|
||||
|
||||
const char *dmk_format::extensions() const
|
||||
const char *dmk_format::extensions() const noexcept
|
||||
{
|
||||
return "dmk";
|
||||
}
|
||||
@ -108,7 +108,7 @@ int dmk_format::identify(util::random_read &io, uint32_t form_factor, const std:
|
||||
}
|
||||
|
||||
|
||||
bool dmk_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const
|
||||
bool dmk_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const
|
||||
{
|
||||
size_t actual;
|
||||
|
||||
@ -144,7 +144,7 @@ bool dmk_format::load(util::random_read &io, uint32_t form_factor, const std::ve
|
||||
variant = floppy_image::SSDD;
|
||||
}
|
||||
}
|
||||
image->set_variant(variant);
|
||||
image.set_variant(variant);
|
||||
|
||||
int fm_stride = is_sd ? 1 : 2;
|
||||
|
||||
@ -330,7 +330,7 @@ bool dmk_format::load(util::random_read &io, uint32_t form_factor, const std::ve
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dmk_format::supports_save() const
|
||||
bool dmk_format::supports_save() const noexcept
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -22,12 +22,12 @@ public:
|
||||
dmk_format();
|
||||
|
||||
virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants) const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const override;
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual bool supports_save() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
virtual bool supports_save() const noexcept override;
|
||||
};
|
||||
|
||||
extern const dmk_format FLOPPY_DMK_FORMAT;
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:Olivier Galibert
|
||||
/*********************************************************************
|
||||
|
||||
formats/dmv_dsk.c
|
||||
formats/dmv_dsk.cpp
|
||||
|
||||
NCR Decision Mate V format
|
||||
|
||||
@ -14,17 +14,17 @@ dmv_format::dmv_format() : upd765_format(formats)
|
||||
{
|
||||
}
|
||||
|
||||
const char *dmv_format::name() const
|
||||
const char *dmv_format::name() const noexcept
|
||||
{
|
||||
return "dmv";
|
||||
}
|
||||
|
||||
const char *dmv_format::description() const
|
||||
const char *dmv_format::description() const noexcept
|
||||
{
|
||||
return "Decision Mate V disk image";
|
||||
}
|
||||
|
||||
const char *dmv_format::extensions() const
|
||||
const char *dmv_format::extensions() const noexcept
|
||||
{
|
||||
return "img";
|
||||
}
|
||||
|
@ -19,9 +19,9 @@ class dmv_format : public upd765_format
|
||||
public:
|
||||
dmv_format();
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
|
||||
private:
|
||||
static const format formats[];
|
||||
|
@ -49,17 +49,17 @@ ds9_format::ds9_format()
|
||||
{
|
||||
}
|
||||
|
||||
const char *ds9_format::name() const
|
||||
const char *ds9_format::name() const noexcept
|
||||
{
|
||||
return "a9dsk";
|
||||
}
|
||||
|
||||
const char *ds9_format::description() const
|
||||
const char *ds9_format::description() const noexcept
|
||||
{
|
||||
return "Agat-9 840K floppy image";
|
||||
}
|
||||
|
||||
const char *ds9_format::extensions() const
|
||||
const char *ds9_format::extensions() const noexcept
|
||||
{
|
||||
return "ds9";
|
||||
}
|
||||
@ -89,7 +89,7 @@ int ds9_format::identify(util::random_read &io, uint32_t form_factor, const std:
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool ds9_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const
|
||||
bool ds9_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const
|
||||
{
|
||||
uint8_t track_count, head_count, sector_count;
|
||||
find_size(io, track_count, head_count, sector_count);
|
||||
@ -115,7 +115,7 @@ bool ds9_format::load(util::random_read &io, uint32_t form_factor, const std::ve
|
||||
}
|
||||
}
|
||||
|
||||
image->set_variant(floppy_image::DSQD);
|
||||
image.set_variant(floppy_image::DSQD);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -18,12 +18,12 @@ public:
|
||||
ds9_format();
|
||||
|
||||
virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants) const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const override;
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual bool supports_save() const override { return false; }
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
virtual bool supports_save() const noexcept override { return false; }
|
||||
|
||||
static const desc_e ds9_desc[];
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:Olivier Galibert
|
||||
/*********************************************************************
|
||||
|
||||
formats/dsk_dsk.c
|
||||
formats/dsk_dsk.cpp
|
||||
|
||||
DSK disk images
|
||||
|
||||
@ -288,22 +288,22 @@ dsk_format::dsk_format() : floppy_image_format_t()
|
||||
{
|
||||
}
|
||||
|
||||
const char *dsk_format::name() const
|
||||
const char *dsk_format::name() const noexcept
|
||||
{
|
||||
return "dsk";
|
||||
}
|
||||
|
||||
const char *dsk_format::description() const
|
||||
const char *dsk_format::description() const noexcept
|
||||
{
|
||||
return "CPC DSK Format";
|
||||
}
|
||||
|
||||
const char *dsk_format::extensions() const
|
||||
const char *dsk_format::extensions() const noexcept
|
||||
{
|
||||
return "dsk";
|
||||
}
|
||||
|
||||
bool dsk_format::supports_save() const
|
||||
bool dsk_format::supports_save() const noexcept
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -354,7 +354,7 @@ struct sector_header
|
||||
|
||||
#pragma pack()
|
||||
|
||||
bool dsk_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const
|
||||
bool dsk_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const
|
||||
{
|
||||
size_t actual;
|
||||
|
||||
@ -378,7 +378,7 @@ bool dsk_format::load(util::random_read &io, uint32_t form_factor, const std::ve
|
||||
int tracks = header[0x30];
|
||||
|
||||
int img_tracks, img_heads;
|
||||
image->get_maximal_geometry(img_tracks, img_heads);
|
||||
image.get_maximal_geometry(img_tracks, img_heads);
|
||||
if (tracks > img_tracks)
|
||||
{
|
||||
if (tracks - img_tracks > DUMP_THRESHOLD)
|
||||
|
@ -20,12 +20,12 @@ public:
|
||||
dsk_format();
|
||||
|
||||
virtual int identify(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants) const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const override;
|
||||
virtual bool load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const override;
|
||||
|
||||
virtual const char *name() const override;
|
||||
virtual const char *description() const override;
|
||||
virtual const char *extensions() const override;
|
||||
virtual bool supports_save() const override;
|
||||
virtual const char *name() const noexcept override;
|
||||
virtual const char *description() const noexcept override;
|
||||
virtual const char *extensions() const noexcept override;
|
||||
virtual bool supports_save() const noexcept override;
|
||||
};
|
||||
|
||||
extern const dsk_format FLOPPY_DSK_FORMAT;
|
||||
|
@ -62,22 +62,22 @@ dvk_mx_format::dvk_mx_format()
|
||||
{
|
||||
}
|
||||
|
||||
const char *dvk_mx_format::name() const
|
||||
const char *dvk_mx_format::name() const noexcept
|
||||
{
|
||||
return "mx";
|
||||
}
|
||||
|
||||
const char *dvk_mx_format::description() const
|
||||
const char *dvk_mx_format::description() const noexcept
|
||||
{
|
||||
return "DVK MX: floppy image";
|
||||
}
|
||||
|
||||
const char *dvk_mx_format::extensions() const
|
||||
const char *dvk_mx_format::extensions() const noexcept
|
||||
{
|
||||
return "mx";
|
||||
}
|
||||
|
||||
bool dvk_mx_format::supports_save() const
|
||||
bool dvk_mx_format::supports_save() const noexcept
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -136,7 +136,7 @@ int dvk_mx_format::identify(util::random_read &io, uint32_t form_factor, const s
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool dvk_mx_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image) const
|
||||
bool dvk_mx_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image &image) const
|
||||
{
|
||||
uint8_t track_count, head_count, sector_count;
|
||||
|
||||
@ -165,17 +165,17 @@ bool dvk_mx_format::load(util::random_read &io, uint32_t form_factor, const std:
|
||||
|
||||
if (head_count == 1)
|
||||
{
|
||||
image->set_variant(floppy_image::SSDD);
|
||||
image.set_variant(floppy_image::SSDD);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (track_count > 40)
|
||||
{
|
||||
image->set_variant(floppy_image::DSQD);
|
||||
image.set_variant(floppy_image::DSQD);
|
||||
}
|
||||
else
|
||||
{
|
||||
image->set_variant(floppy_image::DSDD);
|
||||
image.set_variant(floppy_image::DSDD);
|
||||
}
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user