Fixed SELECT_DRIVE for slow drives. Fixed AUTOIDE too.

This commit is contained in:
Tolik 2025-02-28 01:39:06 +10:00
parent b4fca7ecb4
commit 90bb74daac
3 changed files with 17 additions and 7 deletions

View File

@ -38,7 +38,7 @@ ATAPI_5x_RESET: LD C,IDE.Device.ATAPI
CP BIOS.Error.ATAPI.UnitAttention CP BIOS.Error.ATAPI.UnitAttention
SCF SCF
RET Z RET Z
; ;!FIXIT ­¥ âண âì ¯à¥à뢠­¨ï
EI EI
HALT HALT
DJNZ .loop DJNZ .loop

View File

@ -50,7 +50,15 @@ SELECT_DRIVE: AND #0F
AND #F0 AND #F0
LD BC,IDE.Write.DeviceHead LD BC,IDE.Write.DeviceHead
OUT (C),A OUT (C),A
LD A,H ;
LD A,high IDE.Read.Status
IN A,(low IDE.Read.Status)
AND IDE.CtrlByte.Busy
JR Z,.notBusy
LD B,32
DJNZ $
;
.notBusy: LD A,H
EXX EXX
RET RET
; ;

View File

@ -823,9 +823,10 @@ DETECTORS:
.IdentPDevChk: LD E,IDE.ATAPI.IdentifyPacketDevice .IdentPDevChk: LD E,IDE.ATAPI.IdentifyPacketDevice
LD BC,IDE.Write.Command LD BC,IDE.Write.Command
OUT (C),E OUT (C),E
LD HL,PAUSES.WAIT.IDE ;
LD HL,PAUSES.HALT.Time_2s
LD DE,IDE.CtrlByte.Busy*256 + 0 LD DE,IDE.CtrlByte.Busy*256 + 0
CALL BITS_WAITS.WAIT_PRT CALL BITS_WAITS.Clear_BUSY
RET C RET C
; ;
; BC = IDE.Read.Status ; BC = IDE.Read.Status
@ -868,6 +869,7 @@ SetUP_CHANELS:
CALL .CMD CALL .CMD
LD A,2 LD A,2
.CMD: CALL SELECT_IDE .CMD: CALL SELECT_IDE
PAUSE_DJNZ 32
LD BC,IDE.Write.Command LD BC,IDE.Write.Command
LD H,IDE.ATA.Nop LD H,IDE.ATA.Nop
OUT (C),H OUT (C),H