Commit Graph

53 Commits

Author SHA1 Message Date
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 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
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
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
Juha Laukkanen 7edf747e84 Darwin/OSX Mutex & MAP_ANON vs. MAP_ANONYMOUS.
OSX compilation fix: mutex: Windows
2015-12-02 05:00:23 +02: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
Jonathan Li 618ef8b549 pcsx2:linux: Use narrow characters for stdout
Things seem to break when you mix wide and narrow characters.

Plugins messages sent to stdout are now viewable.
2015-10-29 19:09:49 +00:00
Gregory Hainaut 2eb73644e9 pcsx2|common: use DESTRUCTOR_CATCHALL to catch exception in various destructor
Allow to print a nice error message instead of a brutal abort in case of
massive failure
2015-09-23 09:47:27 +02:00
Gregory Hainaut 87bcb465c6 common: fix gcc 5.0 issue
Don't use const for variable object

Close issue #560
2015-05-27 18:20:06 +02: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
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
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 e99540554a wx3.0: clang complains about support of reference in varargs 2014-08-03 14:43:08 +02:00
Gregory Hainaut fded22e1b3 wx3.0: extend logger to support wxString as input
Note: only enabled it on 2.8 for windows (because of UTF8 linux is fine)
2014-07-29 20:45:44 +02:00
Jake.Stine c396684e07 * Fix a bug that prevented devel/verbose console logs from being logged in Release builds.
* Switch microVU's cache logs to DevCon (verbose only).  TODO: Make a vuPerfLog for them someday.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3841 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-09-26 17:41:57 +00:00
Jake.Stine 1cac8d3948 * Added subdivided content to the u128 type (changed it from a struct to a union, added _u32[4], _u16[8], etc).
* Added ToString methods to the u128 type.
* Bugfixes for the FastFormat string utilities, namely when writing UTF8 content via the UTF16 formatter.
* MSVC: Removed obsolete disabling of unsigned/signed mismatch warning (4018)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3703 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-08-31 05:14:00 +00:00
Jake.Stine 91851c6222 Trace Logging:
* Cleaned up trace logging and switched from C++ initializers to C-style const arrays.  Kinda mixed on which I like better, but decided to go with the general rule of thumb that a bit less C++ weirdness is probably a good thing.
 * Removed __assume() feature from pxFail and pxFailDev, due to the likeliness of unwanted/unexpected compiler behavior (MSVC only).  To hint the compiler that code should be unreachable, explicitly use pxAssume(false).

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3643 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-08-16 15:01:13 +00:00
arcum42 e4eec943de Get rid of extraneous line breaks on the console output(Linux).
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3638 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-08-13 19:35:32 +00:00
Jake.Stine 8375b0a989 Refactoring:
* Added __fi and __ri, which are abbreviations for __forceinline and __releaseinline.
 * Added some static qualifiers to functions in mVU, MMI ops, and others where appropriate.
 * Removed some unnecessary __fastcall qualifiers (since GCC gets funny sometimes when you combine __fastcall and inlining).
 * Made _1mb, _16mb, _1gb values common to all emulation code (moved from newVif/mvu to Common.h) -- they're useful! :)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3624 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-08-09 04:10:38 +00:00
Jake.Stine 912872af80 Introducing a mostly revamped Tracelog and Console log system. Various console log sources can now be toggled on/off on the fly, allowing end users to enable more verbose logging when they encounter problems. Both console and trace sources can be given automatic prefixing.
DevNotes:  DevCon logs are now available in *Release* builds as well as Devel builds, and can be enabled from the Console window's "Sources" menu.  They are disabled by default in Release builds, and are always enabled regardless of the ini setting in devel builds.  Debug logs are still strictly available in debug builds only.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3609 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-08-06 05:46:09 +00:00
Jake.Stine e5f87e068b Changed the FastFormatString functions into nifty little classes that use TLS for their buffer workspaces. Result: a fully concurrent printf with zero malloc/free overhead. Use the pxsFmt macro for them -- which is a fully working alternative to wxsFormat().
(pxsFmt has been applied to console/logging only for now.  Will apply it to more later, once the code is confirmed stable)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3596 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-08-03 22:18:19 +00:00
Jake.Stine ff1db14f9d Converted the GameDB to use wxWidgets classes.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3188 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-06-09 17:37:11 +00:00
Jake.Stine 6fdb282c81 UI:
* Major bugfix to the startup/user path settings code (should fix issues some people were having when trying to run multiple copies of pcsx2 from different folders).
 * Various bugfixes to panel appearances
 * Win32: "stdio" console output now redirects to theVisual Studio Debug Output window, since Stdout is generally useless on windows.

