APPLICATIONSDIVERS ★ RSX CIRCLE ★

RSX - Circle (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 ★ 

THE CPC464 has a few rather simple graphics commands which Amstrad greatly improved when they brought out the CPC664 and 6128. However there is still one command they might have included — a circle routine.

Now you can draw circles with ease on any CPC with the program presented here. When run it sets up a new RSX called, as you've probably guessed, CIRCLE.

It requires three parameters. The first is the X radius, the second the Y radius and lastly the pen to draw it in.

It's actually a bit more powerful than a simple circle routine since both X and Y are given. If X and Y are the same you'll get a circle. However if they are different you'll get an ellipse.

To use it MOVE to wherever you want the centre to be and |CIRCLE,rx,ry,pen will draw the circle or ellipse. For instance, to draw a circle in the centre of the screen simply enter:

MOVE 320,200
|CIRCLE,100,100,2

Due to the poor pixel resolution in Mode 0 you won't get perfect circles if the radius is very small. The most accurate is the hi-res Mode 2.

The usual method of drawing circles is used where x=radius*COS(angle) and y=radius*SIN(angle) with angle running from 0 to 360. Since SIN and COS are very difficult in machine code I've cheated and used a sly trick to avoid them.

At the end of the code are two tables - one of all the SIN values and one of all the COS values that are required multiplied by 64.

So SIN(20) instead of being 0.342020143 becomes 22, or near enough as makes no difference. Negative numbers are marked by having bit 7 set.

The circle routine uses integer maths only and ends up with coordinates that are 64 times too big. It's a simple matter to divide by 64 to obtain the correct coordinates when the points are actually plotted.

CWTA

★ PUBLISHER: Computing with the Amstrad
★ YEAR: 1986
★ CONFIG: 64K + AMSDOS
★ LANGAGE: ???
★ LiCENCE: LISTING
★ COLLECTION: COMPUTING WITH THE AMSTRAD 1986
★ AUTHOR: ROLAND WADDILOVE
 

★ AMSTRAD CPC ★ DOWNLOAD ★

Type-in/Listings:
» RSX-Circle    (Computing  with  the  Amstrad)DATE: 2020-07-25
DL: 207
TYPE: ZIP
SiZE: 4Ko
NOTE: 40 Cyls
.HFE: Χ

» RSX-Circle    (Computing  with  the  Amstrad)    LISTINGDATE: 2013-05-05
DL: 244
TYPE: text
SiZE: 2Ko
NOTE:

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

Lien(s):
» Applications » Fonction Circle (CPC Revue)
» Coding Src's » Circle of Triangles (Computing with the Amstrad)
» Applications » RSX Turbo-Circle (Schneider Aktiv)
» Applications » Graphic - Draw Really Fast Circles On Your Amstrad (Popular Computing Weekly)
» Coding Src's » Graphic - Circle Writer (Amstrad Computer User)
» Applications » Jetzt geht's rund (CIRCLE Basic-Routine)
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 716 millisecondes et consultée 1991 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.