home *** CD-ROM | disk | FTP | other *** search
- (*
- ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
- ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
- ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
- ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
- ▓▓▓▓▓▓▓▓·── ──·▓▓▓▓▓▓▓▓▓▓▓
- ▓▓▓▓▓▓▓▓│ │░░▓▓▓▓▓▓▓▓▓
- ▓▓▓▓▓▓▓▓ Unit was conceived, designed and written ░░▓▓▓▓▓▓▓▓▓
- ▓▓▓▓▓▓▓▓ by Floor A.C. Naaijkens for ░░▓▓▓▓▓▓▓▓▓
- ▓▓▓▓▓▓▓▓ UltiHouse Software / The ECO Group. ░░▓▓▓▓▓▓▓▓▓
- ▓▓▓▓▓▓▓▓ ░░▓▓▓▓▓▓▓▓▓
- ▓▓▓▓▓▓▓▓ (C) MCMXCII by EUROCON PANATIONAL CORPORATION. ░░▓▓▓▓▓▓▓▓▓
- ▓▓▓▓▓▓▓▓ All Rights Reserved for The ECO Group. ░░▓▓▓▓▓▓▓▓▓
- ▓▓▓▓▓▓▓▓ ░░▓▓▓▓▓▓▓▓▓
- ▓▓▓▓▓▓▓▓│ │░░▓▓▓▓▓▓▓▓▓
- ▓▓▓▓▓▓▓▓·── ──·░░▓▓▓▓▓▓▓▓▓
- ▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓▓▓▓▓
- ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
- ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
- ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
- *)
- {$O+,F+}
- unit eco_mou;
- interface
-
- uses
- dos
-
- ; { for interrupts and registers }
-
-
- const
- mdd = $33; { interrupt for mouse device driver }
- hardware = 1; { cursor types }
- software = 0;
- left = 0; { mouse buttons }
- right = 1;
- middle = 2;
-
- type
- resetrec = record { initialized by mouse function 0 }
- exists : boolean; { true if mouse is present }
- nbuttons : integer; { # buttons on mouse }
- end;
-
- locrec = record { initialized by mouse fcns 3, 5, and 6 }
- buttonstatus, { bits 0-2 on if corresp button is down }
- opcount, { # times button has been clicked }
- { opcount not returned by fcn 3 }
- column, { position }
- row : integer;
- end;
-
- moverec = record { initialized by mouse fcn 11 }
- hcount, { net horizontal movement }
- vcount : integer; { net vertical movement }
- end;
-
- var reg : registers;
-
- { these are the microsoft mouse functions }
- {$f+}
- procedure mreset (var mouse : resetrec); { function 0 }
- procedure mshow; { function 1 }
- procedure mhide; { function 2 }
- procedure mpos (var mouse : locrec); { function 3 }
- procedure mmoveto (col, row : integer); { function 4 }
- procedure mpressed (button : integer;
- var mouse : locrec); { function 5 }
- procedure mreleased (button : integer;
- var mouse : locrec); { function 6 }
- procedure mcolrange (min, max : integer); { function 7 }
- procedure mrowrange (min, max : integer); { function 8 }
- procedure mgraphcursor (hhot, vhot : integer;
- maskseg, maskofs : word); { function 9 }
- procedure mtextcursor (ctype, p1, p2 : word); { function 10 }
- procedure mmotion (var moved : moverec); { function 11 }
- procedure minsttask (mask,
- taskseg, taskofs : word); { function 12 }
- procedure mlpenon; { function 13 }
- procedure mlpenoff; { function 14 }
- procedure mratio (horiz, vert : integer); { function 15 }
- {$f-}
- { ---------------------------------------------------------- }
-
-
-
-
- implementation
-
-
-
-
-
- function lower (n1, n2 : integer) : integer; { local to unit}
- begin
- if n1 < n2 then lower := n1
- else lower := n2;
- end;
-
- function upper (n1, n2 : integer) : integer; { local to unit }
- begin
- if n1 > n2 then upper := n1
- else upper := n2;
- end;
- { --------------------------- }
- procedure mreset; { resets mouse to default condition }
- begin
- reg.ax := 0;
- intr (mdd, reg);
- if reg.ax <> 0 then
- mouse.exists := true
- else
- mouse.exists := false;
- mouse.nbuttons := reg.bx;
- end;
- { --------------------------- }
- procedure mshow; { make mouse cursor visible }
- begin
- reg.ax := 1;
- intr (mdd, reg);
- end;
- { --------------------------- }
- procedure mhide; { make mouse cursor invisible }
- begin
- reg.ax := 2;
- intr (mdd, reg);
- end;
- { --------------------------- }
- procedure mpos; { get mouse status and position }
- begin
- reg.ax := 3;
- intr (mdd, reg);
- mouse.buttonstatus := reg.bx;
- mouse.column := reg.cx;
- mouse.row := reg.dx;
- end;
- { --------------------------- }
- procedure mmoveto; { move mouse cursor to new location }
- begin
- reg.ax := 4;
- reg.cx := col;
- reg.dx := row;
- intr (mdd, reg);
- end;
- { --------------------------- }
- procedure mpressed; { get pressed info about a given button }
- begin
- reg.ax := 5;
- reg.bx := button;
- intr (mdd, reg);
- mouse.buttonstatus := reg.ax;
- mouse.opcount := reg.bx;
- mouse.column := reg.cx;
- mouse.row := reg.dx;
- end;
- { --------------------------- }
- procedure mreleased; { get released into about a button }
- begin
- reg.ax := 6;
- reg.bx := button;
- intr (mdd, reg);
- mouse.buttonstatus := reg.ax;
- mouse.opcount := reg.bx;
- mouse.column := reg.cx;
- mouse.row := reg.dx;
- end;
- { --------------------------- }
- procedure mcolrange; { set column range for mouse }
- begin
- reg.ax := 7;
- reg.cx := lower (min, max);
- reg.dx := upper (min, max);
- intr (mdd, reg);
- end;
- { --------------------------- }
- procedure mrowrange; { set row range for mouse }
- begin
- reg.ax := 8;
- reg.cx := lower (min, max);
- reg.dx := upper (min, max);
- intr (mdd, reg);
- end;
- { --------------------------- }
- procedure mgraphcursor; { set mouse graphics cursor }
- begin
- reg.ax := 9;
- reg.bx := hhot;
- reg.cx := vhot;
- reg.dx := maskofs;
- reg.es := maskseg;
- intr (mdd, reg);
- end;
- { --------------------------- }
- procedure mtextcursor; { set mouse text cursor }
-
- { notes: }
- { type 0 is the software cursor. when specified, p1 }
- { and p2 are the screen and cursor masks. }
- { type 1 is the hardware cursor. when specified, p1 }
- { and p2 are the start and stop scan lines, i.e. }
- { the cursor shape. }
-
- begin
- reg.ax := 10;
- reg.bx := ctype;
- reg.cx := p1;
- reg.dx := p2;
- intr (mdd, reg);
- end;
- { --------------------------- }
- procedure mmotion; { net movement of mouse since last call }
- { expressed in mickeys (1/100") }
- begin
- reg.ax := 11;
- intr (mdd, reg);
- moved.hcount := reg.cx;
- moved.vcount := reg.dx;
- end;
- { --------------------------- }
- procedure minsttask; { install user-defined task }
- begin
- reg.ax := 12;
- reg.cx := mask;
- reg.dx := taskofs;
- reg.es := taskseg;
- intr (mdd, reg);
- end;
- { --------------------------- }
- procedure mlpenon; { turn on light pen emulation (default) }
- begin
- reg.ax := 14;
- intr (mdd, reg);
- end;
- { --------------------------- }
- procedure mlpenoff; { turn off light pen emulation }
- begin
- reg.ax := 15;
- intr (mdd, reg);
- end;
- { --------------------------- }
- procedure mratio; { set mickey to pixel ratio }
-
- { notes: }
- { ratios are r/8. }
- { default is 16 for vertical, 8 for horizontal }
-
- begin
- reg.ax := 15;
- reg.cx := horiz;
- reg.dx := vert;
- end;
- { --------------------------- }
-
- end.
-