Commit Graph

343 Commits

Author SHA1 Message Date
Clang Format 1fba5cb580 reformat main common directory
Disable some reformat around emitter registers declaration and a massive cases.
2016-11-12 16:52:49 +01:00
Jonathan Li c9a1097579 console: Remove buffered and wxerror console writers
Both haven't been used for a long time, and don't seem to hold any
advantages over the default stdout console writer.
2016-08-17 22:07:42 +01: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
Jonathan Li ac7e7a79c3 utilities:windows: Remove memset32 assembly
It's unused, and it doesn't compile in 64 bits.
2016-07-23 02:21:21 +01:00
Gregory Hainaut 7d35e15fea Merge pull request #1444 from PCSX2/atomic-relax
Atomic relax
2016-07-22 18:36:02 +02:00
Gregory Hainaut e872552fdc spu2x|common: s/jASSUME/pxAssume/ allow to remove code and __debugbreak intrinsic 2016-07-17 10:24:29 +02:00
Gregory Hainaut 10ea05bc6f common: remove old atomic wrapper
Use cross-platform std::atomic instead
2016-07-14 18:29:41 +02:00
Gregory Hainaut ca46921796 MTVU: use acquire/release semantics for atomic operation
* Avoid the generation of memory barrier (mfence)
* Based on the fact that it used to work on previous code without any
  barrier

v2:
* keep basic code in reset path
* use relaxed access for isBusy. The variable doesn't carry load/store
  dependency but is instead an hint to optimize semaphore post
2016-07-14 18:29:40 +02:00
Jonathan Li 79d019b5bb utilities: Don't use TLS buffers in FastFormatString classes (#1430)
The TLS buffers used by the FastFormatUnicode and FastFormatAscii
classes seem to be responsible for PCSX2 not terminating properly on
Windows under certain conditions (using MTVU before commit
1111e03901, using CDVDgigaherz without a
disc, possibly other conditions).

When PCSX2 shut downs and the FastFormatBuffers are being cleaned up,
the call to pthread_key_delete() would end up calling
WaitForSingleObject(e, INFINITE) and waiting indefinitely for an event
to trigger. It never does get triggered (for reasons unknown) and
therefore PCSX2 doesn't terminate properly.

Remove the usage of TLS buffers in the FastFormatString classes - it
fixes the termination issue on Windows and doesn't seem to have much
effect on performance.
2016-06-29 13:13:51 +01:00
Jonathan Li 3904c67e6e utilities: Use Bind instead of Connect 2016-06-17 00:03:58 +01:00
Jonathan Li c10728319b utilities: Use Bind compatible event declarations/definitions 2016-06-16 23:49:34 +01:00
Jonathan Li 7aa6564dcc common:freebsd: Fix compilation 2016-05-20 22:32:41 +01:00
Jonathan Li f78d1a4018 utilities: Remove wx2.8 code and uses of wxMAJOR_VERSION 2016-04-29 00:09:47 +01:00
Jonathan Li 5035c8bd48 utilities: always include wx/crt.h on Linux
The header is necessary if the wx3.0 package isn't compiled with
wx2.8 backwards compatibility.
2016-04-23 13:57:47 +01:00
Jonathan Li dda44519c1 pcsx2|utilities: Use non-deprecated wxFont stuff 2016-04-23 13:57:42 +01:00
Jonathan Li a487aaf952 Merge pull request #1232 from turtleli/nonxp-toolkit
windows: Switch to Non-XP compatible toolkits
2016-03-16 20:34:27 +00:00
Gregory Hainaut 0ef8ddb2a2 Merge pull request #924 from kust2708/onepad-gui
Onepad GUI for Linux - New wxWidget interface
2016-03-15 20:23:44 +01:00
Jonathan Li b516c1001a windows: Set _WIN32_WINNT to 0x0600 (Windows Vista) 2016-03-13 13:41:16 +00:00
Gregory Hainaut 610bf8a277 Common: delete most of the deprecated atomic API 2016-02-28 15:29:31 +01:00
Gregory Hainaut 5ca92ecd67 Common: port code to std::atomic 2016-02-28 15:29:31 +01:00
Gregory Hainaut ca8955daf3 MTVU: port ScopedLockBool to std::atomic 2016-02-28 15:29:31 +01:00
Gregory Hainaut 60fe26ff2f common:threading: Port NonblockingMutex to std::atomic_flag 2016-02-28 15:29:00 +01:00
Gregory Hainaut 89fad4d3ad common: port ScopedPtrMT to std::atomic
v2: s/NULL/nullptr/
v3: tentative fix for MSVC
// ScopedPtrMT.h(91, 0): error C2593: 'operator ==' is ambiguous
2016-02-28 15:29:00 +01:00
kust2708 823a37aed7 OnePad : New GUI based on gwWidget
Buttons done, configuration initialization done.
Still need to add Gamepad and Joysticks configuration frames.
Require png file for the moment (the embedded picture will be fixed after).

New Onepad GUI based on wxWidget (Main frame almost finish)
Background picture is now embedded
Button binding works
Loading and saving works
Need to add feedback and gamepad, joysticks configuration frame

Modification of the onepad CMakeList.txt
Automatic generation of images headers using perl script

