Showing posts with label IBM PC. Show all posts
Showing posts with label IBM PC. Show all posts

Friday, January 2, 2015

Ultima II - The Long PC Journey




In 1982, Richard Garriott, Lord British, made Ultima II: Revenge of the Enchantress for the Apple II computer.  His previous games, Akalabeth and Ultima, had been released in ziplock bags, but not only did LB demand a box for his sequel, but also a cloth map.  No publisher would agree to this,except for up-and-coming Sierra On-line.  There began a short-lived relationship between two soon-to-be giants of the computer gaming industry.

As part of its SierraVenture line, Sierra would also release a port of Ultima for the Atari 8-bit computers, and would eventually release the obscure Ultima : Escape from Mt. Drash for the Commodore VIC-20.  However, Sierra and LB's main collaboration would be Ultima II, which would be released for the Apple II, Atari 8-bit, Commodore 64, Macintosh and Atari ST computers as well as the IBM PC.  Sierra would commission ports and sold the game at least until 1986.  LB decided to start his own publishing company with Ultima III: Exodus.  It is the PC version of Ultima II which this entry will primarily focus upon.

There are four major physical versions of Ultima II for the PC.  The first is the original release for the IBM PC by Sierra.  Next came the IBM PCjr release, also by Sierra.  Later, Origin Systems reacquired the rights to Ultima II and included it in the Ultima Trilogy.  Finally, Origin released it on CD collections with other Ultima games, culminating in the Ultima Collection.

1.  Ultima II for the IBM PC















This was ported by Jay Sullivan and released in 1983, not too long after the Apple II version in 1982.  It can be found in the large, borderless box, but later came in the black bordered box and later gray bordered boxes as well.  The borderless and black boxes are guaranteed to have the 22"x17" cloth map.  The borderless box cloth map typically has a "Sierra On-line" logo in the bottom right corner, while the black-bordered box cloth map will typically have a "Sierra" logo in the bottom right corner.  The later gray bordered boxes have a smaller, 16"x12" cloth map with no logo on it.  You can see lots of scans of the original IBM PC borderless-boxed version here : http://www.mocagh.org/loadpage.php?getgame=u2

The system requirements were very modest indeed, only 64KB of RAM, a CGA card, one floppy drive and DOS 1.1 were required.  Use of DOS 2.0 required 128KB of RAM.  While an RGB monitor could be used to play the game, it was intended for color composite monitors and TVs.  This is a game where an older CGA card may be more appropriate to use because the Viper in the dungeon demonstration screen is green with old CGA and blue with new CGA.  However, the old CGA card requires quite the brightness and contrast boost on most TVs to make the blue color stand out.

Ultima II came on three 160KB single sided floppy disks.  Disk 1 is the Program Master Disk, Disk 2 is the Player Disk and Disk 3 is the Galactic Disk.  This version's Program Master Disk is copy protected with a protection called "Copylock", which was used on several other Sierra Online releases during the 1983-1984 period.

All disks are readable by real MS-DOS or PC-DOS.  Windows may not be able to read these disks because they use the DOS 1.x format, which is slightly different from the standard 2.0 format.  Sierra did not to use flippy disks because double sided drives were beginning to be introduced.  In fact, you can install DOS 1.1 on the disk to make it bootable.  DOS 2.0 takes up too much room, so it cannot be installed, at least for the releases of the game that came on a 160KB disk.

A later 1985 release had a Program Master Disk that came on a 320KB disk, presumably to accommodate DOS 2.0-3.2.  The type of copy protection has changed to Softguard 2.0.3 with the original loader.  Here is an article mentioning the company behind it, Softguard Systems, Inc. : https://books.google.de/books?id=nC8EAAAAMBAJ&pg=PA28&lpg=PA28#v=onepage&q&f=false
Sierra used the Softguard protection on the DOS releases of its AGI engine games but with its own, easier to crack loader.  The Player Master and Galactic Disks are still singled sided 160KB disks and unchanged from the 1983 disks.

The Player Master disk was meant to be copied through a normal DOS DISKCOPY command.  The original Player Master disk should never be used to play a game because it cannot be reset.  If you see a copy of any version of Ultima II with the write tab perforated on or cut into the Player Master disk, be very wary of buying it if you intend to use the software.

2.  Ultima II for the IBM PCjr.

Apparently, IBM and Sierra's close working relationship encouraged Sierra to enhance several of its PC titles for the PCjr.  Among these were Wizard and the Princess, Crossfire (floppy, not the cartridge) and Ultima II.  For Ultima II, the chief improvement was that the graphics were adjusted to show appropriate composite colors.  Thus for both the PC and PCjr, you can see purple mountains, blue water and green trees, but the brick streets in the town are red for the IBM PC with a CGA card and greenish yellow for the IBM PCjr.'s graphics adapter.  You can find screenshots showing the differences in the attachment to the first post here : http://www.vogons.org/viewtopic.php?f=7&t=41889

Sierra apparently could not get its Formaster Copylock copy protection working on the PCjr. (due to the lack of DMA most likely) so the Program Master Disk is actually not copy protected.  Disk 1 is increased in size to 180KB to accommodate copying DOS 2.1 with the SYS command to make it bootable on the PCjr.

Considering that this version was generally unknown until recently, it almost certainly did not sell many copies.  The only known complete physical copy comes in the black bordered box and the full-size 22"x17" cloth map.



When this is run on a PCjr., the system will need 128KB.  You should boot this disk from the built-in DOS, if any, or make it bootable with PC-DOS 2.1 SYS command.  Otherwise, if your system has a sidecar RAM expansion, do not load a memory manager when playing this game.  The game will run too fast.

The PC version can be run on the PCjr if cracked, but the colors will be less than ideal.  However, if run with 128KB, it will run slower than it should.  If run with 256KB or more and a memory manager installed, it should run at an appropriate speed.

3.  Ultima Trilogy
















