******************** Multi-Task Sample Engine for the TI-82 *****************

I.  Introduction
II.  Installation
III.  Running the Programs
IV.  Internal Workings
V.  Credits
VI.  Conclusion


I.  Introduction
  If you have ever played any game or run Windows on a computer, you have
used a multi-tasker without knowing it.  Multi-taskers can run multiple tasks
at almost the same time.  Usually each task is given around 50 milliseconds
to execute.  This type of multi-tasking isn't possible on the TI-82 graphing
calculator.  However, I have written a sample piece of code that comes as
close to multi-tasking as is possible for TI-Basic.  I got this idea after I
had written a similar piece of code for QBasic.  Enjoy!



II.  Installation
  If you didn't extract the zipfile into its own directory, do so.  Then copy
all the files to your calculator using your link software.  Run the program
MULTTASK.

WARNING:  Running any other program besides MULTTASK could cause an error...
if this happens, I am NOT to be held responsible in any manner.



III.  Running the Programs
  To run the different programs, just press the [ Y= ] key to add tasks.  To
end a task early, just press [MODE].  Once there are no more tasks left, you
can add a task or quit the demonstration.  You must be running MULTTASK to
run the different programs.



IV.  Internal Workings
  A multi-tasking engine has to be able to do two things:
1)  Start up tasks...each task must initialize themselves.
2)  Make sure each task won't conflict with another.

  Matrix [E] has the following layout that enables the multi-tasking engine
to work:

[E] = row 1 = {Running (0), Uses Home Screen (0), Uses Graphics Screen (1),
               Active (0), Variable 1 (0), Variable 2 (0), ...,
               Variable 11 (0)}
      row 2 = {Running (0), Uses Home Screen (0), Uses Graphics Screen (0),
               Active (0), Variable 1 (0), Variable 2 (0), ...,
               Variable 11 (0)}
      row 3 = {Running (0), Uses Home Screen (0), Uses Graphics Screen (0),
               Active (0), Variable 1 (0), Variable 2 (0), ...,
               Variable 11 (0)}

  If you will notice, the program in the row 1 position has first priority in
the multi-tasker.  Position 4 is mainly used to determine which program has
the right to get keyboard input and also which program can put things on the
screen.
  Positions 2 and 3 restrict which programs can be run at a time.  If one
program uses the home screen a lot you will want a 1 in the #2 position. If
another program has a 1 in the same spot, you will not be able to run both at
the same time.  Same thing occurs in the #3 spot.
  The #1 position tells the multi-tasker if the program is running.  You can
store a 2 in this position after you initialize the program...this way you
don't re-initalize the program every time the multi-tasker loops.  See
ASTEROID for an example of this.



V.  Credits
    Name                              E-mail Address
-----------------------------------------------------------------------------
Thomas J. Hruska                     thruska@tir.com



VI.  Conclusion
  I now release this program as public domain.  Programmers, I ask that you
give me credit for the idea of multi-tasking if you use this program.  Also,
when transferring to other people's calculators, leave the write protect
attribute on any program using the multi-tasking engine.

Thomas J. Hruska
thruska@tir.com
shinelight@geocities.com
http://www.geocities.com/SiliconValley/Heights/8504

Shining Light Productions
"Meeting the Needs of Fellow Programmers"
C/C++
TI-BASIC
JavaScript
QuickBasic
HTML
