home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / mbug / mbug022.arc / MCHASE.DOC < prev    next >
Text File  |  1979-12-31  |  7KB  |  259 lines

  1.  
  2.  
  3.                MAZE CHASE
  4.             (C) 1985 by Tom P Jansing
  5.  
  6.  
  7.               INTRODUCTION
  8.  
  9. MAZE CHASE is an action game designed for any character-mode 
  10. ASCII terminal that has an addressable cursor and a 24x80 or 
  11. larger format.  No special graphic capabilities are needed.  
  12. Complete instructions for customization are provided in this 
  13. document.  This version requires the CP/M-80 operating system and 
  14. about 24k of memory.  It is written in Small C and may eventually 
  15. appear on other operating systems.
  16.  
  17. Legal stuff:  The compiled code (or any modified versions) of 
  18. MAZE CHASE for CP/M-80 may be freely distributed subject to the 
  19. following two restrictions:
  20.  
  21. -    It shall not be offered for sale without my prior written
  22.     consent.  Giving it away is OK, however.
  23. -    The program shall not be distributed without this
  24.     documentation file and the on-line help file, both in
  25.     unmodified form.
  26.  
  27.  
  28.               INSTALLATION
  29.  
  30. MAZE CHASE comes distributed as 3 files, as follows:
  31.  
  32. MCHASE.COM    - The game itself.
  33.  
  34. MCHASE.HLP    - The on-line instructions.  This file explains
  35.           the game play in detail, and should be on the
  36.           currently logged disk.
  37.  
  38. MCHASE.DOC    - You're reading it.
  39.  
  40. (MCHASE.DAT)    - This file will contain the game's high scores
  41.           for posterity.  This file is NOT included, as
  42.           it'll simply be created if MAZE CHASE cannot           
  43.           find one by this name.  To reset the scores
  44.           to zero, simply erase this file.
  45.  
  46.  
  47.                 PATCHING
  48.  
  49. To accommodate almost any terminal type, MAZE CHASE was designed 
  50. to allow easy patching of the terminal functions it uses.  The 
  51. distributed version is configured for the common Lear Siegler 
  52. ADM-3A codes, so owners of Kaypros, Osbornes, etc. should have 
  53. little need to patch this program.  For the rest of you, here's 
  54. what's involved:
  55.  
  56.  
  57. CURSOR POSITIONING STRING
  58.  
  59. This is located at 017Fh.  The first byte will be the length of 
  60. the cursor positioning string, and should be followed immediately 
  61. by the string itself.  The positions where the X and Y values 
  62. will be inserted can contain anything for now.  (X is the column 
  63. number, starting with 0 for the left edge, and Y is the row 
  64. number, starting with 0 for the top row).  The current settings 
  65. are:
  66.  
  67.       Address  Value    Description
  68.            (hex)
  69.  
  70.     017F    04    Length of the following:
  71.     0180    27    ESC                    (1)
  72.     0181    61    =                    (2)
  73.     0182    00    Y+offset goes here, as defined below.    (3)
  74.     0183    00    X+offset, ditto.            (4)
  75.     0184    00    (extra)
  76.     ...
  77.     0189    00    End of patch string.
  78.  
  79.  
  80. Y AND X POSITIONS IN THE SEQUENCE
  81.  
  82. These two bytes tell the program where to insert the Y and X 
  83. values in the cursor positioning string.
  84.  
  85.     019A    03    Y position is 3rd in sequence.
  86.     019B    04    X position is 4th in sequence.
  87.  
  88.  
  89. Y AND X OFFSETS
  90.  
  91. Many terminals require a constant value to be added to the Y and 
  92. X screen addresses.  The following values will be added before 
  93. insertion into the cursor positioning string:
  94.  
  95.     01AC    20    Y offset, in hexadecimal (=32 decimal)
  96.     01AD    20    X offset,    "    "    "
  97.  
  98.  
  99.  
  100. CLEAR SCREEN STRING
  101.  
  102. This will be a byte containing the length of the string, followed 
  103. by the string itself.  If your terminal does not have a clear-
  104. screen function, you should set the length byte to 0, and code 
  105. your own subroutine to, possibly, print 48 linefeeds.
  106.  
  107.     01B8    01    Length of one.
  108.     01B9    26    CTRL-Z        (1)
  109.     01BA    00    Extras
  110.     01BB    00    ..
  111.     01BC    00    ..
  112.  
  113.  
  114. CURSOR-ON AND CURSOR-OFF STRINGS (Optional)
  115.  
  116. If your terminal allows the cursor to be turned on or off, patch 
  117. these strings; otherwise leave the length bytes as 0.  For a
  118. Kaypro, just set the length bytes to 3, as the codes are already 
  119. in place.
  120.  
  121. CURSOR ON:
  122.     01CC    00    Length (0 means currently disabled)
  123.     01CD    27    ESC    For Kaypro
  124.     01CE    42    'B'
  125.     01CF    34    '4'
  126.     01D0    00    Extra
  127.  
  128. CURSOR OFF:
  129.     01E0    00    Length (0 means currently disabled)
  130.     01E1    27    ESC
  131.     01E2    43    'C'
  132.     01E3    34    '4'
  133.     01E4    00    Extra
  134.  
  135.  
  136. STRINGS TO INITIALIZE AND DE-INITIALIZE TERMINAL 
  137.  
  138. The initialize string will be sent to your terminal before any
  139. other I/O is done.  Likewise, the de-initialize string will be
  140. the last thing sent when the program terminates.  You probably
  141. won't need this, especially since there's a separate (and
  142. preferred) function for controlling the cursor.
  143.  
  144. INITIALIZE:
  145.     01F5    00    Length (0 means currently disabled)
  146.     01F6    00    Up to ten bytes can go here.
  147.     ...
  148.     01FF    00
  149.  
  150. DE-INITIALIZE:
  151.     0212    00    Length (0 means currently disabled)
  152.     0213    00    Up to 10 bytes again.
  153.     ...
  154.     021C    00
  155.  
  156.  
  157. NOISE
  158.  
  159. If you don't like the sound of your terminal's bell, change the 
  160. following byte to 0.  This can also be toggled on/off from the 
  161. game's title page by pressing CTRL-B.
  162.  
  163.     022F    07    "Bell" character.
  164.  
  165.  
  166. GAME SPEED
  167.  
  168. This is the initial speed of the game (which can still be changed 
  169. on the fly).  This must be in the range of 1 to 9.
  170.  
  171.     0237    01    Initial speed of 1.
  172.  
  173.  
  174. CPU SPEED
  175.  
  176. This should be set to match your CPU's clock speed, in MHz (use 
  177. the nearest whole number).
  178.  
  179.     0245    04    4 Mhz.
  180.  
  181.  
  182. MAZE WALL CHARACTER
  183.  
  184. This is the character used to draw the walls of the maze.  If 
  185. your terminal can display a solid-block character, you may prefer 
  186. to use that instead.
  187.  
  188.     024C    23    23 hex is the character '#'.
  189.  
  190.  
  191. EXTRA-LIFE THRESHOLD
  192.  
  193. Every (this many * 100) points, you get another "p".
  194.  
  195.     0259    64    = 100 decimal = 10000 points.
  196.  
  197.  
  198. NUMBER OF LIVES
  199.  
  200. This is the number of lives you start with every game.
  201.  
  202.     0265    04    Four to start.    (pppp)
  203.  
  204.  
  205. GENERAL PURPOSE PATCH AREA
  206.  
  207. If you can't adapt MAZE CHASE to your terminal with the above 
  208. patches, you may have to rewrite some of the I/O subroutines (see 
  209. below).  An area of memory has been set aside for this purpose:
  210.  
  211.     026E    Start of patch area.
  212.     ...
  213.     02A6    Last usable byte.
  214.  
  215. If this is not enough, then you can use all the memory you need 
  216. above 63A0.  This'll make your .COM file somewhat larger, though.
  217.  
  218.  
  219. I/O SUBROUTINE ENTRY POINTS
  220.  
  221. If you need to change any of the following routines (perhaps to 
  222. support memory-mapped video), just patch a JMP instruction at the 
  223. address given, and use the patch area mentioned above to hold the 
  224. custom code.
  225.  
  226.     06A1    Cursor positioning routine.
  227.         The parameters are kept on the stack.  To get the 
  228.                 X address into register A, go
  229.             LXI  H,6
  230.             DAD  SP
  231.             MOV  A,M    
  232.         To get the Y address, use LXI H,4 instead.
  233.                      
  234.     0896    Clear screen routine.
  235.  
  236.     089F    Turn the cursor on.
  237.  
  238.     08A8    Turn the cursor off.
  239.  
  240.     08B1    Send the initialize string (first thing).
  241.  
  242.     08BA    Send the de-initialize string (last thing).
  243.  
  244.  
  245.                 FEEDBACK
  246.  
  247. I welcome your criticisms, suggestions, etc. about this program.  
  248. I can be reached on most Edmonton-area CP/M bulletin boards, or 
  249. by mail at the following address:
  250.  
  251.     Tom P Jansing
  252.     86 Mission Avenue
  253.     St. Albert, Alberta
  254.     CANADA
  255.     T8N 1H8
  256.  
  257.  
  258. Enjoy!
  259.