🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #5164

Re: Dual Monitor Switching

#5164
From: Roger Fulton
Date: Wed, 13 Mar 1991 06:22
211 lines
8571 bytes
Well, this is really getting interesting now.
First we have this:

In article <1991Mar12.140842.63@cbnewsh.att.com>, rkl@cbnewsh.att.com (kevin.laux) writes:
> In article <18203@milton.u.washington.edu>, roger@wrq.com (Roger Fulton) writes:
> > In article <1991Mar11.172914.4450@engin.umich.edu> pong@caen.engin.umich.edu (Bryan John Jalowitz) writes:
> > >
> > >Hi,
> > >I would like to know how, from within an application, I can switch
> > >monitors in a dual configuration.  I would like something similar to
> > >"mode mono" vs. "mode co80", but that does not clear the display.
> > >
> > >More specifically, I am using a VGA/HERC dual monitor configuration,
> > >and I would like to be able to route text/graphics to one or the other
> > >display systems.  I know about setting the mode with int 10h func 0,
> > >but there appears to be more to it than that.  That doesn't "switch" the
> >      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > >video bios' notion of the current display.
> > 
> > Yes, there is.  In addition to setting the video mode,
> > you need to also update the equipment flag at 0040:0010
> > appropriately: xx10xxxx for color, xx11xxxx for mono
> > (where 'x' means leave it alone).  Also, you should account
> > for the fact that color systems have a different maximum
> > cursor line count than mono systems (so you should save and
> > restore the cursor when changing video modes).
> 
> 	Yes, there is but this is not it!  Those bits in the equipment flag word
> are for the *INITIAL* video mode.  Changing those bits will *not* effect a
> display adapter switch.  As I answered in alt.msdos.programmer, what's missing
> is Int 10h, Function 12h, Subfunction 35h:
> 
> 	AH:	12h
> 	BL:	35h
> 	AL:	0	Initial external adapter off
> 		1	Initial VGA on
> 		2	Active adapter off
> 		3	Inactive adapter on
> 	ES:	Segment of Switch State area
> 	DX:	Offset of Switch State area
> 
> 	The first time display adapters are switched call the subfunction with
> AL=0, then again with AL=1.  Thereafter, double calls with AL=2,3 are used.
> The Switch State area is a 128 byte buffer and each display needs its own.


Then we have this:


In article <1991Mar12.175839.1687@engin.umich.edu>, pong@caen.engin.umich.edu (Bryan John Jalowitz) writes:
> In article <1991Mar12.133739.28811@cbnewsh.att.com> rkl@cbnewsh.att.com (kevin.laux) writes:
> >
> >	You're missing Int 10h Function 12h Subfunction 35h, the Display
> >Switch Interface.
> >
> >	AH:	12h
> >	BL:	35h
> >	AL:	0	Initial external adapter off
> >		1	Initial VGA on
> >		2	Active adapter off
> >		3	Inactive adapter on
> >	ES:	Segment of Switch State area
> >	DX:	Offset of Switch State area
> >
> >	The first time you switch displays you must use AL=0,1.  After that,
> >you use a double call to AL=2,3.  The Switch state area is a 128 byte buffer
> >and each display needs it own.
> >
> My documentation ("Programmer's guide to PC & PS/2 video systems", Microsoft
> Press) says that this function is for PS/2 video systems.  I tried it 
> anyway, in case the book's information was old, however I do not get a
> successful return value.  I am using an AT clone with both cards on an
> ISA bus.  Should this still apply?
> 
> Any other ideas?
> 
> Tony Whipple
> Tony_Whipple@um.cc.umich.edu


Well, Tony, I'm gratified to see that R. Kevin Laux's "solution"
did not work for you; I knew it wouldn't.  As you pointed out,
INT 10h, Func 12h, Subfunc 35h ONLY applies to PS/2 video systems.

From the well-known list of interrupts:

"INT 10 - VIDEO - ALTERNATE FUNCTION SELECT (PS) - DISPLAY-SWITCH INTERFACE
                                             ^^
                                             This means PS/2 ONLY.
         AH = 12h
         BL = 35h
         AL = 00h initial adapter video off
              01h initial planar video on
              02h switch active video off
              03h switch inactive video on
               80h *UNDOCUMENTED* set system board video active flag
         ES:DX = buffer (128 byte save area if AL = 0, 2 or 3)
 Return: AL = 12h if function supported"

From the "Programmer's Guide to PC & PS/2 Video Systems", Microsoft
Press (good choice, Tony):

