delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/14/01:45:30

From: Bjorn Hansen <viking AT xyz DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: displaying a bmp
Date: Thu, 13 Aug 1998 01:59:46 -0800
Organization: ISPNews http://ispnews.com
Lines: 37
Message-ID: <35D2B912.3F40D6C8@xyz.net>
NNTP-Posting-Host: hom-2-3.xyz.net
Mime-Version: 1.0
NNTP-Posting-Date: 13 Aug 1998 10:01:48 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

I am trying to figure out how to display a bmp without using allegro but
I can't quite seem to get it.  here is my code:

#include <stdio.h>
#include <sys/movedata.h>
#include <dpmi.h>

#define VGA_13h 0x13
#define TEXT 3

void set_mode(int mode)
     {
     __dpmi_regs r;
     r.x.ax = mode;
     __dpmi_int(0x10, &r);
     };

void main()
{
 char smiley[320*200];
 FILE *pict= fopen("C:\\Cstuff\\smibm.bmp","rb");
 set_mode(VGA_13h);

 dosmemput(pict+128,320*200,0xA0000);
 while(!kbhit());
 set_mode(TEXT);

}

It compiles and runs ok but what I see on the screen is not the bmp that
I'm trying to display.  I'm not sure if this is even the right approach
but if someone could tell me what I'm doing wrong (or not doing at all)
I would appreciate it.

Thanks
Bjorn Hansen

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019