forked from Bill-Gray/PDCursesMod
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpdcgetsc.c
More file actions
47 lines (29 loc) · 835 Bytes
/
pdcgetsc.c
File metadata and controls
47 lines (29 loc) · 835 Bytes
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
/* PDCurses */
#include "pdcdos.h"
#include <stdlib.h>
/* return width of screen/viewport */
int PDC_get_columns(void)
{
int cols;
PDC_LOG(("PDC_get_columns() - called\n"));
cols = PDC_state.video_width / PDC_state.font_width;
PDC_LOG(("PDC_get_columns() - returned: cols %d\n", cols));
return cols;
}
/* get the cursor size/shape */
int PDC_get_cursor_mode(void)
{
int start = PDC_state.font_height * 3 / 4;
int end = PDC_state.font_height - 1;
PDC_LOG(("PDC_get_cursor_mode() - called\n"));
return (start << 8) | end;
}
/* return number of screen rows */
int PDC_get_rows(void)
{
int rows;
PDC_LOG(("PDC_get_rows() - called\n"));
rows = PDC_state.video_height / PDC_state.font_height;
PDC_LOG(("PDC_get_rows() - returned: rows %d\n", rows));
return rows;
}