Fixed the third batch of problems.

This commit is contained in:
OBattler
2020-01-15 04:58:28 +01:00
parent af023ff5dd
commit 932ad5595a
39 changed files with 127 additions and 80 deletions

View File

@@ -304,6 +304,7 @@ esdi_write(uint16_t port, uint8_t val, void *priv)
esdi->command &= ~0x03;
if (val & 0x02)
fatal("Read with ECC\n");
/*FALLTHROUGH*/
case 0xa0:
esdi->status = STAT_BUSY;
@@ -351,6 +352,7 @@ esdi_write(uint16_t port, uint8_t val, void *priv)
default:
esdi_at_log("WD1007: bad command %02X\n", val);
/*FALLTHROUGH*/
case 0xe8: /*???*/
esdi->status = STAT_BUSY;
timer_set_delay_u64(&esdi->callback_timer, 200 * HDC_TIME);

View File

@@ -757,6 +757,7 @@ ide_set_features(ide_t *ide)
default:
return 0;
}
break;
case FEATURE_ENABLE_IRQ_OVERLAPPED:
case FEATURE_ENABLE_IRQ_SERVICE:

View File

@@ -133,7 +133,8 @@ image_is_hdx(const wchar_t *s, int check_signature)
fclose(f);
return 0;
}
fread(&signature, 1, 8, f);
if (fread(&signature, 1, 8, f) != 8)
fatal("image_is_hdx(): Error reading signature\n");
fclose(f);
if (signature == 0xD778A82044445459ll)
return 1;
@@ -175,7 +176,8 @@ image_is_vhd(const wchar_t *s, int check_signature)
fclose(f);
return 0;
}
fread(&signature, 1, 8, f);
if (fread(&signature, 1, 8, f) != 8)
fatal("image_is_vhd(): Error reading signature\n");
fclose(f);
if (signature == 0x78697463656E6F63ll)
return 1;
@@ -770,7 +772,8 @@ hdd_image_seek(uint8_t id, uint32_t sector)
addr = (uint64_t)sector << 9LL;
hdd_images[id].pos = sector;
fseeko64(hdd_images[id].file, addr + hdd_images[id].base, SEEK_SET);
if (fseeko64(hdd_images[id].file, addr + hdd_images[id].base, SEEK_SET) == -1)
fatal("hdd_image_seek(): Error seeking\n");
}