Commit Graph

7234 Commits

Author SHA1 Message Date
Miguel A. Colón Vélez f1cb2cfa35 Fix segmentation fault with the new libstdc++ ABI.
Local variable goes out of scope and everything goes boom.
2015-09-12 17:35:45 -04:00
micove 53680d538d Merge pull request #817 from micove/GIT_TZ
Fix git version detection.
2015-09-12 06:33:00 -04:00
Jonathan Li 5c6915f633 utilities: Simplify _aligned_malloc wrapper
Windows doesn't actually use it at all, so let's exclude it from the
VS build. Also include ScopedAlloc.h into the VS project file.
2015-09-12 10:01:04 +01:00
Jonathan Li 8312e21f00 utilities: Cleanup unused memcpy defines
All refer to memcpy, and only memcpy_fast is used, so there's no point
keeping them.

Also remove the _memset16_unaligned function prototype since there's no
function definition for it.
2015-09-12 10:00:49 +01:00
Jonathan Li 239306e9a2 pcsx2|gsdx:linux: Fix posix_memalign
The AddressSanitizer can be used on Linux again. Well, PCSX2 doesn't get
very far when it's used though.
2015-09-12 09:58:00 +01:00
Miguel A. Colón Vélez 49072d6e02 Fix git version detection
- It currently fails to detect a 64bit git.
- It currently breaks with a TZ left of the Greenwich meridian.
- The output of git show -s can cause compilation errors pipe to NUL.
- Pipe the two can't find the git command error messages to NUL too.
2015-09-11 19:20:23 -04:00
Gregory Hainaut fc67e372d2 pcsx2:gui: fix potential infinite loop 2015-09-11 21:01:23 +02:00
Gregory Hainaut 0422854384 pcsx2:interpreter: always false condition
Both fields are 10 bits but the ~ operation apply on the 32 bits.
Therefore msb bits were always '1' and the condition always false.

Code is only used on the interpreter but it could explain some hangs
2015-09-11 20:01:01 +02:00
Gregory Hainaut bfe1236d98 pcsx2|lilypad: Unintentional integer overflow
Add some cast to do the intermediate operation in 64 bits
2015-09-11 16:50:02 +02:00
Gregory Hainaut 0a7eed686c Merge pull request #763 from PCSX2/gsdx-texture-format
Gsdx improves texture format setup
2015-09-11 14:44:31 +02:00
Gregory Hainaut cee0fde940 gsdx-tc: improve support of TEXA register
* Greatly reduce the number of clut read (factor 10x)
* Avoid to get wrong TEXA texture in the cache.
* Fix "jump depends on uninitialized variable" Valgrind warning.

Fix #748

I try my best to avoid any breakage of DX but please test it too.
2015-09-11 14:16:11 +02:00
Gregory Hainaut 78569ee833 gsdx-ogl: redo properly the setup of texture format
* add lengthly comment to explain the format
* Likely reduce the number of shader permutation
* Avoid slow AEM (on GPU)

Expect regressions because TC needs some fixes