By 1989, Origin Systems had reacquired the rights to publish Ultima II, and they were preparing to release the first Ultima trilogy with Ultima I, II and III.  This box came with four disks, with Ultima I (Enhanced Re-release) taking up one disk, Ultima III taking up a second disk, and Ultima II requiring two disks.  All three games are copy protected, with Ultima I and II using Origin Systems, Inc.-1 (OSI-1)  in-house copy protection.

For all PC floppy versions of Ultima II, you cannot run them from a hard drive, despite being DOS disks. This is because the Player Master and Galactic Disks use several of the same file names, but the files themselves are different.  This reflected the way the disks were distributed on the Apple II original, which used 143KB disks.  When the game was ported to the IBM PC, they used single sided disks with 8 sectors for 160KB, allowing the game to be used with single-sided drives and DOS 1.1.

For the Ultima Trilogy, Origin Systems used 360KB disks and put the Program Master and Galactic Disks onto a single disk.  In 1989 everybody was using 360KB disks (requiring DOS 2.0 or better) and double sided drives, so this was unobjectionable.  The were no files with the same names on the separate Program Master and Galactic Disks.  The Player Master Disk was left on a separate disk.  The game will not save when you are not on Earth and never writes to the Program Master* or Galactic Disks.

* - The player may write to the Program Master disk to make it bootable, but for the Ultima Trilogy version, it comes as a bootable DOS 2.1 disk.

4.  Ultima I-VI Series and the Ultima Collection

These represent the last time Ultima II was released on physical media, in this case CD-ROMs.  These versions of Ultima II are not copy protected and are intended to be run from a hard drive.  Moreover, they did not do anything sensible like update the program to support subdirectories.  Had they done so, they could have put the Player Master and Galactic Disk files in separate subdirectories.  Instead they copied the Galactic Disk files then overwrote them with the more important Player Master files.  Thus several planets maps are replaced by Earth maps.  Here is the file overlap between the two disks :

Player Disk
File
Location

Galactic Disk
File
Location

MAPX00 Legends

MAPX03 Shadow Guard

MAPX10 Pangea 9,000,000 B.C. MAPX10 Mercury
MAPX11 Baradins Town

MAPX15 Greenland Dungeon MAPX15 Mercury Dungeon
MAPX20 1423 B.C. MAPX20 Venus
MAPX21 Le Jester

MAPX22 Towne Linda

MAPX23 Castle of Lord British

MAPX24 South America Tower

MAPX25 Greenland Dungeon

MAPX30 1990 A.D. MAPX30 Mars
MAPX31 Port Bonifice

MAPX32 New San Antonio MAPX32 Towne Mary
MAPX33 Castle of Lord British

MAPX34 Egypt Tower

MAPX35 Greenland Dungeon

MAPX40 Aftermath 2112 A.D. MAPX40 Jupiter
MAPX41 Pirates Harbour MAPX41 Jupiter Village


MAPX44 Jupiter Tower
MAPX45 Greenland Dungeon MAPX45 Jupiter Dungeon


MAPX50 Saturn


MAPX60 Uranus


MAPX61 New Jester


MAPX70 Neptune


MAPX71 Computer Camp


MAPX80 Pluto


MAPX81 Tommersville


MAPX82 Towne Makler


MAPX85 Pluto Dungeon


MAPX90 Planet X


MAPX92 Towne Basko


MAPX93 Castle Barataria
MONX00


MONX03


MONX10
MONX10
MONX11


MONX15
MONX15
MONX20
MONX20
MONX21


MONX22


MONX23


MONX24


MONX25


MONX30
MONX30
MONX31


MONX32
MONX32
MONX33


MONX34


MONX35


MONX40
MONX40
MONX41
MONX41


MONX44
MONX45
MONX45


MONX50


MONX60


MONX61


MONX70


MONX71


MONX80


MONX81


MONX82


MONX85


MONX90


MONX92


MONX93
TLKX03


TLKX11


TLKX21


TLKX22


TLKX23


TLKX31


TLKX32
TLKX32
TLKX33


TLKX41
TLKX41


TLKX61


TLKX71


TLKX81


TLKX82


TLKX92


TLKX93
MONSTERS


PLAYER



MAPX## gives the tile definitions for each of the 64x64 tiles on each map and the definitions for each dungeon and tower level and the MONX## are the monster/NPC placement files.  The TLKX## files are for the text for the NPCs in the towns, villages and castles only.  PLAYER gives the stores the statistics for the player character.   MONSTERS holds the graphics for the dungeon monsters.

Fortunately, Moonstone Dragon's Patch fixed this in time for the Ultima Collection.  The PC and Apple II versions of the game use the same Player Master and Galactic Disk files.  None of the official Origin releases contain the patch.  As you can see, there was nothing critical omitted from the game by the effective removal of Mercury, Venus, Mars and Jupiter.

5.  Differences

The Sierra IBM PC and PCjr. versions say "SIERRA ON-LINE PROUDLY PRESENTS" where the Ultima Trilogy says "ORIGIN PROUDLY PRESENTS"  The copyright is "(C)-1983 BY LORD BRITISH AND SIERRA ON-LINE", whereas the Ultima Trilogy and later gives a copyright of "(C)-1983, 1989 BY LORD BRITISH AND ORIGIN".  That is it for text differences.  The IBM PC and PCjr. versions use PWM sound effects during the intro where the Ultima Trilogy and later versions are silent.  There are also PWM sound effects in the game, like the attack sound effect, that were replaced with simpler sweep type effects for the Trilogy and later.  This could have been done because the originals sound rather harsh.  More likely it was done because the PWM effect is mostly lost at the higher CPU speeds available in the late 1980s.  (See Section 7 below)

In the original Apple II version, there is a screen in the demonstration that says "PLEAD WITH MEDIEVAL KINGS FOR ASSISTANCE."  Unfortunately, due to the inefficient way in which the demonstration screens were stored (16KB CGA full-screen bitmap instead of using a 200 byte tilemap) and the use of PC-DOS instead of a custom bootloader, there was no room on the Program Master Disk for this screen.  This can be restored with Voyager Dragon's Ultima II Upgrade Patch. Additionally, the Apple II and Atari 8-bit versions have an animated title screen with the dragon breathing fire to reveal the ][ and the  "REVENGE OF THE ENCHANTRESS" caption.  In the PC versions, this is a static screen and the sound effects are not present.

