1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-07 03:13:49 +00:00
Commit Graph

1401 Commits

Author SHA1 Message Date
Sergey Lipskiy
24885907d8 Add hack_ZeldaCamera to fix camera in Zelda MM, #577
The game copies current frame buffer to the area, which initially allocated for depth buffer.
Game read camera data from that area, not from normal frame buffer.
That's why 'copy color buffer to RDRAM' option does not help there.
Special code needed to process that. Looks ugly, but works.
2015-09-27 10:10:05 +06:00
Sergey Lipskiy
1eaa967553 Add hack_skipVIChangeCheck hack for Zelda MM.
Fix problem with Majora's Mask subscreen after Bomber's Notebook read, #698

The game switches to interlaced mode when it opens Notebook screen and background buffer is removed.
This hack prevents buffers clear on VI change.
2015-09-26 22:36:31 +06:00
Sergey Lipskiy
a3f9b43b4a Disable _copyDepthBuffer() for GLES2 only. 2015-09-26 22:36:25 +06:00
Sergey Lipskiy
27c4cccd81 Code refactor in _copyDepthBuffer(). 2015-09-26 22:13:49 +06:00
Sergey Lipskiy
bff19580eb Code refactor: CheckForFrameBufferTexture - use fbList variable instead of calls to frameBufferList() 2015-09-26 22:11:31 +06:00
Sergey Lipskiy
874ebce5ca Use fixed alpha flag only for 8bit frame buffers.
Otherwise it cause regression in Pokemon Stadium 2, see #721
2015-09-25 22:04:59 +06:00
Sergey Lipskiy
a98aac9fd4 Make frame buffer texture monochrome when it is used as IA texture.
Fixes sepia effect in Pokemon Stadium 2 during credits, #721
2015-09-25 19:34:46 +06:00
Sergey Lipskiy
d506d6134d Set vertex alpha for texrect to 1.
This is actually a hack. Rect functions use vertex color and alpha set to zero.
This hack is done to fix issue #721 in Pokemon Stadium 2. The game uses
texrects to render images in the auxiliary buffer. The texrects use SHADE
for alpha combiner. Since alpha is zero, the rendered image in the auxiliary buffer
has zero alpha. When the auxiliary buffer is used as texture, it is blended with
background, and zero alpha makes it invisible. I set vertex alpha to 1 to avoid it.

When N64 saves pixel to 16bit frame buffer, it uses pixel coverage for alpha value to store,
not calculated pixel's alpha. Thus, on real N64 the auxiliary buffer will have
full alpha and blending will not make it invisible. Thus, true emulation will
require pixel coverage calculation and shader-based blending.
2015-09-25 19:34:41 +06:00
Sergey Lipskiy
11317c2d85 Correct some blend modes. 2015-09-25 18:50:39 +06:00
Sergey Lipskiy
1fb78594c8 Fix buffer end address calculation in FrameBuffer::reinit.
Fixed regression in Pokemon Stadium 2: the bottom of the portraits is cut off, see #415
2015-09-25 12:21:20 +06:00
Sergey Lipskiy
43d387b956 Fix compilation of GLSLCombiner_gles2.cpp 2015-09-24 19:01:51 +06:00
Sergey Lipskiy
076345dadb Do not init NoiseTexture is noise emulation option is disabled. 2015-09-21 21:42:46 +06:00
Sergey Lipskiy
2ec48ee251 Optimize NoiseTexture update: do not create new buffer data on each update. 2015-09-21 21:42:42 +06:00
Sergey Lipskiy
a73b8dddbd Fix bug in FrameBufferList::saveBuffer :
corrent end address for auxiliary buffer only if it was not corrected by correctHeight().
2015-09-20 20:28:05 +06:00
Sergey Lipskiy
702a0d8203 Correct FrameBufferList::saveBuffer :
disable draw to FBO if new buffer can't be saved because of wrong buffer size
2015-09-20 20:12:52 +06:00
Sergey Lipskiy
6ad1d1d3a5 Correct FrameBufferList::correctHeight() :
do not change buffer if new buffer height is the same as the current one.
2015-09-20 20:09:59 +06:00
Sergey Lipskiy
22a1e6a39f Revert "Correct frame buffer end address calculation in FrameBufferList::saveBuffer."
Seems to be not needed anymore.

This reverts commit bb6a9b3549.
2015-09-20 20:02:22 +06:00
Sergey Lipskiy
3d6a897c97 Fix GL error when CopyToRDRAM a buffer with zero width or height. 2015-09-20 15:31:39 +06:00
Sergey Lipskiy
1bf3b6e85a Fix alphaNoiseDither.
Weird, but use of bit mask causes the shader to work completely wrong, see #518
2015-09-19 19:27:12 +06:00
purplemarshmallow
f487225b48 Optimize Perfect Dark framebuffer effects
We only check once per frame. ~100% performance boost in deep sea with
infrared vision.
2015-09-19 18:45:32 +06:00
purplemarshmallow
e7024978ac don't update NoiseTexture if noise is disabled
updating NoiseTexture kills performance in Star Wars Episode I - Racer.
If noise emulation is disabled there's no need to update it.
2015-09-19 18:00:47 +06:00
matto
18172a6c0b Fixing multisampling
We were calling glTexStorage2DMultisample with a 'samples' parameter of 0.
Reading the GL 4.4 spec, this is specifically forbidden, but the
documentation pages from Chronos were incorrectly stating that it was
allowed, so many implementations probably accept it. Mesa, the graphics
driver for many Linux cards has recently been corrected so that it emits
a warning and fails when glTexStorage2DMultisample is called with
samples=0. The current release works, but the next one will fail when
multisampling is turned off in this plugin (with multisampling turned
on, it will work the same as before).

