1 /* ***********************************************************
 2    *                                                         *
 3    * Copyright, (C) Honeywell Bull Inc., 1987                *
 4    *                                                         *
 5    * Copyright, (C) Honeywell Information Systems Inc., 1986 *
 6    *                                                         *
 7    *********************************************************** */
 8 
 9 /* HISTORY COMMENTS:
10   1) change(86-09-05,Lee), approve(87-07-13,MCR7580), audit(87-07-13,Leskiw),
11      install(87-08-07,MR12.1-1072):
12      Created.
13                                                    END HISTORY COMMENTS */
14 
15 /* : PROCEDURE FUNCTION (get_cursor_pos)
16 
17 Return the absolute coordinates of the cursor in x,y
18 */
19 
20 #include <dos.h>
21 #include <emulator.h>
22 
23 #define VIDEO_IO    0x10
24 #define GET_CURSOR  0x03
25 #define GET_WIDTH   0x0F
26 
27 #if EM_DEBUG                           /* Do NOT compile if !EM_DEBUG */
28 
29 get_cursor_pos(x,y)
30 
31 int *x;
32 int *y;
33 {
34 union REGS inregs;
35 union REGS outregs;
36 
37    inregs.h.ah = GET_CURSOR;
38    inregs.h.bh = 0;
39 
40    int86(VIDEO_IO,&inregs,&outregs);
41 
42    *x = outregs.h.dh;
43    *y = outregs.h.dl;
44 }
45 
46 /* : PROCEDURE FUNCTION (get_screen_width)
47 
48 Return the width of screen in columns
49 */
50 
51 get_screen_width()
52 {
53 union REGS inregs;
54 union REGS outregs;
55 int screen_width;
56 
57    inregs.h.ah = GET_WIDTH;
58    int86(VIDEO_IO,&inregs,&outregs);
59    screen_width = outregs.h.ah;
60 
61    return(screen_width);
62 }
63 
64 #else
65 get_cursor_pos()
66 {}
67 get_screen_width()
68 {}
69 #endif