Commit Graph

1562 Commits

Author SHA1 Message Date
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 047726a60c aligned_stack: no real progress... just reached a point where I need to move dev over to my windows so I can have real debugging/disasm/memory dumping ability. (this is the most horrible job I've ever undertaken, btw)
git-svn-id: http://pcsx2.googlecode.com/svn/branches/aligned_stack@2034 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-18 19:26:07 +00:00
Jake.Stine 54f1409090 Gave the frame limiter some smarts so it can sleep the EEcore a bit if there's nothing to do for a while.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2033 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-18 17:12:02 +00:00
Jake.Stine b1fb7f80ae aligned_stack: sync with trunk; some bugfixes to the stack prep on entry; and re-enabled the esp/ebp integrity assertions.
git-svn-id: http://pcsx2.googlecode.com/svn/branches/aligned_stack@2032 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-18 14:56:48 +00:00
Jake.Stine 950c99f886 wxWidgets/Win32: Bugfixed wxLog getting perma-suspended when calling YieldIfNeeded
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2031 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-18 12:30:54 +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 877f59a255 More thread sync fixes (these mostly only showed up on linux, because of threads starting a lot slower); fixed by including a startup signal to let the creating thread know when the worker has aquired its persistent locks.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2029 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-18 03:01:10 +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 9a1f3ae9f1 aligned_stack: fix attempt #1 for RecExit. Changed the jump to a call, which (I think!) should give GCC the stackframe setup it expects to see when trying to throw an exception.
git-svn-id: http://pcsx2.googlecode.com/svn/branches/aligned_stack@2025 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-17 22:30:50 +00:00
Jake.Stine 87cbaaf5ca aligned_stack branch: Preliminary work for having the recompilers align the stack to 16 bytes, to appease the expectations of GCC and Mac OSX.
Done:
 * EEcore aligns stack on entry and performs routine checks of ESP and EBP integrity.
 * Dispatchers are recoded using the PCSX2 Emitter.

Todo:
 * Convert all C-code function calls from the recompiler to use the new aligned stack setup.
 * Implement stack-alignment checks and emitter-based dispatchers for the IOP.

git-svn-id: http://pcsx2.googlecode.com/svn/branches/aligned_stack@2024 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-17 20:48:03 +00:00
Jake.Stine 0880cadf64 Linux: Minor fixes for prev commit.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2023 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-17 18:51:17 +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
ramapcsx2 c3cbdaf016 SPU2-X:
New default values for soundtouch, fix the sound quality somewhat.
Also got rid of a small configuration dialog glitch.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2021 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-17 17:49:33 +00:00
gigaherz bdad3bfa97 It seems trying to second-guess win32api plays against you, so it's best to assume it worked when the functions say it did.
(Fixes the stdout redirection for me.)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2020 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-17 16:19:13 +00:00
ramapcsx2 1ae5d07a3f Quick fix for GSdx10 crashing when entering/leaving fullscreen on pcsx/wx.
Ideally this should be reverted one time, it really made a difference in fps for some DX calls heavy games.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2019 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-17 15:11:21 +00:00
ramapcsx2 733e3daa18 Tested the cycle changes extensively on legacy_gui, they are fine.
So bringing them over to pcsx2/wx now.
They're tagged with "voodoocycles" in the source, to easily test for regressions (or improvements!) :p

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2018 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-17 14:15:33 +00:00
Jake.Stine aa26ea5004 More cleanups and comments on top of gigaherz's work, and added a stdout pipe concatenation thingie due to Windows liking to send 1-character messages to begin every new message written to the redirection pipe.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2017 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-16 19:28:59 +00:00
gigaherz e75474f076 Cleaned up the redirection code a bit trying to figure out why does it refuse to accept the redirection for stdout, but not for stderr.
The error still happens but at least the code is a bit cleaner.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2016 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-16 17:46:58 +00:00
Jake.Stine 04b3657ca1 Bugfixed some of the ini creation code on startup.
Bugfixed a memory leak when running blockdumps.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2015 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-16 16:59:48 +00:00
Jake.Stine 5c930fcb55 Win32: Attempt #1 at bugfixing the stdout/stderr redirection; Switched from CreateNamedPipe to CreatePipe.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2014 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-16 16:15:40 +00:00
Jake.Stine 66e9e8c085 Quick fix for duplicate keystrokes coming in from LilyPad when using keyboard input Raw or DInput modes.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2013 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-16 12:39:40 +00:00
ramapcsx2 d87cc4d250 Hack in a frame limit toggle on F4 and TAB using a global int. :p
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2012 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-16 10:45:47 +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 adf4b7ae50 Recompilers:
* Removed EBP push/pop stuff from the recExecute of the R5900 and R3000A both (not needed anymore since we disabled EBP in iCore).
 * Moved the legacy j8ptr and j32ptr buffers to iCore, since they'll go obsolete at the same time iCore does; and nothing outside PCSX2 references them.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2009 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-16 03:46:19 +00:00
arcum42 bffeda5ef9 Worked on SIF0dma a bit.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2008 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-14 23:59:05 +00:00
Jake.Stine f64876203a cdvdGigaherz:
* Plugged up some various thread sync issues with the sector cache (caused problems mainly on startup.init and during disc change detection)
  * Added a thread sleep to the ReadThread when the dvd tray is empty or open (speedup).
  * Replaced a thread sleep with an Event when waiting on pending events (speedup).

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2007 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-14 23:17:41 +00:00
Jake.Stine 6447ef282a GSdx: Recycle the m_merge texture instead of deleting it; and made a note about a debug assertion that happens in XS2 (probably nothing useful, but no harm in making a note for future references)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2006 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-14 16:42:59 +00:00
arcum42 863db9d52d Set the preferred stack boundary to 2 for the moment in Linux, and disable the old iVif code, as this takes care of the iVif issues.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2005 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-14 12:37:11 +00:00
arcum42 3d43e53928 Hack! Make Resets work in Linux by not throwing an exception that is supposed to be thrown, because gcc seems unable to catch it for some bizarre reason.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2004 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-13 12:49:05 +00:00
Jake.Stine 52d34a0616 Another experimental fix for GCC/Linux exception propagation out of the recompiler; using inline asm to invoke a jmp to an external asm function (to set up stackframe pointers), plus disabling EBP in the recompilers (which is just a plain bad idea in any reality or alternate universe).
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2003 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-13 11:00:51 +00:00
arcum42 0a117b1b99 The saints may come marching in, but the cpus shouldn't be. I've removed some march flags that shouldn't be there. I also made a change to Sif.cpp that was discussed in r1998.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2002 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-13 10:23:34 +00:00
MattMenke 22d31831e6 LilyPad: Minor fixes to alt-F4 detection code.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2001 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-13 02:35:25 +00:00
Jake.Stine c5c21f06cb GSdx: Fixed a couple memory leaks.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2000 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-12 19:58:03 +00:00
Jake.Stine 8b0cbe445a SPU2-X: Minor bugfix to suspend/shutdown code which caused SPU2-X to hang in very rare occasions.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1999 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-12 19:55:54 +00:00
arcum42 7533e00816 Fix minor mistake in my last commit.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1998 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-11 09:05:41 +00:00
arcum42 e0cef88d54 A couple misc changes. Converted a few more lines to the new register format, fixed spelling in a few comments, and so on...
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1997 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-11 08:40:44 +00:00
ramapcsx2 4b6e67eff8 Fix GSdx game patches not loading when bios skip hack enabled.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1996 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-10 11:50:39 +00:00
arcum42 a5aa1e65d6 Quick save menu fix.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1995 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-10 03:52:47 +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
arcum42 2a69c92067 Made hwDmacSrcChain & hwDmacSrcChainWithStacks a bit easier to follow. Misc other changes, mainly register related, or making use of existing constants.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1992 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-09 05:50:10 +00:00
Jake.Stine a4f180aa5d wxWidgets: helps if I fix *both* string and object allocators. I'm a commit spammer tonight. -_-
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1991 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-09 00:39:09 +00:00
Jake.Stine 9db4d2d53a wxWidgets: Bugfix to the private heap, caused by me recovering the wrong file to commit to svn. -_-
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1990 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-09 00:35:50 +00:00
Jake.Stine ca49f2edc0 wxWidgets/Win32: Helps when I include the necessary files (HeapAllocator.cpp / HeapAllocator.h)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1989 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-08 23:23:35 +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 67957b13b6 wxWidgets/Win32: Added a private heap allocation feature, which directs all wxString and wxObject allocations through a Windows private Heap (should reduce fragmentation and multithreaded contention when allocating/freeing blocks)
(and fix some oddball compilation errors in spu2-x in rare circumstances)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1987 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-08 19:26:57 +00:00
arcum42 53dd6b728a Linux: Fix compilation.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1986 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-08 19:10:05 +00:00
arcum42 2c8bede679 Revert one of my changes from r1970.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1985 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-08 18:47:32 +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