Commit Graph

115 Commits

Author SHA1 Message Date
refractionpcsx2 286769dc03 VIF MFifo: Simulate buffer filling time from Scratchpad.
-Fixes other Chessmaster hang.
-having it say it has data really quickly if the data incoming was huge seemed to throw it off.  I suspect it may actually be the time it takes to fill 16qw (or whatever is incoming if lower) is the wait time but it seems rather happy with the incoming data size.
2015-10-24 13:25:29 +01:00
refractionpcsx2 8d22006165 Vif MFIFO: Logic fix for Chessmaster. Game still needs EE Timing Fix to solve later hang in video, but game is playable now. Thanks to Ssakash for looking in to this :) 2015-10-24 03:30:29 +01:00
archshift fb9c24b900 Removed `using std::min/max` from PCH 2014-08-14 14:55:52 -07:00
refraction@gmail.com a1bc42fa92 VIF: Put in a check to make sure VIF doesn't break during a FIFO write.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5565 96395faa-99c1-11dd-bbfe-3dabce05a288
2013-02-18 21:17:35 +00:00
refraction@gmail.com 7b195696a7 VIF: Hack for Dynasty Warriors 5 Empires. Completely harmless hack to make sure we aren't still waiting for PATH 2 data after a VIF reset. Something really odd is going off with the VIF packets in this game (probably SIF or something), but until we know what, this'll do.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5553 96395faa-99c1-11dd-bbfe-3dabce05a288
2013-02-10 18:31:35 +00:00
refraction@gmail.com 0e80111499 VIF/VU: Removed all the everblue crap, found another way of doing it. As the savestate bummp wasn't needed anymore, i've put it back again. savestate users rejoyce?
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5546 96395faa-99c1-11dd-bbfe-3dabce05a288
2013-02-05 23:30:25 +00:00
refraction@gmail.com c30f67b767 VIF/VU: Fixes for Everblue and Hitman 2 from r5404, details below. Savestate bump needed, sorry. Also fixed a copy/paste bug i noticed along the way in vif0FBRST.
Everblue: Slightly messy fix, not as nice as id hope, but it seems to work, we need to remember VU programs written to the VU so we can check if an unpack is modifying it.  This retains the behaviour of the Snowblind engines whilst fixing everblue.

Hitman 2: Our vif0/1VUFinish() routing which works in conjunction with the delays wasn't paying attention to if the VIF was stalled or not and reran it before the game wanted it to, now fixed.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5544 96395faa-99c1-11dd-bbfe-3dabce05a288
2013-02-05 00:42:44 +00:00
refraction 71065506c1 Vif: Modified VIF FIFO reverse while VIF is active hack. Now just makes sure VIF is stopped before it swaps direction either way. Fixes Sled Storm.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5477 96395faa-99c1-11dd-bbfe-3dabce05a288
2012-12-08 13:00:31 +00:00
refraction d465c18228 More vif work to fix Shadowman 2 and improve the function of some parts. Gave vifstalled a more specific job and reasons for the stall. Also did some work with the irq offset, seperating it from the stalls.
Savestate bump needed.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5380 96395faa-99c1-11dd-bbfe-3dabce05a288
2012-08-16 23:03:27 +00:00
refraction d29a30c265 VIF: Reworked the VU delays in to scheduled events to simulate VU run time without killing Metal Saga or Fahrenheit. Adjusted the COP checks on the VU's to use the same method as the VPU_STAT is never set essentially so the VU is never "running".
Path3 Masking: Fixed a bug which caused persona 3 not to boot, previous a hack had been put in place to get around this.
VIF: Fixed a VIF error with the rare game Realta Nua, now goes through the prologue correctly. Game requires the EE timing hack to get rid of most of the noise (Path3 masking problem with new GIF unit, unfixable).

Expecting bugs, I will be monitoring this.


git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5147 96395faa-99c1-11dd-bbfe-3dabce05a288
2012-04-07 01:48:34 +00:00
ramapcsx2 54688f1f98 Reverted r4942 as some games need this to work..
Fixes Metal Saga menus and should fix Fahrenheit, too.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4962 96395faa-99c1-11dd-bbfe-3dabce05a288
2011-11-07 16:08:30 +00:00
refraction 702f71d5f1 VIF: Removed the vu cycle counting craziness mentioned in r4941 comments. It was intended to pretend if the VU "ran" for longer than the VIF did, but it didn't really change a lot :P
Savestate version bump again

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4942 96395faa-99c1-11dd-bbfe-3dabce05a288
2011-10-18 18:16:27 +00:00
ramapcsx2 d3f286e120 Fixed pretty bad bug of us counting cycles only for one VIF when the system has 2.
Also added a couple important global variables to be savestated (breaks old state compat).

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4941 96395faa-99c1-11dd-bbfe-3dabce05a288
2011-10-15 10:45:31 +00:00
refraction c355393b5b Vif/Gif: Hack for Hotwheels World Race, should be pretty harmless at it's very rare conditions.
(Note: Game runs better on ZeroGS than GSDX)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4889 96395faa-99c1-11dd-bbfe-3dabce05a288
2011-08-29 21:54:23 +00:00
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
cottonvibes 7e1be9c489 pcsx2: deleted a lot of the old gif code.
some bits were kept for reference and should be deleted in the future (along with the entire GIFpath.cpp)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4823 96395faa-99c1-11dd-bbfe-3dabce05a288
2011-07-24 22:24:10 +00:00
cottonvibes c05dc759e3 Big gif transfer code rewrite!
Pcsx2 now has a gifUnit class which acts like the ps2's gif and executes a single gif transfer at a time (and performs path arbitration according to priority and path3 slicing).

