|[hatari-devel] Missing DMA sector count register emulation for ACSI transfers?|
[ Thread Index |
| More lists.tuxfamily.org/hatari-devel Archives
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: [hatari-devel] Missing DMA sector count register emulation for ACSI transfers?
- From: Christian Zietz <czietz@xxxxxxx>
- Date: Wed, 1 Sep 2021 15:45:45 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1630503946; bh=dNqp75t9EyXRE8MXgy6X+9XlY7K9C9kmmc0JSUElRgk=; h=X-UI-Sender-Class:To:From:Subject:Date; b=iTN40uNJ19QkdirdScenizRvtGgMCSY+sU7L/I/o9VcdOZM4SoQFeHgmlsslLiHZW s1SviYR/gRJyDly/9LFIhZYQ2EFQjTxgJobLn5IY6v1RtAFKHAcod4hCq2fEpwdRIa CZ6IfDTwEQ3cWd3qiU5fiQdf9X6XXrxeVP6CuAGk=
I'm testing a (fairly exotic) harddisk driver that was bundled with DDD
(C) 1991 by K.R.
Digital Data Deicke
(Digital Data Deicke used to be a popular Atari distributor in Germany.)
.... and I found it not to be working on Hatari. First, I thought that it
was perhaps relying on some non-standard behavior/commands of DDD
harddisks. But meanwhile I've come to the conclusion that there is a
detail missing in Hatari's emulation of ACSI disks.
After completion of a command, the driver reads the DMA status register
at address $FF8606. (Not to be confused with the status byte that is
read over the ACSI bus from the actual drive.) It masks the lower three
bits and checks for 1 (= 3'b001). But Hatari always returns a 3 (=
3'b011), here. Bit 0 means "no DMA error", bit 1 means "sector count
register is not zero". The equivalent lines of code are here:
However, it seems that the ACSI code in hdc.c never sets the DMA sector
count register to 0, which makes this particular disk driver fail. I've
tested (by means of a quick hack) that zeroing the sector count register
from Acsi_DmaTransfer() makes Hatari return the expected DMA status of
1, and makes the driver work.