1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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
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
47
48
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