diff --git a/dlls/winedos/dosexe.h b/dlls/winedos/dosexe.h index 4a82f7c409b..45c77ef3359 100644 --- a/dlls/winedos/dosexe.h +++ b/dlls/winedos/dosexe.h @@ -79,6 +79,7 @@ extern BYTE WINAPI DOSVM_Int09ReadScan(BYTE*ascii); /* int10.c */ extern void WINAPI DOSVM_Int10Handler(CONTEXT86*); +extern void WINAPI DOSVM_PutChar(BYTE ascii); /* int16.c */ extern void WINAPI DOSVM_Int16Handler(CONTEXT86*); diff --git a/dlls/winedos/int10.c b/dlls/winedos/int10.c index a6cf7db0e9c..916f662d845 100644 --- a/dlls/winedos/int10.c +++ b/dlls/winedos/int10.c @@ -27,6 +27,7 @@ #include "vga.h" #include "wine/debug.h" #include "console.h" +#include "dosexe.h" WINE_DEFAULT_DEBUG_CHANNEL(int); @@ -548,7 +549,7 @@ void WINAPI DOSVM_Int10Handler( CONTEXT86 *context ) case 0x0e: /* TELETYPE OUTPUT */ TRACE("Teletype Output\n"); - CONSOLE_Write(AL_reg(context), 0, 0, 0); + DOSVM_PutChar(AL_reg(context)); break; case 0x0f: /* GET CURRENT VIDEO MODE */ @@ -826,3 +827,22 @@ static void scroll_window(int direction, char lines, char row1, } } + +/********************************************************************** + * DOSVM_PutChar + * + */ + +void WINAPI DOSVM_PutChar(BYTE ascii) +{ + BIOSDATA *data = DOSMEM_BiosData(); + unsigned xpos, ypos; + + TRACE("char: 0x%02x\n", ascii); + + // FIXME: Update VGA text buffers here... + WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), &ascii, 1, NULL, NULL); + + VGA_GetCursorPos(&xpos, &ypos); + BIOS_SetCursorPos(data, 0, xpos, ypos); +} diff --git a/dlls/winedos/int21.c b/dlls/winedos/int21.c index fa9155b82d8..40192d64c2d 100644 --- a/dlls/winedos/int21.c +++ b/dlls/winedos/int21.c @@ -92,7 +92,7 @@ void WINAPI DOSVM_Int21Handler( CONTEXT86 *context ) case 0x02: /* WRITE CHARACTER TO STANDARD OUTPUT */ TRACE("Write Character to Standard Output\n"); - CONSOLE_Write(DL_reg(context), 0, 0, 0); + DOSVM_PutChar(DL_reg(context)); break; case 0x06: /* DIRECT CONSOLE IN/OUTPUT */ @@ -123,7 +123,7 @@ void WINAPI DOSVM_Int21Handler( CONTEXT86 *context ) } } else { TRACE("Direct Console Output\n"); - CONSOLE_Write(DL_reg(context), 0, 0, 0); + DOSVM_PutChar(DL_reg(context)); } break; @@ -163,6 +163,20 @@ void WINAPI DOSVM_Int21Handler( CONTEXT86 *context ) } break; + case 0x40: /* WRITE TO FILE OR DEVICE */ + /* Writes to stdout are handled here. */ + if (BX_reg(context) == 1) { + BYTE *ptr = CTX_SEG_OFF_TO_LIN(context, + context->SegDs, + context->Edx); + int i; + + for(i=0; i