APPLICATIONSDIVERS ★ EXTENSIONS ... EXPANDED BASIC FOR THE CPC464 (HOME COMPUTING WEEKLY) ★

Extensions ... Expanded BASIC for the CPC464 (Home 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 ★ 

This useful program from J Keneally shows how the prowess of the Amstrad CPC464 can be enhanced using a set of expanded Basic commands

You may not be able to get a new ROM to upgrade your CPC464 to a 664, but this is the next best thing — a set of expanded Basic commands which simulate many of the extra 664 commands, and also add some additional goodies not even available to 664 users!

The extra commands

These arc installed as Resident System Extensions (RSX), as described later. As with all RSX commands, they must be preceded by a vertical bar character (Shift @, and followed by exactly the right number of parameters for that command. Examples arc given below.

Graphics commands

The usual MOVE, MOVER, PLOT, PLOTR, DRAW, and DRAWR commands are not able to directly set the graphics write mode, i.e. whether the graphic is written in Replace, Exclusive OR, normal OR, or AND modes. As most will know, the screen data is held in the screen memory, so it is possible to merge new data onto the existing screen in several ways.

The simplest is just to replace what was there previously by the new graphic, but many times it is useful to be a bit more subtle. Of particular use is the Exclusive OR method, as this has the property that if you write the same information twice in exactly the same way, after the second write the screen will be restored to the same state as it was before the first write. This is very useful to, for example, make a sprite pass in front of a background object
(or behind it, come to that!).

Another restriction is that the MOVE commands will not accept a pen colour. The expanded commands will all accept both pen and write mode parameters as follows:—

|MOVE,x,y,p,w
|MOVER,dx,dy,p,w
|PLOT,x,y,p,w
|PLOTR,dx,dy,p,w
|DRAW,x,y,p,w
|DRAWR,dw,dy,p,w

where x = xcoord, y = ycoord, dx,dy = x,y offsets p = pcn, w = write mode (0 = Replace, 1= Exclusive OR, 2 = AND, 3 = OR)

Note that the ! character has been used instead of the vertical bar. as this cannot be printed.

Cassette Commands

The normal cassette commands all insist on saving file-structured data complete with gaps between records, file headers, and so on. However, it is very useful to simply save or load a section of memory as a single continuous record. This is done with: —

|DUMP,address,length
|LOAD,address,length

where the parameters are the start address, and the number of bytes. You must supply both of these, otherwise strange results will occur.

The other extra cassette command is an expanded CAT instruction:— 'CAT This works in a similar way to the normal CAT, giving a catalogue of a tape, but with much more information including load address, entry address (for code segments), file type, number of bytes in the block, the state of the Protect bit, and the block number. All numbers are printed in hexadecimal.

File type is:—

0 = Basic
1 = Binary
2 = Screen image
3 = ASCII
4-7 Undefined

Protect bit is 1 if protected. Occasionally it is useful to be able to flush out the keyboard input buffer, effectively causing the computer to wait until no keys are being pressed. This can be tricky in Basic, due to the debounce delays etc. As in the 664, this is done with the command:— |CLEARINPUT Reading a character from the screen can be a handy trick, for example for detecting the presence of an object on the screen or overwriting and restoring an area of the screen. Although the 464 operating system has a routine for this, it is not implemented as a Basic command. The extended command is of the form: — !COPYCHR,@AS where AS is any string.

The ©character is essential! It allows a$ to be loaded with the screen data starting at the current position of the cursor. The string aS should be set up initially with the number of characters you want to read along the line. For example: aS = STRING$(5,32):!COPY CHR, AS would read 5 characters from the screen, advancing the cursor by 5 places.

Finally, it is possible to wait for the start of a screen scan.

This can also be done using CALL&BD19, but it is much easier to remember: |FRAME as the equivalent BASIC command.

The command is used to synchronise software action with the screen, e.g. to prevent flicker on sprites.

Installing the program

The BASIC listing is used to install the machine code for the extended commands. After typing it in, run it to create the code segment, and then save the code for later use using the command: SAVE“UP464”,B, 43302,585 As well as creating the code, the BASIC program does a CALL 43302 in line 70 to activate the expanded commands. On subsequent occasions, you will find it quicker to load the code segment alone, rather than BASICprogram.Dothisby using MEMORY 43301: LOAD“” Then activate the extra command using CALL 43302.

Remember that the vertical bar character typed in front of any extra command is actually (SHIFT @ on the keyboard.

Conversion

This uses the special properties of the CPC464, so conversion to another machine is not practical.

Home Computing Weekly #125

★ EDITEUR: Home Computing Weekly
★ YEAR: 1985
★ CONFIG: 64K + AMSDOS
★ LANGUAGE:
★ LiCENCE: LISTING
★ AUTEUR: John KENEALLY
 

★ AMSTRAD CPC ★ DOWNLOAD ★

Type-in/Listings:
» RSX-Expanded  BASIC  for  the  CPC464    (Home  Computing  Weekly)    LISTING    ENGLISHDATE: 2017-02-12
DL: 245
TYPE: PDF
SiZE: 108Ko
NOTE: Uploaded by hERMOL ; 1 page/PDFlib v1.6

  » RSX-Expanded  BASIC  for  the  CPC464    (Home  Computing  Weekly)    LISTING    ENGLISHDATE: 2024-03-31
DL: 7
TYPE: text
SiZE: 3Ko
NOTE: Uploaded by CPCLOV ;

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

Lien(s):
» Applications » RSX Text (Compute Mit)
» Applications » Univ-Rsx (CPC Amstrad International)
» Applications » Graph Pack
» Applications » RSX Scroller v4.0
» Applications » RSX - 3D Characters (Amstrad Action)
» Applications » RSX Ltext (CPC Magazin)
Je participe au site:
» 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 327 millisecondes et consultée 1463 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.