Commit Graph

681 Commits

Author SHA1 Message Date
Gregory Hainaut 29ef99d2d1 windows build take3: revert previous commit
Use back _Interlocked* function
Use vol_t type for all variables that uses _Interlocked* function
    (so it is compatible with 64 bits)
2015-01-18 19:25:46 +01:00
Gregory Hainaut 6d4039cc85 More fix for windows (extend previous commit) 2015-01-18 13:08:47 +01:00
Gregory Hainaut 4cf1b6068f common: fix windows build (hopefully)
* Use threading wrapper for Mutex.cpp/wxHelpers.cpp
* Cast s32 to long on window

(not tested on windows ;) ping me if it still doesn't work)
2015-01-17 20:39:38 +01:00
Johannes Obermayr 149940ffda common: gcc can't inline a couple of function
=> "can never be inlined because it uses variable argument lists"
2015-01-16 20:57:09 +01:00
Gregory Hainaut 04ca7f4a2b common: 64 bits intrinsic fixes
long is 8B on linux. Replace it with s32
long long is always 8B but let's replace it with s64 so we are sure
2015-01-05 23:46:18 +01:00
Gregory Hainaut aba0a09816 pcsx2 64b: fix crash on string formating function
Call to vsnprintf update the gp_offset of the varargs (at least on x86_64 linux).
Therefore the 2nd call (because buffer was too small) uses out-of-memory arguments

We need to keep a local copy otherwise you will get an awful SIGSEV

Note: I'm sure we have same issue on plugins
2015-01-05 23:38:30 +01:00
Gregory Hainaut b24c76f12a SafeArray: add a null pointer check
Thanks @ghost for the report.

Close issue #327
2014-12-21 12:49:02 +01:00
Gregory Hainaut 0b77f93154 console: improve readability on consoles that have black backgrounds
Thanks Micove for the patch.

Close issue #383
2014-12-21 12:41:01 +01:00
Gregory Hainaut 66d7aa75e2 cmake: move -DNDEBUG to global option 2014-12-20 13:43:25 +01:00
Gregory Hainaut 768362852e pscx2: s/wxTrap/pxTrap/
wxTrap is only enabled on wxDebug build. pxTrap is always available. It is much nicer for debug on linux
2014-12-13 12:28:37 +01:00
Miguel A. Colón Vélez c7c8b70b22 Don't buffer the changes to the console colors.
After a Console.Write/Writeln that uses colors a call to
ConsoleColorScope::LeaveScope() is made to restore m_old_color. This
restoration command stays buffered until a full line is printed. In the
meantime any console message that happens will use the old coloring
and if the program happens to crash the console would keep using the
color of the last colored text that was printed.
2014-12-12 19:44:45 -05:00
Gregory Hainaut 35f26f00bc Merge pull request #386 from PCSX2/remove-tls
spu2x:zzogl: disable TLS
2014-12-11 09:55:17 +01:00
Gregory Hainaut cdd09a2616 gtk2: use a pointer as argument instead of g variable
Easier and compliant with gtk3
2014-12-10 22:09:21 +01:00
Gregory Hainaut a52f598369 spu2x:zzogl: disable TLS
builds an Utilies_NO_TLS.a archive of the common Utilities code. It replaces native TLS by a slower reimplementation

Rational: number of TLS slot is very limited by the GLIBc on linux. I hope it doesn't impact performance.
* Zzogl don't requires TLS AFAIK
* spu2x will likely use it for assertions only.

TLS exhaustion creates issue to dlopen plugins
    issue #384 : https://github.com/PCSX2/pcsx2/issues/384

But also for profiled build (-fprofile-generate)
    http://forums.pcsx2.net/Thread-WORKAROUND-build-with-fprofile-generate

