Classic Computer Magazine Archive ANTIC VOL. 3, NO. 9 / JANUARY 1985

WIDE TEXT

Bold letters beef up graphics 0

by BILL MORRIS

The easiest and most powerful method ever developed for inserting bold double-width Graphics 1 letters anywhere on the screen in Graphics 0, the standard text mode.  Works with all Atari computers of any memory size.  But if you want to use the included source code, you'll need either Atari Assembler Editor or MAC/65.  Antic Disk subscribers, RUN"D:WIDETEXT.BAS"

It's been accepted as fact that you have to fold, spindle and mutilate the Atari display list in order to print bold, double-width Graphics 1 letters on a screen in the standard text mode, Graphics 0.
   Even after you went through all this programming effort, you still wouldn't be allowed to put Graphics 1 letters on the same line as Graphics 0 letters.  And inverse video Graphics 1 letters were completely out of reach.
   WideText neatly solves all three problems.  It's a short assembly language subroutine that lets you put standard or inverse Graphics 1 letters anywhere on a Graphics 0 screen.  And you don't have to struggle with the display list.
   You can use the WideText subroutine in your own BASIC or machine language programs.  Antic is publishing WideText here in a longer BASIC demonstration version.  The actual subroutine is in binary load format in lines 6400-6520 and 20000-20280.  We're also providing the assembly language source code for the subroutine.

HOW IT WORKS
WideText redefines portions of the computer's character set to simulate the Graphics 1 letters.  For example, the letters [CTRL] [A] and [a] have been redefined to look like:
Wide [CTRL][A]  Wide [a]

   Now when [CTRL] [A] and [a] are printed next to each other, they look like an "A" in Graphics 1. It works the same way with any other letter.  If you want a Graphics 1 "X," you type [CTRL] [X] and then [x].  WideText only works for letters, not with numbers, punctuation marks, or special characters.
   The routine that does this is in lines 20000-20280.  You can use it to mix Graphics 0 and Graphics 1 letters in your own BASIC programs.  Once included in your program, you can turn it on with the statement X = USR (1536).
   You can also type with WideText's simulated Graphics 1 letters.  First, set the variable WIDE equal to [1].  Now as you're typing, the routine in lines 6400-6520 substitutes the wider Graphics 1 characters on the screen for each Graphics 0 letter.  To type with Graphics 0 letters, set WIDE to 101.

HOW TO USE WIDETEXT
Type in Listing 1, check it with TYPO II, and SAVE a backup copy.  When you type RUN, the program will cycle through a demonstration of how WideText prints messages on the screen.  You don't need to type either Listing 2 or Listing 3 in order to use Listing 1.

USING ASSEMBLY LANGUAGE WIDETEXT
Listing 2 is the WideText assembly language source code.  To use it you need either an Atari Assembler Editor or O.S.S. MAC/65 cartridge.  SAVE a backup copy after you type it in.  Antic Disk subscribers, ENTER #D:WIDETEXT.ASM
   Once a machine language program is assembled and you SAVE it as object code, it can become part of a BASIC program if it starts with a PLA instruction and ends with an RTS instruction.
   Before BASIC can use object code, the code must be converted into DATA statements.  Listing 3 will load the converted object code by POKEing this data into memory.
   First, save the assembled machine code on a disk by typing SAVE #DPAGE6.OBJ<600,6FF

MAC/65 owners, type:

ASM,,#D:PAGE6.OBJ

If you wish to save the source code too, type:

LIST #D:WIDETEXT.ASM

   Next, turn off the computer.  Then reboot it with BASIC DOS.  Use Option L to load the machine-language routine into Page Six.
   Exit DOS and use Listing 3, the PEEKER program, to generate the necessary DATA statements.  Type in Listing 3, check it with TYPO II and SAVE a backup copy before you RUN it.  Antic Disk subscribers, follow the applicable instructions above before using the DATA statements it generates.
   IMPORTANT: Remember to delete the PEEKER program before using the DATA statements it generates.

ASSEMBLY LANGUAGE TAKE-APART
This take-apart is for Listing 2, the assembly language source code of the DATA statements in Listing 1.

130-190 Sets the variables.  Page Zero locations must be chosen carefully, since few are safe from BASIC.

200 Holds the starting address.

210 The PLA at the beginning of a machine-language subroutine exposes the Return-To-Basic address on the 6502 stack.

220-370 Finds a 1K block of memory just below the bottom of screen memory and copies a slightly modified version of the ROM character set.

410-420 Stores unchanged copies of numerals and punctuation marks.

430-440 Stores unchanged versions of capital letters.

450 Uses the variable ONECHAR to store an extra copy of each value.

460-500 Shifts all bits in ONECHAR four places to the right, and stores the value in HALFCHAR.

510-520 Delete the leftmost four bits of ONECHAR.

530-540 Calls a subroutine that expands four-place bit patterns into eight-place bit patterns.  Then, this new byte is stored as a control character.  Eight of these bytes will form the right half of a wide letter.

550-580 Deletes the leftmost four bits of HALFCHAR, stretches the patterns to eight bits, and stores this new byte as a lower case letter.  Eight of these bytes will form the left half of a wide letter.
590-620 Repeats character-redefining steps 208 times until we have a new alphabet. (26 letters x 8 bytes per letter = 208.)

630-730 Finishes copying and storing the character set.

740-750 Updates the character base pointer, 756 ($02F4).

760 Contains the "Return from Subroutine" (RTS) instruction.

Bill Morris is a San Francisco taxi driver.  He just walked in to Antic one day with the WideText program.  He also showed us his outstanding almost-finished machine language action game called Taxicab Hill.

Listing 1: WIDETEXT.BAS Download

Listing 2: WIDETEXT.ASM Download / View

Listing 3: PEEKER.BAS Download