CPCWiki forum

General Category => Emulators => Topic started by: Wanderer on 23:49, 16 February 10

Title: "EXTENDED CPC DSK File" (.dsk) format
Post by: Wanderer on 23:49, 16 February 10
Hi everyone.

Could someone please point me to info about the .dsk file format? I know i've seen it somewhere but i can't find it at the moment.

Thanks
Title: Re: "EXTENDED CPC DSK File" (.dsk) format
Post by: redbox on 00:31, 17 February 10
They are on the 'Unofficial Amstrad WWW Resource' website (www.cpctech.org.uk):

Normal DSK format (http://www.kjthacker.f2s.com/docs/dsk.html)

Extended DSK format (http://www.kjthacker.f2s.com/docs/extdsk.html)


Title: Re: "EXTENDED CPC DSK File" (.dsk) format
Post by: Wanderer on 00:36, 17 February 10
'Unofficial Amstrad WWW Resource' website (www.cpctech.org.uk)

Great. Thanks. I have found several links to the 'Unofficial Amstrad WWW Resource' on Google but they all pointed to a dead site.
Title: Re: "EXTENDED CPC DSK File" (.dsk) format
Post by: redbox on 00:56, 17 February 10
Great. Thanks. I have found several links to the 'Unofficial Amstrad WWW Resource' on Google but they all pointed to a dead site.

Yes, cpctech.org.uk is a frame mask for: http://www.kjthacker.f2s.com/
Title: Re: "EXTENDED CPC DSK File" (.dsk) format
Post by: Devilmarkus on 01:26, 17 February 10
The actual website can be found here:
http://arnold.cpc-live.com/cpctech/
(mirror)
Title: Re: "EXTENDED CPC DSK File" (.dsk) format
Post by: krusty_benediction on 23:10, 09 December 18
Just looked at these documentation to write a DSK reader for my toolbox. I have to admit that I do not find them clear at all.For example, location of  data is not explicitly stated. I had to make several tries before (I hope so) being able to write my DSK reader (at least the sector information looks like what cpcpower view for the dsk I tested).
The ultimate fix to my code was to start to read the the sector data after 231 bytes. I obtain this magic number there : https://github.com/damieng/DiskImageManager/blob/master/Source/DSKFormat.pas#L37 (I doubt i would have been able to finish my reader without that)
Why this value ? I do not understand at all; it is not even a multiple of 8.
Thanks for the help
Title: Re: "EXTENDED CPC DSK File" (.dsk) format
Post by: robcfg on 00:08, 10 December 18
I did a DSK file reader, and I don't have any fixed values.


See here the C++ declaration of that data structure on my code:
Code: [Select]
struct CDSKFile_TrackInfoBlock
{
string header;                              // Header string is 13 bytes long
unsigned char unused[3];                    // 3 unused bytes
unsigned char trackNumber;                  // Track number
unsigned char sideNumber;             // Side number
unsigned char dataRate;                     // Previously unused. Now Data Rate (John Elliott extension)
unsigned char recordingMode;                // Previously unused. Now Recording Mode (John Elliott extension)
unsigned char sectorSize;                   // Sector size
unsigned char sectorsNum;                   // Number of sectors
unsigned char gap3Length;                   // GAP#3 length
unsigned char fillerByte;                   // Filler byte value
vector<CDSKFile_SectorInfo> sectorInfoList; // Sector information list
vector<uint8vector> sectorData;             // Actual sector data
bool isUnformatted;                         // Is this an unformatted track?
};


Hope it helps!
Title: Re: "EXTENDED CPC DSK File" (.dsk) format
Post by: krusty_benediction on 10:51, 10 December 18
Code: [Select]
Not really I have well understood this global structure.
To undetrstand where I fuck(ed) up, I would need to see your bits of code just after reading
sectorInfoList [font=arial]and just before reading [/font]sectorData. [size=2][font=arial]I started to read at a wrong place (i have not verified if it is too soon or too late however) until I used this 231 magic number.

thxedit: what a crappy web editor ...
Title: Re: "EXTENDED CPC DSK File" (.dsk) format
Post by: Gryzor on 14:46, 13 December 18
thxedit: what a crappy web editor ...


Just use the 'Remove Formatting' button ;)
Title: Re: "EXTENDED CPC DSK File" (.dsk) format
Post by: krusty_benediction on 23:04, 17 December 18
Fixed the issue few days ago .I do not remember where I was wrong, but I use no more this hard coded value
I did a DSK file reader, and I don't have any fixed values.


See here the C++ declaration of that data structure on my code:
Code: [Select]
struct CDSKFile_TrackInfoBlock
{
   string header;                              // Header string is 13 bytes long
   unsigned char unused[3];                    // 3 unused bytes
   unsigned char trackNumber;                  // Track number
   unsigned char sideNumber;               // Side number
   unsigned char dataRate;                     // Previously unused. Now Data Rate (John Elliott extension)
   unsigned char recordingMode;                // Previously unused. Now Recording Mode (John Elliott extension)
   unsigned char sectorSize;                   // Sector size
   unsigned char sectorsNum;                   // Number of sectors
   unsigned char gap3Length;                   // GAP#3 length
   unsigned char fillerByte;                   // Filler byte value
   vector<CDSKFile_SectorInfo> sectorInfoList; // Sector information list
   vector<uint8vector> sectorData;             // Actual sector data
   bool isUnformatted;                         // Is this an unformatted track?
};


Hope it helps!
Title: Re: "EXTENDED CPC DSK File" (.dsk) format
Post by: robcfg on 23:07, 17 December 18
That's great news!