summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/formats/flopimg.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/formats/flopimg.h')
-rw-r--r--src/lib/formats/flopimg.h218
1 files changed, 109 insertions, 109 deletions
diff --git a/src/lib/formats/flopimg.h b/src/lib/formats/flopimg.h
index 73a7fa8c5aa..3539d52cd89 100644
--- a/src/lib/formats/flopimg.h
+++ b/src/lib/formats/flopimg.h
@@ -226,34 +226,34 @@ class floppy_image_format_t
public:
floppy_image_format_t();
virtual ~floppy_image_format_t();
-
+
/*! @brief Identify an image.
- The identify function tests if the image is valid
- for this particular format.
- @param io buffer containing the image data.
- @param form_factor Physical form factor of disk, from the enum
- in floppy_image
- @return 1 if image valid, 0 otherwise.
- */
+ The identify function tests if the image is valid
+ for this particular format.
+ @param io buffer containing the image data.
+ @param form_factor Physical form factor of disk, from the enum
+ in floppy_image
+ @return 1 if image valid, 0 otherwise.
+ */
virtual int identify(io_generic *io, UINT32 form_factor) = 0;
-
+
/*! @brief Load an image.
- The load function opens an image file and converts it to the
- internal MESS floppy representation.
- @param io source buffer containing the image data.
- @param form_factor Physical form factor of disk, from the enum
- in floppy_image
- @param image output buffer for data in MESS internal format.
- @return true on success, false otherwise.
- */
+ The load function opens an image file and converts it to the
+ internal MESS floppy representation.
+ @param io source buffer containing the image data.
+ @param form_factor Physical form factor of disk, from the enum
+ in floppy_image
+ @param image output buffer for data in MESS internal format.
+ @return true on success, false otherwise.
+ */
virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) = 0;
-
+
/*! @brief Save an image.
The save function writes back an image from the MESS internal
floppy representation to the appropriate format on disk.
@param io output buffer for the data in the on-disk format.
@param image source buffer containing data in MESS internal format.
- @return true on success, false otherwise.
+ @return true on success, false otherwise.
*/
virtual bool save(io_generic *io, floppy_image *image);
@@ -275,7 +275,7 @@ public:
//! @param file_name
//! @returns true if file matches the extension.
bool extension_matches(const char *file_name) const;
-
+
protected:
//! Input for convert_to_edge
enum {
@@ -289,16 +289,16 @@ protected:
// **** Reader helpers ****
//! Struct designed for easy track data description. Contains an opcode and two params.
-
+
//! Optional, you can always do things by hand, but useful nevertheless.
//! A vector of these structures describes one track.
-
+
struct desc_e {
int type, //!< An opcode
- p1, //!< first param
- p2; //!< second param
+ p1, //!< first param
+ p2; //!< second param
};
-
+
//! Opcodes of the format description language used by generate_track()
enum {
END, //!< End of description
@@ -347,40 +347,40 @@ protected:
/*! @brief Generate one track according to the description vector.
- @param desc track data description
- @param track
- @param head
- @param sect a vector indexed by sector id.
- @param sect_count number of sectors.
- @param track_size in _cells_, i.e. 100000 for a usual 2us-per-cell track at 300rpm.
- @param image
- */
+ @param desc track data description
+ @param track
+ @param head
+ @param sect a vector indexed by sector id.
+ @param sect_count number of sectors.
+ @param track_size in _cells_, i.e. 100000 for a usual 2us-per-cell track at 300rpm.
+ @param image
+ */
void generate_track(const desc_e *desc, int track, int head, const desc_s *sect, int sect_count, int track_size, floppy_image *image);
/*! @brief Generate a track from cell binary values, MSB-first.
- @param track
- @param head
- @param trackbuf track input buffer.
- @param track_size in cells, not bytes.
- @param image
- */
+ @param track
+ @param head
+ @param trackbuf track input buffer.
+ @param track_size in cells, not bytes.
+ @param image
+ */
void generate_track_from_bitstream(int track, int head, const UINT8 *trackbuf, int track_size, floppy_image *image);
//! @brief Generate a track from cell level values (0/1/W/D/N).
-
+
/*! Note that this function needs to be able to split cells in two,
- so no time value should be less than 2, and even values are a
- good idea.
- */
+ so no time value should be less than 2, and even values are a
+ good idea.
+ */
/*! @param track
- @param head
- @param trackbuf track input buffer.
- @param track_size in cells, not bytes.
- @param splice_pos is the position of the track splice. For normal
- formats, use -1. For protected formats, you're supposed to
- know. trackbuf may be modified at that position or after.
- @param image
- */
+ @param head
+ @param trackbuf track input buffer.
+ @param track_size in cells, not bytes.
+ @param splice_pos is the position of the track splice. For normal
+ formats, use -1. For protected formats, you're supposed to
+ know. trackbuf may be modified at that position or after.
+ @param image
+ */
void generate_track_from_levels(int track, int head, UINT32 *trackbuf, int track_size, int splice_pos, floppy_image *image);
//! Normalize the times in a cell buffer to sum up to 200000000
@@ -401,7 +401,7 @@ protected:
// Fastcopy Pro optimized formats, with fake sector header for
// faster verify and skew/interleave where appropriate
- static const desc_e atari_st_fcp_9[];
+ static const desc_e atari_st_fcp_9[];
static const desc_e *const atari_st_fcp_10[10];
static const desc_e atari_st_fcp_11[];
@@ -422,46 +422,46 @@ protected:
// **** Writer helpers ****
/*! @brief Rebuild a cell bitstream for a track.
- Takes the cell standard
- angular size as a parameter, gives out a msb-first bitstream.
-
- Beware that fuzzy bits will always give out the same value.
- @param track
- @param head
- @param cell_size
- @param trackbuf Output buffer size should be 34% more than the nominal number
- of cells (the dpll tolerates a cell size down to 75% of the
- nominal one, with gives a cell count of 1/0.75=1.333... times
- the nominal one).
- @param track_size Output size is given in bits (cells).
- @param image
- */
+ Takes the cell standard
+ angular size as a parameter, gives out a msb-first bitstream.
+
+ Beware that fuzzy bits will always give out the same value.
+ @param track
+ @param head
+ @param cell_size
+ @param trackbuf Output buffer size should be 34% more than the nominal number
+ of cells (the dpll tolerates a cell size down to 75% of the
+ nominal one, with gives a cell count of 1/0.75=1.333... times
+ the nominal one).
+ @param track_size Output size is given in bits (cells).
+ @param image
+ */
/*! @verbatim
- Computing the standard angular size of a cell is
- simple. Noting:
- d = standard cell duration in microseconds
- r = motor rotational speed in rpm
- then:
- a = r * d * 10 / 3.
- Some values:
- Type Cell RPM Size
-
- C1541 tr 1-17 3.25 300 3250
- C1541 tr 18-24 3.50 300 3500
- C1541 tr 25-30 3.75 300 3750
- C1541 tr 31+ 4.00 300 4000
- 5.25" SD 4 300 4000
- 5.25" DD 2 300 2000
- 5.25" HD 1 360 1200
- 3.5" SD 4 300 4000
- 3.5" DD 2 300 2000
- 3.5" HD 1 300 1000
- 3.5" ED 0.5 300 500
- @endverbatim
- */
+ Computing the standard angular size of a cell is
+ simple. Noting:
+ d = standard cell duration in microseconds
+ r = motor rotational speed in rpm
+ then:
+ a = r * d * 10 / 3.
+ Some values:
+ Type Cell RPM Size
+
+ C1541 tr 1-17 3.25 300 3250
+ C1541 tr 18-24 3.50 300 3500
+ C1541 tr 25-30 3.75 300 3750
+ C1541 tr 31+ 4.00 300 4000
+ 5.25" SD 4 300 4000
+ 5.25" DD 2 300 2000
+ 5.25" HD 1 360 1200
+ 3.5" SD 4 300 4000
+ 3.5" DD 2 300 2000
+ 3.5" HD 1 300 1000
+ 3.5" ED 0.5 300 500
+ @endverbatim
+ */
void generate_bitstream_from_track(int track, int head, int cell_size, UINT8 *trackbuf, int &track_size, floppy_image *image);
-
+
//! Defines a standard sector for extracting.
struct desc_xs {
int track, //!< Track for this sector
@@ -484,7 +484,7 @@ protected:
//! @brief Get a geometry (including sectors) from an image.
-
+
//! PC-type sectors with MFM encoding
void get_geometry_mfm_pc(floppy_image *image, int cell_size, int &track_count, int &head_count, int &sector_count);
@@ -519,7 +519,7 @@ protected:
private:
enum { CRC_NONE, CRC_AMIGA, CRC_CCITT, CRC_MACHEAD };
enum { MAX_CRC_COUNT = 64 };
-
+
//! Holds data used internally for generating CRCs.
struct gen_crc_info {
int type, //!< Type of CRC
@@ -598,7 +598,7 @@ public:
TIME_MASK = 0x0fffffff,
MG_MASK = 0xf0000000,
MG_SHIFT = 28, //!< Bitshift constant for magnetic orientation data
- MG_A = (0 << MG_SHIFT), //!< - 0, MG_A -> Magnetic orientation A
+ MG_A = (0 << MG_SHIFT), //!< - 0, MG_A -> Magnetic orientation A
MG_B = (1 << MG_SHIFT), //!< - 1, MG_B -> Magnetic orientation B
MG_N = (2 << MG_SHIFT), //!< - 2, MG_N -> Non-magnetized zone (neutral)
MG_D = (3 << MG_SHIFT) //!< - 3, MG_D -> Damaged zone, reads as neutral but cannot be changed by writing
@@ -626,30 +626,30 @@ public:
//! floppy_image constructor
/*!
- @param _tracks number of tracks.
- @param _heads number of heads.
- @param _form_factor form factor of drive (from enum)
- */
+ @param _tracks number of tracks.
+ @param _heads number of heads.
+ @param _form_factor form factor of drive (from enum)
+ */
floppy_image(int tracks, int heads, UINT32 form_factor);
virtual ~floppy_image();
-
+
//! @return the form factor.
UINT32 get_form_factor() { return form_factor; }
//! @return the variant.
UINT32 get_variant() { return variant; }
//! @param v the variant.
- void set_variant(UINT32 v) { variant = v; }
+ void set_variant(UINT32 v) { variant = v; }
/*!
- @param track
- @param head
- @param size size of this track
- */
+ @param track
+ @param head
+ @param size size of this track
+ */
void set_track_size(int track, int head, UINT32 size) { track_size[track][head] = size; ensure_alloc(track, head); }
-
+
/*!
@param track track number
- @param head head number
+ @param head head number
@return a pointer to the data buffer for this track and head
*/
UINT32 *get_buffer(int track, int head) { return cell_data[track][head]; }
@@ -657,7 +657,7 @@ public:
//! @param track
//! @param head
UINT32 get_track_size(int track, int head) { return track_size[track][head]; }
-
+
//! Sets the write splice position.
//! The "track splice" information indicates where to start writing
//! if you try to rewrite a physical disk with the data. Some
@@ -666,9 +666,9 @@ public:
//! representation is the angular position relative to the index.
/*! @param track
- @param head
- @param pos the position
- */
+ @param head
+ @param pos the position
+ */
void set_write_splice_position(int track, int head, UINT32 pos) { write_splice[track][head] = pos; }
//! @return the current write splice position.
UINT32 get_write_splice_position(int track, int head) const { return write_splice[track][head]; }
@@ -683,7 +683,7 @@ public:
static const char *get_variant_name(UINT32 form_factor, UINT32 variant);
private:
-
+
enum {
MAX_FLOPPY_HEADS = 2,
MAX_FLOPPY_TRACKS = 84