APPLICATIONSDIVERS ★ XCOL ★

RSX Xcol (Computing With the Amstrad)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 ★ 

XCOL is a program that allows you to display more than the legal number of colours on the screen in any mode on the CPC series.

Impossible? Not quite. Perhaps you've seen the mode switching trick used in Sorcery that sets the upper part of the display to Mode 0 and the lower part to Mode 1? Well this program does a similar thing with palette switching so that the values of the inks may be varied on different parts of the screen. It doesn't change mode to do it.

Type in Program I which is the Basic loader for the machine code. Save it before trying to run it because it will erase itself from memory once debugged.

You will now find three extra commands added to Basic - |XCOL, |XDIS and |SETHT,n where n is a parameter. |XCOL enables the new facility, |XDIS disables it and |SETHT allows some control over the position of the switching.

Having typed |XCOL you will find that the normal INK and BORDER commands act in a slightly different way. Normally issuing an instruction such as BORDER 0,1 would set the border flashing between colours 0 and 1 - black and blue.

With XCOL enabled the same command would set the top part of the border to the first colour and the bottom part to the second. INK 1,22,26 will produce a similar result with anything written with PEN 1, and so on.

|SETHT expects one parameter of value 0, 1 or 2 which will vary the level of the split to either 1/3 ,1/2 or 2/3 of the way down the screen.

|XDIS will disable XCOL and restore all inks as they were before XCOL was used. Further use of XCOL will resume use of the ink values employed the last time XCOL was in operation. Therefore if you are writing a program that runs with XCOL disabled for part of the time you will need to define the inks twice - once in the usual fashion and again after |XCOL has been executed.

There are a few points to note before using XCOL in your own programs:

  • The horizontal division does not fall exactly on the boundary between two text lines.
  • ake the dividing line visible by typing BORDER 0.1 :INK 0,1,0. If you are lucky the line will be steady and will not jitter when you press a key. If you aren't lucky the division will appear to waver by one graphics line vertically, accentuated by key presses. It is the luck of the draw when you switch on whether or not you get a steady line.

    For these two reasons it is best to avoid producing screen displays where the dividing line is made plainly visible. In other words, keep your background and border colours the same in both halves of the screen and avoid putting graphics or text over the split.

  • During disc or cassette operations your Amstrad disables interrupt routines. If this happens with XCOL enabled the result will be unsightly because normal ink handling is temporarily restored. When XCOL reactivates it will probably be out of sync with frame flyback. It is therefore advisable to first disable XCOL when using cassette or disc.
  • Don't assume that XCOL is compatible with commercial software. The worst thing that can happen is a crash. I found this to be the case with the text editor in Maxam - it doesn't like the substitute screen clearing routine which is used whenever XCOL is enabled.

    There's nothing to cause any great hardship there, just so long as you are aware of the limitations.

Program II gives the source code. It works using a fast ticker interrupt, which occurs every 1/300 of a second. A frame flyback happens every 1/50 second, so that during one frame cycle there are six fast ticker interrupts.

Fast tickers are synchronised with frame flyback so it is possible to set up an interrupt to change the values of the inks while the cathode ray beam is only part-way down the tube. When the beam reaches the bottom of the screen - at frame flyback - the interrupt routine changes the values back, ready to refresh the top part of the display.

The values of the inks and border are stored in the operating system workspace in the form of two lists known as vectors. Two vectors are required because each ink can be set to two colours when flashing. XCOL takes its ink values from the same two lists but uses the second one for inks to be displayed on the lower part of the screen.

When enabling or disabling XCOL the contents of the vectors are swapped with those in a buffer so that you can work with two different sets of inks depending on whether or not XCOL is being used. The address of the vectors depends on which model of CPC you are using, but the program sorts that out for itself.

The machine operating system has its own arrangements for refreshing the screen display and some of the routines involved compete with XCOL to produce unsightly effects. You can't alter the guilty sections of program because they thumb their noses at you from the safety of ROM.

This mainly causes problems when changing mode, or would do if I hadn't substituted a screen clearing routine that favours XCOL. This is the bit that Maxam - and who knows what else - doesn't get on with, so be careful.

An example of how XCOL could be used would be with a graphic text adventure where the text could be printed in two or three colours in one part of the screen and the picture could employ three different foreground colours in the other part. This would help to avoid the monotony of four colours using Mode 1 as you could effectively display seven colours.

Another possible use would be in a screen or sprite designer where, by using Mode 0, it would be possible to display all 27 colours for comparison when making an initial pallette selection. Program III is an example of displaying all 27 colours at one time. I hope you find this utility as useful as I have.

CWTA

★ PUBLISHER: Computing With The Amstrad
★ YEAR: 1986
★ CONFIG: ???
★ LiCENCE: LISTING
★ COLLECTION: COMPUTING WITH THE AMSTRAD 1986
★ AUTHOR: Ian C. Sharpe
 

★ AMSTRAD CPC ★ DOWNLOAD ★

Type-in/Listings:
» RSX-XCOL    (Computing  with  the  Amstrad)    ENGLISHDATE: 2020-07-23
DL: 195
TYPE: ZIP
SiZE: 5Ko
NOTE: 40 Cyls
.HFE: Χ

» RSX-XCOL    (Computing  with  the  Amstrad)    LISTINGDATE: 2013-09-17
DL: 228
TYPE: PDF
SiZE: 438Ko
NOTE: 3 pages/PDFlib v1.6

» RSX-XCOL    (Computing  with  the  Amstrad)    LISTINGDATE: 2020-07-23
DL: 232
TYPE: text
SiZE: 3Ko
NOTE:

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

Lien(s):
» Applications » 90 colunas no ecrã (Amstrad Magazine)
» Applications » Sean Mcmanus Software Collection
» Applications » The Micro Collection
» Applications » Magic Colour
» Applications » CHARLEYTRONIC of System-D Source Code Collection
» Applications » Paper Colour Mixer (Amstrad Computer User)
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 160 millisecondes et consultée 1738 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.