Commit Graph

42 Commits

Author SHA1 Message Date
Jake.Stine 376a2c94b1 Added some hourglass cursors for various things; renamed more Semaphore and Mutex APIs (I'm too indecisive >_<)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2109 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-11-01 09:27:16 +00:00
Jake.Stine e92e3fb4bb I speal gewd. (Aquire -> Acquire)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2103 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-31 19:25:46 +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 efc35405f8 Reorganized the exception/signal handlers, setjmp/longjmp, and SysCoreThread stuff:
* Exception/Signal handling now uses an EventSource, so that multiple handlers can be registered.  This is in preparation for (eventual) more complete MIPS TLB support in the VTLB memory model.
 * Improved code isolation, so that recompiler-specific code is primarily in iR5900-32.cpp (cleans up Counters.cpp and SysCoreThread.cpp)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2063 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-23 20:24:59 +00:00
Jake.Stine 54f8f33257 aligned_stack: Linux has never worked so well!
* made a workaround for some obscure GCC templating bug
 * Fixes the assert from PersistentThread when starting the emu

git-svn-id: http://pcsx2.googlecode.com/svn/branches/aligned_stack@2047 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-21 02:23:42 +00:00
Jake.Stine 00461fdac6 aligned_stack: synced with trunk, to bring in the new console code for additional testing under a (properly working!) linux.
git-svn-id: http://pcsx2.googlecode.com/svn/branches/aligned_stack@2046 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-21 01:25:55 +00:00
Jake.Stine 2cb8e571cd Second half of __unused removal -- comment out (remove) names on unused parameters as per the guidelines of some C guideline that all compilers adhere to (this suppresses the same warnings __unused used to suppress).
Minor cleanups to Counters/Gif.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2038 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-19 11:53:18 +00:00
arcum42 29e8fe94e9 Change a few project options and get rid of _unused.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2036 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-19 10:42:36 +00:00
Jake.Stine e3a5229076 aligned_stack branch progress!
* Implemented setjmp/longjmp method of escaping recompiled code, circumventing the deadly pitfalls of the g++ exception mess.
 * Use longjmp to jump to a "safe" location (outside recompiled code) for suspending and canceling the SysCoreThread (see StateThreadCheck_LongJmp)
 * I'm the stack daddy mack.  That's right.  Uh huh.  Uh huh.
 * Test for m_detached in PersistentThread::IsSelf, since Linux likes to recycle thread handles in a hurry (like, as in, consecutively)
 * Fix a deadlock in the Consoole Log (seems to be GTK+ specific, and in fact I'm pretty sure wxApp->Yield() isn't thread safe and thinks it's recursive even when it's not)

git-svn-id: http://pcsx2.googlecode.com/svn/branches/aligned_stack@2035 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-19 01:50:52 +00:00
Jake.Stine 6c631e009d Yet more thread sync fixes, mostly to do with rapid reset/resume/suspend/exit actions.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2030 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-18 12:30:00 +00:00
Jake.Stine 6b0c9cfdfe Added some missing semaphore/mutex resets, and bugfixed the emitter when using a certain type of complex indirect sddressing ( ie, ptr32[addr + (eax*4)] )
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2026 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-17 23:30:16 +00:00
Jake.Stine d69f6610e8 More threading improvements:
* Added TimedLock to MutexLock
 * Use MutexLock::TimedLock as a replacement for some sloppy semaphore use in SysCoreThread and PersistentThread.
 * Minor fixes to thread cleanup when exiting the App
 * Added some extra deadlock protection to the blocking Wait and Lock functions for Mutexes and Semaphores.
 * Moved MutexLock and Semaphore implementations into their own files.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2022 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-17 18:21:30 +00:00
Jake.Stine d2767da7b3 Fix release mode build compilation errors from the prev rev.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2011 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-16 04:23:56 +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 e8e61a5cf8 Settings work again!
* Switched the SysCoreThread to a static (fully persistent) thread.
 * Added some listeners for when the CoreThread status changes
 * fixed some slowness in savestates, and the emu will now stall until savestates complete, if you try to exit too quick (avoids savestate corruption)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1993 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-09 15:17:53 +00:00
Jake.Stine 46badcc0e8 Fixed a memory leak in the MutexLock object.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1984 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-08 18:30:40 +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 e1c89dacdb Bind the cdvd's newDiskCB properly when changing CDVD sources; and more jASSUME->pxAssert change-overs.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1953 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-04 15:34:40 +00:00
Jake.Stine db01c15977 Linux: Minor fixups!
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1952 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-04 09:00:07 +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 15d2824d1b (work in progress -- some of this stuff still doesn't quite work as it should)
* Rewrote Savestate code, fixed lots of stuff in PersistentThread, and renamed most "Emu"s to "Sys".
 * Removed wxScopedPtr and whipped up our own ScopedPtr that doesn't use boost's fail-style function names (and made it more thread-safe).
 * Handling exceptions across threads: Added Clone() and Rethrow() methods to BaseException, and added a Rethrow() to PersistentThread.
 * Go rid of AppInvoke macros (those were nasty!)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1929 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-09-29 19:16:00 +00:00
Jake.Stine aaa3b773c6 Improved MTGS (added better suspend/resume support), and work on savestates a bit (still not working tho)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1908 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-09-23 09:53:21 +00:00
Jake.Stine 39bd850f72 win32pthreads: Changed from _beginthreadex to CreateThread, which is the preferred method of creating threads when using dynamic CRT linking.
PCSX2/Win32:
 * Assigned names to the threads so that they show up nicely in the debugger.
 * Added more error checking in the new stdout/stderr PipeRedirection code, hopefully fixing Issue 422 (but can't reproduce the error here to be sure).

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1904 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-09-22 17:28:48 +00:00
arcum42 34af7c1281 Linux: IsRunning was crashing pcsx2. Also, jNO_DEFAULT isn't a good idea in these two spots.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1845 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-09-17 23:24:44 +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 8eb8f1bcea Emulation options (speedhacks, CPU, etc) should work now, and fixed a few memleaks on exit, and crash-on-close bugs caused by more mis-used pthreads timedwait parameters.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1800 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-09-09 14:08:15 +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 976d5ec539 * Implemented Skip Bios (settings still not saved tho)
* Fixed a bug in how I was (not) handling pthreads return codes.  It's errno you need to check, *not* the function's return value. ;)
 * Changed MTGS over to use the pthread_cleanup api.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1779 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-09-08 03:44:35 +00:00
Jake.Stine 50446e6930 * Added preliminary keyboard support back in (probably doesn't compile in linux)
* Fixed a deadlock in thread cancellation.
 * Muted some folder warnings when running pcsx2 for the first time.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1778 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-09-07 21:16:12 +00:00
Jake.Stine 9308d86ffc wxgui: Runs games. 'nuff said.
* Fixed some deadlock conditions by adding a message pump to semaphore waits ont he main/gui thread.
 * Many more config and init bugfixes.
 * Implemented most of the new Boot menu.

git-svn-id: http://pcsx2.googlecode.com/svn/branches/wxgui@1745 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-09-05 23:07:23 +00:00
arcum42 163efebb29 wxgui: Add in a missed check on the threading. Update the game fixes panel.
git-svn-id: http://pcsx2.googlecode.com/svn/branches/wxgui@1744 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-09-05 12:02:07 +00:00
Jake.Stine 93e1d87a22 wxgui: improve single-threaded plugin enumerator for Linux (still a bit buggy)
git-svn-id: http://pcsx2.googlecode.com/svn/branches/wxgui@1743 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-09-05 09:21:59 +00:00
Jake.Stine 64e43a9086 wxgui:
* Fixed thread classing so that detached pthreeads are handled safely, and so that virtual functions in C++ destructors are explicitly specified.
 * Added some helper functions to Pcsx2App for safely executing menu commands form any thread in the emu.
 * Fixed several minor bugs in settings / config handling.

git-svn-id: http://pcsx2.googlecode.com/svn/branches/wxgui@1730 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-09-03 11:59:05 +00:00
Jake.Stine 980afabc30 wxgui:
* Moved some files around in an attempt to improve CoreEmu and UI separation.
 * Major upgrade to the UI's handling of savestates
 * Maintenance work to the C++ exception handling
 * Some improved error handling and message popups here or there

git-svn-id: http://pcsx2.googlecode.com/svn/branches/wxgui@1714 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-08-31 03:47:05 +00:00
Jake.Stine 9303bc5bf2 wxgui: Prepped the R5900 recompiler for the new wxWidgets-enhanced dedicated emulation thread design, and removed the old boolean-based re-entrant event checking mess.
Note: Nearly have a successfully booting branch! (bios crashes when it reaches CDVD api callbacks, should be a simple fix but it'll have to wait until later >_<)

git-svn-id: http://pcsx2.googlecode.com/svn/branches/wxgui@1680 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-08-25 15:38:48 +00:00
Jake.Stine db3e81504e wxgui: The Linux side compiles and runs again. Note: Removed "Open in Explorer" buttons for folders since there seems no reliable way to do that in Linux.
git-svn-id: http://pcsx2.googlecode.com/svn/branches/wxgui@1661 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-08-20 23:05:26 +00:00
Jake.Stine c415d8d694 wxgui:
* Major cleanups and improvements to the Threading namespace.
 * Created CoreEmuThread class framework, which currently runs the EEcore, IOP, and VUs with threadsafe suspension, reset, and resume features.

git-svn-id: http://pcsx2.googlecode.com/svn/branches/wxgui@1624 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-08-15 06:17:43 +00:00
Jake.Stine 8505e4a7e7 wxgui: Added plugin selection dialog (complete with plugin enumeration and an exceedingly fancy progress bar), fixed some menus, added isofile recent lists, and lots more stuff is correctly saved and loaded from the configuration file.
* Dev note: Re-enabled USE_STL in wxWidgets since that's required to ensure thread safety.

git-svn-id: http://pcsx2.googlecode.com/svn/branches/wxgui@1505 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-07-14 06:18:52 +00:00
Jake.Stine fb6a8939b0 wxgui: Moved some more files around in Common/Utilities, and merged against trunk.
git-svn-id: http://pcsx2.googlecode.com/svn/branches/wxgui@1460 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-07-03 20:48:11 +00:00
Jake.Stine aceefaf812 wxGui branch: [linux] Updated projects, added Utilities and x86emitter libraries.
git-svn-id: http://pcsx2.googlecode.com/svn/branches/wxgui@1459 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-07-03 20:12:33 +00:00
Jake.Stine da691894c3 wxgui branch: Maintenance merge against trunk, plus many cleanups and project-level changes.
* Moved the x86 emitter to /common, so that plugins can link against it if they wish.
 * Created a new "utility" class in /common which houses string utils, fast memcpy, common exception classes, and other handy dandies.
 * Removed old-style linux automake files from the pcsx2 dir since they were hopelessly out of date (and their multi-file-per-line format makes svn merging impossible >_<)

git-svn-id: http://pcsx2.googlecode.com/svn/branches/wxgui@1454 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-07-03 00:49:40 +00:00