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

318 Commits

Author SHA1 Message Date
Sergey Lipskiy
57dbfb5145 Revert changes in FrameBuffer::getTexture made by commit 6942083
These changes are incorrect and cause regression in Paper Mario fortune teller.
2016-10-25 12:27:49 +07:00
Sergey Lipskiy
85a5ae8ea1 Implement performance counter.
Implement drawing performance info on screen.
2016-10-08 14:53:33 +07:00
Sergey Lipskiy
aab6726117 Implement crop image feature. 2016-10-08 14:53:21 +07:00
Sergey Lipskiy
ce5abcb21b Correct FrameBuffer::isValid - do not update m_validityChecked when isValid called from VI_UpdateScreen
Fixed Broken Pokemon stadium 2 in-game portraits #1149
2016-10-05 15:39:41 +07:00
Sergey Lipskiy
ff55e5bea9 Apply scissor to all input coordinates in FrameBufferList::fillRDRAM.
Fixed Super Smash Bros Intro not playing with Framebuffer Emulation enabled #1154
2016-10-04 21:22:20 +07:00
Sergey Lipskiy
6942083612 Disable FrameBuffer::_getSubTexture for GLES2 because GLES2 implementation of OGLRender::copyTexturedRect can't be safely used here. 2016-09-29 19:58:56 +07:00
Sergey Lipskiy
39da91bb93 Move gDPFillRDRAM to FrameBufferList::fillRDRAM
Correct FrameBuffer::isValid()
Code cleanup.

Fixed Mickey Speedway USA is broken again. #1132
2016-09-27 21:43:28 +07:00
Sergey Lipskiy
b5163ca048 Drop cfb flag when buffer changed. 2016-09-19 15:32:24 +07:00
Sergey Lipskiy
e28bebd17e Add validity check for background fb textures.
Fixed Nushi Zuri 64: fb background doesn't work anymore #1115

Problem: The game normally uses color and depth buffers.
When it needs to show rectangle with text, CPU copies current color buffer
by depth buffer address. This buffer rendered as background, text rendered over.
Plugin detects buffer usage and tries to use depth buffer as background texture.
That buffer in video memory has no color information, because data copied by CPU and contained in RDRAM.

Solution: check that found frame buffer is valid.
In this case validity check will fail because RDRAM content modified by CPU,
and background will be read from RDRAM.
2016-09-16 17:09:25 +07:00
Sergey Lipskiy
5a296525ea FrameBufferList::renderBuffer : correct condition for Xoffset. 2016-09-12 21:26:37 +07:00
Sergey Lipskiy
32172d30af Fix depth buffer clear for aux buffers. 2016-09-11 18:08:03 +07:00
Sergey Lipskiy
21ef068f2a Fix typo in FrameBuffer::getTexture 2016-09-11 15:27:59 +07:00
Sergey Lipskiy
9faeb2bfb9 Force clear depth buffer for aux buffers.
Fixed uncleaned depth buffer problem when depth buffer cleared partially via fillrect.
2016-09-08 22:29:12 +07:00
Sergey Lipskiy
d289d4c65a Correct conditions when render to depth buffer can be enabled. 2016-09-07 21:11:31 +07:00
Sergey Lipskiy
7dca7f8f4d Implement depth buffer copy for Mario Golf.
Fix Mario Golf: Animated effects render in front of course #312
2016-09-06 19:37:11 +07:00
Sergey Lipskiy
4c226bcc95 Do not show rightmost pixels in frame buffer when AA and divots elimination enabled in VI.
Problem: Some games have strange glitch, which looks like vertical line of
pixels outside of right bound of the image. Examples: JFG title screen,
both Zelda games when new game started. Software plugin has the same issue,
but when image passes VI stage, the problem disappears. Most likely
VI filters somehow eat the rightmost pixels. I suspect that it is result of
divots elimination. Thus, the fix works like this:
when divot flag is set the rightmost column of pixels is not shown.
2016-08-29 18:32:16 +07:00
Sergey Lipskiy
d80bd636e2 Emulate crazy way of shifting image horizontally, which bottom of the 9th uses.
Fixed bottom of the 9th: screen not centered #862
2016-08-28 18:22:44 +07:00
Sergey Lipskiy
3bfebd0910 Remove allocated frame buffer if its color depth is less then necessary.
Fixed Majora's Mask screen turns red #790