If someone have a better idea, please raise your hand!
2014-12-08 22:26:46 +01:00
Gregory Hainaut 070dce4c83 Merge pull request #356 from PCSX2/issue-fixes
various bug-tracker fixes
2014-12-06 19:48:13 +01:00
Nicolas Hillegeer b259a46ab7 linux/threads: simplify timer code
Possibly also changes the semantics. According to the docs, it should now be
equal to the Windows code (up to accuracy issues, of course).

v2: done by gregory38

Fix miscalculation of time. Unit must be in 1s/GetThreadTicksPerSeconds(). (now us)

Factorize a bit GetCpuTime/GetThreadCpuTime

Note: results seems reasonables and mostly equivalent as before.
2014-11-24 23:31:32 +01:00
Gregory Hainaut 5d89454d25 wx: properly overwrite trait creation
The fix move the Pcsx2AppTraits definition from core to common part.
It allows to use it in wxAppWithHelpers::CreateTraits

fix issue #352
2014-11-22 18:51:05 +01:00
Gregory Hainaut 69e88ffed0 common: remove old memcpy implementation
PCSX2 used standard memcpy now (thanks to xsacha)
2014-11-04 09:20:47 +01:00
Gregory Hainaut 5b3f031654 cmake: fix commit f3a50a01a7
* link common with c lib (required for gold linker)
* fix the macro to properly set the library variable
  => use the variable instead to hardcoded value
2014-09-24 09:02:56 +02:00
Gregory Hainaut fd7b692d00 Merge pull request #251 from xsacha/memzero_ptr
Remove redundant memzero_ptr. All compilers use SSE implementation
2014-09-21 17:15:54 +02:00
Gregory Hainaut 47cafaaa7c windows build: fix typo introduced in bf7c29e4cd 2014-09-20 09:59:23 +02:00
Sacha bf7c29e4cd Disable memcmp_mmx for non-msvc compilers and 64-bit. Remove MemcpyFast.S (Linux). 2014-09-16 17:53:54 +10:00
Gregory Hainaut 27992b16c2 common: fix std type define on windows 2014-09-12 20:41:28 +02:00
ramapcsx2 98d22f8b2e Merge pull request #215 from xsacha/memcpy
Remove some slow, redundant memcpy implementations: memcpy_const/memcpy_...
2014-09-12 19:57:57 +02:00
Gregory Hainaut b9e6024fe9 Merge pull request #282 from xsacha/emitter-cleanup
common: Remove two unused files in emitter, inlines.inl and macros.h
2014-09-12 19:30:34 +02:00
Gregory Hainaut 2d4b6273f0 Merge pull request #276 from xsacha/defs-cleanup
pcsx2: require C99 standard for stdint
2014-09-12 19:24:08 +02:00
uyjulian f3a50a01a7 cmake: Use previous macros in CMakeLists.txt files
Gregory: add a c lib for zzogl-pg-cg replayer
2014-09-05 20:16:23 +02:00
Gregory Hainaut 80df352711 Merge pull request #211 from xsacha/intrinsics
Remove pre-gcc4.1.0 code and a bunch of functions that were never used.
2014-08-28 20:23:55 +02:00
Sacha 378556c0c2 Remove two unused files in emitter, inlines.inl and macros.h 2014-08-27 22:40:26 +10:00
Sacha b47a4da81f Use 64-bit compatible rdtsc for Linux. Remove some more intrin_x86 functions. 2014-08-27 18:49:44 +10:00
Sacha ad3b76c4d8 Remove all custom memcpy usage from core pcsx2 and remove memcpy_fast from plugins. 2014-08-27 13:45:23 +10:00
ramapcsx2 9168c344b1 Use generic memcpy from now on. Tests show generics are good enough now.
It should be a speedup even on modern CPUs.
2014-08-26 01:02:23 +02:00
Sacha 90e59b2704 Clean up the type defines in pcsx2.
The non-stdint fallback was not even working which shows that it was never used. No supported platform would not have stdint anyway.
Remove unused code and do not restrict types to Linux and MSVC. Was there a reason for this?
2014-08-25 16:16:34 +10:00
Sacha 999eb83de8 Remove unused _InterlockeD* functions. 2014-08-25 04:57:03 +10:00
Sacha 7a260c9885 Remove redundant memzero_ptr. All compilers use SSE implementation anyway. 2014-08-17 23:23:55 +10:00
Sacha f542c7232e Use __builtin_unreachable where possible for non-msvc 2014-08-15 14:43:52 +10:00
Sacha a3bc6a73a3 Remove some horrible old code.
Remove an assert define and instead use the static_assert that all compilers provide.
As an added bonus, assert messages\!
2014-08-13 13:55:32 +10:00
Sacha f0af6460a1 Remove pre-gcc4.1.0 code and a bunch of functions that were never used. 2014-08-13 13:08:19 +10:00
Ryan Houdek 3d37a6ce27 Removes the usage of __LINUX__ define
This is defined and set it a ton of different places.
It's checked in a whole lot more
Instead just use __linux__ like a real project should
2014-08-03 13:20:36 -05:00
Gregory Hainaut 82c7bcd761 wx3.0: compilation fix for arch linux
* Manually cast WxGetTranslation
* Accept string as format parameter of pxWindowTextWriter
* Manually convert wxString to wide string

