CoBra DEVIL - BASIC featuring floppy disk support


CONTENTS:

(Click the link to get there, hit Home to get back here)
  1. Short description of the operating system

  2. Basic utilities used in DEVIL
  3. My CoBra DEVIL floppy archive
  4. Procedure to convert CoBra DEVIL Teledisk floppy images to RAW floppy images

  5. Utility to transfer files between Linux and CoBra DEVIL RAW floppy images
  6. Converting CoBra DEVIL RAW floppy images to HFE images for use with the HxC SD Card floppy disk emulator



1. Short description of the operating system



Being a computer with floppy interface, eventually of course there showed up a BASIC version modified for CoBra supporting floppy disk operations. The name under which I knew it at the time is DEVIL, obviously because of the message printed at startup and also maybe because of the black background displayed initially, instead of the classic white background of the original Spectrum BASIC:


Data storage on disk is different from the way files are stored in, let's say, CP/M, or any other operating systems. Data storage on disk uses the floppy as medium to implement the same data structure used by the standard ZX Spectrum when storing data on magnetic tape. In other words, the floppy disk is used as a magnetic tape split in 9 KB slices, which is the capacity of 1 floppy track (both sides). Data blocks stored can only be of a standard type (Program, Bytes, Character Array or Number Array) with their proper headers. Headerless data blocks cannot be stored in general (with an exception described below). For this reason, only a very small number of de programs can be correctly stored on a DEVIL floppy disk. Any non-standard program will have to be modified and brought to a standard format, with headers associated to all its component data blocks and standard loading speed, in order to be stored on a DEVIL floppy disk.