Problem description:
the game allocates 8bit aux frame buffer when enter to subscreen.
When screen shrink effect started, the game allocates 16bit buffer on the same address.
Since plugin already had buffer allocated, it reused that buffer. Since the buffer's
texture had only red component, whole screen turned red.

Fix: create new buffer if color depth of existing buffer is less than necessary.
2016-08-28 16:00:50 +07:00
Logan McNaughton
e0d8830b2a Another fix for FBE on Raspberry Pi 2016-07-21 10:57:17 +06:00
Logan McNaughton
a20dc97a5a Fixes menu on Castlevania and Rayman 2 with FBE enabled on Raspberry Pi
Probably fixes other FBE issues as well
2016-07-11 10:05:52 +06:00
Logan McNaughton
f2babed36d Fix some more graphical glitches with FBE on the Raspberry Pi
See https://github.com/RetroPie/RetroPie-Setup/pull/1563
2016-07-08 16:42:22 +06:00
Logan McNaughton
1cbbea8183 Enable Framebuffer Emulation on the Raspberry Pi
renderbuffer code was written by gonetz, not me
2016-06-26 17:40:14 +06:00
Sergey Lipskiy
07854d3857 Use OGLRender::copyTexturedRect in ColorBufferToRDRAM::_prepareCopy.
Enable color buffer copy for GLES2.
2016-06-23 16:15:27 +06:00
Sergey Lipskiy
7ad11627d6 Use OGLRender::copyTexturedRect in FrameBuffer::renderBuffer
Remove GLES2-specific code.
2016-06-23 16:14:04 +06:00
Sergey Lipskiy
4cb53d9675 Use OGLRender::copyTexturedRect in FrameBuffer::_getSubTexture
Remove GLES2-specific code.
2016-06-23 16:12:50 +06:00
Sergey Lipskiy
4c4b1bf57d Code refactor: move struct FBOTextureFormats to separate files. 2016-06-20 15:16:15 +06:00
Sergey Lipskiy
86fbea9edc Code refactor: replace NULL by nullptr. 2016-06-10 12:40:18 +06:00
Sergey Lipskiy
2834fa1780 Code refactor: move classes FrameBufferToRDRAM, DepthBufferToRDRAM and RDRAMtoFrameBuffer from FrameBuffer.cpp to separate files. 2016-05-30 11:11:15 +06:00
Francisco Zurita
dca2c29edf When in CopyColorToRDRAM async mode, we will now use the
OES_EGL_image_external OpenGL ES extension to copy the color buffer into
system memory. This provides large performance improvements in many
Android devices.
2016-05-30 11:10:57 +06:00
matto
04e90bee85 Fix multisampling when the VI origin is not 0
This happens with Beetle Adventure Racing when the movie reel
effect is at work. It threw up a whole bunch of errors without
taking into account whether or not the framebuffer is multi-sampled.
2016-05-23 15:26:45 +06:00
Francisco Zurita
5d45a45282 Framebuffer copy performance improvements 2016-05-18 14:24:12 +06:00
Sergey Lipskiy
020144d6fd Disable scissoring when blit internal buffers. 2016-05-14 18:15:54 +06:00
Sergey Lipskiy
88656c9059 Correct multisample texture resolving in FrameBufferList::renderBuffer. 2016-05-14 18:13:18 +06:00
Sergey Lipskiy
d571587531 Fix postprocessor when native resolution factor is used. 2016-05-13 23:29:35 +06:00
Sergey Lipskiy
de388cbc56 Remove FrameBuffer::m_postProcessed field since it became useless after PostProcessor modifications.
Fixed pga european tour: gauge not working properly (fb effect) #325
2016-05-13 00:06:25 +06:00
Sergey Lipskiy
fc0b0df0b6 Fix FrameBuffer::_getSubTexture : disable scissor before glBlitFramebuffer
Fixed rear mirror in Roadsters, #741
2016-05-10 20:29:27 +06:00
Sergey Lipskiy
87f307c3ff FrameBuffer: replace m_pLoadTile by m_loadTileOrigin and m_loadType. 2016-05-10 20:29:21 +06:00
Sergey Lipskiy
f61293fe2b Disable scissor for RDRAMtoFrameBuffer::CopyFromRDRAM
Fixed copy buffer from RDRAM in native resolution.
2016-05-09 18:27:51 +06:00
Sergey Lipskiy
f9a8ff7087 Fix texture scale in FrameBuffer::getTextureBG 2016-05-09 17:37:23 +06:00
Sergey Lipskiy
45d9d63564 Implement frame buffer subimage copy.
When N64 game needs to apply frame buffer texture to a polygon, it
copies part of frame buffer data to texture memory. The plugin
does not copy frame buffer texture, since frame buffer texture already in video memory
and thus can be used directly.
However, sometimes polygons with frame buffer texture use texture coordinates wrap.
Wrap can't be done correct when whole frame buffer texture is used.
Thus, frame buffer subimage copy is implemented. Part of texture copied to
a new texture, which can be correctly wrapped.

