News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_ComSoft6128

Locomotive BASIC - Condensed by Gerd Cebulla

Started by ComSoft6128, 06:54, 31 March 22

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ComSoft6128

Type-in from the February 1989 issue of 'Schneider Computer Partner' magazine.
From the magazine (Courtesy of CPCRulez):
"An RSX command extension for all CPCs

In mode 0, the CPC provides the impressive number of 16 colors. However, this is at the expense of the screen resolution. Especially with text output, it is very annoying that only 20 characters fit in one line. Even in mode 1 with 40 characters per line, you quickly reach the limits of the capacity. To remedy this, I had the idea of implementing a condensed type mode on the screen. The result is the "Condensed" program, which makes three new RSX commands available. Type in the basic loader and start it with RUN. It creates a machine program with a length of 1087 bytes and saves it under the name CONDENSE .MC, by the way, it contains a relocator, so you can load it into any free space; it adapts automatically to the respective start address. To do this, follow these steps:

MEMORY start-1
LOAD"CONDENSE.MC", start
CALL start

Text can now be displayed in condensed type on the monitor. 40 characters per line are now possible in mode 0, 80 in mode 1 and 160 in mode 2, i.e. twice as many as before. In Mode 2, however, "Condensed" should only be used when there is an absolute lack of space. Here, the condensed characters are relatively difficult to read on the green monitor, and on a color screen they can hardly be deciphered due to the poorer resolution. On the other hand, the "Condensed" Font in Mode 0 is even much easier to read than the oversized CPC standard font. Finally, mode 1 offers the ideal resolution for text output with 80 characters per line. Since you can choose between four colors here, there are significantly more highlighting options than in mode 2.

The RSX command |CPRINT is responsible for outputting a text in condensed type. The text must first be stored in a string variable. Here is an example: a$ = "Text"

|CPRINT, @a$

Owners of a CPC 664/6128 can omit the monkey sign in front of the variable name or pass the text directly. It looks like this: |CPRINT, "Text"

Note that "Condensed" basically works in graphics mode, similar to the TAG command of Schneider-Basic. This means that you have to move the graphics cursor to the desired position with MOVE x, y before output; it denotes the Position where the upper left corner of the first character of the string to be output is to be seen. Also, the text appears in the color of the graphic pen and graphic paper. If required, you can also append the appropriate values to the |CPRINT command -gene:

|CPRINT, @a$, pen#, paper#

Owners of a CPC 464 have the option of simulating the GRAPHICS PEN and GRAPHICS PAPER commands of the 664/6128-Basic by first defining an empty string and then setting the graphic color values with |CPRINT. This happens as follows:

a$ = |CPRINT, @a$,0,1

This does the same thing as GRAPHICS PEN 0:GRAPHICS PAPER 1.

Now it is relatively complicated to always have to deal with graphic coordinates. Therefore, "Condensed" provides an additional command that allows the use of text coordinates. It is:

|CLOCATE, column, row, window no.

This command places the graphics cursor at the position addressed by column and line in the specified text window. The parameters correspond to those of the LOCATE command in Schneider Basic. If the window number is missing, the text coordinates are related to the entire screen.

Here is the third RSX command:

|CSYMBOL, No. ,Z1, Z2, Z3, Z4, Z5, Z6, Z7, Z8

If you need any special characters or are not satisfied with the default design of the "Condensed" character set, you can use this command to define a new character. The parameters are used in the same way as with the Basic command SYMBOL; however, the symbol number must be in the range 0-127. The symbols from 32 to 126 correspond to the ASCII code, as is the case with the normal CPC character set. In addition, "Condensed" also provides the German special characters.

CHR$ (0) - Paragraph
CHR$ (1) - Ä
CHR$ (2) - Ö
CHR$ (3) - Ü
CHR$ (4) - ä
CHR$ (5) - ö
CHR$ (6) - ü
CHR $ (7) - ß

The parameters Z1 to Z8 designate the first to eighth matrix line of the character to be defined in binary coding. Of course, since condensed characters are only four pixels wide, these are 4-bit values (between 0 and 15); Bit 3 stands for the leftmost pixel, bit 0 for the rightmost one. Note that the "Condensed" character set is completely independent of the normal CPC character set. So a |CSYMBOL command has no effect on the normal-width characters; conversely, a SYMBOL statement does not affect the condensed type.

If you then save the MC program to diskette or cassette with SAVE"Name", B, start, 1087, the redefined characters are retained."



Links:
https://www.cpc-power.com/index.php?page=detail&num=16456
https://cpcrulez.fr/auteur-gerd_cebulla.htm
https://www.cpcwiki.eu/index.php/CPC_Magazin

Powered by SMFPacks Menu Editor Mod