From: DavMac AT iname DOT com (Davin McCall) Newsgroups: comp.os.msdos.djgpp Subject: Re: Windows trashes my 800x600 graphics mode program Date: Wed, 28 Apr 1999 03:33:13 GMT Organization: Monash Uni Lines: 146 Distribution: world Message-ID: <3726805b.8551068@newsserver.cc.monash.edu.au> References: NNTP-Posting-Host: damcc5.halls.monash.edu.au X-Trace: towncrier.cc.monash.edu.au 925270372 13182 130.194.198.138 (28 Apr 1999 03:32:52 GMT) X-Complaints-To: abuse AT monash DOT edu DOT au NNTP-Posting-Date: 28 Apr 1999 03:32:52 GMT X-Newsreader: Forte Free Agent 1.1/32.230 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com On Tue, 27 Apr 1999 10:34:22 +0300 (IDT), Eli Zaretskii wrote: >Thanks. I guess we are back to square one with this problem... For reference, here is the info straight out of the Win 3.1 DDK. I tried mucking around with this stuff a while back, without success if I remember correctly. But it's here if anyone else wants to try it. I suspect it depends largely on the display driver... mov ax, 4000h ; Enable VM-Assisted Save/Restore int 2fh mov [ModesSupported], al ; video modes supported while in background Enable VM-Assisted Save/Restore directs the virtual-display device (VDD) to notify the virtual machine (VM) application whenever the VDD needs to access the video hardware registers. The VDD returns a value specifying the number and type of video modes the VDD supports when the VM application is in the background. A VM application calls this function during its initialization. Returns The return value is one of the following values, if successful. Value Meaning 01h No modes virtualized in background. 02h Only text modes virtualized in background. 03h Only text and single-plane graphics modes virtualized. 04h Only text, single-plane, and VGA multiplane graphics modes virtualized. 0FFh All supported video modes virtualized. Otherwise, the function returns zero in the AL register if virtualization is not supported. Comments When a VM application calls this function, the VDD disables I/O trapping of unreadable registers. Thereafter, the VDD calls Save Video Register State and Restore Video Register State (Interrupt 2Fh Functions 4005h and 4006h) if it needs to access the video registers. The VM application must provide an appropriate interrupt handler to process these functions. When an VM application calls this function, the VDD saves the current state of the video registers. The VDD uses this saved state later to restore video registers before it calls Notify Foreground Switch and Restore Video Register State (Interrupt 2Fh Functions 4002h and 4006h). After a VM application calls Enable VM-Assisted Save/Restore, the VDD no longer saves video memory across screen switches; it becomes the application's responsibility to completely reinitialize video memory after a Notify Foreground Switch request. See Also Interrupt 2Fh Functions 4002h Notify Foreground Switch Interrupt 2Fh Functions 4005h Save Video Register State Interrupt 2Fh Functions 4006h Restore Video Register State -------- mov ax, 4001h ; Notify Background Switch int 2fh Notify Background Switch notifies a VM application that it is being switched to the background. The VM application can carry out any actions, but should do so within 1000ms. This is the amount of time the system waits before switching the application. Returns This function has no return value. Comments After switching to the background, the application continues to run unless it attempts to access video memory. If the video adapter is in a video mode that the virtual display device (VDD) does not support in the background, the VDD freezes the application until the application can be switched back to the foreground. VM applications that have called Enable VM-Assisted Save/Restore (Interrupt 2Fh Function 4000h) should avoid accessing video memory and registers to avoid being frozen. Applications that have not called Enable VM-Assisted Save/Restore, call access video memory and registers since the VDD saves theses after this function returns. See Also Interrupt 2Fh Function 4000h Enable VM-Assisted Save/Restore Interrupt 2Fh Function 4002h Notify Foreground Switch -------- mov ax, 4002h ; Notify Foreground Switch int 2fh Notify Foreground Switch notifies a VM application that it has been switched to the foreground and can now access the video memory and registers without being frozen. The virtual-display device (VDD) calls this function. Returns This function has no return value. Comments If the VM application has called Enable VM-Assisted Save/Restore (Interrupt 2Fh Function 4000h), VDD restores the video registers to their state prior to the call to Enable VM-Assisted Save/Restore; the application is responsible for restoring video memory. If the VM application has not called Enable VM-Assisted Save/Restore (Interrupt 2Fh Function 4000h), the VDD automatically restores both video memory and registers. Under certain error conditions, the VDD may call this function without calling a corresponding Notify Background Switch (Interrupt 2Fh Function 4001h). See Also Interrupt 2Fh Function 4000h Enable VM-Assisted Save/Restore Interrupt 2Fh Function 4001h Notify Background Switch ------ mov ax, 4007h ; Disable VM-Assisted Save/Restore int 2fh Disable VM-Assisted Save/Restore directs the virtual-display device (VDD) to discontinue notifying the VM application when it needs access to video registers. VM applications call this function when they terminate. Returns This function has no return value. Comments This function directs the VDD to restore I/O trapping of unreadable registers and to discontinue calling Save Video Register State and Restore Video Register State (Interrupt 2Fh Functions 4005h and 4006h) when it needs access to the registers. Furthermore, the VDD ignores any subsequent calls to Enter Critical Section and Exit Critical Section (Interrupt 2Fh Functions 4003h and 4004h). This function does not disable Notify Background Switch and Notify Foreground Switch (Interrupt 2Fh Functions 4001h and 4002h). See Also Interrupt 2Fh Function 4001h Notify Background Switch Interrupt 2Fh Function 4002h Notify Foreground Switch Interrupt 2Fh Function 4003h Enter Critical Section Interrupt 2Fh Function 4004h Exit Critical Section Interrupt 2Fh Function 4005h Save Video Register State Interrupt 2Fh Function 4006h Restore Video Register State __________________________________________________________ *** davmac - sharkin'!! davmac AT iname DOT com *** my programming page: http://yoyo.cc.monash.edu.au/~davmac/