page 58,132 title INT_10P Copyright (c) 198x COMPAQ Computer Corp. ;****************************************************************************** ; ; Name: INT_10P ; ; Group: PATCH ; ; Revision: 1.10 ; ; Date: 10 Sept., 1987 ; ; Author: S M Dawson ; original module by M P Vaughan ; ;****************************************************************************** ; ; Changes: ; ; DATE REVISION DESCRIPTION ; -------- -------- ------------------------------------------------------ ; 8/31/87 1.00 Original - fixed Plasma ROM INT 10 fcn 1 in MDA mode ; 9/10/87 1.10 Added IDC-2 workaround in Fcn 2 ; ;****************************************************************************** ; ; Functional Description: ; ; *** This patch fixes TWO bugs in the Plasma display in MDA mode. *** ; ;A) Grabs INT 10 func 01 (set cursor) and fixes bug in Plasma ROM. ; If AH <>1 or default adapter address not= 3b4 (MDA mode) then the ; original INT 10 is called. ; IF AH = 1 and 40:63 = B4h, then the patch handles setting the ; cursor and returns. ; ; ; Notes on Monochrome cursor handling with Plasma Display: ; ; 1) Character Boxes: ; CGA = 8 x 8 ; MDA = 9 x 14 ; Plasma = 8 x 16 (lines 1 & 2 @ top of box are blank, lines 3 ; thru 16 same as MDA's 1 to 14 ) ; ; 2) The Fakeout PROM on the Plasma Display controller (port 23c6, ; bit 1) must be disabled. Otherwise, it multiplies the ; cursor line numbers by 2 for emulation of CGA cursor. ; ; 3) The cursor lines values in CL & CH must be incremented by 2 ; in order to bypass the 2 blank lines at the top of the ; Plasma character box. ; ; ;B) Grabs func 2 and works around a bug in the IDC-1 & -2 gate arrays ; in MDA mode: ; IDC gate array is blanking the cursor if the attribute byte at ; the cursor location is 00. ; *** That is correct for CGA operation but not for MDA. *** ; ; The patch intercepts func 2 calls and does the following: ; 1) Calculates the desired cursor position in screen memory ; using the number of columns onscreen from 40:4A and the ; starting address in region buffer from 40:4E ; 2) Examine the Character Attribute byte at the calculated ; address. If it is 00, write a 03h at that location to make ; the cursor visible when it gets there. ; 3) Call the original INT 10 to do the actual cursor movement. ; ;****************************************************************************** page ;****************************************************************************** ; Equates ;****************************************************************************** ; MONO_ADDR equ 0B4h MONO_MEM equ 0B000h ; patch segment byte public 'patch' assume cs:patch,ds:patch,es:NOTHING ; ;****************************************************************************** ; Data area for procedure ;****************************************************************************** ; public oldint oldint dd ? ;Old Int 10h vector my_flags db ? ; ;****************************************************************************** ; New INT 10h 01h routine ;****************************************************************************** ; public _new10 _new10 proc near push ax push es push si mov ax,40h ;Look for mono adapter i/o address mov es,ax mov si,63h mov al,es:[si] cmp al,MONO_ADDR pop si pop es pop ax jne go_old ; Not in MDA mode, use old INT 10 cmp ah,02h ; Test for fcn 02 (move cursor) je idc_fix cmp ah,01h ; Test for fcn 01 (set cursor) je fix01 go_old: jmp old_10 ;------------------- fix01: push ax ; New fcn 01 cursor routine starts here push si ; Save registers push ds push es push dx push cx mov ax,40h ; Store cursor stop/start @ 40:60 mov ds,ax mov si,60h mov al,cl mov [ds:si],al mov al,ch inc si mov [ds:si],al add ch,2 ; fudge CL & CH for plasma disp add cl,2 mov dx,23c6h ; Master Mode port mov al,02 ; disable Fakeout PROM out dx,al mov dx,3b4h ; send cursor info to CRTC mov al,0ah ; index out dx,al inc dx mov al,ch ; "start" line data out dx,al dec dx mov al,0bh ; index out dx,al inc dx mov al,cl ; "stop" line data out dx,al mov dx,23c6h ; re-enable Fakeout PROM mov al,0 out dx,al _done: pop cx pop dx pop es pop ds ; Restore registers pop si pop ax iret idc_fix: ; Mask error in IDC Gate array push ax ; by intercepting func 2 calls push bx push cx push dx push ds push si mov ax,40h mov ds,ax xor ax,ax ; Calc cursor position mov cx,dx ; use cx xchg al,ch ; get row from CH mov si,4ah ; number of columns per row [40:4A] mov bx,[si] mul bx ; mul rows by number of columns add cx,ax ; and add to leftover column info mov si,4eh mov ax,[ds:si] ; get offset in region buffer add cx,ax ; and add it to the position info shl cx,1 ; create offset from B000 inc cx ; add 1 to look at attribute byte mov ax,MONO_MEM mov ds,ax mov si,cx mov al,[ds:si] ; Get attribute @ new cursor location cmp al,0 jne no_fix ; leave it alone if not zero mov al,03 ; otherwise, mov [ds:si],al ; put a usable value in char attrib no_fix: pop si ; restore registers and pop ds ; and call old INT 10 to do pop dx ; the actual cursor movement pop cx pop bx pop ax old_10: jmp cs:[oldint] ; use the original INT 10 _new10 endp patch ends end _new10