WriteDSK

From CPCWiki - THE Amstrad CPC encyclopedia!
Jump to: navigation, search

Introduction

WriteDSK is a tool written by Targhan for converting dsk images used on emulators back to real floppies. It can read the dsk image from a 720k dos-formatted floppy in drive A or B, or from a serial link with the cpcbooster connected to a PC with appropriate software. It can write the floppy on drive A or B. It can handle most protected formats.

Links

Arkos Download page

Instruction Manual

(extracted from the disk image)

WRITEDSK/DIRDOS 1.1

By Targhan/Arkos


These two little tools -also available in rom- will allow you to transfer a DSK from a 720ko disc (formatted on PC or DOSCOPY for example) to a CPC disc. It works like DSKCPC from Divine Coding. Of course, Writedsk is much more powerful :) :

New features for V1.1

  • New interface. You are now able to see how the sectors are organized on the tracks.
  • A new optional parameter allows you to write directly on the second side of your disc, if the destination drive is a 3"5.
  • Bigger internal buffer, most conventionnal DSKs are transfered in 2 passes.
  • Ctrl+Shift+Esc to exit anytime.
  • Correction of a bug that could prevent DIRDOS from working properly.
  • Correction of a bug that could prevent some PC files from being read.
  • Managment of tracks unformatting. At the end of the transfert, tracks that are not coded in the DSK with be unformatted. In a general way, it allows protected DSKs to work fine.
  • Writting of different sized sectors allowed, with limitations. A lot of protected DSKs can be transfered.
  • Writting of erased sectors allowed. Same result.

Other features

  • It recognizes all standard CPC format, from size 0 to 5. Size 6 sectors aren't recognized.
  • Standard and Extended DSKs are recognized.
  • Double sided DSKs too.
  • You can use ONE drive only for the transfert ! Very useful for those, like me, who have only one 3'5 drive and don't want to use 3'.


Both tools will be released once again soon when the Antitec's CPCBOOSTER+ is released. New functions will allow tranfering DSKs directly on a CPC disc, as well as SNApshots into the CPC memory. A developer's dream ! We may also release some cool tools for coders in the same rom.

HOW TO USE IT

|WRITEDSK,"dskname",["SourceDestination[Head]"]

Transfert the DSK named "dskname" from Source drive to Destination drive. If the second parameter is omitted, the Source is B and the destination A. The DSK name is short (8+3 letters), DOS-like. You may have to use tilde (control+2) if you've saved your DSK on PC with a long name.

Know that your DSK must always be on the root of your disc.

New option since V1.1, the "head" allows to write directly on the second side of your disc. It is optional though. Having to switch side between two passes now belongs to the past ! The only possibility is "1" though, with indicates side 1. I did this for you not to incidentally erase the side 0, thinking it was the second one (In the FDC language, sides are noted 0 and 1, not 1 and 2).

Note that the 'head' option is ignored if the DSK is double sided, with is logical. What's more, this option doesn't change the 'side' included to the sector IDs.

I should also say that you can ONLY read the PC disc (FAT 12) if the selected head of your source drive is 0 (else head 0 is no more accessible, as head 1 is forced. FAT 12 is double sided !).


Examples :

|WRITEDSK,"thedemo.dsk","AB"
|WRITEDSK,"bigofull.dsk"
|WRITEDSK,"dia.dsk","AA1"



|DIRDOS,["Source"]

DIRDOS performs a CAT on the DOS disc, to see the files on the root. Directories are also noted, but can't be explored. The Source drive declaration is optional. By default, the B drive is used.

Once again, don't forget to select the side 0 of your drive.

Example :

|DIRDOS,"a"
|DIRDOS


THE INTERFACE

Nothing crazy. You don't have to understand anything to transfert your DSKs. Let me describe what the columns mean. They all refer to the sectors of the current track to be written.

  • TR = Number of TRack written in the sector ID.
  • SD = Shows the SiDe in the sector ID.
  • ID = Very important, IDentification number of the sector.
  • SZ = Very important too, the sector SiZe. It is the actual size of the sector.

Note that, except the SiZe, all this information can be junk, it's only used to identify a sector. Some protections will have fun at using strange values.

In the INFOS columns can come two acronyms :

ERA = Means ERAsed. It's just a mark set to the sector, it doesn't mean the sector is actually erased. To read it you must use the 'read erased sector FDC instruction.

CKS = Means Bad CheckSum. To sum up, the FDC will report an error after reading the sector, believing an error has been made while reading. I'll talk about it later, but in a practical case it's completely useless, in fact I simply don't do anything with this flag.

The 'Size' at the left of the screen represents the sector size given to the Format instruction. So all sectors of the track can be this size, or less.

Last remark, note the increasing value at the bottom right when reading the PC disc : it represents the buffer filling. Just to know how long you still have to wait...

That's all about the interface.


ACKNOWLEDGMENT

Although the DSK format is well featured, a lot of emulators don't update it well, like Winape. If you format a track with size 3 sectors, the track header will read size 2 ! The good size has to be found in the sector headers... The GAP#3 suffers the same way. Approximated FDC emulation allows demos and software to run well, but corrections need to be made if you transfert them on CPC. Existing tools like CPDWRITE and CPCTRANS perform these corrections. WRITEDSK too. About the GAP, I used the correction table you will find in the DISC+ULTRA notice. However, I made a lot of changes. Thus, the minimum value is set to #20, the maximum to #4E. Every well built track will work. If the GAP must be lower than #20, then the track contains too much sectors for its own good, and it's not my business ! Bigger than #80 GAP is useless too. If your drive needs it then you MUST change it quick !


The V1.1 contains a lot of improvments, as I learnt a lot lately (Thanks Ram7 !) Thus, contrary to what I thought, it is possible to have different sized sectors. The routines I used here are basic, but allow many protections to be transfered.

About the 'bad checksum' flag, the only way I see to create it is really hardcore. In fact I believe it is set by transfer tools that don't like different sized sectors. Anyway, for now I never found a DSK that tested such flag, so...

So far the only DSK that doesn't work with Writedsk 1.1 is the 5KB Demo 3, because it contains tracks whose sectors are all named the same. 'The Demo' uses the same technic but work fine though... I may try to find a technic to manage that correctly.

About this topic, it is possible that I update WriteDSK to manage special formats like the ones I'm working on...

Just wait and see !


If you have a DSK that doesn't work with WriteDSK, don't hesitate to send it to me, just make sure it works fine on emulators !