home *** CD-ROM | disk | FTP | other *** search
/ World of A1200 / World_Of_A1200.iso / programs / compress / misc / pp / pp.doc < prev    next >
Text File  |  1995-02-27  |  7KB  |  177 lines

  1.  
  2.                             Powerpacker Patcher
  3.                                 Version 1.0
  4.  
  5.                      Copyright (C) 1991, Michael Berg
  6.                             All Rights Reserved
  7.                                  ---------
  8.  
  9.  
  10. INTRODUCTION
  11.  
  12.    Ever  got  tired of having to use PPMore or equivalent to view all those
  13. Powerpacked  datafiles  you  have  scattered  everywhere?   Or maybe PPMore
  14. doesn't do exactly what you want?
  15.  
  16.    Well,  this  program  should  solve  your problem.  It makes PowerPacker
  17. datafiles look completely like normal files.  In fact, there is now not one
  18. thing  you  can  do with normal files, which you cannot do with PowerPacker
  19. files.
  20.  
  21.  
  22. RUNNING PP
  23.  
  24.    Powerpacker  Patcher  runs from either the Workbench or the CLI.  If you
  25. use  it  from CLI, you need not RUN it, because it detaches itself from the
  26. current CLI process as soon as it is activated.
  27.  
  28.    You will notice that a small window pops up when PP is started.  This is
  29. done  so that you have a visual way of determining if PP is running or not.
  30. Moreover, it provides a way of terminating PP.
  31.  
  32.    Powerpacker  datafiles  will  begin to act as normal files as soon as PP
  33. has  been  activated.  Most programs, commercial or PD, will be fooled into
  34. thinking  that  a  powerpacked  file  exists  in the form of its decrunched
  35. state.   When  they  attempt to load such a file, the decrunched version of
  36. the file will be passed allong to the program.
  37.  
  38.  
  39. STOPPING PP
  40.  
  41.    Simple!   Just  punch  the  "closewindow"  gadget in the PP window.  You
  42. can't  miss  it,  because  it  is the only gadget present (at least in this
  43. version).   When  the  window  disappears,  DOS  has  been  restored to its
  44. original   state,  and  Powerpacker  datafiles  will  again  appear  as  ..
  45. Powerpacker datafiles.
  46.  
  47.  
  48. SAMPLE APPLICATIONS
  49.  
  50.    Well,  what  is  it all good for, then?  Here's a small list just to get
  51. your juices flowing:
  52.  
  53.     o Viewing Powerpacker datafiles (text)
  54.  
  55.       Simply use the TYPE command - or bring the text directly into
  56.       your favourite editor (TxEd, CygnusEd)
  57.  
  58.     o Viewing Powerpacker datafiles (pictures)
  59.  
  60.       Crunch a typical IFF picture. Then bring it directly into
  61.       DPaint or equivalent
  62.  
  63.     o Icons
  64.  
  65.       Yes, that's right. Go ahead and crunch all those icons. Workbench
  66.       will never know the difference. Remember to retain the names of
  67.       the icons - DON'T use ".info.pp". Workbench recognizes icons
  68.       as files with a postfix of ".info".
  69.  
  70.     o Include files (header files)
  71.  
  72.       Why not go ahead and crunch all your include files for your
  73.       compiler?
  74.  
  75.  
  76. THEORY OF OPERATION
  77.  
  78.    It's simple, really.  PP juggles with a few DOS library vectors, so that
  79. future calls to certain DOS functions will be rerouted through PP.  When an
  80. Open  request  arrives,  PP  looks  at  the  file  in  question in order to
  81. determine  the  filetype.   If it is a special file (e.g.  CON:  or NIL:) a
  82. filehandle  from  the original DOS Open() function is returned.  Otherwise,
  83. the  file is decrunched (or simply loaded) to a memory block, which is then
  84. flushed  into a temporary file on the RAM disk.  A pointer to this new file
  85. is then returned.
  86.  
  87.    You might think that the RAM disk will be filled with temporary files in
  88. a  very short time, but PP is intelligent enough to remove them from RAM as
  89. they  are  no  longer  needed.  If PP sees that the temporary file has been
  90. changed between the Open and the Close call, the file is rewritten over the
  91. original file, if possible.
  92.  
  93.    Future  attempts  to  Examine()  a  file  will  return  the  size of the
  94. decrunched  file  in the FileInfoBlock, and not the size of the Powerpacker
  95. datafile  itself.   Why?  Imagine an editor trying to load a text file.  It
  96. does  an  Examine()  to get at the filesize.  Then it allocates just enough
  97. memory  to  hold  the  file.  It then loads the file into that memory area.
  98. Well,  that  just  won't work if the filesize it receives from Examine() is
  99. about  50%  too  small.   Keep in mind that as soon as an Open() attempt is
  100. made,  the  file  is  decrunched, and will thus have a completely different
  101. filesize!
  102.  
  103.    For   further  details  on  the  technique  involved,  please  read  the
  104. sourcecode -- it's included for just that.
  105.  
  106.  
  107. CAVEATS
  108.  
  109.    Yep, there are a few of these, too.  First of all, you have to remember,
  110. that  PP  only  works "one way".  This means that loading Powerpacker files
  111. will  work  fine, but saving them again will result in a non-crunched file.
  112. The powerpacker.library sorely lacks a crunch function.
  113.  
  114.    Secondly,  when  working  with  crunched icons (or, for that matter, any
  115. other  type  of  crunched  file),  there is a nominal performance reduction
  116. caused by the decruncher.  Don't expect icons to pop up at the same rate as
  117. they  used  to,  or  include files to get included as fast as they used to.
  118. Use of B.A.D.  or Addbuffers is recommended.
  119.  
  120.    Thirdly,  the  DOS library patches aren't done according to the textbook
  121. (if  there  is  one  on  this topic!).  I suppose a SumLibrary() call is in
  122. order, but its presense or absense seemed to make no difference whatsoever,
  123. so I left it out.
  124.  
  125.    I  admit that the code is more or less tailored for an OS no larger than
  126. 1.3.   No doubt it would crash a 2.0 system, because AmigaDOS looks quite a
  127. lot  different on such machines (A3000).  The program was tested on an A500
  128. using AmigaDOS 1.2, with .5Mb extra RAM fitted.
  129.  
  130.    The  overall  effect of this program is quite astonishing.  I use it all
  131. the  time.   Try  it - it is just fantastic to see how *.pp files act as if
  132. they were completely normal files!
  133.  
  134.  
  135. THANKS GO TO...
  136.  
  137.    Well,  who  other  than Nico François.  Nico's powerpacker.library, and,
  138. for  that  matter,  all  the other powerpacker tools, are simply brilliant.
  139. Credit where credit is due!
  140.  
  141.  
  142. FUTURE RELEASES
  143.  
  144.    This  version  of PP is pretty much a beta release.  There's a multitude
  145. of possibilities for improving PP.  Some obvious choises:
  146.  
  147.     o Let PP create temporary files on other devices than RAM:
  148.       I'm going to implement this via ENV:ironment variables. Harddisk
  149.       users will probably welcome this.
  150.  
  151.     o More gadgets to control PP. Switching PP on and off while it is
  152.       running.
  153.  
  154.     o Maybe build in a small memorymeter or a clock (or both)
  155.       (The window is just sitting there, why not use it for something?)
  156.  
  157.  
  158. SHAREWARE
  159.  
  160.    PP  is  shareware.   As  you  know, this means that I would appreciate a
  161. small sum of money if you use it alot.  US$ 5+ (or equivalent) will get you
  162. free updates of PP as soon as these are ready.
  163.  
  164.  
  165. FLAMES
  166.  
  167.    If  you find anything you (dis)like, mail me.  Also, the code is still a
  168. little  shaky,  so  it  is  possible  that  a few insects have survived the
  169. initial sprays of TNT.  Anyway, here's my address:
  170.  
  171.                                Michael Berg
  172.                          Sct. Peders Gade 24A, 2th
  173.                                8900  Randers
  174.                                   DENMARK
  175.  
  176.                                  Have fun!
  177.