-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMTEST2.C
More file actions
52 lines (45 loc) · 1.72 KB
/
Copy pathMTEST2.C
File metadata and controls
52 lines (45 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/* ------------------------------------------------------------------
* MTEST2.C - same raw INT 33h probe as MTEST.C, but run AFTER
* iniciagra() (i.e. inside BGI graphics mode). Bypasses RATON.LIB
* entirely. Compares against MTEST.C (text mode) to isolate whether
* entering graphics mode is what breaks mouse reporting.
* Build: set MAIN=MTEST2.C in BUILD.BAT, run BUILD, then run MTEST2
* ------------------------------------------------------------------ */
#include "libregra.h" /* iniciagra() + graphics.h */
#include <dos.h>
#include <stdio.h>
#include <conio.h>
void main(void)
{
union REGS in, out;
char buf[80];
long count = 0;
iniciagra(); /* enter BGI graphics mode, like DIAG/simso */
setcolor(15);
outtextxy(20, 20, "MTEST2 - raw INT 33h probe INSIDE graphics mode");
in.x.ax = 0; /* AX=0: reset mouse / driver check */
int86(0x33, &in, &out);
sprintf(buf, "AX=%04X BX=%04X (present if AX=FFFF)", out.x.ax, out.x.bx);
outtextxy(20, 40, buf);
if (out.x.ax != 0xFFFF) {
outtextxy(20, 60, "Driver did NOT respond inside graphics mode.");
outtextxy(20, 75, "Press any key to exit.");
getch();
closegraph();
return;
}
outtextxy(20, 60, "Driver responded. Move mouse / click. Press KEY to exit.");
while (!kbhit()) {
in.x.ax = 3; /* AX=3: get position + buttons */
int86(0x33, &in, &out);
setfillstyle(1, 0);
bar(20, 90, 620, 110);
setcolor(14);
sprintf(buf, "#%-6ld buttons(BX)=%04X x(CX)=%-5d y(DX)=%-5d",
count++, out.x.bx, out.x.cx, out.x.dx);
outtextxy(20, 95, buf);
delay(50);
}
getch();
closegraph();
}