'=========================================================================== ' Subject: GRAPHICS PRINT REPLACEMENT Date: 06-08-96 (06:02) ' Author: Douglas H. Lusher Code: QB, PDS ' Origin: FidoNet QUIK_BAS Echo Packet: GRAPHICS.ABC '=========================================================================== 'Hi. It was no surprise when you replied to my post of 'the routine to print text in the graphics modes and indicated 'that the VGA character set was at a different location on your 'graphics card than on mine. Different manufacturers did their 'BIOSes differently and I knew that. I had also known a long 'time ago that there was an interrupt that could be called to 'find the location of the active VGA character set. But believe 'it or not, it had never occured to me to put the two together. 'Duh. I get absent-minded sometimes. And when I first came across 'the idea, only the CGA character set was used, and since that 'is hard-coded into the BIOS, its segment and offset are fixed 'and the same for everybody and were written right into the code. 'And it just didn't occur to me to do it any different until 'I read your reply. Anyway, here's the same routine but with 'the interrupt called to get the location of the VGA character 'set. Also, I modified the code to get the LineFormat bits. 'This should execute faster. You will need to load QB with the '/L switch and put the line REM $INCLUDE: 'QB.BI' SUB GPrint (X%, Y%, Text$, Culler%) 'this routine allows printing text at any pixel location ' in the graphics modes without disturbing the background 'by Douglas H. Lusher, 06-08-1996 ' 8 x 8 char box, CGA 'CharSegment% = &HFFA6: CharOffset% = &HE 'CharWid% = 8: CharHgt% = 8 ' 8 x 14 char box, EGA 'CharSegment% = &HC000: CharOffset% = &H4ED5 'CharWid% = 8: CharHgt% = 14 ' 8 x 16 char box, VGA DIM Regs AS RegTypeX Regs.AX = &H1130 Regs.BX = &H600 CALL InterruptX(&H10, Regs, Regs) CharSegment% = Regs.ES: CharOffset% = Regs.BP CharWid% = 8: CharHgt% = 16 DEF SEG = CharSegment% XX% = X% FOR Char% = 1 TO LEN(Text$) Ptr% = CharHgt% * ASC(MID$(Text$, Char%, 1)) + CharOffset% FOR Ln% = 0 TO CharHgt% - 1 BitPattern& = PEEK(Ptr% + Ln%) * 256& LineFormat% = (BitPattern& - 32768) XOR -32768 LINE(XX%,Y%+Ln%)-STEP(CharWid%-1,0),Culler%,,LineFormat% NEXT XX% = XX% + CharWid% NEXT DEF SEG END SUB