#define NDEBUG
#include "emulator.h"
+#include "callback.h"
#include "clock.h"
-#include "bios/bios.h"
+#include "bios/rom.h"
#include "hardware/cmos.h"
#include "hardware/pic.h"
#include "hardware/ps2.h"
Opcode[9]);
/* Stop the VDM */
- VdmRunning = FALSE;
+ EmulatorTerminate();
return;
}
CpuCallLevel, MaxCpuCallLevel);
/* Stop the VDM */
- VdmRunning = FALSE;
+ EmulatorTerminate();
return;
}
CpuCallLevel++;
- CpuSimulate = TRUE;
+ VdmRunning = CpuSimulate = TRUE;
while (VdmRunning && CpuSimulate) ClockUpdate();
CpuCallLevel--;
CpuSimulate = FALSE;
}
+VOID EmulatorTerminate(VOID)
+{
+ /* Stop the VDM */
+ VdmRunning = FALSE;
+}
+
VOID EmulatorInterrupt(BYTE Number)
{
/* Call the Fast486 API */
A20Line = Enabled;
}
-VOID WINAPI EmulatorDebugBreakBop(LPWORD Stack)
+static VOID WINAPI EmulatorDebugBreakBop(LPWORD Stack)
{
DPRINT1("NTVDM: BOP_DEBUGGER\n");
DebugBreak();
}
-VOID WINAPI EmulatorUnsimulateBop(LPWORD Stack)
+static VOID WINAPI EmulatorUnsimulateBop(LPWORD Stack)
{
EmulatorUnsimulate();
}
/* Register the I/O Ports */
RegisterIoPort(CONTROL_SYSTEM_PORT61H, Port61hRead, Port61hWrite);
+ /* Set the console input mode */
+ // FIXME: Activate ENABLE_WINDOW_INPUT when we will want to perform actions
+ // upon console window events (screen buffer resize, ...).
+ SetConsoleMode(ConsoleInput, ENABLE_PROCESSED_INPUT /* | ENABLE_WINDOW_INPUT */);
+ // SetConsoleMode(ConsoleOutput, ENABLE_PROCESSED_OUTPUT | ENABLE_WRAP_AT_EOL_OUTPUT);
+
/* Initialize the PS2 port */
PS2Initialize(ConsoleInput);
- /* Set the console input mode */
- // SetConsoleMode(ConsoleInput, ENABLE_MOUSE_INPUT | ENABLE_PROCESSED_INPUT);
-
/* Start the input thread */
InputThread = CreateThread(NULL, 0, &PumpConsoleInput, ConsoleInput, 0, NULL);
// if (InputThread == NULL) return FALSE;
VOID EmulatorCleanup(VOID)
{
- // VgaCleanup();
+ VgaCleanup();
/* Close the input thread handle */
if (InputThread != NULL) CloseHandle(InputThread);
VDDTerminateVDM(VOID)
{
/* Stop the VDM */
- VdmRunning = FALSE;
+ EmulatorTerminate();
}
PBYTE