Note: Wx setup.h is not the same between Debian and Arch. Unfortunately it
generated various compilations errors on wx code.

Close issue #172
2014-08-03 14:54:44 +02:00
Gregory Hainaut e99540554a wx3.0: clang complains about support of reference in varargs 2014-08-03 14:43:08 +02:00
Pseudonym 3e65c1d0a3 Just killing a couple of latin-1 characters my editor was complaining about. 2014-07-31 16:17:37 +01:00
Pseudonym e25ad9759a Merge pull request #178 from Sonicadvance1:x86_64-cpudetect
Support grabbing the MXCSR mask on x86_64.
2014-07-31 16:14:49 +01:00
Ryan Houdek 06ccc0121f Support grabbing the MXCSR mask on x86_64.
Instead of using some dynamic code to grab the FXSave information, use an intrinsic if on at least MSVC 2012.
With GCC just use a bit of ASM, and if on MSVC 2010 or older, use the old crappy method.

This method can be removed once MSVC 2010 support is dropped and mandate at least MSVC 2012 minimum.
2014-07-31 10:11:25 -05:00
Pseudonym 03bfffea23 Merge pulled request #174 from Sonicadvance1/x86_64-emitter-fixes
Fix a couple issues in the x86emitter on x86_64.
2014-07-31 15:43:35 +01:00
Ryan Houdek b4771030d3 Fix a couple issues in the x86emitter on x86_64.
This won't fix the billions of errors that will happen at runtime of using the x86 emitter, but chooses to make some better coding practice choices
that enables it to compile on x86_64.

in the xIndirectVoid class, instead of using s32 for the offset, use sptr which will be 32bit or 64bit depending on architecture.
This also fixes a few alignment issues in xAddressVoid's constructors.

In EmitSibMagic we are casting a void* to s32, which won't work on x86_64, so first do a cast from sptr to s32.
Won't work on x86_64, but gets us compiling.
2014-07-31 09:01:56 -05:00
Lioncash ac558afc8a Remove 'elif' define from Pcsx2Defs and microvu_misc.h 2014-07-30 23:44:04 -04:00
sudonim1 904f5de1ea Merge pull request #144 from Sonicadvance1/fix-BitScanFoward
Fix the BitScanForward implementations for x86_64.
2014-07-30 18:19:19 +01:00
Gregory Hainaut 6485bd89d9 common: drop remaining of HashMap
Ryan Houdek removes all use of this code.

Let's remove the left-overs too, beside it will removes the sparsehash depencency
2014-07-29 21:06:31 +02:00
Gregory Hainaut 76237955c7 wx3.0: fix various string printing on linux
wide-char must use %ls format on linux. Don't rely on non standard %s/%S
2014-07-29 20:45:44 +02:00