APPLICATIONSPROGRAMMATION ★ GRAPHIC - SPLIT MODES (COMPUTING WITH THE AMSTRAD) ★

Graphic - Split Modes (Computing With the Amstrad)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 ★ 

SOME of the best software around employs split mode screens in which the top half of the screen is usually Mode 0 whereas the lower half may be Mode 1 or 2.

The advantage of this is that it's possible to have both 16 colours and high resolution graphics - although they must be in separate halves of the screen.

The technique is used in adventures and arcade adventures to enable a 16 colour picture to be drawn in the top half of the screen and text to be printed in either 40 column Mode 1 or 80 column Mode 2 in the lower half of the screen. It might sound difficult but it's actually a lot easier to accomplish than you think.

Way back in the August 1985 issue of Computing with the Amstrad we saw how to use events - a pre-packed form of interrupt. To create a split mode screen display we use the same technique so if you're a bit fuzzy about events then have a read of that article.

The value of the first two bits in the mode and ROM enable register in the video gate array determine how the screen display is built up. Changing bits 1 and 0 to %00 sets the screen mode to 0, %01 is Mode 1 and %10 is Mode 2.

The alternate registers B' and C' are conveniently already set up for writing to the video gate array. The C' register contains a copy of the mode and ROM enable register. So we can switch to the alternate registers, set the appropriate bits of C' and write the new value with:

OUT (C),C

to change the mode.

What we do is to wait until frame flyback occurs, then set the screen mode. We wait as the screen display is built up and when the top half of the screen has been drawn, a fraction of a second later, we change mode. The lower half is built up according to this new mode.

To achieve this feat we write a short machine code event routine and put it on the frame flyback list. It will then be called as soon as frame flyback occurs.

The mode is set and another event routine initialised and placed on the fast ticker list. This routine is set to go off after the top half of the screen has been displayed and it sets the mode for the lower half of the screen.

Program I is a Basic listing which pokes the machine code into memory. The routine is enabled by calling &A000.

Program II is an Assembly listing. You'll see that it uses three firmware calls: &BCD7 initialises and places a block on the frame flyback list, &BCE0 initialises and puts a block on the fast ticker list and &BCE6 removes it.

The position of the split can be altered by poking &A034 with 2, 3 or 4. This is the delay for the fast ticker event. You may think that this is all there is to it but it isn't quite the end of the story.

Changing these bits alters how the hardware looks at the screen memory but it does not affect the firmware at all. So although you may change from Mode 0 to Mode 1 by writing to the mode and ROM enable register, the firmware - Basic and the lower ROM - still think you're in Mode 0.

They get very confused when you try to print or draw something. For instance, the firmware would think that there were still only 20 characters per line and that there were 160 pixels across the screen. You can see how muddled it would be if there should be 40 characters and 320 pixels across.

We need to be able to write to both sections of the screen, whatever mode they may be. This would be possible if we could change mode without affecting the screen display.

By changing to Mode 0, or whatever mode we've selected, we could write to the top half of the screen, then change mode without clearing or altering the screen in any way and write to the bottom half of the screen.

To do this we need to change one of the screen pack indirections SCR MODE CLEAR at &BDEB. It points to a routine in the lower ROM which, among other things, clears the screen.

The indirection is altered so that it enters the routine after the code which clears the screen, so it does everything but clear the screen. This doesn't affect CLS which can still be used to clear the screen.

There's no excuse for dull adventures and arcade games now - use a split mode screen.

CWTA

★ PUBLISHER: Computing With The Amstrad
★ YEAR: 1986
★ CONFIG: 64K + AMSDOS
★ LANGUAGE:
★ LiCENCE: LISTING
★ COLLECTION: COMPUTING WITH THE AMSTRAD 1986
★ AUTHOR: ROLAND WADDILOVE
 

★ AMSTRAD CPC ★ DOWNLOAD ★

Type-in/Listings:
» Split  Modes-ROLAND  WADDILOVE    LISTINGDATE: 2013-09-15
DL: 312
TYPE: PDF
SiZE: 168Ko
NOTE: 2 pages/PDFlib v1.6

» Split  Modes    (Computing  with  the  Amstrad)    ENGLISHDATE: 2020-07-23
DL: 247
TYPE: ZIP
SiZE: 4Ko
NOTE: 40 Cyls
.HFE: Χ

» Split  Modes    (Computing  with  the  Amstrad)    LISTINGDATE: 2013-05-05
DL: 332
TYPE: text
SiZE: 2Ko
NOTE:

Je participe au site:
» Vous avez des infos personnel, des fichiers que nous ne possédons pas concernent ce programme ?
» 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 142 millisecondes et consultée 2308 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.