diff --git a/subsystems/mvdm/ntvdm/emulator.h b/subsystems/mvdm/ntvdm/emulator.h index deff274d4fa..e4554289bb8 100644 --- a/subsystems/mvdm/ntvdm/emulator.h +++ b/subsystems/mvdm/ntvdm/emulator.h @@ -15,7 +15,11 @@ /* DEFINES ********************************************************************/ -/* Basic Memory Management */ +/* + * Basic Memory Management + */ +#define NULL32 ((ULONG)0) + #define MEM_ALIGN_DOWN(ptr, align) (PVOID)((ULONG_PTR)(ptr) & ~((align) - 1l)) #define MEM_ALIGN_UP(ptr, align) MEM_ALIGN_DOWN((ULONG_PTR)(ptr) + (align) - 1l, (align)) @@ -35,7 +39,9 @@ C_ASSERT(0x100000 <= MAX_ADDRESS); // A minimum of 1 MB is required for PC emul #define ARRAY_INDEX(ptr, array) ((ULONG)(((ULONG_PTR)(ptr) - (ULONG_PTR)(array)) / sizeof(*array))) -/* BCD-Binary conversion */ +/* + * BCD-Binary conversion + */ FORCEINLINE USHORT @@ -71,6 +77,11 @@ BCD_TO_BINARY(USHORT Value) return Result; } + +/* + * Emulator state + */ + enum { EMULATOR_EXCEPTION_DIVISION_BY_ZERO, @@ -94,6 +105,7 @@ extern FAST486_STATE EmulatorContext; extern LPVOID BaseAddress; extern BOOLEAN VdmRunning; + /* FUNCTIONS ******************************************************************/ VOID DumpMemory(BOOLEAN TextFormat); diff --git a/subsystems/mvdm/ntvdm/hardware/sound/speaker.c b/subsystems/mvdm/ntvdm/hardware/sound/speaker.c index f99918b0a0d..3817b004778 100644 --- a/subsystems/mvdm/ntvdm/hardware/sound/speaker.c +++ b/subsystems/mvdm/ntvdm/hardware/sound/speaker.c @@ -18,6 +18,7 @@ /* Extra PSDK/NDK Headers */ #include +#include /* DDK Driver Headers */ #include diff --git a/subsystems/mvdm/ntvdm/memory.c b/subsystems/mvdm/ntvdm/memory.c index 3b53374afc2..c9de5d915d5 100644 --- a/subsystems/mvdm/ntvdm/memory.c +++ b/subsystems/mvdm/ntvdm/memory.c @@ -16,6 +16,9 @@ #include "emulator.h" #include "memory.h" +/* Extra PSDK/NDK Headers */ +#include + /* PRIVATE VARIABLES **********************************************************/ typedef struct _MEM_HOOK diff --git a/subsystems/mvdm/ntvdm/ntvdm.h b/subsystems/mvdm/ntvdm/ntvdm.h index 17dbd8dfa1e..2b006c06c39 100644 --- a/subsystems/mvdm/ntvdm/ntvdm.h +++ b/subsystems/mvdm/ntvdm/ntvdm.h @@ -9,6 +9,31 @@ #ifndef _NTVDM_H_ #define _NTVDM_H_ +/* BUILD CONFIGURATION ********************************************************/ + +/* + * Activate this line if you want to run NTVDM in standalone mode with: + * ntvdm.exe + */ +// #define STANDALONE + +/* + * Activate this line for Win2k compliancy + */ +// #define WIN2K_COMPLIANT + +/* + * Activate this line if you want advanced hardcoded debug facilities + * (called interrupts, etc...), that may break PC-AT compatibility. + * USE AT YOUR OWN RISK! (disabled by default) + */ +// #define ADVANCED_DEBUGGING + +#ifdef ADVANCED_DEBUGGING +#define ADVANCED_DEBUGGING_LEVEL 1 +#endif + + /* INCLUDES *******************************************************************/ #include @@ -36,38 +61,12 @@ DWORD WINAPI SetLastConsoleEventActive(VOID); #define NTOS_MODE_USER -#include -#include -#include +#include // For NtQueryPerformanceCounter() #include -#include /* PSEH for SEH Support */ #include -/* - * Activate this line if you want to run NTVDM in standalone mode with: - * ntvdm.exe - */ -// #define STANDALONE - -/* - * Activate this line for Win2k compliancy - */ -// #define WIN2K_COMPLIANT - -/* - * Activate this line if you want advanced hardcoded debug facilities - * (called interrupts, etc...), that break PC-AT compatibility. - * USE AT YOUR OWN RISK! (disabled by default) - */ -// #define ADVANCED_DEBUGGING - -#ifdef ADVANCED_DEBUGGING -#define ADVANCED_DEBUGGING_LEVEL 1 -#endif - -#define NULL32 0 /* VARIABLES ******************************************************************/