Thursday, August 18, 2016

Happy 35th birthday, IBM PC!

August 12, 1981 introduced us to the IBM PC, and to PC-DOS along with it. The latter included extensions for the machine's ROM BASIC, plus a slew of demonstration programs proudly showing off these indispensable capabilities: 4-color graphics and 1-bit beeper sound. One of them in particular went on to live in certain infamy as Bill Gates' first (and only) direct personal contribution to video game history: the inimitable DONKEY.

So I'm a few days late to the party, but hopefully my little present can still be accepted: Sorry Ass, a tiny remake of DONKEY.BAS designed to fit into a standard floppy disk's 512-byte boot sector. The only requirements are 8088+, CGA+, a keyboard and a disk drive, so this should run on most x86-based PCs all the way back to the original IBM 5150. For an appropriately eardrum-raping approximation of the jackass greeting your bumper, the PC speaker is also supported.

Assembly source is included, plus a 442-byte .COM version for use under DOS. The 360KB disk image is bootable and can be written directly to a floppy, or started from DOSBox ("boot SorryAss.ima"), PCEm, and so on; if you're so inclined you can pad it with zero bytes to your favorite standard disk size.

- Download (7 KB .zip)
- Pouet prod page

Sunday, July 17, 2016

Keen 4 Mystery Code Demystified

In my post on Keen 4 I mentioned a seemingly-unused routine in v1.4-CGA, which I ended up using as patch space for my own code.  Having no idea what it was for, I consulted the sources for Keen Dreams, and found that it looked an awful lot like a KDR routine which caches level data - specifically, CA_CacheMarks in ID_CA.C.  At some point during Keen 4's initialization, a single pointer gets set to this code; but immediately afterwards the address is replaced so this function is never executed.

NY00123 took a closer look at it, and it turns out that that's exactly what it is: leftover level-loading code from Keen Dreams.  It's still fully-functional, too: for whatever reason, id left it lying around as a placeholder in later versions of their engine, and simply reset the pointer at runtime to whatever new thing they came up with.

Amusingly, you can bring it back into action by NOPing out the pointer overwrites - this replaces Keen's finger-counting with a KDR-style progress bar (or a "thermometer" in contemporary id palance):

Yet another 16-color CGA makeover: Keen 5

After giving Keen 4's CGA version a 16-color composite overhaul, I figured I'd have a go at the next episode, since the code has nearly everything in common with Keen 4, and the composite enhancements detailed in my previous post could be applied without too many essential changes (other than different offsets/addresses, of course).  Let's strap this one to the rack then:

Saturday, May 28, 2016

Dopefish goes NTSC: Commander Keen 4 Composite CGA Patch Notes

If you're just landing here at random and wondering about the title: this is a 16-color 'remaster' of the original CGA version of Commander Keen IV: Secret of the Oracle, with code patched and graphics redrawn and reworked to take optimal advantage of CGA's composite output capabilities.

For more info (plus the download link), see the VOGONS thread - all sorts of cool stuff in there, like videos recorded from real hardware, and a DOSBox build patched with some useful additions for running this.  However, I've had a request or two for the technical nitty-gritty, so here's where I'm gonna dump it (careful what you wish for? ;-))

This patch started out as direct modification of the .EXE, following some disassembly and analysis.  I "ported" it to the CKPATCH format (for in-memory patching) only when I was done, by generating a binary diff.  This is why my notes will follow the disassembly, which is easier to comment on; all offsets are relative to the beginning of the load image (=file offset minus 2C00h) in v1.4-Apogee of the CGA executable.

Patch space

For new data, I found some 119 bytes that could be reused at offset 31548h.  In KEEN4C.EXE this has the color tables for the EGA fade routines - they're still present in the CGA executable for no discernible reason.  I ended up using only 36 bytes here, for extending the color tables used by various CGA drawing routines.

Tuesday, March 22, 2016

Olympiad: IBM prototype fonts unearthed

My Ultimate Oldschool PC Font Pack got some pretty cool responses, and one of them contained something quite unexpected: a set of files transferred from twenty-five 5.25" floppies, containing internal snapshots of font development done at IBM around 1984.

These prototype fonts were designed specifically for a project codenamed Olympiad.  Familiar?  Probably not, but it came to light a couple years later as the IBM 6150 AKA the RT PC, a RISC workstation and grandaddy of the PowerPC architecture.  The type design work was evidently carried out in IBM's Austin, TX campus; the date stamps on the files range from Dec '83 to mid '85 - according to the contributor, this set of fonts took the team a year to deliver.