Fixed PD cloacking effect, #839
2016-05-08 15:58:19 +06:00
Sergey Lipskiy
ef5af03aaa Code refactor: replace
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, frameBufferList().getCurrent()->m_FBO)
by
  frameBufferList().setCurrentDrawBuffer()
2016-05-08 13:35:17 +06:00
Sergey Lipskiy
8a9ec948d7 Minor code refactor and cleanup in FrameBuffer_ActivateBufferTexture. 2016-05-07 23:23:14 +06:00
Sergey Lipskiy
298b22a9dc Fix frame buffer texture offsetS for LOADTYPE_TILE.
Fixed Banjo-Tooie Framebuffer not working properly #651
2016-05-07 23:21:42 +06:00
Sergey Lipskiy
2054d9d689 Fix FrameBuffer::copyRdram(): fingerprint size must be not less than 4.
Fixed validity check for PD cloacking effect, #839
2016-05-07 23:20:10 +06:00
Sergey Lipskiy
0e24e6d1e8 Fix post-processing with GLES2 2016-05-05 16:40:16 +06:00
Sergey Lipskiy
0ad53ad0e8 Rewrite blending emulation:
- remove hardcoded mapping of N64 blend modes to GL blending
- add blending stage(s) to pixel shaders.
2016-05-05 16:38:59 +06:00
Sergey Lipskiy
f5310c4ba7 OGLRender::drawTexturedRect : call _updateStates only for texrect command. 2016-05-05 16:29:31 +06:00
Sergey Lipskiy
92beef8b35 Correct FrameBufferToRDRAM::_prepareCopy
Fixed banjo kazoiie: puzzle in intro doesn't work anymore (regression) #966
2016-04-23 18:29:29 +06:00
Sergey Lipskiy
bc80ff446a Code refactor: add TexturedRectParams::texrectCmd parameter
to distinguish calls to OGLRender::drawTexturedRect from texrect commands
and from other places.
2016-04-14 13:41:38 +06:00
Francisco Zurita
1611e8dd61 fix zelda subscreen crash 2016-04-12 07:39:00 -04:00
Sergey Lipskiy
b75d661b04 Fix FrameBufferToRDRAM::_prepareCopy: do not copy more than one buffer per frame.
Fixed ogre battle 64: wrong background jpeg (regression) #957
2016-04-10 20:16:49 +06:00
Sergey Lipskiy
4484bb5623 Correct texture coordinates calculation in OGLRender::drawTexturedRect :
add dsdx/dtdy instead of 1.0f

Fixed issues #27, #128, #209
2016-04-09 10:56:15 +06:00
Sergey Lipskiy
427806ac23 Rewrite PostProcessor: do not modify original buffer, use special frame buffer instead.
Fixed dual heroes: incorrect colors in menu #926
2016-04-02 18:56:07 +06:00
Sergey Lipskiy
046493e7d3 Revert "remove Lego racers hack"
This reverts commit ca6d6c720f.