One improvement of the PC version vs. the Apple II and Atari 8-bit versions is that the Strength bug is apparently absent on all copies.  In the early Apple II and Atari 8-bit versions of the game, the Clerk in New San Antonio will not raise your Strength attribute, but will raise other attributes.  This is the only way to raise your Strength in the game, absent hacking or implementing a bug fix by writing to the affected sector on the disk.

One other point of interest is the Pangea Greenland Dungeon.  According to the README supplied with Moonstone Dragon's Patch, Origin apparently removed the entrance to the Pangea Greenland Dungeon because the map file for the dungeon itself was corrupted when they ported the game to the Ultima I-VI Series CD.  However, the entrance is not on the IBM PC, IBM PCjr. or Ultima Trilogy versions.  It seems that if the error was "fixed", it was fixed by Sierra back in 1983.  Of course, no one apparently realized that the Greenland Dungeon is present in all four Earth timezones and is identical in each.  All they had to do was to make a copy from one of the other files and rename it.  (This is not the only time a port of Ultima II was missing a feature, the Atari 8-bit version is missing Pangea dungeon and the demonstration screens, probably because the disks at 90KB were too small to include the pictures).  The Apple II versions, both the older :ON-LINE SYSTEMS PRESENTS" version and the re-released "Origin Systems Presents" version have a Pangea dungeon entrance and an uncorrupted dungeon.

The Sierra On-line versions of Ultima II had no speed limiting of any kind.  At the time, 1983-1984, there were only two system speeds in wide use, the PC and the PCjr.  These games will not necessarily crash when played at faster speeds, but may be unplayable at AT speeds.  When Origin released the Ultima Trilogy in 1989, it included speed adjustment code in this release for people with AT class systems.  The program will count CPU cycles and try to adjust itself, but eventually will give a Divide By Zero error once the CPU speed increases past a certain threshold.  This was carried over to the Ultima I-VI Series CD. The version in the Ultima Collection replaces the speed test with a hard coded delay value, but the value was way too small for the systems of 1998. However, the Collection included a version of MoSlo for all the Ultima games.

6.  Fixing the Player Disk

Ultima II is very annoying because it can overwrite the files on the Player disk.  If some cheap idiot used his original Player disk to save a game, then the game will not be able to restore it to its pristine state.  Fortunately, they can be fixed.  The only files the game saves to are MAPX10, MAPX20, MAPX30, MAPX40, PLAYER, MONX10, MONX20, MONX30 & MONX40.  Replace those files with untouched versions and you enjoy a new game of Ultima II.  The pristine PLAYER and MONX files only have 00s in them.  Note that MAPX10, which is the Pangea map, will not have the dungeon entrance unless the file has been patched.

7.  Sound Effects of the Sierra Online PC and PCjr. Versions

Since I own an IBM PC and an IBM PCjr. and have access to all PC versions of Ultima II and some of the sounds rely on effects not properly emulated at present and speed-sensitive, I decided to record the playback from the respective speakers of these systems.  In each case I placed my smartphone close to the speaker's location outside of the case.  You will therefore hear keyboard keys, fans and other background noise.  I chose to do it this way in order to give the listener a true impression of how these games will sound to the actual computer user.  Note that the PCjr. was recorded without a memory device driver loaded for the proper speed.









I did not feel anything was to be gained by recording the Origin System's version, DOSBox can do justice to its simple sound effects.

Thursday, October 23, 2014

4.77MHz 8088, You're Needed!

The floor for all PCs, in terms of speed, is the Intel 8088 CPU running at 4.77MHz, the speed it ran in the IBM PC Model 5150 released in 1981.  However, there are various nuances when it comes to PC speed :

The IBM PCjr. also ran at 4.77MHz, but its access to 128KB of RAM was substantially slower than the PC because the video chip also accessed memory to refresh the memory.  It could decrease performance by 15-20%.  However, if software is ran in memory above 128KB, the performance is slightly better than the IBM PC.  Because the PCjr. was not designed to use more than 128KB, at least in the beginning, most early software did not account for the speed increase.  On the other hand, most PCjr.-specific software was contained on cartridges or self-booting disks and did not need RAM about 128KB.

A DOS rip of a PCjr. booter may run too fast.  Lode Runner is a good example of a game with this problem.  Fortunately it does have a speed adjustment that can reduce the speed to sane levels.  This is, however, a rare feature.

Most 8088s in the PCs and compatibles, including all the IBM PCs, XTs most of the PCjr.s, were socketed.  The NEC V20 was a very popular upgrade and was a simple replacement for the 8088.  It could increase performance by 15-20%, depending on the application.  Later, ISA accelerator cards like the Orchid Tiny Turbo and the Intel Inboard 386PC plugged into an ISA slot and the CPU socket and could speed up the system to be the equivalent of a low end AT or 386 machine.  Some brave users would try to overclock their machines by using crystal-switching devices like PC Sprint, which allowed the processor to use a faster clock crystal while the rest of the system used the standard clock crystal, vital for system timing.  

Later PC compatibles bumped the clock speed (Tandy 1000 SX, EX and HX), used a V20 (Tandy 1400) or the 8086 with a true 16-bit data path to RAM (some Compaq machines, Tandy SL, SL/2 and RL, IBM PS/2 Models 25 and 30) to improve speed without seriously sacrificing compatibility with software that relied on the basic speed.  Usually one speed "bump" would not be sufficiently serious to break software, but gameplay, sound effects and graphical effects could be affected when compared to the base machine.

However, when IBM released the IBM PC AT in 1984, it included a 6MHz 80286, which could run applications three times faster than the original PC or XT.  All the software that had been written before the AT's release had only to cope with one speed, so code that was dependent on processor speed could run far faster than intended.  Even when the AT was released, programmers did not necessarily put speed checks in their code overnight, the AT was an enormously expensive machine and games would be the last kind of software expected to run on it.  Thus for a five year period, 1981-1986, game software was generally designed to run on a 4.77MHz 8088.

