Category : Modula II Source Code
Archive   : CONSOLE.ZIP
Filename : CONSOLE.DEF

 
Output of file : CONSOLE.DEF contained in archive : CONSOLE.ZIP
DEFINITION MODULE Console; (* Version 1.0 *)

(************************************************************************)
(* COPYRIGHT 1988 by David Albert *)
(* You may use this module in any of your work and distribute it freely *)
(* Provided that: 1) The copyright notice is not changed or removed *)
(* 2) The module is not modified *)
(* 3) Under NO conditions is this module to be sold *)
(************************************************************************)

(* CONSOLE uses BIOS calls to provide advanced screen handling. *)

CONST ScreenSizeX = 80;
ScreenSizeY = 25;

VAR CurWindow : RECORD
X1, Y1, X2, Y2,
Attribute : CARDINAL;
END;

PROCEDURE ClearScreen(); (* Clear entire screen *)
PROCEDURE ClearEOL(); (* Clear from cursor to end of line *)
PROCEDURE GetVidMode() : CARDINAL; (* Returns current video mode *)
PROCEDURE GetVidCh() : CARDINAL; (* Returns char+attr at current X,Y *)
PROCEDURE GotoXY (X,Y : CARDINAL); (* Place cursor at location X,Y *)
PROCEDURE Highlight(); (* Turns highlighting on *)
PROCEDURE Inverse(); (* Turns inverse video on *)
PROCEDURE KeyPressed() : BOOLEAN; (* True if a key has been pressed *)
PROCEDURE Normal(); (* Sets Video back to Normal *)
PROCEDURE PutChar (Ch:CHAR;Num:CARDINAL); (* Puts num chars at X,Y *)
PROCEDURE PutVidCh(ChAttr:CARDINAL); (* Put char+attr at current X,Y *)
PROCEDURE Read(VAR Ch : CHAR); (* Read a character from the kbd *)
PROCEDURE ScrollDown(Lines:CARDINAL); (* Scroll screen down *)
PROCEDURE ScrollUp(Lines : CARDINAL); (* Scroll screen up *)
PROCEDURE SetCursorSize(Top, Bottom : CARDINAL);
PROCEDURE SetVidMode(Mode:CARDINAL); (* Sets new video mode *)
PROCEDURE WhereX () : CARDINAL; (* Returns current X pos of cursor *)
PROCEDURE WhereY () : CARDINAL; (* Returns current Y pos of cursor *)
PROCEDURE Window(X1,Y1,X2,Y2:CARDINAL); (* Defines current window *)
PROCEDURE WriteChar (Ch : CHAR); (* Write a char and bump cursor *)
PROCEDURE Write(Ch : CHAR); (* Write a char in current window *)
PROCEDURE WriteLn(); (* Advance cursor to next line col 1*)
PROCEDURE WriteString(S:ARRAY OF CHAR); (* Write a string using Write *)
PROCEDURE StealWrite(); (* Redirs Writes to use above proc. *)
PROCEDURE ReturnWrite(); (* Returns writes to previous Write *)
END Console.



  3 Responses to “Category : Modula II Source Code
Archive   : CONSOLE.ZIP
Filename : CONSOLE.DEF

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/