Fixed lego racers: map doesn't appear anymore (regression) #935
2016-04-02 14:16:50 +06:00
Sergey Lipskiy
d69f722539 Fix Mario Tennis scoreboard. 2016-04-02 12:53:06 +06:00
Sergey Lipskiy
a4e5d58459 Fix scissor for post-processor.
Fixed buck bumble: bars on top and bottom of the screen (regression) #919
2016-03-31 17:52:01 +06:00
Sergey Lipskiy
f3677db0a7 Fix copy to RDRAM for native resolution factors above 1.
Fixed Broken monitor in MK64 #929
2016-03-24 17:50:51 +06:00
Sergey Lipskiy
3cfb377155 Fixed scissor in FrameBufferList::renderBuffer when AA enabled.
Fixed cut image in fullscreen mode with AA enabled in some games, e.g Mario Party 3
2016-03-19 20:36:56 +06:00
Sergey Lipskiy
ea62a778fa Force resolve multisampled buffer in FrameBufferList::renderBuffer.
Fixed Mario Party 3 - Missing characters and textbox in intro #901
2016-03-19 20:36:54 +06:00
Sergey Lipskiy
05466632af Correct main bufer height calculation again:
fix regression caused by commit 3215a8ad5d

Fixed regression issue #902
2016-03-19 19:21:05 +06:00
Sergey Lipskiy
444aa8320a Fix depth buffer copy for Perfect Dark. 2016-03-13 17:05:25 +06:00
Sergey Lipskiy
ede0a046c2 Fix DepthBufferToRDRAM::_prepareCopy for Native Resolution mode.
Fixed issue #888.
2016-03-13 17:02:10 +06:00
Sergey Lipskiy
a2c39afc19 Fixed crash in RDRAMtoFrameBuffer::CopyFromRDRAM in GLES2 mode. 2016-03-12 20:39:54 +06:00
Sergey Lipskiy
c504b9b216 Correct depth buffer removal:
if depth buffer removed, clear pointers on it for all frame buffers.
2016-03-06 21:12:23 +06:00
Sergey Lipskiy
d9d6d4530a FrameBuffer::init - clear buffer texture after allocation.
Fixed garbage on screen in some games on Linix, e.g. Tsumi To Batsu.
2016-03-04 10:58:52 +06:00
Sergey Lipskiy
235530cec8 Fix out of range read/write in _copyPixelsFromRdram when address in input array is outside of current frame buffer. 2016-03-01 16:49:54 +06:00
Sergey Lipskiy
3215a8ad5d Correct main bufer height calculation.
Fixed flicker in Bomberman Hero (E) , issue #305
2016-02-28 17:45:53 +06:00
Sergey Lipskiy
54d486371a Add "UseNativeResolutionFactor" option. 2016-02-27 12:43:20 +06:00
Sergey Lipskiy
f06b2d823a Code rafactor to fix compilation errors with mupen64plus build. 2016-02-27 11:58:56 +06:00
Sergey Lipskiy
c4b0e9999e Fix copy from RDRAM in widescreen mode. 2016-02-27 10:52:12 +06:00
Sergey Lipskiy
2a01d47df4 Fix copy to RDRAM in widescreen mode. 2016-02-27 10:52:11 +06:00
Sergey Lipskiy
8b3d53f4e5 Pass destination frame buffer to OGLRender::drawTexturedRect.
Fixed RDRAMtoFrameBuffer::CopyFromRDRAM, when FBWrite writes to a buffer,
which is not current displayed buffer.
Example: JFG crosshair.
2016-02-27 10:52:10 +06:00
Sergey Lipskiy
e8d76d21f0 Minor code cleanup: add RDRAMtoFrameBuffer::Reset() 2016-02-27 10:52:10 +06:00
Sergey Lipskiy
dca42610a8 Add FBInfo::isSupported() to know that emulator provides FBInfo support.
Correct frame buffer write detection hack (idea by purplemarshmallow).
2016-02-27 10:52:07 +06:00
Sergey Lipskiy
ce7526eaf5 Rewrite RDRAMtoFrameBuffer::CopyFromRDRAM:
copy from RDRAM only those pixels, which were provided with FBWrite.
2016-02-27 10:52:07 +06:00
Sergey Lipskiy
dcf32d0c5d Fix issues with FrameBufferToRDRAM::copyToRDRAM 2016-02-27 10:52:06 +06:00
Sergey Lipskiy
e62ce067e8 Fix FrameBufferToRDRAM::copyToRDRAM : pass correct end_address to _copy 2016-02-27 10:52:05 +06:00
Sergey Lipskiy
52dac34b98 Fix _cutHeight. 2016-02-27 10:52:05 +06:00
Sergey Lipskiy
8202638a7a Correct FrameBufferList::fillBufferInfo - do not add depth buffer. 2016-02-27 10:52:04 +06:00
Sergey Lipskiy
1ec14d0f8b Rename ShaderCombiner::updateFBInfo to ShaderCombiner::updateFrameBufferInfo 2016-02-27 10:52:03 +06:00
Sergey Lipskiy
857ae8a360 FBWrite draft implementation. 2016-02-27 10:52:02 +06:00
Sergey Lipskiy
646a88139c Fixing FBInfo build on gcc (5.2.1)
There was a conflict between signed and unsigned types to std::min.
Explicitly setting the literal as unsigned keeps all math as unsigned,
which I think is the best case here (assuming that 1 + y0 - y1 will never
be negative).
Also adding std:: prefix to make it clearer where these functions come from.
2016-02-27 10:52:02 +06:00
Sergey Lipskiy
148349a00a Fix FrameBufferToRDRAM::_prepareCopy
Wrong buffer could be used when several buffers copied per frame
2016-02-27 10:52:01 +06:00
Sergey Lipskiy
0b12d3b26e Correct height calculation on buffer copy. 2016-02-27 10:52:00 +06:00
Sergey Lipskiy
dde54b238f Fix mistakes in buffer copy. 2016-02-27 10:52:00 +06:00
Sergey Lipskiy
53e638bf47 Increase _numPixels if chunkStart is not even. 2016-02-27 10:51:59 +06:00
Sergey Lipskiy
1e376d641b Fix usage of FrameBufferToRDRAM::m_frameCount 2016-02-27 10:51:59 +06:00
Sergey Lipskiy
b9ee15bfb6 FrameBufferInfo API extension. Initial dummy implementation. 2016-02-27 10:51:56 +06:00
Sergey Lipskiy
5d8ea5dda1 Implement partial buffer copy. 2016-02-27 10:51:56 +06:00
gonetz
a9d1df5694 Move gamma correction to post processor. 2016-01-16 19:48:19 +06:00
gonetz
330603e2b6 PostProcessor refactor: - rename process() to doBlur(). - move Blur() init and destroy to separate functions. 2016-01-16 19:48:18 +06:00
Sergey Lipskiy
da36e88862 Merge pull request #828 from purplemarshmallow/24
remove Lego racers hack
2016-01-12 15:00:27 +05:00
purplemarshmallow
ca6d6c720f remove Lego racers hack
it's no longer needed because of commit
1466e162f3
2016-01-02 13:42:50 +01:00
purplemarshmallow
f49258e86a typo fix 2015-12-14 19:27:53 +01:00
purplemarshmallow
84611502c6 copy only modified pixels to RDRAM
0 is used as test color. If pixels are 0 they are not copied. This fixes
the crash in Donkey Kong 64 (E) issue #355
2015-11-19 22:46:08 +06:00
purplemarshmallow
2b95cc4037 fix copying 32bit framebuffers to RDRAM
this fixes issue #348
2015-11-17 16:59:12 +06:00
Sergey Lipskiy
93f659c8af Correct _cutHeight() function.
Fixed detectCFB causes crash in Pokemon Stadium 2 #548
2015-11-15 15:26:03 +06:00
purplemarshmallow
142ad0bc3c code refactoring to support async buffer reads
Copy of color buffers is now always done in gDPFullSync. There are no
known disadvantages only advantages. Quake 2 will run faster
2015-11-09 21:54:07 +06:00
purplemarshmallow
dc3da06a68 as suggested by gonetz buffers are now also copied after the buffer changed in SetColorImage command
now the copy auxiliary option also works if a buffer is used in the
current frame
2015-11-09 21:35:11 +06:00
purplemarshmallow
15611a7731 Copy auxiliary buffers at fullsync
Do not use fingerprint
2015-11-09 21:33:13 +06:00
purplemarshmallow
a8aebe4936 auxiliary buffers are rendered in native resulution if copyAuxiliary option is enabled
This improves quality. No more need to scale down
2015-11-09 21:24:22 +06:00
purplemarshmallow
d8bc38e26d make CopyToRDRAM compatible with auxiliary buffers 2015-11-09 21:14:24 +06:00
purplemarshmallow
c661ace24e Replace RSP.DList by OGLVideo::getBuffersSwapCount()
RSP.DList does not count the dlists, it counts the buffer swaps.
Thus it is replaced by counter in OGLVideo.
2015-10-17 21:20:50 +06:00
Sergey Lipskiy
0afa5c4c57 Merge pull request #755 from lioncash/framebuffer
Framebuffer/DepthBuffer: Minor initializer list changes
2015-10-11 22:25:25 +06:00
Lioncash
b6c18d2565 FrameBuffer/DepthBuffer: Add missing class members to constructor initializer lists 2015-10-10 14:05:18 -04:00
Lioncash
41a9969087 FrameBuffer: Correct initialization list order 2015-10-10 12:34:23 -04:00
Sergey Lipskiy
2483f03159 Add CopyToRDRAM modes to Config: disable, sync, async.
copyToRDRAM option can take 'async' value.
copyDepthToRDRAM is still sync mode only.
2015-10-09 23:08:21 +06:00
Sergey Lipskiy
23de60b500 Re-implement async color buffer read.
Color buffer read in async mode is 7 times faster than sync read on my video card.
2015-10-09 23:06:06 +06:00
Sergey Lipskiy
3bd24d34a1 Disable FBO draw when current buffer set to NULL. 2015-09-27 10:54:11 +06:00
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
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
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
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
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
2847606877 Always reinit buffer after its height correction.
This fixes pokemons library in Pokemon Stadium 2.
2015-09-03 20:52:12 +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
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
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
cbbd5d17de Fix crash when fb emulation enabled/disabled during gameplay, issue #601 2015-07-23 21:55:30 +06:00
Gillou68310
40da41d953 Fix framebuffer texture rectangle coordinate in GLES2 2015-07-02 10:45:52 +06:00
Sergey Lipskiy
7936e02066 Enable hack_subscreen for GLES2. 2015-06-26 19:20:44 +06:00
Sergey Lipskiy
b897c449a1 Fix shader texture uniforms update for GLES2.
Fixed issue #586.
Thanks Gillou68310 for the hint.
2015-06-23 22:19:11 +06:00
Sergey Lipskiy
68941f6cbe Optimize frame buffer copy to RDRAM:
read from pixel buffer one time per pixel.
Old code does 4 reads from the pixel buffer per pixel.

