                            CONTINUING CODE CONCERNS

--  Use in-line asm wherever possible.

--  Comment well.

--  Consistent style.

--  Local register variables:

    -- often-used non-arrays
    -- make a local register copy of an often-used global non-array
    -- make a local register copy of an often-used global array element
    -- often-used combinations of variables (e.g. regxy=x+y;)
    -- do NOT make a local register pointer to a global or local array
    -- do NOT use a register variable for something that is only used
       once or is not used in a loop.  The overhead of setting up the
       register variable can be more than the RAM saved by using it.
       
--  Do not declare large arrays of initialized global variables.  Instead
    code them as lines of dc.w (dc.l) inside a function.  First array
    element is at function+4 (skip the "link #0,a6").  Set up global pointers
    to pseudo-arrays in startup().  All pseudo-data must be in main segment.

--   Global variables start as 0, so no need to initialize them.

--   All logical bytes 0/1, not 0/(-1)

--   Use "+=", "-=", etc. operators instead of "x=x+1"

--   For optimizing speed, avoid computations in 2nd clause of for loop.  
	  For example:

     for (i=0; i<(n+3); i++)

--   Stack tricks:  do not repeatedly push/pop arguments that are in common
     between function calls.  For example:

     test(x1,x2,y1,y2);
     test(x3,x4,y1,y2);

     can be better coded:

     asm { move.w y2,-(a7)    move.w y1,-(a7) }
     test(x1,x2); 
     test(x3,x4);
     asm { addq.l #4,a7 }

--   another stack trick:  use same register variable for all loop counters,
	  even if loops are nested:
	  
	  for (i=0; i<n; i++)
	  {
	  		...
			asm { move.w i,-(a7) }
			for (i=0; i<m; i++)
			{
				...(this code does not use the outer loop counter)
			}
			asm { move.w (a7)+,i }
			...
		}

--   use casting throughout

--   Replace arrays of defined offsets with structures.

--   { x= expression1 }
	  if (expression2)
	  { x= expression3 }

	  is shorter, but more time-consuming than
	  
	  if (expression2)
	  { x= expression3 }
	  else
	  { x= expression1 }
	  
	  so use the former only if expression1 doesn't take too long to evaluate.

--  int (*funcptr)();  then funcptr=&funcname;   then (*funcptr)(x,y,...)
	 This allows you to reuse functions for more than one purpose, if the
	 functions differ only in what functions they call.

--  use comma operator, especially in complex while-loops -- I think that it
	 can eliminate the need for duplicating some code inside & outside the loop.

--  a lot of code can be re-factored by cleverly using already existing funcs,
	 especially functions in thread.c and display2.c

--  According to K&R, expressions and'd or or'd together are evaluated
	 from left to right.  For and'ing, if any expression is 0, the rest
	 aren't evaluated, and for or'ing if any expression is 1, the rest
	 aren't evaluated.  This could simplify some things that I've coded
	 as nested ifs.  I've used nested ifs where the 2nd if would blow up
	 unless the first were true.

--  Use alt-click in RCS2 to find extraneous I-boxes throughout entire rsc.

--  Test: GDOS, German ST, Mega ST (with blitter), 520ST, new ROMs.

--  Use code improver, but not on pseudo-data.

--  Go through all modules, take care of any code marked with " !!!".

--  In RCS, sort all trees for smooth draws.

--  Don't put a break after last case of a switch -- wastes 4 bytes.

--  Use >> and << in place of * and / by powers of 2.

--  Use the ? operator:  x = ( a ? b : c) is the same as if (a) x=b; 
    else x=c;

--  Use unsigned data type wherever appropriate, helps avoid sign extension
	 errors.
