Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Borland Pascal: Graphics Problem 1

Status
Not open for further replies.

ltandkt

Programmer
May 14, 2003
2
CA
I wrote a DOS program that displays messages in graphics mode. The program works well in most computers. But recently some people complaint that when run the program in a new laptop with Windows XP or 2000 and ATI video card, the alphabet characters appear OK on the screen but the digits and non-alphabet characters are garbled or just shows blank. I thought it was the video card in the new laptop causing the problem so I bought a new PC with Windows XP Pro and tested my program in that PC with an ATI card and NVIDIA card but I could not duplicate the problem.

Does anyone have any idea?
 
...Bad Luck?

j/k

Sorry No Idea...

Are you using standard pascal function to draw the characters or did you make your own procedures?

I have seen some laptops scramble the characters in QBasic when using the character maps from memory to draw the characters in graphics mode...

It might just be a laptop thing...

Have Fun, Be Young... Code BASIC
-Josh Stribling
cubee101.gif

 
I don't know either, but if it is a system font problem, one way to fix it would be to catch the interrupt that is used to return the address of the system (bios) font, and replace it with your own that either calls the original if faced with a request it doesn't understand, or returns the address of a dummy proc in your own pascal unit, which you would write as an assembler proc containing dw's for all the codes of the font. To avoid making up a complete font yourself you could use the original interrupt on your own computer (that you know works), and take the character definitions from there.
Sorry, very longwinded, and there must be a neater way.
(I'm still stuck in Turbo 6.0 world, so not up on Borland pascal)
 
Thank you all for your help. I used the standard "OUTTEXT" function. I think that part of the font table or video buffer may be overwritten by some other software. I tried to reserve the video memory start at $A000 in the CMOS setup but in some laptops, I don't see the Chip Set page anymore. I am thinking of generating a font table for my program but this is very tedious. While my DOS program has this problem in some laptops, I wrote a Delphi program to show messages. The Delphi program works OK.

This is the first time I tried this group and I am surprised with the quick responses from Tek-Tips.
 
Glad you like this site. So do I. People are often helpful, almost always courteous...
You are right that creating your own table would be tedious, but I'd imagine you could get the address of the font table in your PC and "steal" it - copy it to a file and use that on other systems. I might be wrong, but I think you can get the address by calling interrupt 010h with ah=011h (=character generator), al=030h (get font pointer info), bh=font you want to get (I can't remember the codes, but it's things like 0, 1, 2, 3, for 8*8, 8*14 etc., Abrash's big black book has full details embedded in it somewhere), and the interrupt returns address in es:bp, bytes per character in cx.
If you are interested in going this way and can't find Abrash or get stuck, I can try to dig out the proper details. I did do it once!
Lionel
 
The fact is that modern BIOSes either have their own implementation of the second half of the ASCII table or don't implement the second half at all, using the memory for something else. And even though some (older) BIOSes do contain the second half, you can never be sure it's the way you want it because it's not standard (ASCII is a seven bit standard; the MSB was usually used for region specific characters).

What you can do is very easy: make a list of the characters you need on a computer that has a character set you want. You can do this by writing some assembly or you can switch to graphics mode, write a character with outtextxy and retrieve the font data with 8 x 8 = 64 getpixel calls and this 128 times (that's the way I've done it once).

Regards,
Bert Vingerhoets
vingerhoetsbert@hotmail.com
Don't worry what people think about you. They're too busy wondering what you think about them.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top