This new code is generally a speedup for most games. Particularly VU heavy games like GoW.
This revision breaks old saved state compatibility so don't update if you wish to keep playing with your old saved states.
Leave comments if this revision fixes or breaks anything...

Message to GS Plugin authors:
This new code now uses only 1 gif callback to transfer data to the gs plugin (GSgifTransfer).
pcsx2 also is garaunteed to send full GS primitives to the plugin. So you don't have to account for partial-transfers anymore.

Thanks goes out to shadowlady who tested around 500 games for me :D

Note 1: The old gif code is still in this revision, and can be enabled by the USE_OLD_GIF macro. The old code will be deleted soon.
Note 2: This revision also enables assertion dialogs in devel builds, and changed a lot of assume cases into assertions.


git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4821 96395faa-99c1-11dd-bbfe-3dabce05a288
2011-07-24 13:02:50 +00:00
refraction d30a2dbd10 VIF: Fix for Donald Duck Quack Attack - vifcmd errors caused by VIF not stopping on reset. It would be nice to find out the actually 100% behaviour of FBRST, information is limited.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4520 96395faa-99c1-11dd-bbfe-3dabce05a288
2011-04-01 14:58:23 +00:00
refraction 55f79ec54e VIF: Fix for Downhill Domination introduced in r3762.
For future reference:
Clearing registers on VIF reset = bad! That operation is designed to stop VIF Processing its current data, nothing more.
More importantly it causes me a great headache as it took me 2 days to find this >.<

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4519 96395faa-99c1-11dd-bbfe-3dabce05a288
2011-04-01 13:44:01 +00:00
refraction 3fb753d463 PATH3 Masking: Tweaks mainly for Path3Masking to fix TOCA3, This is the best Path3 masking is ever going to get, there might be an occasional glitch, but nothing major *fingers crossed*, Now have the ability to log Path3 stuff seperately which will help if problems do arise.
Cleaned up Gifdma a little, removing duplicate code. Disabled a few console writes we dont nee really.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4278 96395faa-99c1-11dd-bbfe-3dabce05a288
2011-02-01 01:24:37 +00:00
refraction 41fc6feaf7 Fixes for Ikusa, Kinetica and Need for Speed Underground, should all be working again (or as good as before r3274)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4081 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-12-11 00:29:20 +00:00
Jake.Stine 4671428593 ... and update the savestate version, since I changed all the vif containers around.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3764 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-09-13 23:05:14 +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 372478c0ec Remove some obsolete code relating to VIF/GIF FIFOs (hwRead/Write handlers always intercept them now, so saving values back to the eeHw register mirror is ineffective).
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3741 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-09-08 11:34:39 +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 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
refraction 26fece9510 Summary of fixes
Games
- Resident Evil Dead Aim flickering graphics fixed.
- Flatout games should now boot everytime (instead of randomly)
- Sega Superstar Tennis flashing fixed
- Destruction Derby graphics fixed (NTSC confirmed, PAL unsure)
- Tenchu Fatal Shadows flickering textures fixed, Issue 748
- Spyro Hero's Tail should boot again, Issue 746

General Info
- General reworking of the GS paths with all paths prioritizing more correctly.
- XGKICK can stall if another GS transfer is in progress
- Major reworking of Path3 masking, could still be combined with normal Path3 transfers, but lets get it working first :P
- Taken in to account a few conditions which could have caused VIF to lock up/crash when stalling on ends.
- Unreversed GIF and SPR and VIF so its the normal way round
- all DMA paths should now resume correctly after being stopped by hardware
- GIF FIFO now actually transfers stuff :P
- VIF CMD's simulated by the length of the interrupts at the end.

