[A83] Re: Faster Multiplication


[Prev][Next][Index][Thread]

[A83] Re: Faster Multiplication



The rom's division routine is actually quite well written, unlike it's mult 
routine.  This is straight out of disassembly:

_divHLbyA:
    push bc
    ld c,a
    sub a
    ld b,16
_divLoop:
    add hl,hl
    rla
    cp c
    jr c,_divNoOverflow
    sub c
    inc l
_divNoOverflow:
    djnz _divLoop
    pop bc
    ret

And 3-D stuff is a bit more complicated than that.  You need trig tables to 
figure out what point (or wall if you're doing a raycaster) will be displayed 
at each location on the screen.


In a message dated 5/31/2001 3:58:33 PM Eastern Daylight Time, 
Mike3465@aol.com writes:


> Well, if people could figure out better multiplication and division 
> functions(anyone know of one for division?) and install those on the 
> processors, we could boost the fps on games quite easily, because 3d is so 
> heavily multiplication and division.  For example, to get a 3d point into 
> 2d 
> cordinates(lets forget about multiplication and scalling and what ever):
> x = x*(screen width/2(i think thats what the value is))/z;
> y = y*(ditto)/z;
> 
> see the reason that 3d is so slow? thats 2, maybe 3 multiplication and 
> division things to do(I think thats the general way to do it.)
> 
> But then we also have to get into the texture mapping and what ever.
> 
> But as it stands right now, they are trying to speed up the texture 
> mapping, 
> light/shadows, and so on.  But anyways, I should also say that, the 83 
> programs are graphically lesser then most windows programs, but also, 
> windows 
> games probably use a level of alpha blending, which is a pain 
> multiplication 
> ways, unless you use a rather large preset and what not.
> 
> But anyways, I'm just saying, that I personally go for speed and size, 
> favoring speed of course, but I never even seen anything like that.... Or 
> 




----
Jonah Cohen
<ComAsYuAre@aol.com>
http://jonah.ticalc.org