summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/formats
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/formats')
-rw-r--r--src/lib/formats/d64_dsk.c7
-rw-r--r--src/lib/formats/d81_dsk.c80
-rw-r--r--src/lib/formats/flopimg.h6
-rw-r--r--src/lib/formats/g64_dsk.c4
4 files changed, 48 insertions, 49 deletions
diff --git a/src/lib/formats/d64_dsk.c b/src/lib/formats/d64_dsk.c
index 9d2ac61d289..9186f07d510 100644
--- a/src/lib/formats/d64_dsk.c
+++ b/src/lib/formats/d64_dsk.c
@@ -234,7 +234,7 @@ bool d64_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
floppy_image_format_t::desc_e *desc;
desc_s sectors[40];
int track_offset = 0, error_offset = 0;
-
+
UINT8 id1 = 0, id2 = 0;
get_disk_id(f, io, id1, id2);
@@ -251,7 +251,7 @@ bool d64_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
int remaining_size = total_size - current_size;
if(remaining_size < 0)
throw emu_fatalerror("d64_format: Incorrect track layout, max_size=%d, current_size=%d", total_size, current_size);
-
+
// Fixup the end gap
desc[21].p2 = remaining_size / 8;
desc[22].p2 = remaining_size & 7;
@@ -259,7 +259,7 @@ bool d64_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
build_sector_description(f, &img[track_offset], sectors, sector_count, &img[f.sector_count*f.sector_base_size + error_offset]);
generate_track(desc, physical_track, head, sectors, sector_count, total_size, image);
-
+
track_offset += track_size;
error_offset += sector_count;
}
@@ -272,7 +272,6 @@ bool d64_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
void d64_format::extract_sectors(floppy_image *image, const format &f, desc_s *sdesc, int track, int head)
{
-
}
bool d64_format::save(io_generic *io, floppy_image *image)
diff --git a/src/lib/formats/d81_dsk.c b/src/lib/formats/d81_dsk.c
index 1d5bfcb767b..b3924ab6a36 100644
--- a/src/lib/formats/d81_dsk.c
+++ b/src/lib/formats/d81_dsk.c
@@ -137,46 +137,46 @@ const d81_format::format d81_format::formats[] = {
floppy_image_format_t::desc_e* d81_format::get_desc_mfm(const format &f, int &current_size, int &end_gap_index)
{
- static floppy_image_format_t::desc_e desc[25] = {
- /* 00 */ { MFM, 0x4e, f.gap_1 },
- /* 01 */ { SECTOR_LOOP_START, 0, f.sector_count-1 },
- /* 02 */ { MFM, 0x00, 12 },
- /* 03 */ { CRC_CCITT_START, 1 },
- /* 04 */ { RAW, 0x4489, 3 },
- /* 05 */ { MFM, 0xfe, 1 },
- /* 06 */ { TRACK_ID },
- /* 07 */ { HEAD_ID_SWAP },
- /* 08 */ { SECTOR_ID },
- /* 09 */ { SIZE_ID },
- /* 10 */ { CRC_END, 1 },
- /* 11 */ { CRC, 1 },
- /* 12 */ { MFM, 0x4e, f.gap_2 },
- /* 13 */ { MFM, 0x00, 12 },
- /* 14 */ { CRC_CCITT_START, 2 },
- /* 15 */ { RAW, 0x4489, 3 },
- /* 16 */ { MFM, 0xfb, 1 },
- /* 17 */ { SECTOR_DATA, -1 },
- /* 18 */ { CRC_END, 2 },
- /* 19 */ { CRC, 2 },
- /* 20 */ { MFM, 0x4e, f.gap_3 },
- /* 21 */ { SECTOR_LOOP_END },
- /* 22 */ { MFM, 0x4e, 0 },
- /* 23 */ { RAWBITS, 0x9254, 0 },
- /* 24 */ { END }
- };
-
- current_size = f.gap_1*16;
- if(f.sector_base_size)
- current_size += f.sector_base_size * f.sector_count * 16;
- else {
- for(int j=0; j != f.sector_count; j++)
- current_size += f.per_sector_size[j] * 16;
- }
- current_size += (12+3+1+4+2+f.gap_2+12+3+1+2+f.gap_3) * f.sector_count * 16;
-
- end_gap_index = 22;
-
- return desc;
+ static floppy_image_format_t::desc_e desc[25] = {
+ /* 00 */ { MFM, 0x4e, f.gap_1 },
+ /* 01 */ { SECTOR_LOOP_START, 0, f.sector_count-1 },
+ /* 02 */ { MFM, 0x00, 12 },
+ /* 03 */ { CRC_CCITT_START, 1 },
+ /* 04 */ { RAW, 0x4489, 3 },
+ /* 05 */ { MFM, 0xfe, 1 },
+ /* 06 */ { TRACK_ID },
+ /* 07 */ { HEAD_ID_SWAP },
+ /* 08 */ { SECTOR_ID },
+ /* 09 */ { SIZE_ID },
+ /* 10 */ { CRC_END, 1 },
+ /* 11 */ { CRC, 1 },
+ /* 12 */ { MFM, 0x4e, f.gap_2 },
+ /* 13 */ { MFM, 0x00, 12 },
+ /* 14 */ { CRC_CCITT_START, 2 },
+ /* 15 */ { RAW, 0x4489, 3 },
+ /* 16 */ { MFM, 0xfb, 1 },
+ /* 17 */ { SECTOR_DATA, -1 },
+ /* 18 */ { CRC_END, 2 },
+ /* 19 */ { CRC, 2 },
+ /* 20 */ { MFM, 0x4e, f.gap_3 },
+ /* 21 */ { SECTOR_LOOP_END },
+ /* 22 */ { MFM, 0x4e, 0 },
+ /* 23 */ { RAWBITS, 0x9254, 0 },
+ /* 24 */ { END }
+ };
+
+ current_size = f.gap_1*16;
+ if(f.sector_base_size)
+ current_size += f.sector_base_size * f.sector_count * 16;
+ else {
+ for(int j=0; j != f.sector_count; j++)
+ current_size += f.per_sector_size[j] * 16;
+ }
+ current_size += (12+3+1+4+2+f.gap_2+12+3+1+2+f.gap_3) * f.sector_count * 16;
+
+ end_gap_index = 22;
+
+ return desc;
}
const floppy_format_type FLOPPY_D81_FORMAT = &floppy_image_format_creator<d81_format>;
diff --git a/src/lib/formats/flopimg.h b/src/lib/formats/flopimg.h
index fdf0a1d97c2..d693188f606 100644
--- a/src/lib/formats/flopimg.h
+++ b/src/lib/formats/flopimg.h
@@ -301,7 +301,7 @@ protected:
FM, //!< One byte in p1 to be fm-encoded, msb first, repeated p2 times
MFM, //!< One byte in p1 to be mfm-encoded, msb first, repeated p2 times
MFMBITS, //!< A value of p2 bits in p1 to be mfm-encoded, msb first
- GCR5, //!< One byte in p1 to be gcr5-encoded, repeated p2 times
+ GCR5, //!< One byte in p1 to be gcr5-encoded, repeated p2 times
RAW, //!< One 16 bits word in p1 to be written raw, msb first, repeated p2 times
RAWBYTE, //!< One 8 bit byte in p1 to be written raw, msb first, repeated p2 times
RAWBITS, //!< A value of p2 bits in p1 to be copied as-is, msb first
@@ -330,13 +330,13 @@ protected:
SECTOR_DATA_FM, //!< Sector data to fm-encode, which in p1, -1 for the current one per the sector id
SECTOR_DATA_O, //!< Sector data to mfm-encode, odd bits only, which in p1, -1 for the current one per the sector id
SECTOR_DATA_E, //!< Sector data to mfm-encode, even bits only, which in p1, -1 for the current one per the sector id
- SECTOR_DATA_GCR5, //!< Sector data to gcr5-encode, which in p1, -1 for the current one per the sector id
+ SECTOR_DATA_GCR5, //!< Sector data to gcr5-encode, which in p1, -1 for the current one per the sector id
SECTOR_DATA_MAC, //!< Transformed sector data + checksum, mac style, id in p1, -1 for the current one per the sector id
CRC_CCITT_START, //!< Start a CCITT CRC calculation, with the usual x^16 + x^12 + x^5 + 1 (11021) polynomial, p1 = crc id
CRC_CCITT_FM_START, //!< Start a CCITT CRC calculation, with the usual x^16 + x^12 + x^5 + 1 (11021) polynomial, p1 = crc id
CRC_AMIGA_START, //!< Start an amiga checksum calculation, p1 = crc id
- CRC_CBM_START, //<! Start a CBM checksum calculation (xor of original data values, gcr5-encoded), p1 = crc id
+ CRC_CBM_START, //<! Start a CBM checksum calculation (xor of original data values, gcr5-encoded), p1 = crc id
CRC_MACHEAD_START, //!< Start of the mac gcr6 sector header checksum calculation (xor of pre-encode 6-bits values, gcr6-encoded)
CRC_END, //!< End the checksum, p1 = crc id
CRC, //!< Write a checksum in the apporpriate format, p1 = crc id
diff --git a/src/lib/formats/g64_dsk.c b/src/lib/formats/g64_dsk.c
index 2107ba3e753..7ce61b87d8e 100644
--- a/src/lib/formats/g64_dsk.c
+++ b/src/lib/formats/g64_dsk.c
@@ -42,7 +42,7 @@
#include "emu.h"
#include "formats/g64_dsk.h"
-#define G64_FORMAT_HEADER "GCR-1541"
+#define G64_FORMAT_HEADER "GCR-1541"
g64_format::g64_format()
{
@@ -113,7 +113,7 @@ bool g64_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
if (pos > 0) {
track_size = pick_integer_le(img, pos, 2);
pos +=2;
-
+
if (speed_zone_offset[track] > 3)
throw emu_fatalerror("g64_format: Unsupported variable speed zones on track %d", track);