     ZTETRIS v1.5 -   by Jimmy Mrdell  <yarin@acc.umu.se>
                      Sam Heald <evil_sam@hotmail.com>
                      Patrick Davidson <eeulplek@hotmail.com>

	Ti-83 Version by Ahmed El-Helw <ahmed.ticalc.org>

	Note - Please read the revision history. Thanks.

			M A R C H   1 9 9 9

FEATURES
--------
 * 21 levels (0-20). You can choose which level to start between
   (only start on level 0-9 though).

 * 16 different level patterns!

 * Hiscore table with names! The three best results are saved.

 * Teacher key! If you see your techer heading your way, quickly
   press the teacher key to return to TI-OS, and when you start
   the game the next time, you'll automatically resume where you
   was. If you run it from a shell however, it returns to the
   shell instead. But that's your problem, not mine :)

 * Linkplay! Play against each other and kick some butt! The link
   protocol is the same as in ZTetris for the 86 and Tetris for Fargo,
   so you could link an 82 to an 85, 86, or a 92 and play against each other!

 * The scoring is almost the same from the Game Boy version. The last digit
   in the score isn't shown (you could think of it that way anyway) because
   of several reasons. Unlike the ZShell version, you also score for
   dropping or moving down a piece.

 * You can start with trashlines. It's different from the gameboy version
   though, because there is no win-when-cleared-25-lines.

 * In linkplay, you can choose if you want to get scrambled (as in Tetris
   for Windows) or unscrambled (Tetris for Gameboy) lines.

 * Rotation in both direction. You can pause the game (1 player)

CONTROL
-------
Choosing players:    Up/Down      - Change number of players
		     1/2          - Choose that number of players
		     Clear        - Quit

At the option menu:  Arrowkeys    - Choose level
		     Enter        - Start level
		     S            - Toggle "2-4 lines", "1-3 lines" (LP only)
		     L            - Toggle scrambled/unscrambled lines (LP)
		     Trace        - Decrease start high
		     Graph        - Increase start high
		     Clear        - Quit game

When playing:        Left & Right - Move the piece to the left and right
		     Up & 2nd     - Rotate clockwise
		     Down         - Move the piece faster down
		     xto          - Drop key
		     Alpha        - Rotate anti-clockwise
		     Clear        - Quit game
		     Mode         - Pause
		     Del          - Teacher key. Quickly jumps out to
				    TI-OS. The game will resume when you
				    start it the next time.

When typing name:    A-Z, Space   - Enter letter (max 10 chars)
		     Enter        - Continue
		     Left arrow   - Backspace

SCORING
-------
	   L 0    L 1   L 2   L 3   L 4   L 5   L 6   L 7   L 8    L 9
1 line   |    4 |   8 |  12 |  16 |  20 |  24 |  28 |  32 |   36 |   40 |
2 lines  |   10 |  20 |  30 |  40 |  50 |  60 |  70 |  80 |   90 |  100 |
3 lines  |   30 |  60 |  90 | 120 | 150 | 180 | 210 | 240 |  270 |  300 |
4 lines  |  120 | 240 | 360 | 480 | 600 | 720 | 840 | 960 | 1080 | 1200 |

When dropping a piece, your score will increase with dropsteps/10 (the
last digit will remain in memory, although not shown). Every time you
move the piece down (with the down key) you will increase the score with
0.1.

LINKPLAY
--------
To play linkplay, first connect two TI-83's (or connect the TI-83 to a
TI-82, TI-85, TI-86, or a TI-92) and choose two player mode. The level selection
menu looks slightly different. Besides from choosing which level to start at
(the two players can start at different levels), you can choose how many
penalty lines should be sent to the other calc when clearing lines. Either
you send 2-4 lines (if you get 2-4 lines) or 1-3, ie one line less than you
cleared. This option can also be different on both calcs, thus allowing
handicap. You can also toggle if you want to get unscrambled penalty lines
or scrambled penalty lines. If choosing unscramble (defualt), the lines sent
to you will only have one gap, making it much easier than getting totally
scrambled lines.

Press Enter to start the game. Now the calc will go into waiting mode and
wait until the other player has reached this mode. When one player enters
the waiting mode, the other player MUST have started ZTetris (or be in an
assembly shell) because else the game would start immediately for the first
player. If you link with a TI-82 or a TI-85 or a TI-86 or a TI-92, the other calc must enter Waiting mode first.

Now the fun begins!

You play as you usually do, but when you clear 2 or more lines, the other
opponent will get penalty lines depening on how many lines you cleared and
the option choosed when selecting startlevel.

