Skip to content

Commit

Permalink
Tidying, usage corrections, new readme, makefile tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
ghalfacree authored and pulkomandy committed Dec 12, 2021
1 parent 3337938 commit 24029d9
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 37 deletions.
49 changes: 39 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,47 @@
Quick and dirty UNIX port of ddosutils
======================================
Quick and dirty UNIX port of Graham E. Kinns' Dragon DOS Utils
==============================================================

This is originally an MSDOS tool to read Dragon 32 floppy disks.
A *NIX port of the Dragon DOS Utils, a suite of utilities for MS-DOS designed to handle Dragon DOS floppy disks, originally written by Graham E. Kinns <gekinns@iee.org> in Apr 1997 and released under an unspecified open-source licence.

This version is crudely converted to operate on VDK files instead. Not a lot of testing was done.
This version was ported to *NIX by Adrien Destugues <pulkomandy.tk> in November 2021; port-specific code is available in the file `linux.c` and is published under the WTFPL licence.

My ugly code in linux.c is under the WTFPL license (do whatever you want with it). The other parts
are under whichever license they were distributed under, I don't know.
The original tool handled physical Dragon DOS floppy disks in a real floppy drive on MS-DOS computer systems; the port uses VDK disk images. If you have physical floppy disks you want to read, use an imaging tool like a KryoFlux to create a VDK.

The tools were patched to accept a VDK file name instead of a drive number in command line
parameters.
Compiling
=========

Compile using:
`make -f makefile.gcc`

make -f makefile.gcc
Clean with `make -f makefile.gcc clean clean_exes`

The tools are as follows, in alphabetical order:

bas2txt
=======

Converts Dragon BASIC BAS files extracted using `dcopy` into plain text files.

*USAGE:* `./bas2txt.exe input_file.bas output_file.txt`

dcopy
=====

Copies files out of a Dragon DOS VDK-format disk image onto your filesystem.

*USAGE:* `./dcopy.exe input_file.vdk [wildcard] [output_directory]`

ddir
====

Lists the files in a Dragon DOS VDK-format disk image.

*USAGE:* `./ddir.exe input_file.vdk [wildcard]`

drm2txt
=======

Converts DosDream DRM format files extracted using `dcopy` into plain text files.

*USAGE:* `./drm2txt.exe input_file.drm output_file.txt`

Enjoy!
33 changes: 19 additions & 14 deletions dcopy.c
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
/*
* dcopy.c $Id: dcopy.c 1.1 1997/05/08 21:59:08 Graham Rel $
* dcopy.c $Id: dcopy.c 2.1 2021/12/12 Linux Rel $
*
* Copies files from Dragon DOS disk
*
* Usage: 'dcopy A:', 'dcopy 1: *.bin', 'dcopy B: *.bin *.bi_'
* 'dcopy A: *.bin c:\temp\'
* Usage: 'dcopy input_file.vdk', 'dcopy input_file.vdk *.bin', 'dcopy input_file.vdk *.bin *.bi_'
* 'dcopy input_file.vdk *.bin /tmp/'
*
* Graham E. Kinns <gekinns@iee.org> Apr '97
* Ported to Linux by Adrien Destugues <pulkomandy.tk> 2021
*
* $Log: dcopy.c $
* Revision 1.1 1997/05/08 21:59:08 Graham
* Rename directory in split_filepath() prototype to fix warning.
*
* Revision 1.0 1997/04/15 21:05:38 Graham
* Initial revision
* Revision 2.1 2021/12/12
* Minor tidying
* Revision 2.0 2021/11/16
* Linux port
* Revision 1.1 1997/05/08 21:59:08 Graham
* Rename directory in split_filepath() prototype to fix warning.
* Revision 1.0 1997/04/15 21:05:38 Graham
* Initial revision
*/

#ifdef RCS
static const char rcs_id[] = "$Id: dcopy.c 1.1 1997/05/08 21:59:08 Graham Rel $";
static const char rcs_id[] = "$Id: dcopy.c 2.1 2021/12/12 Linux Rel $";
#endif

#include <stdio.h>
Expand All @@ -37,7 +42,7 @@ _ExceptInit (void)
#endif /* BC++ v4.0x */

#define PROG_NAME "dcopy"
#define VERSION "1.0"
#define VERSION "2.1"

#define MAX_DIR_ENTS 160

Expand Down Expand Up @@ -300,20 +305,20 @@ main (int argc, char *argv[])
char *output_filemask;

fputs (PROG_NAME " v" VERSION " -- Copies files from Dragon DOS disk\n"
"Graham E. Kinns <gekinns@iee.org> " __DATE__ "\n"
"Original by Graham E. Kinns <gekinns@iee.org>\nLinux port by Adrien Destugues <pulkomandy.tk>\nCompiled on " __DATE__ "\n"
"\n", stderr);

