home *** CD-ROM | disk | FTP | other *** search
- ; pc8bitpl.asm
- ;
- ; 7/21/89 by Ted
- ;
- ; font plotter for 8 bit per pixel display modes (VGA mode 13h)
- ;
- ; 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_8bitplotchar()
-
- pubproc DIGPRIV pc_8bitplotchar
- 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
-
- ; get fg, bg colors into bx
- mov bx, word ptr pcdatastruc_ext.fgcol ; bl = fgcol; bh = bgcol
-
- linesloop:
- push ds ; save ds
- mov ds, pcdatastruc_ext.fontseg
- lodsb ; load font byte for this line; inc fontaddr
- pop ds ; restore ds
-
- ; plot this scanline for all 'nsame' chars
- push di ; save vidaddr
- push dx ; save y
- mov dl, al
- mov cx, pcdatastruc_ext.nsame
- charsloop:
- mov ah, 8
- pixloop:
- mov al, bl ; fg color
- rol dl, 1 ; rotate font byte left; bit duplicated in carry is current bit.
- jc fgplot
- mov al, bh ; bg color
- fgplot:
- stosb
- dec ah
- jnz pixloop
-
- loop charsloop
- pop dx ; restore y
- pop di ; restore vidaddr
-
- ;; 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_8bitplotchar
- ;------------------------------------------------------------------------------;
- ENDPS
- end
- ;------------------------------------------------------------------------------;
-