The optimization makes color buffer read circa 4 times faster.

Thanks Lars Bishop for finding the sources of the problem and for suggested solution.
2015-06-16 19:43:15 +06:00
Sergey Lipskiy
7ee974f213 Remove debug calls of isGLError() from FrameBufferToRDRAM::CopyToRDRAM. 2015-06-16 19:40:56 +06:00
Sergey Lipskiy
eb23f38934 New fix for issue #563. It does not break CBFD work. 2015-06-14 23:29:33 +06:00
Sergey Lipskiy
48959f0702 Revert "Correct coronas emulation in Perfect Dark."
This reverts commit 36fbcd5eac.

Reverted commits causes issues in CBFD. Need another approach.
2015-06-14 22:57:53 +06:00
Sergey Lipskiy
36fbcd5eac Correct coronas emulation in Perfect Dark.
Fixed issue #563.
2015-06-04 22:17:04 +06:00
Sergey Lipskiy
a25c85b3f2 Hack depth buffer attachment for GLES2. Need proper fix. 2015-06-02 18:57:54 +06:00
Sergey Lipskiy
1653069329 Correct FBO texture formats for different GL versions. 2015-06-02 18:57:24 +06:00
Sergey Lipskiy
9a991ba550 Correct FrameBufferList::renderBuffer for GLES2 2015-06-01 23:58:57 +06:00
Sergey Lipskiy
6b67ba3a57 Fix 3point texture filtering for GLES2. 2015-05-31 14:13:27 +06:00
Sergey Lipskiy
910c5de1bf Enable post-processor for GLES2. 2015-05-30 22:40:14 +06:00
Sergey Lipskiy
19c9e80b70 Correct frame buffer texture format for GLES2. 2015-05-18 13:51:16 +06:00
Sergey Lipskiy
b16dedd3f9 Fix compilation error in FrameBufferList::renderBuffer. 2015-05-18 13:51:10 +06:00
Sergey Lipskiy
7cbca30197 Disable resolveMultisampledTexture() for system without GL_MULTISAMPLING_SUPPORT 2015-05-18 13:51:10 +06:00
Sergey Lipskiy
b219997c80 Always show cfb until first dlist:
- move flag CHANGED_CPU_FB_WRITE from gSP to gDP (code refactor)
- enable CHANGED_CPU_FB_WRITE on video init.
- disable CHANGED_CPU_FB_WRITE in process display list.