if (argc < 2
|| argv[1][0] == '-' || argv[1][0] == '/')
{
fprintf (stderr, "Usage: %s drive: [filename_wildcard] [dir\\][output_wildcard]\n\n", argv[0]);
fprintf (stderr, "Usage: %s input_file.vdk [filename_wildcard] [dir\\][output_wildcard]\n\n", argv[0]);
return (1);
}

drive_num = get_drive_num (argv[1]);
if (drive_num == 0xff)
{
fprintf (stderr, "Error: invalid drive specifier in '%s'\n", argv[1]);
fprintf (stderr, "Error: invalid input file specifier in '%s'\n", argv[1]);
return (1);
}

Expand Down Expand Up @@ -358,7 +363,7 @@ main (int argc, char *argv[])
if (num_tracks != (Byte) ~buf[254]
|| num_sectors != (Byte) ~buf[255])
{
fprintf (stderr, "Not a Dragon DOS disk\n");
fprintf (stderr, "Not a Dragon DOS VDK image\n");
return (1);
}

Expand Down
21 changes: 13 additions & 8 deletions ddir.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,21 @@
*
* Directory of Dragon DOS disk
*
* Usage: 'ddir A:', 'ddir 1: *.bin'
* Usage: 'ddir input_file.vdk', 'ddir input_file.vdk *.bin'
*
* Graham E. Kinns <gekinns@iee.org> Apr '97
* Ported to Linux by Adrien Destugues <pulkomandy.tk> 2021
*
* $Log: ddir.c $
* Revision 2.1 2021/12/12
* Minor tidying
* Revision 2.0 2021/11/16
* Linux port
* Revision 1.0 1997/04/15 20:56:54 Graham
* Initial revision
*
*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand All @@ -31,11 +36,11 @@ _ExceptInit (void)
#endif /* BC++ v4.0x */

#ifdef RCS
static const char rcs_id[] = "$Id: ddir.c 1.0 1997/04/15 20:56:54 Graham Exp $";
static const char rcs_id[] = "$Id: ddir.c 2.1 2021/12/12 Linux Exp $";
#endif

#define PROG_NAME "ddir"
#define VERSION "1.0"
#define VERSION "2.1"

#define MAX_DIR_ENTS 160

Expand Down Expand Up @@ -271,20 +276,20 @@ main (int argc, char *argv[])
uint file_count;

fputs (PROG_NAME " v" VERSION " -- Dragon DOS disk directory\n"
"Graham E. Kinns <gekinns@iee.org> " __DATE__ "\n"
"Original by Graham E. Kinns <gekinns@iee.org>\nLinux port by Adrien Destugues <pulkomandy.tk>\nCompiled on " __DATE__ "\n"
"\n", stderr);

if (argc < 2
|| argv[1][0] == '-' || argv[1][0] == '/')
{
fprintf (stderr, "Usage: %s drive: [filename_wildcard]\n\n", argv[0]);
fprintf (stderr, "Usage: %s input_file.vdk [filename_wildcard]\n\n", argv[0]);
return (1);
}

drive_num = get_drive_num (argv[1]);
if (drive_num == 0xff)
{
fprintf (stderr, "Error: invalid drive specifier in '%s'\n", argv[1]);
fprintf (stderr, "Error: invalid VDK image specifier in '%s'\n", argv[1]);
return (1);
}

Expand Down Expand Up @@ -334,7 +339,7 @@ main (int argc, char *argv[])
if (num_tracks != (Byte) ~buf[254]
|| num_sectors != (Byte) ~buf[255])
{
fprintf (stderr, "Not a Dragon DOS disk\n");
fprintf (stderr, "Not a Dragon DOS VDK image\n");
return (1);
}
num_sides = (num_sectors > 18 ? 2 : 1);
Expand Down
14 changes: 9 additions & 5 deletions makefile.gcc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
# Graham E. Kinns <gekinns@iee.org> Apr '97
#
# $Log: makefile.gcc $
# Revision 1.4 2021/12/12 Gareth Halfacree
# Change RM from del to rm
# Reduced warnings
#
# Revision 1.3 2021/11/16 pulkomandy.tk
# *NIX port
#
# Revision 1.2 1997/05/08 21:32:44 Graham
# Fixed CFLAGS with -DRCS
#
Expand All @@ -14,15 +21,12 @@
# Initial revision
#

RM = del
RM = rm

EXES = ddir.exe dcopy.exe drm2txt.exe bas2txt.exe
OBJS = djgppsml.o wildcard.o linux.o

CFLAGS = -W -Wall -pedantic -Wpointer-arith -Wbad-function-cast -Wcast-qual \
-Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wshadow \
-Wnested-externs -Winline

CFLAGS = -Wno-implicit-function-declaration
ifdef DEBUG
CFLAGS += -g
else # !DEBUG
Expand Down

0 comments on commit 24029d9

Please sign in to comment.