Commit Graph

4653 Commits

Author SHA1 Message Date
lightningterror 86a8cbf402 GSdx: Change Skipdraw Maximum limit value.
Previously the limit was 1000, now 10000 in the GUI. It should help in
some rare cases where a higher number is needed without the need of ini
editing and value reset issues caused by the GUI.
2018-02-05 23:03:19 +00:00
Christian Kenny 94b822df3b Resolve cases where GUI values are not updated when adjusting sliders with the scroll wheel. 2018-02-05 22:49:09 +00:00
Christian Kenny a5db116d00 Remove unused 'About Box' references on Linux and Windows from SPU2-X/CMakeLists, ect. 2018-02-05 22:49:09 +00:00
Christian Kenny 168402217f Make GUI more user-friendly by disabling some options when they aren't used. 2018-02-05 22:49:09 +00:00
lightningterror 4aa25c4971 GSdx: Disable Merge Sprite on native resolution.
Previously if HW hacks were enabled Merge Sprite was active(if checked) on
native resolution even if the GUI option was disabled, which in result
caused glitches in games on native resolution.

This should address that issue.
2018-01-13 23:18:57 +05:30
FlatOutPS2 57cbc901b7 SPU2-X: Prevent volume check from altering volume
Fixes issue in Tokyo Xtreme Racer Zero where checking the left master
volume would alter it.
2018-01-12 14:37:40 +01:00
FlatOutPS2 fe27d3b25a GSdx: Add Dark Cloud CRCs to automatic mipmapping 2018-01-12 13:28:43 +05:30
lightningterror 9dc7930ff2 GSdx: Merge CRC hacks of Wild Arms 4 and 5
It's better to avoid duplicate code so let's merge these two together
as well.
2018-01-12 13:25:40 +05:30
lightningterror fbdd0f4394 GSdx: Remove/move/merge CRC hacks.
Remove Aggressive CRC hacks for SSX 3. Was used to remove the red lines
on older versions but no longer needed since the issue has been fixed.
Offered 1fps or less speed bump but it's not worth keeping for such a
minimal increase.

Merge all FFX CRC hacks in to one. They share the same code so it's
better to have one to avoid duplicate code.

Move CRC hack for Bleach Blade Battlers to Aggressive. It removes the
character shading. It can be used as a speed hack since the gains are
quite good from it. Around 15-30%.
2018-01-10 08:10:56 +05:30
lightningterror 29ef586f91 GSdx: Move CRC hacks for Soul Calibur 2&3 to DX level.
Add missing CRC ids for Soul Calibur 2 and 3.
Move CRC hacks to DX level. They are not needed anymore on OpenGL since
Depth Emulation fixes depth issues (shadows).
2018-01-09 20:36:14 +05:30
lightningterror 687c0b45e2 Gsdx: Tekken 5 Channel effect and CRC Hacks
Move CRC hack to Partial that fix the half screen
bottom issue since the effect is not rendered correctly.

Move CRC hack to Aggressive. These hacks are only
needed when running upscaled resolution. They skip the
blur effect which cause ghosting and some other screen issues.
Side effect is they also remove the channel effect on OpenGL
which is emulated correctly so let's put them on Aggressive.

Comment out a hack, it's unknown what the hack does atm.
If there are new issues then it will be added back.

Added comments what the hacks do.

Partial port for channel shuffle effect to Direct3D for Tekken5.
The effect is skipped and not rendered but now the top left
screen glitch has been resolved.
Note: At least Minimum CRC level is required for this to work.
2017-12-13 13:31:49 +01:00
lightningterror 41051f3cfe GSdx: Add hidden option to disable Nvidia hack
Add hidden option "UserHacks_DisableNVhack" to disable
the Nvidia hack on Direct3D which added black lines on the right
and bottom of the screen. Could be useful for Intel and AMD GPUs.

A better solution would be to add Vendor Id detection instead,
but this will do for now.

To disable the Nvidia hack add UserHacks_DisableNVhack=1 in GSdx.ini
2017-12-10 21:37:00 +05:30
lightningterror a74a5d95ab GSdx: Remove/move CRC hacks for Simpsons Game
Remove CRC hacks no longer needed.
Move CRC hacks to Aggressive level. Can be used as a performance hack.
2017-11-28 16:59:13 +05:30
lightningterror 3c74f0f907 GSdx: Extend support of "Preload Frame Data" for Direct3D.
Fixes glitchy water in Rogue Galaxy in Direct3D when the hack is
enabled.
Fixes Test Drive car reflection in Direct3D when the hack is enabled.

OTher games are affected as well.
2017-11-27 11:01:43 +01:00
Jonathan Li c9abec7cbe cdvdgigaherz: Always read 2352 bytes from CD sectors
For some CDs (i.e. Suikoden), trying to read a 2048 byte "cooked" sector
does not work. However, reading the raw sector and then extracting the
required 2048 bytes works fine, so let's do that.

This also makes it easier to port CD/DVD disk reading to operating
systems that don't provide CD/DVD interface conveniences.
2017-11-24 00:08:26 +00:00
Jonathan Li 0a4ff90bfb cdvdgigaherz: Detect CD track mode correctly
In every CD data sector, byte 15 indicates what the CD track mode is.
2017-11-24 00:08:26 +00:00
lightningterror 6d49bf6fc6 GSdx: Automatic HW Mipmapping option
Adds automatic HW mipmapping support.
It relies on CRC ids so if a game does
not have their CRC id but needs mipmapping
it will not work until the id is added.

Add GUI menu and tooltip for Automatic mipmap
"Automatic (Default)"
This option will be default option from now on.

Rename "Very Slow" text option to "Slow" for full mipmap
as it caused the text not to fit properly in the menu.

Credits also go to @RedPanda4552 and @ssakash for helping
with the code.
2017-11-20 09:54:56 +01:00
lightningterror 431b4f6f17 GSdx: Rearrange HW Hacks
Rearrange the two columns of HW hacks, new arrangement
is done in alphabetical order on Windows and Linux.

Rename some hacks on Linux to match the windows version.

Some other minor tweaks as well.
2017-11-20 09:54:32 +01:00
Christian Kenny 5956493684 GSdx: Remove CRC hack for James Bond Everything or Nothing. Thes hack was used to avoid a VRAM spike, but isn't needed anymore. 2017-11-19 12:58:48 +05:30
lightningterror b31c23b37b GSdx: Add/move CRC hacks for Street Fighter EX3
Add missing CRC ids.
Move CRC hacks to OpenGL since the effects aren't emulated properly atm.
2017-11-13 16:04:42 +05:30
Akash 6299d9efa9 GSdx-Capture: Grayout configure button for codecs
The following patch grays out the configure button when there's no
configuration dialog available for the selected codec. What's the use in
clicking it when no dialog pops up? :P (I've been tricked by it lots of
times)
2017-11-11 12:50:22 +05:30
Akash 849c2f36d9 GSdx-Capture: Format event commands in switch-case
Use switch-case over chained if statements for the event commands, makes
the code more readable in my opinion.
2017-11-11 12:50:22 +05:30
lightningterror 1cbd4c5387 GSdx: Add CPU Frame buffer Conversion Hack
Add HW Hack that enables Framebuffer Conversion on the CPU instead of the GPU.
Can fix broken textures on games but at the cost of slower performance.
List of games: Harry Potter games, FIFA Street games.
Games like Call of Duty, Kung fu Panda might also be affected as well as others
especially on Direct3D.
Add HW Hack GUI option on Windows/Linux for 4-bit and 8-bit Framebuffer conversion hack
named "Frame Buffer Conversion".
2017-11-02 10:38:07 +01:00
Jonathan Li 96b412ebb8 pcsx2|common|gsnull: Remove GSprintf API
It's not really used, and the OSD uses a different API.

The specified calling convention (stdcall) is also incorrect since
variadic functions are caller-clean, not callee-clean. The compilers
ignore the stdcall and just use cdecl (I think), though it does trigger
a -Wcast-calling-convention on clang.
2017-10-29 01:01:49 +01:00
Jonathan Li 9be61f83df cdvdgigaherz: Fix Q subchannel relative offset calculation
The wrong comparison was used, so all the relative offsets were
completely wrong. Fixes the wrong track issue in the CD player.

