home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 2 / crawlyvol2.bin / program / pascal / passrc / pasfix1.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1985-11-18  |  3.4 KB  |  120 lines

  1. { -----------------------------------------------------------------------------
  2.  
  3.                                  NOTICE:
  4.  
  5.       THESE MATERIALS are UNSUPPORTED by OSS!  If you do not understand how to
  6.       use them do not contact OSS for help!  We will not teach you how to 
  7.       program in Pascal.  If you find an error in these materials, feel free
  8.       to SEND US A LETTER explaining the error, and how to fix it.
  9.  
  10.       THE BOTTOM LINE:
  11.  
  12.          Use it, enjoy it, but you are on your own when using these materials!
  13.  
  14.  
  15.                                DISCLAIMER:
  16.  
  17.       OSS makes no representations or warranties with respect to the contents
  18.       hereof and specifically disclaim all warranties of merchantability or
  19.       fitness for any particular purpose.   This document is subject to change
  20.       without notice.
  21.       
  22.       OSS provides these materials for use with Personal Pascal.  Use them in
  23.       any way you wish.
  24.  
  25.    -------------------------------------------------------------------------- }
  26.  
  27.  
  28. (* FixPas - Patch bugs in PASGEM library and COMPILER.PRG; resultant version is
  29.     identical with 1.02.  Compile this patch program for TOS (but it doesn't
  30.     really matter much).  To perform the patch after compiling the program,
  31.       1.  Make a copy of your master disk (or your normal Pascal disk)
  32.       2.  Copy the FIXPAS.TOS program to this new disk.
  33.       3.  From either TOS or the Pascal manager, run the FIXPAS program.
  34.     The new disk now contains patched versions of the GEM library and the
  35.     Pascal Compiler. *)
  36.  
  37. PROGRAM FixPas ;
  38.  
  39.   VAR
  40.     f : PACKED FILE OF byte ;
  41.     patch_pos : long_integer ;
  42.  
  43.   PROCEDURE patch( old_val, new_val : BYTE ) ;
  44.  
  45.     BEGIN
  46.       get( f, patch_pos ) ;
  47.       IF (f^ <> old_val) AND (f^ <> new_val) THEN
  48.         BEGIN
  49.           writeln( 'File doesn''t match: ', patch_pos:6:h, ' ', f^:2:h ) ;
  50.           halt
  51.         END ;
  52.       f^ := new_val ;
  53.       put( f, patch_pos ) ;
  54.       patch_pos := patch_pos + 1 ;
  55.     END ;
  56.  
  57.   PROCEDURE patch_pasgem ;
  58.  
  59.     BEGIN
  60.       reset( f, 'pasgem' ) ;
  61.  
  62.       patch_pos := 11587 (*$2d43*) ;
  63.       patch( $0e, $0c ) ;
  64.  
  65.       patch_pos := 11600 (*$2d50*) ;
  66.       patch( $5c, $58 ) ;
  67.  
  68.       patch_pos := 21902 (*$558e*) ;
  69.       patch( $54, $47 ) ;
  70.  
  71.       patch_pos := 37094 (*$90e6*) ;
  72.       patch( $48, $38 ) ;
  73.       patch( $c5, $05 ) ;
  74.       patch( $d1, $e5 ) ;
  75.       patch( $c5, $44 ) ;
  76.       patch( $d1, $d0 ) ;
  77.       patch( $c5, $c4 ) ;
  78.  
  79.       patch_pos := 37144 (*$9118*) ;
  80.       patch( $67, $60 ) ;
  81.     END ;
  82.  
  83.   PROCEDURE patch_compiler ;
  84.  
  85.     BEGIN
  86.       reset( f, 'compiler.prg' ) ;
  87.  
  88.       patch_pos := 106550 (*$1a036*) ;
  89.       patch( $46, $7c ) ;
  90.       patch( $61, $46 ) ;
  91.       patch( $74, $61 ) ;
  92.       patch( $61, $74 ) ;
  93.       patch( $6c, $61 ) ;
  94.       patch( $20, $6c ) ;
  95.       patch( $65, $20 ) ;
  96.       patch( $72, $65 ) ;
  97.  
  98.       patch_pos := 106559 (*$1a03f*) ;
  99.       patch( $6f, $72 ) ;
  100.       patch( $72, $6f ) ;
  101.       patch( $21, $72 ) ;
  102.       patch( $5d, $21 ) ;
  103.       patch( $5b, $20 ) ;
  104.       patch( $20, $5d ) ;
  105.       patch( $41, $5b ) ;
  106.       patch( $62, $41 ) ;
  107.       patch( $6f, $62 ) ;
  108.       patch( $72, $6f ) ;
  109.       patch( $74, $72 ) ;
  110.       patch( $20, $74 ) ;
  111.  
  112.       patch_pos := 122165 (*$1dd35*) ;
  113.       patch( $01, $02 ) ;
  114.     END ;
  115.  
  116.   BEGIN
  117.     patch_pasgem ;
  118.     patch_compiler ;
  119.   END.
  120.