cvs.gedasymbols.org/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/13/15:46:44

From: Bjorn Hansen <viking AT xyz DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Memory buffer in VGA mode 13h
Date: Thu, 13 Aug 1998 11:29:00 -0800
Organization: ISPNews http://ispnews.com
Lines: 49
Message-ID: <35D33E7B.A1629AF3@xyz.net>
References: <e6AA1.1381$Oj4 DOT 2462004 AT nntpserver DOT swip DOT net>
NNTP-Posting-Host: hom-3-4.xyz.net
Mime-Version: 1.0
NNTP-Posting-Date: 13 Aug 1998 19:31:03 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Well it works ok for me. Here is some code that works so you can see if
it is similar to what you are trying to do.


#include <go32.h>
#include <sys/farptr.h>
#include <sys/movedata.h>
#include <dpmi.h>

#define VGA_13h 0x13
#define TEXT 3
#define BACKGROUND 6

char image[320*200];

///////////////set mode////////////////////

void set_mode(int mode)
     {
     __dpmi_regs r;
     r.x.ax = mode;
     __dpmi_int(0x10, &r);
     };
////////////create the picture//////////////
void make_pic(void)
     {
     int i;

     memset(image,BACKGROUND,sizeof(image));
     };
///////put the picture on the screen///////
void paint(void)
     {
     dosmemput(image,320*200,0xA0000);
     };
///////////////////MAIN/////////////////////
void main()
{
 set_mode(VGA_13h);
 make_pic();
 paint();
 while(!kbhit());
 set_mode(TEXT);
}



Bjorn Hansen

- Raw text -


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