sam-users  

Re: Grabbing floppy images

Thomas Harte
Sun, 22 Jun 2008 05:06:19 -0700

There are some USB to SCSI adaptors, which OS X fully supports, and SCSI floppy drives, but overwhelmingly they are of the LS-120 type, i.e. 100+mb 3.5" drives that are backwards compatible with old floppies. So probably they'd have PC geometry hard coded at a different place.

What sort of floppy format were Apple using in 1997? Would obtaining one of the very original USB floppy drives that were intended for people moving to the iMac be of any advantage?

On 22 Jun 2008, at 11:38, Leszek Chmielewski wrote:

Simon Owen schrieb:
Leszek Chmielewski wrote:
You coded the fdrawcmd.sys? It should work with onboard floppy connector under Win2K.

Yes, and yes :-)


I changed the code from example HANDLE h = CreateFile("\\\\.\ \fdraw0", GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL) to PureBasic syntax: Handle.l=CreateFile_("\\\\.\ \fdraw0",#GENERIC_READ|#GENERIC_WRITE,0,#Null,#OPEN_EXISTING, 0,#Null)

but Handle returns always -1. I guess, that's not correct.

The actual path being opened is \\.\fdraw0, but the backslash characters
need to be escaped in C by adding additional backslashes before each.

Try changing "\\\\.\\fdraw0" to "\\.\fdraw0" and see if that works. If
it doesn't, check GetLastError() to see what it returns.  If you're
still having trouble, e-mail me off the list and I'll look into it.


Thanks, it now seems to work, the handle is now every time 892. I never used C before, so I did not knew that trick :-[ . Btw.: you wrote, RealSpectrum Emulator use Fdrawcmd to read discs. I tried to read +D discs under Win2K, but Sector 10 is bad on every disc (Directory sector 10 is corrupted), SimCoupe reads all directory entries correctly. I guess RealSpectrum use a older version of Fdrawcmd, because it works fine only under Windows 98SE or older. The newer RS32 has no ability to read real discs.
maybe it could be easier to use a standard SAM Disc, and create a dummy file, which has a Sector bitmap that reserves all sectors nr 10
on the whole disc.

That's pretty much what I had in mind, but with additional dummy entries to reserve sector 10 on the directory tracks. 2 hidden entries can be added to each, to prevent the listing stopping so the remaining entries
will be searched.

I though, you want to modify SimCoupe to format and write discs with 9 sectors, that means, need to change the ROM, File Bitmap layout, etc.
When the image is used in the emulator, saving will not use sector 10 in the directory since it has hidden files in it. The dummy file prevents
sector 10 being used across the rest of the disk.

Thats what I mean too.
To write to a USB floppy drive would just need the 10th sector to be
dropped, and the remaining 720K written to the raw device. When opening
the USB drive in SimCoupe, the emulator will need to provide suitable
dummy details for every sector 10.

So you automaticaly can recognise USB Drives, I guess. I never used USB drives and have no Apple here, but Mac users have no other chance to connect a floppy drive, if they got no internal floppy connector.

A Image of 256 Bytes of the last directory entry, which is precalculated and could be written on any disc, reserving sectors that are not accessable from PC. Any files saved after that on this disc, would be avoid writing these sectors, so no need to change SimCoupe.

If there are more than 17 files on the disk, getting a directory listing
would attempt to read track 0 sector 10.  A SimCoupe change is still
needed to return something for that read attempt. It would also be wise
to block attempts to write to sector 10, since it can't be saved.

Oh, I forgot about writting dummy sectors to directory sectors 10. So 8+1 Entrys needed, so this will reduce the number of saveable files to 71. But for data transfer needs it does not matter very much. The dummy entrys did not need to have a bitmap.
Si


Cheers!
LCD