Commit Graph

287 Commits

Author SHA1 Message Date
Gregory Hainaut 8d4fadb3c8 Revert "gsdx state: TEX0 write behavior might depends on the context"
This reverts commit b34243fa7b.

Unfortunately we have a regression on GT4. I'm doomed
2016-09-28 20:00:56 +02:00
Gregory Hainaut adb8be3287 gsdx: add/update comment
Need to investigate why the number of vertex is different in upscaled resolution
2016-09-28 19:41:12 +02:00
Gregory Hainaut 749037346c gsdx: report an error if PSM is invalid 2016-09-28 19:41:12 +02:00
Gregory Hainaut 97172f5e51 gsdx debug: count draw call in a different way
* Always do +1 before the draw call
* Prefix texture name with i (as input) to keep them before the FB

Goal is to ensure that all renderers share the same draw call value.
2016-09-28 19:41:11 +02:00
Gregory Hainaut b34243fa7b gsdx state: TEX0 write behavior might depends on the context
Game: harley davidson
* write tex0 ctx0
* write tex0 ctx1
* draw  ctx 0

Previous GSdx behavior will load the clut every write of TEX0. In the
above case the draw will take the wrong clut.

To be honest, it could be a wrong emulation on the EE core emulation.
The hardware likely got a single clut (1KB cache is quite expensive)
So clut loading must be skipped if the context is wrong.

Next draw will use the ctx1 clut so I apply TEX0 when the context is switched

Please test harley davidson :)

v2: detect context switch from UpdateContext function
V3: always set m_env.CTXT[i].offset.tex, avoid crash (Thanks to FlatOutPS2 that spot the issue)
V4: move bad psm correction code (rebase put it in the wrong place)
2016-09-27 10:04:09 +02:00
Gregory Hainaut be9995bd1e gsdx mipmap: improve robustness to avoid potential crash 2016-09-26 09:27:03 +02:00
Gregory Hainaut 78b2848622 gsdx: factorize the TEX0 generation for mipmap 2016-09-25 11:51:48 +02:00
Gregory Hainaut d89b09427f gsdx: gl logging is only available in MTGS thread
Fix crash in debug build
2016-09-22 17:54:44 +02:00
Gregory Hainaut 6966e08306 gsdx: move alpha test optimization in base class
One code for all renderers :)
2016-09-19 08:48:32 +02:00
Gregory Hainaut 1a1d6ab478 gsdx: handle the invalid format 0x3
International Super Star Soccer seems to use it.

It could be a core bug, in doubt uses the likely expected standard 0x13
2016-09-14 19:22:45 +02:00
Gregory Hainaut 029d74f855 gsdx: add an auto flush hack to implement a Read Write GS effect.
It impacts all renderers. It ought to fix issue in GTA radiosity,
Shadows in Jak series. (note shadows will suck in upscaling)

Implementation is really brutal. Expect a massive slow down, but at least we can test the effect
easily.

Normally perf impact will remain reasonable if the game doesn't use a Read-Write effect

Performances number are welcomes (my guess is really awful in HW mode, slow in SW mode).
You can enable it with "UserHacks_AutoFlush = 1"
2016-09-08 17:25:59 +02:00
Gregory Hainaut c9a1558c60 gsdx: save the blit buffer register when a transfer is started
Fix motocross mania missing texture. Close #1319

As far as I understand, transfer is initialized in DIR. But the real
write only occured later so the blit buffer could have been overwritten
by a new value.

BLIT 0 13700
TREG 40 40
DIR 0 0
BLIT 0 13f00 <=== the bad guy
Write! ...  => 0x3f00 W:1 F:C_32 (DIR 00), dPos(0 0) size(64 64)

v2: set a value in m_tr.m_blit for load state
2016-09-01 09:59:38 +02:00
Gregory Hainaut 90707f8d4e gsdx: avoid aliasing issue
Extend GSVector to support float move

Initial code likely used integer move for performance reason. However due to
the nan correction, register is now in float domain.
2016-08-14 20:48:34 +02:00
Gregory Hainaut 0dcce91a6e Merge pull request #1504 from ssakash/RemoveFunction
GSDX: Remove GetDeviceSize()
2016-08-08 16:15:07 +02:00
Akash bc24e90070 GSDX: Remove GetDeviceSize()
It's not used anywhere and it doesn't seem needed.
2016-08-07 12:43:03 +05:30
Gregory Hainaut e9e1b33884 gsdx: log a nice string instead of the hex format of PSM 2016-08-03 18:07:54 +02:00
Gregory Hainaut 25bc2dff07 gsdx: dump and log EE texture read
It gives a visual opportunity to detect a bad read of the texture cache
2016-07-14 19:45:06 +02:00
Akash e05e7bee82 GSDX: Add proper detection of internal resolution 2016-06-19 17:10:03 +05:30
Gregory Hainaut a9c18c57e4 gsdx option: use the new GetConfig* function
v2:
add PSX stuff
ssakash review
2016-05-28 10:07:27 +02:00
Jonathan Li db81925c4b Merge pull request #1335 from turtleli/freebsd
Support FreeBSD
2016-05-25 18:55:51 +01:00
Jonathan Li 571432a7aa gsdx:freebsd: Fix compilation 2016-05-21 13:34:18 +01:00
Akash 2166980f91 GSDX: Calculate dimensions of rectangle after merge
* Properly display rectangle size after passing through merge circuit on
GS Dumps and GS Frame titlebar.
2016-05-19 15:53:49 +05:30
Akash 58b43dbb6c GSDX: Rework video mode detection code
* Use some nice enums instead of macros
* properly detect 720P/1080I separately.
* Some code cleanup, extended variable names and added few comments
2016-05-19 14:02:50 +05:30
Gregory Hainaut 37c7fa7663 gsdx: add draw exception (OOM and Recoverable)
The exception will free the unused (but allocated) texture aka the emergency break ;)