Phew, i think that's everything :S

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3274 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-06-22 23:10:40 +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
sudonim1 7c6f8877e8 Found wizardry / growlanser 2 & 3 hanging bug thanks to rama. OPH flag in GIF_STAT was misinterpreted (probably). It needs to be set on download, not upload.
Also clean-up/fix of GS download logic.  Might fix something if we're very lucky.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2954 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-05-06 00:43: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
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
refraction 912a90a605 Fixed a small VIF FIFO error on my part, and clarified the clarification on vif direction ;p
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2882 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-04-21 23:48:32 +00:00
refraction f01e10fc9a -Rewrote the DMA checking functions as per the manual specs so certain situations can alter the DMA's while busy.
-Improved DMA Queuing slightly, less "all over the place" code.
-Jiggled some IPU bits around to clean up some clutter.
-Added the FFX and Digital Devil Saga video fixes as a Gamefix for now. Due to the delay involved, this causes other videos to terminate early, so now disabled by default.
-Added a load of logging for hardware in dev builds (also now label more correctly) and some bits for debugging IPU easier. Some are commented out, but can be enabled for testing.
-Made a small clarification in VIF

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2875 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-04-20 01:18:31 +00:00
refraction 40bdbf9748 Fixes for r2853.
- BIOS works again, Issue involving GIF Tag looping from the VU (which must have never worked!)
- Fixed KH freeze issue, possibly fixes Onimusha 2 as well. Thx Arcum for spotting it, thanks Rama for trying to bring fast resolution to the issue (however it wasnt quite right)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2856 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-04-15 10:48:44 +00:00
refraction b1954edc3d - Better implementation of Reverse FIFO (Fatal Frame QWC Warning and more!)
- Improved handling of suspended DMA's, Also some traps in case DMA values are changed during suspend (please report if they don't start with 5 or 6)
- Better handling of GS Path priorities, this improves many Path3 Masked games such as Star Wars Episode 3, Gran Turismo 4 (slightly) and Videos like Digital Devil Saga/FFX
- Removed Voodoo Cycles
- Doesn't kill everything this time :P

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2853 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-04-15 00:32:58 +00:00
ramapcsx2 04eb79093d Revision 2822 contains a bug somewhere that we need to figure out.
So this reverts all VIF and GIF related code of that revision, 
leaving only the changes that were made to IPU.

Compatibility should be fixed again, with the added bonus of lots more videos working. 

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2828 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-04-09 15:15:43 +00:00
refraction 774411e3a4 Pleanty O' Changes:
- IPU 1 DMA rewritten - now much more readable, less hacky. A couple of games are still slightly picky, but overall compatability is similar (if not better in some cases)
- Reverse VIF transfers figured out and implemented (mostly)! - There are still some problems with this, will work on it.
- Improved GS PATH transfer control, now PATH2 and 3 cant transfer when PATH1 is, PATH3 cant when PATH2 is and so on.
- IPU now waits for ended GS transfers, for some reason this was screwing videos (mainly from PATH2) and causing them to be torn, which the original voodoo cycles addition fixed.

Note: You may see a lot of "Double IRQ on DMA 4" messages.  At the moment these are unavoidable but aren't actually causing any issues. I do know about them :P

Feel free to negative is I've seriously broke something lol

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2822 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-04-08 01:22:30 +00:00
refraction 928816732b -Fixed a small bug in the unpack dynarec causing it to drop back to the interpreter (MGS3 - now about 10fps faster!)
-Rewrote VIF0 DMA to work like VIF1, report any breakage from it.
-Tweaked a couple of cycle bits when stalling VIF

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2766 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-03-26 00:06:29 +00:00
refraction c697f6e6da Fixed for Looney Tunes menu. Commented some Forcebreak stuff for future reference, removed offending code from Vif0 till i can be bothered to rewrite the DMA to be like Vif1.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2760 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-03-21 00:34:54 +00:00
Jake.Stine 3e709bade8 Removed legacy savestate code (should have done it in my prev commits, but forgot). Made the PCSX2 startup a bit smarter and less assumptive about the UserDocs folder.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2673 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-03-05 21:00:49 +00:00
cottonvibes 76194c82dc Vif - Cleanups/refactoring
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2585 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-02-11 04:36:47 +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
arcum42 c455ea38e5 Fix Linux. Use defines for CPU_INT.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2522 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-01-25 22:40:01 +00:00
cottonvibes 46079853f9 Unified vif0 and vif1's write32 functions...
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2518 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-01-25 07:42:45 +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 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
Jake.Stine f34f3ac0c4 * Significant optimizations to the VIFunpack interpreter (employs templated maskmode and cyclesize constants).
* Minor optimizations to newVifUnpackSSE, and more optimization notes.


git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2352 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-12-17 13:59:01 +00:00
arcum42 d7c0cb64d3 Revised dmaGetAddr. Fixed a thread error message.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2337 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-12-11 04:15:50 +00:00