The logical allocation unit is therefore 1 track both sides, which is 9 KB. Each allocation unit (track) has an entry in the disk directory, which entry takes up 256 bytes. Each data block is associated with one catalog entry, and each catalog entry can have multiple directory entries if that data block is greater than 9 KB. The whole disk catalog takes up the first 3 tracks (#0, #1, #2) and the size of every disk sector is 256 bytes, each track (both sides together) having 36 sectors. That means the catalog will fit a maximum of 3 x 36 = 108 entries, and the actual data storage area on disk has a maximum of 80 - 3 = 77 allocation units (tracks). The DEVIL disk format features a physical interleave (no logical interleave), the physical sector numbers on one track side having the sequence 1, 10, 2, 11, 3, 12, 4, 13, 5, 14, 6, 15, 7, 16, 8, 17, 9, 18, this also being their logical reading order.

If a data block being stored on disk is greater than 9 KB, it will be stored on multiple tracks, requiring multiple entries in the disk catalog. The extra entries will have a Type byte (byte 0) with a value of $E4 and will be stored in the catalog in the same order as the data in that block. Also the actual data stored on disk will be stored on consecutive tracks in the same order they were stored on magnetic tape.

Catalog entries of erased data blocks (using the ERASE command or any utility program) will have the Type byte (byte #0) set to $E5.

Data blocks stored on disk have 2 attributes that can be manipulated: Read-Only/Read-Write (R/O-R/W) and Catalog/Hidden (DIR/SYS). These are stored in byte #17 (file attribute byte) of that catalog entry (the first byte being byte #0, representing the data block type - $00 for Program, $01 for Number Array, $02 for Character Array, $03 for Bytes). As a note, a catalog entry takes up 256 octeți, of which only the first 18 are normally used, the rest of them being set to $00 by default.

I mentioned above there is an exceptional case when headerless data can be stored on a DEVIL floppy disk.

This is the case of one or more consecutive headerless data blocks having a Flag byte of $FF and immediately following a standard data block (Program or Code).
In this case, the headerless data is stored immediately after the end of data in that standard block (if the standard block data occupies less than an exact multiple of 9 KB, then the headerless data will be stored starting with the first unused data byte in the last track occupied by the data in the standard data block).

The lengths of these consecutive headerless blocks will be stored in the (normally) unused bytes after byte #17 in the every directory entry of that catalog entry. Bytes #18 and #19 are always unused. If there is headerless data to be stored, then bytes #20 and #21 will store a duplicate of the data length for the standard block preceding the headerless data block(s). Therefore we have 256 - 18 - 2 - 2 = 234 bytes available in every directory entry for storing headerless block lengths. Since each block length is represented on 2 bytes, it means we can have a maximum of 234 / 2 = 117 headerless blocks stored after a standard data block.

So to conclude, in every directory entry, bytes #18 and #19 are always unused, bytes #20 and #21 are reserved (see above) and bytes #22 to #255 are normally unused but can store headerless data lengths if needed.

The standard Spectrum BASIC has 3 commands implemented to work with a Microdrive: ERASE, CAT and FORMAT. Of these, ERASE and CAT are, in the case of DEVIL, modified to work with the floppy interface in CoBra, and the FORMAT command is abolished (its execution has no effect, ending immediately with the standard message
0 OK, 0:1
.

The ERASE command has the syntax:
ERASE "filename"
, where filename is the name of a data block stored on disk and the double quotes must be included.

The CAT command does not recognize any parameter (in the standard Spectrum Basic it requires as parameter the drive name between double quotes, for instance
"A:"
), its execution listing on the screen the contents of the disk in the first physical drive detected as READY. In other words, if physical disk drives 0, 1 and 2 are present, and both drives 2 and 3 each have a disk inserted and are READY, the CAT command will list the contents of the disk in physical drive 2. If there is also a disk inserted in physical drive 0 which is READY, then the contents of the disk in drive 0 will be listed.

In the following example I used the CAT command to list the contents of the UTILS1 disk in my DEVIL floppy archive:

1:

The CAT command is entered from keyboard (New Mode, then Symbol Shift + 9)...

2:

... and after an ENTER the floppy disk contents is listed.


2. Utility programs used in DEVIL



There are 3 basic utilities used in DEVIL: Next I will briefly describe each of them.

STAT - UTILITY TO MANIPULATE FILES (DATA BLOCKS) AND FILE ATTRIBUTES

1:

The loading command is entered from the keyboard, LOAD "STAT".

2:

After loading, the program displays a main menu. To begin, it is mandatory that the "Statistics" option is selected (the S key) which determines also what physical drive will be used further in this session (if multiple drives are present).

3:

This option displays the number of files, the disk space occupied and the free disk space as well as a graphic representation of the disk space usage. This is the result for the GAMES1 disk in my 3.5" floppy archive.

4:

By pressing any key we get back to the main menu. Next we can choose any other menu option, let's choose "Catalogue".

5:

The disk catalog is displayed, with details for every data block. This is the catalog for the GAMES1 disk. Data blocks with the SYS attribute (Hidden) are displayed in INVERSE video.

6:

Since the catalog listing cannot be listed completely on just one screen, pressing ENTER allows scrolling the listing up and showing the next page...

7:

...and another page, which is also the last.

8:

After that, pressing any key brings back the main menu. Next, let's choose the "File" option using the F key.

9:

A list is displayed showing the name of every data block on disk, having the first name selected. Using the SPACE key or the arrow keys the selection can be moved on another name. This is the contents of the UTILS3 disk in my floppy archive.

10:

The selection was moved onto the "EPROM6.13" data block (this is the source in Assembler for a program I wrote for the EPROM writer I designed), and then ENTER was pressed.

11:

The screen changes and a menu is displayed with options for this data block. We can change the two file attributes (R/O-R/W using the O and W keys, DIR/SYS using the H and S keys). We can rename, delete or execute this data block.

12:

The O key was pressed, in order to change the Read/Write attribute to Read Only and the screen changes getting back to the "File" menu. Then ENTER is pressed once more in order to access the "EPROM6.13" block again.

13:

Notice that the block is now Read Only. The H key is pressed in order to also set the SYS (Hidden) attribute.

14:

The program returns to the "File" menu again. ENTER is pressed again to access the "EPROM6.13" data block.

15:

Notice that now the block has the Read Only and Hidden ("Non catalog") attributes set.

16:

The M key is pressed and we get back to the main menu, after which using the E key the program is terminated in order to return to Basic.

17:

The program displays a goodbye message for a few seconds...

18:

...after which it performs a Basic reset and the DEVIL startup message is displayed.


DIP - UTILITY TO COPY DATA BLOCKS BETWEEN DIFFERENT FLOPPY DISKS

1:

The loading command is entered from the keyboard, LOAD "DIP".

2:

After loading, the program displays a main menu. Data blocks can be copied by entering the data type (P, N, C or B keys) followed by : and then the block name. The CAT command displays the disk contents.

3:

Let's say we want to copy the program "GENS 4", which has 2 data blocks: Program "GENS 4" and Code "GENS4". First we enter the copy command for the Program data block:

4:

After an ENTER a message is shown asking to insert the source disk. The floppy disk is inserted in the drive and ENTER is pressed.

5:

Another message is shown announcing the disk search operation for the "GENS 4" block and the program starts searching.

6:

When the data block is found, another message is shown to indicate that, then the block is loaded from the source disk into memory and the program requests inserting the destination disk.

7:

The destination disk is inserted and ENTER is pressed. A message is shown announcing the block is being saved and the save operation begins.

8:

When saving is finished, the prompter is displayed waiting for a new command.

9:

Next, the command to copy the Bytes block is entered:

10:

After an ENTER a message is shown asking for the dource disk to be inserted (since the screen is already full, it is scrolled up one line). The disk is inserted in the drive and ENTER is pressed.

11:

Another message is shown announcing the disk search operation for the "GENS4" block and the program starts searching.

12:

When the block is found, another message is shown to indicate that, the block is loaded from disk into memory and the program requests for the destination disk to be inserted.

13:

The destination disk is inserted and ENTER is pressed. A message is shown announcing the block is being saved and the save operation begins.

14:

When saving is done, the prompter is displayed again waiting for a new command.

15:

The CAT command is entered (New Mode, Symbol Shift + 9) in order to see the contents of the destination disk...

16:

...and, after an ENTER, the two data blocks previously copied are listed.

17:

Then the E key is pressed...

18:

...and after an ENTER the program is terminated with a reset...

19:

...and the DEVIL startup message is displayed.


FIU - UTILITY TO COPY FILES FROM MAGNETIC TAPE TO DISK

1:

The loading command is entered from the keyboard, LOAD "FIU".

2:

After an ENTER the screen changes, a start message is shown and the program waits for any key press to continue.

3:

After pressing a key the screen changes and the work interface is shown, is still not fully loaded. The "Free" box in the top right corner showing the available memory is empty.

4:

After a moment a message is shown announcing the loading of a code block which is part of this utility...

5:

...and the block is loaded (quite visibly) in the lower third of the screen, in the video memory.

6:

When the program actually starts, total available memory is displayed and the program waits for a command to be entered. The L key will start loading from tape, S will save the loaded code to disk.

7:

Next, the L key was pressed to load a program from magnetic tape. For the purpose of this demonstration a game was used, AMAUROTE. The border changed color, waiting for the audio signal.

8:

The loading signal for the header of the first block shows up on the BORDER...

9:

...and then the information in the header shows up in the list on the screen.

10:

Next the actual data block is loaded...

11:

...and then it too is shown in the list.

12:

Then the loading signal for the header of the second block shows up on the BORDER...

13:

...then the information in the header shows up in the list on the screen.

14:

Next the actual data block is loaded (a SCREEN)...

15:

...and then it too is shown in the list.

16:

At this moment the SPACE key was pressed to stop the loading. The next block is quite big and it would not fit in the remaining available memory, so first we will save what was loaded up to this point.

17:

To do this, an empty disk (formatted) is inserted into the drive. The blocks to be saved must be first selected with the ENTER key. So we press ENTER once...

18:

...twice...

19:

...three times...

20:

...four times...

21:

We press the S key to save all selection to disk. The menu on the right is deactivated, the selection in the list moves on the first block, whose name is shown above the list in the "Current:" box (which was empty before) and the block is saved to disk.

22:

When the first block was saved, the selection in the list moves on the second block, whose name is shown above the list in the "Current:" box, and it too is saved to disk.

23:

Now the two blocks loaded can be erased from memory to make room for the next block of the program being copied. Deletion (of selected blocks) can be done with the K key.

24:

After pressing it, the menu deactivates for a few moments....

25:

...then the list is emptied, the available memory displayed in the top right goes back to the max. value shown at startup and the menu on the right reactivates, with only two available options (Load and Exit).

26:

Next the L key is pressed in order to load the rest of the game from tape. The border becomes white, waiting for the audio loading signal.

27:

The loading signal for the header of the last block shows on the BORDER...

28:

...then the information in the header is shown in the list on the screen.

29:

Next the actual data block is loaded...

30:

...then the loading ends, and since at this point the whole program finished copying too...

31:

...the SPACE key is pressed to stop the loading. The menu activates and the name of the loaded block is selected in the list.

32:

Now we must select the header and the block in order to save them to disk, so we press ENTER once...

33:

...and one more time.

34:

Then we press S to start saving. The menu on the right deactivates, the selection in the list moves on the header of the block, whose name shows above the list in the "Current:" box and the block is saved to disk.

35:

When saving is done, the menu reactivates. Now that the copying is done, let's test the "name" option in the menu which renames a loaded data block. Obviously, using the N key.

36:

So, having selected the header (the name) for the last loaded block, we press N and the field with the original name (PROG) empties, waiting for a new name to be entered. I will rename it PROG1. So I will type...

37:

... P ...

38:

... R ...

39:

... O ...

40:

... G ...

41:

... 1 ...

42:

... and ENTER. The menu on the right reactivates after being disabled while entering the new name.

43:

Now I press K to delete the block from memory and the list empties.

44:

Then I press E to quit the program and get back to DEVIL. A reset is performed...

45:

...then the startup DEVIL message is shown.

46:

Now, in order to see the contents of the disk we saved to, we will use the CAT command (New Mode, SS + 9)...

47:

...and after an ENTER, the disk contents is displayed, confirming the program we copied was successfully saved.


3. My CoBra DEVIL floppy archive



Back in the day, around 1990-1997, I did hoard too, like any other fanatic CoBra owner, every piece of CoBra software I could lay my hands on. As far as DEVIL software is concerned, I could not amass too much. Aside from the basic utilities used with this BASIC species with floppy support, the rest of the software is mostly transfered by myself from magnetic tape. And since not every program can be transfered to a DEVIL floppy disk, the amount of DEVIL software floppies amassed by me is drastically reduced too.

As in the case of CP/M, in the early '90s, the floppy drive I used with CoBra being a 5 ¼" drive, DSDD 80-track 720K, I stored DEVIL software on 5 ¼" floppies. I amassed during that period 6 floppies, 3 with utility programs and 3 with games.

Later on, in the late '90s, I also achieved a 3 ½" floppy drive, and consequently I copied all my 5 ¼" archive onto 3 ½" floppies. These latter ones, about the end of the '90s, when I already had a PC, I archived with Teledisk and stored on a data CD. The 5 ¼" floppies were mothballed and it looks like they have been preserved very well so far, because recently (around 2013) I pulled them out of the preservation storage containers and I archived them too with Teledisk, using the ancient 5 ¼" drive, which was preserved very well too.

That's how and why, at present, I have two different Teledisk floppy image archives of some CoBra DEVIL disks, containing pretty much the same things. I will list below the two archives, along with the contents of every disk and the result of a SAMdisk scan, which in a few cases reveals logical disk errors, and at this time the inventory will be complete, establishing which floppies have errors and which ones are OK.

For each floppy image it is shown a listing of the disk catalog, generated with the STAT utility, as a screen snapshot (so I don't have to do manual work transcribing the whole text), as well as the result of a SAMdisk scan, listing the sector numbers for all tracks present in the floppy image. These two pieces of information are shown when the mouse cursor is above the name of the floppy image. The floppy image itself can be downloaded with a right-click on its name followed by "Save As". Also, to the right of the floppy image name, there is a cell containing "Disk STATistics". Hovering the mouse over this text will bring up the result of the "Statistics" command in STAT for that floppy. And to go the whole 9 yards, for floppy images with errors, the background is pink and a little text tip will pop up describing the nature of the error.

3 ½" DEVIL FLOPPY DISKS WITH GAMES: (to download, right-click the disk name on the left and then "Save As")

Floppy image

Contents

SAMdisk scan

GAMES1.TDO Disk STATistics

GAMES2.TDO Disk STATistics
GAMES3.TDO Disk STATistics


3 ½" DEVIL FLOPPY DISKS WITH UTILITIES: (to download, right-click the disk name on the left and then "Save As")

Floppy image

Contents

SAMdisk scan

UTILS1.TDO Disk STATistics

UTILS2.TDO Disk STATistics
UTILS3.TDO Disk STATistics


5 ¼" DEVIL FLOPPY DISKS WITH GAMES: (to download, right-click the disk name on the left and then "Save As")

Floppy image

Contents

SAMdisk scan

DISK_1D.TDO Disk STATistics

DISK_2D.TDO Disk STATistics
DISK_3D.TDO Disk STATistics


5 ¼" DEVIL FLOPPY DISKS WITH UTILITIES: (to download, right-click the disk name on the left and then "Save As")

Floppy image

Contents

SAMdisk scan

DISK_D0.TDO Disk STATistics

DISK_D1.TDO Disk STATistics
DISK_D2.TDO Disk STATistics

* * *

4. Procedure to convert Teledisk images of CoBra DEVIL floppies to RAW images.



In order to convert DEVIL floppy images from Teledisk format to RAW format, I personally use two different procedures:
  1. A bash script I wrote (TD02RAW, described next), which in turn uses two executables, SAMdisk.exe (written by Simon Owen) and hexdumptxt2bin (written by me).
    This method will generate a RAW image having sectors saved with an interleave, in the exact same order they are on the physical floppy disk.
  2. The HxCFloppyEmulator.exe utility, written for the HxC floppy emulator. For conversion, the Teledisk image must be loaded with the „Load” button, then the Track Analyzer must be open and deleted any possible existing tracks beyond 79, and then using the "Export" button the image is saved in RAW format.
    This method will generate a RAW image having sectors saved without interleave, in the order of their physical sector numbers.
Starting from the observation that the SAMdisk utility written by Simon Owen can extract the entire contents of a Teledisk (.TD0) floppy image into a text format, listing all bytes in the disk sectors in hex, I was starting to think about finding an "automated" way to convert the Teledisk images in my archive into RAW images, simply containing in a binary format all disk sectors, in their physical order.

Such an image could have then be used with some future utility (preferably written by myself) which would transfer files (data blocks) from and into these images.

Unlike CP/M, in DEVIL's case there is no logical sector interleave, but a physical interleave. While in CP/M sectors on a track (512 bytes/sector) are physically numbered (on one side) on disk in order, from 1 to 9, in DEVIL sectors on a track (256 bytes/sector) are physically numbered with an interleave of 2, which means the physical order of sectors on a track (on one side) is 1, 10, 2, 11, 3, 12, 4, 13, 5, 14, 6, 15, 7, 16, 8, 17, 9, 18.

Converting a Teledisk image which has physical interleave to a RAW image, when using the HxCFloppyEmulator.exe utility, yields a result I did not expect, this utility saving a RAW image with sectors in the order of their physical sector numbers instead of saving them in their physical disk order. Seems like this would be the de facto standard for RAW images. Except I don't agree with this, and it seems more logical to me for a RAW image to have sectors saved in the same order as their physical disk order. In other words, if the original disk has physical interleave, the RAW should have sectors saved interleaved too.

Aside from the physical interleaving issue described above, when converting from .TD0 to .RAW another aspect must be considered: some Teledisk images in my archive belong to some 720K floppies, but which floppies had previously been formatted in 860K (86 tracks). At the time I archived them with Teledisk, they have been read by a 5 ¼" drive which could not move its head on all 86 tracks, but only up to track 82-83. As such, Teledisk archived them as 82-track floppies, since it could only read 82. Obviously tracks 80-81 are of no interest here, since the data on these disks is stored in 720 KB format, on only 80 tracks. Therefore, when converting .TD0 -> .RAW, the tracks from 80 beyond must be excluded.

Bottom line, a true utility to convert DEVIL images from Teledisk format to RAW format should take as one argument a track range when transfering data to the RAW image. For DEVIL floppies, the range used will be 0 to 79. For this format (18 sectors / track side, 256 bytes/sector), the size of a RAW image generated like this will be exactly 737280 bytes (80 tracks x 36 sectors/track x 256 bytes/sector).

As in CP/M's case, the same bash script I wrote (TD02RAW) can be used to convert the Teledisk image to RAW by using Simon Owen's SAMdisk.exe, then another utility (written by me in Standard C, cobra-devil-diskimg-copy.c, described below) can be used to transfer files between DEVIL RAW images and Linux. The "TD02RAW" script in turn uses SAMdisk.exe in order to extract track data from the Teledisk image as text (hex listing), which text is then converted to binary image (RAW). Initially it was split in two scripts: the first would extract the track data, the second would convert from text to binary. Later on I joined them into one single script and I added more options. The problem is the second part, the way it is written in Bash, is very slow. In order to convert a floppy from text (hex listing) into binary image, it needs about one hour (!!!). That's why later on I added the option of using an external executable I wrote in C (hexdumptxt2bin, described below) which would deal with the text-to-binary conversion, and which does the job instantly. At present the script checks to see if the external executable is present and if it is, it uses it. If it's not, it uses the more hardworking alternative written in Bash just like the rest of the script.

Bash script for conversion from Teledisk image to RAW image (TD02RAW)



I recommend using it together with the hexdumptxt2bin executable described below (saved in the same directory with this script)
SYNTAX:
TD02RAW   TD0_image   [start_track   [end_track]]


NOTE:
1.
TD0_image
is the name of a Teledisk image WITHOUT the .TD0 extension (which must be present in the file name though).
2.
start_track
is the number of the first track to extract from the Teledisk image.
3.
end_track
is the number of the last track to extract.
If the first track extracted has a number (n) greater than 0, tracks 0 to n-1 will be generated in the RAW image filled with the $E5 byte (formatted).
If start_track and end_track are not specified, they will be assumed to be start_track = 0 and end_track = 79.
So, for normal cases, executing the script with no parameters after the Teledisk file name is just enough.

EXAMPLE:
To extract data from the Teledisk DEVIL floppy image GAMES1.TD0 (720K, 80 tracks) the command used must be:

TD02RAW GAMES1

and tracks 80-81 in the Teledisk image will be excluded from the RAW image being generated.

Linux utility written in Standard C for text-to-binary conversion (hexdumptxt2bin.c)

The downloadable .ZIP archive contains the C source presented below, the statically built executable (should run with no problems in any Linux distro other than mine) and the compilation log (contains the actual command used for compilation and compiler messages)

SYNTAX:
hexdumptxt2bin   filename.hexdump


NOTE: The text file name supplied as parameter must have the .hexdump extension.

The resulted binary file is saved as "filename.bin"

* * *

5. Utilities for file transfer between Linux and CoBra DEVIL RAW floppy images



5.1 Text mode Linux utility, written in Standard C.


This is a text mode program (runs in a Linux text console) which generates floppy images (formatted), extracts files from floppy images, writes them into images, deletes files from images, lists image contents in detail, can manipulate DEVIL file attributes (Read Only/Read Write and Catalog/Non Catalog) and check for certain logical errors in the DEVIL filesystem. It has a builtin help which is displayed in console when the program is run without arguments.

NOTE!
This program only works with interlaced RAW images (sectors saved in their original physical disk order)

NOTE:
Because of the Spectrum style of storing the information on magnetic tape, data transfer from/into CoBra DEVIL floppy images (using this program) is done in .TAP format, according to the description of this format by Gerton Lunter, the author of the Spectrum "Z80" emulator. When extracting an application from a DEVIL floppy image, a block range must be specified, using the data block index in the disk catalog, displayed using the -l command (list). Therefore the floppy image contents must be listed first, using the -l command, then the -x command can be used specifying a range of data blocks that must be extracted. Usually the first block would be a "Program", followed by a few other "Code" blocks. If the first block to be extracted is displayed for instance with the index 1 and the next blocks of the same application have the indexes 2, 3, 4, 5, 6, the block range to use when extracting the apllication from the DEVIL image is "1-6". The .TAP file generated this way will have the name of the first block in the range specified, which usually is the original name of the application.

Since most of the programs written by others convert Teledisk floppy images with a physical interleave to RAW images having non-interleaved sectors, I implemented in this program two special commands: -i (interleave) and -di (de-interleave).

The -i command takes such a DEVIL RAW floppy image with lost interleave and correctly restores the interleave. If the initial image is for instance "devildisk.img", the interleaved image will be saved as "devildisk_interleaved.img". Obviously, "devildisk.img" is presumed to have 256-byte sectors, with 18 sectors/track/side, and 80 tracks.

The -di command takes an interleaved RAW image and saves it without interleave. If the initial image is for instance "devildisk.img", the non-interleaved image will be saved as "devildisk_deinterleaved.img". Obviously, "devildisk.img" is presumed to have 256-byte sectors, with 18 sectors/track/side, and 80 tracks. This command must be used before exporting the image to HFE format using HxCFloppyEmulator.exe in order to use it in the HxC floppy emulator.

The downloadable ZIP archive contains the C source presented below, the statically compiled executable (should run without problems on any Linux different from mine) and the compilation log (contains the actual compilation command and the compiler messages).

Linux utility written in Standard C for file transfer from/into Cobra DEVIL RAW floppy images (cobra-devil-diskimg-copy.c)


5.2 Graphic mode Linux utility, written in C++ and Qt 3.3.8.


2018-06-22:


A few (6) months after the start of the action (with many long breaks) I also finished a graphic version in C++ and Qt (Qt 3.3.8 for now) for the previously presented utility for data transfer from/in CoBra DEVIL floppy images.

I came up with a program that can be used in two different ways: This utility can be compiled in a few different versions: The usefulness of this program is maximum when it is used in conjunction with a hardware floppy emulator (HxC for instance), for which the RAW images can easily be converted (to HFE format) and used on a SD Card directly with CoBra.

Below are two screen snapshots taken during program execution, along with the downloadable archive containing the source files as well as the precompiled executable (in 3 versions) in case you don't have a Linux system with all building requirements.

Linux graphic (Qt3) utility for data transfer from/into CoBra DEVIL floppy RAW images

Downloadable archive - rev.4.9.2 MD5: daf03e7c46b092abe77263a52ae70aaa

5.2 Graphic mode Linux utility, written in C++ and Qt 4.8.6.


2019-02-28:


About a year ago I also finished a graphic version in C++ and Qt 4.8.6 for the previously presented utility for data transfer from/in CoBra DEVIL floppy images.

Functionally it is identical, the only difference is Qt4 instead of Qt3. Just like the Qt3 version, it is a program that can be used in two different ways: This utility can be compiled in a few different versions: The usefulness of this program is maximum when it is used in conjunction with a hardware floppy emulator (HxC for instance), for which the RAW images can easily be converted (to HFE format) and used on a SD Card directly with CoBra.

Below are two screen snapshots taken during program execution, along with the downloadable archive containing the source files as well as the precompiled executable (in 3 versions) in case you don't have a Linux system with all building requirements.

Linux graphic (Qt4) utility for data transfer from/into CoBra DEVIL floppy RAW images

Downloadable archive - rev.5.1 MD5: 657a0a53d512f6c5011f4ce66d236b8c

* * *

6. Converting CoBra DEVIL floppy RAW images into HFE images for use with the HxC SD Card hardware floppy emulator



A CoBra DEVIL floppy RAW image can be generated in a few different ways, one would be the conversion of an existing Teledisk image in one of the two ways dscribed in paragraph 2, another is by using the "cobra-devil-diskimg-copy.c" utility previously presented. The most interesting use of such a RAW image is in a hardware floppy emulator. I personally do own such a device, so I will make here a little comment about converting CoBra DEVIL floppy RAW images into HFE images usable on an SD Card inserted in this emulator.

In order to use a RAW image in the HxC emulator, the image file must first be converted to HFE format, which is the only format accepted for use in the SD Card inserted in the emulator. Once created, these HFE files can be used in both Read and Write mode, offering a very accurate emulation of a real floppy disk. I will state here again, before converting it to HFE format, the RAW image must be brought (if it is interleaved) to a non-interleave format (using the -di command of cobra-devil-diskimg-copy).

The first thing to be said here is that a RAW image only contains the user data stored on the original floppy (data bytes in the sectors on disk). All formatting information (number of sectors per track, number of bytes per sector, interleave, Pre-Index GAP, Index Mark, Post-Index GAP, GAP2, GAP3 etc.) are missing. All this missing information is included though in the HFE images. For the RAW -> HFE conversion, the user will have to know some of the formatting parameters of the original floppy disk corresponding to the RAW image and enter them in a RAW -> HFE conversion program.

The HxC emulator comes with a floppy image conversion utility ("HxCFloppyEmulator.exe"). In order to convert 720 KB RAW CoBra DEVIL floppy images to HFE format with this utility, the first thing to do is to make sure the RAW image has its sectors non-interleaved. If it is an image previously manipulated with cobra-devil-diskimg-copy, it must be converted with the -di command. After that, the following steps must be followed:

1. "HxCFloppyEmulator.exe" must be started (either in Microsh*t Windblows, or in Linux under Wine - obviously I ran it in Wine). A main window will be shown (see the image on the right).
2. Click the "Load Raw image" button
3. Another window will show up ("RAW File format configuration") where the formatting parameters of the original floppy disk must be entered for the RAW image to be converted (see next image on the right).
In this window all required parameters will be shown with some default values. Some will have to be changed in order to match the CoBra DEVIL floppy format, as follows:
4. The "Format Value" box must be set to 229 (that is 0xE5, the DEVIL formatting byte)
5. The "Sector per track" box must be set to 18.
6. The "Sector size" drop-down list must be set to 256 Bytes.
7. The "Interleave" box must be set to 2.
8. The "Auto GAP3" checkbox must be unchecked and the "GAP3 length" box set to 12.
9. All other parameters can be left to their default values, which should look like in the image on the right.
10. Click the "Load RAW file" button, and in the file selection dialog that shows up select the RAW image file to be converted. Then the configuration window will close and we get back to the main window.
11. In the main window click the "Export" button and choose the HFE file format as well as the name of the file to be saved with this format.