Recoverable could be useful for unsupported draw call
2016-05-05 17:47:32 +02:00
Gregory Hainaut c8dddfed06 gsdx hack: move m_skip and m_userhacks_skipdraw to GSState level
Avoid to push argument to call IsBadFrame
2016-05-05 16:22:14 +02:00
Gregory Hainaut 21d1bd48ec gsdx hack: move the CRC setup into a separate function
In order to reduce a bit the overhead of IsBadFrame called each draw calls
2016-05-05 16:03:48 +02:00
Gregory Hainaut 60267790a1 gsdx: move (most) of the hw hack into a separate file
GSState.cpp was really too big
2016-04-30 12:24:08 +02:00
Gregory Hainaut e195e67a48 gsdx: move Metal Gear Solid CRC to DX level
OpenGL is near perfect :)
2016-04-29 17:34:17 +02:00
Gregory Hainaut df70b8bb0e gsdx: fix Q NaN value
Avoid potential undefined results
2016-04-26 19:09:32 +02:00
Gregory Hainaut cb8088216b Merge pull request #1281 from PCSX2-Alpha/NTSC_saturation
GSDX: Remove some unnecessary/dubious hacks
2016-04-21 09:28:30 +02:00
Gregory Hainaut 59ef668fd2 Merge pull request #1222 from PCSX2/gsdx-black-fmv
Gsdx black fmv
2016-04-21 09:25:36 +02:00
Gregory Hainaut 4611264ce3 gsdx: add CRC hack for Nocturne PAL
Reduce depth transfer to the real size of the game. Otherwise
we need to handle a mix of color/depth transfer.
2016-04-11 16:04:04 +02:00
Akash a1b0ae467e GSDX: Remove dubious/unnecessary hacks
* Silent Hill 2 doesn't need the CRC hack
* GSRenderer: no need to explicitly set bottom value for r.
* Texture Cache: Removed a check which couldn't possibly enter true
branch.
2016-04-07 15:15:39 +05:30
Akash 69c9a3d793 GSDX: Add an option to disable NTSC saturation
v2: convert it into a member variable.
2016-04-07 15:15:17 +05:30
Gregory Hainaut d922225e69 gsdx tc:invalidate RT when a texture is written inside it
It often happens the game try to upload the FMV directly which typically
gave a black screen.

Commit fix rules of roses and I hope various black screen FMV

Performance impact must be tested, and I'm afraid of strange texture cache behavior.

V2: check the size of the transfer too
V3: add support of 16 bits format
V4: avoid division by 0
2016-04-04 21:29:31 +02:00
Gregory Hainaut 261ef9ab6a gsdx: move some DBZGT hacks to Dx level
Based on this thread:

http://forums.pcsx2.net/Thread-Dragon-Ball-Z-Budokai-Tenkaichi-3-Graphical-Issue-Emulator-does-not-render-outlines
2016-03-25 08:23:50 +01:00
Gregory Hainaut 8ae7f60b04 Merge pull request #1175 from PCSX2-Alpha/GSDX_stuffs
GSDX: Vertical frequency corrections and extra stuffs
2016-02-13 18:15:49 +01:00
Akash e810428c86 GSDX: Remove some old comments
Disgaea 2 intro FMV now works fine with/without upscaling. (confirmed
with rama)
2016-02-12 12:05:42 +05:30
Akash 67a7a63a36 GSDX: Add vertical frequency for all video modes 2016-02-12 05:28:30 +05:30
Akash 1445bf7fb1 GSDX: Extend macros for all video modes.
The following patch detects the other video modes based on Phased lock loop divider (LC)
2016-02-12 04:43:57 +05:30
Gregory Hainaut 51b40c6b18 gsdx: move black CRC hack from openGL to DX level
Rendering is much nicer this way
2016-02-06 17:32:12 +01:00
Gregory Hainaut 85f64b8c08 Merge pull request #1137 from PCSX2-Alpha/CRTC_Scaling
PCRTC: Proper handling for 720P/1080P video modes.
2016-02-01 10:11:58 +01:00
Akash 7407162dfe GSDX: Add some nice macros 2016-01-30 05:19:53 +05:30
Gregory Hainaut 2ff611137e pcsx2|lilypad|gsdx: use portable printf format
(portable: let's see VS compilation...)
2016-01-22 19:46:03 +01:00
Akash 22fccd5143 GSDX: Add a nice debug message 2016-01-20 04:29:23 +05:30
Akash ebb6e34196 PCRTC: Fix video modes higher than 480P 2016-01-20 04:23:45 +05:30
Akash aade5278d8 PCRTC: Better handling of CRTC height saturation 2016-01-10 21:47:59 +05:30
ramapcsx2 4c765a04f7 Change an outdated GSdx comment. It may confuse people nowadays. 2015-12-01 21:36:23 +01:00
Akash d5ba546d2e GSDX: Improve CRTC output size handling 2015-11-09 05:52:42 +05:30
Gregory Hainaut 50e6306331 Merge pull request #919 from ssakash/coverity_init
Coverity: Initialize class members
2015-10-25 20:08:46 +01:00