@@ -386,23 +386,16 @@ static void abort_data_cmd() {
386386 gd_state_t * GDS = get_GDS ();
387387
388388 LOGFF (NULL );
389- if (fs_dma_enabled () == FS_DMA_STREAM ) {
390- fs_enable_dma (FS_DMA_SHARED );
391- }
392389 abort_async (iso_fd );
393390 GDS -> ata_status = CMD_WAIT_IRQ ;
394391
395392 while (!pre_read_xfer_done ()) {
396393 gdcExitToGame ();
397394 }
398-
399395 pre_read_xfer_end ();
400-
401- if (GDS -> cmd_abort ) {
402- GDS -> transfered = 0 ;
403- GDS -> status = CMD_STAT_IDLE ;
404- GDS -> ata_status = CMD_WAIT_INTERNAL ;
405- }
396+ GDS -> transfered = 0 ;
397+ GDS -> status = CMD_STAT_IDLE ;
398+ GDS -> ata_status = CMD_WAIT_INTERNAL ;
406399}
407400
408401static void data_transfer_cb (size_t size ) {
@@ -616,27 +609,23 @@ static void data_transfer_dma_stream() {
616609 }
617610 else if (pre_read_xfer_done () || alt_read ) {
618611
619- if (! alt_read ) {
620- pre_read_xfer_end ( );
612+ if (alt_read ) {
613+ do {} while ( poll ( iso_fd ) > 1 );
621614 }
615+ pre_read_xfer_end ();
622616 GDS -> transfered = pre_read_xfer_size ();
623617 GDS -> ata_status = CMD_WAIT_INTERNAL ;
624618
625619 if (GDS -> requested == 0 ) {
626- if (alt_read ) {
627- abort_data_cmd ();
628- }
629620 GDS -> status = CMD_STAT_COMPLETED ;
630621 break ;
631622 }
632623 }
633-
634624 if (GDS -> cmd_abort ) {
635625 abort_data_cmd ();
636626 break ;
637627 }
638628 }
639-
640629 GDS -> drv_stat = CD_STATUS_PAUSED ;
641630}
642631
@@ -662,11 +651,9 @@ static void data_transfer_pio_stream() {
662651
663652 if (alt_read ) {
664653 read (iso_fd , (uint8 * )GDS -> param [2 ], GDS -> param [1 ]);
665- #if defined(DEV_TYPE_IDE ) || defined(DEV_TYPE_GD )
666- /* Just for ATA IRQ from NOP command. */
667- g1_ata_abort ();
668- #endif
669- } else {
654+ pre_read_xfer_abort ();
655+ }
656+ else {
670657 pre_read_xfer_start (GDS -> param [2 ], GDS -> param [1 ]);
671658 }
672659 GDS -> ata_status = CMD_WAIT_IRQ ;
@@ -1281,8 +1268,8 @@ int gdcCheckDmaTrans(int gd_chn, int *size) {
12811268 return -1 ;
12821269 }
12831270#ifdef _FS_ASYNC
1284- if (fs_dma_enabled () == FS_DMA_STREAM && ! exception_inited () ) {
1285- poll (iso_fd );
1271+ if (fs_dma_enabled () == FS_DMA_STREAM ) {
1272+ do {} while ( poll (iso_fd ) > 1 );
12861273 }
12871274#endif
12881275 if (pre_read_xfer_busy ()) {
0 commit comments