#include "ntvdm.h" #define NDEBUG #include #include "emulator.h" #include "io.h" typedef void (_stdcall *Out32Func) (short, short); typedef short (_stdcall *Inp32Func) (short); HMODULE inpout32; Out32Func Out32; Inp32Func Inp32; BYTE WINAPI ParallelReadPort(USHORT Port){ BYTE Data = (BYTE)Inp32(Port); return Data; } VOID WINAPI ParallelWritePort(USHORT Port, BYTE Data){ Out32(Port,(short)Data); } VOID ParallelInitialize(VOID){ inpout32 = LoadLibraryA((LPCSTR)"inpout32.dll"); if(inpout32){ Out32 = (Out32Func)GetProcAddress(inpout32,"Out32"); Inp32 = (Inp32Func)GetProcAddress(inpout32,"Inp32"); RegisterIoPort(0x378,ParallelReadPort,ParallelWritePort); RegisterIoPort(0x379,ParallelReadPort,NULL); RegisterIoPort(0x37A,ParallelReadPort,ParallelWritePort); } } VOID ParallelCleanup(VOID){ UnregisterIoPort(0x378); UnregisterIoPort(0x379); UnregisterIoPort(0x37A); FreeLibrary(inpout32); }