Classic Computer Magazine Archive ANTIC VOL. 7, NO. 6 / OCTOBER 1988

Type-In Software

First XEP80 Slide Show

Full 80-column graphics display for 8-bit

By Matthew Ratcliff

This picture loader is the first published program delivering the full 80-column graphics potential of the Atari XEP80 display hardware. The BASIC Slide Show program--plus several related demonstration listings--works on 8-bit Atari computers with at least 48K memory and disk drive.

At last real 80-column displays on the 8-bit Atari! But where's the commercial software we need for practical uses of the $79.95 Atari XEP80 board? (Reviewed in the July 1987 Antic.) Well, the graphics programs and routines accompanying this article will at least help fill some of the gap until applications like AtariWriter Plus 80 arrive.

XEP80 Slide Show delivers an 80-column display of any pictures originating in the Atari's widely used Graphics 7-1/2 or 8 formats. Assembly language students can obtain the MAC/65 source code for the programs' main USR routines on this month's Antic Disk.


So let's get started. We'll take a look at some of the XEP80's inner workings and show how to begin putting this fascinating hardware into gear.

Setting up the XEP80 box couldn't be simpler. Just use the provided RCA cable to connect the XEP80 to the monitor. The XEP80 plugs into any 8-bit Atari via either joystick port 1 or 2. Now boot the software that comes with the XEP80, turn on the power and you have a full 80-column display.

The handler software for the XEP80 fills less than 2K memory, but is quite powerful. The manual is a good general reference and the technical documentation is very helpful for digging into this smart little box.

The XEP80 requires a special program that replaces the E: and S: handlers built into the Atari operating system. This comes in the form of an AUTORUN.SYS file on an included Atari DOS 2.5 boot disk. The disk also contains complete source code for the XEP80 driver and full in-depth technical documentation.

The XEP80 has a printer interface port which is of limited use. Before it can be accessed, the handler must be loaded from disk as an AUTORUN.SYS file. Most commercial word processors (except for the original AtariWriter cartridge) just don't allow this.

Hooray! You can now edit your MAC/65 or Atari BASIC programs in 80 columns with the XEP80. Any "well-behaved" Graphics 0 application will also work with the XEP80 Specifically, this means any program which doesn't use custom display lists, only talks to the E: device through standard PRINT statements and doesn't manipulate DMA control (i.e. enable the ANTIC chip). Admittedly this is a pretty limited supply, but the XEP80 does support the full complement of character graphics, cursor control and screen editing key commands.

User groups have been receiving "pre-release" versions of AtariWriter Plus 80 this spring, which is at least a hopeful sign that might soon be generally available. However you can forget about 80-column compatibility with ICD/OSS software such as BASIC XL, BASIC XE, Writer's Tool and ACTION! The same goes for the Lightspeed C editor, which insists on turning on DMA to enable the standard 40-column display. MAC/65 is the only ICD/OSS product which does not use high-speed screen memory access for text output. The company's other products circumvent the E: device, so they just don't work with the XEP80.

Portrait above is 40 columns, fast 80-column version below