Regression introduced in f314c2a4d9.
2017-10-12 23:54:59 +01:00
Jonathan Li fe2dfdb3b9 gsdx: Remove "using namespace std" 2017-09-08 09:56:28 +02:00
Jonathan Li 82d1aba67f gsdx: Prefix std:: to ostringstream, pair, codecvt* 2017-09-08 09:56:28 +02:00
Jonathan Li 7ed360e06b gsdx: Prefix std:: to shared_ptr 2017-09-08 09:56:28 +02:00
Jonathan Li 0cde534e30 gsdx: Prefix std:: to min and max 2017-09-08 09:56:28 +02:00
Jonathan Li 54c320c724 gdsx: Prefix std:: to map
Also use auto when appropriate.
2017-09-08 09:56:28 +02:00
Jonathan Li 2ff67f3741 gsdx: Prefix std:: to list
Also use auto when appropriate
2017-09-08 09:56:28 +02:00
Jonathan Li 5415b7ad5b gsdx: Prefix std:: to vector
Also use auto when appropriate
2017-09-08 09:56:28 +02:00
Jonathan Li 2aeb406e38 gsdx: Remove hash_{map,set} macros
Also use auto when appropriate.
2017-09-08 09:56:28 +02:00
Jonathan Li d57b812f36 gsdx: Prefix std:: to string and to_string 2017-09-08 09:56:28 +02:00
lightningterror d158ac5ffe GSdx-ogl:
Comment out driver version detection on amd as it was not working properly.
Rename bools for vendor ids.
2017-09-06 18:08:37 +02:00
lightningterror 481a884d25 GSdx - dx9: Edit Alpha Correction (FBA) tooltip.
Can cause graphical glitches in some games.
2017-09-06 18:05:21 +02:00
lightningterror f14c78cf12 GSdx-ogl: Fix GSdx crashing on Intel igpus
Regression was introduced in #1954
GSdx caused the emulator to crash when the renderer was restarted.

It may have affected older gpus from nvidia/amd
with older OpenGL support as well.
2017-09-06 17:14:21 +02:00
lightningterror 91d8e7c7c6 GSdx-Windows: Grey out OSD and Shader Configuration
Grey out OSD Configuration button for Direct3D
since only OpenGL supports the feature atm.
Grey out Shader Configuration button in Core Benchmark.
2017-08-31 21:11:43 +05:30
Jonathan Li 854f3d5b85 lilypad: Fix Lock Direction/Input/Both features
Regression was introduced in 2ea078beb5.

