| [hatari-devel] reading DMA sector count in HDC mode ? | 
[ Thread Index | 
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
] 
Hello
while trying to improve FDC/DMA emulation, I noticed that it's 
apparently not possible to read the value of the dma sector counter, you 
can only set it.
When trying to read it on my STF, I get the latest value that was 
read/written at $ff8604.
For example, consider this code :
	move.w  #$86,$ff8606	; data reg
	bsr	FDC_Tempo
	move.w	#$67,$ff8604
	bsr	FDC_Tempo
	move.w  #$90,$ff8606
	bsr	FDC_Tempo
	move.w  #$12,$ff8604	; DMA sector count
	move.w	$ff8604,res
FDC_Tempo
	rts			; 44 cyles pause
In that case, 'res' will be $67, not $12 as could be expected, you get 
the latest value written (or read when) accessing the FDC/HDC.
Is this the same when in HDC mode ? For example :
	move.w  #$10,$ff8606
	bsr	FDC_Tempo
	move.w  #$12,$ff8604	; DMA sector count
	move.w	$ff8604,res
Do we get $67 too, or $12 ?
I think the dma sector counter is common to FDC/HDC mode, so it should 
be the same, but could someone with a hard drive confirm this ?
None of the doc I have are clear on this, they don't mention if sector 
count can be read or not. But as dma status has a bit to tell if sector 
count is 0 or not, this could confirm you can't read sector count, you 
can only know if it reached 0.
Nicolas