Skip to content

Commit

Permalink
Read one extra block in CHS imager mode. Workaround for some bad USB …
Browse files Browse the repository at this point in the history
…adapters/drives that unexpectedly have random corrupted data in last read block.
  • Loading branch information
tonioni committed Jul 20, 2018
1 parent 7ef41a6 commit 6657aa4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion od-win32/hardfile_win32.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit 6657aa4

Please sign in to comment.