v2: fix palette mode
2015-09-11 14:14:22 +02:00
Gregory Hainaut 6c7ce3465e pcsx2:CDVD: guarantee that index of mg_zones array is below than 8
CID 146917 (#1 of 1): Untrusted array index read (TAINTED_SCALAR)
tainted_data: Using tainted variable cdvd.Result[1] as an index into an array mg_zones
2015-09-11 09:25:09 +02:00
Gregory Hainaut 8928c3e7f1 onepad: be sure pad variable is 0 or 1
CID 146918 (#1 of 1): Use of untrusted scalar value (TAINTED_SCALAR)
tainted_data: Passing tainted variable pad to a tainted sink
2015-09-11 09:18:49 +02:00
Gregory Hainaut 113c0aa411 pcsx2: use sizeof of object instead of pointer (portability)
CID 146912 (#1 of 1): Sizeof not portable (SIZEOF_MISMATCH)
suspicious_sizeof: Passing argument recConstBuf of type u32 * and argument 131072U /* RECCONSTBUF_SIZE * sizeof (recConstBuf) */ to function memset is suspicious. In this case, sizeof (u32 *) is equal to sizeof (u32), but this is not a portable assumption.
2015-09-11 08:54:29 +02:00
Gregory Hainaut 2430abed33 gsdx: potential division by zero
CID 146833 (#2-1 of 2): Division or modulo by zero (DIVIDE_BY_ZERO)
divide_by_zero: In expression this->m_width / this->m_upscale_multiplier, division by expression this->m_upscale_multiplier which may be zero has undefined behavior.
2015-09-11 08:54:29 +02:00
Gregory Hainaut e6d1a4cccf gsdx: avoid a potential division by zero
CID 146835 (#1 of 1): Division or modulo by float zero (DIVIDE_BY_ZERO)
50. divide_by_zero: In expression (float)(end - start) / (float)frame_number, division by expression frame_number which may be zero has undefined behavior
2015-09-11 08:54:29 +02:00
Gregory Hainaut 2934a15902 gsdx: remove a duplicated check 2015-09-11 08:54:29 +02:00
Gregory Hainaut f092f9045c pcsx2: initialize the block pointer
There is a check on it on the resize function
2015-09-11 08:54:29 +02:00
Gregory Hainaut ac8f4e69d6 pcsx2|gsdx: avoid potential null deferencement 2015-09-11 08:54:29 +02:00
Gregory Hainaut 0260c9119e common: suspicious missing comma 2015-09-11 08:54:29 +02:00
Gregory Hainaut 1baa6be6de debugger: enforce a null terminated char of a C-string
CID 146728 (#1 of 1): Buffer not null terminated (BUFFER_SIZE_WARNING)
buffer_size_warning: Calling strncpy with a maximum size argument of 128 bytes on destination array mod.name of size 128 bytes might leave the destination string unterminated
2015-09-11 08:52:05 +02:00
Gregory Hainaut b082147c4d onepad: avoid potential resource leak 2015-09-10 14:21:27 +02:00
Gregory Hainaut f4f08b9c99 pcsx2: avoid couple of out-of-bounds access 2015-09-10 14:20:51 +02:00
Gregory Hainaut c687c73edd pcsx2:debugger: avoid strlen call on random data 2015-09-10 13:46:36 +02:00
Gregory Hainaut 0bcaff4214 pcsx2:cdvd/debug: various uninitialized data
Most of the time, code is correct. In doubt always init the value.
2015-09-10 13:45:42 +02:00
Gregory Hainaut 5e8f899620 pcsx2:debug: miss a break that lead to a mem leak 2015-09-10 13:42:23 +02:00
Gregory Hainaut 5c933a7faf pcsx2:gzip: free the index
Normally index will be NULL if len is 0 but it won't hurt
2015-09-10 13:41:22 +02:00
Gregory Hainaut 8b2de15096 build: add an option to build a coverity DB 2015-09-10 13:40:45 +02:00
refractionpcsx2 2a8bae187f Merge pull request #811 from micove/GSdx_Debug
Rename Release/Debug SSE2 to Release/Debug.
2015-09-09 23:28:05 +01:00
Miguel A. Colón Vélez 26e2b4a5be Rename Release/Debug SSE2 to Release/Debug. 2015-09-08 23:17:07 -04:00
Jonathan Li d8a7bfd438 gui: Adjust mainframe size and status bar position
There are a few odd things with Windows and the background logo.
1. The windows containing the logo is smaller than the logo.
2. The fitting algorithm doesn't work at 200% DPI.

Both make no sense, but can apparently be worked around.
2015-09-08 18:47:45 +01:00
Jonathan Li bcc125ceb6 gui:windows: Implement image DPI scaling
This should reproduce the old non-DPI aware pre-wxWidgets 3.0 behaviour
for the main dialogs, except the font rendering should be better.

And add comments that I should have already added but didn't.
2015-09-08 18:47:44 +01:00
Jonathan Li 59ffed85ba gui: Fix image list scaling
The listbook images aren't rescaled unless the embedded icons are used.
Make sure all the images are correctly rescaled.
2015-09-08 18:27:48 +01:00
Jonathan Li 5cf94e5a15 gui: Allow screenshot icon to be themed.
The logo and all the other icons can apparently be themed (though
theming is a bit broken). Let's allow the camera screenshot to be
themed as well.
2015-09-08 18:27:48 +01:00
Jonathan Li 2263961d4d gui: Simplify and rework EmbeddedImage class
The wxImage Scale/Rescale methods with wxIMAGE_QUALITY_HIGH upsamples
and downsamples using the bicubic and box resampling methods
respectively, so let's just use that instead of the ResampleBox method,
which is undocumentated and probably shouldn't be used.

The Rescale function also modified the image when it was not supposed
to. Fix it, and rename it scale to avoid confusion with the wxWidgets
class.
2015-09-08 18:27:48 +01:00
Gregory Hainaut ddc03cbccf gsdx: add a nice enum to replace the hardcoded convert shader 2015-09-08 16:51:24 +02:00
Gregory Hainaut 1ae0fed83b gsdx: fix a regression due to the shader renaming 2015-09-08 16:06:15 +02:00
Gregory Hainaut 81e056e79a gsdx: always enable the boost queue
ifdef was for VS2010

GSThread.h is useless. I keep it for the transactional queue implementation
2015-09-08 14:43:09 +02:00
Gregory Hainaut 3706cfe908 gsdx: always enable CXX11 mutex feature.
ifdef was only useful for VS2010
2015-09-08 14:34:17 +02:00
Gregory Hainaut ca9b5ce11d gsdx-ogl: move depth conversion shader
Add 2 new shaders:
* ps_main12: cast a 16 bit depth to a RGB5A1 color
* ps_main16: cast a a RGB5A1 color to a 16 bit depth

Shader might be used in future commit as it seems Silent Hill uses this
kind of format.

Fix tab/indentation too
2015-09-08 12:41:05 +02:00
Gregory Hainaut 4eed4ca3a1 gsdx-debug: restore 16 bit dump format in the SW renderer
Actually dump both 32/16 bits (former for texture shuffle and later
for real 16 bits RT)
2015-09-08 12:41:05 +02:00
Jonathan Li 9d4a8688c1 Merge pull request #801 from turtleli/windows-left-list-icons
Have listbook icons (Emulation Settings, Plugin BIOS selector) on the left for all platforms.
Don't set minimum widths for Framelimiter and Frameskip panels.
2015-09-07 08:46:49 +01:00
Jonathan Li 1d2d8cd38b gui: Don't set min widths for Framelimiter/skip panels
It causes weird behaviour at higher DPIs.
2015-09-07 08:26:20 +01:00
Jonathan Li 5e9ba64db8 gui: Have listbook icons on left for all platforms
On Windows, this fixes the minimise/restore weird dialog bug on the
Emulation Settings and Plugin/BIOS selector dialogs. It also fixes a bug
at high DPI, where it becomes difficult to click on GUI elements at the
top of the dialog.

It also makes it easier for me to work on the Windows DPI stuff, I don't
have a 4k monitor.
2015-09-07 08:25:56 +01:00
Jonathan Li ca0aeb8e62 Windows: Avoid lockup for RuntimeError exception
This is the same problem that the Plugin Open and BIOS load exceptions
had - The message box pops up, intercepts the hide event for GSFrame and
leaves you with no alternative but to terminate PCSX2 via the Task
Manager.

The same solution applies - Close the GSFrame first.
2015-09-06 20:36:19 +01:00
Jonathan Li d87b34ab36 gui: Increase presets message width
This prevents clipping at 200% DPI on Windows.
2015-09-05 23:10:15 +01:00
Jonathan Li e2f1bafeef gui:windows: Fix tooltip wrapping
wxWidgets 3.0 now wraps tooltips automatically on Windows, so the custom
tooltip wrapping functionality is no longer necessary.
2015-09-04 22:54:11 +01:00
Jonathan Li 31a505768d gui: Use SetSizerAndFit after dialogs are constructed.
It seems to fix the button UI problem for Linux wx3.0 builds.
2015-09-04 17:58:25 +01:00
Jonathan Li 9052930ebc Merge pull request #791 from turtleli/gsdx-gui-changes
Add tooltips to Windows GUI. Fixes #578.
Rearrange Window GSdx GUI a bit.
Reformat tooltip descriptions to be both Linux and Windows (un)friendly.
Add new tooltip descriptions.
2015-09-03 22:49:41 +01:00