News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_Wanderer

"EXTENDED CPC DSK File" (.dsk) format

Started by Wanderer, 22:49, 16 February 10

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Wanderer

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
- Wanderer -

redbox

They are on the 'Unofficial Amstrad WWW Resource' website (www.cpctech.org.uk):

Normal DSK format

Extended DSK format



Wanderer

Quote from: redbox on 23:31, 16 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.
- Wanderer -

redbox

Quote from: Wanderer on 23:36, 16 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/

Devilmarkus

When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

krusty_benediction

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

robcfg

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:
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!

krusty_benediction

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 ...

Gryzor

Quote from: krusty_benediction on 09:51, 10 December 18thxedit: what a crappy web editor ...


Just use the 'Remove Formatting' button ;)

krusty_benediction

Fixed the issue few days ago .I do not remember where I was wrong, but I use no more this hard coded value
Quote from: robcfg on 23:08, 09 December 18I 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:
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!

robcfg


Powered by SMFPacks Menu Editor Mod