-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMTEST.C
More file actions
41 lines (36 loc) · 1.41 KB
/
Copy pathMTEST.C
File metadata and controls
41 lines (36 loc) · 1.41 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
/* ------------------------------------------------------------------
* MTEST.C - direct INT 33h probe, bypassing RATON.LIB completely.
* Tests DOSBox's mouse emulation at the lowest level so we know
* whether the problem is in DOSBox or in the RATON library.
* Build: set MAIN=MTEST.C in BUILD.BAT, run BUILD, then run MTEST
* (plain text mode - no iniciagra() needed)
* ------------------------------------------------------------------ */
#include <dos.h>
#include <stdio.h>
#include <conio.h>
void main(void)
{
union REGS in, out;
long count = 0;
printf("Calling INT 33h, AX=0 (reset mouse / driver check)...\n");
in.x.ax = 0;
int86(0x33, &in, &out);
printf(" -> AX=%04X BX=%04X (driver present if AX=FFFF; BX=button count)\n\n",
out.x.ax, out.x.bx);
if (out.x.ax != 0xFFFF) {
printf("No mouse driver responded to DOSBox/DOS. Nothing else to test.\n");
printf("Press any key to exit.\n");
getch();
return;
}
printf("Driver present. Now polling raw position/buttons.\n");
printf("Move the mouse and click; press a KEYBOARD key to exit.\n\n");
while (!kbhit()) {
in.x.ax = 3; /* AX=3: get position and button status */
int86(0x33, &in, &out);
printf("\r#%-6ld buttons(BX)=%04X x(CX)=%-5d y(DX)=%-5d ",
count++, out.x.bx, out.x.cx, out.x.dx);
delay(100);
}
getch();
}