In addition to the CPU speed, the speed of the video card sometimes needs to be taken into account.  The IBM Color/Graphics Display Adapter was the first graphics card for the IBM PC and compatibles, and it was widely cloned.  (By contrast, the IBM Monochrome Display and Printer Adapter could only show 80-column text and was not suitable for most games).  The PCjr. was only semi-compatible and the Tandy 1000 was (almost) fully compatible with IBM CGA, but it accessed memory far faster than the IBM card.  Some games rely on the performance of the IBM CGA card to produce special graphical effects.

Eventually, most early games will break sooner or later as the processor speed and generations increase, or the CGA hardware found less and less support with more advanced graphic cards.  Some games, however, like Shamus and Alley Cat, were famously far-sighted and could be run on virtually any system that can run DOS, regardless of processor speed.

IBM PC 4.77MHz

Defender
Defender simply runs too fast when the speed becomes any greater than one bump.  Forget about it running at a playable speed on a 286, even one that has been slowed down to 4MHz as with a Tandy 1000 TX or TL.  A 4MHz 286 is about as an 8MHz V20 or 8086.

Ultima I-IV
All of the first four Ultima ports to the PC vary the length of their sound effects, the speed of attacks and the spawning rate based on the system speed.

Dunzhin: Warrior of RAS
Dunzhin features synthesized speech, and the pitch of the speech is speed sensitive.  "Welcome to Dunzhin!"

IBM PCjr. 4.77MHz

Lode Runner & Championship Lode Runner
These games detect the presence of the PCjr. and adjust their speed.  Running games like these as a DOS conversion will result in the action running very fast.  The speed settings contained in the game may not fully compensate.

IBM PCjr. 4.77MHz and Tandy 1000 4.77MHz

Touchdown Football
This game was released by Imagic first for the PCjr. and somewhat later for the Tandy 1000.  At this point, the Tandy 1000 only ran at 4.77MHz and came with 128KB of RAM onboard.  The PCjr. version could run in a 128KB Tandy 1000, but the digitized speech would play back too quickly because the Tandy does not have same the speed penalty for memory accesses in its 128KB of RAM.  If you were able to accelerate your PCjr., the speech would playback too quickly.  The digitized speech in the Tandy version is affected by any speed bump, such as the 7.16MHz Tandy 1000 SX.  Fortunately, Tandy allowed you to change the speed of the CPU to 4.77MHz either at boot-up or in DOS.

Demon Attack
Also developed by Imagic and ported from the PCjr. cartridge version.  Similar to Touchdown Football, this game is extremely speed sensitive and runs properly only on a 4.77MHz 8088 Tandy 1000/A/HD/EX/HX/SX.

IBM PC 4.77MHz and Tandy 1000 4.77MHz

Super Boulder Dash
As discussed here : http://nerdlypleasures.blogspot.com/2016/08/boulder-dash-pc-speed-and-joysticks.html, the joystick will respond correctly only at this speed.  Fortunately it will still work with a V20 CPU.

IBM CGA Graphical Effects

Frogger
Jungle Hunt
Frogger and Jungle Hunt rely not so much on processor speed as they do on CGA speed to achieve the effect of making a change in the background color (Frogger) or palette (Jungle Hunt), in mid-frame.  Thus, the default graphics in Frogger will show blue water on the top and black pavement on the bottom, and show a white score text (using the intense cyan, magenta and white palette) on the top and green, red and brown in the playfield for Jungle Hunt.  Even at 4.77MHz, I discovered that at least Jungle Hunt will have an issue with initiating the palette switch on the right scanline when I was using an ADP-50L hard drive controller.  Using a different hard drive controller fixed the issue.

Digger
Digger uses a color-cycling effect on its High Score screen that looks properly when run on a 4.77MHz machine with a CGA card.

8088mph
This recent (2015) demo will only run correctly with a 4.77MHz 8088 CPU and an IBM CGA card. It relies both on the speed of the CPU and the video memory speed access of the CGA card, as well as the composite colors generated by the IBM CGA card.   It has different settings for Old and New IBM CGA cards.

Saturday, October 11, 2014

Directional Difficulties - The Early Keyboards and Cursor Keys

When IBM introduced the PC, it came with an 83-key keyboard keyboard that a number row and a numeric keypad.  There were no status LEDs on this keyboard, so the only way you could tell whether the Num Lock key had been pressed was by observing the behavior of the numeric keypad.  If a number was typed, then the Num Lock was on.  The general layout was as follows :


All layouts taken from here : http://www.quadibloc.com/comp/kyb03.htm.  There were also separate + and - keys and a PrtSc * key.  Not every game used the numberpad for directional controls.  

For the IBM PCjr., IBM severely cut down the keyboard size, build quality and number of keys.  There was no numeric keypad.  Instead, the keyboard only had six discrete cursor keys.  Here is the new layout :

The cursor keys pull double and even triple duty, as their function changes  if the Shift or Fn key is held down.  There is no Num Lock key on this keyboard.

The Num Lock key can be "pressed" by hitting Alt, Fn and N.  When the Num Lock function is activated in this manner or the Shift key is pressed, then Up becomes 8, Left becomes 4, Right becomes 6, Down becomes 2, Ins becomes 0 and Del becomes .  If the Fn key is held, then you get Home, Pg Up, Pg Dn and End for Up, Left, Right and Down, respectively.   Press Fn and Shift, and you get 7, 9, 3 and 1.  Numberpad key 5 cannot be directly generated by the PCjr. keyboard.

The next major keyboard innovation came from Tandy.  Tandy 2000 and more importantly 1000 keyboards have separate cursor control keys in the now familiar inverted-T layout.  In addition, there is a numeric keypad, but several functions have been changed.  There are individual keys for Home, Insert and Delete. Here is the layout :


