Added support for regular files with int 21 ax =4406 (get input status)
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1166
This commit is contained in:
parent
dc824945f5
commit
359e55ed8c
1 changed files with 15 additions and 3 deletions
|
@ -16,6 +16,8 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: dos_ioctl.cpp,v 1.12 2003-07-27 12:12:05 qbix79 Exp $ */
|
||||
|
||||
#include <string.h>
|
||||
#include "dosbox.h"
|
||||
#include "callback.h"
|
||||
|
@ -43,9 +45,19 @@ bool DOS_IOCTL(void) {
|
|||
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;
|
||||
} else { // FILE
|
||||
Bit32u oldlocation=0;
|
||||
Files[handle]->Seek(&oldlocation, DOS_SEEK_CUR);
|
||||
Bit32u endlocation=0;
|
||||
Files[handle]->Seek(&endlocation, DOS_SEEK_END);
|
||||
if(oldlocation < endlocation){//Still data available
|
||||
reg_al=0x0;
|
||||
} else
|
||||
{
|
||||
reg_al=0xff; //EOF or beyond
|
||||
}
|
||||
Files[handle]->Seek(&oldlocation, DOS_SEEK_SET); //restore filelocation
|
||||
LOG(LOG_IOCTL,LOG_NORMAL)("06:Used Get Input Status on regualar file with handle %d",handle);
|
||||
}
|
||||
return true;
|
||||
case 0x07: /* Get Output Status */
|
||||
|
|
Loading…
Add table
Reference in a new issue