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

289 Commits

Author SHA1 Message Date
Sergey Lipskiy
2d712f2ae0 Rewrite textures loading and mapping:
- use RiceVideo method for texture size calculation.
  RiceVideo uses the same method for texture dumping.
- rewrite texture mapping.
  Texture Clamp-Wrap-Mirror implemented in shaders.

Problem explanation:
https://github.com/gonetz/GLideN64/issues/1885#issuecomment-485136358

Fixed various glitches with HD textures, #1885
2019-06-19 19:02:52 +07:00
Francisco Zurita
c06c593eba Improve logging information 2019-04-23 11:15:41 +07:00
Sergey Lipskiy
03022db791 Check that RDRAM area is writable before writing buffer data into it.
Fixed Problem with Project64's protect memory option #764
2019-03-16 18:37:05 +07:00
Sergey Lipskiy
b0380e0a04 Increase log level for VI warnings. Users should not see them. 2019-02-24 18:56:30 +07:00
Sergey Lipskiy
916d01ba60 Correct FrameBufferList::renderBuffer() output coordinates calculation.
Fixed screen shake in WDC and Bass Rush - ECOGEAR PowerWorm Championship.
2019-02-17 23:37:54 +07:00
fzurita
18a735dfe6 Fix some sign issues with RdpUpdate 2019-01-28 18:34:23 +07:00
Sergey Lipskiy
132b06fd2f Correct VI image cut calculations, see VI fixes #1981 2019-01-20 19:32:39 +07:00
Sergey Lipskiy
864e635ca4 Correct RdpUpdate::update()
Fixed Black screen on smash bros #1987
2019-01-20 18:52:16 +07:00
Sergey Lipskiy
b036a8296e Fix OverscanBuffer::draw. 2019-01-13 01:07:06 +07:00
Sergey Lipskiy
1e84099521 Correct mapping of RDP frame buffer to output one.
Code of RdpUpdate::update is based on angrylion's rdp_update().

Main visible difference: VI cuts several pixels on left and right of original image.
Cite from angrylion's commit message:
"rdp: new tests revealed the shocking truth:
the VI aggresssively and regardlessly of any data alignment specificities
cuts off either 7 or 8 pixels closest to h_start and h_end, so that nothing
ever appears on the screen unless (h_end - h_start) is 16 pixels or greater
(this removes marginal garbage graphics on the far right in Mario Tennis,
Turok 2 Seeds of Evil intro and probably other games)"
2019-01-13 01:07:02 +07:00
Sergey Lipskiy
0f1b45cfa6 Add hack for Lode Runner 3-D.
The game uses very unique way to allocate frame buffers.
It uses double buffering, but both buffers share the same address space (sic!)
The game uses interlaced display mode, and lines in RDP buffers are interlaced too.
Plugin's fb and VI emulation code can't handle it properly, so I just added a hack.

Fixed Lode Runner 3-D: No video output if framebuffer is enabled #1937
2019-01-13 00:47:52 +07:00
Sergey Lipskiy
fc70172327 Refactor update of buffer end address.
Add removeIntersections() after end address update.
2019-01-13 00:40:21 +07:00
Sergey Lipskiy
6de128b8fd Correct condition for valid depth buffer attachement.
Rat attack uses color buffer with width 640, but depth buffer width is only 639.
goodDepthBufferTexture check failed because of it, and game run without depth compare.

Fixed Rat attack missing geometry #600
2019-01-09 18:19:01 +07:00
Sergey Lipskiy
f899bf57a4 Ignore vi_lowerfield if vi_width <= 320.
It seems that when vi_width <= 320 output uses progressive mode
even if interlaced bit is set in VI_STATUS.

Fixed Bass Rush - ECOGEAR PowerWorm Championship - shakes #1957
2018-12-09 17:39:31 +07:00
Sergey Lipskiy
29575624b9 Call copyRdram() for cfb buffer to have data for validity check.
Fixed NBA Courtside 2: wrong intro - regression #1956
2018-12-09 16:24:35 +07:00
Sergey Lipskiy
68a2c939b4 Correct FrameBufferList::fillRDRAM - do not write to RDRAM color buffer if copyFromRDRAM enabled 2018-10-17 15:52:53 +07:00
Sergey Lipskiy
57ad2e96c6 Fix DepthBufferList::clearBuffer() for image textures. 2018-10-17 15:52:53 +07:00
Sergey Lipskiy
8b3597614a Always render RDRAM content into newly created frame buffer. Remove ugly hack for Mario Tennis scoreboard. 2018-10-17 15:52:52 +07:00
Sergey Lipskiy
5538c7b4bb Add support for frame buffers, which are inside of some other frame buffer.
Fixed Superbowling: black screen in menu and game #116
2018-10-17 15:52:51 +07:00
Sergey Lipskiy
c8b6d35597 Minor code cleanup in FrameBuffer.cpp 2018-10-17 15:52:51 +07:00
Sergey Lipskiy
2f83650725 Switch from blitOrCopyTexturedRect() to copyTexturedRect() in OverscanBuffer::draw. 2018-09-24 20:33:12 +07:00
Sergey Lipskiy
3faa383c55 Fix in FrameBufferList::renderBuffer() : draw blank frame if VI state is wrong.
Previously renderBuffer() did nothing in that case and last rendered frame remained on screen.

