1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292
|
; FreeDOS DISPLAY: VideoINT.ASM
;
; ===================================================================
;
; Interrupt 10h (video) management routines
;
; Copyright (C) 9 Aug 2000 Ilya V. Vasilyev aka AtH//UgF@hMoscow
; e-mail: hscool@netclub.ru
;
; WWW: http://www.freedos.org/
;
; ===================================================================
;
; ( minimum touches by Aitor )
; . . . . . line that rules
;
;===================================================================
; CONSTANTS
NO EQU 0 ; ???
MDA EQU 2 ; Not supported
HGA EQU 4 ; Currently not supported
CGA EQU 6 ; Not supported
EGA EQU 8
MCGA EQU 10 ; Supported ?
VGA EQU 12
VESA EQU 14 ; Currently not detected
;===================================================================
; VARIABLES
;
; . . . . . line that rules
flgOur DB 0 ; Our INT 10 Fn 00?
bAdapter DB 0 ; Adapter type detected (one of
; the constants above)
;===================================================================
; INTERRUPT ROUTINE FOR 10h (video adapter interrup)
;
; ah=00h (set video mode)
; reload the font after changing the video mode
; ax=4f02h (set superVGA mode)
; reload the font after changing the video mode
; ah=11h (character generation functions)
; al= 30h: get info about tables
; al= 1h, 2h, 4h, 11h, 12h, 14h: load fonts in text mode
; al= 22h, 23h, 24h: load fonts in graphics mode
;
; . . . . . line that rules
;************** check if active
New10: push ax
mov al,[cs:bActive] ; are we active?
test al,0ffh
pop ax
jz jOld10 ; in that case, switch to old handler
;************** check if ah=00h and flgOur is clear
or ah,ah
jnz i10n0
cmp ah,[cs:flgOur] ; VESA switching can call i10Fn0
jnz jnzOld10 ; ah=00h BUT flgOur set, so chain to next int10h
;************** AH=00h and flgOur clear: call old, then load fonts
; Here we fix Classic Video BIOS Fn 00: Set Screen Modee
push ax
pushf
call FAR [cs:dOld10]
pop ax ; Do not assume i10Fn0 saved AL
push ax
and al,7fH ; High bit means save video memory
iSFpr: push cx ; preconditions for refreshing
push ds ; hardware codepage
push es
push di
push cs
pop es
call [cs:pRefreshSWcp]
pop di
pop es
pop ds
pop cx
pop ax
iret
;************** AH <> 00h
;************** check if ah=4f02h (set VESA SuperVGA mode)
i10n0:
cmp ax,4f02H ; VESA SET MODE
jnz i10nVESA
inc BYTE [cs:flgOur]; prevent our processing the call
pushf
call FAR [cs:dOld10]
dec BYTE [cs:flgOur]
push ax
mov al,-1 ; Call refresh with Unknown video mode
jmp SHORT iSFpr ; (mode determined dinamically)
jOld10: DB 0eaH
dOld10: DD -16
;************** AH <> 00h, 4f02h
;************** All other business is with character generator functions (ah=11h)
i10nVESA:
cmp ah,11H ; ah=11h?
jnzOld10: jnz jOld10 ; no, then jump to next
cmp al,30H ; Get Font Information?
jnz i10f11n30
;************** AL = 30h (Get Font Information), BH: font info to be supplied
;************** unsupported cases: bh=5, bh>6, bh=6 on NON-VGA
cmp bh,5 ; Font 9x14 not supported (now?)
jz jOld10
cmp bh,6
ja jOld10 ; Font 9x16 not supported (now?)
jb CheckSubFonts
cmp BYTE [cs:bAdapter],VGA
jb jOld10 ; We support 8x16 only on VGA
CheckSubFonts: ; check that we OWE the subfonts
cmp bh,5 ; requested
ja csf1
cmp bh,2
jne i10f1130n6 ; cases 0,1,3,4 always supported
csf1: push cx
mov cx,[cs:wNumSubFonts]
cmp cl,2
ja pi10f1130n6 ; we have 3 subfonts: always supported
cmp bh,6
je csfr ; otherwise, discard bh=6
cmp cl,1
ja pi10f1130n6 ; we have only 1 subfont
csfr: pop cx ; exit from this block, chain
jmp jOld10
;************** supported cases: bh<5, VGA-bh=6
pi10f1130n6:
pop cx ; we pushed it in CheckSubFonts
i10f1130n6:
sub cx,cx ; CH register must be zero on exit
mov es,cx
mov dl,[es:484H] ; Number of lines - 1
mov cl,[es:485H] ; Bytes per char
cmp bh,1
ja i10f1130a1
jz i10f1130s1
les bp,[es:7cH] ; SubFn 00: Return vector 1FH
iret
i10f1130s1:
les bp,[es:43H*4] ; SubFn 01: Return vector 43H
iret
i10f1130a1:
push cs ; All other functions return fonts
pop es ; from DISPLAY.SYS segment
cmp bh,3
ja i10f1130a3
jz i10f1130f3
mov bp,bFont8x14 ; SubFn 02: Return ROM font 8x14
iret
i10f1130f3:
mov bp,bFont8x8 ; SubFn 03: Return ROM font 8x8 (00..7f)
iret
i10f1130a3:
cmp bh,6
jz i10f1130s6
mov bp,bFont8x8+1024; SubFn 04: Return ROM font 8x8 (80..ff)
iret
i10f1130s6:
mov bp,bFont8x16 ; SubFn 06: Return ROM font 8x16
iret
;************** subfunctions AL= 01/11, 02/12 and (VGA+) 04/14
i10f11n30:
cmp al,01 ; SubFn 01: Set ROM font 8x14
jz i10f1101
cmp al,11H ; SubFn 11: Set ROM font 8x14
jnz i10f11n11
i10f1101:
push bp
push bx
mov bp,bFont8x14
mov bh,14
i10set: push es ; set a font, by calling ax=1110h, bh=bytes/char
push ax
push cx
push dx
push cs
pop es
mov cx,256 ; load 256 characters
cwd ; DX=0
and al,10H
pushf
call FAR [cs:dOld10]
pop dx
pop cx
pop ax
pop es
pop bx
pop bp
iret
i10f11n11:
cmp al,02 ; SubFn 02: Set ROM font 8x8
jz i10f1102
cmp al,12H ; SubFn 12: Set ROM font 8x8
jnz i10f11n12
i10f1102:
push bp
push bx
mov bp,bFont8x8
mov bh,8
jmp i10set
i10f11n12:
cmp al,04 ; SubFn 04: Set ROM font 8x16
jz i10f1104
cmp al,14H ; SubFn 14: Set ROM font 8x16
jnz i10f11n14
i10f1104:
cmp BYTE [cs:bAdapter],VGA
jb jOld10 ; We support 8x16 only on VGA
push bp
push bx
mov bp,bFont8x16
mov bh,16
jmp i10set
;************** subfunctions AL= 22, 23 and (VGA+) 24
i10f11n14:
cmp al,22H ; SubFn 22: Set ROM font 8x14 (INT 43)
jnz i10f11n22
push bp
push cx
mov bp,bFont8x14
mov cx,14
i10setg: push es
push ax
push cs
pop es
mov ax,1121H
pushf
call FAR [cs:dOld10]
pop ax
pop es
pop cx
pop bp
iret
i10f11n22:
cmp al,23H ; SubFn 23: Set ROM font 8x8 (INT 43)
jnz i10f11n23
push bp
push cx
mov bp,bFont8x8
mov cx,8
jmp i10setg
i10f11n23:
cmp al,24H ; SubFn 24: Set ROM font 8x16 (INT 43)
jnz jOld10
cmp BYTE [cs:bAdapter],VGA
jb jOld10 ; We support 8x16 only on VGA
push bp
push cx
mov bp,bFont8x16
mov cx,16
jmp i10setg
|