home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Best Objectech Shareware Selections
/
UNTITLED.iso
/
boss
/
util
/
misc
/
018
/
mufmtask.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-08-17
|
24KB
|
500 lines
UNIT MufMTask;
INTERFACE
USES
Dos, Crt, MufGlobs;
(* EXPORTS *)
FUNCTION IsTimeSharingActive : BOOLEAN;
PROCEDURE TurnOnTimeSharing;
PROCEDURE TurnOffTimeSharing;
PROCEDURE GiveUpTime( NSlices : INTEGER );
PROCEDURE Sync_Screen( S_Pos: INTEGER; NChars : INTEGER );
PROCEDURE Sync_Entire_Screen;
IMPLEMENTATION
(* Ensure multitasking defined *)
{$DEFINE MTASK}
(* Multitasker interface routines *)
(*--------------------------------------------------------------------------*)
(* PIBMDOS.PAS --- Multitasker interface routines *)
(*--------------------------------------------------------------------------*)
(* *)
(* Author: Philip R. Burns *)
(* *)
(* Date: Version 1.0: January, 1986. DoubleDos support. *)
(* Version 2.0: April, 1986. Add DesqView support. *)
(* Version 3.0: July, 1986. Add TopView/Windows support. *)
(* Version 3.1: September, 1986. Update for TaskView support. *)
(* Version 3.2: December, 1986. Distinguish TaskView/DesqView. *)
(* Version 4.0: January, 1988. Fix bogus TopView update, add *)
(* check for Novell to stop lockup. *)
(* *)
(* Systems: MS DOS or PC DOS with DoubleDos/DesqView/TopView/Windows *)
(* installed. *)
(* *)
(* History: These routines provide a simple interface for PibTerm *)
(* with SoftLogic's DoubleDos multitasking executive, *)
(* Quarterdeck's DesqView multitasker, IBM's TopView, *)
(* MicroSoft's Windows, and Sunny Hill's TaskView. *)
(* (Windows is handled as a Topview-emulating product. This is *)
(* also true for TaskView and DesqView, but those programs do *)
(* not require the explicit screen updates TopView requires. *)
(* *)
(* If you have another multitasker, you should be able to *)
(* replace these routines fairly easily with similar-acting *)
(* ones for your multitasker. Use the global types defined *)
(* for MultiTasker and MultiTaskerType. *)
(* *)
(* Note also that the routine Get_Screen_Address in Pibscren.pas *)
(* needs to know about multitaskers. *)
(* *)
(* With DoubleDos, it is necessary to reobtain the display buffer *)
(* address every time the screen memory is written to. With *)
(* DesqView, this is unnecessary. With TopView and Windows, *)
(* it is necessary to inform them that the screen has changed. *)
(* TaskView works like DesqView. *)
(* *)
(*--------------------------------------------------------------------------*)
(* *)
(* Please leave messages on Gene Plantz's BBS (312) 882 4145 *)
(* or Ron Fox's BBS (312) 940 6496. *)
(* *)
(*--------------------------------------------------------------------------*)
(*--------------------------------------------------------------------------*)
(* IsNovellActive --- Checks if Novell network is active *)
(*--------------------------------------------------------------------------*)
FUNCTION IsNovellActive : BOOLEAN;
(*--------------------------------------------------------------------------*)
(* *)
(* Function: IsNovellActive *)
(* *)
(* Purpose: Checks if Novell network active *)
(* *)
(* Calling Sequence: *)
(* *)
(* Novell_On := IsNovellActive : BOOLEAN; *)
(* *)
(* Novell_On --- TRUE if Novell network is active. *)
(* *)
(* Calls: MsDos *)
(* *)
(*--------------------------------------------------------------------------*)
VAR
Regs : Registers;
BEGIN (* IsNovellActive *)
Regs.CX := 0;
Regs.AL := 0;
(* Request workstation ID. *)
(* This should be ignored if Novell *)
(* network software isn't active. *)
Regs.AH := $DC;
MsDos( Regs );
(* If we got back a non-zero station *)
(* ID, then Novell must be loaded. *)
IsNovellActive := ( Regs.AL <> 0 );
END (* IsNovellActive *);
(*--------------------------------------------------------------------------*)
(* IsTimeSharingActive --- Checks if multitasker is active *)
(*--------------------------------------------------------------------------*)
FUNCTION IsTimeSharingActive : BOOLEAN;
(*--------------------------------------------------------------------------*)
(* *)
(* Function: IsTimeSharingActive *)
(* *)
(* Purpose: Checks if multitasker is active *)
(* *)
(* Calling Sequence: *)
(* *)
(* Ts_On := IsTimeSharingActive : BOOLEAN; *)
(* *)
(* Ts_On --- TRUE if multitasker is active. *)
(* *)
(* Calls: MsDos *)
(* *)
(*--------------------------------------------------------------------------*)
VAR
Regs : Registers;
(*--------------------------------------------------------------------------*)
FUNCTION Get_TopView_Screen_Address : BOOLEAN;
VAR
SegS : INTEGER;
SegO : INTEGER;
BEGIN (* Get_TopView_Screen_Address *)
Regs.Di := 0;
Regs.Ax := $FE00;
Regs.Es := SEG( DesqView_Screen^ );
SegO := 0;
SegS := Regs.Es;
INTR( $10 , Regs );
DesqView_Screen := PTR( Regs.Es , Regs.Di );
Get_TopView_Screen_Address := ( ( Regs.Es <> SegS )