Technically it did work, but it was undefined behaviour. Use __cpuidex,
which allows setting ecx as well.
Also fix the _xgetbv intrinsic - I have no idea how PCSX2 even
compiled on Windows.
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.
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.
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.
The code was restoring the defaults with hardcoded values. This patch
restores the values however they're defined as defaults for AppConfig.
The code still uses hardcode values to set the highlights (bold) of the
default radio button text - using SetDefaultItem.
Note that other than these two panels, the speedhacks panel is the only other
which has a restore-defaults button, and it already does so programatically.
It's probably not worth trying to unify these three restore-defaults button
into a single system.
The dialog event handling is a bit messed up. An ok/cancel event sends a
close event, which sends a cancel event and repeats. This would actually
be an infinite loop if wxWidgets didn't detect a loop.
Rework the event handling to avoid the loop and to remember the
positions of modal dialogs as well.
Gregory: Get all changes but keep C11 code path which will be the future
(if someone can find info on Visual Studio support)
* Keep the old posix api to use address sanitizer on gcc 4.9
Conflicts:
common/build/Utilities/utilities.vcxproj.filters
common/build/Utilities/utilities_vs2012.vcxproj.filters
common/build/Utilities/utilities_vs2013.vcxproj.filters
common/include/Utilities/MemcpyFast.h
common/include/Utilities/StringHelpers.h
common/src/Utilities/AlignedMalloc.cpp
common/src/Utilities/vssprintf.cpp
plugins/GSdx/stdafx.cpp
there was already code for this, but it was broken due to:
- the message is WM_SYSCOMMAND and wParam is SC_SCREENSAVE etc.
- GSPanel doesn't get WM_SYSCOMMAND - GSFrame does.
- also disabled screen saver while paused if not set to hide the GS window.
- it's an ugly hack where windows keeps trying to activate the screen saver
every few seconds but such code prevents it (Lilypad has the same hack).
the new code uses windows API which was designed for this.
the screen saver is now disabled while the window is focused and the emulation
is running. it's on by defauly and without GUI - the same as with normal games.
this patch addresses Windows only, but adds a placeholder for future
implementations for other platforms.
Performance is not important here. I'm not sure Windows could handle VLA
* new/delete can still be used otherwise.
* Put an assert(0) because debugger surely don't use string bigger than
128 bytes.
code is much more compact 20 lines vs 700 lines ...
It was done to avoid issue with specific compiler flags. I think it is safe to reenable it now.
There are some flags that are still disabled that potentially could be re-enabled:
-fno-guess-branch-probability
-fno-dse
-fno-tree-dse
But it will be for another PR
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
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.
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!
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.
* 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
* 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
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.
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.
Fixed clang build.
Note from Gregory:
C++ requests that at least 1 parameters is a class, an enumeration, or a
reference to those objects. Probably to avoid to screw basic type operation.
For example: *p += 4;
The realy buggy code was this one because T could be an int!
template T
f(*ptr, T)
To avoid any issue in the future the Team decide to drop all overload that use pointers.
This doesn't change anything on x86_32, but it is required on x86_64 so we don't lose precision.
Also adds an assert to see if the distance is greater than the maximum 32bit jump, which can't be hit on x86_32, but can be on x86_64.
* Use c++11 static assert
* Properly cast to parameter template to u32 (help clang)
* Remove lots of useless ASM. Memset it only used with a size of 4096.
* check pthread_mutex_init status
This define takes a pointer(s8* in this case) and grabs 16bits of data from the array it points to.
This can be done the generic way on all compilers, no need for specifying it another way.
* avoid compilation failure when git -C isn't supported
* don't print missing dependency when EXTRA_PLUGINS isn't activated
* sed /endif(.*)/endif/ because I don't like it
* Fix some issue with the new debugger on linux
* Enable the previous tlb miss fix on the interpreter
* disable the building of po by default. It pollute too much my env.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5914 96395faa-99c1-11dd-bbfe-3dabce05a288
* use c++11 for pcsx2
* rename __rdtsc so I won't conflict with gnu version
* add a bunch of .data() method to get string data
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5913 96395faa-99c1-11dd-bbfe-3dabce05a288
Translators note: I save previous translation but a careful review is mandatory
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5366 96395faa-99c1-11dd-bbfe-3dabce05a288
* new dev option CMAKE_BUILD_PO: control regeneration of po file. By default true in release build
* Add a hack for multiarch version of wxwidget
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4951 96395faa-99c1-11dd-bbfe-3dabce05a288
onepad: properly connect the latest button
sdl: do not compile some useless files (which fail to compile on my system btw)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4879 96395faa-99c1-11dd-bbfe-3dabce05a288
Threading VU1 took a lot of rewrites and new code to make possible (MTGS, microVU, gifUnit...), but we finally got to the point where it was feasible, and now we've done it! (so now everyone can stop complaining that pcsx2 only takes advantages of 2 cores :p).
The speedups in the games that benefit from it are great if you have a cpu with 3+ cores (generally a 10~45% speedup), however games that are GS limited can be a slowdown (especially on dual core cpu's).
The option can be found in the speedhacks section as "MTVU (Multi-Threaded microVU1)". And when enabled it should should show the VU thread-time percentage on the title bar window (Like we currently do for EE/GS/UI threads).
It is listed as a speedhack because in order for threading VU1 to have been a speedup, we need to assume that games will not send gif packets containing Signal/Finish/Label commands from path 1 (vu1's xgkick). The good news is very-few games ever do this, so the compatibility of MTVU is very high (a game that does do this will likely hang).
Note: vs2010 builds and Linux builds need to be updated to include "MTVU.h" and "MTVU.cpp".
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4865 96395faa-99c1-11dd-bbfe-3dabce05a288
Pcsx2 now has a gifUnit class which acts like the ps2's gif and executes a single gif transfer at a time (and performs path arbitration according to priority and path3 slicing).
This new code is generally a speedup for most games. Particularly VU heavy games like GoW.
This revision breaks old saved state compatibility so don't update if you wish to keep playing with your old saved states.
Leave comments if this revision fixes or breaks anything...
Message to GS Plugin authors:
This new code now uses only 1 gif callback to transfer data to the gs plugin (GSgifTransfer).
pcsx2 also is garaunteed to send full GS primitives to the plugin. So you don't have to account for partial-transfers anymore.
Thanks goes out to shadowlady who tested around 500 games for me :D
Note 1: The old gif code is still in this revision, and can be enabled by the USE_OLD_GIF macro. The old code will be deleted soon.
Note 2: This revision also enables assertion dialogs in devel builds, and changed a lot of assume cases into assertions.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4821 96395faa-99c1-11dd-bbfe-3dabce05a288
cmake:
* disable fomit-frame-pointer which cause crash with gcc-4.6 (it was not enabled by default but now I'm sure people will not enable it ;) )
* Try harder to pick the 32bits configuration for wx in a 64bits environment (opensuse/fedora).
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4641 96395faa-99c1-11dd-bbfe-3dabce05a288
[0]: it needs gold linker, tuning parameter large-function-growth to 5000 and gcc-4.6.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4617 96395faa-99c1-11dd-bbfe-3dabce05a288
Details:
The major differences between install and portable modes should now be:
1. Portable mode doesn't use the registry at all.
2. Portable mode uses the folders inside pcsx2 folder as default (install mode has some default at "my documents").
3. Portable mode tries to save relative paths at the ini file where possible*.
Specifically, portable mode now allows to select custom folders for plugins, bios, etc via the standard UI, which allows using several portable pcsx2 folder sharing the same resources (bios, iso, memcards, etc).
* Relative paths where possible = the following sequence (thanks to pseudonym for the brilliant idea):
1. If the file/folder is inside pcsx2 folder, it's saved as completely relative (to pcsx2.exe)
2. Else, if the file/folder is at the same drive as pcsx2.exe, it's saved as absolute path without the drive letter (e.g. /ISO/...)
3. Else, saved as absolute path, including the drive letter (for linux, without drive letter naturally).
This allows to create a removable drive with (one or more) pcsx2 folder on it, configure all the files/folders to point to the same drive (ISOs, save states, etc), and then take this drive, plug it into another computer (where it will be assigned with a different drive letter), and everything will continue working.
Please test it if you can. Bugs here can be inconvenient...
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4507 96395faa-99c1-11dd-bbfe-3dabce05a288
* Translate more stuff in various place
* Fix issue with pot generation on linux namely empty string & quote in asm comment
* add missing key on generate_pot script. Note: it also updates the po files with latest pot modification
* regenerate new pot & po files.
Translator note: previous Tertiary pot miss half of the strings.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4359 96395faa-99c1-11dd-bbfe-3dabce05a288
* add/update various translation
* add a patch of Weimingzhi to fix wrapping issue on asian languages.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4280 96395faa-99c1-11dd-bbfe-3dabce05a288
* PCSX2 now splits settings into two files: pcsx2-ui.ini and pcsx2-vm.ini. The former is user interface clutter (window positions, confirmation dialogs, etc). The latter is virtual machine settings, speed hacks, game fixes, etc.
* Added support for PORTABLE INSTALLS!! Portable install is currently manually enabled by adding an empty "pcsx2-portable.ini" to the install location of PCSX2. Portable installs should run seamlessly from any flash drive, etc. (and will usually need Admin rights)
* PCSX2 install location and plugins folders are stored in the registry now (unless portable install is enabled, in which case no registry is used).
Notes:
* A button to enable portable installs from within PCSX2 is planned.
* NSIS installer will hopefully be upgraded to allow for a portable install option as well.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4198 96395faa-99c1-11dd-bbfe-3dabce05a288
* Moved VIF dynamic recompiler buffers to the recompilers section of PCSX2.
* Using RecompiledCodeReserve for the VIF SSE functions.
* Minor bugfixes to VirtualMemory class implementations.
* Improved error handling and error message display.
* [TODO] : implement a call to cpuShutdown() to clean up VIF unpack/SSE reserves.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4169 96395faa-99c1-11dd-bbfe-3dabce05a288
* A couple i18n fixes listed in Issue 915, relating to dialog message formatting for a couple specific messages.
DevNote:
* Added some missing operator+() stuff for the pxsFmt string formatter.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4160 96395faa-99c1-11dd-bbfe-3dabce05a288
* Finished up zipfile-style savestate implementation
* Simplified BaseSaveState class, and removed lots of now-unneeded code.
* Prepared the i18n stuff for a pcsx2_Dev.pot file (WIP), and sorted more stuff to pcsx2_Tertiary.pot.
git-svn-id: http://pcsx2.googlecode.com/svn/branches/wxSavestates@4091 96395faa-99c1-11dd-bbfe-3dabce05a288
* "Browse" option in recent iso menu should translate now.
* Dialogs and config panels remember their positions more reliably (when using X or alt-F4 to close PCSX2, for example).
* Preliminary language selector dialog (available in debug builds only). Will finish it up later.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4088 96395faa-99c1-11dd-bbfe-3dabce05a288
* Added logging of host operating system and physical ram to startup.
* Removed "PhysicalCores" stuff from both x86emitter and startup logs -- physical cores is losing its relevance with all the new AMD and Intel chip designs.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4048 96395faa-99c1-11dd-bbfe-3dabce05a288
* Basic savestate loading/saving working now (needs testing).
* No support for screenshots embedded into the savestate (yet).
git-svn-id: http://pcsx2.googlecode.com/svn/branches/wxSavestates@4043 96395faa-99c1-11dd-bbfe-3dabce05a288
* PCSX2 uses significantly less memory when starting.
* Overall memory use reduced (mildly for some games, significantly for most).
* EE and IOP main memory are now fixed at 0x20000000 and 0x24000000 -- useful when using external cheat apps.
* Properly implemented the 'Shutdown' menu option -- Shutdown now unloads the entire PS2 virtual machine and reduced PCSX2's memory footprint to bare minimums.
* Some more meaningful errors for when memory is a problem (out of memory, low virtual memory, etc).
* Bugfix for pxsFmt when formatting long/large strings (over 1k)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4029 96395faa-99c1-11dd-bbfe-3dabce05a288
* Removed some missing / obsolete files from codeblocks projects.
* Fixed a segfault on exit
* Implemented a platform-consistent pointer value string formatter (%p has no defined standard)
git-svn-id: http://pcsx2.googlecode.com/svn/branches/newHostVM@4026 96395faa-99c1-11dd-bbfe-3dabce05a288
* Applied the new RecompiledCodeReserve to the VIF recompilers (saves another 4-8mb of memory, depending on game).
* Fixed a bug in pxsFmt / FastFormatUnicode (string formatting).
* Final round of error handling cleanups.
(branch is basically ready for re-integration -- needs some testin for obvious/show stopping bugs, thanks!)
git-svn-id: http://pcsx2.googlecode.com/svn/branches/newHostVM@4025 96395faa-99c1-11dd-bbfe-3dabce05a288
* Preliminary implementation for the SpatialArrayReserve class, which will be used for recompiler lookup tables (large portions of these tables are never used by many games). Will put it to use and test it soon.
* Finished implementation of TryResize method for reservations, which will be used by PCSX2 if the operating system runs low on ram.
git-svn-id: http://pcsx2.googlecode.com/svn/branches/newHostVM@3992 96395faa-99c1-11dd-bbfe-3dabce05a288
* Moved profiler management to the RecompiledCodeReserve class.
* Improved error handling some more.
* Numerous minor cleanups.
git-svn-id: http://pcsx2.googlecode.com/svn/branches/newHostVM@3991 96395faa-99c1-11dd-bbfe-3dabce05a288