Commit Graph

10348 Commits

Author SHA1 Message Date
Gregory Hainaut cc68776069 pcsx2: manually cast function pointer to void*
Templace is nicer but give a hard time to compiler.

New version compile in both gcc&clang without hack

v2: add an uptr cast too for VS2013 sigh...
v3: use an ugly function pointer cast to please VS2013
2016-08-17 09:53:30 +02:00
Jonathan Li d36002a02a gsdx:cmake: Use PNG_LIBRARIES instead of PNG_LIBRARY
PNG_LIBRARIES adds both libpng and zlib to the command line.
PNG_LIBRARY only adds libpng to the linker command line, and the cmake
documentation also suggests not to use it.
2016-08-16 20:35:21 +01:00
IlDucci fa5effafcd Updating Spanish translation
Added the new shortcut identifiers. Warning: Some strings are shown in
English.
2016-08-16 13:40:09 +02:00
Gregory Hainaut fa249a3f78 gsdx ogl: don't rely on the Z value in m_vt
Value seems wrongly rounded and you can't distinguish 0xFFFF from 0xFFFE

Instead check that depth is constant for the draw call and the value from the vertex buffer

Fix recent regression on GTA (and likely various games)
2016-08-16 07:30:52 +02:00
FlatOutPS2 c8f6d68d68 PCSX2: IPU end of video freeze fix
Fixes end of video freeze in Enthusia - Professional Racing.
2016-08-15 19:48:21 +02:00
Gregory Hainaut 44bbdbe49d common: use free directly instead of an Alloc(0)
Easier to understand the intent. And avoid false positive in coverity
2016-08-15 15:51:22 +02:00
Gregory Hainaut 252c043409 Merge pull request #1518 from PCSX2/pcsx2-high-level-fopen
Pcsx2 high level fopen
2016-08-15 15:41:27 +02:00
Pseudonym 07e21427b9 When PS1 loading was enabled, someone neglected to check that allowing the function to continue wouldn't cause any problems.
Fixes #1515
2016-08-15 14:23:43 +01:00
Gregory Hainaut 0f1c10230a CDVD: catch MEC/NVM file exception
It will stop the emulation and open a nice box with an error message instead of terminate PCSX2
2016-08-15 14:09:01 +02:00
Gregory Hainaut deb7121fde CDVD: Use wxFFile API to handle MEC file too
again nicer, exception safe, less compilation warning :)

v2:
* check file is properly opened in write mode
* only print an error when result is bad
2016-08-15 13:08:54 +02:00
Gregory Hainaut 534e01e2d6 CDVD: Use wxFFile API to handle NVM file
Nicer, exception safe, less compilation warning :)

v2: check fp is properly open in write mode
2016-08-15 13:06:34 +02:00
Gregory Hainaut 5c7e2432bd gsdx-ogl: improve alpha test for GTA vice city (letters)
I don't understand why but it seems depth is rounded down even in 16 bits.
So uses 0xFFFE to enable ate_all_color_then_depth in 16 bits format too :)
2016-08-15 11:38:07 +02:00
Gregory Hainaut 5fbf702500 gsdx ogl: new optimization to bypass the alpha test
In FB_ONLY mode the alpha test impacts (discard) only the depth value.
If there is no depth buffer, we don't care about depth write. So alpha
test is useless and we can do the draw with a single draw call and no program
switch
2016-08-15 11:35:24 +02:00
Gregory Hainaut b62859ffa2 gsdx ogl: only enable the alternate alpha test in FB_ONLY
RGB_ONLY requires to handle the alpha channel in the alpha test
2016-08-15 11:25:19 +02:00
Gregory Hainaut 2700f06fe7 Merge branch 'pcsx2-verbose-thread-error' 2016-08-14 22:31:28 +02:00
Gregory Hainaut 63ec74ebea build: remove most of the bashism
Various distribution still ship the true old shell to win 1 second at startup.
Besides, bash syntax is no way better