Debugging MAC/65 assembly language using DDT (Dunion's Debugging Tool) won't work either. DDT uses all sorts of custom display techniques which will totally confuse the XEP80. But you should be able to debug assembly code in 80 columns with the old Atari Assembler/Editor cartridge.

With the XEP80 handler installed, Graphics 24 (8 X16) has a very special meaning. It kicks the XEP80 into a 320 X 200 bit image graphics mode, virtually identical in bit-mapping to the standard Graphics 8 display. However, you cannot PLOT and DRAWTO on the XEP80 display. Graphics 8+16 for the XEP80 places the device into "burst mode;" where every byte of data received is treated as eight pixels of display information. It is mapped directly to the XEP80's 80-column screen and the cursor is bumped to the next eighth pixel position.

A graphics demo provided by Atari on the XEP80 boot disk requires five minutes to slowly draw a circle on the top quadrant of the screen display. This slowness is extremely misleading. To see just how fast the XEP80 display can be filled with graphics, type in Listing 1, XEPLIST1.BAS, check it with TYPO II and SAVE a copy before you RUN it.

This first program fills a 40-byte string with ASCII values 255 to 0, stepping backwards. Each graphics "line" is then "plotted" on the XEP80's display simply by printing it. It's slow compared to how quickly a standard Graphics 8 display can be filled, but it is still pretty quick and we can go even faster. Try changing the SZ variable in line 10 to different values, up to 8000, a full screen on the XEP80 display.

Using this first demo program, you will notice that the fill screens wrap around on themselves from bottom to top. While developing the XEP80 Slide Show program, I tried printing a 7680-byte graphics mode screen (192 lines) to the XEP80, immediately followed by 32 zero bytes (eight more lines). Then I loaded and printed the next graphics screen. It wrapped around to the top of the display as I expected, but was slightly skewed to the left.

I discovered that an additional 32 zero bytes had to be sent to the XEP80 to get a perfect wraparound from bottom to top. This made for an interesting slide show, continuously playing one picture after the next. However, the XEP80 always got skewed again at seemingly random intervals.

Apparently in graphics burst mode the timing is very critical between the computer and the XEP80. Eventually it will lose a byte or two. With no special handshaking in burst mode to detect and correct such errors, your pictures will be skewed again. Currently the only way I know to get things synchronized between the computer and the XEP80 is to issue the OPEN command to E:, which forces the text mode and normal communications.

Disk menu in 40-column and 80-column displays.


Now type in Listing 2, XEPLIST2.BAS, check it with TYPO II and SAVE a copy before you RUN it. The XEP80 Slide Show is a simple Graphics 8 viewer program that also lets you load uncompressed Micro-Illustrator pictures (compatihle with KoalaPad, Atari Touch Tablet, Suncom Animation Station, etc.). The "colors" appear as patterns, so the pictuces may not look all that great, depending on color selections and shading techniques used in the original image.

When you RUN this program, you'll be prompted for a directory search specification, such as D1:*.MIC. A directory of all files matohing your selection is listed to the screen. Next, enter the filename you want to LOAD, or press [RETURN] to enter a new directory specification. You don't need to specify a drive or extender. The 62-sector picture file is then loaded and displayed. Press [RETURN] to select a different file to view.

Two separate USR routines are employed. The first is in string XFREAD$, initialized in the subroutine beginning at line 30000. It accepts pointers to a filename string and a graphics buffer string. This USR routine attempts to open the file and read the graphics data into the buffer.

The next step is to get the string displayed on the XEP80 while in the graphics mode. The second USR routine is in XEPGRAF$, beginning at line 25000. It accepts the address of the graphics buffer string and does a binary record PUT of this size to the E: device--the fastest way possible to send the XEP80 all that data. The XEP80 handler does the rest.


Here's a special XIO command that shows a 40-column display while the XEP handler is in use:

XIO 25,#6,12,0,"E:"

If you have two monitors side by side, you can do many interesting things with dual displays. When the 40-column display is on, absolutely no communications to the XEP80 can be carried out. No PRINT statements to the screen may be used. To turn off the 40-column display and resume communications with the XEP80, use the following command:

XIO 24,#6,44,0,"E:"

Any software that uses the 40-column display must write directly to screen RAM. Here's an example of how easy it is to use two different displays with the 8-bit Atari. Type in Listing 3, XEPLIST3.BAS, check it with TYPO II and SAVE a copy before you RUN it. You'll be prompted on the 80 column display to prepare to view the 40-column screen. After you change any connections, if necessary press [RETURN]. The 40-column display is enabled and the screen RAM is POKEd with random values. Don't press [BREAK] while this display is on, or the XEP80 will get very confused--but it would recover on [RESET]. Exit the program at the next 80-column display prompt. Make sure to use a PRINT CHR$(125) command to clear the XEP80 display instead of the usual GRAPHICS 0, which the XEP80 handler simply ignores.

Listing 4 puts this dual display technique to good use, showing a 40-column disk directory. Type in Listing 4, XEPLIST4.BAS, check it with TYPO II and SAVE a copy before you RUN it. The USR routine beginning at line 20000 is placed in XEPRINT$. It requires the X and Y coordinates (in Graphics 0) and the address and length of a string. It will convert the string from ATASCII to screen RAM format and place it in the 40-column display memory at the specified position.

The clear screen character (ATASCII 125) will he interpreted properly and clears the 40-column display. It also handles the carriage return character and can work with strings up to fill screen size, so you can format an entire page of text and display it with one USR call.

Note that the [RETURN] character positions the cursor at the next line using the same X position that was originally specified, acting as if that were the left margin. This is ideal for aligning columns of text. The XEPRINT$ USR routine does not check to see if our text will print past the end of the display, nor does it scroll the screen. Your BASIC program can keep track of the vertical cursor position easily enough.

(80-column hardware)
Atari Corp.
1196 Borregas Avenue
Sunnyvale, CA 94086
(408) 745-2000
$79.95, 16K disk

Matt Ratcliff, longtime Antic Contributing Writer, answers 8-bit technical questions on ANTIC ONLINE. Just type GO ANT- 3927 when you log onto CompuServe.


As Antic's original XEP80 review in July 1987 pointed out, you need a good composite video monitor capable of 80 sharp columns in order to see what the XEP hardware is truly capable of. I tried to use the XEP80 with my old Commodore 1702 color monitor. It almost worked, but the 1702 didn't quite have the bandwidth needed for 80 columns. A line of text at the top and bottom of the display and some characters at the left edge were chopped off.

You could move up to the $300 Commodore 1802, the 80-column version developed for their C128. However, your best bet would be to get an inexpensive 80-column composite video monochrome monitor sold for as little as $50 by mail order companies. Unfortunately these are now somewhat hard to find, because most monochrome monitors these days have TTL interfaces, specifically for IBM PC compatibles.

The May 1988 issue of the San Leandro Computer Club (SLCC) Journal published a tutorial article by Bob Woolley, about modifying the XEP80 for TTL monitors. It looks like a fairly simple project for experienced hardware hackers.-MATT RATCLIFF

Listing 1: XEPLIST1.BAS Download

Listing 2: XEPLIST2.BAS Download

Listing 3: XEPLIST3.BAS Download

Listing 4: XEPLIST4.BAS Download

Listing 5: XEPRINT.M65 Download / View

Listing 6: XEPFREAD.M65 Download / View

Listing 7: XEPGRAF.M65 Download / View