From: Toni Wilen Date: Fri, 20 Jul 2018 12:23:44 +0000 (+0300) Subject: Read one extra block in CHS imager mode. Workaround for some bad USB adapters/drives... X-Git-Tag: 4100~145 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=6657aa4a2347054a13f72d78fc151c303deef3dd;p=francis%2Fwinuae.git Read one extra block in CHS imager mode. Workaround for some bad USB adapters/drives that unexpectedly have random corrupted data in last read block. --- diff --git a/od-win32/hardfile_win32.cpp b/od-win32/hardfile_win32.cpp index 563914fe..399ef3a8 100644 --- a/od-win32/hardfile_win32.cpp +++ b/od-win32/hardfile_win32.cpp @@ -3685,9 +3685,12 @@ int harddrive_to_hdf (HWND hDlg, struct uae_prefs *p, int idx) int seccnt = 0; uae_u8 *p = (uae_u8*)cache; while (seccnt < secs) { + int extrablock = 1; if (seccnt + readsize > secs) readsize = secs - seccnt; - do_scsi_read10_chs(h, -1, cyl, head, seccnt + 1, p, readsize, &specialaccessmode, false); + if (head == heads - 1 && cyl == cyls - 1) + extrablock = 0; + do_scsi_read10_chs(h, -1, cyl, head, seccnt + extrablock, p, readsize, &specialaccessmode, false); get = 512 * readsize; got = 512 * readsize; p += 512 * readsize;