There are more differences between an IBM and a Tandy keyboard as well.  However, the differences do not always make a difference to programs.  There are two general methods with PCs to determine which key was pressed.  The first was to call Int 16h.  The result would give you a translated scan code and an ASCII character.  The second was to read the raw scancode directly from the hardware.  Some programmers used the second method with their own keyboard interrupt handlers.  This tends to be the cause of keyboard incompatibilities.

Because some keys, like the numberpad keys, can give results identical to other keys on the keyboard, even the BIOS allows you to distinguish between the 1 key on the number row and the 1 key on the number paid.  You can tell the difference between the Left and Right Shift keys, even though their function is totally identical.

A Tandy has a Num Lock key and even a status LED, but when the Tandy boots up, the Num Lock defaults to off, just like the PCjr.  An IBM PC defaults the Num Lock function to on.  Many games require you to turn the Num Lock on when running on a Tandy 1000.  This is because the characters given by the Tandy keyboard are often not the same as on an IBM PC keyboard.  However, for numbers they will always be the same.  

The Tandy inverted T cursor keys are another issue.  A well-behaved program doesn't care which key is pressed so long as it reads the scancode it expects.  However, not every DOS game is well-behaved.  In DOS, the separate cursor keys function as they would on an IBM Model M keyboard.  However, some games rely on the numeric keypad to give eight movement directions.  Tandy's inverted-T cursor keys give different raw scancodes and may not always be recognized.  

Later Keyboards :

The 83-key keyboard layout was followed for the PC AT keyboard with a few differences to key placement and size.  IBM included status LEDs and an 84th key for Sys Req.  The raw scancodes are completely different from an 83-key keyboard, only the BIOS allows for compatibility with PC and XT software.  However, despite the fewer number of keys compared to more modern keyboards, it is still usable in any system with a PS/2 port.  

