Hacker News new | ask | show | jobs
by leni536 3220 days 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.

1 comments

except 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.

> 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/05167784ef009d0d0...