Message-ID: <000001be4a32$ac99e6a0$2cfb38c3@daunerni> From: "Kergh-Zhul" To: Subject: help! Date: Wed, 27 Jan 1999 20:20:08 +0100 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0010_01BE4A32.6F20E6C0" 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
Hi everybody, KZ here.
 
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.)
 
It should be an inline assembly = function, if=20 possible. If not, please tell me how to link it in as well.
 
unsigned long kzblend24(unsigned = long x,=20 unsigned long y)=20 {
           &n= bsp;    =20 int=20 rr,gg,bb;
          =       =20 rr=3D(y&0xff0000)/0x10000*(x&0xff0000)/0x800000;
  &= nbsp;           &n= bsp; =20 gg=3D(y&0x00ff00)/0x100*(x&0x00ff00)/0x8000;
   = ;            =  =20 bb=3D(y&0x0000ff)*(x&0x0000ff)/128;
    &n= bsp;           =20 if(rr>255)=20 rr=3D255;
          =       =20 if(gg>255)=20 gg=3D255;
          =       =20 if(bb>255)=20 bb=3D255;
          =       =20 return(makecol24(rr,gg,bb));
       = ;=20 }
 
(This is a light blender and is for my new game = project, Satan=20 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=20 old and Hungarian.
------=_NextPart_000_0010_01BE4A32.6F20E6C0--