APPLICATIONSDIVERS ★ CHARACTER EXPANSION ★

Rsx - Character Expansion (Popular Computing Weekly)Applications Divers
★ Ce texte vous est présenté dans sa version originale ★ 
 ★ This text is presented to you in its original version ★ 
 ★ Este texto se presenta en su versión original ★ 
 ★ Dieser Text wird in seiner Originalfassung präsentiert ★ 

An advantage of the Amstrad's bit mapped display is that text can be mixed with graphics in any of the three display modes. However, It would often be useful to be able to alter the size of the text characters displayed, for use in title screens, menus, and other displays. This Is the facility that this program gives you. via two new commands.

Type in, save and run the Basic Loader program, taking care with the Data statements. If you haven't made any mistakes entering the code you will get a message informing you that the new commands have successfully been loaded Now type in the short demonstration program, to get an idea of what the commands can do. This demo program simply displays the letters 'PCW' in all possible sizes in all three modes.

The two new RSX commands are called |CSIZE and |DISPLAY, the syntax of them is as follows:

|CSIZE,xmag,ymag

Where xmag is the horizontal magnification factor, and ymag is the vertical magnification factor. So to get triple height, double width characters you would type |CSIZE,2.3. Note the T before the command name, this tells Basic that the command is an external RSX command ('|' is obtained using Shift @). Also note that there is a comma immediately after the command name. Xmag and ymag must be in the range 1 to 7. Obviously. using |CSIZE,1,1 would give characters of the normal size.

Once you have set the size of characters, a string is printed using the DISPLAY command. So if X$ is a string containing the message to be printed, the syntax of the command is:

|DISPLAY,@X$

The is necessary before the string variable name to pass the string descriptor (containing the length and start address of the string) to the machine code routine. The string is displayed from the current cursor position, so you can use the normal LOCATE command to position the text. The characters are printed with their top left hand corners at the cursor position. Take care not to cause the screen to scroll within a DISPLAY command, ie. do not try to print the expanded characters too low down the screen, otherwise each section of the expanded character will be printed on a separate line.

There are no restriction on the use of the new commands, they can operate in all modes, and the characters in the string can be user-defined if you wish - using the normal SYMBOL command. The character size set by |CSIZE is with respect to the normal character size for the current screen mode. So CS/ZE2,1 will give mode 1 size characters in mode 2, and mode 0 size characters in mode 1 The characters are displayed in the current pen and paper colours. One point to note is that the program uses character number 255 -chr$(255) - internally, so this must always be a user-definable code, codes 0-254 can be ROM based. Also there is no point in trying to use CHR$(255) in your own programs as the routine redefines it to display the expanded characters.

The assembly language listing is included to show how the program actually operates, and this is fully commented. The main routine is called PRTCH: this prints an expanded character at the current cursor position. The routine first copies the matrix for the required character from ROM or Ram into its own workspace, next it expands it vertically by the current value of MULTY(set by |CSIZE). Finally, it expands each byte horizontally and defines chr$(255) as part of the expanded character - this is then printed using the normal ROM print routine. This process of defining chr$(255) and printing it goes on until the whole of an expanded character has been built up and printed. Once a character has been printed, the cursor position is updated to be ready for the next character So successive DISPLAY commands, without using LOCATE between them will cause each string to be printed one after another Note that control codes cannot be used within a DISPLAY string.

The CSIZE routine forces the xmag and ymag parameters to lie in the range 0-7 by an AND 7 command, and then ignores the result if it is zero. Bigger sizes could have been used with only a little more memory, but characters seven times their normal size should be big enough for anyone!

PopularComputingWeekly860522


★ PUBLISHER: POPULAR COMPUTING WEEKLY
★ YEAR: 1986
★ AUTHOR: Brian Cadge

★ AMSTRAD CPC ★ DOWNLOAD ★

Type-in/Listing:
» RSX-Character  Expansion    (Popular  Computing  Weekly)    LISTING    ENGLISHDATE: 2017-05-11
DL: 280
TYPE: PDF
SiZE: 237Ko
NOTE: Uploaded by hERMOL ; 3 pages/PDFlib v1.6

★ AMSTRAD CPC ★ A voir aussi sur CPCrulez , les sujets suivants pourront vous intéresser...

Lien(s):
» Applications » RH-Buero/RH-Büro
» Applications » Mona -> Maxam Converter (CPC Amstrad International)
» Applications » Microgesa - Loto
» Applications » Compilation: Robot PD AMS87/PowerPage v1.3
» Applications » ESAT Software - Hercule 1
» Applications » RSX Multicol (CPC Magazin)
Je participe au site:
» Pour ce titre nous ne disposons de fichier executable sur CPC (Dump, Saisie du listing) , alors si vous avez ça dans vos cartons ou vous désirez usé vos petit doigts boudinés sur votre clavier faites le nous savoir.
» Vous avez des infos personnel ?
» Vous avez remarqué une erreur dans ce texte ?
» Aidez-nous à améliorer cette page : en nous contactant via le forum ou par email.

CPCrulez[Content Management System] v8.7-desktop/c
Page créée en 352 millisecondes et consultée 1641 fois

L'Amstrad CPC est une machine 8 bits à base d'un Z80 à 4MHz. Le premier de la gamme fut le CPC 464 en 1984, équipé d'un lecteur de cassettes intégré il se plaçait en concurrent  du Commodore C64 beaucoup plus compliqué à utiliser et plus cher. Ce fut un réel succès et sorti cette même années le CPC 664 équipé d'un lecteur de disquettes trois pouces intégré. Sa vie fut de courte durée puisqu'en 1985 il fut remplacé par le CPC 6128 qui était plus compact, plus soigné et surtout qui avait 128Ko de RAM au lieu de 64Ko.