Sunday, March 28, 2021

Family BASIC - Putting the "Computer" into the Family Computer

Courtesy of Wikipedia (taken by Evan Amos)

When Nintendo released its first console, the Famicom, the full name of the system was the Nintendo Family Computer.  In the early 1980s the line between video game consoles and home computers was a fuzzy one.  Some consoles, like the Odyssey^2 had a full (membrane) keyboard but were more like video game consoles.  Some computers like the Commodore 64 had a full-travel keyboard and a disk drive but could also play games via its Expansion Port.  At the Famicom's launch in 1983, the only software available for the machine were arcade game ports.  By the next year (1984) Nintendo had released a new product for the Family Computer which was intended to do more than just play another video game.  This product was released as Family BASIC on July 21, 1984, but was only released in Japan.  Did it succeed in turning the Famicom into a Family Computer?  

Saturday, March 20, 2021

IBM JX - The IBM PCjr. 2.0 (Revised Article)

I wrote an article about the IBM JX (note no "PC" in the computer's name) five years ago.  Much of that article was subject to speculation due to the lack of hard information about the IBM JX.  A significant portion of that article had out-of-date information, so with the help of a site dedicated to the IBM JX and two Youtube videos really showing the system off for the first time, I have rewritten that old article (except for the following paragraph) entirely.  

In 1985, IBM released a computer in Japan, Australia and New Zealand called the IBM JX, Model 5511.  Essentially it was an upgraded PCjr., and in some respects what the PCjr. should have been.  In fact, upon rumors of the JX making it to the United States, at least one commentator dubbed it the PCjr. 2. Released in 1985, just as the PCjr. was being discontinued, it proved to be the last machine by IBM with any substantial PCjr. compatibility.  However, it was not successful anywhere it was released and consequently is extremely obscure today.

Friday, March 19, 2021

Breaking the Disk-Based Protection on Sierra On-line Key Disk Games - The Final Word

Sierra On-line was one of the first of the "big-box" computer game that supported installation of its games to a hard drive on a PC-compatible hard drive.  In the beginning, it required a "key disk" to be inserted in the drive whenever its games would be run.  In this article I will discuss the various ways to bypass this key disk check and explore the key disk check in more detail.

History of Sierra and IBM PC-Compatible Disk Based Copy Protection

Sierra was a very early publisher of PC games.  Its first game, Adventure in Serenia was a port of its popular Hi-res Adventure #2, Wizard and the Princess.  The port was developed while the IBM PC was in development and released soon after the release of the IBM PC in August of 1981.  Even though the release was by IBM, the disk was still copy protected.  

The copy protection on early Sierra titles was pretty basic, weird sector IDs, non-standard sector sizes and the like.  The copy protection did not nearly have to be sophisticated as on other systems at first because the IBM PC was a young computer and fairly expensive.  All it had to do was to break the DISKCOPY command and other copying methods with respected DOS rules.  Other early releases like Frogger and Crossfire used these kinds of in-house protections.

Eventually Sierra began relying on commercially sold copy protection schemes, especially as it started to gravitate toward DOS-reliant releases.  At first it favored Formaster Copylock, used with Ultima II (1983 release on 160KiB disk and 1984 release on 360KiB ), Mr. Cool, King's Quest (IBM PC booter versions only) and Sierra Championship Boxing (1984 Booter release).  Formaster Copylock requiresHowever Formaster Copylock had its issues, it did not work at first with a DMA-less PC like the PCjr. and many early Tandy 1000 models (which is why those King's Quest booter versions do not use it) and it was speed sensitive, breaking on faster 286 machines.  It was also not impossible to copy disks via software methods.

Another disk-based copy protection that was available was Softguard's Superlok.  When Formaster was slow to meet Sierra's needs, Superlok was not possible to reproduce without special hardware or an Option Board.  Superlok's protection schemes did not care about DMA or system speed.  When Sierra began using Superlok, it was at v2.3.  Sierra used Superlok for the booter King's Quest II, Donald Duck's Playground and The Black Cauldron.  Sierra also used Superlok for the DOS-based games Sierra's Championship Boxing (1985 release), Winnie the Pooh in the Hundred-Acre Wood, Mickey's Space Adventure (3.5" disk version only) and Ultima II (1985 360KiB release).  Even though these games required MS-DOS they could not be run when their files were copied to a hard drive.

