![pcsx2 ratchet and clank slow pcsx2 ratchet and clank slow](https://i.ytimg.com/vi/yT4G3o7HXbk/maxresdefault.jpg)
- #PCSX2 RATCHET AND CLANK SLOW PATCH#
- #PCSX2 RATCHET AND CLANK SLOW SOFTWARE#
- #PCSX2 RATCHET AND CLANK SLOW CODE#
- #PCSX2 RATCHET AND CLANK SLOW PS2#
#PCSX2 RATCHET AND CLANK SLOW CODE#
When the third parameter is 1, sceSifCallRpc is asynchronous, meaning that the EE will continue executing code after it sends the command. Interestingly, DOA2 uses the same buffer in memory for both sending the command to the IOP and receiving a reply - keep this in mind.
#PCSX2 RATCHET AND CLANK SLOW PS2#
Using custom modules is common practice for PS2 games, and they can range anywhere from CDVD streaming to texture decompression. DOA2 has a custom sound module running on the IOP called TLSNDDRV that wraps around the default low-level sound driver. This function is used to execute a command on the Input/Output Processor (IOP).
#PCSX2 RATCHET AND CLANK SLOW PATCH#
The patch changes the third parameter, a 1, to 0. To start with, here's the game function (taken from Ghidra) that gets patched: Sometime in the middle of 2019, I wanted to take a deeper look to see if I could get some insight out of this problem.
![pcsx2 ratchet and clank slow pcsx2 ratchet and clank slow](https://i.ytimg.com/vi/gOEjZgSiR8s/maxresdefault.jpg)
Ultimately a patch was backported from the PS2 emulator on the PS3, and that was the end of that. At some point it was discovered that the game relied on the data cache, but it seems no one bothered investigating what exactly was broken in the game. In practice, game developers found the SDK quite limiting and created their own functions to access the hardware, which couldn't possibly go wrong at all.īefore it was patched, DOA2 had been broken on PCSX2 for many years. In theory, a game should never have to worry about the cache, as it is transparent to normal program operation. Sony's SDK is mindful of the cache and makes sure to always flush it whenever accessing other hardware. The PS2 uses the first solution, given that the second is more expensive to implement. The second solution is using "cache coherency" protocols that automatically ensure that cache and main memory are the same. A flush will force all of cache contents to be stored to memory, ensuring that the two of them match.
#PCSX2 RATCHET AND CLANK SLOW SOFTWARE#
The first is that software must manually flush the cache whenever it accesses a peripheral that reads main memory. A mismatch between cache and main memory could result in anything from corrupted graphics to a hard crash, but there are two general ways to prevent this. PS2 DMA can transfer data to a variety of devices, including the GPU, sound chip, and controller.
![pcsx2 ratchet and clank slow pcsx2 ratchet and clank slow](https://i.ytimg.com/vi/tTa_bPp8dCE/maxresdefault.jpg)
For example, the PS2's DMA engine only reads from main memory. This is fine for most applications, but things get hairy when the CPU starts accessing other hardware as it is possible that the cache and RAM will have separate contents. The PS2's Emotion Engine is rather simple and only has a single 8 KB level of data cache.īy design, the cache is separate from main memory, and unless explicitly programmed to do otherwise, the CPU will try to read and write the cache. Modern caches are multi-level and rather complex, but the main idea is the same: frequently accessed data allows the CPU to maximize throughput instead of waiting on memory. Enter the data cache: CPU designers figured out that since the majority of time would be spent accessing a relatively small amount of memory, they could cache program data on a small buffer of memory embedded directly onto the CPU. Any time a memory access happened, the CPU would have to wait dozens of cycles! Increasing the clock rate would make no difference if programs were bottlenecked by memory speed, so a smarter solution was needed. As the years went on, CPUs began outpacing memory speeds. This meant that making the CPU faster would always make whatever program it was running faster as well. Older systems, such as the NES, were slow due to CPU speed being the main bottleneck. What is this data cache thing, why is it so slow, and why does DOA2 even need it? Furthermore, this game won't work at all on any PS2 emulator without the patch, so it's not a problem specific to PCSX2. But why? Enabling "EE data cache" does allow DOA2 to boot and go in-game, but it tanks performance to such a ridiculous extent that the game might as well not exist. This is deceiving, however, as PCSX2 has a patch for DOA2: without the patch, the game fails to boot. One might question why Dead or Alive 2 is mentioned in the title, given that it has worked fine in PCSX2 for many years. Since the code worked on PS2, no one cared, and it was shipped as-is. Some of this code would break on PC, but the PS2 is far more forgiving. The other end, however, has sloppy, inefficient, and overall buggy code written only to meet deadlines. Games like Jak and Daxter as well as Ratchet and Clank would fall in this category. The first end is one of optimization: using every trick in the book, and many more unwritten tricks, to bring about the best performance and graphical fidelity possible. Boasting a library of thousands of games, the PlayStation 2 can be taken to two extremes that cause trouble for emulators.