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

169 Commits

Author SHA1 Message Date
Sergey Lipskiy
9a2a77982b Set gDP.colorImage parameters before frameBufferList().saveBuffer call. 2018-10-17 15:52:53 +07:00
Sergey Lipskiy
1df96cebeb Enable clearDepthBuffer for Pokemon Snap.
Fixed Pokemon Snap Oak's check does not work #777 again

Note: this game is a mistery. I don't understand,
why clearing of depth buffer via drawRecs breaks Oak's check.
Actually, the problem causes rendering to color buffer corresponding to that depth buffer.
Need to investigate, why.
2018-10-07 00:15:01 +07:00
Sergey Lipskiy
423fc7ba3e Code cleanup in gDPFillRectangle 2018-10-06 13:43:14 +07:00
Sergey Lipskiy
4f302cc777 gDPFillRectangle: call frameBufferList().fillRDRAM for color buffers in FILL mode.
Fixed Vigilante 8 Menu and In-game issues. #1917
2018-10-02 17:06:07 +07:00
Sergey Lipskiy
9f1bbeab9f Rewrite primitive depth calculation.
Up shader storage version.

Fixed Star Wars Episode I - Racer: Overlapping #1911
2018-10-01 22:37:03 +07:00
Sergey Lipskiy
5e1c8a6b58 Do not use clearDepthBuffer in FillRect. Use drawRect only. 2018-09-24 22:02:25 +07:00
Sergey Lipskiy
6a7c64dd6b Do not use clearColorBuffer in FillRect. Use drawRect only.
Fixed Twisted Edge Extreme Snowboarding P1 broken #1873
2018-09-24 20:33:15 +07:00
Sergey Lipskiy
e65f8bd68d Weaken condition for invalid frame buffer texture.
Fixed text in Mario Tennis scoreboard.
2018-09-16 22:15:28 +07:00
Sergey Lipskiy
fef718b8d2 Do not reject tile loading when tile end address is out of RDRAM bound.
Try to load as much as possible instead.

Fixed Bust-A-Move 2 wrong 2D during intro #870
2018-09-07 21:08:37 +07:00
Sergey Lipskiy
83e1ccb72e Remove hack for Banjo-Tooie Groggy Crash #1250 added in 8fbd1d030b
Writes to TMEM protected by masking TMEM write address, so it is not necessary anymore.
Rearrange the code a bit.

Fixed NBA Live 99 messed up textures #1826
2018-09-05 23:20:27 +07:00
Sergey Lipskiy
c53bf689e1 Correct calculation of bytes for 32bit textures in gDPLoadTile
Fixed 1080 Snowboarding title logo regression #1824
2018-09-05 17:23:23 +07:00
Sergey Lipskiy
cec0f2fc05 Update end address of the current frame buffer in gDPFullSync().
Fixed Ogre Battle 64 Opening Splash Screens Flicker. #1868

Details

Problem: frame buffer end address set to minimal when buffer is allocated.
It is updated on next call of gDPSetColorImage.
In case of Ogre Battle 64 Opening next call of gDPSetColorImage occurs in next frame.
VI can't find the buffer because REG.VI_ORIGIN points on buffer with some offset,
which in this case is larger than diff between start and end address.
VI allocates new buffer, which eventually replaces the current one and flickering happens.

Solution: update current buffer's end address in gDPFullSync()
to ensure that it will be correct at the moment when VI will search for buffer to draw.
2018-08-28 16:07:31 +07:00
Sergey Lipskiy
d4b770b2c1 Correct texrect dsdx calculation in COPY mode.
Partially fixes issue with the energy bar in F-Zero multiplayer, #1849
2018-07-02 19:24:18 +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
gizmo98
4750e10076 Use _FIXED2FLOATCOLOR 2018-06-02 21:35:32 +07:00
Sergey Lipskiy
6725ad474a Fix warnings of 64bit compiler. 2018-05-06 15:54:12 +07:00
Sergey Lipskiy
7080034ddb Fix DebugMsg format string for gDPTextureRectangle. 2018-02-18 12:43:04 +07:00
Sergey Lipskiy
4bdc44ce4e Code cleanup: fix cast from float to s16. 2017-12-16 13:15:57 +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
737338ca20 Use fixed point calculation for texrect s and t coordinates.
It is impossible to handle integer overflow when coordinates in float format.

Fixed textures in Major League Baseball #146
2017-11-18 15:41:18 +07:00
Sergey Lipskiy
29c9a778d9 Correct debug output 2017-11-16 18:52:32 +07:00
Sergey Lipskiy
ddec7aabe6 Revert "Do not use aux depth buffer as hwfbe texture."
This reverts commit bd10c7a788.
2017-11-16 18:32:05 +07:00
Sergey Lipskiy
5a037474a2 Code cleanup: fix compilation warnings. 2017-11-15 15:07:52 +07:00
Sergey Lipskiy
184debbd43 Fix gDPLoadTLUT when count > 256
Fixed crash in Vigilante 8: 2nd Offense Menu #1479
2017-11-01 17:45:24 +07:00
Sergey Lipskiy
adc2b547e8 Implement YUV-to-RGB color space conversion. See 12.5 of programming manual
Up shader storage version.

