4 ms·
> Since 320x200=64000, it could have been implemented with a 16 bits Maximum-length register. But then you have to calculate modulus for 200 or 320.
by leni536 9y ago
> Since 320x200=64000, it could have been implemented with a 16 bits Maximum-length register.
But then you have to calculate modulus for 200 or 320.
- tripzilch 9y agoexcept the pixels are in a linear framebuffer, the fizzlePixel(x, y) function has a multiplication by 320 in it to calculate the address in the buffer. so you could skip both the modulo and the mul if you go straight for obtaining a random shuffled framebuffer index. unless maybe fizzlePixel does additional bookkeeping for some purpose.
- leni536 9y ago> has a multiplication by 320 Huh the original implementation seems to have a lookup table instead of that, interesting. https://github.com/id-Software/wolf3d/blob/05167784ef009d0d0daefe8d012b027f39dc8541/WOLFSRC/ID_VH.C#L521 https://github.com/id-Software/wolf3d/blob/05167784ef009d0d0...