OpenSWE1R / openswe1r

An Open-Source port of the 1999 Game "Star Wars Episode 1: Racer"
https://openswe1r.github.io/
GNU General Public License v2.0
315 stars 26 forks source link

Game doesn't seem to support more than 16 bit depth buffer #129

Open JayFoxRox opened 6 years ago

JayFoxRox commented 6 years ago

Some of the reverse engineered code suggests that counting pixels which pass a CPU based Z-test, only works if the z-buffer is 1 or 2 bytes per pixel.

The function responsible for these checks can be found at 0x42D440 in the demo version. It has been decompiled and partially rewritten and documented here: https://github.com/OpenSWE1R/swe1r-re/blob/4c945a6b5f403b682012bda43c0ef11ef820fe1e/swep1rcr.exe/RE:-Occlusion-Queries.md (not latest revision)

The respective function should be inspected with a disassembler to be sure. We should keep track of this bug so we don't suddenly have regressions when upgrading to a 32 bit framebuffer.

(The same function also isn't resolution independent and would fail in high-dpi scenarios, although that is another issue)