Sierra was apparently so impressed with Superlok that it used it for all its other games which implemented disk-based copy protection.  One other important feature of Superlok is that it permitted games to be copied to and from a hard disk and would call its protection check program from the floppy disk.  Thus those lucky enough to own a hard drive from 1986 onward would be able to enjoy the faster loading speed from a hard drive as opposed to a floppy drive.  

The hard drive installable games protected by Superlok are King's Quest I, II & III, Space Quest I & II, Leisure Suit Larry I, The Black Cauldron (v2.1 only) Thexder and 3-D Helicopter Simulator. The first seven games use the AGI engine.  All the above games use AGI interpreters.  Although Mixed Up Mother Goose and Police Quest I also use AGI interpreters, they may never have had copy protection applied to them.  Eventually Sierra found that Superlok's was not uncrackable, that disk based copy protection was more trouble than it was worth and began switching to manual-based copy protection.  

Defeating Superlok - Three Methods

There are three general methods to defeat Superlok.  The first is to crack the game's .COM loader.  The second is to crack the game's true executable.  The third is to copy the Superlok track.

The way your supposed to load an AGI game installed to hard disk was to execute either the game's .BAT batch file, created by its hard disk installation program (also a batch file).  The batch file would run the .COM loader.  When you installed the game to a hard drive, the name of this loader would be the game's name, KQ.COM, SQ.COM etc.  Sometimes it is named SIERRA.COM.  

If you did not have a hard drive, you were instructed to make a "Play Disk".  You did this by using the command COPY *.* a: b:, not DISKCOPY A: B:  If you used the DISKCOPY command, DOS would quit and throw an error message when it encountered the protected track.

The COM file calls and executes a program called CPC.COM, a hidden file on the game's first floppy disk.  CPC.COM checked for the presence of the the Superlok-formatted track, which was for Sierra always (with one known exception), track 6, side 0.  If the check passed satisfactorily, CPC.COM would pass the 128-byte encryption key to SIERRA.COM.  SIERRA.COM would then use the encryption key to decrypt the file AGI.  AGI was an encrypted .EXE file which ran the intepreter which, once decrypted, in turn ran the game.  

A track on a 360KiB or 720KiB disk stores 4,608 data bytes.  The data on the Superlok track remained the same from game to game from 1985's Booter versions of King's Quest II to 1987's Space Quest II.  Each game would identify an offset in the data from which to derive its key.  Then this 128 byte key would be XORed with the first 128 bytes of the true executable, then the key is rotated by one bit, then XORed with the next 128 bytes of the executable, rotate and repeat until the executable is fully decrypted.

When Sierra began releasing budget versions of its copy protected games, usually to use up surplus manuals or boxes, it would remove the copy protection to permit for easier disk duplication.  It did this by cracking the .COM loader.  Three bytes, when NOPed out, were sufficient to bypass the call to CPC.COM.  The key that decrypted that executable would be present in the cracked .COM file on the disk instead of being copied to the .COM program running in RAM.  With the key present and a call to a program check for the presence of the copy protected track no longer present, the .COM loader will then decrypt AGI.  This method was also used when it introduced Collection CD-ROMs containing compilations of games of a series.  

The Sierra Unprotection Program by Anders M. Olsson was originally written in 1988-90.  It can crack any hard drive installable Sierra game with an original game disk.  It does not care which disk is used, as I explained above the data on any Sierra Superlok disk is identical.  It can crack all protected games installed to the hard drive and it can also crack .COM files located on "Play Disks".  However, this method has the disadvantage of requiring a protected disk track to perform its cracking.  

The second method decrypts the AGI file itself permanently.  The program, published by Cold Turkey, is called AGI Disk Free Decryptor.  The program embeds the contents of the Superlok track, looks for the offset in the .COM loader and then decrypts the AGI file.  The decrypted executable is called AGI.EXE and that will be used to run the game.  The program comes in three versions, a 16-bit DOS executable for DOS and DOSBox usage, a 32-bit DOS executable intended for early Windows and a modern 32-bit Windows command line utility, so it can be run on anything.

