Message-ID: <33303C7C.509F@geocities.com> Date: Wed, 19 Mar 1997 19:20:29 +0000 From: Daryl Cooper Reply-To: Daryl DOT Cooper AT Bigfoot DOT Com Organization: home MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp To: Eli Zaretskii , djgpp AT delorie DOT com Subject: Re: GPFs and PAGEFAULTS References: Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: quoted-printable Eli Zaretskii wrote: 
You will need to post relevant fragments of your code to get meaningful 
answers.  People have no way of guessing what's wrong with your = code 
without seeing it. 
 
Yeah, Sorry, Here is the code I am using=A0(the main() function and t= he relevant memory functions in my header files) 
#define vga 0xa0000

void main()
{
int x,y,c,detail,border;
unsigned char buffer[64000];
unsigned char *virt=3Dbuffer;
unsigned short local;
printf("protection =3D%i\n",__djgpp_nearptr_enable());


init();
local=3D_my_ds();
putpixel(50,50,50,local,(long)&virt);
flip(_go32_my_ds(),(long)&virt,_dos_ds,0xa0000);


restore();
}
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 
void flip(unsigned short sel,unsigned long source,unsigned short dsel,uns=
igned long dest)
{
//***********************************
//***********************************
//**           &nb=
sp; FLIP           =
;   **
//** Function to flip a virtual    **
//** screen to the real screen     **
//***********************************
//***********************************
asm("
movw %0,%%ax\n
movw %%ax,%%es\n
movl %1,%%edi\n
movw %2,%%ax\n
movw %%ax,%%ds\n
movl %3,%%esi\n
movl $16000,%%ecx\n
rep\n
movsl": :
"g"(sel),"g"(source),"g"(dsel),"g"=
;(dest)
:"ax","edi","esi","ecx"
);
}

void cls(unsigned short sel,unsigned long mem_loc,unsigned char col)
{
//***********************************
//***********************************
//**           &nb=
sp;  CLS          =
    **
//** Function to clear screen to   **
//** a given colour         =
       **
//***********************************
//***********************************
asm("
movw %2,%%ax\n
movw %%ax,%%es\n
movl %1,%%edi\n
movb %0,%%bl\n
movb %%bl,%%bh\n
movw %%bx,%%ax\n
shl $16,%%eax\n
movw %%bx,%%ax\n
movl $16000,%%ecx\n
rep\n
stosl":
:"g"(col),"g"(mem_loc),"g"(sel)
:"eax","bx","ecx"
);
}