many pd roms and demos use cpu rendering only
now they are supported with default settings
also detectCFB=1 now isn't needed anymore for some games

Commit is based on changes made by purplemarshmallow in #536
2015-05-18 12:55:42 +06:00
Sergey Lipskiy
d46ed98804 Fix wrong set of CHANGED_TEXTURE flag. 2015-05-13 10:22:32 +06:00
Sergey Lipskiy
49efba0ce6 Correct RDRAMtoFrameBuffer::CopyFromRDRAM -
need to update combiner's FBInfo before use.
2015-05-13 10:22:28 +06:00
Sergey Lipskiy
eabbd252f8 Change CachedTexture::frameBufferTexture type to enum.
Need to separate one-sampled frame buffer textures from multosampled ones.
2015-05-13 10:22:27 +06:00
Sergey Lipskiy
dbbb7da427 Move _isMarioTennisScoreboard() from FrameBufferList to FrameBuffer. 2015-05-13 10:22:26 +06:00
Sergey Lipskiy
663a0d76f1 Implement multisampled textures fetch in shaders.
Thanks mudlord for the idea.

Fixed Perfect Dark frame buffer effects do not work when FSAA is on. #244
2015-05-13 10:22:26 +06:00
Sergey Lipskiy
b728ab97a7 Disable multisampling related code for GLES below 3.1 2015-05-13 10:22:25 +06:00
Sergey Lipskiy
09b78ea577 Replace define GLES3 by GLES3_1 since current code is GLES3.1 compatible.
GLES3 is different.
2015-05-13 10:22:18 +06:00
Sergey Lipskiy
243e186ba2 Correct internal format for DepthBufferToRDRAM color texture. 2015-05-13 10:22:17 +06:00
Sergey Lipskiy
d3f6754cff Correct depth texture intarnal format for GLES3 2015-05-13 10:22:16 +06:00
Sergey Lipskiy
107a81d079 Don't init from/to RDRAM objects when frame buffer emulation is off. 2015-05-13 10:22:14 +06:00
Sergey Lipskiy
01807a0499 Fix FrameBuffer_CopyDepthBuffer: return false for GLES2 case. 2015-05-13 10:22:10 +06:00
Sergey Lipskiy
a02d284645 Use glTexStorage2DMultisample instead of glTexImage2DMultisample in case of GLSE3 2015-05-13 10:22:05 +06:00
Sergey Lipskiy
70b1b9ad03 Replace glMapBuffer by GLES3 compatible glMapBufferRange. 2015-05-13 10:22:04 +06:00
Sergey Lipskiy
bbc71c3f0a Fix crash in FrameBufferToRDRAM::CopyToRDRAM when current buffer is NULL.
Fixed Snowboard Kids causes segmentation fault #477
2015-05-13 10:22:01 +06:00
Sergey Lipskiy
29ab85fcc2 Fix frame buffer being bloomed twice. 2015-05-13 10:21:56 +06:00
Sergey Lipskiy
05b92c11bb Apply scissor for post-processed frame buffer area.
Fixed overexposed areas for games with black boarders.
2015-05-13 10:21:55 +06:00
Sergey Lipskiy
0c886e26c3 Limit depth buffer copy to RDRAM with top and bottom bounds of fillrect command.
Fixed regression issues #436 and #437
Issue #330 with Roadsters is fixed too.
2015-05-13 10:21:52 +06:00
Sergey Lipskiy
4d87fb6833 Impelent new fb validity check method:
copy RDRAM content to a buffer and compare by content.
2015-05-13 10:21:50 +06:00
Sergey Lipskiy
e3d8905984 Fix _isMarioTennisScoreboard() hack for (E) version. 2015-05-13 10:21:46 +06:00
Sergey Lipskiy
08513ded89 Correct Mario Tennis scoreboard hack. 2015-05-13 10:21:45 +06:00
Sergey Lipskiy
96aab6c9ad Correct Mario Tennis scoreboard hack for (J) rom.
Fixed issue #424
2015-05-13 10:21:44 +06:00
Sergey Lipskiy
52d68d1389 Move all sources to src folder. 2015-05-13 10:21:32 +06:00