Classic Computer Magazine Archive ANTIC VOL. 7, NO. 4 / AUGUST 1988

First Look Inside the XE Game System

Hardware surprises revealed!

By Matthew Ratcliff

This look inside the Atari XE Game System includes two programs. XEGS Manager is a utility for convenient control of all the Game System's built-in features, but many of its options can also be used on the other Atari XL/XE computers. The second BASIC program is a short "spray-painting" routine for testing light guns.

Atari executives asked the heads of several major toy store chains which product they'd rather sell – the powerful 65XE home computer for about $80, or a fancy new game system for about $150. The answer was, "You can keep the computer, give us that game machine!"

This "game machine" is what we now know as the Atari XEGS, the XL-compatible Extended memory Game System. It's simply an enhanced 65XE in a game machine package. It's also a brilliant idea. The XEGS has been selling out almost as fast as toy stores can get them in.

The XEGS may not seem like such a hot idea to serious Atari computer users. But just think about it. If you were afraid of computers or don't have the foggiest idea what to do with one, you'd have absolutely no interest in an Atari 65XE – even if it could play great games. However, you'd probably have no compunction about buying a great video game system, the XEGS, as a new addition to the family entertainment center.

Now we'll take a close technical look at the Atari XEGS. I'll explain how some of its changes in physical design have affected the operating system software. I'll also present the XEGS Manager a utility for controlling all the built-in features of the XEGS.

KEYBOARD

The keyboard of the XEGS is detachable. When not connected, the XEGS console looks (and acts) like just a tame little game console. In fact, Missile Command is turned on automatically.

Plug in the keyboard and turn on the machine without an external cartridge, and you're running Atari BASIC, Revision C. The keyboard is virtually identical to the one found on the 130XE. It's mushy, but you can get used to it.

The cable on the XEGS keyboard is quite short. There are two brackets at the top of the keyboard case which lock neatly under the front of the console. The keyboard connector is a standard DB15 female. My first XEGS project was to construct an extension cable for the keyboard. I find it far more comfortable to type for a long time with the keyboard on my lap than on a desk.

Inside the XEGS keyboard case is a small circuit board. On it you will find some resistors, capacitors and two CD4051 chips, which decode the keypresses and send an internal keycode back to the POKEY chip in the XEGS. I already made an adapter cable to connect the XEGS keyboard to the 800XL joystick ports.

keyboard circuitboard image
This is the small printed circuit board inside the XEGS detachable
keyboard. It is sitting on a schematic of the old Atari 800, adjacent
to virtually identical keyboard circuitry.

So far my efforts at "scanning" the external keyboard manually have failed – the POKEY chip does this automatically in the XEGS – but I hope to bring you a laptop keyboard utility program that lets you use the XEGS keyboard on any other Atari computer with minimal hardware hacking – just a cable.

keyboard internal image
There's room at the top of this keyboard for the START SELECT OPTION
and RESET keys. But they are in the console. A dead giveaway that this
keyboard is identical to that of the 65XE.

MEMORY

There are only two RAM chips in the XEGS, which deliver a full 64K of RAM. They're Texas Instruments TM54464-12 64K-by-4-bit chips. In the XL/XE computers, eight 64K-by-1-bit chips are used. Fewer chips improves reliability and generally reduces the cost of producing the machine. In fact, the XEGS contains a total of only 17 chips.

ICD has indicated that it is working on a RAM upgrade kit for the XEGS similar to the RAMBO XL for the Atari 800XL. I've already received a 128K RAM upgrade kit from Innovative Concepts for my XEGS, making it fully 130XE-compatible. See review on this page.

Using higher-density ROM chips, the updated XEGS operating system had 8K of spare ROM. Atari decided to use that extra ROM for the Missile Command game, which is bank-switched in and out much like how Atari BASIC is toggled on and off. Missile Command can be enabled by holding the [SELECT] key during power-up when a keyboard is connected. When in BASIC, you can enter BYE to get to the Self Test. From there, pressing [RESET] while holding the [SELECT] sends control to Missile Command. Press [RESET] in Missile Command, while holding [OPTION], to return to the Self Test. Press [RESET] by itself to return to BASIC. (Reboot if a disk drive is connected.)

LIGHT GUN

The XEGS comes with a light gun called the XG-l. The Nintendo light gun is more accurate – if something is lined up in its sights, that's exactly what you hit. Not so with the XG-1. You'll find that it often shoots to the left or right, depending on the software you're running.

