Authors
Publication
Pub Details
Date
Pages
I have thoroughly enjoyed my ZX-81 for years. I have added a full-size keyboard, 64k of memory and the Timex/ Sinclair 2040 Printer. I’ve always lamented the lack of high-resolution graphics, but have never felt compelled to invest the extra money for the needed hardware or s/w. The following program will allow you to use your ZX-81/TS 1000/1500 and either the Sinclair or Timex Printer to create high-resolution graphics (see examples 1-4). Goodbye “blocky” pictures!
The characters of the ZX-81 are generated using an eight by eight grid. Each line of this grid is stored as a binary number in the ROM (addresses 1E00h to 1EE7h). IF you were to PEEK the eight addresses for the letter “0” in the ROM, you would find the decimal/binary code in Fig. 1. For each “1” in the binary code, a pixel is set on the screen, producing the pattern “0”.
Due to the design of the ZX-81, only codes stored in the actual ROM can be generated onto the screen without the use of extensive machine code programming. By using the routines contained in lines 500-570 and 1000-1090 of listing 1, and a lifted version of the LLIST subroutine from the ROM, any eight by eight character can be generated via your printer.
USING PABLO PIXEL-O
The program is designed for you to draw a picture and create individual characters to produce a high-res copy of it. Graph paper which is ruled in eight by eight grids will help you map out your characters. Draw or trace your picture onto the graph paper. Next, darken each square (pixel) which is a line or solid/shaded element of your picture. (NOTE: if your picture does not contain an empty 8×8 grid, you may wish to define extra “space” character to help you in formatting later on.) Total up the number of different characters (8×8 pixel grid) you will need to compose your picture. Now count up the number of characters in each line (a max. of 32) and the number of character lines in your picture. You may wish to design your picture sideways and create a long panorama, but it can only be 32 characters high.
You are now ready to LOAD the program and begin creating your own characters. Before LOADing, you will need to lower RAMTOP by entering “POKE 16389, 124”, then followed by “NEW”.
DEFINING CHARACTERS
When the menu appears, choose option 1– “Define Characters” (see fig. 2). This will set up a blank array in which to store your data. Answer the prompt with the total you calculated earlier. You may wish to enter a total slightly higher than the amount of characters you wish to define, allowing for any errors or additions. When prompted, enter each line of the 8×8 grid as a space or an inverted space (GRAPHICS/SPACE…see fig. 3). When this character is produced by the printer, a pixel will be set (black) for each inverted space and unset (blank) for each space. If, after entering all eight lines, you are not satisfied, answer “NO” to the prompt and you will have the option of starting over for that character or changing individual lines. (Keep track of the order in which you define your characters as they are coded and stored in this order. Character code “1” is for the first character defined, code “2” the second defined, ect.) After you have completed your character definition, the screen will go blank for a few seconds while the computer analyzes and stores the data. If you would like to return to the menu during definitions, enter “M” as the first space in any line. This will allow you to check your progress or save your data. NOTE: To continue definitions, choose option 2 “Continue Definitions”, as option 1 will clear all data from memory!
SEEING IS BELIEVING
You can review a portion of your work with “Big- Bits”–option 8. This option will display up to eight enlarged characters across and six down, using the standard Sinclair graphics. (See example 5) When prompted to enter code numbers, enter the number for the character you wish displayed (remember, character 1 is the first character defined, 2 is the second, ect.). After entering the codes the screen will go blank while the computer stores this “notepad” information on a “notepad”. You will then see an enlarged version of the characters in the order you specified. pressing “M”, you can return to the menu, “2” will make a copy of your enlarged characters on the printer. NOTE: The program uses part of the machine code stored in REM to set up the CoPY routine in ROM, copying as many lines as are needed.
HARD EVIDENCE
To print a copy of your picture in high-resolution, choose option 3– “Picture Coding” . Follow the prompts, by inputting the totals you calculated for the width and height of your picture. You will again be asked to enter codes for the newly defined characters in the order to be printed. After entering all of the character codes, you will be returned to the menu. If you only wish to print out a portion of your picture, entering “0” for a character code wiil return you to the menu. you may return to coding the picture by choosing option 7–“Continue Picture Coding” ‘. Option 4–“Print Out Picture” will produce a high-resolution picture via the printer. The monitor screen will go blank for a few seconds while the computer transfers data to a notepad, after which it will print out one line of your picture. This pattern will continue until all of the picture has been printed. After After you have finished “coding” your picture, a copy can be obtained at anytime by going directly to option 4.
HOW DID THAT GET THERE?
If you would like to correct or redefine a character, option 6 will allow you to redefine any character you designate. Redefine a character by following the steps for defining, line by line.
PRESERVING THAT MASTERPIECE
Option 5 will save the program and any data already entered. NOTE: if you break the program, do not RUN, as this will erase all of the data entered. Continue by entering GOTO 600, putting you into the menu. When you reload the program, the menu will appear and you may continue from there.
ENTERING THE PROGRAM – TS1000 version
Before entering listing 1, lower RAMTOP by entering POKE 16389, 124 and NEW. Line 1 should contain 113 characters after REM. When you have finished typing in the program, it is prudent to save it to tape before RUNing the program. After you have made a back-up copy, enter FAST mode and enter GOTO 9000. This will load the machine code into the REM statement. This subroutine will check for most typing errors while entering the machine code contained in A$. After the code has been transferred to the REM statement, you may delete lines 9010-9170. To save this completed version to tape, set-up your recorder to record and start the tape, enter as direct commands, CLEAR and GOTO 3000. Remember, you will have to lower RAMTOP by POKEing 16389 with 124 before loading this program into the computer.
Listing 2 is a disassembled version of the machine code for the 1000 version. Addresses 16514-16529 contain the table holding the different graphic characters used by Big-Bits. The routine starting at 16530, looks at two lines of each character. It first looks at the first two bits in each line and calculates a matching character from the graphics character table, printing this graphic symbol. Then it moves on to the next two bits of each line, calculating and printing until all bits have been translated. This procedure is repeated until all eight lines of the character has been printed and then moves on to the next character. The routine at 16621 copies the screen to the printer. Register D is loaded with the number of screen lines to be copied. The routine then jumps into the ROM’s copy routine.