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

851 Commits

Author SHA1 Message Date
Sergey Lipskiy
cf11996d0e Implement 3 point filtering.
Code ported from mupen64plus-libretro.
2015-05-13 10:19:01 +06:00
Sergey Lipskiy
b0e86e2cbc Limit frame buffer height by VI.height if buffer width == VI.width
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.
2015-05-13 10:19:00 +06:00
Sergey Lipskiy
be0eab5ea7 Add support for Bomberman 2 special blend mode,
which is used to highlight current location on the map.

Fixed issue #122
2015-05-13 10:19:00 +06:00
Sergey Lipskiy
9f7963b770 Correct comments to blend modes. 2015-05-13 10:18:59 +06:00
Sergey Lipskiy
503612b99e Fix tile load when it is out of TMEM.
Fixed texture load in Bomberman 64 - The Second Attack, #122
2015-05-13 10:18:58 +06:00
Sergey Lipskiy
33806e7170 Fix depth calculation.
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
2015-05-13 10:18:58 +06:00
Sergey Lipskiy
c22de119e5 Revert "Correct VI.real_height calculation in interlaced mode."
This change cause crash in Top Gear Overdrive menu, because hEnd == hStart
at some point.

This reverts commit 61f9389656bd26b49c43394b701a3a7e31737b3c.
2015-05-13 10:18:57 +06:00
Sergey Lipskiy
97c9fecd8c Correct VI.width calculation when hEnd is zero.
Corrected commit 42fe2ddf09 since it brokes background in F1 Pole Position, #263
2015-05-13 10:18:56 +06:00
Sergey Lipskiy
686690f919 Remove redundant shader update calls. 2015-05-13 10:18:56 +06:00
Sergey Lipskiy
8a4db59a29 Correct RDRAMtoFrameBuffer::CopyFromRDRAM.
Need to set FBO of found buffer as current draw buffer, otherwise rendering can go
into wrong buffer.
2015-05-13 10:18:55 +06:00
Sergey Lipskiy
88e751b13b Implement FBO height correction. Fixed replays in 1080. 2015-05-13 10:18:54 +06:00
Sergey Lipskiy
1b2b9f9865 Replace gDP.colorImage.changed by FrameBuffer::m_changed 2015-05-13 10:18:53 +06:00
Sergey Lipskiy
ef7ad9a549 Correct force clamp condition in OGLRender::drawTexturedRect
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.
2015-05-13 10:18:53 +06:00
Sergey Lipskiy
d9e9955668 Implement texture packs path selection. 2015-05-13 10:18:52 +06:00
Sergey Lipskiy
7178145462 Fix mipmap when mipmap_lvl == 0.
Fixed AeroFighters Assault: texture issue on the plane (in game and menu) #118
2015-05-13 10:18:51 +06:00
Sergey Lipskiy
eb42f8fe46 Code cleanup: remove unused gDP.texRect struct and related code. 2015-05-13 10:18:50 +06:00
Sergey Lipskiy
fa1ef45101 Fix texture coordinates for texrect flip.
Fixed text in SM64 (E), issue #259
2015-05-13 10:18:50 +06:00
Sergey Lipskiy
f266e91981 Remove textures coordinates swap in case of lower coordinate is larger than higher one.
It is legacy code. Not sure which issue it intended to fix.
2015-05-13 10:18:49 +06:00
Sergey Lipskiy
b7d5819ec6 Implement video restart on settings change. 2015-05-13 10:18:48 +06:00
Sergey Lipskiy
9d422acae3 Enable NoN for Perfect Dark ucode.
That fixed menu screen in Perfect Dark, #260. Otherwise background polygons are z-clipped.
2015-05-13 10:18:48 +06:00
Sergey Lipskiy
12658040f6 Fix int to bool conversion. 2015-05-13 10:18:47 +06:00
Sergey Lipskiy
1e6684014e Add GL_DEPTH_CLAMP state caching. 2015-05-13 10:18:46 +06:00
Sergey Lipskiy
08f4278892 Correct F3D_Tri4. 2015-05-13 10:18:46 +06:00
Sergey Lipskiy
bc34838db6 Fix pause screen in Conker BFD.
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.
2015-05-13 10:18:45 +06:00
Sergey Lipskiy
62aa6495ec Revert "Remove redundunt glTexParameter calls."
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.
2015-05-13 10:18:44 +06:00
Sergey Lipskiy
43eac44f91 Correct RDRAMtoFrameBuffer::CopyFromRDRAM :
fuls and fult for gSP.textureTile[0] should be zero.
2015-05-13 10:18:44 +06:00
Sergey Lipskiy
58799e767f Fix scissor in FrameBufferList::renderBuffer for windowed mode.
Fixed top of the screen being cut.
2015-05-13 10:18:43 +06:00
Sergey Lipskiy
59e86b7794 Fix DepthBufferToRDRAM::CopyToRDRAM when multisampling is on. 2015-05-13 10:18:42 +06:00
Sergey Lipskiy
d06befb4eb Add a hack for Mario Golf replays.
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.
2015-05-13 10:18:42 +06:00
Sergey Lipskiy
6b4b7ae35c Add ucode for Power League Baseball 64 to the list of specialMicrocodes.
Fixed issue #105
2015-05-13 10:18:41 +06:00
Sergey Lipskiy
4faa52e76d Disable noise emulation if enableNoise option is off. 2015-05-13 10:18:40 +06:00
Sergey Lipskiy
46e6f3c28c Correct VI.width calculation when hEnd is zero. 2015-05-13 10:18:40 +06:00
Sergey Lipskiy
2d099dda4c Correct VI.real_height calculation in interlaced mode. 2015-05-13 10:18:39 +06:00
Sergey Lipskiy
4155accfee Correct noise dithering. 2015-05-13 10:18:38 +06:00
Sergey Lipskiy
769ab7ac40 Remove async frame buffer reads - it can cause glitches because of wrong frame read.
Example: F-1 PolePosition 99 car tuning menu.
2015-05-13 10:18:38 +06:00
Sergey Lipskiy
296476405a Fix alpha test for COPY cyclemode.
Fixed text in menu in F-1 Pole Position.
2015-05-13 10:18:37 +06:00
Sergey Lipskiy
4fd702bfe3 Disable color and alpha dither in COPY and FILL cyclemode. 2015-05-13 10:18:36 +06:00
Sergey Lipskiy
e3f51aae25 Correct texture size calculation: use mask size only if mask != 0.
Fixed backgrounds in F-1 Pole Position.
2015-05-13 10:18:36 +06:00
Sergey Lipskiy
2fb7477420 Correct creation of auxilary combiners. 2015-05-13 10:18:35 +06:00
Sergey Lipskiy
917225d783 Move RSP.DList increment from RSP_ProcessDList() to OGLVideo::swapBuffers().
Now frame count works for LLE mode.
2015-05-13 10:18:34 +06:00
Sergey Lipskiy
8bd1b96e3c Correct FrameBufferToRDRAM.
Fixed out of memory writes in 1080 replay.
2015-05-13 10:18:34 +06:00
Sergey Lipskiy
d4264e18a4 Don't create frame buffer with zero height.
Fixed load from savestates in 1080.
2015-05-13 10:18:33 +06:00
Sergey Lipskiy
8e546e6f4b Fix compilation errors when TXFILTER_DLL defined 2015-05-13 10:18:32 +06:00
Sergey Lipskiy
b55656b615 Revert useless commit "Fix bug with ucode loaded each frame."
This reverts commit 62445eb9a1de0c2ddbb4d7744fe90aea7941ded0.
2015-05-13 10:18:32 +06:00
Sergey Lipskiy
7b730096b3 Fix monochrome frame buffers when FSAA is on.
Fixed shadows in Mario Tennis.
2015-05-13 10:18:31 +06:00
Sergey Lipskiy
526dfe0846 RunConfig() returns true if user pushed OK. 2015-05-13 10:18:30 +06:00
Sergey Lipskiy
2b87c0e131 Correct horisontal bounds for input and output buffers in FrameBufferList::renderBuffer
Fixed wrong right bound in Mario Tennis and other games.
2015-05-13 10:18:30 +06:00
Sergey Lipskiy
3c9ad5f730 Correct frame buffer - texture bounds intersection check.
Fixed bottom of background image in Dr.Mario
2015-05-13 10:18:29 +06:00
Sergey Lipskiy
b085593d2a Major fixes in RDRAMtoFrameBuffer::CopyFromRDRAM.
Fixed Dr.Mario pills
2015-05-13 10:18:28 +06:00
Sergey Lipskiy
d0073fe3a3 Don't clear frame buffer area when copyFromRDRAM option is on. 2015-05-13 10:18:28 +06:00