-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDIAG.C
More file actions
40 lines (35 loc) · 1.39 KB
/
Copy pathDIAG.C
File metadata and controls
40 lines (35 loc) · 1.39 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
/* ------------------------------------------------------------------
* DIAG.C - live MOUSE readout (v3). Text is confirmed working, so we
* print what the int 33h driver reports as you move/click the mouse.
* Build: set MAIN=DIAG.C in BUILD.BAT, run BUILD, then run DIAG
* IMPORTANT: capture the mouse in DOSBox first (press CTRL-F10, or
* click once inside the window) so movement reaches the DOS program.
* ------------------------------------------------------------------ */
#include "libregra.h"
#include "raton.h"
#include <stdio.h>
void main(void)
{
int x, y, bi, bc, bd, hay = 0;
char buf[80];
iniciagra();
resetraton();
hayraton(&hay); /* hay != 0 -> a mouse driver answered */
cursorraton(3); /* show the cursor, like simso does */
setcolor(15);
outtextxy(20, 20, "MOUSE READOUT - move to the 4 corners, click buttons");
outtextxy(20, 35, "Press any KEY to exit.");
sprintf(buf, "hayraton (mouse present) = %d", hay);
outtextxy(20, 55, buf);
while (!kbhit()) {
estadoraton(&x, &y, &bi, &bc, &bd);
setfillstyle(1, 0); /* black */
bar(20, 80, 620, 100); /* wipe the previous readout line */
setcolor(14);
sprintf(buf, "x=%d y=%d left=%d center=%d right=%d",
x, y, bi, bc, bd);
outtextxy(20, 85, buf);
delay(15);
}
closegraph();
}