Mail Archives: djgpp/1997/03/04/21:11:51
> Which brings up another point: wasn't Quake targeted at Pentiums and up?
> then why is there a slew of 16.16 fixedpoint code in it? doesn't the
> Pentium run FP faster than integer??? (snarl.. this is one of the reasons
> I've hit a snag on my Quake-on-SGI-and-SPARC port -- those &*%^^ fixed
> point routines are in Intel assembly <ack>)
There is fixed point so Quake can process 16 pixels at a time using affine
texture mapping while a perspective divide is running on the next perspective
correct calculation. I think the inner loop would be something like: (well,
I do it this way and Quake is about 1/2 cycle quicker per pixel)
fdiv leftpoint;
get leftu, leftv;
get rightu, rightv;
loop:
fix (rightu - leftu) >> 4;
fix (rightv - leftv) >> 4;
fdiv next_right_point;
calc offsets in texture for u,v;
calc UV step Nocarry, UV step carry;
unrol loop to map 16 pixels in the middle;
<fdiv finished>
mov right point values, left point values
loop;
Remember, Quake was designed specifically for Intel CPU's. If your porting
to another platform, you have to do all the dirty work.
Leathal.
- Raw text -