Commit Graph

60 Commits

Author SHA1 Message Date
refractionpcsx2 46662b0436 MFIFO: Fix Tadr position on END tags with data. An Empty interrupt needs to be fired at DMA end for FF7 DoC, but the formula doesn't work out normally since we don't increment TADR on END tags (due to Soul Calibur 2 & 3 breaking), so a special case is made for MFIFO 2018-07-14 14:32:02 +01:00
refractionpcsx2 ba1689f6d6 Mild improvement to VIF MFIFO logging, got rid of a useless global variable \o/ 2018-06-20 22:01:10 +01:00
refractionpcsx2 c78b5b706d MFIFO: Refactor of some of the VIF/GIF MFIFO functionality. Centralised the MFIFO resume function which should have been separate anyway.
Added some more memory address safeguards.
Logging now makes a bit more sense to look at.
2018-05-30 01:29:23 +01:00
Gregory Hainaut 056ecb1c39 pcsx2: add some cast to fix gcc (int vs uint) warning
I'm pretty sure that .RMSK (which is an u32:31) warnings are false positives
2016-11-12 17:36:40 +01:00
Gregory Hainaut 4796803c33 pcsx2: Remove == true/false for boolean logic (#1556)
As discussed in #1553

Clang Tidy reports goes from 156 to 9.

Remain some macro in spu2x + a deadcode line
2016-09-10 20:08:14 +02:00
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
refractionpcsx2 c753f0d206 VIF-MFIFO: Fix for stalls on wait instructions, fixes Stuart Little 3
- VIF Waits for Path3 to flush, but it was firing before it had finished.
-Condition is much cleaner and less hacky now.
2015-06-27 22:47:44 +01:00
archshift fb9c24b900 Removed `using std::min/max` from PCH 2014-08-14 14:55:52 -07:00
Gregory Hainaut 4d78b6be31 pcsx2/plugin: sign compare mismatch extra 2014-05-03 10:18:27 +02:00
refraction 35b5e6a923 GIF:
-Implemented GIF_MODE Masking fixed the All Star Pro Wrestling series slowness/hanging.

DMA: 
-Standardize the IPU and SIF dma's to use the standard chain handling in hw.c, fixed up some DMA resuming stuff in the forementioned units, VIF, GIF and SPR.

-Added some warnings for DMA stall control which isn't implemented, hopefully somebody will find a game that does it so we can add/test it :)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5915 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-02-26 22:34:02 +00:00
refraction 5a8f01edf4 VIF MFIFO: Missed the MFIFO when i did my VIF change in r5843 which would have stopped some games working.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5873 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-02-02 20:19:54 +00:00
refraction@gmail.com b7d28572a2 MFIFO: Added protection on MADR when it is on the edge of the ring buffer when setting the DMA Tag where the data follows the Tag.
Fixes Front Mission 4.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5585 96395faa-99c1-11dd-bbfe-3dabce05a288
2013-03-11 16:02:56 +00:00
refraction@gmail.com e8b09949f8 MFIFO: Just over the top of the ring buffer is not classed as in the buffer (reaching the top is masked anyway). Fixes DDR X and Supernova games.
Bug was introduced between r4034 and r4039.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5584 96395faa-99c1-11dd-bbfe-3dabce05a288
2013-03-10 23:24:00 +00:00
refraction@gmail.com b51f0b01dd GIF Unit: Gave it some timing, kind of. Well the APATH and OPH flags in GIF Stat will now pretend it's transferring anyway, this makes games that read these flags and expect to see them busy very happy indeed. (187 Ride or Die as an example).
I'm expecting something to break, it's my code, it's bound to. But i have tested some 40 games without problems, so my hopes are high!

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5551 96395faa-99c1-11dd-bbfe-3dabce05a288
2013-02-08 23:41:28 +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 489bce662d Path 3 games speed up. Stopping VIF looping when waiting for Path 3 to finish (can sometimes loop over 1000 times)
Examples of speed ups:

Outrun 2006

before 43.4 - 45.7
after  44.7 - 47.33

Grand Theft Auto: San Andreas
before 63 - 66.9
after  66 - 69.5

Need for Speed Most Wanted

before 33.0 - 33.3
after  33.22 - 33.57

Burnout 2

before 46.5 - 48.3
after  53.2 - 55.5

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5246 96395faa-99c1-11dd-bbfe-3dabce05a288
2012-05-30 19:19:53 +00:00
refraction b3f8c59cf4 -Bumped savestate version, forgot to do that in my last commit.
-Fixed a bug stopping GT4 running.
-VIF now waits if the VU is busy rather than spinning, causing huge slowdowns.
-Filled in some bits i missed

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5149 96395faa-99c1-11dd-bbfe-3dabce05a288
2012-04-07 12:27:19 +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
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 44a186266a newGif - Fix Area 51 slowness.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4825 96395faa-99c1-11dd-bbfe-3dabce05a288
2011-07-25 07:43:31 +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 c368a6a422 Updated the FFX Video Fix, should work again now. Added DMA End log messages to DMA logging. Hopefully one day someone will reverse engineer the FFX video code so we can see if we are really doing something really wrong or if the code is just dire >.<
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4354 96395faa-99c1-11dd-bbfe-3dabce05a288
2011-02-24 11:07:13 +00:00
refraction b2cf9d026f MFIFO fixed Guitar Hero Videos, another case of developers assuming SPR1 will be finished before SPR0 gets to the data being written >.<
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4343 96395faa-99c1-11dd-bbfe-3dabce05a288
2011-02-22 22:19:21 +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 abf620141b Added some extra "how much in VIF fifo" checks, removed a silly one, fixes Gungrave
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4241 96395faa-99c1-11dd-bbfe-3dabce05a288
2011-01-21 16:24:54 +00:00
refraction 07bb54acc4 Fix for GTC Africa Jerkyness (Placement issue), Fix for Aura for Laura demo causing graphical errors, was multiplying VU Cycles by BIAS twice, not really clever :P
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4239 96395faa-99c1-11dd-bbfe-3dabce05a288
2011-01-21 15:17:29 +00:00
refraction 86fab4e955 *Insert Profanity here*
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4039 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-11-19 20:37:11 +00:00
refraction 71142dfd7f Take 3 and done *i hope!* comments for r4035-r4038 in here please!
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4038 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-11-19 20:07:57 +00:00
refraction 9979fe30e3 Fixed monumental cockup from my big commit, it shows, product placement really does work!! FFXII now works again, at normal speed.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4037 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-11-19 19:47:06 +00:00
refraction 80663917b1 This is part of r4035, you just "Thought" you saw a new revision..
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4036 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-11-19 16:32:48 +00:00
refraction 96ef86f560 - Standardized DMA Source chains, all DMA's now act exactly the same (within reason) Explanation for this in Hw.cpp. Consequently this fixed a hack id done for FFX videos (Not the one there is a game fix for)
- Slight tweak to Path3 masking, an overlooked situation where Path3 can wait between GIFTags.
- Improved the stability of MFIFO on both sides greatly for games such at Tekken Tag (which boots again) Gran Turismo 4 and FF7 Dirge of Cerberus.

I'm expecting *Something* to break, so please report it here if something does, please make sure it is THIS revision.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4035 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-11-19 16:29:28 +00:00
refraction 0bf97480b7 Fix/Bodge for Clock Tower 3 black screens. GT4 now boots again. Explanation for bodge in the edit :) I am still alive here, just :P
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4012 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-11-10 22:38:09 +00:00
Jake.Stine fc99f79aac Minor tweaks to assist in comparing new and old DMAC behaviors:
* VIF now sends a 128 bit tag instead of a 64 bit tag (lower 64 bits masked to 0 -- this should mimic real hardware behavior more closely)
 * Added more GIFtag logging info

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3916 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-10-12 12:15:57 +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 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
refraction 81dc6726d0 VIF MFIFO:
- Proper fix for FF7 DoC. 
- Changed the handlng of .inprogress to be cleared/set with ANDs and ORs (could probably change this to a structure later), it could have interfered with MFIFO functionality.
-Un-bool'd a function in MFIFO which really didnt need to be bool'd, causing pointless passing around of data.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3632 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-08-11 09:16:12 +00:00
ramapcsx2 e97c68e832 Added a minor hack to MFIFO interrupt timing. Fixes FF7 DoC.
Long interrupt delays are always bad, no matter how true it is to actual console behavior.
(Issue with running code in block slices.)
Also removed outdated hacks for Devil May Cry PAL :p

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3629 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-08-10 10:04:17 +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
ramapcsx2 3971787b9a Revert the OPH work of r3522 as it was based on wrong assumptions (except the direction flag in BUSDIR, that one was right).
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3554 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-07-22 19:17:10 +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
ramapcsx2 f7d0ed2dc5 ReorderingMTGS: Clean up and unify all OPH flag handling to be in the BUSDIR handler.
git-svn-id: http://pcsx2.googlecode.com/svn/branches/ReorderingMTGS@3522 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-07-17 22:37:36 +00:00
refraction 0c6e6d8274 Modified some recent changes a little, should bring back some more of the performance that was lost recently.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3347 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-06-29 19:32:30 +00:00
refraction b911ce1443 Game fixes:
- Batman Returns Issue 709 . 
- Fixed flashing in Sega Superstars Tennis. 
- Clawed back some of the speed loss from the XGKick delays.

Detailed changes:
- CALL Tag DMAs that contain invalid next tag addresses ignore the call (Batman started sending corrupt information from invalid addresses)
- VU1 now flushes any pending transfers if it's trying to send another and doesnt process any packed/list regs
- Batman was checking for OPH to be high, this was a timing thing, something id completely got rid of accidently (same for APATH)
- XGKick will no longer queue if PATH3 is interrupted

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3285 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-06-24 14:55:57 +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
refraction fbf2a59b32 Fix for Killzone from r2954, also cleaned up some other OPH's that had been missed
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2969 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-05-09 16:13:27 +00:00