Mail Archives: djgpp/1997/07/09/01:47:54
From: | "Ben Cohee" <benco AT gisco DOT net>
|
Subject: | Help from DJGPP AT&T/LINUX assembly guru's ;)
|
Message-ID: | <01bc871e$1d070820$55a333cf@gisco.net.gisco.net>
|
Newsgroups: | comp.os.msdos.djgpp
|
Date: | Wed, 02 Jul 1997 15:29:26 -0400
|
Lines: | 34
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
I need a function to be converted into assembly and needed help just
getting it converted to some intel style assembly but now that im using
DJGPP i need it done with AT&T assembly. I dont think it will make much
difference if its in inline assembly or an external .s file does it?? Well
anyway its kinda long but here it is.
void Scan_Out_Line(EDGESCAN *left,EDGESCAN *right)
{
fixed sourcex = left->sourcex;
fixed sourcey = left->sourcey;
int destx = left->destx,destxmax = right->destx;
fixed destwidth,sourcexstep,sourceystep;
if ((destxmax <= CLIP_MIN_X) || (destx >= CLIP_MAX_X))
return;
if ((destxmax-destx) <= 0)
return;
destwidth = itofix(destxmax-destx);
sourcexstep = fdiv(right->sourcex - sourcex,destwidth);
sourceystep = fdiv(right->sourcey - sourcey,destwidth);
sourcex += sourcexstep >> 1;
sourcey += sourceystep >> 1;
if (destxmax >= CLIP_MAX_X)
destxmax = CLIP_MAX_X;
if (destx <= CLIP_MIN_X)
{
sourcex += fmul(sourcexstep,itofix(CLIP_MIN_X - destx));
sourcey += fmul(sourceystep,itofix(CLIP_MIN_X - destx));
destx = CLIP_MIN_X;
}
for (; destx<destxmax; destx++)
{
buffer[ytable[desty] + destx] = image[ytable[sourcey] + sourcex];
sourcex += sourcexstep;
sourcey += sourceystep;
}
}
Look familiar to anyone ;)
- Raw text -