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

179 Commits

Author SHA1 Message Date
Sergey Lipskiy
ff085b0cbf Correct RDRAMtoFrameBuffer::CopyFromRDRAM 2015-05-13 10:19:34 +06:00
Sergey Lipskiy
f5ca94b1ef Remove frame buffer validity check by buffer address written at the origin
of the buffer in RDRAM. This is unreliable method.
2015-05-13 10:19:32 +06:00
Sergey Lipskiy
cbdacb58d8 Don't call FrameBufferList::_findBuffer until buffer's actual height is not detected.
Otherwise wrong buffers can be removed.

Fixed auxilary buffers creation in Pokemon Stadium menu.
2015-05-13 10:19:25 +06:00
Sergey Lipskiy
5384e189c4 Don't discard frame buffers creation when VI.height == 0
Fixed auxilary color buffers creation in Pokemon Stadium.
2015-05-13 10:19:25 +06:00
Sergey Lipskiy
66f7af5a59 Always correct height for auxilary buffers. 2015-05-13 10:19:24 +06:00
Sergey Lipskiy
4ff13a30e6 Correct FrameBufferList::removeBuffers : remove all buffers with given width.
Fixed issue with Pokemon Stadium, which set zero VI height before
interlace mode switch.
2015-05-13 10:19:23 +06:00
Sergey Lipskiy
3ac4f2ddb1 Fix crash in FrameBufferList::renderBuffer when m_pCurrent is NULL 2015-05-13 10:19:22 +06:00
Sergey Lipskiy
4e7a5a6b9e Do not remove auxilary color buffers on interlaced mode switch.
Fixed removal of color buffers with pokemon portraits in Pokemon Stadium 2.
2015-05-13 10:19:21 +06:00
Sergey Lipskiy
ea3e81540b Correct FrameBuffer_ActivateBufferTexture:
use buffer's scale instead of scale currently set in video.

Fixed pokemon portraits size in Pokemon Stadium 2.
2015-05-13 10:19:21 +06:00
Sergey Lipskiy
3da54c5616 Re-init frame buffer if its new height is larger than its current one. 2015-05-13 10:19:20 +06:00
Sergey Lipskiy
dfabb7d105 Replace FrameBufferList::isFboMode() check by FrameBufferList::getCurrent() != NULL 2015-05-13 10:19:19 +06:00
Sergey Lipskiy
f4e1afa30c Split hack_noDepthFrameBuffers on two options:
hack_noDepthFrameBuffers and hack_blurPauseScreen.

hack_blurPauseScreen is for games, which copy color buffer into depth buffer area,
blur it and use as background image. Examples: Conker BFD, Mickey USA

hack_noDepthFrameBuffers is for games, which never use depth buffer area as texture
Example: F-1 Pole Position, Mario Golf.
2015-05-13 10:19:18 +06:00
Sergey Lipskiy
e9b406d134 Add special frame buffer flag for Ogre Battle backgrounds.
It should protect such buffers from being overwritten by FrameBufferToRDRAM::CopyToRDRAM.
2015-05-13 10:19:17 +06:00
Sergey Lipskiy
2f83ab8963 Correct code for 'noDepthBuffers' situation.
Enable 'noDepthBuffers' for "MICKEY USA".

Fixed pause screen in "MICKEY USA"
2015-05-13 10:19:16 +06:00
Sergey Lipskiy
f41bd934ef Disable RDRAM clear for depth frame buffers. 2015-05-13 10:19:16 +06:00
Sergey Lipskiy
f9f3dc6ede Fix m_isDepthBuffer flag set. 2015-05-13 10:19:15 +06:00
Sergey Lipskiy
189b594118 Reset buffer's m_RdramCrc and m_validityChecked on buffer change. 2015-05-13 10:19:14 +06:00
Sergey Lipskiy
4a9e7cdc1f New FB validity check based on checksum of RDRAM content. 2015-05-13 10:19:14 +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
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
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
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
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
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
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
7b730096b3 Fix monochrome frame buffers when FSAA is on.
Fixed shadows in Mario Tennis.
2015-05-13 10:18:31 +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
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
Sergey Lipskiy
6f40fa430b Fix frame buffer content check in CheckForFrameBufferTexture.
Frame buffer area is cleared in FrameBufferList::saveBuffer.
If scissor does not equal to frame buffer size, clear is incorrect.
Solution: clear frame buffer area without scissoring.

Fixed background in Dr.Mario
2015-05-13 10:18:26 +06:00
Sergey Lipskiy
f946a82e38 Fix replay in Mario Golf:
replay is copied to a area, which is used for depth buffer.
Added check that found frame buffer is not depth buffer.
2015-05-13 10:18:24 +06:00
Sergey Lipskiy
0efce8bb17 Fix FrameBufferToRDRAM::CopyToRDRAM when multisampling is on. 2015-05-13 10:18:23 +06:00
Sergey Lipskiy
67e26af187 Revert "Use VI.real_height to make copy to RDRAM more safe."
Wrong solution - causes bottom black line when copied image is used as
background.

This reverts commit 2186d12c9230be48b1824aaabbee56f135f54d4d.
2015-05-13 10:18:21 +06:00
Sergey Lipskiy
bbeb149df4 Correct FrameBufferList::removeBuffer - set m_pCurrent to NULL if current color buffer isd removed. 2015-05-13 10:18:19 +06:00
Sergey Lipskiy
907a29e313 Fix division by zero in FrameBufferList::renderBuffer
Fixed crash with FB enabled in Top Gear Hyperbike
2015-05-13 10:18:17 +06:00
Sergey Lipskiy
975b54810f Emulate VI manipulations with REG.VI_H_START register.
This emulates horizontal slide effect in Top Gear Overdrive menu.
Fixed issue #17
2015-05-13 10:18:17 +06:00
Sergey Lipskiy
db649b5341 Fix FrameBufferToRDRAM::CopyToRDRAM:
copy to provided address, not to the cached one.

Fixed Top Gear Hyper Bike with FB to RDRAM on.
2015-05-13 10:18:15 +06:00
Sergey Lipskiy
bb6a9b3549 Correct frame buffer end address calculation in FrameBufferList::saveBuffer.
Fixed gfx not showing with fb emulation on in Top Gear Hyper Bike #45
2015-05-13 10:18:15 +06:00
Sergey Lipskiy
34d638a0a3 Don't copy depth buffer if it was not cleared.
Uncleared depth buffer most likely is used as auxilary color buffer.

Fix pause screen in Mickey USA when copy depth to RDRAM is enabled, issue #85.
2015-05-13 10:18:14 +06:00
Sergey Lipskiy
b9257e33b1 Fix RDRAMtoFrameBuffer::CopyFromRDRAM.
Fixed flicker in StarCraft64 logos.
2015-05-13 10:18:12 +06:00
Sergey Lipskiy
47e4f4e8e4 Switch from shader based pseudo-random simplex noise to texture based one. 2015-05-13 10:18:09 +06:00
Sergey Lipskiy
7ed2ed1365 Use VI.real_height to make copy to RDRAM more safe.
VI.height can be larger than actual buffer height. Example: The New Tetris.
2015-05-13 10:18:06 +06:00
Sergey Lipskiy
8c0aa1c804 Fix FrameBufferToRDRAM::CopyToRDRAM when multisampling is enabled. 2015-05-13 10:18:00 +06:00
Sergey Lipskiy
06c7877208 Fix vOffset calculation in FrameBufferList. 2015-05-13 10:17:57 +06:00
Sergey Lipskiy
17b2db7031 Workaround for Mupen64Plus issue with initialization 2015-05-13 10:17:54 +06:00