source: bootcd/isolinux/syslinux-6.03/com32/cmenu/libmenu/com32io.c @ 26ffad7

Last change on this file since 26ffad7 was e16e8f2, checked in by Edwin Eefting <edwin@datux.nl>, 3 years ago

bootstuff

  • Property mode set to 100644
File size: 2.1 KB
Line 
1/* -*- c -*- ------------------------------------------------------------- *
2 *
3 *   Copyright 2004-2005 Murali Krishnan Ganapathy - All Rights Reserved
4 *
5 *   This program is free software; you can redistribute it and/or modify
6 *   it under the terms of the GNU General Public License as published by
7 *   the Free Software Foundation, Inc., 53 Temple Place Ste 330,
8 *   Boston MA 02111-1307, USA; either version 2 of the License, or
9 *   (at your option) any later version; incorporated herein by reference.
10 *
11 * ----------------------------------------------------------------------- */
12
13#include <string.h>
14#include <com32.h>
15#include "com32io.h"
16#include "tui.h"
17#include "syslnx.h"
18
19com32sys_t inreg, outreg;       // Global register sets for use
20
21void getpos(char *row, char *col, char page)
22{
23    memset(&inreg, 0, sizeof inreg);
24    REG_AH(inreg) = 0x03;
25    REG_BH(inreg) = page;
26    __intcall(0x10, &inreg, &outreg);
27    *row = REG_DH(outreg);
28    *col = REG_DL(outreg);
29}
30
31char inputc(char *scancode)
32{
33    syslinux_idle();            /* So syslinux can perform periodic activity */
34    memset(&inreg, 0, sizeof inreg);
35    REG_AH(inreg) = 0x10;
36    __intcall(0x16, &inreg, &outreg);
37    if (scancode)
38        *scancode = REG_AH(outreg);
39    return REG_AL(outreg);
40}
41
42void getcursorshape(char *start, char *end)
43{
44    char page = 0; // XXX TODO
45    memset(&inreg, 0, sizeof inreg);
46    REG_AH(inreg) = 0x03;
47    REG_BH(inreg) = page;
48    __intcall(0x10, &inreg, &outreg);
49    *start = REG_CH(outreg);
50    *end = REG_CL(outreg);
51}
52
53void setcursorshape(char start, char end)
54{
55    memset(&inreg, 0, sizeof inreg);
56    REG_AH(inreg) = 0x01;
57    REG_CH(inreg) = start;
58    REG_CL(inreg) = end;
59    __intcall(0x10, &inreg, &outreg);
60}
61
62void setvideomode(char mode)
63{
64    memset(&inreg, 0, sizeof inreg);
65    REG_AH(inreg) = 0x00;
66    REG_AL(inreg) = mode;
67    __intcall(0x10, &inreg, &outreg);
68}
69
70// Get char displayed at current position
71unsigned char getcharat(char page)
72{
73    memset(&inreg, 0, sizeof inreg);
74    REG_AH(inreg) = 0x08;
75    REG_BH(inreg) = page;
76    __intcall(0x16, &inreg, &outreg);
77    return REG_AL(outreg);
78}
Note: See TracBrowser for help on using the repository browser.