home *** CD-ROM | disk | FTP | other *** search
- ; pc1bitpl.asm
- ;
- ; 7/07/89 by Ted
- ;
- ; font plotter for 1 bit per pixel display modes
- ;
- ; OWL-PCA 1.2
- ; Copyright (c) 1989 Oakland Group Inc.
- ; ALL RIGHTS RESERVED
- ;
- ;------------------------REVISION HISTORY--------------------------------------;
- ; 9/06/89 ted Initialized ds in large data models; I forgot to before.
- ;------------------------------------------------------------------------------;
- include PCDECL.MAC
- include PCDATA.MAC
-
- PSEG
- ;------------------------------------------------------------------------------;
- ; void DIGPRIV pc_1bitplotchar()
-
- pubproc DIGPRIV pc_1bitplotchar
- pushm <bp, ds, es, di, si> ; no args, so bp is not needed
-
- IF FAR_DATA
- mov ax, seg pcdatastruc_ext
- mov ds, ax
- ENDIF
-
- ;; get everything we need out of pcdatastruc_ext
- mov si, word ptr pcdatastruc_ext.fontoffs
- mov di, pcdatastruc_ext.vidaddr
- mov es, pcdatastruc_ext.dispseg
-
- mov dx, pcdatastruc_ext.starty ; put y in dx
- mov bp, dx
- add bp, pcdatastruc_ext.fontlines ; put ending y val in bp
-
- ;; find out if chars are black on black or white on white
- mov ax, word ptr pcdatastruc_ext.fgcol ; al = fgcol; ah = bgcol
- xor ah, al ; set ah lo bit if colors different
- sar al, 1 ; shift al lo bit into ah:
- rcl ah, 1 ; bit 0 of ah now shows fgcol lo bit
- ; bit 1 of ah now shows if text has contrast
- linesloop:
- mov al, 0FFh
- test ah, 2 ; test contrast bit
- jz nocontrast
- mov bx, ds ; save ds temporarily in bx
- mov ds, pcdatastruc_ext.fontseg
- lodsb ; load font byte for this line; inc fontaddr
- mov ds, bx ; restore ds
- nocontrast:
-
- ;; check for inverse or normal video
- test ah, 1 ; test fgcolbit
- jnz normal
- not al
- normal:
-
- ; plot this scanline for all 'nsame' chars
- mov cx, pcdatastruc_ext.nsame
- mov bx, di ; save vidaddr in bx temporarily
- rep stosb
- mov di, bx
-
- ;; if (++y > endy) break;
- inc dx
- cmp dx, bp
- jae alldone
-
- ;; vidaddr += ((y & ilmask) == 0) ? vbincr : ilsize;
- test dx, pcdatastruc_ext.ilmask
- jz incvidbuf
- add di, pcdatastruc_ext.ilsize
- jmp linesloop
- incvidbuf:
- add di, pcdatastruc_ext.vbincr
- jmp linesloop
-
- ;---------
- alldone:
- popm <si, di, es, ds, bp>
- ret
- endproc pc_1bitplotchar
- ;------------------------------------------------------------------------------;
- ENDPS
- end
- ;------------------------------------------------------------------------------;
-
-