APPLICATIONSPROGRAMMATION ★ FAST FILL ★

Fast Fill|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 ★ 

IN the September 1986 issue of Computing with the Amstrad Chris Ratcliffe showed us a routine to fill any shape, no matter how intricate, with any colour. This is for C PC464 owners of course - 6128 owners have their own built-in fill command.

Unfortunately the CPC464 fill routine is rather slow. The problem is that it's a legal fill using the Amstrad approved and documented firmware calls.

This Fast Fill routine doesn't use the firmware, but simply peeks and pokes the screen memory.

The result is that the code is only half as long yet it runs up to 12 times faster. To fill a shape first move to the start position and:

  • CALL &9E00,pen
The fill stops when it hits its own colour, so if you wanted a red flower draw the outline in red and fill it with r^d.

You can't draw a shape in one colour and fill with another - they both have to be the same. That's not a bug in the routine, it's the way the CPC6128 fill works so I've merely kept it the same.

There is one restriction though. Make sure that there aren't any gaps in the outline or the fill will leak out. It will colour the rest of the Amstrad's memory given half a chance.

When Fast Fill is run HIMEM is moved down to &9E00 to make room for the code and workspace. The routine is less than a page long and is followed by 1 k of workspace.

You can use the workspace from &9D00 onwards as a scratchpad, but remember that Fast Fill will use it when called, so don't store anything there that you want to keep.

CWTA

★ PUBLISHER: Computing With The Amstrad
★ YEAR: 1986
★ CONFIG: 64K + AMSDOS
★ LANGUAGE:
★ LICENCE: LISTING
★ AUTHOR: ROLAND WADDILOVE

CPCrulez[Content Management System] v8.7-desktop/cache
Page créée en 058 millisecondes et consultée 716 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.