Sunday, August 21, 2016

Boulder Dash - PC Speed and Joysticks

Boulder Dash was originally released for the IBM PC and PCjr. in 1984 by First Star Software.  The disk included two separate executables, one for the IBM PC and one for the IBM PCjr.  The disk was a PC booter.

The IBM PC executable is serviceable but not particularly impressive.  There is a distinct lack of animation on the title screen and for the amoeba tiles.  There is also no color-cycling effect for the diamonds.   It is debatable whether the game really uses composite color graphics.  Sound effects are weak even by PC speaker standards.

The IBM PCjr executable, on the other hand, is much, much more impressive.  It uses the 3-voice PCjr. chip for music and sound effects.  It supports 16-color graphics with full animation and color cycling.  Despite the PCjr. being slower than the PC, it does not suffer from a lot of slowdown, despite the extra effort.  Compare these pairs of screenshots from the PC and PCjr. executables :

In 1986, Electronic Arts released Super Boulder Dash, a compilation of Boulder Dash 1 & 2.  This version included Tandy 1000 support to give owners of those computers the PCjr. graphics and sound.

Eventually, the standalone release of Boulder Dash was cracked and copies of the PC executable were disseminated.  Super Boulder Dash was also cracked and a copy of the cracked disk was on the Retrograde Station site for a long time.  Unfortunately, all these cracks only supported the bland PC executable, not the superior PCjr /Tandy 1000 executables.

Somewhat recently (2013), a patch to fix the Super Boulder Dash image was made.  Now everyone can play a superior port of the Atari 8-bit game on DOSBox.  But for those of us on real hardware, this port has one particular Achilles Heel, the joystick support.

The original code was written to read the analog PC joysticks in an IBM PC or PCjr.  At that time, faster PCs really were just emerging in the marketplace.  This code relied on tight timing loops to read the X and Y positions of the joysticks which do not scale well with CPU speed unless the programmer had programmed scaling factors into his code.  Boulder Dash's PC programmer (probably Peter Liepa) evidently did not.

IBM PCjr. - Joystick responds correctly
IBM PCjr. w/NEC V20 - Joystick responds correctly
IBM PC/XT - Joystick responds correctly
IBM PC/XT w/NEC V20 - Joystick responds correctly
Tandy 1000 SX (7.16MHz 8088) - Joystick does not respond correctly
Tandy 1000 SX in Slow Mode (4.77MHz 8088) - Joystick responds correctly
Tandy 1000 SX with 286 Express Accelerator, cache enabled (7.16MHz 80286 w/8KB Cache) - Joystick does not respond at all
Tandy 1000 SX with 286 Express Accelerator, cache disabled - Joystick responds correctly
Tandy 1000 TX or TL (8MHz 80286) - Joystick does not respond at all
Tandy 1000 TX or TL in Slow Mode (4MHz 80286) - Joystick does not respond correctly

When the joystick does not respond correctly, Rockford will move uncontrollably in one direction or the other or he will move smoothly in one direction and jerkily in the other direction.  He will not move smoothly in all four directions regardless of the settings on the joystick trimmers.  The best you can do is, by fiddling with the trimmers, will be to get smooth movement up and left at any extension of the stick and smooth movement to the right and down with a partial extension of the stick.  This is not ideal.

According to DOSBox, the PC and PCjr./Tandy executables have a rather narrow range of machine cycles when it comes to giving proper joystick response, about 300-450 cycles in the normal core work with the cga or tandy machine types.  The pcjr. machine type requires a much lower cycle count, about 175 cycles, and can tolerate a much lower deviation (say 165-185 cycles).  Surprisingly, the PCjr. does not have a problem with a V20 installed, which is supposed to speed up the system by 10-15%.

Why is this so important?  Because Boulder Dash was meant to be played with an Atari-style digital joystick.  Actually it really plays best with a Sega Genesis gamepad, but U.S. and European computer gamers did not have anything quite like that back in 1984.  Playing Boulder Dash with a keyboard is an extra challenge because you often have to be extremely quick to dodge falling boulders and roaming fireflies and butterflies.  The earlier Atari 8-bit and Commodore 64 ports (the PC/PCjr. port came third) support digital joysticks.

