Commit Graph

1031 Commits

Author SHA1 Message Date
Jonathan Li aee571e9b2 utilities: Split thread internal callback function
__try is used in pthread_cleanup_push when CLEANUP_SET is used as the
pthread cleanup model. That can't be used in functions with objects that
have destructors, so move it into a separate function.

Prevents compile errors on non-release Windows builds if other things in
the internal callback function change.
2019-10-07 01:39:32 +01:00
orbea d943870413 common: Fix build error with clang 9. (#3123)
clang 9 now provides _rotr and _rotl.
2019-09-29 20:30:47 +01:00
arcum42 7679dcf469 clang: Get rid of a number of warnings. I don't need pages of warnings that things clearly marked in the code as deprecated are deprecated, and I doubt I'll be worrying about those overloaded functions any time soon. 2019-08-23 14:40:33 -07:00
arcum42 ed6ac00186
onepad-legacy: Use mt_queue, and move it from onepad to common. (#3060) 2019-08-10 15:46:29 -07:00
arcum42 441e786d3d Take care of a few clang warnings. 2019-07-06 14:16:04 -07:00
Shanoah Alkire de1717c1a1 Switch a bunch of 64 bit #ifdef's to use the cross-platform 64-bit define I added into Pcsx2Defs.h. 2019-06-18 22:08:43 -07:00
arcum42 563772fdf1 Added a universal 64-bit define, and a message indicating that Pcsx2 was compiled as 64 bit in the system information. 2019-06-16 17:33:17 -07:00
Shanoah Alkire 2941fd9b87 wx: Replace a bunch of wx 2.8 macros with the wx 3.x versions. 2019-05-11 20:43:47 -07:00
Shanoah Alkire 5d4ae31ba1 Add a few default functions in explicitly. (-Wdeprecated-copy) 2019-05-11 19:18:18 -07:00
lightningterror 6905d4d883 x86emitter: Purge empty file sse_helpers.h.
Code was removed in
60a9463e7a
Right now it's useless.
Update VS/cmake project files to remove any mentions of the file as
well.
2019-02-18 11:51:06 +01:00
Shanoah Alkire 1b41d19016 Remove the unused 'incomplete and untested' BaseTaskThread class. 2019-01-10 13:13:20 -08:00
arcum42 d05163a26f
Remove gigaherz old wip 'new' iopdma code. (#2703)
* Remove gigaherz old wip new iopdma code.

* Second pass removing dma code I missed last time.
2018-12-09 18:00:04 -08:00
arcum42 2e1db411fa GSdx: Folder Reorganization. (#2657)
This pull request is for the pending reorganization of the folder structure on GSdx,
making it better organized and easier to work with.

Also remove unused GSTextureFX.cpp file.
2018-11-16 19:41:37 +01:00
Shanoah Alkire 122871654e Expand out a define to get rid of a warning. Get rid of other compiler warnings. Re-indent so that it doesn't look like a statement is part of an if statement when it isn't. 2018-10-27 02:49:03 -07:00
Shanoah Alkire 7641d6726f New helper include for gtk for use in plugins. Mostly based on the gtk 2/3 helper functions I added to spu2-x for the moment. 2018-10-02 01:20:54 -07:00
Jonathan Li a977f1e6c1 pcsx2|utilities; Revert ambiguous wxString related commits
This reverts
93d5b52df3
f3e78b8267
55155ca7f1.

Unfortunately wxString stuff is a PITA to deal with. Breaks FreeBSD
compile, but there are probably more issues that just haven't been
reported yet...
2018-09-04 21:57:27 +01:00
Jonathan Li 55155ca7f1 utilities: Fix compile when using --enable-stl wxWidgets builds
Regression introduced in 93d5b52df3.
2018-09-03 20:30:14 +01:00
Jonathan Li f3e78b8267 utilities: Split thread internal callback function
__try is used in pthread_cleanup_push when CLEANUP_SEH is used as the
pthread cleanup model. That can't be used in functions with objects
that have destructors, so move it into a separate function.

Fixes a non-release build compile error on Windows. Regression was
introduced in 93d5b52df3.
2018-09-03 20:30:14 +01:00
Jonathan Li 93d5b52df3 pcsx2|utilities: Remove ambiguous wxString-related overloads
Avoid some function overloads that can accept char*, wxChar* and
wxString as a parameter. wxString can be constructed with either of
those parameters, so the function overloads may actually result in
ambiguity errors. Keep the wxString parameter versions and remove the
rest.

Fixes some compile errors on FreeBSD.
2018-09-03 01:56:35 +01:00
Jonathan Li fcda371f9a utilities: Remove HashMap
It's now unused.
2018-08-29 22:26:09 +01:00
Jonathan Li 890d7ab953 utilities: Restrict pxWindowAndFlag templates to wxObject derived classes
Fixes a compile error (C2666) on VS2017 15.8 caused by ambiguity issues.
The sstream header uses

constexpr auto _both = ios_base::in | ios_base::out;

Without the extra type restrictions the compiler cannot tell whether to
use the template or the built-in | operator (the const wxSizerFlags &
parameter will accept ints).
2018-08-17 22:37:39 +01:00
Jonathan Li e8ed18feba common: Use GCC's _xgetbv definition from GCC 8.2 onwards
The _xgetbv bug was fixed, so avoid using our own definition (again).
2018-08-12 18:07:13 +01:00
Jonathan Li c9dbd4118b misc-plugins:windows: Fix ini/log path issues
Fixes some issues with opening ini/log files when the path contains
characters that are not present in the current codepage for the
following plugins:
SPU2-X
LilyPad
cdvdGigaherz
Dev9null
USBnull
FWnull
2018-07-23 00:51:02 +01:00
Jonathan Li 27d0995a8b common: Add plugin compatibility file
Adds a helper function for converting UTF-8 to UTF-16 on Windows. Also
adds a fopen wrapper function for pathnames that may contain characters
that are not present in the current Windows codepage.
2018-07-23 00:51:02 +01:00
Jonathan Li 9d4f8a322c common: Add common null plugin config code
This adds code that allows modifying the log options via the GUI
(Windows, Linux) and also saving and loading the log options in a
reusable form.
2018-07-12 01:05:09 +01:00
Jonathan Li 43f461cc36 common: Remove PluginNullAbout
It's unused.
2018-07-12 01:05:09 +01:00
Jonathan Li fa7822fbbf common: Call va_end after vfprintf in PluginLog
The C spec states that the va_arg argument value is indeterminate after
returning from vfprintf. va_end and va_start must be called before the
variable is reused.
2018-06-22 01:20:40 +01:00
Jonathan Li 171e7f016d common: Work around GCC8 _xgetbv bug
clang and earlier GCC versions do not provide the _xgetbv intrinsic.
GCC8 does, but unfortunately it's broken.
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85684).

Re-use our _xgetbv implementation to avoid the bug, but rename it to
avoid compilation errors as well.
2018-05-12 12:05:20 +01:00
Jonathan Li 15efe69e46 common: Fix multiple _xgetbv() error on GCC 8
GCC 8 now provides _xgetbv, so avoid using our own definition in that
case.
2018-05-06 00:52:47 +01:00
Jonathan Li 629bb23832 utilities: Fix CheckedStaticBox behaviour
Avoid enabling the child windows when SetValue is called if the window
is currently disabled.

Also continue processing the checkbox event after it has been handled,
which allows the event to propagate to the parent window.
2018-02-28 01:19:12 +00:00
Huud 4e3730f8f4 Utilities: Fix subtraction operation function in FixedInt class (#2313) 2018-02-20 15:39:34 +05:30
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 7a71b6f3d0 Flag XP as an unsupported OS. 2017-12-02 23:47:08 +00: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
Gregory Hainaut 36fd2b6854 gsdx: remove the unused GSsetFrameLimit API 2017-07-02 15:09:47 +02:00
Gregory Hainaut bc0b1a78e5 common: workaround to start ASAN with recent glibc
Issue: wait of the semaphore timedout. However semaphore was properly posted
counter is 1.

To workaround the issue, only throw an error if semaphore counter is 0.
Note: I reduced the timeout to 100ms by threads to avoid huge startup delay

Close #1939
2017-05-16 09:20:35 +02:00
Gregory Hainaut 02861fabc8 pcsx2|common: replace throw() by noexcept 2017-05-13 10:38:35 +02:00
Gregory Hainaut 1a9a65d4d0 common: use = default instead of trivial destructor
Strangely clang-tidy didn't report them.

Commit was done with a sed to it need careful review.
2017-05-13 10:38:35 +02:00
Gregory Hainaut b951e24024 common: remove throw specifier on destructor
By default in C++11 destructors are noexcept.
Besides throw is deprecated
2017-05-13 10:38:35 +02:00
Gregory Hainaut 94b50b85e7 core: use = default instead of trivial copy constructor 2017-05-13 10:38:35 +02:00
Gregory Hainaut 9e101c9ef0 common: use = default instead of trivial constructor/destructor
reported by clang-tidy

Note: drop throw() specifier as it is the 'default' in C++11 for
destructor
2017-05-13 10:38:35 +02:00
Gregory Hainaut b9e62be3c1 modernize: use std::make_unique instead of std::unique_ptr
I didn't update GSdx and cdvdGigaherz because we need to pull
common include files
2017-05-03 12:03:38 +02:00
Gregory Hainaut 756176118b common: add make_unique for C++11
v2: fix windows compilation
v3: fix copyright date
2017-05-03 12:03:38 +02:00
Gregory Hainaut a378e307b3 common: drop pthread TLS emulation
thread_local is supported by all C++11 compliant compiler

Keep a way to disable TLS for shared object to avoid issue of DTV
slot shortage.
2017-04-14 17:18:20 +02:00
KousukeItsagame 11aebe465f common: Replace __threadlocal with C++11 thread_local 2017-04-13 19:59:00 +02: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 23d081ab21 common: remove an old gcc workaround 2017-02-01 18:24:51 +01:00
Gregory Hainaut 6d7b1f9dbd common: move ssappendf in DisR59000asm.cpp
Legacy function to print EE opcode. It doesn't worth an extra file.
2017-02-01 18:24:51 +01:00
Gregory Hainaut 965fccaff0 common: use C++11 version vssappendf
* use std::vector instead of VLA
* remove windows code (optimization is useless here)
2017-02-01 18:24:51 +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 de6216b37b Remove warnings about ISO C++11 conformance 2017-01-29 09:06:10 -05:00
Gregory Hainaut 6f9feee759 common: init m_vtune_id 2017-01-22 16:45:49 +01:00
Gregory Hainaut e3d1871f86 MTVU: small thread scheduling improvement
* Use yield to avoid a spin loop during WAIT
* Don't flush the full buffer when we miss space
2017-01-18 19:11:10 +01:00
Jason Brown fce2814735 Added callbacks for OSD Log and Monitor. Added wrappers in PCSX2 main for callbacks. Added some basic info calls (e.g. Saving loading FPS) 2017-01-03 10:43:56 +01:00
Gregory Hainaut 632b4971de common: remove memset duplicates
Use standard memset instead of memset_8

Move memzero/memset8 in a common OS file.
2016-12-16 20:45:22 +01:00
Jonathan Li 415090d249 common: Avoid wchar_t in pxTextWrapper
wchar_t is 16-bits on Windows, which can't actually properly fit all
Unicode characters.

Use the wx3.0.x wxTextWrapper approach of using iterators that increment
by actual characters to fix the issue, and also switch to using the
std::string style functions in wxString.
2016-12-10 22:30:27 +00:00
Akash b86518ef24 CDVD: Convert CDVD_SourceType into enum class
* Add a template function for underlying type conversions of enumerations
2016-12-10 12:35:57 +00:00
Gregory Hainaut 031b6e6372 common: improve vtune merge support
Mapping the full buffer is killer on Vtune (either crash or requires a huge processing time).
Instead keep the same ID for code in the same buffers.

I think all buffers are correctly mapped now but I still miss the frame pointer
for VU code.
2016-12-09 09:28:19 +01:00
Gregory Hainaut b9369e7c00 pcsx2: remove the reserve feature of recompiler memory
Cons:
* requires ~180MB of physical memory (virtual memory is the same so it
  doesn't impact the 4GB limit)

From steam: 98.81% got at least 2GB of RAM. 83.62% got at least 4GB of RAM.
That being said, it might not really increase RAM requirements as OS could put the
new allocation in the swap.

Pro:
* code is much easier
* remove at least half of the signal listener
* last but not least, it is way easier for profiler/debugger
2016-12-09 09:28:19 +01:00
Gregory Hainaut 0453e5cad8 cmake: improve vtune integration
Year is included in the path so search in order 2018/2017/2016

Not ideal but at least all logic is inside the FindVtune module
2016-12-09 09:28:19 +01:00
Gregory Hainaut f41bb8db5e common: forget to format common properly
Moral of the story, don't rely on the commit hook when it isn't installed correctly ;)
2016-11-29 22:59:06 +01:00
Gregory Hainaut 310181b97f common: remove a gcc 4.6 hack
Not supported anymore
2016-11-29 22:59:06 +01:00
Gregory Hainaut c9db1c6c4b vtune: plug PCSX2 core + add missing profiling (VU/VIF/TLB)
Doesn't fully work yet
* Unknown stack frame
* Outside any known module

Potential root cause:
* Nvidia driver
* VU code as ebp is required for emulation so likely no frame
2016-11-28 19:07:04 +01:00
Jonathan Li 008fea5d89 common|cdvdgigaherz: Fix API sign mismatch
The typedef and function declaration don't quite match.
2016-11-22 21:26:41 +01:00
Gregory Hainaut 30a5922a0b pcsx2: reduce std padding to 1 for small screen 2016-11-19 21:52:08 +01:00
Gregory Hainaut 0e2ec9c2cb pcsx2 gui: reduce the padding to 2 for low cost display 2016-11-19 11:27:20 +01:00
Gregory Hainaut 9c598fcd01 common: finally spot the text size bug
GetBestWrappedSize (hence the BestSize) computes the size of
the wrapped text based on box side minus padding.

So the width of the widget is already the good size for text wrapping
2016-11-19 11:21:07 +01:00
Gregory Hainaut 4ee942aba2 pcsx2 gui: use pxGetFixedFont helper instead of wxFont constructor 2016-11-19 11:19:24 +01:00
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
Gregory Hainaut 5596f69c0e pcsx2 gui: use git desribe as version name
Shorter than date and give all the useful info

Require windows test

close #1043
2016-11-08 22:44:39 +01:00
Gregory Hainaut b282909c9e common: avoid silly compiler warning due to define redefinition
comma was updated in plugings (due to clang reformat)
2016-09-08 19:20:24 +02:00
Gregory Hainaut 1a8825b374 pcsx2|common|gsdx: use empty() instead of .size() ==/!= 0 check
Enhance readability reported by clang tidy
2016-08-21 17:20:13 +02: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 bf0e5dc5bd Merge pull request #1516 from PCSX2/emitter-manual-void-cast
pcsx2: manually cast function pointer to void*
2016-08-17 18:56:55 +02:00
Gregory Hainaut 19ceea4f1e Merge branch 'strict-aliasing' 2016-08-17 18:53:08 +02:00
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
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 2700f06fe7 Merge branch 'pcsx2-verbose-thread-error' 2016-08-14 22:31:28 +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 e8e66ec4b5 x86emitter: use memcpy to avoid aliasing issue
Code is only called once anyway.
2016-08-14 20:48:45 +02:00
Gregory Hainaut 5ad4cbace7 onepad|common: fix GCC warning type limit 2016-08-12 19:30:14 +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
Jonathan Li af60501fb6 windows: Remove unused solution files and property sheets
The solution files are unused and for ancient Visual Studio versions -
GSDumpGUI has its own solution file, and bin2cpp is included in the main
solution file.

The property sheets have either fallen out of use or were never used in
the first place.
2016-08-04 23:09:08 +01:00
Jonathan Li ed47dca8a1 x86emitter:windows: Make cpu detection/affinity 64-bit compatible
Use DWORD_PTR since that works on both 32-bit and 64-bit builds. And
remove some empty unused functions.

Fixes a 64-bit compilation issue.
2016-07-24 19:05:18 +01:00
Jonathan Li f04dfe43a8 utilities:windows: Restrict memcmp_mmx to 32-bits
Fixes a 64-bit compilation issue.
2016-07-23 10:52:09 +01: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
Jonathan Li 768ed80ece utilities:threading:windows: Use intrinsic pause
Fixes a 64-bit compile error.
2016-07-23 02:21:13 +01:00
Gregory Hainaut 5cf2688c0c common: remove useless x86_intrin.h
Yeah one less licence in the project :)
2016-07-22 18:47:51 +02:00
Gregory Hainaut 7d35e15fea Merge pull request #1444 from PCSX2/atomic-relax
Atomic relax
2016-07-22 18:36:02 +02:00
Jonathan Li f8605dda61 common|pcsx2: Tidy/standardise VS project
Combine all the different configurations together so the project files
are more generic and maintainable.

Also standardise the layout so all the project files will be similar and
all have the same standard elements (even if empty).

Add 64-bit configurations.
2016-07-19 23:25:12 +01:00
Jonathan Li 7277074d9e windows: Fix incremental linking property sheet
Don't use "-dbg" target suffix - both Devel and Debug builds use the
property sheet, so it's incorrect.

Also don't set optimise references to false - it's incompatible with
incremental linking and causes compile failures.
2016-07-19 23:25:12 +01:00
Lena 5a17b95901 x86_intrin.h: fix build using GCC (#1468)
__GNUG__ is not defined while compiling this file,
this causes the build to fail.

Replacing this with __GNUC__ fixes this.
2016-07-19 23:13:24 +01:00
Gregory Hainaut 6e306ee44f common: move _xgetbv with cpuid intrin
Besides, code comes from Gabest and not reactOS
2016-07-17 10:25:00 +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 c56ca4a0fa common: include cpuid.h on unix
I tested both clang and gcc.
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 812e41d578 common: relax atomic of m_IsBeingDeleted
Avoid the memory fence in the constructor
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
Akash 72661e7c16 PCSX2-Core: Clean up some warnings on MSVC
x86emitter : Convert variable type from u8 to bool.
recVTLB: Cast "sign" to bool to prevent a warning.
R5900OpcodeImpl: Cast all the values in array to u64 instead of s64.
2016-06-30 16:49:18 +05:30