From b11c036b84d53b8abc1c1ce638a8c3f5e2da04f0 Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Wed, 15 Sep 2004 18:52:00 +0000 Subject: [PATCH] Added NUL Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1979 --- src/dos/dos_devices.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/dos/dos_devices.cpp b/src/dos/dos_devices.cpp index aad4cc79..a9dad893 100644 --- a/src/dos/dos_devices.cpp +++ b/src/dos/dos_devices.cpp @@ -34,6 +34,27 @@ static DOS_Device * devices[MAX_DEVICES]; static Bit32u device_count; +class device_NUL : public DOS_Device { +public: + device_NUL() { name="NUL"; }; + bool Read(Bit8u * data,Bit16u * size) { + for(Bitu i = 0; i < *size;i++) + data[i]=0; + LOG(LOG_IOCTL,LOG_NORMAL)("NUL:READ"); + return true; + } + bool Write(Bit8u * data,Bit16u * size) { + LOG(LOG_IOCTL,LOG_NORMAL)("NUL:WRITE"); + return true; + } + bool Seek(Bit32u * pos,Bit32u type) { + LOG(LOG_IOCTL,LOG_NORMAL)("NUL:SEEK"); + return true; + } + bool Close() { return true; } + Bit16u GetInformation(void) { return 0x8004; } +}; + Bit8u DOS_FindDevice(char * name) { /* loop through devices */ Bit8u index=0; @@ -73,5 +94,8 @@ void DOS_SetupDevices(void) { DOS_Device * newdev; newdev=new device_CON(); DOS_AddDevice(newdev); + DOS_Device * newdev2; + newdev2=new device_NUL(); + DOS_AddDevice(newdev2); }