Author: hbelusca
Date: Wed May 14 18:50:29 2014
New Revision: 63297
URL:
http://svn.reactos.org/svn/reactos?rev=63297&view=rev
Log:
[NTVDM]: Introduce a echo state for INT 21h, AH=01h and AH=3Fh.
Modified:
trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dos.c
trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dos.h
trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dosfiles.c
Modified: trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dos.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/dos/dos32…
==============================================================================
--- trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dos.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dos.c [iso-8859-1] Wed May 14 18:50:29
2014
@@ -39,6 +39,9 @@
static BYTE DosAllocStrategy = DOS_ALLOC_BEST_FIT;
static BOOLEAN DosUmbLinked = FALSE;
static WORD DosErrorLevel = 0x0000;
+
+/* Echo state for INT 21h, AH = 01h and AH = 3Fh */
+BOOLEAN DoEcho = FALSE;
/* PRIVATE FUNCTIONS **********************************************************/
@@ -1434,8 +1437,9 @@
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;
@@ -1576,6 +1580,8 @@
while (Count < InputBuffer->MaxLength)
{
+ // FIXME!! This function should interpret backspaces etc...
+
/* Try to read a character (wait) */
Character = DosReadCharacter(DOS_INPUT_HANDLE);
@@ -2051,10 +2057,14 @@
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)
{
Modified: trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dos.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/dos/dos32…
==============================================================================
--- trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dos.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dos.h [iso-8859-1] Wed May 14 18:50:29
2014
@@ -160,6 +160,8 @@
#pragma pack(pop)
+extern BOOLEAN DoEcho;
+
/* FUNCTIONS ******************************************************************/
extern CALLBACK16 DosContext;
Modified: trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dosfiles.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/dos/dos32…
==============================================================================
--- trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dosfiles.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dosfiles.c [iso-8859-1] Wed May 14
18:50:29 2014
@@ -167,15 +167,14 @@
/* 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;
}