Fixed Killer Instinct Gold: Improper Projectile Effects. #1513
2017-10-31 13:27:34 +07:00
Sergey Lipskiy
77ffe6106e Split othermode::textureConvert on 3 bits. 2017-10-31 13:27:34 +07:00
Sergey Lipskiy
757c3c4f8f Calc FPS as number of color buffer origin changes per second.
Fixed FPS counter not reporting correctly #1510
2017-10-30 15:33:38 +07:00
Sergey Lipskiy
bd10c7a788 Do not use aux depth buffer as hwfbe texture.
Fixed black polygons in vigilante 8,  #1639
2017-10-24 20:36:14 +07:00
Sergey Lipskiy
35cc66bad4 Code cleanup:
* make RSPInfo::busy and RSPInfo::halt boolean
* remove RSPInfo::close
* rename RSPInfo::bLLE to RSPInfo::LLE
2017-10-24 15:44:37 +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
a2eefed0a3 Add hack for rect color alpha.
Details in commit d506d6134

Fixed Foresaken 64: wrong intro (regression) #1585
2017-09-26 22:58:05 +07:00
Francisco Zurita
8fbd1d030b Fix memory corruption in Banjo-Tooie 2017-09-11 10:26:49 +07:00
Sergey Lipskiy
84cf648089 Always call frameBufferList().saveBuffer() from gDPSetColorImage, even if buffer data not changed.
Fixed fb-related issues with Star Wars - Rogue Squadron
2017-08-11 12:23:39 +07:00
Sergey Lipskiy
c907c3013a Implement Debugger. 2017-06-25 15:35:48 +07:00
Sergey Lipskiy
08f2b8be31 Improve log quality 2017-06-25 15:06:50 +07:00
Sergey Lipskiy
ee60040a78 Rewrite debug logging 2017-06-25 15:02:36 +07:00
Sergey Lipskiy
952769a671 Always call frameBufferList().setBufferChanged in gDPFillRectangle. 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
c8e6644bd7 Use software render to calculate frame buffer height. 2017-03-16 18:50:14 +07:00
Sergey Lipskiy
1c72ef16fd Code refactor: move gDP.rectColor initialization to gDP.cpp 2017-03-01 11:49:58 +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
151fdf5ecc Remove code to clear depth image textures.
Depth image textures cleared by GraphicsDrawer::drawRect, as on N64.
2017-02-17 15:54:16 +07:00
Logan McNaughton
1f74b9c821 Disable N64 Depth Compare if Image Textures are unsupported
Also disable fragment depth writing in GLES2
2017-02-09 21:54:44 +07:00
Logan McNaughton
acff19e66c Force disable fragment depth writing in GLES2 2017-02-08 12:33:31 +07:00
Sergey Lipskiy
80ed169e24 Remove use of OpenGL.h 2017-01-22 20:43:05 +07:00
Sergey Lipskiy
e83c3489a3 Replace OGLVideo by DisplayWindow
Replace OGLRender by GraphicsDrawer
2017-01-16 20:56:11 +07:00
Sergey Lipskiy
41d0a9ade5 Replace ShaderCombiner 2 2017-01-08 17:49:39 +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
Francisco Zurita
e5f89406b7 Zelda subscreen hack always enables copy color to RDRAM 2016-10-19 00:05:30 -04: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
0a52dae80c Set texture level in LLE mode.
Fixed map-mapping in LLE mode. #1135
2016-09-29 20:53:05 +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
16406bb1b0 Fixed Majora's mask in-game pictures look incorrect with software depth buffer #1131 2016-09-23 12:05:48 +07:00
Sergey Lipskiy
91f03c70bc Use dmaVertices when draw with drawScreenSpaceTriangle. 2016-09-21 15:24:15 +07:00
Sergey Lipskiy
77d0c9aada Code refactor: rename drawLLETriangle to drawScreenSpaceTriangle. 2016-09-20 16:21:54 +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
32172d30af Fix depth buffer clear for aux buffers. 2016-09-11 18:08:03 +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
27cdae1e33 Correct condition for depth buffer clear again.
Fixed Body Harvest graphics missing (Regression) #1107
2016-09-05 12:14:51 +07:00
Sergey Lipskiy
669337f5ab Correct condition for depth buffer rendering:
games may draw in depth buffer in fill mode too.

Correct condition for depth buffer clear.