Not fully tested, some bashism might remain for some options but at least you can
do a standard build
2016-08-14 22:29:12 +02:00
Gregory Hainaut 9d8135cf1c x86emitter: allow strict aliasing optimization 2016-08-14 21:01:40 +02:00
Gregory Hainaut 2cc98191f0 common: allow strict aliasing optimization 2016-08-14 21:01:40 +02:00
Gregory Hainaut 0417a10483 gsdx: allow strict aliasing optimization 2016-08-14 21:01:40 +02:00
Gregory Hainaut 2e7fab7813 gsdx sw: avoid aliasing issue, clear function was wrong anyway
Value must be un-normalized. Function is only used with 0.0 so
API was updated to only use the 0 case.
2016-08-14 21:01:09 +02:00
Gregory Hainaut ef7530af29 microVU: fix aliasing issue
Union is safer for the compiler
2016-08-14 20:49:12 +02:00
Gregory Hainaut e8e66ec4b5 x86emitter: use memcpy to avoid aliasing issue
Code is only called once anyway.
2016-08-14 20:48:45 +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 cc15a9480b clang format: disable vertical alignment
Avoid issue of bad alignment on some versions
To reduce change impact
2016-08-14 20:47:36 +02:00
Gregory Hainaut 447e0d0336 Merge pull request #1514 from PCSX2/gsdx-nouveau-driver
Gsdx alpha test improvement
2016-08-14 20:29:09 +02:00
Gregory Hainaut 15db7eeb81 gsdx: use correct format in printf
u => unsigned
d => signed

zu => size_t
2016-08-13 12:48:35 +02:00
Gregory Hainaut 0a1454ff6c gsdx: use prefix increment operator for non-primitive type
I think compiler is clever enough to optimize the code but it won't hurt
and it reduces the number of cpp check warning.
2016-08-12 23:11:26 +02:00
Gregory Hainaut dc2864ad7a gsdx hw: avoid a null deferenced false-positive in coverity
It is a false positive because it supposes that PRIM->TME is both true and false.

