Running Electronic Arts' "Starflight" on the IBM PCjr

  

Running Electronic Arts' "Starflight" on the IBM PCjr (revised)

---------------------------------------------------------------


Lee Johnson [71310,405]

October 8, 1986.


Introduction

------------


Although the label on the Starflight package reads "IBM AT, XT, PC, TANDY

1000, 1200, 3000 and all 100% IBM compatibles", Starflight does not run

correctly on the IBM PCjr.  Fear not, for you CAN run Starflight on your

PCjr, if you have enough memory.  And you can do it in vibrant colour, on

an RGB display!


Memory requirements

-------------------


Starflight requires a minimum of 256K on a "regular" PC.  Because of the

added RAM overhead for PCjr video buffers, etc., you will probably need a

minimum of 320K to run Starflight on a PCjr.  Be sure to configure your DOS

boot disk to use the extra memory.  For IBM PCjr memory expansion sidecars,

this means including the line


        DEVICE=PCJRMEM.COM


as the first line of the CONFIG.SYS file on your DOS boot disk.  If you

have a large amount of memory (e.g., 640K), you may want to force

everything to run in expansion memory, for added speed.  For IBM PCjr

memory expansion, this would be done by including


        DEVICE=PCJRMEM.COM /E


as the first line of the CONFIG.SYS file.



Video problems

--------------


Starflight does not set up the video chips properly for the PCjr.  The

problem manifests itself as a wild scattering of lines and pixels on the

display, giving the appearance of a TV set with horizontal hold problems.

To fix this problem, we must make a small modification to the Starflight

program.  To perform the modification, you will need:


        Your original (legitimate) Starflight diskettes

        2 blank diskettes (3 if you want to back up the patch)

        The DEBUG program (which comes with DOS).


1.  Using DISKCOPY, copy the original Starflight disks that came with your

package onto the two blank ones.  Put your originals away.


2.  Insert the disk containing DEBUG, type "debug", and press the Enter

key.  DEBUG should respond with a hyphen, '-'.


3.  Insert the copy of the Starflight A disk.  Enter the following two

lines, pressing Enter after each:


        n starflt.com

        l


After a few moments of disk access, a hyphen prompt should appear.


4.  We now must verify that we are patching the correct part of the

program.  For now we must assume that all Starflight disks shipped by EA

for IBM systems have been the same.  Type:


        d 8dcc l e


DEBUG should display:


xxxx:8DCC  BA D4 03 BE                                       :T.>

xxxx:8DD0  16 8D E8 26 FF 83 3E AF-8D 01                     ..h&..>/..


Examine these numbers closely.  All of them MUST agree with the numbers

listed here, except for the numbers I have shown here as "xxxx".  If there

is a difference, the program has probably changed and this patch will not

work.  If all the numbers agree, you may proceed to the next step.


We will now replace some of the old code with new code.  There are two

different patches; choose either step 5 or step 6.  DON'T apply both patches.


5.  The "old" patch.  This patch fixes the video initialization problem

when running Starflight on the PCjr, but it has some limitations:


    - It only provides 4-colour RGB output, using the cyan/magenta/

      black/white palette;


    - It will produce 16-colour output in composite mode, but the

      colours displayed will be incorrect.


When I created the original patch in August, I was more immediately

concerned with just getting Starflight to run on the PCjr, having spent the

money on the program and finding myself unable to use it.  I am leaving the

old patch here because some users have discovered a use for it on IBM PCs,

XTs, and AT's; namely, if they issue the "graphics" command from DOS before

running Starflight with the old patch installed, they can print the screen

while the game is running.


Type the following exactly, taking special care to get it right.  Check the

line once or twice before pressing the Enter key:


        e 8dcc b8 04 00 83 ff 01 75 02 b0 05 cd 10 eb 3c


Now, let's check the patch.  Type:


        u 8dcc l e


DEBUG should display:


xxxx:8DCC B80400        MOV     AX,0004

xxxx:8DCF 83FF01        CMP     DI,+01

xxxx:8DD2 7502          JNZ     8DD6

xxxx:8DD4 B005          MOV     AL,05

xxxx:8DD6 CD10          INT     10

xxxx:8DD8 EB3C          JMP     8E16


If you do not get this result, go back to step 5 and try again.  Most

likely one of the values was entered incorrectly.  If your results agree

with the text shown here, go to step 7.


6.  The "new" patch, which will ONLY run on a PCjr.  It fixes the video

problem and produces 16-colour output on RGB or composite displays, using the

correct palette of colours.  There is one catch:  The patch must be applied

to a fresh copy of the original disks; it can NOT be applied to a game already

in progress.  If you patch a game already in progress, the change will not

"take", because Starflight makes a separate copy of the video initialization

routines in STARA.COM.  This copy cannot be patched, because doing so would

corrupt the save file and cause an integrity error when the saved game is

restored.


Type the following exactly, taking special care to get it right.  Check the

line once or twice before pressing the Enter key:


        e 8dcc b8 08 00 cd 10 1e 0e 1f ba df 8d b8 02 10 cd 10 1f eb 37


Then type the following, also checking it carefully before pressing Enter:


        e 8ddf 00 02 01 03 04 08 05 09 06 0a 07 0b 0c 0e 0d 0f 00


