kbr-net / sdrive-max

Arduino based Atari 8-bit Floppy Emulator with Touchscreen
http://www.kbrnet.de/projekte/sdrive-max/index.html
GNU General Public License v3.0
94 stars 22 forks source link

Using Atari DOS 2.0D (double density version) new command creates single density sized blank disk #47

Closed s-simpson closed 4 years ago

s-simpson commented 4 years ago

'New' blank double density formatted disks aren't physically allocated the correct file size in the FAT32 directory on the SD-card. (approx half the needed space is allocated) (tested version 1.2 Corona release)

s-simpson commented 4 years ago

Link for dos 2.0D (How the problem was detected)

http://www.atarimania.com/utility-atari-400-800-xl-xe-dos-20d_17585.html

Atari dos 2.0 modified for double density (included with the first Percom drives as a patch)

if you boot the Atari dos 2.0d, everything works, it loads and boots like I remember, you can save and load files onto the existing atr. If you use the 'new' command from the touch screen to make a new disk, it makes the new disk, and when you format it, the disk appears to function ok (ie write dos files works.) The file that is created, is however the wrong size. It should be the same number of sectors as a SD disk, but 256 bytes per sector, rather than the 128 bytes per sector. A double density blank atr file should take up double the physical space as a single density atr file on the sdcard. Eventually the new blank is going to run out of actual space before it thinks its empty. Either an option to specify which type of 'new' disk to be created is needed, or the sdrive has to detect the density of the currently running dos. The only known current work around that I could find is to make the double density blank atr files on another computer with say Altirra or some other utility (or just copy the dos 2.0D disk over and over) and copy them in advance over to the sdcard, to avoid using the new command altogether. I'm also wondering if this affects sparta dos as well, but I can't test that as I only have an old Atari 800 to try it on. I also haven't tested mydos

s-simpson commented 4 years ago

Also: POTENTIAL PROBLEM? I think the first few sectors of a double density disk aren't 256 bytes per sector though, If memory is correct the first 3 sectors (?) were 128 bytes, and the rest were 256 bytes per sector, but there must be documentation somewhere to confirm this. I think it was for the o/s to be able to start to boot the disk, as the built in Atari O/S didn't know anything about double density, even though the double density dos did. So part of the disk had to be single density for booting purposes. Not sure if this matters for the size of the file ( waste 3 x 128 bytes of file space by allocating all 256 bytes ), but it might create weird hard to find virtual 'seek' errors depending upon how the code is written. It does seem on a glance that this is in the code though. Just a thought, in case.

kbr-net commented 4 years ago

Dos 2.0d sends the regular command $21 for FORMAT SINGLE as specified, there is no percom or something else, so Sdrive-MAX is doing all right. I think, the 815 is a very special thing, and can only format DD. Don't use this special Dos!

Spartados is working. (without special sector skew, this makes no sense on a drive emulator and ATR images)

s-simpson commented 4 years ago

Dos 2.0d sends the regular command $21 for FORMAT SINGLE as specified, there is no percom or something else, so Sdrive-MAX is doing all right. I think, the 815 is a very special thing, and can only format DD. Don't use this special Dos!

Ok, well it worked ok on the original percom drives, and formatted double density. perhaps the software didn't follow later conventions as you couldn't select which density to format in that dos. Originally i used it because nothing else existed at the time. It was given to me as a patch to the original atari dos by percom when I bought the drive. you had to boot the atari dos 2.0, install the patch in memory and format a new disk and then write dos files to a new disk to get the double density storage. There must have been a utility at the time to transfer files between single and double density, but I can't remember. It was kind of a pain. I couldn't find anything in your code, but your explanation makes sense to me. The convention for the codes for single and double density formatting may have come later from mydos or spartados or one of those OSS dosses that could do both single and double density. Anyway the patched code on the dos 2.0D probably doesn't behave correctly. The percom drive I had could format either single or double density though. It was single sided. I've never ever seen an Atari 815 drive. I thought they were sorta mythical.

s-simpson commented 4 years ago

https://www.atarimagazines.com/creative/v9n6/114_An_alternative_to_the_Ata.php

The version I had may have been called 2.1P? rather than 2.0D, they look sooo similar. I bet the 2.1P version works correctly.

kbr-net commented 4 years ago

Think, we can close this now.