1 /* -*- c -*- ------------------------------------------------------------- *
3 * Copyright 2004-2005 Murali Krishnan Ganapathy - All Rights Reserved
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.
11 * ----------------------------------------------------------------------- */
19 com32sys_t inreg
, outreg
; // Global register sets for use
21 void getpos(char *row
, char *col
, char page
)
23 memset(&inreg
, 0, sizeof inreg
);
26 __intcall(0x10, &inreg
, &outreg
);
27 *row
= REG_DH(outreg
);
28 *col
= REG_DL(outreg
);
31 char inputc(char *scancode
)
33 syslinux_idle(); /* So syslinux can perform periodic activity */
34 memset(&inreg
, 0, sizeof inreg
);
36 __intcall(0x16, &inreg
, &outreg
);
38 *scancode
= REG_AH(outreg
);
39 return REG_AL(outreg
);
42 void getcursorshape(char *start
, char *end
)
44 char page
= 0; // XXX TODO
45 memset(&inreg
, 0, sizeof inreg
);
48 __intcall(0x10, &inreg
, &outreg
);
49 *start
= REG_CH(outreg
);
50 *end
= REG_CL(outreg
);
53 void setcursorshape(char start
, char end
)
55 memset(&inreg
, 0, sizeof inreg
);
57 REG_CH(inreg
) = start
;
59 __intcall(0x10, &inreg
, &outreg
);
62 void setvideomode(char mode
)
64 memset(&inreg
, 0, sizeof inreg
);
67 __intcall(0x10, &inreg
, &outreg
);
70 // Get char displayed at current position
71 unsigned char getcharat(char page
)
73 memset(&inreg
, 0, sizeof inreg
);
76 __intcall(0x16, &inreg
, &outreg
);
77 return REG_AL(outreg
);