Commit Graph

37 Commits

Author SHA1 Message Date
cottonvibes ac9bf45f98 pcsx2: Implemented Threaded VU1 :D
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
2011-08-12 02:31:49 +00:00
refraction 44a1d17c9d Small optimization for partial unpacks, won't make a noticable difference, but every little helps :P
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4527 96395faa-99c1-11dd-bbfe-3dabce05a288
2011-04-02 20:16:00 +00:00
refraction ec41e24228 Small unpack bug with interpreted/partial transfers in fill mode (probably REALLY uncommon).
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4526 96395faa-99c1-11dd-bbfe-3dabce05a288
2011-04-02 19:23:20 +00:00
Jake.Stine f76e901c64 Minor cleanups for the new virtual memory alloc/reserve system:
* 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
2010-12-30 06:21:07 +00:00
Jake.Stine 63b254c8bd newHostVM:
* 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
2010-11-16 15:58:42 +00:00
Jake.Stine 752034c519 Bugfix for Tri-ace games and possibly others (bug introduced in r3762, caused by missing 'vifRegs.num is actually 256' checks)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3765 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-09-14 00:39:40 +00:00
Jake.Stine 2f8f86a3eb Significant VIFunpack retooling. Interpreters are considerably more efficient, and Recompilers are slightly more efficient. Details:
* All remaining code for handling partial/fragmented unpacks removed.
 * vifRegs.NUM is now accurately simulated when queuing data from fragmented unpacks.
 * Reduced the VIFunpack fragment buffer from 1MB to 4KB (max size of an unpack due to NUM being limited to 8 bits).
 * Removed vif/vifRegs globals formally used by VIF interpreters (everything relies on the templated vifIdx now -- simpler and faster!)
 * g_vifMask vars are integrated into vifStruct.
 * All VIF mask register stuff uses the SSE-friendly vifStruct.MaskRow/Col vars now.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3762 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-09-13 21:13:10 +00:00