Fixed Perfect Dark (Missing Transition Animation at end of Title Intro Screen - PD Logo Doesn't Disappear) #1715
2018-09-24 20:33:08 +07:00
Sergey Lipskiy
ae67c77c9d Replace direct call of Postprocessor methods by list of available postprocessing functions. 2018-09-09 16:41:37 +07:00
Sergey Lipskiy
9705f5d520 Implement FXAA 2018-09-09 16:36:09 +07:00
Sergey Lipskiy
15188dad16 Fix destX calculation in FrameBufferList::renderBuffer()
Fixed black boarders size in Banjo-Kazooie.
2018-09-08 00:13:43 +07:00
Sergey Lipskiy
be49e9e2e9 Correct check for side-by-side buffers in FrameBufferList::renderBuffer()
Fixed Kirby 64 - screen jumps in full screen. #1750
2018-09-07 23:00:45 +07:00
Sergey Lipskiy
b3068d9536 Fix OverscanBuffer::getScaleX() 2018-08-28 20:57:50 +07:00
Sergey Lipskiy
2a677a23a8 Implement left offset for source image when VI_ORIGIN address points on non-zero position in scan-line.
Fixed PAL version of International Superstar Soccer 98, #1845
2018-06-23 21:56:10 +07:00
Sergey Lipskiy
2322f5f53f Implement Overscan feature.
Remove Crop feature.
Change settings save-load when "per game settings" enabled:
    * When config dialog opens, show custom settings for the running game. If no game run yet, show main settings.
    * When user press OK button, save settings to the custom ini file and to the main ini file.
2018-06-17 20:04:45 +07:00
Logan McNaughton
e80577e105 Allow non-0 default framebuffer 2018-05-22 08:25:24 -06:00
Sergey Lipskiy
6725ad474a Fix warnings of 64bit compiler. 2018-05-06 15:54:12 +07:00
Sergey Lipskiy
2e7c0ecee2 Add forceDepthBufferClear config option.
Enable it for Eikou no Saint Andrews (J) in custom settings.

Fixed Eiko St Andrews: wrong 3d #161
2018-05-01 19:21:30 +07:00
Logan McNaughton
9bda0568a8 Copy FBO texture if glTextureBarrier is unsupported 2018-04-20 22:56:17 +07:00
Logan McNaughton
7bad64ce70 Only call texture barrier if we are sampling from current FB 2018-04-16 11:35:15 +07:00
Logan McNaughton
c9cf91e8da Add support for ext_shader_framebuffer_fetch 2018-04-16 11:32:35 +07:00
Logan McNaughton
c01c0d5166 use gl_LastFragDepthARM and glTextureBarrier 2018-04-13 21:24:56 +07:00
Logan McNaughton
18e9a73eba Cache SpecialFeatures check 2018-04-07 11:30:33 +07:00
Logan McNaughton
9c73fb27b1 Remove Image Texture requirement for some shaders 2018-04-07 11:30:33 +07:00
Sergey Lipskiy
ed21ec774b Fix TexrectDrawer when frame buffer emulation disabled. 2018-03-21 21:20:57 +07:00
Logan McNaughton
cb90bb95ed Cleanup FB Texture caching code 2018-02-26 21:15:51 +07:00
Sergey Lipskiy
b18ae00bfd Correct next buffer detection in FrameBufferList::renderBuffer().
Fixed flickering in WDC.
2018-02-18 15:33:21 +07:00
Sergey Lipskiy
9b2f50ca67 Fix rendering in widescreen resolutions when fb emulation disabled, #1700 2018-01-05 15:27:19 +07:00
Sergey Lipskiy
fbd4a9a016 Unbind FBO before clearing frame buffers list.
Fixed memory leak on graphics context destroy.
2017-11-19 19:55:13 +07:00
Sergey Lipskiy
26623cec1f Code cleanup: fix issues in GLideN64 found by static code analyser. 2017-11-18 22:07:27 +07:00
Sergey Lipskiy
5a037474a2 Code cleanup: fix compilation warnings. 2017-11-15 15:07:52 +07:00
Sergey Lipskiy
bc1f2d37d4 Code cleanup: remove commented code for blur post filter.
It will not be refactored.
2017-10-24 20:36:08 +07:00
Sergey Lipskiy
70c540b073 Rewrite fix for #1539 : keep in tile descriptor start address of frame buffer, not pointer on it.
Should be more safe.
2017-09-29 22:25:56 +07:00
Sergey Lipskiy
203c53307d Reset gDPTile::frameBuffer if it points to removed buffer.
Fixed Paper Mario: Red Station Crashing #1539
2017-09-29 17:20:07 +07:00
Sergey Lipskiy
57da925a14 Check for overlapping frame buffers in FrameBufferList::removeIntersections()
Fixed Mario Tennis - missing bottom half of scoreboard #1564

Problem:
Top Gear Hyper Bike has overlapping frame buffers.
That is start address of a buffer points on last line in previous buffer.
When new buffer intersects with prevois one, plugin removes old buffer.
That causes black screen in case of Top Gear Hyper Bike.

FrameBuffer::updateEndAddress() was modified in commit 17eb8696ea to fix it.
It sets buffer end address using buffer height - 1.
This fix causes issue with Mario Tennis scoreboard #1564
HW buffer is not detected because end address is wrong.

Solution:
Add another test for intersecting buffers.
It checks that the buffers are not just arbitrary intersected ones,
but it is sequence of two slighly overlapping buffers.
In that case buffer is not removed, but its end address is corrected,
because buffers address space must not intersect.
2017-09-26 16:31:24 +07:00
Sergey Lipskiy
032da85357 Reset m_cleared and m_RdramCopy for depth buffer after software render.
Fixed #1594 Mario Tennis VS screen: line flickers
2017-09-26 15:23:07 +07:00