Help for Jello Part 1
---------------------

The layout of the assembly program is not entirely obvious, as a lot of the
routines are in separate library programs. The layout of Part 1 is shown
below, where / denotes a macro being used and | denotes a subroutine being
called.

main
  |
  cls, rotate_jello, draw
         /
         rotation

draw / screen_jello / draw_jello

adr macro used throughout

Note that draw subroutine is actually assembled in JelloMain.

Program Flow
------------

1. main: Set up mode, palette, screen addresses, cursor, graphics origin
and mouse rectangle.

2. main loop: Get mouse coordinates and put into (xrot,yrot), cliping to
the range 0..360. Swap display banks and then call subroutines cls,
rotate_jello and draw in that order.

3. cls: Simply clears the screen by filling the screen memory with zeros.

4. rotate_jello: The jello in (xj,yj,zj) and (cenx,ceny,cenz) is rotated
through angles (-xrot,-yrot) into (xt,yt,zt) and (cenxt,cenyt,cenzt). The
centre co-ordinates are stored separately to ease jello calculations in
part 3, when the jello is jellified. The angles are negated for reasons
outlined in part 3.

5. draw: Subroutine screen_jello is called to project the jello from
(xt,yt,zt) and (cenxt,cenyt,cenzt) into (xjs,yjs), and then the jello is
moved to (0,0,zdist%) and projected into (xjs5,yjs5). Subroutine draw_jello
is then called to calculate which sides of the jello are visible using
(xjs,yjs), and how bright the visible sides should be using (xjs5,yjs5),
and then the visible triangles are plotted. The second set of projection
co-ordinates is used to calculate the illumination so the intensity of the
light seems to be the same however far or near the jello is to the viewer.

[Note jello in (xj,yj,zj) includes zdist% component in zj.]
