| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Detecting if fullscreen |
TB>For some time ago I wrote to you All to help me out. I still don't know
TB>how to sole my problem ! You see, I'm making a program (DOS) that loads
TB>own designed fonts (for NU like screens), but when running the program in
TB>a windowed-dos-session the emulation f.... up my font.
TB>Is it possible to detect if a dos-program is running fullscreen or windowed
TB>If possible, I would like to see some code for this in assembler or pascal.
It is possible to detect a switch by hooking int 2F function 40xx, I did
this to fix a font problem on my old Trident 8900. Note that
Video_Switch_Notification must be turned on for the DOS session
for this to work. Also look at ISWINDOW.COM in your OS2\MDOS
directory, that program returns a return code of 1 for a windowed
session and 0 for a full screen session. Here's the hook function I
used:
Int2F proc far
pushf
cmp ax,4002h ; Get this if going from window to FS
screen in OS/2 DOS box.
; Get 4001h if going from FS to window.
je {at}{at}DoFixes
{at}{at}Do2F: popf
jmp cs:csInt2F
{at}{at}DoFixes: 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
___
X SLMR 2.1a X Yield to temptation, it may not pass your way again.
--- 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™.