Mail Archives: djgpp/1999/01/27/15:19:36
Message-ID: | <000001be4a32$ac99e6a0$2cfb38c3@daunerni>
|
From: | "Kergh-Zhul" <kz AT bethlen DOT hu>
|
To: | <djgpp AT delorie DOT com>
|
Subject: | help!
|
Date: | Wed, 27 Jan 1999 20:20:08 +0100
|
MIME-Version: | 1.0
|
X-Priority: | 3
|
X-MSMail-Priority: | Normal
|
X-Mailer: | Microsoft Outlook Express 4.72.2106.4
|
X-MimeOLE: | Produced By Microsoft MimeOLE V4.72.2106.4
|
Reply-To: | djgpp AT delorie DOT com
|
This is a multi-part message in MIME format.
------=_NextPart_000_0010_01BE4A32.6F20E6C0
Content-Type: text/plain;
charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable
Hi everybody, KZ here.
I am in a big need of help now. I wrote a transparency blender function =
for Allegro. It works perfectly, but it is SLOW. It must be LOT faster. =
(With that function, my test code generates approx. 0.9 frame/sec on my =
100 mhz 486. It should generate at least 5/sec.) I am fairly experienced =
with C - so writing my code in C is not a problem, but the syntax of =
djgpp's assembler is just too COMPLEX for me. (I am experienced with =
assembly, too, but I only wrote code for real mode NASM.) So PLEASE, =
will somebody help me with translating this function to assembly? (It is =
the 24 bit version - I think I will be able to do the 15 version when I =
saw the translation of the 24 bit one.)
It should be an inline assembly function, if possible. If not, please =
tell me how to link it in as well.
unsigned long kzblend24(unsigned long x, unsigned long y) {
int rr,gg,bb;
rr=3D(y&0xff0000)/0x10000*(x&0xff0000)/0x800000;
gg=3D(y&0x00ff00)/0x100*(x&0x00ff00)/0x8000;
bb=3D(y&0x0000ff)*(x&0x0000ff)/128;
if(rr>255) rr=3D255;
if(gg>255) gg=3D255;
if(bb>255) bb=3D255;
return(makecol24(rr,gg,bb));
}
(This is a light blender and is for my new game project, Satan Klaus.)
Very very big thanks.
KZ http://edu.bethlen.hu/nagy_m/ kz AT bethlen DOT hu
P.S. Answers ONLY to kz AT bethlen DOT hu, please.
P.S.2. Sorry for my bad english - I am 15 years old and Hungarian.
------=_NextPart_000_0010_01BE4A32.6F20E6C0
Content-Type: text/html;
charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>
<META content=3Dtext/html;charset=3Diso-8859-2 =
http-equiv=3DContent-Type>
<META content=3D'"MSHTML 4.72.2106.6"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT color=3D#000000 size=3D2>Hi everybody, KZ here.</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT> </DIV>
<DIV><FONT color=3D#000000 size=3D2>I am in a big need of help now. I =
wrote a=20
transparency blender function for Allegro. It works perfectly, but it is =
SLOW.=20
It must be LOT faster. (With that function, my test code generates =
approx. 0.9=20
frame/sec on my 100 mhz 486. It should generate at least 5/sec.) I am =
fairly=20
experienced with C - so writing my code in C is not a problem, but the =
syntax of=20
djgpp's assembler is just too COMPLEX for me. (I am experienced with =
assembly,=20
too, but I only wrote code for real mode NASM.) So PLEASE, will somebody =
help me=20
with translating this function to assembly? (It is the 24 bit version - =
I think=20
I will be able to do the 15 version when I saw the translation of the 24 =
bit=20
one.)</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT> </DIV>
<DIV><FONT color=3D#000000 size=3D2>It should be an inline assembly =
function, if=20
possible. If not, please tell me how to link it in as well.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=3D#000000 size=3D2>unsigned long kzblend24(unsigned =
long x,=20
unsigned long y)=20
{<BR> &n=
bsp; =20
int=20
rr,gg,bb;<BR> =
=20
rr=3D(y&0xff0000)/0x10000*(x&0xff0000)/0x800000;<BR> &=
nbsp; &n=
bsp; =20
gg=3D(y&0x00ff00)/0x100*(x&0x00ff00)/0x8000;<BR>  =
; =
=20
bb=3D(y&0x0000ff)*(x&0x0000ff)/128;<BR> &n=
bsp; =20
if(rr>255)=20
rr=3D255;<BR> =
=20
if(gg>255)=20
gg=3D255;<BR> =
=20
if(bb>255)=20
bb=3D255;<BR> =
=20
return(makecol24(rr,gg,bb));<BR>  =
;=20
}</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>(This is a light blender and is for my new game =
project, Satan=20
Klaus.)</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT> </DIV>
<DIV><FONT color=3D#000000 size=3D2>Very very big thanks.</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT> </DIV>
<DIV><FONT color=3D#000000 size=3D2>KZ <A=20
href=3D"http://edu.bethlen.hu/nagy_m/">http://edu.bethlen.hu/nagy_m/</A> =
<A=20
href=3D"mailto:kz AT bethlen DOT hu">kz AT bethlen DOT hu</A></FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT> </DIV>
<DIV><FONT color=3D#000000 size=3D2>P.S. Answers ONLY to <A=20
href=3D"mailto:kz AT bethlen DOT hu">kz AT bethlen DOT hu</A>, please.</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT> </DIV>
<DIV><FONT color=3D#000000 size=3D2>P.S.2. Sorry for my bad english - I =
am 15 years=20
old and Hungarian.</FONT></DIV></BODY></HTML>
------=_NextPart_000_0010_01BE4A32.6F20E6C0--
- Raw text -