return Result;
}
+static VOID VgaSetActiveScreenBuffer(HANDLE ScreenBuffer)
+{
+ /* Set the active buffer */
+ SetConsoleActiveScreenBuffer(ScreenBuffer);
+
+ /* Reinitialize the VDM menu */
+ DestroyVdmMenu();
+ CreateVdmMenu(ScreenBuffer);
+}
+
static BOOL VgaEnterGraphicsMode(PCOORD Resolution)
{
DWORD i;
ZeroMemory(ConsoleFramebuffer, BitmapInfo->bmiHeader.biSizeImage);
/* Set the active buffer */
- SetConsoleActiveScreenBuffer(GraphicsConsoleBuffer);
+ VgaSetActiveScreenBuffer(GraphicsConsoleBuffer);
/* Set the graphics mode palette */
SetConsolePalette(GraphicsConsoleBuffer,
ReleaseMutex(ConsoleMutex);
/* Switch back to the default console text buffer */
- // SetConsoleActiveScreenBuffer(TextConsoleBuffer);
+ // VgaSetActiveScreenBuffer(TextConsoleBuffer);
/* Cleanup the video data */
CloseHandle(ConsoleMutex);
DPRINT1("VgaEnterTextMode\n");
/* Switch to the text buffer */
- SetConsoleActiveScreenBuffer(TextConsoleBuffer);
+ VgaSetActiveScreenBuffer(TextConsoleBuffer);
/* Adjust the text framebuffer if we changed the resolution */
if (TextResolution.X != Resolution->X ||
/* Enter new text mode */
if (!VgaEnterTextMode(&Resolution))
{
- DisplayMessage(L"An unexpected VGA error occurred while switching into text mode.");
+ DisplayMessage(L"An unexpected VGA error occurred while switching into text mode. Error: %u", GetLastError());
EmulatorTerminate();
return;
}
/* Enter graphics mode */
if (!VgaEnterGraphicsMode(&Resolution))
{
- DisplayMessage(L"An unexpected VGA error occurred while switching into graphics mode.");
+ DisplayMessage(L"An unexpected VGA error occurred while switching into graphics mode. Error: %u", GetLastError());
EmulatorTerminate();
return;
}
+VOID ScreenEventHandler(PWINDOW_BUFFER_SIZE_RECORD ScreenEvent)
+{
+ DPRINT1("Screen events not handled\n");
+}
+
BOOL VgaAttachToConsole(VOID)
{
//
SMALL_RECT ConRect;
/* Restore the old screen buffer */
- SetConsoleActiveScreenBuffer(TextConsoleBuffer);
+ VgaSetActiveScreenBuffer(TextConsoleBuffer);
/* Restore the original console size */
ConRect.Left = 0;
/***/ VgaResetPalette(); /***/
/* Switch to the text buffer */
- SetConsoleActiveScreenBuffer(TextConsoleBuffer);
+ VgaSetActiveScreenBuffer(TextConsoleBuffer);
/* Clear the VGA memory */
VgaClearMemory();