APPLICATIONSPROGRAMMATION ★ STRETCH YOUR CHARACTERS ★

Graphic - Stretch your Characters-double height basic loader (Personal Computer News)Applications Programmation
★ 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 ★ 

Stretch your letters to their full height with this easy routine for the Amstrad from John Keneally

This machine code program for the Amstrad CPC464 allows you to print double height characters on the screen, for use both in games and serious software. The characters can be printed in windows and can be user defined using symbol as normal. Used for headings, they give a professional look to your software.
As well as providing a useful facility to the Basic programmer, the assembly language 1 isting demonstrates the use of many of the Amstrad's powerful features, including some ROM routines.

To get it running, type in the Basic Loader listing, taking particular care with the DATA statements (don't confuse 8's with B's), and then save it onto tape. When run, the screen should clear and the program is ready to use.

There are no messy calls to machine code from now on. All that is required is to type print chr$(264> to turn on double height printing, and print chr$(255) to revert back to normal printing. These characters no longer print and are used as control codes by the software — so redefining these will have no useful effect.

Obviously, by mixing these characters in a print string, it is possible to print double and normal height characters on the same line. The only restriction is that double height characters cannot be printed via the tag command.

The program will work in all three modes as the short demo program listing shows. In Mode 0 you get double size characters, in Mode 1 you get double height characters, similarly in Mode 2.

The program operates by intercepting the operating system's character output routine. The character codes 254 and 255 are used to turn the routine on and off, and internally these are used to print a double height character as follows. If the routine is turned off, then the character to be printed is sent to the normal ROM routine.

If the routine is on, then the matrix for the particular character is looked up in theROM(orRAMifitisuserdefined)via an OS routine at bb as, which returns the start address of the matrix for the character in the 'A' register in the HL register pair. This matrix is then copied to reserved RAM, but each line is copied twice — giving 16 lines in all.

Character 254 is defined as the top eight lines, and character 255 is defined as the lower eight lines, by loading the ASCII code into the A register and the address of the matrix into HL and calling the OS routine at bbas.

Having defined these characters, the cursor position is obtained by calling bb78 and moved up a line, the top of the character is printed — code 254, and then the cursor position is restored and the bottom half of the character — code 255 is printed.

Control codes are always printed as normal whether or not double height is on or off (so that they are not printed twice which could cause havoc). The exception to this is the line feed character; if this is printed, an extra line is skipped to account for the extra height of the characters.

Although the software will work in direct mode, it is advisable to use it only from programs where you know where the output is being sent. Also note that lines input by the user will always be printed in normal height, regardless of whether the routine is on or off.

Personal Computer News#92

★ EDITEUR: Personal Computer News
★ YEAR: 1985
★ CONFIG: 64K + AMSDOS
★ LANGUAGE:
★ LiCENCE: LISTING
★ AUTEUR: John Keneally
 

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

Lien(s):
» Applications » Variable Height
» Applications » Enlarged-Height Character Generator (Amstrad Computer User)
» Applications » Height (Amstrad Action)
» Applications » Graphic - Double Height Characters (The Amstrad User)
» Applications » Height (Amstrad Action)
» Applications » Fast Basic double-height
Je participe au site:

» 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 437 millisecondes et consultée 1643 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.