Now, let's check the patch.  Type:


        u 8dcc l 13


DEBUG should display:


xxxx:8DCC B80800        MOV     AX,0008

xxxx:8DCF CD10          INT     10

xxxx:8DD1 1E            PUSH    DS

xxxx:8DD2 0E            PUSH    CS

xxxx:8DD3 1F            POP     DS

xxxx:8DD4 BADF8D        MOV     DX,8DDF

xxxx:8DD7 B80210        MOV     AX,1002

xxxx:8DDA CD10          INT     10

xxxx:8DDC 1F            POP     DS

xxxx:8DDD EB37          JMP     8E16


Type:


        d 8ddf l 11


DEBUG should display:


xxxx:8DDF  00                                                .

xxxx:8DE0  02 01 03 04 08 05 09 06-0A 07 0B 0C 0E 0D 0F 00   ................


If you do not get these results, go back to step 6 and try again.  Most

likely one of the values was entered incorrectly.  If your results agree

with the text shown here, go to step 7.


7.  We now have to write the patched file back to disk.  Type "w" and press

the Enter key.  DEBUG should respond:


Writing D3B6 bytes


8.  Type "q" and press the Enter key to leave DEBUG.


You now have a version of Starflight that will run on the PCjr, without the

video problems.  At this point, you might wish to back up the patched A

disk and put it away with your originals, so that you won't have to repeat

this patch procedure the next time you want to start a new game; In this

case, all you would have to do is DISKCOPY your patched A disk and original

B disk to the disks you are using for the new game.



Using your patched copy of Starflight

-------------------------------------


After booting your PCjr to get the expansion memory, enter the command


        mode co80


from your DOS disk.  This is not ABSOLUTELY necessary, but without it you

will not see the first prompt asking you to insert the disk with STARB.COM

on it.


Now start the game by entering


        starflt


When you get to the screen asking you your display type, the option you

select will depend on whether you have applied the old (4-colour) patch,

or the new PCjr 16-colour patch.


If you are running on a PCjr and have applied the 16-colour patch, select '3'

(Composite monitor or color TV).  This will produce correct output on both

composite _and_ RGB displays.  Do not select '2' (RGB), as this will cause

Starflight to use the colours incorrectly.  (RGB mode uses different colours

in some places.)


If you are running with the old patch, you may select '1', '2', or '3'.

NEVER select '4' (Hercules monochrome adapter); the program will die

a graceless death.  You cannot use the Hercules card or IBM Monochrome Display

with either of the patches given here.


    - Option 1 (Black and white) will produce a black-and-white picture on

      a TV or composite colour monitor.  Note that option 1 will produce a

      colour picture on the PCjr Color Display, which doesn't pay attention

      to the colour burst signal and always assumes it's there.


    - Option 2 will produce colour output on an RGB display, using the

      standard cyan-magenta-white-black palette.


    - Option 3 is for use with colour composite monitors or colour TVs;

      however, if you have one of these, you are probably better off not

      patching your program at all, as "regular" PCs should generate

      correct output.  (If you have a PCjr and a composite monitor, you

      should apply the 16-colour patch.)  "Regular" PC owners should only

      apply the old patch if they want to take advantage of graphics dumps

      (see instructions for old patch, above).



Notes

-----


In the end, I was amazed at how easy the 16-colour patch for the PCjr

turned out to be.  For those of you who want to know, the patch uses a

graphics mode peculiar to the PCjr, the so-called "lo-res" 16-colour

160 x 200 mode.  The lo-res mode stores two double-width pixels side-by-side

in a single byte, like so:


        +--+--+--+--+--+--+--+--+


        +--+--+--+--+--+--+--+--+


Four bits per pixel allows 16 different values to be stored there; this

allows 16 different colours.


Starflight, in its RGB mode, uses the 4-colour 320 x 200 graphics mode

("medium-res").  Four-colour medium-res mode stores four pixels per byte,

like this:


        +--+--+--+--+--+--+--+--+


        +--+--+--+--+--+--+--+--+


Two bits per pixel allows 4 different values, giving four colours.


Those of you playing Starflight in the four-colour mode will notice that

Starflight "doubles up" its pixels, representing one colour (for example)

by a white pixel paired with a magenta pixel.  Nearly ALL of the graphics

(except perhaps the title screens) are done this way.  Doubling up the

pixels effectively gives 4 bits per wide pixel.  This is done to fake out

the composite output into producting 16 colour values.  Aha! I thought.

Why not just turn on the lo-res mode, and let these 4-bit groups be

interpreted as 16 different colours in RGB?  So that's what I did.  The

only remaining thing to do was to rearrange the colour settings to agree

with what the composite output would produce; in fact, most of the patch

does nothing but set the colours up properly.



Acknowledgments

---------------


Thanks go to Alan Ford [73317,1426], who brought the graphics dump use of

the old patch to my attention.  A big thank you to Rod McConnell, one of

Starflight's co-authors, who put up with my pestering and provided me with

the "official" set of colour values to use in the PCjr 16-colour patch.



Feedback

--------


Please send any questions or correspondence to Lee Johnson, [71310,405].


Have fun!                                                                                                                        

Comments

Popular posts from this blog

BOTTOM LIVE script

Fawlty Towers script for "A Touch of Class"