There is also a bar telling how high up in the playing field your opponent
is (it's not visible in the beginning since the field is empty). This is
good when choosing strategy.

When a player loses, or aborts the game, a "You won" message will appear
on the other calc.

You can't pause or use the teacher key in two player mode, and you can
neither enter the hiscore table (even though score is counted)

When you play against an 85/86 know that the 82 version runs slightly
faster than those versions. Set the 85/86, one level higher than the 82
to even things out.

KNOWN BUGS
----------
 * Don't pull out the linkcable while playing twoplayer! The calcs
   may freeze a few seconds (not crash).
 * The linkplay probably isn't that stable, and the calc may freeze
   sometimes for a short time. It is also possible that one player
   may "miss" some penalty lines :) See this as a feature instead hehe :)

VERSION HISTORY
---------------
1.0  First release version. No next piece shown (I think...)
1.1  Added next piece + some other things (don't remember)
2.0  Linkplay, dropkey, clear screen when pausing, fixed teacher key bug,
     better random routines and other details
2.1  Possibility to start with "High", toggle between scrambled/unscrambled
     lines in linkplay, huge linkplay improvement, background patterns
2.11 Fixed a bug which causes the calc to crash when you pressed Exit
     when waiting on the other calc (the crash happened when you run
     ZTetris the next time).
3.0  Optimized ZTetris to fit Usgard. Better scoring system.
*************CONVERTED TO THE 82***********************
0.9   First 82 release. No background patterns.     
      SIZE:3114

0.91  Added background patterns.                    
      SIZE:3509

0.92  Fixed pause bug
      Fixed speed
      Adjusted Gaps and Information
      Saved 109 bytes
      SIZE:3400

0.93  *Never Released due to lack of an internet connection*
      Fixed a minor unnoticed bug
      Moved Next piece display and gap
      Optimized 6 bytes 
      SIZE:3394    

0.99  Fixed Title screen bug
      Added 99 bytes :(
        -Size is only temporary because I need to find a better way
         to fix the title screen. Right now my method is extremely crude
         and poorly coded. Sorry. Wait till v1.0. The game will be under
         3300 bytes, I promise.
      SIZE: 3493

*************CONVERTED TO THE 83***********************
0.92  Simple single player works
      Kinda buggy
      Dual Player doesn't work

0.93  Fixed all the single player bugs
0.94  Added Link Play support!  
0.95  Fixed the slow key movements
0.96  Fixed up the extra fast speed
0.99  Normal speed, equivelent to the 82
1.00  First release, 100% working, fixed pixel bug, didn't add 99 bytes :) Size - 3415

1.10  As you can see, this zip file has 2 83p's.  Let me explain.  Several people have
      complained to me about flashing pixels.  This I found out was only on calculators
      that are turboed.   Thus, there are 2 83p's in this package, the ztetris.83p is the
      standard one, for people with a normal 83p.  It is almost identical to the last
      release, except that I fixed a few minor details.  It is also the same size, 3415.

      Now the other version is also an option, but it is meant for people with turboed
      calculators, because I don't really recommend it.  The only difference between
      these two versions is the graph buffer copy routine, the normal one uses Joe's 
      fast copy.  This version, on the other hand, uses _grbufcpy_v, which has some
      cons - mainly - its a tad bit slower, especially noticable with keypresses on
      non turboed 83s.  I don't know how it would work out on the turboed 83, but it
      should stop the flickering.  Of course, some of you might use the top one for
      the speed, but that's up to you.  This version is a lot smaller than the other one,
      about 3366 bytes to be exact, which is about 50 bytes smaller.  Nevertheless, it
      is kinda slow.  Anyways, for the people with turboed calcs, if Joe ever fixes
      his FastCopy routine to work with the turboed calcs, then I might as well release
      a version 1.2 for the 83, but until then, we'll see.

1.2   Ok, last version had two versions, one which was 50 bytes smaller
      to fix up the turboed calculator bug.  In reality, the problem
      was the routine I suspected, yet nevertheless, it occured on some non-turboed
      calculators as well.  Thus, Joe has finally fixed his ZGFXL library and I can now
      say that the bug is fixed.  Here is what is new in this release:

1. Fixed the pixel flashing bug [thanks to Joe [fixing his ZGFXL],
Djpupon [reporting the bug and letting me know when it worked],
as well as Dustin Graham [also reporting the bug], and anyone else.

2. Fixed the APD Bug, which messed up your calculator if you left
it on in pause mode for 5 min.  I think now this should be fixed,
and credits go to BlackBelt for reporting this bug.

3. The program has dropped in size to 3408, which means its 7 bytes smaller!
It was 3404, but due to the fact that I had to fix the APD bug, 4 
additional bytes were added.  Yet it should all work out now.

Nevertheless, I decided that since this is an SOS release anyways, and since there is
an AShell v. 1.2 that is also released as a seperate file, that I might as well make
a version to use ZGFXL.  This version is thus about 3384 in size, plus ZGFXL, which
is about 131 bytes.  If you do not want to use the lib, I suggest you use ztetris.83p
because it is smaller than the AShell version.  If you use AShell on the otherhand,
then go ahead and download the AShell version off of ticalc.org or my page.  The 83g
file includes the SOS library version, with the new ZGFXL and the install program,
simply run install and you can play.  Note that it is important you have either
this or a later version of ZGFXL to prevent the flickering.

1.3     This is probably the final release.  This version simply drops
        the program size to 3331, about 80 bytes smaller than the last version.
        I know the 82 version will be smaller than this one, but it will use ASH
        specific RomCalls to make itself smaller.  So this is about as small as it gets.
        The other file, ztetsos.83g is the SOS version using ZGFXL.  It is
        also a lot smaller.  The size on this one is 3301.  You can get ZGFXL
        off of Joe's Page [http://www.usmo.com/~joewing] or off of www.ticalc.org.
        Run Install first if your running this version!

1.4     This is the non lib version for SOS.  This version speeds up the game a bit,
        and now it is about the same speed as the 82 version.  This version is also
        about 6 bytes smaller than the last version.  I might release an SOS version
        that uses ZLib to save another 38 bytes.  Also, renamed the 83p to tetris
	rather than ztetris, so it doesn't cause any problems with SOS libs.

1.5	This version is just a fix of the graphics library, which caused a wierd
	look on the new Ti-83s.  This should be totally compatible with the brand
	new Ti-83 calculators.  You now require the ZGFXL lib and SOS to run it,
	but put the ZGFXL lib in this zip file rather than the older version[s].

FUTURE VERSIONS
---------------
x Nothing else 83 related :)

 If you have any other suggestions about more features, mail them to
 Sam Heald at evil_sam@hotmail.com.

 But if they are 83 related, check my page at http://ahmed.ticalc.org

THANKS
------
Special thanks to...
 Pascal Bouron   - great link routines!
 Martin Hock     - example source on how to use those link routines
 CalcEm Author   - His emulator was a huge help!
 Joe Wingbermule - helped with backgrounds and fixing stuff for the new 83.
 Mark May (OBD)  - beta testing and trying to help
 Dines Christy Justesen - Trying to help
 Derrick Ward    - beta testing, trying to help when possible, and maintaining our page.
 Bryan Rabeler &
  Kouri Rosenberg - For repeatedly crashing their calcs for good of Ztetris.
   And the rest of the beta testers...
....and most of all
 Patrick Davidson - For teaching me everything I know about asm, and
                    solving the major bugs that I(Sam) could not.

Ti-83 Thanks...
 Florent Dhordain - the link routines!
 Joe Wingerbermuhle - the faster graph buffer copy [and fixing it!] 
 Djpupon, Dustin Graham, and BlackBelt - for reporting the bugs
 My Beta Testers - for suggestions.
 
HOW TO CONTACT (SAM) ABOUT THE 82 VERSION
-----------------
The best way is to send an email to evil_sam@hotmail.com.

  Visit my webpage at www.cswnet.com/~ddward/index.html for the latest info.

------------------------------------------------------------------------------
HOW TO CONTACT (PATRICK) ABOUT THE 82 VERSION
----------------
     WWW - http://www.calweb.com/~kwdavids/patrick/
           http://www.toptown.com/hp/ariwsi/
   EMail - ariwsi@juno.com
           ariwsi@rocketmail.com
           eeulplek@hotmail.com

------------------------------------------------------------------------------

Contacting Ahmed about 83 Version - http://ahmed@ticalc.org
                                    ahmed@ticalc.org

HOW TO CONTACT (JIMMY) ABOUT ANY OTHER VERSION OF ZTETRIS
-----------------
The easiest way is to send an email to mja@algonet.se, but you can also
find me on IRC, #calc-ti at EFnet with the nick Yarin. I'm usually there
about 11:00 pm - 02:00 am CET (5:00-8:00 EST).
IRC......: Yarin                             
Email....: mailto:yarin@acc.umu.se        
Homepage.: http://www.acc.umu.se/~yarin/
------------------------------------------------------------------------------
//Ahmed El-Helw <ahmedre@bellsouth.net / http://ahmed.ticalc.org>
//Sam Heald <evil_sam@hotmail.com / http://www.cswnet.com/~ddward/index.html>
//Jimmy Mrdell <yarin@acc.umu.se / http://www.acc.umu.se/~yarin>
//Patrick Davidson <eeulplek@hotmail.com>