Several games use non-standart value for depth buffer clear.
This value must be known beforehand for correct emulation.
Fixed NFL Quarterback Club 2000: gfx screwed up #148
Fixed flicker in Bomberman 2 map screen. The game sets scissor.lry = 250 here,
while VI.height is 240. Actual frame buffer height is 240. Making it 250
causes wrong selection of that buffer on VI update.
Problem:
N64 formula for screen z is screenZ = z/w*viewport.vscale[2]+viewport.vtrans[2]
OpenGL uses z/w, vscale and vtrans are set in glViewport and they always equal.
viewport.vscale[2] can be not equal to viewport.vtrans[2] and in that case
standard OpenGL z compare does not work correct.
Solution:
use N64 formula for screenZ in fragment shader.
Fixed Twine: wrong depth for the arm #115
This change cause crash in Top Gear Overdrive menu, because hEnd == hStart
at some point.
This reverts commit 61f9389656bd26b49c43394b701a3a7e31737b3c.
Fixed sun in Perfect Dark, which was broken after commit ba89dce8512:
Remove textures coordinates swap in case of lower coordinate is larger than higher one.
How it work:
- content of previous main frame buffer is copied into depth buffer area.
- CPU applies blur to th eimage in depth buffer area.
- Depth buffer is used as background texture for pause screen.
Solution:
1. Do not use depth buffer FBO as texture. Image must be load from RDRAM.
2. If current color image is depth image and previous color buffer is used as
texture for it, copy content of color image in RDRAM to depth image area.
Commit was based on wrong assumption that glTexParameters sets parameter
for current texture. Actually it sets parameter for current TMU.
glTextureParameter sets parameter per texture, but it is OGL 4.5
This reverts commit 0526d284ef377981cf45bf764dd8c0e7ea571f6e.
Replays works only if depth buffer FBO is NOT used as texture
because CPU copies color frame buffer for replays into depth buffer area.
Pause screen in Zelda OOT is copied into depth buffer area and it works only
id depth buffer FBO IS used as texture. Thus it is impossible to write general code
for both situations.