Fixed Mario Tennis 64's Versus Screen Issue #771
2016-09-04 20:26:41 +07:00
Sergey Lipskiy
5efd89ccd2 Fix input texture checksum calculation. 2016-07-03 00:09:26 +06:00
Sergey Lipskiy
42f3643865 Implement software depth buffer render. 2016-06-20 15:12:31 +06:00
Sergey Lipskiy
2fbee3661f Move TextureFilterHandler class to separate files. 2016-06-10 17:58:47 +06:00
Sergey Lipskiy
86fbea9edc Code refactor: replace NULL by nullptr. 2016-06-10 12:40:18 +06:00
Sergey Lipskiy
99a075eae7 Add config option enableNativeResTexrects.
Support in GUI and mupen64plus settings.
2016-06-03 11:06:33 +06:00
Sergey Lipskiy
baa8b28056 Fix TexrectDrawer work with AA enabled. 2016-06-03 11:05:39 +06:00
Sergey Lipskiy
00b9de68e0 Implement TexrectDrawer. 2016-06-03 10:44:23 +06:00
Sergey Lipskiy
37cb9ef9b8 gDPLoadTile: check for frame buffer texture before check for RDRAM bound crossing.
Fixed Banjo-Tooie Framebuffer not working properly #651
2016-05-19 22:50:43 +06:00
Sergey Lipskiy
87f307c3ff FrameBuffer: replace m_pLoadTile by m_loadTileOrigin and m_loadType. 2016-05-10 20:29:21 +06:00
MaximeMorel
caadac1a7c Fix Linux compilation 2016-05-10 08:54:19 +01:00
Sergey Lipskiy
773e95382e gDPLoadTile: skip tile load if tile coordinates are incorrect.
Fixed FIFA - Road to World Cup 98: black line in menu #952
2016-05-04 22:41:49 +06:00
Sergey Lipskiy
bb4c572c88 Code cleanup: remove debug code from gDPFillRDRAM. 2016-04-26 15:11:26 +06:00
Sergey Lipskiy
5f7cdb4cb4 gDPFullSync(): add check, that buffer copied to RDRAM is not auxiliary one.
Fixed shadows in JFG.
2016-04-17 15:31:59 +06:00
Sergey Lipskiy
269b3c19e9 Add correctTexrectCoords option: make texrect coordinates continuous to avoid black lines between them. 2016-04-16 12:28:39 +06:00
Sergey Lipskiy
dad7fcb687 gDPSetColorImage: use VI.height instead of gDP.scissor.lry as fallback value for buffer height.
Fixed nfl quaterback 98 #316 in LLE mode
2016-04-14 16:51:07 +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
Sergey Lipskiy
c095fea58a Code refactor: replace gDPTextureRectangleFlip by flip parameter in gDPTextureRectangle 2016-04-14 13:21:06 +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
6d29070c57 gDPFillRectangle: set gDP.colorImage.height only when lrx == gDP.colorImage.width 2016-04-02 13:59:04 +06:00
Sergey Lipskiy
1db0c7a75e Fixed bug in gDPFillRectangle, caused by commit bcde07a978 2016-04-02 13:56:43 +06:00
Sergey Lipskiy
06c99ad30f Rewrite LoadBlock. 2016-03-26 21:14:42 +06:00
Sergey Lipskiy
85101a5d67 Yet another fix for gDPLoadBlock line calculation.
Fixed  pilotwings: text issues (regression) #927
2016-03-24 10:33:40 +06:00
Sergey Lipskiy
bcde07a978 Don't skip buffer height calculation in gDPFillRectangle.
Fixed regression in Super Robot Spirits: Crash rankings option in HLE. #909
2016-03-20 13:24:26 +06:00
Sergey Lipskiy
04b1f3f9f9 Correct gDPLoadBlock line calculation again:
fixed regression caused by commit f6be5fd39

Fixed regression in Racing Simulation 2 #167
2016-03-19 19:20:58 +06:00
Sergey Lipskiy
f6be5fd39f Fix bug with line calculation in gDPLoadBlock.
Fixed South Park Rally (All) - Gfx Issue #391
and probably other similar issues.
2016-03-17 09:29:57 +06:00
Sergey Lipskiy
ff67350c8c Revert "Increase only y coordinate of rect in COPY or FILL mode."
because it causes regression in Mischief Makers.

This reverts commit 143a68bc07.
2016-03-12 20:09:34 +06:00
Sergey Lipskiy
fbbbe147c6 Correct hack for texrect textures.
Fixed texture coordinates for backgrounds in Dark Rift, issue #648
2016-03-05 20:23:00 +06:00
Sergey Lipskiy
143a68bc07 Increase only y coordinate of rect in COPY or FILL mode. 2016-03-05 20:06:41 +06:00
Sergey Lipskiy
024c48218a Fix frame buffer texture detection when load tile is not 7.
Fixed wrong frame buffer detection in Tetrispere intro, issue #681
Terisphere uses tile 2 as load-tile and as base tile.
2016-03-05 17:55:30 +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
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
ac8a9a9d5d Add FBInfo config options. 2016-02-27 10:52:08 +06:00
Sergey Lipskiy
170a072deb Remove gamma correction code from gDPFillRectangle.
Forgot to remove it when gamma correction was moved to post-processor.
Fixed green background in Superman.
2016-02-06 00:09:00 +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
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