Mail Archives: djgpp/1997/03/19/14:41:56
<HTML><BODY>
Eli Zaretskii wrote:
<BLOCKQUOTE TYPE=3DCITE>You will need to post relevant fragments of your
code to get meaningful
<BR>answers. People have no way of guessing what's wrong with your =
code
<BR>without seeing it.
</BLOCKQUOTE>
<BR>Yeah, Sorry, Here is the code I am using=A0(the main() function and t=
he relevant
memory functions in my header files)
<BLOCKQUOTE TYPE=3DCITE>
<PRE>#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();
}</PRE>
</BLOCKQUOTE>
=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
<BR> =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
<BR> =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
<BLOCKQUOTE TYPE=3DCITE>
<PRE>
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"
);
}</PRE>
</BLOCKQUOTE>
<BR>
</BODY>
</HTML>
- Raw text -