From 9bbec94977dfdcddd405578c792297ee2cff67b8 Mon Sep 17 00:00:00 2001 From: Sjoerd van der Berg Date: Tue, 8 Jul 2003 16:51:26 +0000 Subject: [PATCH] Slightly better support for ioctl function 0x6 Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1097 --- src/dos/dos_ioctl.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/dos/dos_ioctl.cpp b/src/dos/dos_ioctl.cpp index e2602186..f509242a 100644 --- a/src/dos/dos_ioctl.cpp +++ b/src/dos/dos_ioctl.cpp @@ -40,8 +40,16 @@ bool DOS_IOCTL(void) { case 0x00: /* Get Device Information */ reg_dx=Files[handle]->GetInformation(); return true; + case 0x06: /* Get Input Status */ + if (Files[handle]->GetInformation() & 0x8000) { //Check for device + reg_al=(Files[handle]->GetInformation() & 0x40) ? 0xff : 0; + } else { + LOG(LOG_IOCTL,LOG_NORMAL)("06:Unsupported File handle %d",handle); + reg_al=0xff; + } + return true; case 0x07: /* Get Output Status */ - LOG(LOG_IOCTL,LOG_NORMAL)("DOS:IOCTL:07:Fakes output status is ready for handle %d",handle); + LOG(LOG_IOCTL,LOG_NORMAL)("07:Fakes output status is ready for handle %d",handle); reg_al=0xff; return true; case 0x08: /* Check if block device removable */ @@ -93,13 +101,6 @@ bool DOS_IOCTL(void) { return false; } break; - case 0x06: /* Get Input Status */ - if(reg_bx==0x00) { /* might work for other handles, but tested it only for STDIN */ - if(Files[handle]->GetInformation() & 0x40) reg_al=0x00; else - reg_al=0xFF; - return true; - break; - } default: LOG(LOG_DOSMISC,LOG_ERROR)("DOS:IOCTL Call %2X unhandled",reg_al); return false;