For the IBM PC, you can use a Gravis Gamepad as a digital gamepad.  For the IBM PCjr., you can use a Gravis Gamepad, but you will need to make your own adapter or (more likely) appropriate a cable from a IBM PCjr. joystick.  For the early Tandy 1000s, the EX, SX and HX, you can make the digital joystick adapter I described in a previous blog post :  For the Tandy SL, SL/2 and RL, these systems use a 8086 CPU that can be slowed down to 4MHz or 4.77MHz,  This should be sufficiently slow to use the built-in Tandy joystick ports.

For the Tandy 1000 TL, TL/2 and possibly TL/3, they cannot be slowed down sufficiently to make the built-in joystick port work properly.  But you can disable the built-in joystick port using, put the machine into Slow mode using the setup program, then press Ctrl-Alt-Del (and not the red reset button) and use your own joystick card.  Interestingly, the IBM PC joystick cards will work at this speed correctly, even without a hardware speed adjust, when the Tandy 1000 joystick interface will not.

For the Tandy 1000 TX, which runs at the same speed as the TL and TL/2, you are probably screwed, because you can't disable its built-in joystick port.  If you use 100KOhm variable resistors instead of standard resistors in the digital adapter, you may be able to find a proper balance that will give you smooth movement in all four directions when these systems are set to slow CPU operation.  Otherwise, you can disable the built in joystick port by lifting pins 1 & 19 of U10, a 74LS244, and wiring them to +5v.

Boulder Dash II PC Version Differences

Everything said above applies equally to Boulder Dash and Boulder Dash II.  DOSBox indicates that Boulder Dash II may be slightly more forgiving of system speed when it comes to joysticks because it will give a proper response up to 550 cycles, but on real hardware this does not help.

I would note that Boulder Dash II's PC executable in Super Boulder Dash tried to be a little more interesting than its predecessor's.  It will use both standard 4-color CGA palettes.  Caves E and M will give light green, light red and yellow instead of light cyan, light magenta, and bright white.

In the United Kingdom, Boulder Dash and Boulder Dash II were released by Prism Leisure Corp. separately.  Their Boulder Dash II disk is a protected DOS disk and has two distinct executables, BD2PC.EXE and BD2JR.EXE.   BD2JR.EXE does not support Tandy.  Given that the PCjr. was never released in the U.K., one wonders why the executable is there at all.  If your Tandy 1000 has no more than 128KB, then it may work but do not count on getting a proper joystick response.

BD2PC.EXE uses the unofficial light cyan, light red and bright white palette throughout.  While perhaps more visually pleasing than the standard palette, the lack of any palette changes is felt.

I have never encountered an executable of Boulder Dash that uses anything other than the light cyan, light magenta, and bright white palette.  I have more screenshot comparisons of the PC vs. the PCjr. executables, but hover over the images in the left column to see what they look like with the Prism Leisure Corp. PC executable :



Dr. Zeissler said...

OK, If I own a T1000RL where can I get both Versions with PCjr support?

Foone Turing said...

There's a sentence fragment in the 10th paragraph, it ends with "Given that the"

Great Hierophant said...

I have no idea what I was trying to say, so it is now gone.

Ray said...

Hello Great Hierophant,

I could use your help with a PCjr problem again. I am playing "Adventure in Serenia" on my 256k PCjr. I am using a Basic Cartridge so that the game will run on my PCjr. After I type the command to take the rock from the snake's tail, the snake reveals himself as king of the snakes and says "to repay you I will..." nothing. That's it. The game just hangs there forever and won't display the rest of the message. It keeps me from moving on with the game. Any ideas how to solve this?

Ray said...

One thing I did not mention. Sometimes right after the game title screen I see this message "/O error please re-insert disk and press enter." Sometimes I will press enter and the game run still run, but that doesn't mean the whole game will run flawlessly.

