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 : http://nerdlypleasures.blogspot.com/2016/08/the-pc-joystick-to-tandy-1000-joystick.html  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 nojoy.com, 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 :

 









3 comments:

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.