1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-06-30 08:24:05 +00:00
Commit Graph

57 Commits

Author SHA1 Message Date
Blake Warner
0255e10db6 native port 2022-01-29 17:22:09 -05:00
fzurita
43a5d16905 Keep a color copy FBO and texture per N64 frame buffer 2021-04-19 21:50:55 +07:00
Sergey Lipskiy
46c65776a0 Code refactor and cleanup:
* type cast fixes
* signed/unsigned fixes
* code formatting fixes
* class members initialization fixes
2020-11-14 16:54:28 +07:00
Sergey Lipskiy
86a227308e Implement copy depth to main depth buffer. It is necessary for correct work of some Reshade shaders. 2019-09-27 19:33:18 +07:00
Sergey Lipskiy
69d608310f Fix compilation warning. 2019-02-25 15:38:20 +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
fc70172327 Refactor update of buffer end address.
Add removeIntersections() after end address update.
2019-01-13 00:40:21 +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
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
9bda0568a8 Copy FBO texture if glTextureBarrier is unsupported 2018-04-20 22:56:17 +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
4d4a2d18a2 Fix RDRAMtoColorBuffer::copyFromRDRAM with FBInfo 2017-11-16 09:44:44 +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
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
Sergey Lipskiy
4f5759ef46 Fix validity check for depth buffer.
Fixed Pokemon Stadium Menu Items Missing (Regression) #1446
2017-03-29 17:01:59 +07:00
Sergey Lipskiy
0775d28065 Remove FrameBuffer::m_scaleY 2017-03-16 18:50:15 +07:00
Sergey Lipskiy
456459be68 Add FrameBuffer::m_isMainBuffer flag. 2017-03-16 18:50:14 +07:00
Sergey Lipskiy
a28ca93ada Rewrite FrameBufferList::_findBuffer 2017-03-16 18:50:14 +07:00
Sergey Lipskiy
811dea1d77 Rewrite viewport for polygons with screen coords. 2017-03-16 18:50:14 +07:00
Sergey Lipskiy
5f4d03fe21 Rewrite FrameBufferList::renderBuffer() 2017-03-16 18:50:14 +07:00
Sergey Lipskiy
dd11326115 Rewrite buffer height calculation. 2017-03-16 18:50:14 +07:00
Sergey Lipskiy
e6811b4d4f Move gDP.colorImage.height update to FrameBufferList::setBufferChanged. 2017-03-16 18:50:14 +07:00
Sergey Lipskiy
5a0344aa02 Code cleanup: remove redundant parameter from FrameBuffer::init. 2017-02-27 21:00:27 +07:00
Sergey Lipskiy
873a830d88 Always render to FBO, even when frame buffer emulation is disabled. 2017-02-25 14:08:26 +07:00
Sergey Lipskiy
8460b08b09 Move struct PBOBinder from FrameBuffer.h to separate file. 2017-01-22 19:12:39 +07:00
Sergey Lipskiy
f147927af9 Remove OpenGL use from FrameBuffer 2017-01-21 16:35:00 +07:00
Sergey Lipskiy
cf5e9d8ed2 BufferManipulationObjects WIP 2017-01-02 21:00:49 +07:00
Sergey Lipskiy
7fdf97cf29 Use gfxContext in FrameBuffer 2017-01-02 00:09:19 +07:00
Sergey Lipskiy
1d87a92c72 Do not use frame buffer as texture if the buffer is just allocated.
Fixed tripleplay2000: black background in game #346

Problem: The game allocates auxiliary buffer with the same width
as the main one. Plugin detects it as main buffer and set its width
and height as of main buffer. Actual buffer height is half of main
buffer height, but it became known only when game switches to the
main buffer. Wrong buffer height leads to wrong calculation of
buffer address space. Game uses textures with addresses behind
the actual buffer’s address space but within calculated one.
Plugin tries to use buffer texture instead and, as the result,
everything is black.

Solution: The situation is bad. Plugin cannot detect that
allocated buffer is an aux one. I decided to forbid buffer usage
as texture if buffer is new. New buffer is blank, so reading from
it is strange. N64 games do lots of strange stuff, so this solution
is potentially dangerous.
2016-10-29 23:46:39 +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
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
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
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
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
87f307c3ff FrameBuffer: replace m_pLoadTile by m_loadTileOrigin and m_loadType. 2016-05-10 20:29:21 +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
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
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
3215a8ad5d Correct main bufer height calculation.
Fixed flicker in Bomberman Hero (E) , issue #305
2016-02-28 17:45:53 +06:00
Sergey Lipskiy
f06b2d823a Code rafactor to fix compilation errors with mupen64plus build. 2016-02-27 11:58:56 +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
857ae8a360 FBWrite draft implementation. 2016-02-27 10:52:02 +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
330603e2b6 PostProcessor refactor: - rename process() to doBlur(). - move Blur() init and destroy to separate functions. 2016-01-16 19:48:18 +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
15611a7731 Copy auxiliary buffers at fullsync
Do not use fingerprint
2015-11-09 21:33:13 +06:00