Ray said...

Sorry about my grammatical error. My "Adventure in Serenia" game will still run sometimes when I press enter after seeing that /O error. Problem is, not everything in the adventure seems to run without a hitch.

Great Hierophant said...

It may be possible that your disk is bad, especially if it is an original disk. I cannot say I have played the available disk image past that point.

You could try removing the BASIC cartridge. Cartridge BASIC and 256KB or more of RAM do not play well with each other. You do not need the cartridge to run the game. You could also remove the RAM expansion, Adventure in Serenia cannot use it.

Adventure in Serenia is the IBM PC version of the game. IBM's documentation states that the game is compatible with the PCjr, although there will be some color variations on a color composite monitor. You could try Wizard and the Princess, the PCjr. specific version of the game. It should be available in the latest Total DOS Collection.

Ray said...


I actually solved the problem. Just so you know, the PCjr "does" in fact need a basic cartridge for the Serenia game, if you are using a TV instead of a monitor. If you are using a TV, the game title screen barley shows up, and it's not very readable. When you press a key to start the game, you get a black screen and can't see the adventure at all. This is what happens with a TV display and no basic cartridge. If you use a basic cartridge, everything shows up bright and clear on your TV. As for my problem I learned this from the game instruction manual: It says if the game can't display a whole message, press the "Scroll Lock" key and the rest of the message shows up, and you are free to type the next command. A PCjr keyboard has a slightly different set up. The Scroll Lock key is actually the "S" key, AND you have to press "FN" right before pressing S. You are probably right about not needing a basic cartridge if you are using a computer monitor. But if you are using a TV, you can't see what you are doing without a basic cartridge. Thank you for your response. I appreciate it!

Great Hierophant said...

IBM lied :) Good to know about Adventure in Serenia, I forgot about its odd way of scrolling text. Wizard and the Princess uses the same method, despite the inconvenience.

Ray said...

Hello again,

I have another IBM PC mystery on my hands. I received a game called "The Hobbit" by Addison Wesley. The requirements say 128k and DOS 2.0 or higher. I have DOS 2.10 and two PCjr's. One is a 128k and the other is 256k. I followed the loading instructions to type "hobbit" at the "A>" prompt and got this message on both computers: "program too big to fit in memory." Why the heck would it say that?!

Great Hierophant said...

Did you load a PCjr. expansion memory manager like JRCONFIG in CONFIG.SYS when you booted DOS on your 256KB PCjr.? Most DOS programs will not detect RAM above 128KB unless a memory manager is installed The box for The Hobbit indicates that 128KB is required for PC/PCjr., but it is possible that they overlooked the PCjr's RAM stealing or that IBM PC-DOS 2.1 requires more RAM than IBM PC-DOS 2.0.

Ray said...

What is an "expansion memory manager?" What I typically do is load the dos 2.1 disk, type in a made up date and time, and then at the A> prompt switch the dos disk with the game disk. I then type one of two commands. I have come across a few games that require you to type "AUTOEXEC" and press enter to run the game. Otherwise you type the first word of the game like "hobbit". Some Sierra games, like King's Quest, require you to type "sierra." If what I am missing is something called JRCONFIG, how do I include it so that it doesn't get overlooked. Just so you know, I have a PCjr with a little toggle switch in the back that allows you to go back and forth between PC and PCjr, which happens to be my 128k PCjr with two disk drives. My 256k PCjr does not have that toggle switch and uses one disk drive. I tried to run the game on both computers and on both PCjr and regular PC.

Great Hierophant said...

You can find the answers and links to the files you need here :

If your boot disk is an original IBM disk, make a copy of it with the DISKCOPY program. Then on your copied disk, create an AUTOEXEC.BAT file and a CONFIG.SYS file and copy over the JRCONFIG driver you wish to use. If you put anything in the AUTOEXEC.BAT file like "PROMPT$p$g" you won't be prompted for the date and time every time you boot the machine. You load device drivers by entering the appropriate line in the CONFIG.SYS file.