maettig.com

DOS file format converter

← Back to the index of my DOS archive

CARD/1 coordinates converter (1998)

Koordinatendateien nach CARD/1 konvertieren von Thiemo Mättig Interactive column picker of the CARD/1 converter Line-by-line comparison of the imported and exported coordinate formats

The "CARD/1 coordinate converter" is one of the few utilities I wrote for my father. It's also one of the few things I did you could call finished: A straight, very simple but effective command line interface, effective use of colors and a clear focus on a single, simple but very flexible task. The tool converts geographical coordinates from any ASCII file format to one of two specific formats the CARD/1 software was capable of importing when my father had this problem back in 1998. What you had to do is to pick the columns where latitude, longitude, elevation and the number of that point start and end. The final step of the conversion even included a line-by-line diff between the old and the new file.

Download the »CARD/1« coordinates converter and source code (PowerBASIC)

Reverse engineering (1998)

Among software I found on my beloved Pegasus and Mediaplex CD-ROM collection, two German diskmags got my special attention: Hot-Mag and Suicide. I wanted to print some of the articles from these magazines but could not find a supported way to do this. So I started reverse engineering the file formats the executable magazines use internally, and had a lot of fun turning what I learned into decoder utilities.

Swing was a puzzle game by the German company Software 2000, originally created for the PlayStation. The DOS release of the game is one of the extremly rare ones that run in a 640 × 480 pixels graphics mode with 15 bits (32,768 colors). I realized that a lot of the glorious fullscreen renderings the game shows are stored in uncompressed files. So I wrote a two-way converter for these and had fun swapping the game's assets with my own.

CCS to TXT (2000)

Issue 3 of the WildMag magazine we released in October 2000 contained two texts from the German C64 disk magazine Digital Talk, issues 43 and 44, released just two months earlier: a Mekka and Symposium 2000 party report and a short text listing hidden parts in C64 demos. Both are topics I was interested in, as well as German diskmags in general. I contacted the Digital Talk staff and asked for permission to re-release a few of the texts I found worth reading for PC users, and they said yes.

Preview of the letter D during an interactive OCR session But all I had was the compiled version of the diskmag, running in the CCS64 C64 emulator. So I wrote a simple converter that was able to load BMP screenshots from that emulator, split them into 8-by-8 pixel chunks, turn each chunk into a monochrome bitmask and interactively build a lookup map to turn each bitmask into the character is represents. And so I wrote my first optical character recognition (OCR) algorithm in less than 100 lines of hacky BASIC, with no libraries other than what was build in PowerBASIC (reading and writing binary files, string and bit manipulation). I felt so cool, even if I used it for only two small texts in the end.

The download contains three files. CCS2TXT.BAS is the actual OCR tool. CCS2TXT.DAT is the bitmask-to-character map, which is interactively build and updated every time you run the tool. CHANGE.BAS is a separate tool to fix mistakes in the data file.

Download the »CCS to TXT« source codes (PowerBASIC)

»Fake it!« patch for Duke Nukem 3D (1999)

Comparison of Duke Nukems hand original holding a dollar bill, versus a blue 3.5 inch floppy disk This tiny modification for Duke Nukem 3D replaces the dollar bill in the protagonists hand with a floppy disk, and Jon St. Johns voice recording "Shake it, baby" with "Fake it, baby" (a reference to my »real.fake« label). The amount of work I put into this proof-of-concept is absurd. It involves a rewrite of the games KEXTRACT utility, because I found the original executable to big. The floppy disk is a scan of an actual disk – grayscale and colored in Paint Shop Pro, because all I had was a grayscale scanner.

Icon 256 (1999)

Windows 3.11 was running on my PC when I started designing my first icons for programs that did not had one, using an editor that only supported 16 colors. Some of my creations can still be seen in my icon archive on this website. Later I learned how the ICO format works – that it's basically just a few BMP files stuck together. It was the Hugi icon contest that made me want to use more than the 16 default colors, but I could not find a free editor I could use. So I ended sticking to my beloved Paint Shop Pro, and wrote a trivial converter that could transform a 32 × 32 pixels BMP image with 256 colors (and nothing else) into the ICO format. As with many of my tools I believe I only used it one or two times, and then found much more powerful icon editors.

Download the »Icon 256« converter and source code (PowerBASIC)

GIF image file optimizer (2002)

GIFOPT v0.01 by mados/TAP

I love size coding competitions and even started my own, called 256b.htm. Whenever you want to include actual images into an entry for a competition like that, you quickly learn than neither JPEG nor PNG are the way to go. These formats are way to heavy. In contrast, GIF barely has any headers, and most of them are even optional, which is when my »GIFOpt« tool comes into play. It analyzes the internal structure of a GIF file and allows to remove or edit optional header information, transparency information, and even the palette of 2-color GIFs.

Download the »GIF optimizer« and source code (PowerBASIC)