Author Topic: "EXTENDED CPC DSK File" (.dsk) format  (Read 3291 times)

0 Members and 1 Guest are viewing this topic.

Offline Wanderer

  • Supporter
  • CPC664
  • *
  • Posts: 60
  • Country: 00
  • CPC fan
  • Liked: 4
  • Likes Given: 20
"EXTENDED CPC DSK File" (.dsk) format
« 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
- Wanderer -

Offline redbox

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.751
  • Country: gb
    • redbox
  • Liked: 326
  • Likes Given: 267
Re: "EXTENDED CPC DSK File" (.dsk) format
« Reply #1 on: 00:31, 17 February 10 »
They are on the 'Unofficial Amstrad WWW Resource' website (www.cpctech.org.uk):

Normal DSK format

Extended DSK format



Offline Wanderer

  • Supporter
  • CPC664
  • *
  • Posts: 60
  • Country: 00
  • CPC fan
  • Liked: 4
  • Likes Given: 20
Re: "EXTENDED CPC DSK File" (.dsk) format
« Reply #2 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.
- Wanderer -

Offline redbox

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.751
  • Country: gb
    • redbox
  • Liked: 326
  • Likes Given: 267
Re: "EXTENDED CPC DSK File" (.dsk) format
« Reply #3 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/

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1007
  • Likes Given: 926
Re: "EXTENDED CPC DSK File" (.dsk) format
« Reply #4 on: 01:26, 17 February 10 »
The actual website can be found here:
http://arnold.cpc-live.com/cpctech/
(mirror)
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

Offline krusty_benediction

  • CPC664
  • ***
  • Posts: 134
  • Country: fr
  • Liked: 100
  • Likes Given: 35
Re: "EXTENDED CPC DSK File" (.dsk) format
« Reply #5 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

Offline robcfg

  • Supporter
  • 6128 Plus
  • *
  • Posts: 2.134
  • Country: se
  • 8-Bit Technomancer
    • index.php?action=treasury
  • Liked: 944
  • Likes Given: 2108
Re: "EXTENDED CPC DSK File" (.dsk) format
« Reply #6 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!

Offline krusty_benediction

  • CPC664
  • ***
  • Posts: 134
  • Country: fr
  • Liked: 100
  • Likes Given: 35
Re: "EXTENDED CPC DSK File" (.dsk) format
« Reply #7 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 ...

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 14.935
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 2916
  • Likes Given: 5070
Re: "EXTENDED CPC DSK File" (.dsk) format
« Reply #8 on: 14:46, 13 December 18 »
thxedit: what a crappy web editor ...


Just use the 'Remove Formatting' button ;)

Offline krusty_benediction

  • CPC664
  • ***
  • Posts: 134
  • Country: fr
  • Liked: 100
  • Likes Given: 35
Re: "EXTENDED CPC DSK File" (.dsk) format
« Reply #9 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!

Offline robcfg

  • Supporter
  • 6128 Plus
  • *
  • Posts: 2.134
  • Country: se
  • 8-Bit Technomancer
    • index.php?action=treasury
  • Liked: 944
  • Likes Given: 2108
Re: "EXTENDED CPC DSK File" (.dsk) format
« Reply #10 on: 23:07, 17 December 18 »
That's great news!