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

  1. Unit GameInt9;
  2.  
  3. INTERFACE
  4.  
  5. Uses
  6.   DOS,CRT;
  7.  
  8. Var
  9.   Left,
  10.   Right,
  11.   Space,
  12.   Escape : Boolean;
  13.   P : Byte;
  14.  
  15. IMPLEMENTATION
  16.  
  17. Var
  18.   OldExitProc,
  19.   SaveInt09 : pointer;
  20.  
  21. procedure JmpOldISR(OldISR: pointer);
  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( Flags,CS,IP,AX,BX,CX,DX,SI,DI,DS,ES,BP:word ); Interrupt;
  27. Begin
  28.   P := Port [$60];
  29.   If ( P = 75 ) Then
  30.     Left := TRUE
  31.   Else
  32.   If ( P = 77 ) Then
  33.     Right := TRUE
  34.   Else
  35.   If ( P = 57 ) Then
  36.     Space := TRUE
  37.   Else
  38.   If ( P = 1 ) Then
  39.     Escape := TRUE
  40.   Else
  41.     JmpOldISR( SaveInt09 );
  42.  
  43.   Inline($E4/$61/$8A/$E0/$0C/$80/$E6/$61/   { Clean up as the    }
  44.          $86/$E0/$E6/$61/$B0/$20/$E6/$20);  { Bios would         }
  45. End;
  46.  
  47. Procedure Int09ExitProc;
  48. Begin
  49.   ExitProc := OldExitProc;
  50.   SetIntVec( 9, SaveInt09 );
  51. end;
  52. {$F-}
  53.  
  54. Begin
  55.   OldExitProc := ExitProc;
  56.   ExitProc := @Int09ExitProc;
  57.   GetIntVec( 9, SaveInt09 );
  58.   SetIntVec( 9, @Key_ISR );
  59.  
  60.   Left := FALSE;
  61.   Right := FALSE;
  62.   Space := FALSE;
  63.   Escape := FALSE;
  64. end.
  65.