Mail Archives: djgpp/1999/05/16/11:08:01
Getting the BIOS font, and writing it to the screen.
Some rough functions ripped from my graphics code:
// first we get the font from the ROM BIOS
void GI_LoadFont(void)
{
GI_CHAR_SET = malloc(8*128); // allocate non-near memory
// get the ROM font and load into memory
dosmemget((0xF000*16)+0xFA6E, 8*128, GI_CHAR_SET);
}
// we can draw it, but do conversion first. Its stored funny.
void GI_BlitChar(int x, int y, char color, char c, char t_flag)
{
int offset, x2, y2;
char *work_char;
unsigned char bit_mask = 0x80;
work_char = GI_CHAR_SET + c * CHAR_HEIGHT;
offset = y * SCREEN_W + x;
for(y2=0; y2<CHAR_HEIGHT; y2++)
{
bit_mask = 0x80;
for(x2=0; x2<CHAR_WIDTH; x2++)
{
if((*work_char & bit_mask))
_farpokeb(VideoSelector, offset+x2, color);
// _farpokeb(VideoSelector, y * SCREEN_W + x, color);
else if(!t_flag)
_farpokeb(VideoSelector, offset+x2, 0);
bit_mask = (bit_mask >> 1);
}
offset += SCREEN_W;
work_char++;
}
- Raw text -