The documentation pages from Kronos have since been updated to reflect
the GL spec (I put in a bug to them). You can see the proper
changes at this address
(https://www.opengl.org/wiki/GLAPI/glTexStorage2DMultisample).
2015-09-08 10:58:52 +06:00
matto
0ea397a4cc Changing the getRevision script to place the header differently
I called getRevision.sh from a directory other than src and I ended
up with an unexpected Revision.h in my current directory without
placing one in src. This modifies the script to place the header
file in the same directory as the script.
2015-09-05 16:24:17 -04:00
purplemarshmallow
1fcb64ca79 Revert "Don't discard frame buffers creation when _height == 0"
This reverts commit de32176303.

This commit causes regressions:
In Pokemon Stadium when starting a battle one portrait can be missing
failed assertion in framebuffer.cpp Line:580 Expression checkFBO()
2015-09-04 10:09:00 +06:00
purplemarshmallow
edc09dffff ini fixes:
- up config version in custom ini
- remove txPath
2015-09-03 21:45:07 +06:00
matto
3e8ab78258 Code cleanup: Adding newlines to code lines that were too long.
I think this adds to the readability of the code, as my brain
starts reeling when the line has to break off the page.
2015-09-03 21:27:55 +06:00
matto
6c22746619 Code cleanup: removing random semicolon. 2015-09-03 21:25:40 +06:00
matto
4eb27a8795 Adding assert on malloc
We do this in other places and I think it's good behaviour for the
exceptional occasion that we cannot allocate memory.
2015-09-03 21:24:35 +06:00
matto
6156c35617 Code cleanup: moving logic from large loop in TextureCache::_load to
worker function.

This makes this loop tighter and easier to read. The loop was really
difficult to read before, and now it's a tad easier.
2015-09-03 21:22:08 +06:00
purplemarshmallow
2847606877 Always reinit buffer after its height correction.
This fixes pokemons library in Pokemon Stadium 2.
2015-09-03 20:52:12 +06:00
matto
fa7e1c8137 Splitting up asserts
If these asserts are to be useful for debugging, they should really
be split up so that we can tell which one is failing.
2015-08-29 11:55:34 -04:00
purplemarshmallow
59c771cb7b [ini] remove Knockout Kings 2015-08-27 19:44:27 +06:00
purplemarshmallow
b62e50a86e [ini] remove validityCheckMethod 2015-08-27 19:44:24 +06:00
Sergey Lipskiy
2604b57bf1 Remove ValidityCheckMethod from config and UI.
Up config version.
2015-08-27 19:44:19 +06:00
purplemarshmallow
8e096a8db9 remove fill RDRAM functionality
fix m_fingerprint usage
fix code formatting
2015-08-27 19:43:00 +06:00
Sergey Lipskiy
c6988bb963 Fig regression with frame/depth buffer copy in HLE mode caused by commit 77f342f. 2015-08-27 19:39:29 +06:00
Sergey Lipskiy
5eddea5baf Add workaround for Adreno issue with glBlitFramebuffer.
Thanks fzurita for problem investigation and found solution.
2015-08-27 19:20:26 +06:00
purplemarshmallow
de32176303 Don't discard frame buffers creation when _height == 0 2015-08-26 20:43:09 +06:00
purplemarshmallow
97468d8e2a enable validity checking if copyFromRDRAM option is on 2015-08-26 19:42:43 +06:00
Sergey Lipskiy
60c8003dc9 Remove GL ES extensions enablings from fragment shaders,
because they cause crash on PowerVR GPUs.

No regression found on Adreno and Tegra GPU. Need to be tested on other GPUs.
2015-08-26 19:27:02 +06:00
Sergey Lipskiy
444545baea Enable hack_VIUpdateOnCIChange for Perfect Dark.
Fixed: Perfect Dark flickering lights #609
2015-08-23 20:38:44 +06:00
purplemarshmallow
01ffde2aa9 update scale when resizing window 2015-08-23 12:40:56 +06:00
Sergey Lipskiy
57e88cb800 Remove unused code. Fix code formatting. 2015-08-17 21:57:01 +06:00
purplemarshmallow
8463c0347f fix regression in Mario Tennis 2015-08-17 21:57:00 +06:00
purplemarshmallow
0735bd0372 modify fingerprint validity checking method
In Zelda OOT the CPU applies a filter on the framebuffer texture. If we
write a small amount of data at the beginning the CPU won't change our
specific values
2015-08-17 21:56:59 +06:00
purplemarshmallow
e0face5f86 use unique values as fingerprint
this works much better
But sometimes Zelda writes values not only under but also over the
fingerprint, Link's model is lost again
2015-08-17 21:56:58 +06:00
purplemarshmallow
e617177958 fix problem with validity ckecking in Zelda OOT
problem: the game writes data below our fingerprint
solution: just check if the fingerprint is still there and ignore the
data below
2015-08-17 21:56:58 +06:00
Sergey Lipskiy
d30d813b18 Fix texture filter init/shutdown:
- texture filter updated when config.textureFilter options changed.
2015-08-17 15:42:40 +06:00
Sergey Lipskiy
5bf7a4e4de Add support of 6xBRZ to user interface. 2015-08-17 15:37:15 +06:00
Sergey Lipskiy
daf18efabb Update xBRZ texture filter to version 1.4
xBRZ: "Scale by rules" - high quality image upscaling filter by Zenju

Adopted sources from
http://sourceforge.net/projects/xbrz/files/xBRZ/
2015-08-17 15:37:15 +06:00