static BOOLEAN DosUmbLinked = FALSE;
static WORD DosErrorLevel = 0x0000;
+/* Echo state for INT 21h, AH = 01h and AH = 3Fh */
+BOOLEAN DoEcho = FALSE;
+
/* PRIVATE FUNCTIONS **********************************************************/
/*
case 0x01:
{
// FIXME: Under DOS 2+, input / output handle may be redirected!!!!
+ DoEcho = TRUE;
Character = DosReadCharacter(DOS_INPUT_HANDLE);
- DosPrintCharacter(DOS_OUTPUT_HANDLE, Character);
+ DoEcho = FALSE;
// /* Let the BOP repeat if needed */
// if (getCF()) break;
while (Count < InputBuffer->MaxLength)
{
+ // FIXME!! This function should interpret backspaces etc...
+
/* Try to read a character (wait) */
Character = DosReadCharacter(DOS_INPUT_HANDLE);
case 0x3F:
{
WORD BytesRead = 0;
- WORD ErrorCode = DosReadFile(getBX(),
- SEG_OFF_TO_PTR(getDS(), getDX()),
- getCX(),
- &BytesRead);
+ WORD ErrorCode;
+
+ DoEcho = TRUE;
+ ErrorCode = DosReadFile(getBX(),
+ SEG_OFF_TO_PTR(getDS(), getDX()),
+ getCX(),
+ &BytesRead);
+ DoEcho = FALSE;
if (ErrorCode == ERROR_SUCCESS)
{
/* Retrieve the character in AL (scan code is in AH) */
Character = getAL();
- // FIXME: Sometimes we need echo, some other times not.
- // DosPrintCharacter(DOS_OUTPUT_HANDLE, Character);
+ if (DoEcho) DosPrintCharacter(DOS_OUTPUT_HANDLE, Character);
((PCHAR)Buffer)[BytesRead32] = Character;
/* Stop on first carriage return */
if (Character == '\r')
{
- // DosPrintCharacter(DOS_OUTPUT_HANDLE, '\n');
+ if (DoEcho) DosPrintCharacter(DOS_OUTPUT_HANDLE, '\n');
break;
}