home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / TP_ADV.ZIP / LIST0702.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1989-11-20  |  1.5 KB  |  57 lines

  1. Unit Int05;
  2.  
  3. INTERFACE
  4.  
  5. Uses
  6.   DOS,
  7.   GPrint;
  8.  
  9. Var
  10.   GraphPrn : Boolean;
  11.  
  12. IMPLEMENTATION
  13.  
  14. Var
  15.   OldExitProc,
  16.   SaveInt05 : pointer;
  17.  
  18. Procedure JmpOldISR(OldISR: Pointer);
  19. { An inline macro procedure. The code for this will be inserted at the }
  20. { point that it is called. The purpose of this macro is to jump to the }
  21. { Interrupt Service Routine at the address passed in.                  }
  22.   Inline($5B/$58/$87/$5E/$0E/$87/$46/$10/$89/
  23.          $EC/$5D/$07/$1F/$5F/$5E/$5A/$59/$CB);
  24.  
  25. {$F+}
  26. Procedure Key_ISR; Interrupt;
  27. { This interrupt procedure is the new ISR for Interrupt 05. Based  }
  28. { on the value of the global boolean variable GraphPrn, either the }
  29. { graphics print screen is called ( TRUE ), or the old ISR print-  }
  30. { screen is called ( FALSE ).                                      }
  31. Begin
  32.   If GraphPrn Then
  33.   Begin
  34.     HardCopy ( 1 );    { This value may differ for non-Epson printers. }
  35.   End
  36.   Else
  37.     JmpOldISR( SaveInt05 );
  38. End;
  39.  
  40. Procedure Int05ExitProc;
  41. { This procedure will be called upon exit of the program. Its purpose }
  42. { is to restore the interrupt that was stolen at startup.             }
  43. Begin
  44.   ExitProc := OldExitProc;
  45.   SetIntVec( 5, SaveInt05 );  { Restore the old ISR }
  46. end;
  47. {$F-}
  48.  
  49. Begin
  50.   OldExitProc := ExitProc;    { Set up exit procedure }
  51.   ExitProc := @Int05ExitProc; { " }
  52.   GetIntVec( 5, SaveInt05 );  { Save old ISR value }
  53.   SetIntVec( 5, @Key_ISR );   { Set up new ISR }
  54.  
  55.   GraphPrn := FALSE;          { Default to normal print screen }
  56. end.
  57.