"INT 10H function 1AH with BL = 35H provides a set of routines
that support switching between two PS/2 video subsystems in
the same computer.  In a computer that contains two different
PS/2-compatible video subsystems, calls to this function let a
program separately access the video BIOS on a video adapter and
the video BIOS on a PS/2 motherboard."

From "The New Peter Norton Programmer's Guide to the IBM PC
and PS/2, Microsoft Press:

"Subservices 32H (decimal 50) and 35H (decimal 53) are provided for
programmers who want to use two different video subsystems in the
same PS/2 computer.  In particular, these routines support the use
of a VGA alongside the built-in MCGA subsystem in a PS/2 Model 30."

So, well, gee, hmmmm, it kind of maybe looks like you wouldn't
want to use R. Kevin Laux's "solution" for the configuration
Tony has (VGA/Herc).

But, to be ABSOLUTELY SURE, I ran the following code (from
the "Programmer's Guide to PC & PS/2 Video Systems", Microsoft
Press) as a test:

---------------------------------------------------------------------------
        page    60,132

data segment public 'data'
        assume  ds:data

VGAsave         db      128 dup(?)
MCGAsave        db      128 dup(?)

data ends

code segment public 'code'
        assume  cs:code, ds:nothing, es:nothing
start:
        mov     ax,1200h
        mov     bl,35h
        mov     dx,seg VGAsave
        mov     es,dx
        mov     dx,offset VGAsave
        int     10h
        cmp     al,12h                  ; here's the test, folks
        jne     Error

        mov     ax,1201h
        mov     bl,35h
        int     10h

        mov     ax,1202h
        mov     bl,35h
        mov     dx,seg VGAsave
        mov     es,dx
        mov     dx,offset VGAsave
        int     10h

        mov     ax,1203h
        mov     bl,35h
        mov     dx,offset MCGAsave
        int     10h
Error:
        mov     ah,4ch
        int     21h
code ends

        end     start
---------------------------------------------------------------------------

In my AST 386/25, I have a Paradise Professional VGA and a
Hercules Incolor Plus.  Needless to say, when I ran the
above code, I did not flip from one screen to another.
Furthermore, when stepping thru the code with Periscope,
I saw that the value of AL at the line commented above as
"here's the test, folks" was zero (not 12H).  Seems like
proof to me.

To do the equivalent of MODE MONO or MODE CO80 (which I think
is what you want to do, Tony) you (as I said previously):

- set the equipment flag appropriately
- make the appropriate "set video mode" BIOS call

(This is exactly what MODE MONO and MODE CO80 do; I have
stepped thru them with Periscope and watched it happen.)

(As I also said previously, I think it's nice to also save and
restore the cursor configuration when switching between
screens.)

Example code for doing this is located at the end of chapter 1
in (guess what) the "Programmer's Guide to PC & PS/2 Video 
Systems", Microsoft Press.

About the equipment flag: yes, R. Kevin Laux, bits 4 and 5 DO
indicate the *initial* video mode.  So, why would you need
to update these bits?  Once again from the "Programmer's Guide
to PC & PS/2 Video Systems", Microsoft Press:

"The BIOS video mode routines generally support dual-display
configurations.  The video BIOS routines use bits 4 and 5
of the variable EQUIP_FLAG at 0040:0010 in the BIOS video
data area to choose between two video subsystems."

So, R. Kevin Laux, do you still say, "Yes, there is but this is 
not it!"?
-- 
Roger Fulton
roger@wrq.com
Technical Details
Message-ID: <18300@milton.u.washington.edu>
Path: arc1-ca.pugleaf.net!utzoo!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!emory!ogicse!cs.uoregon.edu!ns.uoregon.edu!milton!roger
References: <1991Mar11.172914.4450@engin.umich.edu> <1991Mar12.133739.28811@cbnewsh.att.com> <1991Mar12.175839.1687@engin.umich.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!emory!ogicse!cs.uoregon.edu!ns.uoregon.edu!milton!roger
From: roger@wrq.com (Roger Fulton)
Newsgroups: comp.os.msdos.programmer
Subject: Re: Dual Monitor Switching
Message-ID: <18300@milton.u.washington.edu>
Date: 13 Mar 91 06:22:35 GMT
References: <1991Mar11.172914.4450@engin.umich.edu> <1991Mar12.133739.28811@cbnewsh.att.com> <1991Mar12.175839.1687@engin.umich.edu>
Sender: news@milton.u.washington.edu
Distribution: na
Organization: Walker Richer & Quinn, Inc., Seattle, WA
Lines: 211