/* INCLUDES *******************************************************************/
-#include <windows.h>
#include <stdio.h>
-#include <conio.h>
#include <stdarg.h>
+#include <conio.h>
+
+#define WIN32_NO_STATUS
+#include <windows.h>
+
#include <debug.h>
-#include <limits.h>
/* DEFINES ********************************************************************/
#define TO_LINEAR(seg, off) (((seg) << 4) + (off))
#define MAX_SEGMENT 0xFFFF
-#define MAX_OFFSET 0xFFFF
-#define MAX_ADDRESS TO_LINEAR(MAX_SEGMENT, MAX_OFFSET)
-#define FAR_POINTER(x) ((ULONG_PTR)BaseAddress + TO_LINEAR(HIWORD(x), LOWORD(x)))
-#define STEPS_PER_CYCLE 256
+#define MAX_OFFSET 0xFFFF
+#define MAX_ADDRESS 0x1000000 // 16 MB of RAM
+
+#define FAR_POINTER(x) \
+ (PVOID)((ULONG_PTR)BaseAddress + TO_LINEAR(HIWORD(x), LOWORD(x)))
-// Uncomment the following to use the new Soft386 CPU emulator (EXPERIMENTAL)
-// #define NEW_EMULATOR
+#define SEG_OFF_TO_PTR(seg, off) \
+ (PVOID)((ULONG_PTR)BaseAddress + TO_LINEAR((seg), (off)))
+
+#define STEPS_PER_CYCLE 256
/* FUNCTIONS ******************************************************************/
extern LPVOID BaseAddress;
extern BOOLEAN VdmRunning;
-extern LPCWSTR ExceptionName[];
VOID DisplayMessage(LPCWSTR Format, ...);