home *** CD-ROM | disk | FTP | other *** search
-
- /* cur_control(cursor, start, stop) sets cursor size and visibility
-
- Copyright (c) 1985 by JMI Software Consultants, Inc.
-
- */
-
- #include "acom.h"
- #include "host.h"
-
- VOID cur_control(cursor, start, stop)
- INT cursor, start, stop;
- {
- INTERN REGVAL cur_type = {0x0100, 0x0000, 0x0C0D, 0x0000};
- INTERN REGVAL cga_type = {0x0100, 0x0000, 0x0607, 0x0000};
- BITS cx;
- REGVAL r;
- LOCAL BOOL colordev = NO;
- LOCAL BOOL firsttime = YES;
-
- if (firsttime)
- {
- firsttime = NO;
- int86(0x11, &cga_type, &r);
- if ((~r.ax) & 0x0030)
- colordev = YES;
- }
- if (colordev)
- cx = cga_type.cx;
- else
- cx = cur_type.cx;
- if (start != -1)
- {
- if (start < 0 || start > 31)
- xerror(1, "LOCATE");
- else
- cx = (cx & 0x00ff) | (start << 8);
- if (stop == -1)
- stop = start;
- if (stop < 0 || stop > 31)
- xerror(1, "LOCATE");
- else
- cx = (cx & 0xff00) | stop;
- }
- if (cursor != -1)
- if (cursor == 0)
- cx |= 0x2000;
- else
- if (cursor == 1)
- cx &= 0x1f1f;
- else
- xerror(1, "LOCATE");
- if (!colordev && cx != cur_type.cx)
- {
- cur_type.cx = cx;
- int86(0x10, &cur_type, &r);
- }
- else if (cga_type.cx != cx)
- {
- cga_type.cx = cx;
- int86(0x10, &cga_type, &r);
- }
- }