Jake.Stine da9c955135 * Simplified VIFunpack's C-based interpreters (removed ODD size handlers and unused data)
* Fixed V2/V3 unpacks to behave same as the SSE unpacks (matches undefined PS2 behaviors)
 * Removed legacy vifUnpacker (haven't needed it for any regression testing in forever).
 * Move some VIF MARK console spam to DevCon (Ape Escape 3)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3746 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-09-10 13:16:50 +00:00
Jake.Stine 1edb900405 Changed a few more -> to . for consistency.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3707 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-08-31 13:06:53 +00:00
Jake.Stine 003da7d287 MAJOR: All new hwRead and hwWrite handlers (expect regressions). Details:
* Writes via 16 and 8 bit ops now use 32-bit read/modify/write operations by default; which should enable nearly complete support for all such operations (instead of the formerly spotty coverage before).
 * Eliminated almost all former 8/16-bit specific register operations.  All code shares the same 32 bit handlers now.
 * Completely revamped the developer trace logs for hardware registers!  *ALL* registers are logged now, complete with address, name, and value being read/written (and nicely formatted!).
 * Handlers are now fully page-based using templated functions (minor speedup)


git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3704 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-08-31 05:22:26 +00:00
Jake.Stine a0389c4d18 * Redid the VIFunpacker's wrapped memory address detection (a bit more compact now)
* More VU interpreter cleanups  (VU0micro.cpp and VU1micro.cpp are just about ready for permanent removal now).

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3685 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-08-24 17:53:27 +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 bc849cc042 Merge const qualifiers and cleanups from ReorderingMTGS: Includes the VIF DIRECT changes, which seem to be stable this time. ;)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3549 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-07-22 12:20:11 +00:00
Jake.Stine 4f9a5c6876 Remove all MMX and XMM register freeze code.
DevNote: I could have left the code for the freezes in, except I *really* don't want us to ever have to resort to using such a system ever again in the future.  For anything. (its just not safe on modern optimizing compilers)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3392 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-07-05 01:12:38 +00:00
sudonim1 7234302f65 Actually fix the leak.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3182 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-06-07 14:12:13 +00:00
Jake.Stine 403c9d3f2f Likely fix for 30mb memleaks when loading states and resetting the emu.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3181 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-06-07 14:03:58 +00:00
Jake.Stine 81c35c9fcc Many small memoryleak fixes in PCSX2 (mostly related to newVIF's recompiler) and one memoryleak fixed in USBnull. Had to juggle around the initialization/reset code for VIF a bit to get it happy. This also removes quite a bit of redundant memory allocations and clears when starting/resetting the emulator; expect a small speedup on slower machines.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3103 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-05-28 16:54:42 +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
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
cottonvibes c53ecee572 Fixed a bug in the newVif unpack dynarec with filling writes...
(was some optimization i had, but only was working correctly for skipping writes...)

Fixes half-life...

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2732 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-03-18 04:52:57 +00:00
cottonvibes d379a1b010 Vif1: Rewrote a lot of stuff, lets see if this fixes or breaks anything.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2603 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-02-18 08:37:02 +00:00
cottonvibes 15f01118e8 Added some saved-state code for newVif.
Not in effect yet cuz there seems to be a minor bug in the current saved-state versioning system. (GetVersion() is not correctly returning the loaded-state's version when loading a saved state)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2567 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-02-06 03:11:19 +00:00
cottonvibes 09e268e251 newVif: removed the old partial transfer logic since the new code doesn't seem to break anything.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2550 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-02-02 05:59:32 +00:00
cottonvibes 9356d311eb newVif: Rewrote the way partial transfers are handled.
The code is very simple now and doesn't need the vif unpack interpreter anymore for partial transfers.

Need some more testing done before I remove the code for the old way...

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2549 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-02-02 05:01:13 +00:00
cottonvibes 92ddae17ce More vif refactoring/cleanups.
There is a lot of code duplication in the vif0/vif1 files, I will probably work on getting them to use common functions.


git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2489 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-01-23 04:14:59 +00:00
cottonvibes 84bc805761 Vif Cleanups - did some code refactoring so things make more sense.
I need to do more later on...

I mostly separated the unpack code from the dma/transfer code in this commit.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2485 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-01-23 02:30:00 +00:00
cottonvibes a8c2941901 Removed the old vif unpack code since pcsx2 is now using newVif.
Notes to Devs:
- Linux project files probably need to be updated since I deleted some files.
- In the vif0/vif1 Freeze() functions for saved states, I kept some dummy vars to keep saved state compatibility. We should remove them next time we decide to break saved state compatibility.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2461 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-01-21 06:51:09 +00:00
cottonvibes 3780b67ea8 minor cleanups (no functional changes)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2455 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-01-19 01:24:07 +00:00
cottonvibes 9e7d4dc49a newVif: fix for rule of rose.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2452 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-01-18 09:15:21 +00:00
cottonvibes 804cae0b15 newVif: minor changes...
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2451 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-01-18 05:33:06 +00:00
cottonvibes 33bc8652e2 newVif: Cleaned up some code and added some Cleanup code. :D
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2448 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-01-18 04:49:45 +00:00
cottonvibes fbb95f85e4 newVif: fixed some bugs with mask/mode modes. i had forgotten that mVUmergeRegs() modifies the source reg's vectors, so data was being corrupted and breaking some games (sse4.1 users didn't have this problem).
This revision correctly fixes .hack GU Rebirth.
At this point we don't know any games newVif breaks compared to the old vif code. If you know any please leave a comment.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2447 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-01-18 04:07:57 +00:00
cottonvibes c6b79a4915 newVif: reverted my last change since it wasn't correct (i wasn't thinking straight when i coded it)
so .hack gu rebirth will be broken with this revision... i still need to figure out the real problem.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2446 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-01-18 01:28:24 +00:00
cottonvibes 0fd4e40286 newVif: fixed a bug... fixes Digital Devil Saga crashing.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2431 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-01-16 03:01:10 +00:00
cottonvibes cbc043156d newVif: fixed tekken 5 while keeping games like gradius 5 working.
hopefully this fixes the rest of the problems newVif was having with games..

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2429 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-01-15 07:43:52 +00:00
Jake.Stine c2aa78f2b5 Undo VPU renaming, Vif was better for this originally. >_<
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2391 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-12-23 22:14:51 +00:00
Jake.Stine b27b89b162 newVif: I'm a terrible person. What started out at an optimization turned into this.
* Optimized codegen of the VPU recompiler using displaced memory offsets (1-2% speedup)
 * Undid a lot of the inl stuff for more traditional cpp code layout (explained below)
 * Removed some redundant code and turned some macros into functions.
 * Renamed a few things to VPU (Vector Processing Unit, which is the specific name of the logic core that performs VIF Command Processing and Unpacking on the PS2)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2387 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-12-23 13:22:30 +00:00