Package PacLib

Uses KbdCRT

Interface

Sub Halt
Def KeyPressed as Word
Sub FlushBuf
Sub InitScr
Sub Plot(L,C,V as Word)
Def Point(L,C as Word) as Word

Implementation

Sub Halt
Enter
  PrintS "Press Ctrl-Break to exit"
  InLine &HFEEB
Leave

Def KeyPressed as Word
Type
    BytePtr is ^Byte
Enter
  If BytePtr(0,1050)^<>BytePtr(0,1052)^ Then Result=1 Else Result=0;
Leave

Sub FlushBuf
Type
    BytePtr is ^Byte
Enter
  BytePtr(0,1050)^=BytePtr(0,1052)^
Leave

Var
   Scr as @Array[1..25,1..40] Of Word

Sub InitScr
Enter
  SetCRTMode Text40x25
  @Scr=Pointer(@Screen)
Leave

Sub Plot(L,C,V as Word)
Enter
  Scr[L][C]=V
Leave

Def Point(L,C as Word) as Word
Enter
  Result=Scr[L][C]
Leave

Enter
Leave