Finally, IBM released the Model M 101-key keyboard which essentially defined the minimum number of keys and the basic layout that we use today.  Its provided fully separate cursor keys in addition to the numeric keypad.  Most of the time, the cursor keys can be used as directionals, but because they have different raw scancodes than the numeric keypad cursor keys, some games will not recognize them.  The Model M supports three sets of raw scancodes, Set 1 is the PC/XT scancodes and it sends those scancodes when it is plugged into a PC or XT or Tandy 1000 TL/SL/RL or the 8086 based IBM PS/2s (but compatibility with anything other than the PC/XT's 2nd or 3rd BIOS is dicey).  Set 2 is when it is plugged into an IBM PC AT, PC/XT Model 286 and just about every other computer, including modern machines. Set 3 was intended as the native PS/2 scancode set and is similar to Set 2 but was rarely used. 

Sunday, September 7, 2014

Non-PC Speaker Digitized Sound Part II : Sample Time

In a prior post, I discussed the ability of sound devices other than the PC Speaker to produce digitized sound.  In this entry, I will share some recordings I have made of these digitized samples.  Most of the samples will be voice, but there are some sound effects and even music.

First off, here is Touchdown Football for the IBM PCjr., with an 8088 CPU @ 4.77MHz and using the TI SN76496 :



Next, here is the same game in its Tandy version, running on a Tandy 1000 RL, which uses an 8086 running at 9.44MHz, using a PSSJ-based TI SN 76496 core :



This code is very speed-sensitive.  Even on an RL in the slow 4.77MHz mode, it still runs too fast.  I believe that the code was only meant for an 8088 running at 4.77MHz, not a V20, and not an 8086 (which is what the RL has).

Here is the same sample, but being run by a Tandy 1000 SX, which uses an 8088 CPU running at 7.16MHz and an NCR 8496 (clone of the TI SIN 76496) :



This time, the sample sounds much more appropriate than the chipmunk like rendering by the faster machine.  However, this game was released when the only Tandy 1000 on the market was the 4.77MHz only 8088 CPU of the original Tandy 1000.  A Tandy 1000 TX running at 4MHz sounds very similar.  Because the SX can also run at 4.77MHz, I have been able to record the sample at that speed, and here it is :



If you compare this sample to the PCjr. sample, it becomes clear that the same voice is being used for both software versions.  Therefore, in order to run this game at its intended speed, an 8088 running at 4.77MHz is necessary.

While Touchdown Football turned out not to be a PCjr. exclusive, the next sample clip is from The World's Greatest Baseball Game.  This game, as far as I know, only officially supported PCjr. for enhanced graphics and sound.  I have included the music and speech that play before you start a game :



The announcer does sound a bit more synthetic than the announcer for Touchdown Football, but the speech is easy enough to comprehend.

The next sample clip is a fairly long one, and it is my recording of the movement sounds and battle sounds from the original, 16-color version of Battle Chess.  In this case, Battle Chess is running on a Tandy 1000 TX, 8MHz 80286, using an NCR 8496 clone of the TI SN 76496 :



Roughly, the clips are in the following order:

Pawn Moves
Knight Moves
Bishop Moves
Knight Takes Bishop
Bishop Takes Pawn
King Takes Bishop
Knight Takes Knight
Queen Takes Pawn
Rook Moves (King and Queen move silently)
Queen Takes Knight
Queen Takes Pawn
Knight Takes Queen
Queen Takes Knight
Rook Takes Queen
Bishop Takes Knight

Battle Chess in its 16-color version only supports PC speaker and Tandy 3-voice sound.  The PC speaker version lacks movement sounds, and the sound quality is pretty awful compared to the Tandy sound.  It was too awful to record, play the game in DOSBox if you want to hear it.  Fortunately, the 256-color version supports a Sound Blaster and plays identically to the 16-color version.  Interplay could have done better, as we will see soon enough.

Before I continue, I would note that I am recording all the Tandy 3-voice and PC Speaker samples through the RCA audio out jack of the Tandy 1000 TX.  This jack provides line level output.  I decided to avoid using my Tandy 1000 TL because a game may inadvertently utilize the Tandy DAC, and that is not the point of these samples.  For the Adlib and Game Blaster and Sound Blaster samples, I recorded them off a Sound Blaster 1.5 with C/MS upgrade.  That card only has an amplified out, so those samples are comparatively louder in these recordings than the Tandy and PC Speaker samples.  I decided not to tamper with them.

The next three games support PC Speaker or Adlib for digitized sound.  Wizardry, Bane of the Cosmic Forge and Super Jeopardy also supports the Covox Sound Master, Voice Master and the Innovation SSI-2001, but I do not have access to any of the Covox boards.  [I will try to put up a recording from the SSi-2001 clone I purchased].  Bill and Ted's Excellent Adventure sounds very impressive with the Adlib.  Additionally, both Wizardry and its sequel, Wizardry Crusaders of the Dark Savant uses the Adlib for digitized sound, even though they are quite aware of a Sound Blaster.  The digitized sound in the Wizardry Bane intro is not very long, so I did not bother to record a PC Speaker reference sample.











Finally, I will demonstrate Activisions "Omnimusic" driver from BattleTech : The Crescent Hawks' Revenge. This driver provides digitized sound through the PC Speaker, the Tandy 3-voice sound chip, the Adlib and Game Blaster chips, the Sound Blaster DSP, the IBM PS/1 Audio/Game Card, the Covox Sound Master and the Innovation SSI-2001.  It is a jack of all trades as far as sound devices of the late 80s and early 90s go.  However, not all things are equal, as you can judge for yourself.











As you can hear, the PC Speaker only does the digitized sound effects, and not very well at that.  The Game Blaster has a high pitched whine in its playback not heard with Tandy or Adlib, but the samples sound pretty decent  The Sound Blaster provides reference quality samples.

There are other PC games that support digitized sound through an Adlib card or clone.  These include Dungeon Master, Another World/Out of this World and Electro Man / ElectroBODY.  All these games support Sound Blaster and that is what anyone with a Sound Blaster should use.

If you want some more samples of what the Tandy chip can do when pushed to incorporate digital samples, then listen to some of these recordings from my friend Cloudschatze's channel :

688 Attack Sub : https://www.youtube.com/watch?v=M2A8GbsKcYQ
One on One : https://www.youtube.com/watch?v=M2A8GbsKcYQ
Kings of the Beach : https://www.youtube.com/watch?v=t2N7VLF0ZQo
Skate or Die : https://www.youtube.com/watch?v=I8_z_CI37JE

Friday, September 5, 2014

Flavors of PC Compatible BASIC and Why You Should Care

Cassette BASIC :

In 1981, when IBM released the IBM PC Model 5150, it included BASIC in ROM.  In the 5150, it was contained on four 8KB chips, in later machines, it was included within the 32KB chips that included the BIOS.  In every IBM PC model it occupies the space from F600:0000 to FDFF:0000.

Cassette BASIC, as its name implies, has commands for saving and loading only to a compact cassette.  In order to save to or load a program from a cassette, the user needed to connect a cassette drive to his IBM PC with a special cable.  On the back of the IBM PC Model 5150, there was a 5-pin DIN next to the keyboard DIN that this cable would plug into.  At the other end of the cable there would be a 3.2mm audio jack for the auxillary or microphone input (to save/record data from a PC), a 3.2mm audio jack for the earphone output (to load/playback data to the PC), and a 2.5mm jack to control the tape recorder remotely. The PC had a relay circuit on the motherboard that would start and stop the motor so that the user would not have to.

IBM did not offer a cable for the 5150, but Tandy/Radio Shack TRS-80 and Color Computer tape recorders came with the correct cable.  Most older tape recorders, including those Radio Shack sold for their non-PC compatibles, had four audio jacks, the EAR, REM, MIC and AUX.  Current recorders ditch the AUX input and only have a MIC input.  REM is the smaller jack that controls the cassette deck.  There was a jumper on the system board to set the appropriate signal strength for a MIC input or an AUX input.

Cassette BASIC comes in three versions, C1.0, C1.1 and C1.2.  C1.0 will only be found in the very first IBM PCs, typically those with a 16-64KB system board and a BIOS version dated 04/24/81 or 10/19/81. C1.1 generally should come with all IBM PC Model 5150s with a 64-256KB system board or those systems with a BIOS version dated 10/27/82 (the last).  However, the BIOS in the IBM PC is contained in one chip, U33, and can be updated in an 16-64KB system board without updating BASIC.

All later IBM PCs, the XT, Portable, AT, XT/286 and Convertible, contain Cassette BASIC C1.1.  The PCjr. (and probably the PC JX) uses Cassette BASIC C1.2 for reasons described below.  All PS/2s released during the 1980s and early 90s, and the early IBM PS/1s, also contain Cassette BASIC C1.1 for compatibility reasons.  No other PC Compatible system, unless an exact clone of one of these systems, included Cassette BASIC.

Unlike the disk-based versions of BASIC, Cassette BASIC does not require PC or MS-DOS to run.  However, because the IBM PC and IBM PCjr. are the only PC-compatible systems known to come with circuitry to drive a cassette recorder, Cassette BASIC can only save or load programs on these two systems. 

Disk BASIC, Advanced BASIC and GW-BASIC :

Disk BASIC and Advanced BASIC were included with PC-DOS v1.0 and every version thereafter, 1.1, 2.0, 2.1, 3.0, 3.1, 3.2, 3.3, 4.0 and 4.01.  They were replaced by QBASIC in PC-DOS 5.0.  The version number for Disk BASIC and Advanced BASIC correspond directly to the version of DOS they came with.  This you will see D1.1 for the version of Disk BASIC accompanying PC-DOS 1.1 and A3.3 for the version of Advanced BASIC that came with PC-DOS 3.3.  Disk BASIC is invoked by executing BASIC.COM in DOS, and Advanced BASIC by BASICA.COM in DOS.

The Disk BASIC-Advanced BASIC split was due to the low amounts of memory that came with early IBM PCs.  You could buy an IBM PC with only 16KB of RAM, but with that amount of RAM, you could only run Cassette BASIC.  Disk BASIC required 32KB of RAM, and Advanced BASIC 48KB of RAM.  Disk BASIC could do everything that Cassette BASIC could do and added support for saving and loading programs to floppy disks and serial port access, keeping track of the date and time and supporting two additional printers.  Advanced BASIC does all Disk BASIC does and more, such as support for more graphics and sound statements and event trapping.

PC BASIC does not support multiple memory segments, it runs everything within one 64KB segment.  Thus, after PCs began shipping with 128KB of RAM or more, there was no further need to use Disk BASIC.  In fact, as of DOS 3.3, BASIC.COM was just a small (1-2K) stub that called BASICA.COM and was only present for compatibility.  DOS 1.0-3.2 had a functional BASIC.COM.  PC BASIC would keep up with DOS features, like the added support for subdirectories in DOS 2.0 and the IOCTL calls in DOS 3.0.

With non-IBM machines, vendors and OEMs released system-specific versions of MS-DOS.  With these operating systems, GW-BASIC was included.  GW-BASIC did not require Cassette BASIC.  In these systems, sometimes there is a large BASIC.EXE and a small BASICA.COM.  BASICA.COM is the stub that executes BASIC.EXE.  Sometimes there is also a BASIC.COM stub.  In certain systems, the file was BASICA.EXE or GWBASIC.EXE.

Tandy's GW-BASIC for the Tandy 1000 series included the commands found in Cartridge BASIC to control its PCjr-derived advanced graphics and sound capabilities.  The AT&T 6300's GW-BASIC included commands for the advanced graphics capabilities of that system, and the Hercules Graphics Card came with a utilities disk with HBASIC, which allowed the use of the 720x348 graphics mode these cards support.  A generic GW-BASIC would not support these special features.  Microsoft began releasing generic, non-OEM specific versions of MS-DOS starting with MS-DOS 3.2.  A generic version of GW-BASIC can be found on them.

IBM also released Compiler BASIC which allowed users to compile their program into object code so it does not require a BASIC interpreter to run the program.  Most companies that released games found it simpler to run their code through an interpreter, because every computer with a disk drive and DOS should have had one during the 1980s.

Cartridge BASIC :

The PCjr. included Cassette BASIC C1.2 in its system ROM.  Due to the differences between the PC and PCjr., the BASIC code cannot be identical.  However, to maintain compatibility with applications written for Cassette BASIC, all the functionality of PC Cassette BASIC is included in PCjr. Cassette BASIC, and nothing more.  IBM released an official cassette cable that plugged into a unique male BERG-style port on the PCjr., but it requires a cassette recorder with an AUX input.

IBM released Cartridge BASIC with the PCjr., and the user had to buy it separately.  It is a 32KB cartridge that plugs into either cartridge slot of the PCjr.  Cartridge BASIC included commands to take advantage of the PCjr. video adapter and sound chip.  Cartridge BASIC has only one version, J1.0.  Disk BASIC and Advanced BASIC, when run on the PCjr., will show the version as J1.0, regardless of DOS version.  Disk BASIC and Advanced BASIC will not run unless Cartridge BASIC is present.

Using Cartridge BASIC in a PCjr. with more than 128KB of RAM imposes special problems.  Cartridge BASIC was not designed for more than 128KB, and programs run it may not run correctly or at all. However, the PCjr. will not recognize extra RAM unless a device driver is loaded in DOS.  If DOS is loaded, either from a disk or a hard drive without a device driver loaded, then Cartridge BASIC should run normally.  You will be limited to the first 128KB of RAM and the poor performance resulting by running BASIC code within it.  The popular device driver JRCONFIG 3.1 included an unsupported /q command line switch where it will lie about the amount of memory available to BASIC, but it will warn you that anything contained in a RAM Disk or Print Spooler created by JRCONFIG will be in danger.

QBASIC :

In PC-DOS 5.0 and MS-DOS 5.0, Disk BASIC and Advanced BASIC were no longer included with the operating system.  Instead, QBASIC version 1.0 was included.  QBASIC was a cut down version of Microsoft QuickBASIC.  QBASIC does not require line numbers and supports a mouse cursor, split windows, drop down menus and multiple colors in its text-based user interface.  The MS-DOS EDIT.EXE program requires QBASIC.EXE, QBASIC.HLP and EDIT.HLP to work.  QBASIC tends to be a poor performer on 8088-based XT-class and low speed 286-based AT-class machines.

I read that the original version of QBASIC in PC-DOS 5.0 still required Cassette BASIC in ROM, but it only used checked to see that it was there before loading QBASIC.  This requirement was removed in the QBASIC that came with PC-DOS 5.02.  QBASIC version 1.1 was included in MS-DOS 6.0 through Windows ME and NT 4.0.

BASIC Games :

The first game ever written for the IBM PC was Donkey.  This simple game was included as the file DONKEY.BAS with several other demonstration programs included on the DOS disks.  In fact, half the files included in PC-DOS 1.0 and 1.1 were BASIC demonstration programs.  It is included with PC-DOS 1.0-3.2.  With DOS 3.3, virtually all the demo programs were eliminated.  

QBASIC in MS-DOS 5.0 and PC-DOS 5.0 came with two games, Gorillas and Nibbles.  Their files are called GORILLA.BAS and NIBBLES.BAS.  Nibbles is a text mode game that uses an 80x25 column mode, but appears as a 80x50 column mode by the use of a half-bar ASCII character (where the top half uses the foreground color and the bottom half uses the background color).  It works with any video adapter. Gorillas uses either the 320x200x4 CGA Mode 04 or the 640x350x16 EGA Mode 0F.  They are intended to be run on a low-end 386 or a high end 286.  Both games would be gone by MS-DOS 6.22 and PC-DOS 6.1

Games Requiring BASIC :

Several games, usually early games, used Cassette/Disk/Advanced BASIC.  Some were copy-protected DOS disks that directly accessed Cassette BASIC.  They must be run on an IBM system.  Nine games commercially released by IBM early in the life of its PC line require Cassette BASIC or Cartridge BASIC.  They are

Adventures in Math
Arithmetic Games Set 1*
Arithmetic Games Set 2*
Bumble Games*
Bumble Plot*
Casino Games
Juggles Butterfly*
Monster Math
Strategy Games

* - Copy Protected (The Learning Company games) or probably Copy Protected (Science Research Associates, Inc.)  IBM never seemed to copy protect the games it developed internally, but did with any game it released that was licensed from or developed by another company.  Any game that is not copy protected, or has been cracked to run on a generic disk should be able to be run with GW-BASIC.  Mobygames lists 75 games that require BASIC, and some are sophisticated commercial releases like Battle of the Bulge, some are old classics like Temple of Apshai and others are small single file games that just need a BASIC interpreter. There are many, many freeware games that run on QBASIC, and while Mobygames may not document every Cassette/Disk/Advanced BASIC game ever made, it does not really list any games that use QBASIC other than Gorillas an Nibbles.  A good place to start to find QBASIC games is here :

http://www.qbasic.com/games/
http://www.petesqbsite.com/index.php


Monday, August 4, 2014

HomeWord - Sierra Online's Easy to Use Word Processor

Ken Williams, who founded what would become Sierra Online in 1979, was a programmer. He had worked service bureaus selling computing services to businesses.  He programmed on mainframe computers, and bought an Apple II with a disk drive to develop a FORTRAN compiler.  His wife Roberta loved playing computer text adventure games, and persuaded him to program her idea for a game on his Apple II.  The result was Mystery House and the rest was history.  Within a year of Mystery House's 1980 debut, Sierra had published a Word Processing program called ScreenWriter, but felt there was a market for a more family-friendly program.

The end result of Sierra's efforts was HomeWord, released for the Apple II and ported to the IBM PC and PCjr.  Sierra's program was not going to compete with WordStar, WordPerfect or even Microsoft Word.  In fact, it was marketed toward people who would have been too imtimidated by WordStar's command shortcuts or WordPerfect's brick-thick manuals.  Many, many home-market friendly computer companies released word processors.  Broderbund's Bank Street Writer was one of the products against which HomeWord would compete.  Sierra would later release HomeWord II, which would have full hard drive support.  HomeWord came with a tutorial cassette to walk the novice user through his first word processing session.

In this blog entry I am going to take a look at HomeWord for the IBM PCjr., released at the end of 1983.  It was sold through IBM for $75.00. This version only ran on a PCjr., it will fail to load if it detects the presence of DMA, which would indicate a PC.  It came with an overlay for the PCjr. chicklet keyboard that looked like this :


The disk was formatted for DOS 2.1, but was copy-protected.  It required the user to save his files to a formatted floppy disk.  It could exit to DOS and contained programs like FORMAT and DISKCOPY to allow the user to do that without needing his DOS disk.  The program did not support hard drives.  Hard drives were extremely expensive in 1983 and were not intended for the consumer PCjr.

When you boot the HomeWord disk, you will see the following :

Doesn't this look familiar...
 then this :

I sincerely doubt they sold nine hundred million copies
After the title screen, the disk's AUTOEXEC.BAT file will automatically execute the DOS DATE and TIME commands, in order to remind you to set them.  The PCjr. had no real-time clock, but even so, many people were probably too lazy to set the date and time.  After the date and time prompts, the program would show you this screen :


The menu is using a tweaked 4-color graphics mode 04h, which requires less RAM than a 16-color mode but more flexibility than the PCjr. text modes.

HomeWord is pretty functional for a basic word processor, and the commands are easy to use.  The program is will describe what you need to do, and you can see the results fairly quickly to make sure you have it right.  The program will allow you access to most, if not all, of them via the menu.  However, learning the shortcuts makes things easier (refer to the overlay in the image above).  Instead of going through all its capabilities, let me allow the program to show some of them to you :

Beginning of the Document
Menu Selections
Scrolling Down is done by the Cursor Control (Arrow) keys
The program also supported 80-column "text", in reality graphics mode 06H :

80-column mode, note the use of inverse text to identify functions
The PCjr.'s graphics capabilities were not quite ready for WYSIWYG, but Sierra did try to give the user a good idea of what the document would look like before they used the print command.  On the bottom right of the screen, there is a miniature version of the page, showing the text alignment as it was being typed.  There is also a "show document" command that will display the whole document as it will appear on the printed page.  The scrolling happens automatically, and you need to press the spacebar to pause it.  Unfortunately, there is no obvious option to have it pause screen by screen.

The program supports custom margins, combining documents, headers and footers and page numbers.  It does not support automatic footnotes, but that was a function of high-end Word Processors.  The resulting files are very small and almost plain-text, so only the formatting would be lost.  If you want to show off your mastery of printer escape codes, there is a function which would allow you to insert them into the document.  You can also see the raw ASCII for the document.

Most keyboard functions are handled by the Control key, but the Alt key is sometimes required and the Fn key will also be frequently used.  Since I don't have the manual, I am not aware of the function that will bring the cursor to the beginning or end of the line.  Once you turn a function on, like Bold or Underline, the function will apply to all text until you use the Normal function to turn those attributes off.  No support for italics, but that was not a common feature of the printers of the day.

Here is the end result as printed on my IBM Compact Printer.  Although this program has explicit support for a serial printer, it refused to print anything more than two lines with that selection.  It would stop printing, saying my printer wasn't ready.  The hell it was!  I believe it was confused because I had an Internal Modem and the Parallel Printer Attachment installed.  Instead, I tricked it into thinking it was printing to a parallel printer via the DOS mode command.  Using the MODE command found in DOS 2.1, I used the following commands to fool the program (you have to exit the program first, type the commands in DOS, then restart it):

mode lpt1:=com2:
mode com2: 1200,n,8,2,p

With that, the printer printed as well as the Compact Printer can, and here is a scan of the results :

To Boldly Go, or maybe Not
This program was designed to run on a 128KB PCjr., and suffers from the performance limitations of that machine.  Even so, the program is not as slow as you might expect.  I do not know if the speed can be improved by loading it after using a device driver to allow it access to the fast memory contained on a PCjr. attachment, but I suspect it would.