The XG-1 is simply a specialized light pen. Light pen support was built into the earliest Atari computers, but it never really caught on. In the shape of a gun, the light pen has brought a whole new dimension to video games applications. The light pen horizontal position, LPENH, can be PEEKed at memory location 564, and the vertical position, LPENY is found at location 565.

Light gun values range from 0 to 227. You will notice that your horizontal readings are quite odd. Try the sample program below, and notice how the GUN-X readings vary as you sweep the gun across the screen, left to right.

10 LPENH=564
20 LPENV=565
30 GRAPHICS 0:POKE 752,1:POKE 712,15
40 POS. 0,0:FORI=1 TO 4:? "0123456789";:NEXT I
50 ? "GUN-X=";PEEK(LPENH);" "
60 ? "GUN-Y=";PEEK(LPENV);" "
70 ? "TRIGR=";STICK(0)
80 GOTO 50

Listing: DRAWGUN.BAS Download

XEGS system with Atari Light Gun

Point the gun to the far left of the display and GUN-X will read about 88. Moving from left to right, the reading will reach 227 at about column 34. Then suddenly it drops to 0 and increases again to about 30 at column 39. This offset is due to the delay between when a pixel is actually lit on the display and when the information is relayed from the light gun sensor to the POKEY chip, which latches an internal scan counter for the pen reading.

The old Atari 400/800 Hardware Technical Reference recommends a "calibration procedure" each time the light pen is used, so that the software can compensate for this offset. A calibration procedure would improve the accuracy of the light gun. But Atari's Bug Hunt and Barnyard Blaster games both have "hard-coded" values – different ones in fact. While Bug Hunt appears to shoot slightly to the left, Barnyard Blaster seems to shoot a tad to the right. The Y readings for the gun are more predictable, equal to half the number of the currently displayed scan line. You'll notice with your test program that GUN-Y only varies from about 17 to 115. Note that you get much better performance out of the light gun near the screen edges, when you use a light colored border achieved with the POKE 712,15 above.

You'll need to perform some computations to adjust for these unusual readings, to convert gun coordinates to screen coordinates. Different conversion factors are required for each graphics mode (and PIM graphics).

The gun won't return reliable readings at all if the intensity of the display is too low. That's why the screens for Atari light gun games may be brighter than usual. The game screen will momentarily flash white whenever you press the trigger in either Bug Hunt or Barnyard Blaster while the screen is all white, the software reads the gun position and provides the most accurate values.

Listing 1, DRAWGUN.BAS, presents a Graphics "spray-painting" program for testing the XG-1. Dots are drawn whenever the fire button is pressed. Try holding the gun very steady to see how much jitter you get in the readings. These inaccuracies are reflected in your games as well. I feel that, at the higher levels of play, Bug Hunt and Barnyard Blaster both require more accuracy for continued play than the XG-1 can deliver.

Atari has informed me, however, that the XG-1 and a revised Bug Hunt will be released as a separate package. If you're tired of waiting, you may wish to pick up the Sega light gun, for about $25 (when on sale) and modify it for the Atari.

To modify the Sega gun for the Atari, you'll have to cut off the incompatible connector. The wires must be stripped back and soldered into an Atari joystick connector as follows:

		SEGA GUN	ATARI JOYSTICK PORT
		Blue wire	Pin 1 stick FWD
		Gray wire	Pin 6 trigger
		Green wire	Pin 7 +5 volts
		Black wire	Pin 8 Ground

Because of the close-fitting connections for the XEGS ports, don't wire in a DB9 female connector that has "ears." Most joysticks don't have wires for unused signals, so cutting up an old joystick cable may not work. Specifically, an Atari joystick does not need the +5 volts, so there isn't likely to be a wire connected to Pin 7. However, you can find joystick extension cables at Radio Shack, which have all nine pins wired from male to female. Antic disclaims responsibility for any damages that might occur during improper implementaton of this, or any, hardware modification project we publish.

Once it's all hooked up, you'll notice that gun fires when you release the trigger; which is annoying. The Sega trigger wiring is the opposite of what the Atari light gun uses. To rewire the trigger switch, remove the five screws (one is under the Sega logo on the side). Find the trigger micro switch with three connections. Wire to the normally closed contacts instead of normally open.

Internal view of the XEGS

XEGS MANAGER

  Listing 2, XEGSMGR.BAS, is a BASIC loader that lets you create a machine language file on disk. Type it in, check it with TYPO II and SAVE a copy before you RUN it. The file XEGSMGR.EXE can then be loaded from DOS or renamed AUTORUN.SYS. Many of the program's features also can be applied to Atari XL/XE computers.