It is the first Schrodinger's variable ;)
2016-08-12 23:02:06 +02:00
Gregory Hainaut 2d2fdd6e44 debugger: remove useless null check
It is done too late.
CID 168625 (#1 of 1): Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking this->cpu suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
2016-08-12 22:57:09 +02:00
Gregory Hainaut f38cd9d80d onepad: add a missing break when CMD_CONFIG_MODE is true but configuration isn't enabled.
I hope it wasn't done on purpose.

CID 168624 (#1 of 1): Missing break in switch (MISSING_BREAK)
unterminated_case: The case for value CMD_CONFIG_MODE is not terminated by a 'break' statement.
2016-08-12 22:55:19 +02:00
Gregory Hainaut 1a09712f89 gsdx: init m_custom_width/height to a default value
Avoid useless warning on coverity
2016-08-12 22:48:20 +02:00
Gregory Hainaut c41cf6c444 gsdx: init variable in constructor
CID 168626 (#1 of 1): Uninitialized scalar field
uninit_member: Non-static class member m_end_block is not initialized in this constructor nor in any functions that it calls.
2016-08-12 22:45:17 +02:00
Gregory Hainaut 39bf84a13c onepad: don't duplicate the "GamePad" base class code/member in the "JoystickInfo" derivated class 2016-08-12 22:37:37 +02:00
Gregory Hainaut 2d8a0dc59c onepad: fix a couple of ccpcheck warning
Yes I know formating suck
2016-08-12 22:36:17 +02:00
Gregory Hainaut 61eddca39d clang format: preliminary support
Add a .clang-format example file. Might need minor tuning. If people doesn't like the syntax

Add a basic script to validate current change is compliant with clang-format
* on master it will test last 20 commits
* on branch it will test all commits of the branch

Idea is to plug it into travis (might require clang 3.8). Everything is blacklisted. Use "ALL" parameters
to test all standard directories.
2016-08-12 20:28:00 +02:00
Gregory Hainaut 8fe65ec371 cmake: add -Wextra warning on GCC
Add 3 new warnings (first one must be fixed I think)

pcsx2/gui/MessageBoxes.cpp: In copy constructor ‘BaseMessageBoxEvent::BaseMessageBoxEvent(const BaseMessageBoxEvent&)’:
pcsx2/gui/MessageBoxes.cpp:62:1: warning: base class ‘class pxActionEvent’ should be explicitly initialized in the copy constructor [-Wextra]
 BaseMessageBoxEvent::BaseMessageBoxEvent( const BaseMessageBoxEvent& event )

plugins/GSdx/GSPng.cpp: In function ‘bool GSPng::SaveFile(const string&, GSPng::Format, uint8*, uint8*, int, int, int, int, bool, bool)’:
/home/gregory/playstation/emulateur/pcsx2_merge/plugins/GSdx/GSPng.cpp:64:14: warning: variable ‘success’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Wclobbered]
         bool success = false;
              ^
plugins/GSdx/GSPng.cpp:44:58: warning: argument ‘image’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Wclobbered]
     bool SaveFile(const string& file, Format fmt, uint8* image, uint8* row,
2016-08-12 19:30:14 +02:00
Gregory Hainaut 24ff2482a4 pcsx2: break when switch value is CoreThread_Indeterminate
Fix another GCC warning
2016-08-12 19:30:14 +02:00
Gregory Hainaut 6f64fc9f84 pcsx2: don't compare pointer with 0 2016-08-12 19:30:14 +02:00
Gregory Hainaut 41afd85a5d gsdx sw: fix GCC warning enumeral and non-enumeral type in conditional expression 2016-08-12 19:30:14 +02:00
Gregory Hainaut 5ad4cbace7 onepad|common: fix GCC warning type limit 2016-08-12 19:30:14 +02:00
Gregory Hainaut 88b7470c07 gsdx: use const qualifier to avoid gcc (false positive) warning
variable  might be clobbered by ‘longjmp’ or ‘vfork’

Only remains warning for 2 variables: success & image
2016-08-12 19:30:14 +02:00
Gregory Hainaut f28ab4c280 pcsx2: gcc warning sign compare 2016-08-12 19:30:14 +02:00
Gregory Hainaut 214253c579 pcsx2: properly init structure with the { } pattern
Remove also 2 unused variables

GCC warning is still disabled as it generates lots of false positive. GCC5 and later will improve the situation

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36750
2016-08-12 19:30:14 +02:00
ramapcsx2 823670e4c5 Merge pull request #1513 from trostboot/g3mcfix
GameDB: Fix Grandia III MemCardFilter
2016-08-12 18:05:58 +02:00
trostboot 276bd01fcc GameDB: Fix Grandia III MemCardFilter
MemCardFilter for Grandia III NTSC-U Disc 2 was applied to the wrong
game. The serials for Disc 1 and 2 are SLUS-21334 and SLUS-21345,
respectively - I assume someone fatfingered when issuing the serials.
2016-08-12 16:12:39 +02:00
Gregory Hainaut 19e992869a Merge pull request #1512 from PCSX2/gsdx-dynamic-thread-height
gsdx sw: add extrathreads_height to control the quantity of pixels pr…
2016-08-12 15:52:13 +02:00
Gregory Hainaut 078577c7c5 common: try to print a nice error message when pthread_create is bad 2016-08-12 10:05:14 +02:00
Gregory Hainaut 332ef5892b gsdx: replace hardcoded constant with nice enum 2016-08-11 22:30:34 +02:00
Gregory Hainaut 8b94320524 gsdx ogl: implement another algo to handle alpha test
Fix rendering issue on letters on Kengo/burnout 3/...

Default algo will execute the alpha test in 2 passes. However due to blending
you can't handle accurately the color.

Fortunately for us, the rendering uses an always pass depth test so you
can execute first all the color rendering (which doesn't depends on the alpha test)
And then the depth part which depends on the alpha test.
2016-08-11 21:15:17 +02:00
Gregory Hainaut 866173a481 gsdx ogl: move zbuffer emulation code into a dedicated function
* Code was factorized a bit with the help of max_z
* Add an extra optimization if test is ZTST_GEQUAL and min z value is
the biggest value. Z test will always be pass.
Note: due to float rounding (23 bits mantissa vs 24 bits depth) the test
is done against 0xFF_FFFE and not 0xFF_FFFF. It is wrong but GPU will
also use float so impact will be null.
2016-08-11 21:14:58 +02:00