Commit Graph

62 Commits

Author SHA1 Message Date
Jake.Stine 984e79ae03 Attempt for the GCC 4.3 compilation errors introduced in r2063/2064, by selectively disabling __fastcall for the functions being used as listeners... hope it works. >_<
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2071 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-24 22:32:25 +00:00
Jake.Stine 66d92503aa Attempted fix for GCC compilation errors in previous revision. Also:
* Removed some unused sealed class container mess that liked to cause compilation errors on GCC 4.2
 * Added a macro for efficient invocation of static recompiled code buffers.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2065 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-24 16:28:48 +00:00
Jake.Stine aa2e053366 Fix the usual myriad of Linux compilation errors.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2064 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-23 21:05:32 +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 f172829737 aligned_stack:
* Added -fno-strict-aliasing to the ever growing list of gcc optimizations that can potentially cause perfectly good C code to generate entirely broken results.
 * Removed the preferred-stack=2, since this branch *should* run fine without it now.
 * Have Release builds in Linux SIGKILL when encountering an unexpected SIGSEGV.
 * Fixed some deadlock issues with the new console logger (it introduced cancel points, which is a good thing!  unless you're the EE recompiler and you swallow up any attempt by GCC to cancel a thread)
 * Compilation error fixes.

git-svn-id: http://pcsx2.googlecode.com/svn/branches/aligned_stack@2049 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-21 08:57:05 +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 43bac9c6a9 Brand new approach to console logging, should be a lot more efficient, and is relatively deadlock-free. Also fixes most of the scrolling issues from prev versions.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2044 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-20 19:34:57 +00:00
Jake.Stine 27174c3f5b * Improved the framelimiter sleep mode more (less cpu used and more responsive to fps fluctuation near the 60fps line at the same time)
* Added timeBeginPeriod() to improve the Win32 kernel scheduler resolution (improves sleep accuracy and thread responsiveness)
 * hackfixed some code that made exiting pcsx2 "slow" sometimes.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2041 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-19 23:13:22 +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 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 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 28473c1436 Fixed: Savestate bug when saving caused erratic freezeups.
Fixed: More savestate slowness, and less savestate memory hogging.
SPU2-X: Fixed crash bug on using savestates while suspended.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1994 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-09 17:28:17 +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 4e114666d2 Linux: some more minor tweaks to project files and compilation errors (release mode only)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1978 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-07 23:31:03 +00:00
Jake.Stine d30673c5ca Resolve some Linux/GCC errors.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1976 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-07 20:50:39 +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 b71b837efa Linux: Added more correct __asm__ qualifiers and conditions; including __volatile__ on a lot of asm code (it should really be the default behavior and non-vlatile the specifier, but whatever >_<), and added register clobber specifiers. Might help unbreak some of GCC 4.4's optimization problems, although VIFdma's uber-hack SSE optimization looks like a real problem.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1964 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-05 11:05:11 +00:00
Jake.Stine 4f6d7ca776 Linux: We don't need no stinkin' muldefs! (fyi, turns out the solution was to use the "inline" keyword on class member prototype definitions, yes that simple -_-)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1955 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-04 20:28:08 +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 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
arcum42 3d789c5da3 Not particularly tested, but fix Linux.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1931 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-09-29 22:05:21 +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 6b9ffd8132 Renamed memzero_obj to memzero. Been meaning to do that for a while. Also, Savestates *almost* work, but it's just not going to happen. See everyone in 5 days or so. -_-
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1913 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-09-23 12:53:32 +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
Jake.Stine fdbabaa11c Linux: Fix compilation errors and warnings. There's still a lot of new warnings in x86Emitter due to __forceinline being disabled in debug builds, but the proper fix for those will come later.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1898 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-09-21 09:48:31 +00:00
Jake.Stine 8d91458c95 Win32: Added stdout and stderr pipe support for the ConsoleLogger; such that plugins using printf or fprintf will have their messages show up in the new-style console log and in the emuLog.txt file.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1897 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-09-21 03:33:35 +00:00
Jake.Stine 0f259e62d5 Implemented keyboard accelerator tables and a hashed global command table (should be ideal for eventual GUI extensions via plugin, and toolbars and other fanciness). Removed Pause menu and replaced it with a Suspend/Resume menu. Closing GS window behaves more nicely.
Projects: Removed FrameworkVersion descriptor, don't think it matters for C++ code.  Removed all translation files, since they're grossly out-dated and need to be remade anyway.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1894 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-09-20 20:54:45 +00:00
Jake.Stine 3ccb4d3698 Re-re-re-re-fixed the BIOS skip hack saving on exit (plus lots of code cleanups and some API changes to saving/loading settings -- more to come).
Linux/GCC: Disabled __forceinlining in debug builds.  This is the intended design, fixes many GCC errors in debug builds, and also mimics MSVC behavior.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1854 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-09-18 14:07:36 +00:00
Jake.Stine e5da378d9a Added a GSopen2 call to the GS plugin API, which is used by PCSX2 to specify its own window handle.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1840 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-09-17 07:31:57 +00:00
Jake.Stine 19310cef03 Re-fix win32 builds. Stupid C++ templated class inheritance fail.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1839 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-09-17 05:24:47 +00:00
Jake.Stine a2d4144ce9 Linux: Fix some of the standard issue compiler errors that come with any changes. :)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1836 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-09-17 02:12:32 +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 de0442321f Linux: Fixed compiler errors from my prev commit, along with a few verbose warnings and a compile error in SPU2-X. (note, moved Linux's define of SVN_REV macro to PrecompiledHeader.h for now, until a proper solution is implemented)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1819 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-09-13 20:56:22 +00:00
Jake.Stine 4fbc2c26aa Fixed a bug in BiosTools.cpp that caused Bios-Not-Found errors.
MemoryCard / Multitap Renovations:
 * Memorycards should now support multitap (somewhat untested)
 * Implemented a memorycard plugin interface, using the new API defined in PluginCallbacks.h (still prelim and hackish)
 * Memorycard settings are saved to ini!
 * Multitap is now controlled by PCSX2 instead of the pad plugin (which means no multitap until we implement the gui toggles to enable it)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1817 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-09-13 17:11:35 +00:00
Jake.Stine b638f52809 Re-ordered the MSVC folder structure to split PCSX2 into two definitive sections: [App]Host and [Emu]Core (the bracketed names indicate the "long" versions which are generally used in the code to differentiate the functions and classes). If the tentative layout is good then I'll sort the files on SVN to match that layout.
(note: Patch.cpp/Patch.h is still the odd child out in this commit, as it's destiny is to become a plugin)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1804 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-09-12 02:58:22 +00:00
Jake.Stine 76045a4722 Cleaned up Path namespace and moved it and wxDirName to /common/Utilities.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1803 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-09-12 01:03:44 +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
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
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 25a31e3a03 wxgui: retooled exception handling, should eliminate warnings in GCC and remove previous initialization ambiguities. (ended up being a nice code cleanup too, yay)
git-svn-id: http://pcsx2.googlecode.com/svn/branches/wxgui@1720 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-09-01 00:43:28 +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