Coverity CID 178405.
2017-08-30 22:25:06 +01:00
Jonathan Li fecf8e3ed2 gsdx:ogl: Call swap interval function on rendering thread
The swap interval function must be called on the same thread that
rendering takes place on. This fixes an issue where the turbo speed and
frame limiter hotkeys fail to disable vsync when the OpenGL renderer is
used.
2017-08-30 21:08:54 +01:00
Alessandro Vetere a0aa585afd GSdx GSTextureCache: Using FastList instead of std::list. Various other improvements.
Using range loops where possible (correctly).
Using auto where possible (minimize code changes whenever it's decided to change back to a std container).
Use more efficient erase pattern (where possible).
Minor code tweaks.
2017-08-30 11:43:18 +02:00
Alessandro Vetere b2508dcb59 GSdx GSDevice: Using FastList instead of std::list. Using range loops (correctly). Using auto instead of declaring iterator type. 2017-08-30 11:43:18 +02:00
Alessandro Vetere 965334350f GSdx GSTextureCacheSW: Ported erase iterator trick. Using FastList instead of std::list. Using range loops. Using more efficient erase pattern. 2017-08-30 11:43:18 +02:00
Alessandro Vetere 676c7b89c7 GSdx GSFastList: Introducing the custom container template class. 2017-08-30 11:43:18 +02:00
Alessandro Vetere b431d172b7 GSdx GSDirtyRect: std::vector instead of std::list, to speedup linear scan. Improved const-ness. Using range loop. 2017-08-30 11:43:18 +02:00
Alessandro Vetere f8e89b694a GSdx GSLocalMemory: Reserve space required in the std::vector before adding elements to it. 2017-08-30 11:43:18 +02:00
Alessandro Vetere 3300470a29 GSdx GSCodeBuffer: std::vector instead of std::list, to speedup linear scan. Using range loop on destruction. 2017-08-30 11:43:18 +02:00
Alessandro Vetere 798d6a9134 GSdx GSDevice11: Fix unsigned warning under VS2015 with DEBUG build enabled. 2017-08-30 11:43:18 +02:00
Akash 8fe8cad8f9 GSdx-D3D11: Avoid undefined behavior in swapchain
PCSX2 sends a negative value (-1) to GSdx when adaptive mode is
specified for Vsync, this mode is exclusive to OpenGL at the moment
and is unimplemented on the D3D11 renderer. Also the present function
of swapchain only accepts values from 0 to 4 as parameter, hence
passing negative values to the function is undefined behavior.

So let's fallback to standard synchronization method on D3D11 when
PCSX2 requests for adaptive mode.
2017-08-25 22:40:42 +01:00
lightningterror 420f111611 GSdx: Add missing CRC for GT3 2017-08-16 17:35:32 +05:30
Gregory Hainaut c4bf09ad32 glsl: extension must be declared first
Mesa follows this rule of the standard.

Issue #2037

Shader compile fines now but SSO interface seems to be broken.
2017-08-12 15:37:29 +02:00
Gregory Hainaut 8c37418e44 onepad: print a more accurate message when only a single pad is detected 2017-08-10 22:00:33 +02:00
Gregory Hainaut d6c27c190d onepad: fallback on 2nd gamepad for the 2nd player
Close #2039
2017-08-10 22:00:28 +02:00
orbea 590b75453c Add Horipad One config 2017-08-09 17:56:18 -07:00
Gregory Hainaut 17d2d9217b gsdx ogl: test adaptive/late vsync driver support
Supported on GLX (but not Linux free driver) and WGL
2017-08-05 11:00:39 +02:00
Gregory Hainaut 2e4643a398 gsdx ogl: factorize SetVSync
Move common logic into base class
Add API to handle late Vsync (only stub)
2017-08-05 10:59:48 +02:00
Gregory Hainaut 2204885fbb gsdx ogl: factorize common context init code 2017-08-05 10:56:54 +02:00
lightningterror 66a87ce4d0 GSdx: Add missing CRC for Tomb Raider Underworld 2017-07-29 20:10:46 +05:30
Akash 31400b29c3 Merge pull request #2017 from lightningterror/dbzbt3-crcfixup
GSdx: Adjust CRC hack for DBZ BT3
2017-07-27 00:23:25 +05:30
lightningterror f5b4ccf741 GSdx: Adjust CRC for DBZ BT3
Fix CRC hacks on PAL version.
PAL version will no longer experience very high brightness/contrast
issues on stages in hw mode caused by an incorrect CRC hack.
Moved a CRC hack back to OpenGL mode only for the PAL version
because texture shuffling does not work properly on PAL games.
2017-07-26 20:19:44 +02:00
Jonathan Li 4e19f7adbf lilypad: Fix button detection issue in Kung Fu Panda
Kung Fu Panda becomes stuck at an autosave warning screen since it
cannot detect button presses correctly. This fixes the issue, though
potentially it may negatively affect some other games (see #1831,
unfortunately no game titles weren't mentioned).

The issue was introduced in commit 3075ec2203

Closes #1965.
2017-07-24 00:46:00 +01:00
Akash bd5e54e825 GSdx-Windows: Fix Shadeboost text bug
Forgot to replace `IDC_TEXT` with `IDC_VALUE` macros, due to this the
text containing the name of the options was being updated with the
current value of the option instead of updating the text designated for
holding the values.
2017-07-23 22:50:40 +01:00
puzzo888 1d983a6818 Update GSCrc.cpp (#2018)
gsdx crc: add Front Mission 5 CRC
2017-07-22 11:32:15 +02:00
Gregory Hainaut 390568ade9 onepad: add a first time wizard to notify that plugin auto-map the Gamepad/Joystick
It should avoid some bug reports of not-working-as-expected GUI

v2: English improvement
v3: ditto
v4: :)
2017-07-22 11:31:35 +02:00
Akash c3ff1074bb GSdx: Rework framebuffer height calculation
DBY isn't an offset to the frame memory but rather an offset to read
output circuit inside the frame memory, hence the top offset should also
be calculated for the total height of the frame memory. Fixes software
mode regression in Beyond Good and Evil.

Also handle cases when GetFrameRect() is called without any paramerer to
avoid an illegal value access violation on the DISP register.
2017-07-13 17:53:29 +02:00
Gregory Hainaut c5d35d434c glsl: reduce geometry shader complexity
output 1 strip of 2 triangles instead of 2 strips of 1 triangle.

Potentially it would reduce the geometry shader overhead. And it
might avoid a middle line in sprite in some AMD GPU/driver/OS
bad combination
2017-07-12 22:04:03 +02:00
Gregory Hainaut 38010432ee gsdx ogl: handle float integral coordinate for depth sampling
Fix depth effect regression on Nemo (issue #1979)
2017-07-12 22:03:47 +02:00
Jonathan Li 45ac69a1f6 gsdx:d3d11: Fix sprite geometry shader
Sprites always use flat shading.

Fixes #1980
2017-07-02 22:54:36 +01:00
Gregory Hainaut b8f7e12bc0 onepad: Add platform:Linux on game db entries that miss it
SDL doc:
"Mappings not belonging to the current platform or with no platform
field specified will be ignored (i.e. mappings for Linux will be ignored
in Windows, etc)."

Issue #1978
2017-07-02 16:55:50 +02:00
Gregory Hainaut 392816fae3 gsdx: store vsync state into an integer
allow to support late vsync (Adaptive vsync).
2017-07-02 15:14:45 +02:00
Gregory Hainaut 36fd2b6854 gsdx: remove the unused GSsetFrameLimit API 2017-07-02 15:09:47 +02:00
lightningterror 358954d69e GSdx-ogl: Printing console messages v2 (#1954)
GSdx-ogl: Console messages v2

Follow up to
commit/ec63b04719fd9c05a6aeeacb55dc1c54f5ef145b

Add intel broken driver wiki link message in console (OpenGL).
Print intel / amd buggy driver message once in console (OpenGL).
Pring texture barrier and viewpoint array info once in console (OpenGL).
2017-07-02 13:56:45 +02:00
lightningterror f88972013f GSdx: Remove/move DBZ:BT3 CRC
Enables character outlines to partially work on Full CRC.
DX9 has a small issue where a small black line at the bottom shakes when outlines are enabled.
You can either use Aggressive crc or x,y offset to fix the issue.

Removed unnecessary crc hack that caused shadows on stationary objects (trees) to move on Direct3D in a weird
motion blur type way when the player moved slightly.
2017-06-29 16:54:11 +02:00
Akash f2de553d63 GSdx: Cleanup warnings on MSVC
* Cast return value of IsEof() to bool. (Avoids int -> bool performance
warning error)
* Cast field and index to the required parameter type of AppendRawData.
2017-06-29 16:48:50 +02:00
Gregory Hainaut 7d75a73105 cmake: blacklist GCC 7.0 and GCC 7.1 (based on a small testcase)
GCC bug => https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80799

Close #1937
2017-06-29 14:51:50 +02:00
Jonathan Li 4a562401dc gsdx:d3d11: Fix incorrect geometry shader use
The sprite geometry shader was still being used even if the sprites were
converted on the CPUs.

Convert all sprites using the GPU - the fix isn't ideal, but it'll
likely have to do unless someone feels like porting over more of the
OpenGL changes to the D3D11 renderer.

Closes #1921.
2017-06-13 01:11:45 +01:00
Jonathan Li f8787ca6b9 gsdx: Fix variable initialisation issue
Class member variables are initialised in order of declaration in the
class definition. Move native_buffer to the top of the class definition
to avoid initialising m_width and m_height to random values.
2017-06-05 01:12:41 +01:00
Akash 23fa0657a7 GSdx-HW: Move scaling code to separate subroutine
Move the custom resolution scaling code to a separate subroutine and
allow future RT buffer resize calls when the buffer size isn't enough.

(Example: when a game's CRTC/Framebuffer size changes. The older code
didn't consider such cases)
2017-06-04 17:10:25 +02:00
Akash a04d9fa388 GSdx-HW: Revamp buffer size calculation
Added a more robust buffer size calculation mechanism for custom
resolutions. Improves performance in higher resolutions for games
which don't need a big buffer. There's a great boost in performance
at GS limited scenarios.

I don't even feel there's a need for the large framebuffer option right
now, For future - I plan on making the large framebuffer enabled version
as the default as the overhead is there only at situations when it's
necessary. Until then keeping the original code just to be on the safe
side in case any issue pops up.
2017-06-04 17:10:25 +02:00
Akash 266c114c1e GSdx-OGL: Extend ICO workaround to PAL videomode 2017-06-03 14:52:42 +02:00
Jonathan Li 11ed4de0aa gsdx: windows: Port xz dump readback
Also modernize and std:: a bit while I'm at it.
2017-06-03 14:52:01 +02:00
Jonathan Li 742b0edaa8 gsdx: Fix GS dump readback EOF handling
An EOF only occurs after attempting to read past the end of the file.
Account for this correctly, which fixes a potential infinite loop when
reading back an xz compressed GS dump.
2017-06-03 14:52:01 +02:00
Jonathan Li a6ed698fca unix: Remove LZMA_SUPPORTED define 2017-06-03 14:52:01 +02:00
Jonathan Li 3912f3330f windows: Link GSdx to liblzma (xz) 2017-06-03 14:52:01 +02:00
Jonathan Li 97d99632a6 gsdx: Use std::vector for xz dump output buffer
By default, Windows has a 1MB stack size limit per thread, so array
cannot be used...
2017-06-03 14:52:01 +02:00
Akash 49840bb621 GSdx: Implement SYNCV register bitfields
Add the bitfield structure of the undocumented SYNCV register,
potentially might be useful in proper height determination of the output
circuit for some weird games which still get it wrong but still haven't
figured out how it might be useful. Maybe some sort of black magic
formula with the vertical synchronization values?

The differential phase value seems to closely resemble the display
height value of the video modes (480 for NTSC, 576 for PAL) but after
some investigating into the differential phase, I have no clue on how
they might be even related. Hopefully the mystery will be unveiled in
the near future.
2017-05-24 13:44:52 +02:00
Jonathan Li e8f35f0bab onepad: Remove use of "using namespace std"
"using namespace std" was causing ambiguity issues and compile errors on
FreeBSD. Remove it.
2017-05-23 01:11:49 +00:00
Gregory Hainaut 802f1029e9 gsdx: dump gsdump in xz format directly
Reduce disk space. Easy to share.

It would be nice to port the code to Windows.
libzma code was taken from https://git.tukaani.org/xz.git

Note: only short dumps are supported so far. Big dump will freeze the interface during the compression.
Or will suck all the RAM.
Note2: a multithreaded encoder would badly impact the compression ratio

Thanks to Turtleli for all review comments
2017-05-21 23:45:35 +02:00
Gregory Hainaut 53b2fdf31c linux: requires liblzma (xz) to build GSdx 2017-05-21 23:45:35 +02:00
Gregory Hainaut 5c7d9d08e2 gsdx: defer init of GSUtil global object
Close #1935
2017-05-21 14:39:22 +02:00
Gregory Hainaut 9cb8c70434 gsdx linux: port to latest GTK3 API
* replace gtk_table by gtk_grid
  => it still misses some paddings
* Use 3.22 monitor API to query screen size
  => need to be tested
* directly add scrolled windows into a container without bothering with
  the viewport.

Code compile fine but wasn't tested.

v2: disable the code until I (or someone) get a chance to test and fix it.
2017-05-13 10:39:06 +02:00
Gregory Hainaut b15ab1b1cf gsdx: use = default instead of trivial constructor/destructor
reported by clang-tidy
2017-05-13 10:38:35 +02:00
Gregory Hainaut 595ad99a5b Cmake: what should have been the previous commit 2017-05-12 19:38:51 +02:00
Gregory Hainaut 05763b3669 cmake: better gcc + gsdx integration
Only set fabi-version on older GCC (5.0 and below)
Disable broken optimization for GCC7+ (until we find a better solution)
2017-05-11 23:14:06 +02:00
Gregory Hainaut ec63b04719 gsdx: only print once OpenGL status message
All credits go to @lightningterror

Fix #1882
2017-05-11 22:35:31 +02:00
Gregory Hainaut 0939424574 onepad: be sure m_unique_id is set even in case of early return
not important as the object will be deleted but please coverity
2017-05-11 21:47:39 +02:00
Gregory Hainaut 806ede241a onepad: remove useless code
reported by Coverity (I forgot to remove the code)
2017-05-11 21:46:28 +02:00
Akash 984fcfda2e Counters: Update videomode enum with proper prefix
Thanks to @colepcsx2 (https://github.com/PCSX2/pcsx2/pull/1896#commitcomment-21858717) for pointing it out!

I also updated the prefix in the inferior video mode detection of GSdx, I'm not even sure why we need the videomode info on the plugin side, might be useful someday.
2017-05-11 11:23:10 +02:00
orbea 2dcc85d64c Allow building the player with the legacy GSdx. 2017-05-11 09:50:01 +02:00
Akash 7a3239cba0 GSDX: Remove redundant parenthesis from combobox text
The third parameter of the GSSetting constructor already encloses the
text in parenthesis, so the right bracket here just messed up things.
2017-05-07 19:31:37 +01:00
Akash 5f449151a1 GSDX: Add missing grayouts to Shadeboost options
The shadeboost options text (Contrast, Brightness, Saturation) were not
grayed out when shadeboost was disabled, it was sort of inconsistent
compared to the behavior of external shader, so added grayouts to them
when shadeboost is disabled.

Also changed "OpenGL Very Advanced Custom Settings" to "OpenGL Advanced
Settings", the verbosity didn't help much in my opinion.
2017-05-07 19:31:37 +01:00
Gregory Hainaut ecd7107ccb onepad: move KeyName in the dialog and remove the now useless dialog.h
Note: use C++ construct to avoid C buffer.
2017-05-03 16:42:03 +02:00
Gregory Hainaut a71a549fa3 onepad: create a LUT for the pad key => SDL key mapping
Initial plan was to allow to remap the logical (SDL) key.
Unfortunately I feel some issues with the current enum.
* button/axis overlap
* trigger/axis must be handled differently

Nevertheless, code is easier this way
2017-05-03 12:33:42 +02:00
Gregory Hainaut 7597b31215 onepad: replace conf pointer by g_conf object 2017-05-03 12:03:56 +02:00
Gregory Hainaut db4f28f4ca onepad: replace key_status pointer by g_key_status object 2017-05-03 12:03:56 +02:00
Gregory Hainaut b09a82fb94 onepad: remove dead code 2017-05-03 12:03:56 +02:00
Gregory Hainaut 36528bb723 onepad: allow to save/reload SDL2 mapping from OnePAD2.ini file
SDL_GAMECONTROLLERCONFIG is nice but limited to a single entry. (Note it can still be used)

Option name is SDL2. Here an example

SDL2 = 03000000a306000020f6000011010000,PS2700 Rumble Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b0,y:b3,platform:Linux,
2017-05-03 12:03:56 +02:00
Gregory Hainaut 03899a6240 onepad: drop useless goto statement 2017-05-03 12:03:56 +02:00
Gregory Hainaut d8f88ee1e3 onepad: s/set_keyboad_key/set_keyboard_key/ 2017-05-03 12:03:56 +02:00
Gregory Hainaut 2159245224 onepad: add DUALSHOCK4 USB Wireless Adapator mapping
Close #1924
2017-05-02 10:07:17 +02:00
Jonathan Li 1d364f1991 spu2-x: Remove outdated website text file 2017-04-30 23:31:08 +01:00
Gregory Hainaut dc00af8829 psx|spu2x|gsdx: shift negative value is undefined in C standard
Instead does the negation after the shift

v2: assert shift <= 15 in clamp_mix
2017-04-30 21:20:23 +02:00
Gregory Hainaut 627212290e spu2x: comment unused variable 2017-04-30 21:20:23 +02:00
Gregory Hainaut d9e43b5d8d gsdx egl: rewrite the EGL implementation
Split code in 2 parts
* Base class (GSWndEGL) that implement the core EGL and GL context
* Derived class (GSWndEGL_X11/GSWndEGL_WL) that implement the backend to handle native resources

Note: Most backend code is only useful for GSopen1/PS1 mode. GSopen2 only requires
the AttachNativeWindow implementation

Code is based around EGL_EXT_platform extension that allow to select the platform at runtime.
Note: I think the extension was integrated in EGL 1.5

The X11 backend was mostly converted to XCB
The wayland backend is only a placeholder for future code

I don't know if MS windows is/could be supported with EGL_EXT_platform API

Code validated on Mesa. Proprietary drivers aren't yet tested.
2017-04-30 14:04:24 +02:00
Jonathan Li a3b3b4f657 gsdx: Fix uptr size on Windows x64 build 2017-04-29 23:22:02 +01:00
Gregory Hainaut 413d1828eb gsdx: call XInitThread on Linux dump replay 2017-04-29 13:05:28 +02:00
Gregory Hainaut 4b5aabe6b0 onepad: move an ok button to the right corner 2017-04-28 23:24:49 +02:00
Gregory Hainaut 5b4c948e43 onepad: clean the gamepad/joystick interface
Remove return of empty function
Use final/override qualifier
Remove useless virtual

Thanks turtleli for the advices
2017-04-28 11:27:19 +02:00
Gregory Hainaut f91faacc53 onepad: remove autorepeat deadcode
a9af374 onepad: don't touch autorepeat setup
2017-04-28 11:27:19 +02:00
Gregory Hainaut e408b3ab02 onepad: replace pthred/queue with std::mutex/mt_queue
v2: based on turtleli feedback
rename m_q into m_queue
add includes
2017-04-28 11:27:19 +02:00
Gregory Hainaut 7d771229e2 onepad: add a GUI list box to select joypad based on UID
Note: remove the cancel management of the small modal
It is easier, it doesn't always work anyway
2017-04-28 11:27:19 +02:00
Gregory Hainaut 31d8142a0d onepad: plug uid instead of the index
ini must be recreated
2017-04-28 11:27:19 +02:00
Gregory Hainaut 3cff588eff onepad: add an unique identifier 2017-04-28 11:27:19 +02:00
Gregory Hainaut a50766384b onepad: use range loop for hash iteration 2017-04-28 11:27:19 +02:00
Gregory Hainaut c183de5662 onepad: add hot-plugging support
Note: pad to player mapping is done later

v2: remove the useless print
2017-04-28 11:27:19 +02:00
Gregory Hainaut 1b369520ed onepad: drop the pad if an error was detected
v2:
init m_no_error in gamepad constructor
2017-04-28 11:27:19 +02:00
Gregory Hainaut 2e09c7faf3 onepad: Move init/destroy code to constructor/destructor
* prefix remaining member with m_
* Use array for m_effect_id
* Properly Destroy/Close Haptic/Joystick/Game Controller
 (except on older SDL versions which are buggy)
2017-04-28 11:27:19 +02:00
Gregory Hainaut 4b24cfa5ea onepad: use external resource to support more joysticks 2017-04-28 11:27:19 +02:00
Gregory Hainaut 9da843c994 onepad: plug SDL2 API game controller 2017-04-28 11:27:19 +02:00
Gregory Hainaut 35b162adbf onepad: move enum first in .h file
It would avoid future compilation issue
2017-04-28 11:27:19 +02:00
Gregory Hainaut 94e19ac903 onepad: remove SDL1 manual detection code path 2017-04-28 11:27:19 +02:00
Gregory Hainaut 61182249f0 onepad: drop hacks/options for DualShock3
SDL2 will take care of correct detection
2017-04-28 11:27:19 +02:00
Gregory Hainaut 5c537fdbe3 onepad: properly indent comments
Clang-format doesn't like the double *
2017-04-28 11:27:19 +02:00
Gregory Hainaut 9c7e9cc6f2 onepad: use range loop and vector of unique_ptr to manage the joystick 2017-04-28 11:27:19 +02:00
Gregory Hainaut 873ae6717e onepad: add a game controller db resource
It will be used later by the SDL2 API
2017-04-28 11:27:19 +02:00
Gregory Hainaut d3a3a8528f cmake: reindent onepad/CMakeLists.txt with space 2017-04-28 11:27:19 +02:00
Gregory Hainaut 41990a6402 cmake: create the macro add_custom_glib_res to handle resources 2017-04-28 11:27:19 +02:00
Jonathan Li ffcac1bc3b spu2-x:xaudio2: Comment stuff to investigate 2017-04-28 10:12:50 +02:00
Jonathan Li adb92ce349 spu2-x:xaudio2: Use unique_ptr
Also remove the unused constructor parameter from StreamingVoice and
rename the variables slightly.
2017-04-28 10:12:50 +02:00
Jonathan Li 14bd5a4f59 spu2-x:xaudio2: Improve cleanup after an exception
Initialise pointers to nullptr, move the LoadLibrary code into the try
block (where it should have been in the first place), and use Close()
to cleanup if an exception occurs. Also initialise/destroy the critical
section in the base class constructor/destructor.

This should avoid resource leaks if an exception occurs.
2017-04-28 10:12:50 +02:00
Jonathan Li 6c512c1973 spu2-x:xaudio2: Simplify XAudio2Error exception
Instead of creating a separate message function, just reuse what() and
pass the string to the std::runtime_error constructor instead.

Also catch a reference to a std::runtime_error instead, since it'll
allow for simpler cleanup.
2017-04-28 10:12:50 +02:00
Jonathan Li 3cb0e3bb13 spu2-x: Combine XAudio2 2.7/2.8+ code into an inline file
Avoids code duplication, though there's now messy ifdefs...
2017-04-28 10:12:50 +02:00
lightningterror 303564fd70 GSdx: Move/add GT4 CRC
Moved a CRC hack to Aggressive that can cause or fix VRAM and RAM spikes.
This way people can switch between each config if they experience problems with either.
Varies on userconfig , game version and maybe hardware.

Added missing CRC game version for GT4 pal.

Note: The issue might be the same on GT3 and GTConcept , the code might
need to be removed for those games as well.
2017-04-27 17:46:58 +02:00
Gregory Hainaut bb35261aca gsdx: don't request a depth buffer on the window
Code directly uses depth buffer attached to a frame buffer
2017-04-23 10:59:33 +02:00
Gregory Hainaut 2155f65478 gsdx: fix EGL build 2017-04-23 10:59:33 +02:00
FlatOutPS2 47c2f0a289 GSdx: Remove Dirge Of Cerberus CRC hack
Hack was used to remove garbage data rectangles from popping up on screen when objects and characters were added to or removed from the world.
This issue is now being handled by OI_DoubleHalfClear in GSRendererHW.cpp, so the hack is no longe necessary and has been removed.
2017-04-21 11:13:27 +02:00
FlatOutPS2 7392f52184 GSdx: Move Resident Evil 4 and The Getaway series CRC hacks
Moves Resident Evil 4 hack to Aggressive level as it is no longer
required to fix any issues, but does offer a decent speed boost.

Moves The Getaway & The Getaway Black Monday CRC hack to Full level, as the issue can be resolved
when using the OpenGL Hardware renderer.
2017-04-21 11:13:27 +02:00
Gregory Hainaut 688f05ff26 gsdx sw: always enable the gs memory wrapping emulation 2017-04-21 10:53:05 +02:00
Gregory Hainaut ef3435441f onepad: create a legacy version for SDL1
The legacy version is the version 1.3

The new version is the version 2.0. It would be based on SDL2 only

Distribution information.
If you link wxWidget with SDL, you will need to be sure it is SDL2 or upgrade.

You can build wxWidget with SDL2 with the following trick

export SDL_CONFIG=/usr/bin/sdl2-config
./configure --with-sdl .....
2017-04-19 19:02:36 +02:00
Gregory Hainaut 24eb1627e5 gsdx: add GStempdir wrapper to get a tempory directory
Allow to use Linux compatible code for OpenCL
2017-04-12 18:39:11 +02:00
Gregory Hainaut 2b30e7880e gsdx: add GSmkdir for windows based on CreateDirectory
v2: use nullptr
2017-04-12 18:39:11 +02:00
Gregory Hainaut 2d0a61fc8d gsdx ogl: use load resource to load shader
* Windows behavior must be checked
* remove glsl_source.h

v2: fix missing include
Big thanks to Turtleli

v3:
fix indentation in gsdx-res.xml
add dependency in cmake
remove old res/glsl/fxaa.fx symlink
add tfx.cl for OpenCL support on Linux

v4, v5
fix cmake indentation
2017-04-12 18:09:06 +02:00
Gregory Hainaut 38c4f5b6e7 gsdx: always NULL terminate resources on Windows
It is done automatically on Linux. Strings are much
better with this NULL char ;)

All credits go to turtleli

v2: increase resize instead of push_back NULL char
2017-04-12 18:09:06 +02:00
Gregory Hainaut ebae8b65f8 gsdx linux: implement GSdxApp::LoadResource based on g_resource
v2: use early return to reduce code/branch complexity
v3: use nullptr
2017-04-12 18:09:06 +02:00
Gregory Hainaut 1cbade511d gsdx: use vector of char as shader container
It will avoid various char cast on Linux.

v2:
remove cast on windows file and std prefix shader vector
v3:
forget to remove some char cast
2017-04-12 18:09:06 +02:00
Jonathan Li cf131b51a2 cdvdgigaherz: Avoid LL after date in library name string 2017-04-11 00:31:14 +01:00
Gregory Hainaut e91194994f gsdx ogl: remove useless glx/egl context print 2017-04-09 12:59:08 +02:00
Gregory Hainaut 8555b9b5ec remove an old merge conflict file (that souldn't have been commited) 2017-04-08 14:40:55 +02:00
Gregory Hainaut dad4ab1980 gsdx ogl: Deleted objects are automatically unbound/unmapped 2017-04-08 14:40:54 +02:00
Gregory Hainaut 12d2c6be56 gsdx linux gui: align gui with wndows (tooltip + checkbox)
add checkboxes for the 2 "new" hacks
    Wrap gs memory & merge postprocessing sprite

add tooltip for OpenGL options

v2: based on turtleli feedback
use gtk_scrolled_window_set_propagate_natural_height on GTK 3.22+
use the nicer GTK_CHECK_VERSION macro
2017-04-07 23:06:29 +02:00
Gregory Hainaut 83d83b9add gsdx linux gui: reduce height on/for small screen
* Remove the logo
* add a scroll on the osd panel
2017-04-07 23:06:29 +02:00
lightningterror 820919c0a9 GSdx ogl sw: Move GL_ARB_copy_image to optional
Move GL_ARB_copy_image to optional for OpenGL SW render.
It will allow Ivy Bridge to work with OpenGL SW as it's not required.

Sandy Bridge is not yet tested , would be nice if someone could test.
2017-04-06 18:14:59 +02:00
Gregory Hainaut ad63c13cd1 gsdx sw: Update comment on the GCC bug
Add link to bugzilla. Bug will be fixed in GCC7

Close #1881
2017-04-04 19:04:21 +02:00
Gregory Hainaut 5b91dc45e0 gsdx ogl: reduce requirement for SW renderer
Clip Control is only used for the HW renderer.

It will help Nvidia DX10 GPU on Windows. Potentially old AMD GPU too.
Unfortunately Ivy bridge still misses texture copy

Note on Linux, you can use the free Mesa driver.

Otherwise, it is time to save money for a future upgrade :)
2017-04-04 18:37:26 +02:00
Gregory Hainaut df32564bef gsdx: workaround AVX2 generated code by GCC
See commit for the full details.

v2: use a direct access to the union field instead of extract32
It gives us both optimal and working code.
2017-04-01 14:05:40 +02:00
FlatOutPS2 82405982f7 GSdx: Add merge sprite hack to GSdx hacks dialog
Adds merge sprite hack to GSDx hacks dialog

And ports merge sprite hack to Direct3D renderers.
Special thanks to my keyboards Ctrl, c and v buttons for all their hard
work in porting this hack.
2017-04-01 11:16:25 +02:00
FlatOutPS2 557b672232 GSdx: Unscale Point and Line Direct3D11 port
Ports the "Unscale Point and Line" hack to the Direct3D11 Hardware renderer.

And enables the "Unscale Point and Line" hack for Custom Resolutions with Direct3D11 and OpenGL.
2017-04-01 11:16:25 +02:00
FlatOutPS2 117c249595 GSdx: Add Windows GUI for split texture filtering option
Adds Windows GUI elements of the split texture filtering options.

Bilinear Texture Filtering is moved to the top section of the main GSdx window,
and Trilinear Filtering is moved to Hacks.
2017-04-01 11:16:25 +02:00
FlatOutPS2 cb0a430aa4 GSdx: Shader & OSD window update
Adds Texture Filtering Of Display option to the Shader dialog window Windows UI.

Updates the layouts of the Shader and OSD dialog windows to more closely resemble the Linux GUI.
2017-04-01 11:16:25 +02:00
FlatOutPS2 df5278df72 GSdx: Main & Hacks window update
Reorganizes Hacks dialog window.

Adds UI elements for the Memory Wrapping and HPO v2/Special commits

Adds advanced OpenGL functions "Geometry Shader" and "Image Load Store" to the Windows UI.

Renames "Configure Hacks" to "Advanced Settings and Hacks", to more closely resemble the Linux GUI.
2017-04-01 11:16:25 +02:00
FlatOutPS2 975441dfe9 GSdx: Direct3D port of HPO special/V2
Adds a port of the new Half-pixel Offset options for the Direct3D
Hardware renderers.
2017-04-01 11:16:25 +02:00
FlatOutPS2 2d591182c4 GSdx: Memory Wrapping Windows port
Adds GS Memory Wrapping hack to Windows. Enabling the hack will fix cut-off cutscenes in Wallace & Gromit: The Curse of the Were-Rabbit and Thrillville.
2017-04-01 11:16:25 +02:00
Gregory Hainaut 41fb11d846 gsdx: cpu detection take 3! Don't use 64 bits type in Xbyak::Cpu
Recent GCC uses SSE4/AVX code to optimize the 64 bits operation.
It is bad idea as it would generate an illegal instruction on
older CPU.
2017-04-01 11:14:18 +02:00
FlatOutPS2 82ad1392ef GSdx: Move Ace Combat 4 CRC hack to aggressive level and fix spelling issues
Ace Combat 4 CRC hack removes clouds for a good speed boost, which removes both 3D clouds(invisible with Hardware renderers, but cause slowdown) and 2D background clouds.
Removes blur from player airplane.
This hack also removes rockets, shows explosions(invisible without CRC hack) as garbage data, causes flickering issues with the HUD, and in some (night) missions removes the HUD altogether.
The CRC hack has been moved to the aggressive level.

Aggressive is misspeled several times in the file, this has been adressed.
2017-03-31 23:36:35 +02:00
Jonathan Li 815ac8be04 gsdx:cmake: Fix logo dependency issue
Changes to the dependencies of the generated logo files did not trigger
a rebuild of the files. Use add_custom_command instead of
execute_process so build dependencies can be specified.

Also prevent the generated files from polluting the source directory.
2017-03-30 22:55:34 +01:00
Jonathan Li ba94643f0f gsdx:linux: Fix missing logo on some Linux distros
The pixdata format loader has been removed from recent versions of
gdk2-pixbuf, so the logo doesn't load. Avoid preprocessing the data and
leave the logo as an embedded bitmap file.
2017-03-30 17:45:49 +01:00
Jonathan Li ae73356ecf gsdx: Avoid const strings in header file
This prevents each .cpp file that included stdafx.h (IOW everything)
from having its own copy of the strings.
2017-03-30 01:10:48 +01:00
Akash 38c2de3ae3 GSdx-PCRTC: Minor modification to NTSC saturation
Allow the output circuit saturation to take place at cases where one of the output circuit is enabled with frame mode rendering, I'm not sure it would be safe to allow saturations when both of the output circuits are enabled with frame mode rendering. Unlike field mode rendering, frame mode doesn't use identical rectangles at same co-ordinates for output in two alternating fields and potentially they could use a much bigger output size when both of the output circuits are enabled and are separated without any intersection. So let's limit the saturation to only the cases where we detect a single output circuit for frame mode rendering.

Fixes a regression in Devil May Cry 3 and Sky Gunner.
2017-03-29 19:37:44 +02:00
willkuer a18d624bcb gsdx: Add an automatic CRC hack level
If a user switches renderer they also have to remember to change the CRC
hack level for the best user experience with the selected renderer.

This commit adds a new automatic CRC level that autoselects the
recommended CRC level for the selected renderer, so that a user doesn't
have to make the change manually.

coauthor: turtleli
2017-03-28 23:05:24 +02:00
willkuer 439472d4f8 gsdx: Add template version of GetConfig
It allows static_casts to be avoided for enum classes
2017-03-28 23:05:24 +02:00
Jonathan Li 85ddf69042 gsdx: Improve OpenGL HW renderer checks
If OpenGL software is the saved ini renderer and F9 is pressed to toggle
to the hardware renderer, depth emulation will be disabled. This fixes
that issue.
2017-03-28 23:05:24 +02:00
Jonathan Li a5282daf91 gsdx: Store the current renderer in GSdxApp 2017-03-28 23:05:24 +02:00
Jonathan Li 94f2ad9263 gsdx: Move renderer config loading from GSOpen2 to _GSOpen
Some duplicate logic is avoided this way.
2017-03-28 23:05:24 +02:00
lightningterror 6977658443 GSdx ogl: SSO Workaround for AMD buggy drivers (#1858)
GSdx ogl: SSO Workaround for AMD buggy drivers

All 2017 drivers are now blacklisted.
The BSOD/crash issue is still there so don't set Blending Accuracy to None!
Shortened the message in the console making it more appealing.
2017-03-28 23:02:19 +02:00
orbea 2aa33e2875 Add crc hack for project metafalica
Closes https://github.com/PCSX2/pcsx2/issues/1762
2017-03-27 12:51:43 +02:00
Jonathan Li eb8ede38cf lilypad: Use l length modifier for wide character string
w is Windows specific. Fixes a gcc and clang warning.
2017-03-23 22:35:49 +00:00
Jonathan Li f1eff358da gsdx:windows: Fix console output when replaying dumps 2017-03-23 01:33:35 +00:00
Jonathan Li f174d71ac7 gsdx: Fix vsnprintf usage in format function
-1 is only returned when there is an encoding error, and the va_list
argument is indeterminate after being passed to vsnprintf.

Use the return value to determine the buffer length, and call va_end and
then va_start before vsnprintf is called again.
2017-03-21 23:21:26 +00:00
Jonathan Li ae2e8469b4 gsdx: Remove ancient codeblocks file 2017-03-21 23:21:26 +00:00
Jonathan Li 67d9436f22 gsdx: Remove unused and incomplete GSDeviceSW 2017-03-21 23:21:26 +00:00
Jonathan Li 448ca97d93 gsdx: Avoid "using namespace std" in spsc queue 2017-03-21 00:10:35 +00:00
Gregory Hainaut 9865270e68 gsdx: split GSVector.h into smaller files 2017-03-19 13:50:13 +01:00
FlatOutPS2 f3a89f59e4 LilyPad: General fixes and UI improvements
Some general fixes and UI improvements.

Adds Reset Configuration to Input/Force Feedback configuration screens that resets the configuration for the selected control(s).

Adds Restore Defaults button to the General tab that deletes all LilyPad
Settings and bindings and resets to the default settings.

Adds double-click functionality to the PAD list on the General tab,
which will now send the user straight to the corresponding PAD tab.
2017-03-16 22:43:53 +00:00
FlatOutPS2 84a8fdadc5 LilyPad: Fix F4 button (PCSX2 FrameLimiter toggle) getting blocked
Fixes issue where losing focus after pressing alt-tab would end up
blocking the F4 button (which is used for turning the PCSX2 FrameLimiter
on and off).

Fixes: https://github.com/PCSX2/pcsx2/issues/1797
2017-03-16 22:43:53 +00:00
FlatOutPS2 bd45bab34a LilyPad: Display a warning when all controls are inactive
Displays a console warning if no controls/controllers are active and the
emulation cannot be controlled.
2017-03-16 22:43:53 +00:00
FlatOutPS2 2ea078beb5 LilyPad: Add Quick Setup
Adds quick setup that allows for quickly setting up all the default pad
buttons without having to click on each one separately.

Hides special inputs(inputs that aren't available on a PS(2) controller) by default.
2017-03-16 22:43:53 +00:00
FlatOutPS2 3075ec2203 LilyPad: Improve analog/pressure sensitive detection
Improves detection of analog or pressure sensitive support, which previously made some games unable to detect the correct mode.
2017-03-16 22:43:53 +00:00
Gregory Hainaut a3efc77255 gsdx ogl: use an HLE shader to avoid upscaling line in ICO
ICO uses a depth of field effect for the fog. Depth is extracted
into the alpha channel of a texture. And then used as blending factor.
You need a 1:1 texture/pixel mapping otherwise you will line at boundaries.

In order to extract the DoF, ICO moves the depth buffer around the GS
memory. Memory moves are implemented in the not-scaled world. It means
that we can't have the above 1:1 ratio. And we don't know anymore that
data are coming from the current depth buffer.

The solution: I reused an HLE channel shader to read the depth buffer directly.
This way I have the guarantee that pixel/depth are aligned.

Close #1816
2017-03-16 08:27:12 +01:00
Gregory Hainaut 1a768ca438 gsdx sw: sync thread if current target pages are already used by input texture
Otherwise you have a write before read typical race condition. It works
most of the time because textures are stored in temporary buffers (aka
texture cache). So the race condition requires texture invalidation in the mix.

I hope the perf impact will be small enough.

Fix #1691
Blood Will Tell: gray scale effect description

Frame is renderer in 0x700
Sync 0x700 (RT will be used as input)

Foreach page of frame
    // The missing Sync was this one. You can't copy new data to 0x2800
    // until you finish the rendering that use 0x2800 as input texture
    // (AKA end of this foreach loop)
    Sync 0x2800 (not the first iteration, texture will be used as a RT)
    Copy page from 0x700+offset to 0x2800

    Sync 0x2800 (RT will be used as input)
    Render Effect line1 from 0x2800 to 0x700
2017-03-15 18:30:46 +01:00
Jonathan Li c498833c27 gsdx: Remove VS2013 stuff 2017-03-13 23:57:15 +00:00
Gregory Hainaut 0af80b7c86 gsdx: restore the order of the texture filtering option
It was modified by mistake with previous filtering refactoring
2017-03-13 22:55:47 +01:00
Jonathan Li 5c1023a332 spu2-x:windows: Replace GUIDFromString with IIDFromString
Does the same thing.
2017-03-12 00:04:09 +00:00
Akash f423cf73c4 GSdx: Fix Alpha test value initialization
Alpha test should only be disabled when writes to all of the alpha bits in the Framebuffer are masked. Fixes a regression in Dragon Ball Z: Budokai 3 scouter image rendering.
2017-03-11 17:40:28 +01:00
Gregory Hainaut 7d3c850813 gsdx ogl: improve ST/Q precision
When a float overflow is detected, geometry shader is disabled. And ST/Q is done on the CPU

It will help
Issue 551
Issue 1684
2017-03-11 00:24:38 +01:00
Gregory Hainaut 6d6ed1a205 gsdx sw: do const q division in ConvertVertexBuffer
It allow to do the division before the size multiplication
It avoid a float overflow if T is too big.
Old behavior: (T * size) / Q
New behavior: (T / Q) * size

Performance Note:
* Rcp was replaced by a slow division (more accurate)
* At least we avoid a 2nd loop on the vertex buffer

It helps on Pro Soccer Club and Galerians Ash rendering

Tric Note:
SPRITE must be handled differently because the 'q' of first vertex could
be invalid
2017-03-10 20:45:14 +01:00
Gregory Hainaut 611239db5c gsdx: handle float overflow on Q in vertex trace
Replace the fast reciprocal with a slower division when we detect a too big Q value.

Improve #551, #1684
2017-03-10 20:45:14 +01:00
Gregory Hainaut f862f5be03 gsdx sw: use accurate division for the C reference implementation
Speed isn't important here. It would allow to compare the rendering with
the JIT implementation. If it is necessary we could an option for the JIT.
2017-03-10 20:45:14 +01:00
Gregory Hainaut b54a824abd gsdx: split texture filtering option
Bilinear applies to all renderer
* Common code done in GSVertexTrace
* Extend it with forced but sprite (trade-off between linear/upscale glitches)
* Linux GUI option was moved at the top with the renderer selection

Trilinear is moved to OGL hack

close #1837

Thanks to Flatout for the review and feedback.
It will take care to update the Window GUI :)
2017-03-10 18:05:34 +01:00
Jonathan Li ec7781f1f9 windows: Fix VS project file issues
Fixes "project out of date" issue for wx_config on VS2017.
Fixes whole program optimisation possibly not being applied on release
builds for USBqemu (it may have been applied, but I can't actually tell,
and now it at least shows properly in the VS property editor).
2017-03-07 19:47:54 +00:00
Gregory Hainaut 91f805675b gsdx: dump xyoffset register 2017-03-05 22:16:01 +01:00
Gregory Hainaut 0a5f796c33 gsdx sw: missing texture due to wrong optimization fix
Typical bug, missing/wrong texture on the SW renderer but working fine on the HW renderer

Debugged on ATV Quad Power Racing 2 but I suspect couple of game are impacted

Bug description:
GSdx flatten the Q value of sprite. So m_vt.m_eq.q is true when Q(2N+1) are the same.
Q(2N) values could be random. The fix replaces Q0 by Q1 for the uniform Q value.
2017-03-05 20:27:19 +01:00
Gregory Hainaut 438fbf31cf gsdx sw: rcp introduce bad rounding on the grandient
Division is slower but more accurate. Fix rendering issue on Xenosaga (batte slot)/Jak3 (skin color)

Coauthor:pseudonym

Fix issue #1769
2017-03-05 10:53:07 +01:00
Gregory Hainaut ae8aa358e4 gsdx: move window creation before renderer/device setup 2017-02-26 19:09:16 +01:00
Gregory Hainaut da2bf4e366 gsdx: reduce the complexity on window creation
Improve code sharing between OS
Use vector to handle priority
Throw in GSWndDX create in case of error
2017-02-26 19:09:16 +01:00
Gregory Hainaut 9ff385f6f3 gsdx: use shared_ptr instead of raw GSWnd* 2017-02-26 19:09:16 +01:00
Gregory Hainaut 714fcaaadd gsdx ogl: move the validation of the gl context in the window 2017-02-26 19:09:16 +01:00
Gregory Hainaut b3836c58d2 gsdx ogl: properly plug the new HPO option 2017-02-26 19:04:00 +01:00
Gregory Hainaut 646c02a5e2 gsdx linux: update GUI based on previous commit 2017-02-26 19:04:00 +01:00
woj1993 4a6a3af418 gsdx windows: update gui to add a HPO v2 checkbox
Squash done by greg

v2: update tooltip
2017-02-26 19:04:00 +01:00
Akash 500d2e076d GSdx-PCRTC: Apply saturation only for field mode
Previously, the NTSC saturation was also applied for double scan mode (Interlaced and Frame) where the developers send double the height to the DISP registers, saturation shouldn't be performed at such cases as the developers could send a value of 780 while the real size of the output would be 390 due to double scan mode. Doing the saturation later after identifying the real size also seems a bit counter-intuitive as we haven't discovered any cases where double scan games require the NTSC saturation hack. So let's just apply the saturation only for Interlaced (Field) Mode and omit the saturation step for other modes.
2017-02-21 10:54:28 +01:00
Akash 17b33afd64 GSdx-PCRTC: Move hacks away from GetDisplayRect()
Isolate all the hacks into a separate subroutine and properly document about them, should make it easier for people to understand the display rectangle setup code, the hacks were totally messing up the readability of the function earlier.
2017-02-21 10:54:28 +01:00
Akash 319b3dabdf GSdx-Windows: Automatic CRC hack level selection
Default to "Partial" CRC hack level when the GPU's best renderer is determined as the OpenGL hardware renderer.
2017-02-21 10:54:03 +01:00
Akash ff89619b09 GSdx: Add an Enumeration for CRC Hack level 2017-02-21 10:54:03 +01:00
Gregory Hainaut 726f9d5312 gsdx ogl: improve error message on windows
* Common function
* Print an error id
* Don't exit on bad setpixelformat (it is illegal to call it twice)
2017-02-18 22:25:27 +01:00
Gregory Hainaut f3adf4bf57 gsdx ogl: texture barrier is optional too 2017-02-18 20:11:56 +01:00
Gregory Hainaut 193d9f838b gsdx ogl: mark 2 DSA functions as optional 2017-02-18 19:44:17 +01:00
Gregory Hainaut 674d22321a gsdx wgl: drop GL2.0 context and avoid a context leak
Namely detach/delete context before throwing
2017-02-17 19:20:42 +01:00
Gregory Hainaut cdb71101a1 gsdx ogl: As Intel is too cheap to provide GL_ARB_direct_state_access on theirs expensive iGPUs
Add a "slower" emulation of the extension...

Hopefully it will allow to start openGL on haswell (maybe broadwell) and later.
2017-02-17 17:44:26 +01:00
Gregory Hainaut 26993380b1 gsdx-ogl: black list 2016/2017.1 AMD driver
Based on AMD feedback, I'm might blacklist all 2017 drivers too.
2017-02-17 17:32:53 +01:00
Gregory Hainaut da1bb43618 cmake: Add various missing file in CMakeLists.txt
Add some windows code path. It would reduce the burden to port Cmake to windows.
(sill miss 3rdparty/some plugins/...)
2017-02-16 20:11:57 +01:00
Gregory Hainaut de962d3e7e gsdx wgl: retry to create a context without advance flag
Hopefully it will support more drivers #1813
2017-02-10 22:26:41 +01:00
Gregory Hainaut 213fa1c148 gsdx sw: init completely m_scanline buffer
The buffer contains extra room to avoid a segmentation fault due to an overflow.
Unfortunately the end of the buffer wasn't initialized which can lead to unexpected behavior.

Based on issue #1806 it could impact Guilty Gear X2
2017-02-08 19:42:54 +01:00
Gregory Hainaut 2a2a022792 gsdx ogl: add a texture barrier when target is read back
Fix graphical corruption in Nouveau/BUA/devil may cry

Issue #1805
2017-02-08 19:42:54 +01:00
Gregory Hainaut ba91c8f0c2 gsdx opencl: warning+compilation fixes 2017-02-08 19:42:54 +01:00
Gregory Hainaut c232f90d6e cmake: add an option to enable openCL
Note: nothing work
2017-02-08 19:42:54 +01:00
Gregory Hainaut d0b1162b15 gsdx ogl: drop fallback of GL_ARB_clear_texture
Mesa AMD was updated :)

all drivers[1] that support GL_ARB_shader_image_load_store got GL_ARB_clear_texture

[1] Intel driver misses others extensions to run GSdx
2017-02-03 21:56:24 +01:00
Gregory Hainaut 63944e8c43 gsdx ogl: allow to start without GL_ARB_texture_barrier
Rendering will be corrupted (for advance effects) if the driver doesn't support it.
However it allow to run with Mesa software emulation (or inside a virtual machine)

Note: mesa still requires an override of the buffer storage extension
MESA_EXTENSION_OVERRIDE=GL_ARB_buffer_storage
2017-02-03 21:56:24 +01:00
Gregory Hainaut dc42c65dfb gsdx: requires/allow BMI instruction in AVX2 build
So far BMI is inclusive in AVX2 CPU. Help compiler to generate better code
2017-02-01 18:24:51 +01:00
Akash eda22c241d GSdx: Improve robustness of ComboBoxInit()
Previously, the combobox will reach an indeterminate state whenever it's passed with a value out of range via ComboBoxInit(). To avoid such cases, let's initialize the current selection of the combobox with the front element of the settings vector whenever we detect an out of range value which is not declared in the vector.

To reproduce the issue, set "Renderer" to some sort of crazy value like 50 in the GSdx.ini file and it'll mess up the whole GSdx plugin dialog really bad. This patch prevents such undesirable behavior by simply selecting the front element in the vector when we read an unsupported value.
2017-02-01 11:29:38 +00:00
Gregory Hainaut 5751e38180 gsdx: use range loop instead of for_each 2017-01-30 17:58:39 +01:00
Gregory Hainaut cf71049bd4 gsdx tc: use unsigned constant
Help the compiler to generate better code

C code:
uint32 addr = (i >> 3u) % MAX_BLOCKS;
uint32 row = addr >> 5u;
uint32 col = 1 << (addr & 31u);

ASM Before
     f48:	mov    eax,esi
     f4a:	mov    ecx,esi
     f4c:	mov    edx,DWORD PTR [ebp+0x8]
     f4f:	sar    eax,0x1f
     f52:	sar    ecx,0x3
     f55:	shr    eax,0x12
     f58:	add    ecx,eax
     f5a:	and    ecx,0x3fff
     f60:	sub    ecx,eax
     f62:	mov    eax,0x1
     f67:	shl    eax,cl
     f69:	shr    ecx,0x5
     f6c:	lea    edx,[edx+ecx*4]

ASM After
     f48:	mov    ecx,edi
     f4a:	mov    eax,0x1
     f4f:	sar    ecx,0x3
     f52:	shl    eax,cl
     f54:	shr    ecx,0x3
     f57:	and    ecx,0x7fc
     f5d:	add    ecx,DWORD PTR [ebp+0x8]
2017-01-30 17:54:29 +01:00
Gregory Hainaut da054a2aab gsdx: remove useless debug log 2017-01-30 17:54:21 +01:00
Gregory Hainaut 09b8aaed71 gsdx tc: extend the wrap option to the texture cache 2017-01-30 17:54:07 +01:00
Akash bf10873405 GSdx: Remove useless check and add debug messages
IsEnabled() check is already done in GetDisplayRect, so it's pointless to do it here. Also updated a debug message in the GetFrameRect() function.
2017-01-30 15:29:28 +01:00
Akash a2cdcb4e4d GSdx-PCRTC: Improve output circuit selection
Previously, the auto output circuit selection of the GSdx wasn't good, it simply defaulted to the second output circuit even when the first output circuit is also enabled. The new algorithm for auto selecting returns the merged rectangle dimensions when both of the output circuits are enabled and if the condition for merge is not satisfied then it returns the bigger output circuit.
2017-01-30 15:29:28 +01:00
Gregory Hainaut bccc3ef253 Merge pull request #1770 from np511/gcc-cleanup
Cleanup GCC warnings - still needs some work
2017-01-30 15:28:33 +01:00
np511 e5e601eb75 Use GResources API instead of deprecated inline 2017-01-29 09:06:22 -05:00
np511 936d9edc4c Remove old/pointless code 2017-01-29 09:06:21 -05:00
np511 de6216b37b Remove warnings about ISO C++11 conformance 2017-01-29 09:06:10 -05:00
Gregory Hainaut 9393b20e13 Merge pull request #1791 from turtleli/remove-old-cdvd
Remove old cdvd plugins
2017-01-27 11:10:07 +01:00