Re: [hatari-devel] STX (Pasti support) |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
On 18/02/2012 16:54, Fredrik Olsson wrote:
Looking at the stx.h file, I see it's heavily similar to the one
from the HxC floppy emulator ; I think the least would be to credit
Jean-François DEL NERO in your file for the work he made to reverse
engineer the pasti format.
No but I should credit Pera Putnik for his documentation at
http://atari.8bitchip.info/STXdesc.html. If Jean-François has better
docs then please give me a link.
But the french comment in your stx.h really looks like the one from
HxC's header.
Anyway, I think Markus Fritze and HxC's author both reversed engineered
the Pasti format (Markus used to be subscribed to Hatari's list, maybe
he could be of some help for pasti).
HxC doesn't have doc for STX file, but the C plugin for STX is rather
well documented and is supposed to support quite a lot of protected
disk. Importing this code to make it work under Hatari could be best way
to go to have an initial solid implementation.
In the end, I don't think converting the STX file to fit Hatari's
structure is the best way to go. A better approach would be to load
the STX file in its own buffer, then add some hooks for each FDC
command to call the "STX version" of these FDC commands.
This way, our generic FDC code remains usable, and if an STX disk is
inserted the STX specific code will be used.
Sounds to me like the Floppy_InsertDiskIntoDrive() should setup some
function pointers to the correct implementations for different
disk-images, with the hooks you mention.
For ST/MSA the implementation basically copy data from the current
in-men buffer. Whereas the STX implementation do more magic.
When the STX floppy is inserted, some STX related buffers/variables
should be setup.
But regarding the hooks, they should go in fdc.c ; pasti is a very low
level format, emulating it requires to intercept all accesses to $ff86xx
to drive the dma disk and the controler.
If you can provide a floppy_stx.c file that emulates read sector, read
track and read address, I could add the necessary hooks in fdc.c to call
this code (but note that some very precise code should also be added to
handle the drive rotation speed and emulate correct index timings).
In fact, they're two main parts that needs to be emulated :
- accurate values for the FDC registers : this is rather easy, as some
values are stored in the STX files. Other values are supposed to be
already quite accurate in the recent fdc.c code. This is often enough to
handle a lot of pretection.
- accurate emulation of the various "speed" related components : dma
disk transfer with variable bit cells length, index and address marks
seeking, ... Those are really more complex to handle and could be kept
for later.
Nicolas