summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Curt Coder <curtcoder@mail.com>2013-01-07 20:51:34 +0000
committer Curt Coder <curtcoder@mail.com>2013-01-07 20:51:34 +0000
commitcc35a4ed7d9c821d5e64dd2dcbede7b128efd215 (patch)
tree87332c5627263462ee527e3b0cfc335ea9b810df
parent15604c6fc1858da5c2c5280a06fc126d95920854 (diff)
flopimg: FM WIP (nw)
-rw-r--r--src/lib/formats/flopimg.c2
-rw-r--r--src/lib/formats/wd177x_dsk.c61
-rw-r--r--src/lib/formats/wd177x_dsk.h4
-rw-r--r--src/mess/machine/comx_fd.c2
4 files changed, 36 insertions, 33 deletions
diff --git a/src/lib/formats/flopimg.c b/src/lib/formats/flopimg.c
index 591ad67c749..b33996fdeec 100644
--- a/src/lib/formats/flopimg.c
+++ b/src/lib/formats/flopimg.c
@@ -1269,7 +1269,7 @@ void floppy_image_format_t::fixup_crcs(UINT32 *buffer, gen_crc_info *crcs)
switch(crcs[i].type) {
case CRC_AMIGA: fixup_crc_amiga(buffer, crcs+i); break;
case CRC_CCITT: fixup_crc_ccitt(buffer, crcs+i); break;
- case CRC_CCITT_FM: fixup_crc_ccitt_fm(buffer, crcs+i); break;
+ case CRC_CCITT_FM:fixup_crc_ccitt_fm(buffer, crcs+i); break;
case CRC_MACHEAD: fixup_crc_machead(buffer, crcs+i); break;
}
if(crcs[i].fixup_mfm_clock) {
diff --git a/src/lib/formats/wd177x_dsk.c b/src/lib/formats/wd177x_dsk.c
index 6a7d4d101c1..07302c5a82c 100644
--- a/src/lib/formats/wd177x_dsk.c
+++ b/src/lib/formats/wd177x_dsk.c
@@ -106,34 +106,32 @@ void wd177x_format::build_sector_description(const format &f, UINT8 *sectdata, d
}
}
-floppy_image_format_t::desc_e* wd177x_format::get_desc_fm(const format &f, int &current_size)
+floppy_image_format_t::desc_e* wd177x_format::get_desc_fm(const format &f, int &current_size, int &end_gap_index)
{
- static floppy_image_format_t::desc_e desc[25] = {
+ static floppy_image_format_t::desc_e desc[23] = {
/* 00 */ { FM, 0xff, f.gap_1 },
/* 01 */ { SECTOR_LOOP_START, 0, f.sector_count-1 },
/* 02 */ { FM, 0x00, 6 },
/* 03 */ { CRC_CCITT_FM_START, 1 },
- /* 04 */ { RAW, 0x4489, 0 }, // TODO remove
- /* 05 */ { FM, 0xfe, 1 },
- /* 06 */ { TRACK_ID_FM },
- /* 07 */ { HEAD_ID_FM },
- /* 08 */ { SECTOR_ID_FM },
- /* 09 */ { SIZE_ID_FM },
- /* 10 */ { CRC_END, 1 },
- /* 11 */ { CRC, 1 },
- /* 12 */ { FM, 0xff, f.gap_2 },
- /* 13 */ { FM, 0x00, 6 },
- /* 14 */ { CRC_CCITT_FM_START, 2 },
- /* 15 */ { RAW, 0x4489, 0 }, // TODO remove
- /* 16 */ { FM, 0xfb, 1 },
- /* 17 */ { SECTOR_DATA_FM, -1 },
- /* 18 */ { CRC_END, 2 },
- /* 19 */ { CRC, 2 },
- /* 20 */ { FM, 0xff, f.gap_3 },
- /* 21 */ { SECTOR_LOOP_END },
- /* 22 */ { FM, 0x00, 0 },
- /* 23 */ { RAWBITS, 0x9254, 0 },
- /* 24 */ { END }
+ /* 04 */ { FM, 0xfe, 1 },
+ /* 05 */ { TRACK_ID_FM },
+ /* 06 */ { HEAD_ID_FM },
+ /* 07 */ { SECTOR_ID_FM },
+ /* 08 */ { SIZE_ID_FM },
+ /* 09 */ { CRC_END, 1 },
+ /* 10 */ { CRC, 1 },
+ /* 11 */ { FM, 0xff, f.gap_2 },
+ /* 12 */ { FM, 0x00, 6 },
+ /* 13 */ { CRC_CCITT_FM_START, 2 },
+ /* 14 */ { FM, 0xfb, 1 },
+ /* 15 */ { SECTOR_DATA_FM, -1 },
+ /* 16 */ { CRC_END, 2 },
+ /* 17 */ { CRC, 2 },
+ /* 18 */ { FM, 0xff, f.gap_3 },
+ /* 19 */ { SECTOR_LOOP_END },
+ /* 20 */ { FM, 0x00, 0 },
+ /* 21 */ { RAWBITS, 0xffff, 0 },
+ /* 22 */ { END }
};
current_size = f.gap_1*16;
@@ -145,10 +143,12 @@ floppy_image_format_t::desc_e* wd177x_format::get_desc_fm(const format &f, int &
}
current_size += (6+1+4+2+f.gap_2+6+1+2+f.gap_3) * f.sector_count * 16;
+ end_gap_index = 20;
+
return desc;
}
-floppy_image_format_t::desc_e* wd177x_format::get_desc_mfm(const format &f, int &current_size)
+floppy_image_format_t::desc_e* wd177x_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 },
@@ -187,6 +187,8 @@ floppy_image_format_t::desc_e* wd177x_format::get_desc_mfm(const format &f, int
}
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;
}
@@ -199,15 +201,16 @@ bool wd177x_format::load(io_generic *io, UINT32 form_factor, floppy_image *image
const format &f = formats[type];
floppy_image_format_t::desc_e *desc;
int current_size;
+ int end_gap_index;
switch (f.encoding)
{
case floppy_image::FM:
- desc = get_desc_fm(f, current_size);
+ desc = get_desc_fm(f, current_size, end_gap_index);
break;
case floppy_image::MFM:
default:
- desc = get_desc_mfm(f, current_size);
+ desc = get_desc_mfm(f, current_size, end_gap_index);
break;
}
@@ -217,9 +220,9 @@ bool wd177x_format::load(io_generic *io, UINT32 form_factor, floppy_image *image
throw emu_fatalerror("wd177x_format: Incorrect track layout, max_size=%d, current_size=%d", total_size, current_size);
// Fixup the end gap
- desc[22].p2 = remaining_size / 16;
- desc[23].p2 = remaining_size & 15;
- desc[23].p1 >>= 16-(remaining_size & 15);
+ desc[end_gap_index].p2 = remaining_size / 16;
+ desc[end_gap_index + 1].p2 = remaining_size & 15;
+ desc[end_gap_index + 1].p1 >>= 16-(remaining_size & 15);
int track_size = compute_track_size(f);
diff --git a/src/lib/formats/wd177x_dsk.h b/src/lib/formats/wd177x_dsk.h
index e162e93c731..f08d1801ca9 100644
--- a/src/lib/formats/wd177x_dsk.h
+++ b/src/lib/formats/wd177x_dsk.h
@@ -42,8 +42,8 @@ public:
protected:
const format *formats;
- floppy_image_format_t::desc_e* get_desc_fm(const format &f, int &current_size);
- floppy_image_format_t::desc_e* get_desc_mfm(const format &f, int &current_size);
+ floppy_image_format_t::desc_e* get_desc_fm(const format &f, int &current_size, int &end_gap_index);
+ floppy_image_format_t::desc_e* get_desc_mfm(const format &f, int &current_size, int &end_gap_index);
int find_size(io_generic *io, UINT32 form_factor);
int compute_track_size(const format &f) const;
void build_sector_description(const format &d, UINT8 *sectdata, desc_s *sectors) const;
diff --git a/src/mess/machine/comx_fd.c b/src/mess/machine/comx_fd.c
index fff28fd1df7..4d91c1c7380 100644
--- a/src/mess/machine/comx_fd.c
+++ b/src/mess/machine/comx_fd.c
@@ -236,7 +236,7 @@ UINT8 comx_fd_device::comx_io_r(address_space &space, offs_t offset)
if (m_q)
{
data = 0xfe | (m_fdc->intrq_r() ? 1 : 0);
- logerror("%s FDC intrq read %02x\n", machine().describe_context(), data);
+ //logerror("%s FDC intrq read %02x\n", machine().describe_context(), data);
}
else
{