Adding upstream version 4.02+dfsg.
[syslinux-debian/hramrach.git] / com32 / cmenu / libmenu / com32io.h
blobd9cce3d64c1d0ed8f89187ecc630e3c3852e65a3
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 * ----------------------------------------------------------------------- */
13 #ifndef __COM32IO_H__
14 #define __COM32IO_H__
16 #include <com32.h>
17 #include <stdio.h>
18 #include <libansi.h>
20 #ifndef NULL
21 #define NULL ((void *)0)
22 #endif
24 /* Bits representing ShiftFlags, See Int16/Function 2 or Mem[0x417] to get this info */
26 #define INSERT_ON (1<<7)
27 #define CAPSLOCK_ON (1<<6)
28 #define NUMLOCK_ON (1<<5)
29 #define SCRLLOCK_ON (1<<4)
30 #define ALT_PRESSED (1<<3)
31 #define CTRL_PRESSED (1<<2)
32 // actually 1<<1 is Left Shift, 1<<0 is right shift
33 #define SHIFT_PRESSED (1<<1 | 1 <<0)
35 /* BIOS Assisted output routines */
37 void getpos(char *row, char *col, char page);
39 char inputc(char *scancode); // Return ASCII char by val, and scancode by reference
41 void setcursorshape(char start, char end); // Set cursor shape
42 void getcursorshape(char *start, char *end); // Get shape for current page
44 // Get char displayed at current position in specified page
45 unsigned char getcharat(char page);
47 static inline unsigned char readbiosb(unsigned int ofs)
49 return *((unsigned char *)MK_PTR(0, ofs));
52 static inline char getshiftflags(void)
54 return readbiosb(0x417);
57 void scrollupwindow(char top, char left, char bot, char right, char attr, char numlines); //Scroll up given window
59 void setvideomode(char mode); // Set the video mode.
61 static inline char getvideomode(void) // Get the current video mode
63 return readbiosb(0x449);
66 #endif