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; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #define TEXTMODE_BUFFER 0xb8000
23 #define TEXTMODE_BUFFER_SIZE 0x8000
33 /* If we are displaying a CR '\n' then do a LF also */
40 /* If we are displaying a TAB '\t' then display 8 spaces ' ' */
43 /* Display the 8 spaces ' ' */
56 * VIDEO - TELETYPE OUTPUT
59 * AL = character to write
61 * BL = foreground color (graphics modes only)
66 Int386(0x10, &Regs
, &Regs
);
75 * KEYBOARD - CHECK FOR KEYSTROKE
79 * ZF set if no keystroke available
80 * ZF clear if keystroke available
82 * AL = ASCII character
85 Int386(0x16, &Regs
, &Regs
);
87 return 0 == (Regs
.x
.eflags
& I386FLAG_ZF
);
94 static BOOL ExtendedKey
= FALSE
;
95 static char ExtendedScanCode
= 0;
97 /* If the last time we were called an
98 * extended key was pressed then return
99 * that keys scan code. */
103 return ExtendedScanCode
;
107 * KEYBOARD - GET KEYSTROKE
111 * AH = BIOS scan code
112 * AL = ASCII character
115 Int386(0x16, &Regs
, &Regs
);
117 /* Check for an extended keystroke */
121 ExtendedScanCode
= Regs
.b
.ah
;
124 /* Return keystroke */