home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d5xx / d569 / trackmaster.lha / TrackMaster / TM.doc < prev    next >
Text File  |  1991-11-21  |  7KB  |  151 lines

  1.  
  2.  
  3.                              TrackMaster V1.0a
  4.                           ======================
  5.  
  6. ©1991  by BrainTrace Design Software.  This program is free to copy and use
  7. as  long  as  nobody  makes  any kind of profit with it, and the program is
  8. unchanged  and  spreaded  together with the doc- and example-files.  If you
  9. want  to include it to a comercial pd-library or product, or if you want to
  10. use  it for a game, you need the written permission of Cranium Software.  A
  11. general  permission  for distribution is granted to Fred Fish.  Mister S.O.
  12. , Germany, will never get a permission of any kind ( I warn you ).
  13.  
  14.                         BrainTrace Design Software
  15.                               Carsten Schlote
  16.                                Egelseeweg 52
  17.                            6302 Lich 1 / Germany
  18.                          Phone: ++49-(0)6404-7996
  19.  
  20. Purpose:
  21. ========
  22.  
  23.  TrackMaster  is a small program, which will help all game coders to create
  24. trackdisk-loading  game  disks.   TrackMaster copies a list of files, which
  25. are  listened  in  a scriptfile, to a empty disk in a specified drive.  The
  26. files  are written with the trackdisk.device.  Also a bootblock is written,
  27. who will load the first program on disk.
  28.  An  optional feature of TrackMaster is the possibility to compact the file
  29. before  writting  them  to disk.  By default the file are written unpacked.
  30. Look at section 'Scripts' for additional info.
  31.  As  long  as  the  system is left intact, you can now write a trackloading
  32. (FAST) game, without writting all files by hand to this disks.
  33.  Be  sure to use only Forbid(), Permit(), Disable() and Enable().  Also use
  34. AllocMem to get your memory.
  35.  
  36. Technical info:
  37. ===============
  38.  
  39.  The first program must be a binary image and pc-relative.  You can use the
  40. included  program  HunkWizzard  to  convert an amiga executable to a binary
  41. image.  This program will be loaded and started as your game-loader.
  42.  
  43.  Therefore  it  must  handle  all further loading, decrunching and so on by
  44. itself.   The pointer to current StdIOReq is available in register A1.  The
  45. maximum  number of fileentries is available in d0.  The offsets and lengths
  46. of the files on disk are stored as an array of LONGs at offset 1024 ( Block
  47. 2 ) on the disk.  This looks like this:
  48.  
  49.    dc.l   1536, ????   ; Offset and Length of first program ( YOUR loader )
  50.    dc.l   x1, y1       ; Offset and Length of second file
  51.    dc.l   x2, y2       ; Offset and Length of third file
  52.    dc.l   x3, y3       ; Offset and Length of fourth file
  53.    dc.l  .....         ; and so on
  54.  
  55. I sugest you to do the following in the loader:
  56.  
  57.  Examine  how  many  drives  are installed in the system.  This can be done
  58. simply  by  opening all trackdisk units and checking the OpenDevice result.
  59. Your  current  bootdrive unit number you can find in the StdIoReq ( look at
  60. exec/io.h  for  more info.  The pointer to the StdIOReq is stored in A1 !!)
  61. Remember that with Kick 2.0 EACH drive can be the boot drive.  I know a lot
  62. of bad-written games, which force the user to use the drive 0.  If you have
  63. two different drives installed, for example an 3.5" and a 5.25" drive, this
  64. can become VERY nasty.
  65.  Use  now  your  knowledge  about the installed drive for your game loading
  66. system, please !
  67.  
  68. Of  course  you can use the loader as the main part of your game.  Then you
  69. can  use the remaining files for graphics.  This is much simpler as writing
  70. all code pc-relative or use a relocator for executable while loading.
  71.  
  72. The  last  program  in  the  dirtable  is an array of the filenames used by
  73. trackmaster  as fileentries before.  Each filename ocupies 30 characters of
  74. space.  So you can find each filename with the following formula :
  75.  
  76.    filenamestart = 30 * index
  77.  
  78. You  can use the filenames for your own filesystem.  This will allow you to
  79. use  filenames  instead  of  indexes,  which  is fairly transparent to your
  80. programs.  It makes it possible to use a harddisk loader for developing and
  81. a  trackdisk  driver  for the final game or program, without worrying about
  82. the indexes or fileordering on disk.
  83.  
  84.  
  85.  
  86. The script file
  87. ===============
  88.  
  89.  The script file is very simple.  Empty lines and lines starting with a '#'
  90. are  comments.   Everything else is used as a path/filename.  All files are
  91. stored to disk in the same order as in the scriptfile.  The first file must
  92. be  a binary image and pc-relative.  The remaining files can be of any type
  93. you want ( Gfx, Code, Executables, ...  ).
  94.  The  '#'  can  be a switch introducer.  It must be followed by a character
  95. and the numbers 0 or 1 ( means FALSE(0) or TRUE(1) ).
  96.  The following switch exist :
  97.  
  98.    #o<num>  - Continues writing of the following files at the given
  99.               disk block number. Number must be decimal.
  100.  
  101.    #@<num>  - Write seek offset & length for following files at direntry
  102.               <num>. This allows to skip some already written files, e.g.
  103.               if you want to update level data etc. This functions expects
  104.               the disk in drive to BE a trackmaster disk - no checks !
  105.               You must use this function in conjunction with the #o
  106.               directive - be sure to give the right offset - no checks !
  107.               You may use this function only once per script file.
  108.               The first file in table has the number 0 (Zero) - count right !
  109.  
  110.    #c0      - Switch compressing for following file off.
  111.    #c1      - Switch compressing for following file on.
  112.  
  113.    #r1 x    - Relocate executable to address x (hexadecimal) on.
  114.               HunkWizard must be available in current path
  115.               setting.
  116.    #r0      - Relocate off
  117.  
  118.    #s1<doscom <@s> <@d> > - Execute a doscommand on following files.
  119.               the '@s @d' is important. the first is a
  120.               placeholder for the original filename. The second
  121.               is for original filename with a '.rel' extention.
  122.               The placeholder can also be divided by special
  123.               keyword like 'to'. E.g. '@s to @d'. the placeholders are
  124.               optional, and they may be used in any order and in multiple
  125.               places.
  126.    #s0      - Special off
  127.  
  128.    #l x filename - join the x following files to filename
  129.  
  130. Compressed files
  131. ================
  132.  
  133.  For the compression the lh.library by Olaf Bartels is used. The packed data
  134. will be proceded by three long words. The first is a pack-identifier, the
  135. last two are the lengths before and after crunching.
  136.  
  137.    dc.l  'PACK', OriginalSize, PackedSize, ... < Packed data follows >
  138.  
  139. Keep the header in mind if you call the recruncher !!!!
  140.  
  141.  
  142. Usage
  143. =====
  144.  
  145.  Write  your scriptfile and then call TrackMaster with the path/filename of
  146. your  script  as first, and the number of the destination drive ( 0..3 ) as
  147. second Command-Line-argument.
  148.  The rest is done by the program.
  149.  
  150.  
  151.