--- truecrypt/boot/windows/bootconsoleio.cpp 2018/04/24 16:49:04 1.1 +++ truecrypt/boot/windows/bootconsoleio.cpp 2018/04/24 16:53:20 1.1.1.4 @@ -28,7 +28,7 @@ void EnableScreenOutput () void PrintChar (char c) { -#ifdef TC_TRACING_ENABLED +#ifdef TC_BOOT_TRACING_ENABLED WriteDebugPort (c); #endif @@ -198,6 +198,9 @@ byte GetShiftFlags () byte GetKeyboardChar (byte *scanCode) { + // Work around a bug in the Apple BIOS + while (!IsKeyboardCharAvailable()); + byte asciiCode; byte scan; __asm @@ -231,6 +234,22 @@ bool IsKeyboardCharAvailable () } +void ClearBiosKeystrokeBuffer () +{ + __asm + { + push es + xor ax, ax + mov es, ax + mov di, 0x41e + mov cx, 32 + cld + rep stosb + pop es + } +} + + bool IsPrintable (char c) { return c >= ' ' && c <= '~';