home *** CD-ROM | disk | FTP | other *** search
- Unit Int05;
-
- INTERFACE
-
- Uses
- DOS,
- GPrint;
-
- Var
- GraphPrn : Boolean;
-
- IMPLEMENTATION
-
- Var
- OldExitProc,
- SaveInt05 : pointer;
-
- Procedure JmpOldISR(OldISR: Pointer);
- { An inline macro procedure. The code for this will be inserted at the }
- { point that it is called. The purpose of this macro is to jump to the }
- { Interrupt Service Routine at the address passed in. }
- Inline($5B/$58/$87/$5E/$0E/$87/$46/$10/$89/
- $EC/$5D/$07/$1F/$5F/$5E/$5A/$59/$CB);
-
- {$F+}
- Procedure Key_ISR; Interrupt;
- { This interrupt procedure is the new ISR for Interrupt 05. Based }
- { on the value of the global boolean variable GraphPrn, either the }
- { graphics print screen is called ( TRUE ), or the old ISR print- }
- { screen is called ( FALSE ). }
- Begin
- If GraphPrn Then
- Begin
- HardCopy ( 1 ); { This value may differ for non-Epson printers. }
- End
- Else
- JmpOldISR( SaveInt05 );
- End;
-
- Procedure Int05ExitProc;
- { This procedure will be called upon exit of the program. Its purpose }
- { is to restore the interrupt that was stolen at startup. }
- Begin
- ExitProc := OldExitProc;
- SetIntVec( 5, SaveInt05 ); { Restore the old ISR }
- end;
- {$F-}
-
- Begin
- OldExitProc := ExitProc; { Set up exit procedure }
- ExitProc := @Int05ExitProc; { " }
- GetIntVec( 5, SaveInt05 ); { Save old ISR value }
- SetIntVec( 5, @Key_ISR ); { Set up new ISR }
-
- GraphPrn := FALSE; { Default to normal print screen }
- end.