Modification of the test feedback function
2016-02-14 17:26:31 +01:00
Jonathan Li e92636ab1a utilities: Remove ScopedPtr and pxObjPtr implementation
Both are now unused.
2016-02-08 22:31:45 +00:00
Jonathan Li a74677acf7 utilities: Convert ScopedPtr to unique_ptr 2016-02-08 22:31:45 +00:00
Jonathan Li 92bb849e7c Use unique_ptr instead of ScopedPtr for exceptions 2016-02-08 22:31:45 +00:00
Jonathan Li 115b14bc94 cdvd: Replace ScopedPtr with unique_ptr 2016-02-08 22:31:45 +00:00
Jonathan Li 3c7e45ccc8 utilities: Remove ScopedArray implementation
It's now unused.
2016-01-17 22:54:22 +00:00
Jonathan Li e8596f0430 pcsx2: Rearrange Console colour enum order
Preparation for next commit - The default isn't bold, so it's slightly
neater to have it at the start.
2016-01-17 22:06:32 +00:00
Gregory Hainaut 3c528f0fdd common define _32kb and _4kb 2016-01-11 18:00:25 +01:00
Gregory Hainaut 92d7639267 profiler: add functions to plug linux Perf Event on JIT
Basically it creates a /tmp/perf-`pid`.map file which will contains
a mapping of the x86 code with the EE/IOP/VU code

* You need to enable the profiler with a define
* You can split the profiling by block (inside a recomp buffer)

v2: add new file to VS xml files
v3: remove useless include
2016-01-10 13:42:59 +01:00
Gregory Hainaut 74db92bee4 Merge pull request #978 from juhalaukkanen/apple_osx_master_merge
OSX 32bit build
2016-01-08 20:09:37 +01:00
Juha Laukkanen fc3ff48777 Darwin/OSX SysMessage stub & __POSIX__ define. 2015-11-30 12:18:44 +02:00
Jonathan Li 52be531b8e utilities:windows: Use standard memset for memset_8
aka commit 2194685 for Windows
2015-11-29 11:46:59 +00:00
Gregory Hainaut 26774a2fe0 recompilers: always allocate the first block
Avoid several annoying SIGSEGV at startup
2015-11-12 10:35:10 +01:00
Gregory Hainaut 7565bcc789 ee: drop SpatialArrayReserve allocator
Let's the kernel manage the memory either with builtin lazy allocation or
swapped memory.

Avoid to handle SIGSEGV manually (nicer for debug) and removes 250 lines of code.
2015-11-12 10:35:10 +01:00
Jonathan Li 08dfa20da1 utilities:linux: Add function to change stdout stream
stdout is not necessarily at stdout - at least not after I'm done with it.
2015-10-31 13:50:02 +00:00
Gregory Hainaut 2194685d76 memset-linux: use std memset for memset_8
This memset is only used in the init (to clear the page that will
contains the dynarec dispatcher
2015-10-28 14:25:12 +01:00
Akash cfd02bff53 Utilities: Initialize all class members
CID 147010 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)4. uninit_member: Non-static class member Enabled is not initialized in this constructor nor in any functions that it calls.
2015-10-25 14:11:34 +05:30
Gregory Hainaut 4f86cca306 common: don't return a boolean for an assert
It might help to fix those 2 coverity reports.

CID 151744 (#1 of 1): Useless call (USELESS_CALL)
side_effect_free: Calling EnumAssert(id) is only useful for its return value, which is ignored

CID 151745 (#1 of 1): Useless call (USELESS_CALL)
side_effect_free: Calling EnumAssert(id) is only useful for its return value, which is ignored.
2015-10-17 11:49:04 +02:00
Gregory Hainaut 927dd827ce common: make DESTRUCTOR_CATCHALL macro really exception safe
Console.Error() can trigger some exceptions (like out of memory)

v2:
Add a default fallback catch(...) in case someone badly add a new
exception in the codebase
2015-09-25 18:41:19 +02:00
Gregory Hainaut 2c914b9b8f common:FastFormatString: remove unimplemented m_Length 2015-09-23 09:47:27 +02:00
Gregory Hainaut a6c29a5061 common: always set a default color in trace log 2015-09-23 09:47:27 +02:00
Gregory Hainaut 3064d0c300 common: init m_handled in the SrcType_PageFault constructor
Coverity:
CID 147021 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)i
2. uninit_member: Non-static class member m_handled is not initialized in this constructor nor in any functions that it calls.
2015-09-23 09:47:27 +02:00
Avi Halachmi (:avih) d10bbb73f7 FixedInt - round instead of truncate on construction
This could have caused issues where e.g. Fixed100(59.94) differed from
Fixed100::fromString("59.94") due to precision compilation flags
(the former could, and did on Devel builds, end up with Raw == 5993, which
differs from the value constructed from the string at the ini file,
and then it would be incorrectly identified as a custom rate).

Rounding seems the more likely intention when effectively decreasing the
precision of a value.

Unlikely that we have code which depends on truncating behavior, though not
impossible.
2015-09-17 00:30:08 +03:00
Jonathan Li 67dc65ea91 linux: Fix _aligned_realloc implementation
Out-of-bounds memory is no longer accessed if the realloc size is larger.
If reallocation fails, the old memory will not be freed and a memcpy
will not take place.

This should match the Windows _aligned_realloc behaviour, except that an
extra parameter is used.
2015-09-13 21:05:33 +01: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 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