Unfortunately, there is one oversight caused by running AGI without the .COM loader preceding it.  These games tend not to run properly on the IBM PCjr. without the .COM loader doing its thing before transferring control of the system over to AGI.  The Sierra Christmas Card Demo from 1986 has a program called CONFIG.COM which does the tasks necessary to permit the decrypted AGI file to run these games properly on a PCjr.  

The only known exception to the above rule is Space Quest I v1.0X, the first release of an AGI game installable to a hard drive.  This requires a PCjr. memory manager to be loaded.  If you load a standard memory manager from IBM or Microsoft, this will not be an issue.  If you load JRCONFIG, then you must 

Thexder has four executables, MAIN, MAINEG, MAINJR, MAINPS.  THEXDER.COM calls the appropriate executable for the graphics hardware detected in the system.  MAIN is for CGA or Hercules, MAINEG is for EGA, MAINJR is for PCjr. and Tandy Graphics, MAINPS is for MCGA graphics.  3-D Helicopter's real executable is also called MAIN, which HELI.COM decryps.

The third method is to use a universal protection disk.  This disk, when properly produced, can bypass the check for any game.  You need a floppy disk or floppy disk image with the Superlok protection track present.  The disk need only contain the CPC.COM program and the following files : _BC.BAT, _KQ1.BAT, _KQ2.BAT, _KQ3.BAT, _LL.BAT, _SQ.BAT, _SQ2.BAT, HELI.COM, THEXDER.COM.  The reason why the game needs these files is that CPC.COM is always run off a floppy disk and AGI interpreter versions 2.4xx and above check for the game's corresponding batch file or .COM file on the floppy disk.  These files can be completely empty, only the file name is important.  You can use the disk for games installed off 5.25" or 3.5" disks.  If you are willing to modify an original disk, you can write all these files without taking up any additional space on the disk if they are all 0 bytes.  

This disk can also be used for running games off floppy disks.  Start by running SIERRA.COM off the game disk.  Then when the prompt asks for the ORIGINAL disk, insert the universal protection disk.  Then when the game asks for the PLAY disk, insert your game disk again and that is all that is required.  The benefit of this method is that you will see the original prompts that people saw when these games were new.

If you have a means of writing back multiple copies of a disk protected with Superlok, then you can make passable disk images of these games even if you only have a group of files.  For the first disk, copy AGI, the .COM loader, all .OVL files, HGC-FONT, LOGDIR, PICDIR, SNDDIR, VIEWDIR, OBJECT, WORDS.TOK, VOL.0 and VOL.1.  DOS will not copy over the Superlok track, it thinks those chunks are bad and not suitable for file storage.  3.5" images should be able to contain all VOL files except for King's Quest III and Space Quest II.  The second disk should have VOL.0, VOL.2, OBJECT and for 3.5" disks, VOL.3.  The third disk, if required, should have VOL.0, VOL.3 and OBJECT.

Finally, you can use this method for making disks for Sierra's Championship Boxing (1985 release), Winnie the Pooh in the Hundred-Acre Wood, Mickey's Space Adventure (3.5" disk version only).  They are DOS games, although they cannot be run off a hard drive.  Ultima II looks for Superlok on another track and will not work with this method.

Sunday, March 14, 2021

Enjoying and Gaming on a TRS-80 Model 1

When one thinks of the 1977 Trinity, the Apple II, the TRS-80 and the Commodore PET, the Apple II invariably is deemed the greatest of them all.  In many ways it was, but at first it was little more than a niche hobbyist's computer.  The first computer to have any impact in the consumer market was not the Apple II but the TRS-80, later retroactively referred to as the Model 1.  You might not think that this B&W only machine with chunky graphics had anything other than some simple BASIC text and crude text-based ASCII games, but you would be mistaken.  In this article, let's look at some of the issues with using a TRS-80 and how you can play games.