TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Tonny Bjoern
from: Rob Basler
date: 1995-06-11 11:40:00
subject: Video_switch_Notifica 1/

TB>Hi All, how are you ?

TB>Can anyone here tell me how to "grap" the info
Video_Switch_Notification
TB>(settings, screen) returns to a dos-program. I want to use it to detect
TB>if my dos-program is running windowed or fullscreen.
TB>Is that the right way to use this option ???

DEBUG ISWINDOW.COM to see if you are starting in a window or fs in your
OS2/MDOS directory and the see below for detecting changes:

;===========================================================================
;
; TRIDFONT.ASM - Fixes problem switching from Window do Full Screen DOS under
;                the OS/2 DOS box with Trident SVGA cards.
;
;                This program DOES NOT fix the corrupted screen memory when
;                a DOS box is started up.
;
;                This program DOES fix the corrupted VGA fonts that can result
;                from switching to a window after a VGA graphics program has
;                been used.
;
;
; (C)1990 Robware Software Development, All Rights Reserved.
; By Robert Basler
;
;
;===========================================================================

_text   segment word public 'code'

assume cs:_text,ds:_text,es:_text
locals

org 100h

start:
     jmp init

csint2F     dd ?          ; original Int2F handler address
csint10     dd ?          ; original Int10 handler address
font        db 4          ; current font number
ROWS        db 24         ; current number of screen ROWS

Int2F proc far
        pushf
        cmp     ax,4002h      ; Get this if going from window to full screen in
                              ; Get 4001h if going from FS to window.
        je      {at}{at}DoFixes
{at}{at}Do2F:
        popf
        jmp     cs:csInt2F
{at}{at}DoFixes:
int 3
        push    ax
        push    bx
        push    es

        ; set es to bios data segment
        mov     bx,40h
        mov     es,bx

        ; check that are in a text mode.
        mov     bx,49h
        mov     al,byte ptr es:[bx]
        cmp     al,7h
        je      {at}{at}Yup
        cmp     al,3h
        jbe     {at}{at}Yup

        ; nope, don't do anything.
        pop     es
        pop     bx
        pop     ax
        jmp     {at}{at}Do2F

{at}{at}Yup:

        ; see if ROWS has changed since last Int10 call, if so, then
        ; program adjusted itself back to 25 line mode.
        mov     bx,84h
        mov     al,byte ptr es:[bx]
        cmp     al,cs:ROWS
        je      {at}{at}NoChange

        ; check ROWS variable in BIOS data area to determine font to load.
        mov     cs:ROWS,al
        mov     cs:font,4
        cmp     al,24
        jbe     {at}{at}NoChange
        mov     cs:font,2
        cmp     al,42
        jae     {at}{at}NoChange
        mov     cs:font,1

{at}{at}NoChange:
        mov     ah,11h
        mov     al,cs:font
        add     al,10h
        mov     bl,0
        pushf
        cli
        call    cs:Csint10
        ; set the current font page, not really needed
        mov     ax,1103h
        mov     bl,0
        pushf
        cli
        call    cs:Csint10
        pop     es
        pop     bx
        pop     ax
        jmp     {at}{at}Do2F
Int2F   endp


Int10 proc far
        pushf
        cmp     ah,11h
        je      {at}{at}DoFixes
{at}{at}Int10:
        popf
        jmp     cs:CSInt10
{at}{at}DoFixes:
        ; only want functions 1, 2, 4, 11, 12, 14.
        cmp     al,3
        je      {at}{at}Int10
        cmp     al,14h
        ja      {at}{at}Int10
        cmp     al,4h
        jbe     {at}{at}SetFont
        cmp     al,10h
        jb      {at}{at}Int10

{at}{at}SetFont:
        push    ax
>>> Continued to next message
___
 X SLMR 2.1a X recursive (ree 'cuhr siv) adj. - see recursive.

--- Maximus/2 2.01wb
* Origin: The Idle Task... (604)275-0835 Richmond BC. (1:153/905)
SEEN-BY: 105/42 620/243 711/401 409 410 413 430 807 808 809 934 955 712/407
SEEN-BY: 712/515 628 704 713/888 800/1 7877/2809
@PATH: 153/905 828 800 270/101 105/103 42 712/515 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.