Antic Disk owners will also find the MAC165 assembly language source code for Listing 2 on this month's disk, under the filenames XEGSMGR.M65 and RAMOSDAT. M65. If you wish to recompile this code, you'll need the MAC/65 files IOMAC.LIB and SYSEQU.M65.

Normally you must press the [OPTION] key at boot time to disable BASIC and go directly to DOS. And once BASIC is off, the only way to get it back on is rebooting. Option 1 of XEGS Manager is to turn internal BASIC on, and option 2 turns it off.

Disabling BASIC while in DOS provides an additional 8K buffer for file copying. This is an important feature for owners of a single drive. Quite often, BASIC must be off before certain machine language files can be loaded and run. The XEGS Manager eliminates the need of rebooting every time that BASIC must be re-enabled.

SELF TEST

The XEGS Self Test lets you test the computer's sound registers, keyboard, and memory. However, BASIC is not turned off automatically when Self Test is run from the BYE command. This means that the 8K of RAM under BASIC isn't tested. Option 3 from the XEGS Manager lets you run the Self Test with BASIC off, so that the maximum amount of RAM is tested.

RAM OS

All of the operating system of the XEGS (and 64K or more XL/XE machines) is "shadowed" by RAM. Some disk operating systems, such as DOS XL and SpartaDoS, use hidden RAM for many of their own functions. However, if you're using Atari DOS 2.0 or 2.5, then there is a lot of RAM going to waste in your machine.

Option 4 of the XEGS Manager lets you enable a RAM-based operating system so you can do some real "hacking" – disassembling and adjusting parts of the XEGS operating system to suit your needs. Even if you're not a hacker, there are other practical features of a RAM OS.

Once the RAM operating system is enabled, you are prompted for a disk drive number, 1-8 or 0 to exit. A custom font can be loaded in place of the standard one in the OS ROMs: enter the drive number to display a directory of all .FNT files. Then enter the name of the font file to load, or simply press [RETURN] to change drives or disks.

You needn't enter the drive specifier or extender – the XEGS Manager will take care of that for you. The font file is loaded into memory at $E000 (57344). Then you're prompted to (1) repeat the process and try a different font, or (2) exit. (You will find some font files on this month's disk as a bonus.)

Your RAM OS and font are reset-proof, too. Pressing the [RESET] key causes the XEGS to re-enable the ROM-based operating system, but a special handler in Page 6 of memory takes control after that. The handler converts the ROM back to RAM, recopying all the essential parts of the ROM OS, in case part of this RAM area got clobbered while you were hacking about. The handler does not recopy the ROM OS font, however, leaving yours intact. Should your RAM font get garbled somehow, press [RESET] while holding the [START] console key to return to the ROM font. Each time that [RESET] is pressed, a RAM OS prompt is displayed at the top of the screen as a reminder.

If you enable a RAM OS while running SpartaDOS, the XEGS Manager detects it and prevents the installation and subsequent system crash. The Manager does not automatically detect any other DOS, such as DOS XL, which may crash when a RAM OS is enabled.

MISSILE COMMAND

Again, if you turn on your XEGS without the keyboard connected (or hold down the [SELECT] key at power-up), Missile Command fires up automatically. Option 6 of the XEGS Manager will get you into Missile Command without having to mess with any console keys or power switches.

CONCLUSIONS

The XEGS is a superb little computer. It's still a hacker's system too. I've found that the PBI ROM routines are intact, which means that you should be able to hack in your own custom PBI connector and use the XEGS with ICD's MIO board, if you're a real solder jockey.

The XEGS has brought along a lot of new software too something Atari was counting on. Much of it includes repackaged classics or cartridge conversions from disk-based software, but there are a few new titles such as Battle Zone. Atari's new 256K bank-switch cartridges are not likely to be pirated. This means that the piracy threat for 8-bit Atari software should be minimal, thus attracting more new software vendors from the traditional Apple and Commodore markets.

If Atari can provide a responsive cartridge production service for third party software vendors (something the old Atari never would have done), then we're likely to see the software base for the 8-bit Ataris grow with the popularity of the game industry, which is definitely on the rise again.

Matt Ratcliff is a St. Louis aerospace engineer and a longtime Antic contributing writer.


LISTING   DRAWGUN.BAS Download

ON DISK   XEGSMGR.EXE Download

ON DISK   XEGSMGR.M65 Download / View

ON DISK   RAMOSDAT.M65 Download / View