summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--src/lib/formats/pc_dsk.cpp5
-rw-r--r--src/lib/formats/upd765_dsk.cpp4
-rw-r--r--src/lib/formats/upd765_dsk.h1
3 files changed, 8 insertions, 2 deletions
diff --git a/src/lib/formats/pc_dsk.cpp b/src/lib/formats/pc_dsk.cpp
index e7daeb1d829..cb54d5d9ce8 100644
--- a/src/lib/formats/pc_dsk.cpp
+++ b/src/lib/formats/pc_dsk.cpp
@@ -168,6 +168,11 @@ int pc_format::identify(io_generic *io, uint32_t form_factor)
file_header_skip_bytes = 0x200;
}
+ /* some 1.44MB images have a 1024-byte footer */
+ if (size == 1474560 + 0x400) {
+ file_footer_skip_bytes = 0x400;
+ }
+
return upd765_format::identify(io, form_factor);
}
diff --git a/src/lib/formats/upd765_dsk.cpp b/src/lib/formats/upd765_dsk.cpp
index 72e11257b89..67c7ce8b653 100644
--- a/src/lib/formats/upd765_dsk.cpp
+++ b/src/lib/formats/upd765_dsk.cpp
@@ -11,7 +11,7 @@
#include "emu.h" // emu_fatalerror
#include "formats/upd765_dsk.h"
-upd765_format::upd765_format(const format *_formats) : file_header_skip_bytes(0)
+upd765_format::upd765_format(const format *_formats) : file_header_skip_bytes(0), file_footer_skip_bytes(0)
{
formats = _formats;
}
@@ -24,7 +24,7 @@ int upd765_format::find_size(io_generic *io, uint32_t form_factor) const
if(form_factor != floppy_image::FF_UNKNOWN && form_factor != f.form_factor)
continue;
- if(size == file_header_skip_bytes + (uint64_t) compute_track_size(f) * f.track_count * f.head_count)
+ if(size == file_header_skip_bytes + (uint64_t) compute_track_size(f) * f.track_count * f.head_count + file_footer_skip_bytes)
return i;
}
return -1;
diff --git a/src/lib/formats/upd765_dsk.h b/src/lib/formats/upd765_dsk.h
index 980d21a396e..716a7bebb97 100644
--- a/src/lib/formats/upd765_dsk.h
+++ b/src/lib/formats/upd765_dsk.h
@@ -45,6 +45,7 @@ public:
protected:
uint64_t file_header_skip_bytes;
+ uint64_t file_footer_skip_bytes;
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);