Commit Graph

119 Commits

Author SHA1 Message Date
refractionpcsx2 fd4a5acc40 MTVU: Try to make T-Bit more reliable.
Add MTVUSpeedHack option to GameDB so it can be forcefully disabled
2022-03-11 10:25:15 +00:00
TellowKrinkle f7476dfb63 Core: Replace alignment macros with alignas 2021-11-14 13:52:20 -06:00
refractionpcsx2 3f56414824 VIF/VU: Cleaned up VIF Stall behaviour, sync XGKick with Unpacks.
Also cleaned up a bunch of bad/old code
Fixed branches on E-Bit and M-Bit (VU0)
Fixed up VU Int behaviour with VU Instant on/off

Savestate bump
2021-09-12 16:12:31 +01:00
refractionpcsx2 fd1305e4da GIF: Reimplement GIF FIFO to kick in only when it is needed.
Need to adjust GameDB entries for to remove ones no longer required, added EE Timing fix for SOCOM as that seems to fix it up like its sequel.

Some misc changes too which are inconsequential (mostly formatting)
2021-07-29 14:58:36 +01:00
refractionpcsx2 c77e0a3a56 microVU: Enable T-Bit to work with MTVU 2021-07-05 10:26:50 +01:00
Gauvain 'GovanifY' Roussel-Tarbouriech b284ab7566 gs: core code and components merged up to gs 2021-07-03 18:16:11 -04:00
refractionpcsx2 a4553e821f VIF: Allow VIF1 to continue if stalled and the FIFO is reversed 2020-12-22 09:20:03 +00:00
refractionpcsx2 678829a5b2 VIF: Don't rush finish VU programs, fixes remaining SPS in Shadowman 2020-12-13 23:17:07 +00:00
refractionpcsx2 7138769182 VU: Synchronise VU1, added speedhack for old behaviour 2020-12-13 22:02:37 +00:00
refractionpcsx2 ab0d785ab5 VIF: Don't start transfer if VIF1/0 is stalled
Fix missing VIF status check on MFIFO
2020-12-13 22:01:51 +00:00
refractionpcsx2 3d43293a5d DMA: Correctly emulate QWC 0 on NORMAL transfers 2020-12-02 20:00:02 +00:00
refractionpcsx2 32f14f48b0 MFIFO: Maintain VIF DMA status and Empty condition on VIF reset
Also don't decrement/change VIF1 QWC on VIF1 FIFO write
2020-12-02 19:59:47 +00:00
refractionpcsx2 40d02400ca
DMAC: Improve DMA Stall handling (#3701)
SIF: Implemented SIF0 and SIF1 DMA Stall handling
Cleaned up some of the handling of DMA Stalls on the other channels
2020-09-18 16:23:18 +01:00
refractionpcsx2 b5e3fc97dc
VIF: Set decoding status on VIF stall (#3683)
* VIF: Set decoding status on VIF stall

* VIF/GIF: Remove VIF Reset hack, Let GIF Unit reset queued path data (Except MTVU)
2020-09-14 23:28:55 +01:00
refractionpcsx2 e04d86ad39
VIF MSCAL instructions wait on VU T-Bit stop (#3539)
* VIF MSCAL instructions wait on VU T-Bit stop
Fixes:
The Sims
Spiderman 3
Sharks Tale
Maybe some bits of Over the Hedge

* Removed Spiderman 3 patches

* Fix VIF DMA resuming when stalled on tag

* Remove warning which doesn't really need to be there anymore
2020-07-15 13:15:47 +01:00
refractionpcsx2 c009a95d68
Fix situation where a VIF IRQ triggers and the game triggers a STOP causing the IRQ to never trigger. (#3385)
Fixes Nitro Bike
2020-05-12 23:59:56 +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 84f1b08033 VIF: Fix up some scenarios with Reverse VIF FIFO. Fixes #1502
-Also noted a scenario which isn't really handled correctly but unsure what would happen in those cases (if there are any). I guess we'll find out :)
2016-08-07 12:27:28 +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 0bf7a35a53 pcsx2: improve the GS read fifo API
1/ initReadFifo will be first called on the GS thread
    (openGL can only be done on the GS thread)

2/ readFifo will be called on the EE thread. It is not safe too access eeMem from GS
 because of memory is virtual

Fix "recent" regression (crash) on Kingdom heart and others game too.

v2: add a len check on GSState::InitReadFIFO
2014-05-06 20:28:18 +02:00
Gregory Hainaut c6d8b52d26 pcsx2: try to ensure better sync with FIFO read call
First wait will ensure correctness of GS register.
2nd wait will ensure that the GS fifo read call is finished

(If I understand MTGS correctly)
2014-05-01 16:43:12 +02:00
Gregory Hainaut f78c39cc98 pcsx2: call GSReadFIFO from GS thread (was EE) 2014-03-25 16:36:29 +01: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
gregory.hainaut 48356e31b8 linux:
* use same path as game index db for cheats and cheats_ws
* install the new cheat zip file on cmake and debian installer 


git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5850 96395faa-99c1-11dd-bbfe-3dabce05a288
2014-01-26 18:00:14 +00:00
refraction 45d790b854 Path3 Masking: Fixed up some issues causing Gunfighter 2 not to work. Closes Issue 1445
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5759 96395faa-99c1-11dd-bbfe-3dabce05a288
2013-11-05 14:40:25 +00: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 e8d865d01d Gif Unit/VIF: Fix up some bits from r5551. Fixes SSX 3 and Charlie and the Chocolate Factory.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5552 96395faa-99c1-11dd-bbfe-3dabce05a288
2013-02-10 15:06:10 +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@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@gmail.com ac54bad33c VIF VU Execs: Fix for r5404 (the fabled Baldurs Gate fix). Need to check that when VIF ends there is no queued VU Exec left else it gets abandoned. Fixes freezing in Legends of Wrestling 2, possibly fixes the graphics on Warship Gunner 2
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5482 96395faa-99c1-11dd-bbfe-3dabce05a288
2012-12-20 23:46:09 +00:00
refraction 159c4ba138 VIF: Fixed a bug which caused PATH3 masking to fail if there was an IRQ on the FlushA command while it needed to wait. Fixes Futurama Issue 1343
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5443 96395faa-99c1-11dd-bbfe-3dabce05a288
2012-10-31 22:12:38 +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 64447dd23a Path3 Masking: Optimization got missed during r5277 revert. Outrun, GTA:SA, Burnout 2 and others all speed boosted again ;p
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5326 96395faa-99c1-11dd-bbfe-3dabce05a288
2012-06-25 20:55:31 +00:00
refraction cb7f27cd76 Revert original fix for Realta Nua as Pseudonym found the proper fix. This should get rid of the regression on Agressive Inline and one of the Matt Hoffman games having textureless graphics.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5277 96395faa-99c1-11dd-bbfe-3dabce05a288
2012-06-07 21:41:00 +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 de62189834 Path3 Masking: Fix for Need For Speed Underground - This got broken when the new GIF Unit went in, probably affects many games which use streams of NOP commands before issuing the mask. Game still requires EE Timing Fix however.
VIF Stall Delay hack: Modified slightly for Onimusha Blade Warriors.  This expects the end of the packet to all be in the VIF1 FIFO (which doesn't exist) and the VIF to have finished, so the Stall is technically ignored now, doesn't hurt SOCOM 2.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5220 96395faa-99c1-11dd-bbfe-3dabce05a288
2012-05-22 12:31:56 +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
refraction 737098ba8d MFIFO Changes:
* Vif: Altered how resumed transfers are handled slightly on VIF side (for MFIFO).  
* SPR: Now transfers data to the MFIFO even if not in MFIFO mode if it meets the conditions of the ring buffer location (SOCOM 2)

SOCOM 2 is now playable, sort of, the HUD is a mess (unless a tip shows up), looks like Path3 masking but isn't.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4876 96395faa-99c1-11dd-bbfe-3dabce05a288
2011-08-25 13:36: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 f816748d72 microVU:
- Fixed a bug with mVU's ESIN implementation. This finally fixes the flower-petal bug in Radiata Stories (and hopefully the clouds-bug in VP2 but havn't tested). Rama and I have wanted to fix this for a long time, but never knew the problem :p
- Improved implementation of some undefined behavior that happens on branches to take into account pipeline stalls. 

gif / vif:
- Added some logging code that parses gif packets. It can be enabled by the PRINT_GIF_PACKET macro in Gif.h
- Deleted some old gif code.
- On ReadFIFO_VIF1() clear the out-reg to prevent uninitialized results in case GSreadFIFO() doesn't modify it...
- Create a fallback for GSreadFIFO2() so that its always defined (as long as the plugin implements GSreadFIFO()) 

pcsx2:
- Organized the virtual folders in vs2008 a bit...

Note: vs2010 and Linux builds need to be modified to add Gif_Logger.cpp and delete GIFpath.cpp


git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4835 96395faa-99c1-11dd-bbfe-3dabce05a288
2011-08-01 03:16:42 +00:00
cottonvibes d8149fdb8b newGif: send complete gs primitive packets to the gs plugin even if eop wasn't detected. this is needed for games that do GS->EE downloads to make sure the gs plugin is up-to-date with the sent gif data.
fixes Bleach bankai problem, and probably other games (wizardry/growlancer 3) but haven't tested...
Also removed a vif FlushA hack that used to be needed for tekken 4/gitaroo man but not anymore...

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4829 96395faa-99c1-11dd-bbfe-3dabce05a288
2011-07-26 08:47:47 +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