Sample image off the work-in-progress files

Inside the disks is a big bunch of bitmap character data, plus sample images and tools for internal use (some compiled, some written in IBM PC BASIC).  The person who sent this to me had already extracted some of the bitmap data: it's mostly straight 1bpp framebuffer dumps, except for a few '.IDS' files that proved slightly tricky (with characters in sequence like a typical font ROM, except that the scanlines aren't byte-aligned, appallingly enough).  Once I had everything converted, I promptly set about creating .FON and .TTF versions, as you do.

Friday, February 26, 2016

So-called "IBM" freeware games from the early '80s

(and the Cryptic Code Conundrum)

This is a question I've already raised in the usual suspect places, but without much success, so here it is again on the off chance that anybody knows anything.

Going through compilations of very early BBS-fodder for the IBM PC (shareware, freeware, public domain), I frequently see this bunch of games and programs that seem to have a few things in common:

  • They're all in BASIC
  • In their title screens, they all rip off the layout of IBM's PC-DOS demonstration programs (DONKEY, etc.)
  • From that design they retain the 'IBM' on top, but there's no IBM copyright notice
  • There's no publisher info anywhere within the program, although some do list the author
  • Some (not all) of them have a further "mystery code" on the title screen, with the format "XXX-5-5-Y"

A few of these games (e.g. ATTACK) are frequently misattributed to IBM itself.  While it's amusing to think of Big Blue sticking it to the Cupertino cabal with that game, the 'evidence' as such is hardly convincing - especially considering the amateur quality of the game (and the others in this group), and the lack of copyright messagse.  The snippet on the left (from PC Magazine, p55, April 17, 1984) seems to agree.

My best guess would be that some BBS, users group, or disk club simply slapped a few standardized title screens on their user-submitted software.  "IBM", at best, simply served to signify the platform, in the same way that software was referred to as being for "the Apple" or "the Commodore".  Since those early shareware selections were incredibly promiscuous with their offerings, it's incredibly hard to figure out where these titles came from originally.
So, does anybody have a clue?  And what could those cryptic XXX-5-5-Y "mystery codes" be?

Saturday, January 16, 2016

The Ultimate Oldschool PC Font Pack (v1.0)

Character(-set) Assassination: a Monospace Odyssey

At long last, it's done - the world's biggest collection of classic text mode fonts, system fonts and BIOS fonts from DOS-era IBM PCs and compatibles.
You get:
  • Pixel-perfect reproductions of the original raster fonts!
  • TrueType (TTF) and bitmap (FON) remakes for 81 character sets!
  • Multi-lingual Unicode enhancements of the more popular fonts (and some less-popular ones)!
  • Multi-platform compatibility!

The Ultimate Oldschool PC Font Pack started out with the idea of paying tribute to ancient PCs and their bitmapped, pre-GUI typography (if you can call it that). It was inspired by similar efforts that cover other vintage machines: classic system fonts from the Amiga, C64, Apple II, Mac, ZX Spectrum, Atari 8-bit/ST etc. are all celebrated. On the other hand, the IBM PC and its clones seem to get little love... except for that one VGA text mode font (which has been remade numerous times, to varying degrees of success).

This collection is here to remedy that, and to bring you pixel-perfect remakes of various type styles from text-mode era PCs - in modern, multi-platform, Unicode-compatible TrueType form (plus straight bitmap versions).

Although the goal is to make it a complete resource, the main focus is on hardware character sets: the kind that's located in a ROM chip on the system board or graphics card, which is what you'd see by default when working in text (or graphics) mode. Software-loadable fonts are also within the scope of this collection (if associated with a particular machine or display system), so some of these have also made it in.

Here's what's inside (for now):
  • IBM PC Fonts (PC BIOS, CGA/PCjr, MDA, EGA, VGA/MCGA, PGC, 3270 PC, PC Convertible, PS/2 ISA models)
  • Fonts from PC clones (Amstrad PC1512, AT&T PC6300, Tandy 1000, AMI BIOS, DTK/ERSO, ITT Xtra, Kaypro 2000, Phoenix BIOS, VTech Laser XT)
  • Fonts from various graphics hardware (ATI VGA Wonder / Small Wonder, Phoenix EGA, Rendition Verite, Wyse WY-700)
  • System-specific DOS/software fonts (AST Premium Exec, IBM-DOS ISO-compliant, Compaq-DOS, Toshiba-DOS)

Oh yeah, I'm releasing the whole bunch under a Creative Commons (BY-SA 4.0) license.  Have at it!