APPLICATIONSPROGRAMMATION ★ Round and round ★

Graphic - Draw Really Fast Circles On Your Amstrad|Popular Computing Weekly)CirclesGraphic - Circle|The Amstrad User)Graphic - Circle Writer|Amstrad Computer User)
★ 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 ★ 

Draw really fast circles on your Amstrad with the help of B J Wathelet

There have been several routines published already about drawing fast circles on the Amstrad. . . but these are really fast! They work by first Pokeing the coordinates of a given 90 degree arc and then Drawing the complete shape from machine memory.

Both programs are quite memory consuming but can be shortened considerably in actual use. They are shown here with safeguards to prevent crashing and to demonstrate how they work.

With Program One set any Mode,Run and the screen will clear as values are Poked. x%&y% are integers 0-255 and st= 9 is about the best for quick circles/ ellipses, although any value can be tried to give squares, octagons etc.

Once the values have been Poked and the circle or what-ever Drawn, subsequent Run commands skip straight to the Draw section of the routine.

Moving the Origin means, of course, that the shape can be Drawn any number of times anywhere on the screen.

All that really differs between Program Two and the first listing is in the Draw routine. Here, step st must be smaller by several times.

This routine (as 1) sets the variables to suit, and Pokes then Draws, filling the shape from left to right.

If, in either program, you break whilst values are being Poked, strange things may happen when the program is run. If this does occur, reset the memory by entering variables for a larger shape in Mode 2.

Program One - Circles

  • orx%, ory% Coordinates of origin.
  • x%,y% Radii of circle/ellipse:Integers 0-255
  • st Step size:In degrees
  • a Angle in 90 deg arc POKE routine
  • c Count in 90 deg arcPOKE routine
  • b Count in main DRAW routine
Line No

100 Sets variable, Deg mode & Origin
110 Checks st,x%,y% (&HIMEM). If they agree with those in memory goes to Line 160 and Draws, if new values have been entered then sets new HIMEM.
120 Sets a&c to zero which is important when using the routine more than once in a program. It also Pokes x% and y% values.
130-150 Poke new values for the 90 deg arc.
160-200 Draw the complete shap anticlockwise from 9 o'clock.

Program Two - Discs

100 As 1 but branches up to 240 to set the step size to ensure that all lines are drawn adjacent to each other.
110 Sets the step to suit the pixel width in different MODEs.
120-170 As listing 1.
180-230 Plot and Draw lines point to point across the shape as defined in the Pokes. Draws from left to right.
240- These contain step sizes st, all factors of 90 to give the quickest completely filled shapes corresponding to the radii.



PopularComputingWeekly850321

★ PUBLISHER: POPULAR COMPUTING WEEKLY
★ YEAR: 1985
★ AUTHOR: B.J.Wathelet

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