PRE_HIRES_TO_VGA (Function 4)

Call With

EBX: Contains the handle of the VM that is being switched to.

EBP: May or may not point to the Client registers for the VM in EBX.

Return Values

Save anything that you use.

Remarks

The Main VDD calls the routines PRE_HIRES_TO_VGA, POST_HIRES_TO_VGA, PRE_VGA_TO_HIRES, and POST_VGA_TO_HIRES whenever it changes the video focus between Windows and a full-screen MS-DOS prompt. During PRE_HIRES_TO_VGA or PRE_VGA_TO_HIRES, remove trapping on your device's extended registers or make sure that they are not virtualized (meaning that any register I/O that the VM does during the mode change is actually written to the physical hardware). During POST_HIRES_TO_VGA or POST_VGA_TO_HIRES, reestablish the trapping.

Following are the steps when switching from Windows to a full-screen MS-DOS prompt.

  1. The Main VDD responds to a Set_Focus message from the SHELL VxD.
  2. The Main VDD enters the routine that causes the VM to go full-screen. It suspends all VM's and cleans up any "dirty" pages in the VGA virtualization area. That is, it prevents data loss by ensuring that all of the data that a windowed 4 plane VGA application may have written to the off-screen 32K or 64K virtualization area has been delivered to the Grabber.
  3. The Main VDD disables all trapping on the standard VGA ports 3B0h through 3DFh. It also sets the DIB engine's BUSY bit and any Enabled flags that the display driver set with the VDD_SET_USER_FLAGS call. This tells the display driver that it can no longer draw on the hardware.
  4. The Main VDD calls the function PRE_HIRES_TO_VGA in the mini-VDD. The mini-VDD may if it needs to set the screen out of hi-res mode. It should also set flags and/or remove traps on any extended registers that it's trapping.
  5. The Main VDD saves some data from the BIOS data area of the VM that's going to get the video focus, including cursor position, BIOS mode, etc. It also saves off the Interrupt 43h vector which is used by some video BIOS's.
  6. The Main VDD executes an Interrupt 10h, function 0 mode change to enter the mode that the VM is running in. If this is sufficient to get the hardware out of hi-res mode and back to a standard VGA mode, then the mini-VDD need not explicitly set the screen into VGA mode (see step 4).
  7. The Main VDD then restores the BIOS data area of the VM, calls POST_HIRES_TO_VGA, and restores trapping to the proper state for the standard VGA registers.

Following are the steps switching back to Windows from a full-screen MS-DOS prompt.

  1. The Main VDD responds to a Set_Focus message from the SHELL VxD.
  2. The Main VDD enters the routine that causes the VM to go back to Windows. It suspends all VM's and cleans up any "dirty" pages in the VGA virtualization area. That is, it prevents data loss by ensuring that all of the video data that a background 4 plane VGA application may have written to the off-screen 32K or 64K virtualization area has been delivered to the Grabber. It also saves all of the visible full-screen video memory at this time.
  3. The Main VDD disables all trapping on the standard VGA ports 3B0h through 3DFh.
  4. The Main VDD calls the mini-VDD function PRE_VGA_TO_HIRES. The mini-VDD should set flags and/or remove traps on any extended registers that it is trapping.
  5. The Main VDD calls the display driver's ResetHiResMode routine which was registered by the display driver during the function VDD_DRIVER_REGISTER. The display driver runs through all the code necessary to reestablish Windows hi-res mode on the hardware. It also restores the palette DAC, hardware cursor, and font cache if any. The display driver is also responsible for clearing the BUSY bit that was set by the Main VDD when going to full-screen mode.
  6. The Main VDD calls the mini-VDD function POST_VGA_TO_HIRES and restores trapping to the proper state for the standard VGA registers.

Note: If the mini-VDD needs to make calls to Exec_Int or Exec_VxD_Int in order to set the hardware from hi-res mode back to VGA mode during a PRE_HIRES_TO_VGA call, it should make sure that EBP points to client registers for the Current VM. The Main VDD does not guarantee this when it calls the mini-VDD. Since all calls to Exec_Int and Exec_VxD_Int happen in the context of the current VM, you must make the call to the function Get_Cur_VM_Handle and then establish EBP to point to the client registers for that VM before making any calls to the BIOS.