Emulation:
 * Removed the IOP SIF hack since it never did what I was hoping it would do anyway.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3176 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-06-06 04:17:43 +00:00
Jake.Stine f7a30c3291 More work on memorycards, and general UI adjustments. Some things with the dialogs might be a bit broken-ish. Will finish this up properly soon. :)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3047 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-05-20 12:23:13 +00:00
Jake.Stine 70d47bf240 Copyright 2010 : PCSX2 and plugins! (notable exception: didn't update copyright info in any Gabest plugins)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2937 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-05-03 14:08:02 +00:00
Jake.Stine 5d37925617 Major UI renovations!
* Added versioning info to savestates! (along with some other bugfixes)
 * Simplified the Boot and System menus -- removed the old Skip BIOS hack and replaced it with the new BOOT2 injection method (which is considered hack-free at this time).
 * Removed lots of UI deadlock gotchas.
 * Some new confirmation dialogs and better error handling.
 * Implemented an exclusive SysExecutor thread, which serves the purpose of executing system/VM commands and events in uninterrupted order (including suspend, resume, savestates, etc.)



 * ... and probably broke linux!

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2911 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-04-27 13:12:03 +00:00
sudonim1 4457fe40fc Removed all trailing whitespace in *.c *.cpp *.h because it irritates me.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2897 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-04-25 00:31:27 +00:00
Jake.Stine 9473e69b7f Thread Local Storage Fixes:
* Implemented TlsVariable, a nifty alternative to __threadlocal, suitable for archaic operating systems that don't have native TLS support (namely Mac OS/X).
 * Added a forced reference to TLS in AppInit so that TLS is sure to be available to DLLs (otherwise windows doesn't init TLS by default).
 * Disabled TLS support in the x86emitter by default, since it's looking increasingly like we won't find a use for multithreading PS2 sub-components (can be re-enabled later if spontaneous brilliance at a later date proves me wrong).

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2396 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-12-24 22:22:34 +00:00
Jake.Stine ba473e0a7f * Redid console logging to use stdout instead of the buffered queue (probably less buggy).
* Removed some hacks from cpuDetectInit's use of cpuId.
 * Improved assertion checking for thread affinity.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2327 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-12-07 22:43:16 +00:00
Jake.Stine 1dced84153 Linux compilation fixes and fix some signed/unsigned stuff in IsoReader.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2217 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-11-18 16:53:44 +00:00
Jake.Stine 0068ec9cd0 Removed NULL-able DoWrite/DoWriteLn in IConsoleWriter (threaded logging crashed when changing writers on the fly).
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2200 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-11-16 03:23:59 +00:00
Jake.Stine a4baab103f Mode console logging updates and additions;
* Added support for indentation, as a replacement for using \t  (options include methods SetIndent and Indent, and a ConsoleIndentScope class for scoped indentation of a block of WriteLns.)
 * Use of Indent() as a modifier (the abstraction optionally allows use of indentation methods besides \t, if ever needed).
 * Minor header file cleanups: wxWidgets standard headers are now always first in PrecompiledHeader.h files (is recommended due to cross platform setup code by wx).

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2198 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-11-15 06:26:55 +00:00
arcum42 4f6fab781b Expand the color list a bit, muck with the Linux color console code, and change a few ifs to a case statement.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2192 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-11-12 14:52:29 +00:00
Jake.Stine a06803d263 Avoid use of wxString in globals, unless really necessary (C++ global/static object initializers on "complex" objects that do resource management can lead to wonky inter-dependency nightmares, plus this more efficient anyways ;)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2161 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-11-08 05:00:28 +00:00
arcum42 0ade7b5bd0 Minor fix for my last commit.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2160 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-11-08 04:42:24 +00:00
arcum42 190f66186f Change the console functions so that the terminal actually has colored text in Linux. (And doesn't have blue underlined text for most of FFX...)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2159 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-11-08 04:32:15 +00:00
Jake.Stine 04c86ea6d3 Console logging performance tweaks, disable the unused GIFtag register log (it's been tested enough and documented), and add extra calls to GSchangeSaveState (affects zerogs/zzogl only).
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2134 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-11-05 19:32:27 +00:00
Jake.Stine bc2aa38aa1 Implemented ELF loading! :D
Renamed a bunch of functions/methods in the Threading namespace that have been bugging me for a while.  (MutexLock is renamed to Mutex, Lock() is renamed to Aquire(), etc)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2102 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-31 19:18:29 +00:00
Jake.Stine 7d458d583c Revamped some console log stuff.
* Added more colors!
 * VM's EE/IOP logs (the ones that come from the emulated games themselves) are colored accordingly: EE are faint cyan, IOP are faint yellow.  They're intentionally "hard to read" because 99% of the time they're meaningless trivia (but still cool since it's what the actual devs would have used for developing the games!).

Dev Notes:
 * Removed Console.Status (specify blue/green colors manually if you want them).
 * Renamed Console.Notice to Console.Warning.
 * I changed the overloads so that both char* and wxChar* versions work like printf now (no need to use wxsFormat when working with unicode strings).  I also removed wxString& versions of the overloads.  This should (I hope) also be an easier port to wx2.9 or 3.0, when that time comes.
 * Default log color is now black instead of gray; typically you'll want to manually specify Color_Gray when doing high volume logging (like the EErec's block tracking in debug builds).

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2091 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-29 13:32:40 +00:00
Jake.Stine 1f2daa6459 User Interface:
* Fixed and added better Emulation/System menu updating.  Suspend/Resume is more consistent, and Reset grays itself out after being used.
 * Entering plugin configurations auto-suspends the emulator.
 * Changing plugins in the Configuration PAnel takes effect now without a restart.
 * Added preliminary support for an ExtensibleConfirmation Dialog box (contains a sizer you can add content to, and also has an optional "[x] Do not show this again" checkbox).

Bugfixes:
 * Added some mutex protection to cdvdNewDiskCB; "just in case."
 * Resolved several recursion and deadlock scenarios when (very!) rapidly suspending, resuming, and resetting the emu.

Developments / Code Cleanups:
 * Renamed SysCoreThread ExecutionModes:  Suspend/Resume are now Opened/Closed (which more accurately reflects the fact they opena nd close the plugins, and helps avoid ambiguity with the "Paused" state).
 * Added Exception::ThreadTimedOut, which is now thrown from Semaphore::Wait when recursive wxApp::Yield() calls are detected, and a deadlock occurs (basically cancels the current action which, most of the time, allows for full recovery).
 * Major Threading namespace cleanups, documentations, etc.
 * Removed wxScopedArray (scopedarray.h) and replaced it with a better implemeneted ScopedArray class.
 * Removed toUTF8 class, which I only added a couple weeks ago because I didn't realize wxCharBuffer had an implicit typecast to (char*).
 * Implemented more Source/Listener events for Pcsx2App.  CoreThread events are sourced properly now, and added SettingsApplied and SettingsLoadSave Sources.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2010 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-16 03:58:29 +00:00
Jake.Stine 5cf69e328d Minor cleanups -- removed unnecessary "using namespace std;" declares, etc.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1988 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-08 19:37:28 +00:00
Jake.Stine eda5d1d834 Savestates work! Not much else does yet (settings, etc), but at least this monkey's off my back. I can work on tying up more loose ends now. :)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1975 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-07 19:20:11 +00:00
Jake.Stine eff929cf09 Minor buildsystem changes (remove some warnings and add function level linking option to all 3rdparty libs)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1966 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-05 14:40:46 +00:00
Jake.Stine 653d09e821 Lots of new code maintenance stuffs:
* Completely new assertion macros: pxAssert, pxAssertMsg, and pxFail, pxAssertDev (both which default to using a message).  These replace *all* wxASSERT, DevAssert, and jASSUME varieties of macros.  New macros borrow the best of all assertion worlds: MSVCRT, wxASSERT, and AtlAssume. :)
 * Rewrote the Console namespace as a structure called IConsoleWriter, and created several varieties of ConsoleWriters for handling different states of log and console availability (should help reduce overhead of console logging nicely).
 * More improvements to the PersistentThread model, using safely interlocked "Do*" style callbacks for starting and cleaning up threads.
 * Fixed console logs so that they're readable in Win32 notepad again (the log writer adds CRs to naked LFs).
 * Added AppInit.cpp -- contains constructor, destructor, OnInit, and command line parsing mess.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1950 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-04 08:27:27 +00:00
Jake.Stine c9c924fe35 Yay, craploads of fixups for the new gui:
* Lots of crashfixes and threading rules compliance (like using wxYield instead of ProcessPendingEvents)
 * Killed off some memory corruption
 * Better error handling and reporting
 * Much speedier suspend/resume during emulation
 * Revamped entire savestate system to use a RIFF-style file format (untested, will work on it soon)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1832 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-09-16 17:23:02 +00:00
Jake.Stine 7f0039d646 Two more lockup fixes, and changing plugins takes effect without restarting now. :)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1801 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-09-09 16:52:11 +00:00
Jake.Stine d2fbb22076 Upgraded PCSX2 core and utilities to GPLv3.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1783 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-09-08 12:08:10 +00:00
Jake.Stine 3b10771c36 Got rid of that old 'params' mess on console logs. Not needed anymore since wxwidgets has nicer built in formatting options (never liked it anyway)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1782 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-09-08 05:37:40 +00:00