A Simple Warp-Driven Screensaver
Warps are fun, and they are easy, and powerful tools in the hand of the free-thinking programmer. We're going to see how much variation can be achieved with just a few cards, a few simple functions, using warps.
But first a series of paragraphs with more general comments.
When we program, we are not merely playing a game: we are expressing thoughts, and watching the structure of these thoughts when clothed in the shape of a formal language, and getting feedback from the millions of tiny electronical components as to what this structure really implies; what is within our thoughts--formally speaking--is spelled out. Or it is, at least, a formal illustration of a little part of our thoughts. And so this is a dialogue in the mind, that sharps the mind, and that calls on the machinery for this dialogue to take on ever-new heights.
But in order to have a dialogue with ourselves, engaging a machine, the machine must be well-defined; ie, it must have constraints.
The range of the standard full whole greentone screen as defined for all G15 PCs is 1024 pixels horisontally times 768 pixels vertically.
It is good practise to avoid pushing things all the way to the limits,--the X coordinate being max 1023 or so, is here typically set to 1000 or less. Especially when text is output, as it eats up pixels as it goes to the right.
The sequence, by the way, to give coordinates of the screen is, in an almost universal standard, X first then Y. Horisontal first, then Vertical. X is before Y in the alphabet, and H is before V also. So the position on the line of pixels is first, and then which line of pixels, vertically, is indicated. Good to repeat and memorize this sequence; makes things easier!
Why 1024*768? Because professional psychological stimuli is achieved by a squarish format of that kind. The widescreen is more inviting of distractions on the side of the screen; suitable for commercial ads, but not so much for professional work of many types. If you need all that much info on the computers simultaneously radiated into the room, have several computers beside one another. Better that, than stuffing it all into one computer.
The number 1024 is one that we learn to recognise when we program much: double 2 many times and you come to it.
The number 768 is three-fourths of it. So the 4:3 screen, or 3:4 screen, a bit wider than tall, is 1024 times 768. It was the original design of the IBM PC in the 1980s to have this format, and this was greentone for all professional works with texts: many psychological studies showed that the interaction between black and bright green is particularly conducive to good work. Of course, there wasn't all that much graphics variations at that time, and the PCs were very slow compared to what is the G15 PC assumptions. G15 PC is fast, but sticks to greentone, numbered 0..255, but with, in practise, only 64 greentone-steps assumed within this range, as this is enough to produce extremely beautiful renderings of photos of girls, waves, flowers, anything.
You see also that the G15 platform is full of a focus on the optimistic, the young, and that which gathers the coherence of your mind. It is a youth-oriented approach, and it has preteen, teen, and postteen fashionable beauty faces, and some sections of it has got it going a bit wilder.
In some cases, by the way, you want functions that are found eg in the Triangle Screensaver, in the large G15 GEM application, or somewhere else. You'll learn to find your way to these by using the Scan supplemental program at E99 {started within the G15 PMN High-Powered Terminal} on the beginning of the code in each case.
For instance, to draw a rectangle that is composed of four lines instead of a filled rectangle, you can use the simple routine in G15 GEM called SQUARISH, which calls on the draw-rectangle routine RT four times, but each time so that the filled ractangle is slim as a line.
Or, to draw triangles, you can use, and modify if you like, such as the Triangle screensaver {on top of the first utility menu page}. This uses trigonometric functions in a whole-number way to create filled triangles. Filled triangles, when drawn this way, hints of 3D, and indeed it is a quick pathway from filled triangles to emulating 3D. However we advice that unless it is of vital necessity, stick to things that are more elementary and near the flat square screen with its pixels and its essential elementary altogether clear and natural and obvious drawing algorithms.
Now, for the screensaver, as shown in the few cards starting with i:1, as displayed.
In the first cards, ACTION1 to ACTION7 are defined. These use only very simple, mechanical, squarely simple output routines, like RT, BX, RP and PX, and such. These make filled rectangles, or put text anywhere on the screen--BX in B9font, for instance,--while PX put a single pixel on the screen anywhere. Their input, in many cases, are by means of AF.
So AF picks a relatively free fluctuation generated number, also called a RFFG number, or, in more imprecise speech, a 'random' number.
Then the simplest form of a very short array is defined. It is called WARPARRAY. It can have any (meaningful) name of course.
By FF each of the ACTION1 to ACTION7 are located, in terms of the addresses in RAM, their warps.
Finally, a number between 1 and 7 is created by AF and AY gets the warp out of the array and PF performs it.
It remains to create the SCREENSAVER function: it has just two calls, and the second is RE, which jumps up one line and does the stuff again until any key is pressed on the keyboard.










