Date : Fri, 09 Sep 2011 19:43:49 GMT
From : jgh@... (J.G.Harston)
Subject: Sometimes they come back... OSWORD &7F question
Carlo wrote:
> As I said, I'm aware of this issue and tried different patched versions,
none of which seems to implement &E0/&F0. They
> all come back with a result byte of &FE.
....
> Are there any other options for raw track read? Do I really have to code
an NMI handler and send the raw command to the WD1770? Ha
> anyone done it already?
With 8271 DFS you could read an entire track as a single sector. A
single density track can hold a maximum of 3125 bytes, so if you
attempt to read, say, one 8192-byte sector that will read the
entire track and return a data underrun error.
DIM ctrl% 31:X%=ctrl%:Y%=X%DIV256 :REM Set up control block
?X%=drive:X%!1=buffer%:X%?5=3:X%?6=&53
X%?7=0:X%?8=0 :REM Track 0, sector 0
X%!9=&A1 :REM 1 sector of 8192 bytes
A%=127:CALL &FFF1 :REM Call sector read
Checking through the ROM code it turns out that commands &E0 and
&F0 are only checked for if the control block specifies exactly 10
parameters. What the other nine parameters are I can't tell, but
updating the library code to this works:
DEFFNdisk(addr%,cmd%,drv%,trk%,sec%,num%,den%):LOCALfs%
fs%=FNfs:IFfs%<>4:*FX143,18,4
REPEATX%?0=drv%+den%*24+8:X%!1=addr%:X%?5=3-7*(cmd%>127)
X%?6=cmd%:X%?7=trk%:X%?8=sec%:X%?9=num%OR&20
A%=127:CALL&FFF1:A%=X%?10:UNTILA%<>&10:IFfs%<>4:OSCLI"FX143,18,"+STR$ fs%
=A%
result%=FNdisk(&3000,&E0,0,0,0,0,1) reads the low-level
single-density track data for track 0,
result%=FNdisk(&3000,&E0,0,0,0,0,2) does the same in double
density.
I've updated the DiskIO library at http://mdfs.net/blib/DiskIO and
interim documentation at http://mdfs.net/blib/Docs/DiskIO/txt and
the OSWORD &7F docs on the Wiki.
--
J.G.Harston - jgh@... - mdfs.net/jgh
/* Real programmers don't use comments. */