Add busmastering DMA for ATAPI drives

This commit is contained in:
Melissa Goad
2016-09-15 01:08:45 -05:00
parent 4896dfcfb4
commit 090c4c9545

View File

@@ -1631,12 +1631,15 @@ void callbackide(int ide_board)
case WIN_READ_DMA: case WIN_READ_DMA:
if (IDE_DRIVE_IS_CDROM(ide)) { if (IDE_DRIVE_IS_CDROM(ide)) {
goto abort_cmd; atapi->readsector(ide->buffer, ide_get_sector(ide));
}
else
{
addr = ide_get_sector(ide) * 512;
fseeko64(ide->hdfile, addr, SEEK_SET);
fread(ide->buffer, 512, 1, ide->hdfile);
ide->pos=0;
} }
addr = ide_get_sector(ide) * 512;
fseeko64(ide->hdfile, addr, SEEK_SET);
fread(ide->buffer, 512, 1, ide->hdfile);
ide->pos=0;
if (ide_bus_master_read_sector) if (ide_bus_master_read_sector)
{ {
@@ -1731,9 +1734,15 @@ void callbackide(int ide_board)
else else
{ {
/*DMA successful*/ /*DMA successful*/
addr = ide_get_sector(ide) * 512; /*if(IDE_DRIVE_IS_CDROM(ide))
fseeko64(ide->hdfile, addr, SEEK_SET); {
fwrite(ide->buffer, 512, 1, ide->hdfile); }
else
{*/
addr = ide_get_sector(ide) * 512;
fseeko64(ide->hdfile, addr, SEEK_SET);
fwrite(ide->buffer, 512, 1, ide->hdfile);
//}
ide->atastat = DRQ_STAT | READY_STAT | DSC_STAT; ide->atastat = DRQ_STAT | READY_STAT | DSC_STAT;