Uncategorized – RPCS3 https://rpcs3.net/blog RPCS3 is an open-source PlayStation 3 emulator and debugger written in C++, developed for Windows, Linux, macOS and FreeBSD Mon, 17 Feb 2020 20:25:54 +0000 en-GB hourly 1 https://wordpress.org/?v=6.5.4 New Demon’s Souls 60FPS+ patch https://rpcs3.net/blog/2019/08/12/new-demons-souls-60fps-patch/ Mon, 12 Aug 2019 14:25:51 +0000 https://rpcs3.net/blog/?p=1765 Continue reading New Demon’s Souls 60FPS+ patch]]> Hello, I’m Whatcookie, an RPCS3 contributor. I’m here today to talk about the brand new 60FPS patch for Demon’s Souls. But before we discuss the details of the patch, let’s first take a look at some 4K 60FPS gameplay:

Demon’s Souls has long been one of the most popular titles for RPCS3. When it went ingame for the first time it made gaming headlines everywhere. I had been following RPCS3 pretty loosely at the time, but when Demon’s Souls went ingame I finally tried out the emulator. Back then the graphics were quite broken, and I was lucky if the framerate went over 20FPS. But despite all that it was still amazing to me. I thought to myself “Wow, it will be so incredible when the game is playable at 30FPS… maybe in 2 years or so”. The game ended up being very playable much earlier than I expected, all the way back in 2017. Since performance was so solid I thought that it would only be a matter of time before someone out there would make a 60FPS patch.

Fast forward 2 years and there still was no (proper) 60FPS patch. And I had already started to contribute to RPCS3, and created a patch to unlock the framerate in NieR. I assumed that a framerate patch for Demon’s Souls must be impossibly difficult since the only 60FPS patch that was made broke the gamespeed and caused everything to run twice as fast. On a complete whim, I decided to try running Demon’s Souls with the new generic FPS unlocking methods by developer eladash. I knew that since the game used a fixed timestep instead of delta time, the game wouldn’t be playable at proper game speed but I was curious about just how much faster Demon’s Souls was compared to two years ago. Since I’ve had the same quad core desktop PC since the start of 2017, I would be able to see just how much the software has improved.

Turns out RPCS3 has gotten a LOT faster over the past 2 years!

“Wow, RPCS3 is really fast now. But it’s midnight now, I’ll try investigating a patch for proper game speed at 60FPS tomorrow.” I said to myself. Next morning, before I got breakfast I had the game running at proper speed with high framerates.

The patch simply changes the amount of time that’s advanced each frame from 33.3ms to 16.7ms. Since the patch is meant to be used with Vblank at 120 which doubles the max framerate, this lets us get a correct game speed at 60FPS. After that, it is then necessary to set Clocks scale to 200 to re-enable the games internal frameskipping at 60FPS, without which you will drop game speed every time your computer can’t hold 60FPS. I’ve also included another line that’s commented out by default (has the symbol # at the start of the line) which sets the timestep to 8.3 ms. This is meant to be used with Vblank at 240 and Clocks scale at 400 for proper gamespeed at 120FPS.

Warning: The instructions mentioned below are outdated. Click here to visit the Patch repository on our Wiki for the latest patch.

I’m sure you’re itching to play Demon’s Souls at 60FPS by now so let’s go over all the steps you’ll need to take to get it running on RPCS3:

  1. First of all, you’ll need the EU or US disc version of Demon’s Souls. Only the disc versions will currently work.
  2. Next, you’ll need to right click on Demon’s Souls in the game list and click Configure, this will create a custom config for the game so all future changes to settings must be made here instead of on the normal settings window/button.
    On the CPU tab, ensure that SPU block size is set to Safe (which is the default setting).
    On the GPU tab, ensure that Write color buffers is enabled, the Renderer is set to Vulkan and MT RSX is OFF (it can cause some deadlocks currently).
    On the Advanced tab (only available on new RPCS3 builds) change the following settings:
  3. Clocks scale: 200
    Vblank Rate: 120
    And then click the save button.

  4. Now, download the patch here and place it in your RPCS3 folder. If you are on Linux, then place it in ~/.config/rpcs3/.
  5. Finally, there is one last optional step to reduce log spam which can help with stability issues. Right click on Demon’s Souls again and click on “Open custom config folder” and open the corresponding config file. In This file, scroll down to the bottom and enter the following text within the {braces}:
    Log: {sceNp: Fatal}
    Please note that this is case sensitive, when finished hit save.

Be sure to check for the ideal settings for this game in our wiki. RPCS3 advances fast and the ideal settings may change from week to week. With the patch enabled at 60FPS, I’m able to get a locked 60FPS 95% of the time on my i7 7700K. If you have a Ryzen 3000 or i7 8000 series desktop CPU then you can reach 60FPS 99% of the time. Of course as the emulator continues to improve further, the system requirements will continue to drop lower and lower.

Users should also note that the FPS counters are inaccurate with Demon’s Souls as the game will automatically output duplicate frames when the framerate drops below its FPS cap. It is for this reason that FPS counters, even third party software like Afterburner will improperly report 60FPS at all times with the patch enabled because the game is outputting duplicate frames. This is not a bug, its just an unfortunate result of how the game works. To properly measure frame-rates you will need to use tools to analyse video footage, or enable the debug overlay and look out for when the draw calls change.

I hope you enjoy the patch. It’s been killing me since I’ve had to keep it secret for a few days so that we could make this blog post and the YouTube video. If you’re happy with the patch then please consider making a donation to our Patreon. https://www.patreon.com/Nekotekina While RPCS3 is already stable and performant enough to run games such as Demon’s Souls at 60FPS, there’s no end when it comes to things that can be improved when talking about emulation of a system as complex as the PlayStation 3.

Closing Words

If you would like to contribute to the project, you can do so either by contributing code, helping the community or becoming a patron. RPCS3 has two full-time developers working on it who greatly benefit from the continued support of the many generous patrons. In exchange, patrons also get special support over on our Discord server and get access to early updates directly from our lead developers. If you are interested in supporting us, consider visiting our Patreon page at the link below and becoming a patron, or join our Discord server to learn about other ways of contribution.

Also, come check out our YouTube channel and Discord server to stay up-to-date with any big news.

]]>
RPCS3 Begins to Emulate Several Awaited AAA Exclusives. Here’s How We’ve Done It! https://rpcs3.net/blog/2017/12/01/rpcs3-begins-to-emulate-several-awaited-aaa-exclusives/ Fri, 01 Dec 2017 00:08:08 +0000 https://rpcs3.net/blog/?p=1062 Continue reading RPCS3 Begins to Emulate Several Awaited AAA Exclusives. Here’s How We’ve Done It!]]> Yes, you’ve read correctly. Many of the much awaited exclusives are now finally starting to be emulated by RPCS3. In this blog post, you’ll learn which games we know to have improved and how we’ve done it.
But first, check out this awesome teaser:

Table of Contents

SPU Improvements by Jarves
RSX Improvements by kd-11
List of known Improved Games
Closing Words

SPU Improvements by Jarves

There were two main changes to the SPU emulation that brought us to this point of allowing so many newer titles to progress past ‘Intro.’ Let’s take a quick look at both individually.

SPU Interrupt Fix

Many titles in RPCS3 ‘hang’, but in the case of the titles mentioned above, they do not actually crash, and the fps counter would still change with just a black screen. This normally would be mistaken for RPCS3 just being slow and the game taking a bit to load, but opening up the debugger in RPCS3 tells a different story. The games would loop over the same code on both the PPU side and SPU side. In this case, they are waiting on something, but what?

‘The Last of Us’. More like – ‘The Last Loop That Will Ever Execute’
Moving the PC to address 0 of an SPU thread explains more. Most games will have just 0 (null) written there, but some actually have a branch there.

This small group of branches has a big impact on what happens on the SPU
See, the only reason there would be code there is because the game relies on what’s called an Interrupt. Basically what happens, is, when certain conditions are detected behind the scene of the SPU, the SPU abandons the current executing code and instead jumps to location 0 and executes that code instead. So what sweeping changes were needed to support this? Well, none really, as I found out, most of the code was already in the emulator as is. In fact, the main issue was the internal check to make the jump happen in RPCS3 was wrong. A small, but welcome change nonetheless! But then I found that there was a bit more to this story after finding this.

SPU MFC Queue Stall Fix

This commit first requires a quick tutorial on how the Cell processor actually works:
For design reasons relating to performance and speed (explaining this more could be a blog post on its own!), the SPU, unlike the PPU core, doesn’t actually have direct access to main memory, and instead each core has their own tiny 256kb of Local Storage (LS) memory. In order for the SPU to access main memory, and get data in and out of their respective LS, memory transfers are ‘queued’ to what’s known as the Memory Flow Controller (MFC). The MFC is then responsible for the actual copying and transfer of memory. On top of that, there are multiple different types of transfers and the MFC can not only choose to execute transfers out-of-order, the SPU can request certain transfers are held, forcing something that would normally be in-order, to not be.

That last statement from above is key; the emulation of the MFC in RPCS3 has only ever supported in-order executing. Up until these new titles started booting did we finally see SPU code actually request a transfer be held, or stalled, so there was never a reason to change or implement it. I’ve not only fixed the emulation of MFC so it stalled, or held, certain requests by the SPU, I also added out-of-order execution when encountering these special transfer requests. This ended up bringing a slightly more accurate MFC emulation, along with killing some random crashes in these new titles.

After these needed SPU changes were made to get games booting, kd-11 tackled some of the graphic issues in them.

RSX Improvements by kd-11

It has been an exciting month since it was decided earlier on to finally present the SPU improvements code by Jarves. While this means that more games successfully boot, it also means rpcs3 graphics back-end is exposed to games utilizing more advanced techniques and new bugs were inevitably going to get introduced.

Before, I tackled any new games that would be bootable, I decided to take a look at games that were already relatively stable that presented similar looking bugs based on early game screenshots of God of War 3. It is usually a lot easier to debug a game that boots successfully since you can make progress a lot faster if the code doesn’t randomly crash every few seconds. For this task, I decided to look into Dark Souls 2 which had multiple problems from tone-mapping to depth precision.

1. Dark Souls 2

Earlier in the month, hcorion fixed a mouse bug that was keeping Dark Souls 2 from booting. The game was relatively stable but had graphical artifacts that I identified as being related to the HDR pipeline.
After pouring through traces for a few days, it became apparent that some instruction to clamp negative values was missing. Searching for this led nowhere until I found that instructions in the target shader differed very slightly with those from other shaders in that 3 extra unused bits were being manipulated. Quick tests showed that these bits could add extra precision and clamping modifiers and implementing this into the emulator fixed the random bright spots.
The next challenge was the missing shadows. Looking through the traces showed that a color texture was being bound for use instead of a depth texture which made no sense. It was then when I discovered there was a problem with render target address aliasing. It is not possible to determine via addresses or MRT configuration if a memory block will be used for depth or color if set to both. It is also valid to do so on the PS3. The value to be written is determined by other settings such as depth test status or color write mask. After tuning the checks to only always allow one type of target to exist, shadows were working, but flames and collectibles were visible through walls.
Looking through again showed the game was writing to addresses as color buffers in RGBA then binding the memory as the depth buffer. This is allowed since its all just bits to the RSX. This prompted the creation of an overlay pass system to handle data casts between incompatible types such as color to depth. With the depth working properly it was time to fix the final issue – depth was not working correctly. In fact it looked as though only 8 bits of precision were available which is very poor.
I recognized this error from previous work handling data casts between depth textures and RGBA color and it was reported in other titles such as God of War collection and Castlevania: LOS2. The issue came down to respecting texture channel swizzles where the components are shuffled around during readback. After setting this up, Dark Souls 2 was more or less looking great.

2. God of War: HD Collection

As a consequence of properly fixing the depth casting/interpretation as RGBA color, games like God of War Collection also got partially fixed and I embarked to fix the remaining glitches.
The major issue with flickering around some objects like flames or the blades of chaos were fixed by fixing the depth, but shadows were not working on OpenGL. Quick testing showed that face winding on OpenGL was broken and was promptly fixed.

God of War I: Before vs. After

3. Demon’s Souls and Vulkan ZCull

This took a few days to implement and tune for accuracy and it works very well, albeit a little slow and very demanding on system resources. Tuning in the near future will fix that issue as well. This finally resolved the “sun shining indoors” bug when playing Demon’s Souls using Vulkan.
Other fixes applied to Dark Souls 2 such as implementing precision modifiers also fixed the last remaining visual bugs on the game such as the Valley of Defilement being overly bright to the point where geometry can be seen popping into view and also the dark tone on the character creation and profile loading screens.

Demon’s Souls: Before vs. After

4. Uncharted

Testers had reportedly gotten Uncharted 1 to boot as well as its demo. There were many problems with it, including spamming the infamous “Texture upload requested but texture not found” error as well as broken HDR pipeline and misaligned screen-space effects. Luckily this one was not too difficult since most of the work was already done when investigating Dark Souls 2. A few texture cache fixes later and the game was graphically okay, with the exception of broken shadows, but that could wait since there were more pressing issues.

5. Ratchet & Clank

Ratchet & Clank HD I, II, III and IV games were also booting with the SPU fixes, but there was a minor problem where there was no display output.
To be more accurate, sampled clamped edge artifacts were all over the screen meaning that a texture was accessed outside its boundary in the vertical axis. The issue came down to a bad interpretation of the s1 data type when inserted via immediate commands.
Another issue was missing loading screens which were fixed by aligning data writes in the float3 format to 16 bytes (essentially float4 configuration).

Ratchet & Clank I, II, III HD games and Ratchet: Deadlocked/Gladiator rendered Intros, Menus and Ingame like this

6. God of War 3

This one hit the existing RSX emulation pipeline hard and highlighted so many bugs. First was to get bugs related to texture readback (Write Color Buffers) out of the way. With this fixed, nothing improved, but investigations led to the reimplementation of the pack and unpack fragment shader instructions.
This game uses a lot of tricks to achieve scaling on floating point textures which was not possible natively on DX9-class hardware. This requires packing bits into 8 bit values, writing to RGBA8, scaling down, then reconstructing the floating point textures again, averaging, then the cycle repeats until the proper value is written to the final 1×1 target. This still does not fix the final problem with the game which is that it exploits register aliasing, which is difficult to implement. As such, brightness calibration is still off.
On the PS3, one 128-bit register can hold 8 half-floats or 4 full single precision floats. Writing to a half value will modify some bits in the float value that occupies the same memory region.
Fixes for this will be coming soon to rpcs3 once the implementation is ready.

God of War 3 Demo: Before and After first batch of fixes

List of known Improved Games

Note: This is far from being a complete list of improved games. There are surely many other games that also improved from the aforementioned changes. Obviously, there’s no way for us to test even half of the huge library that is the PS3’s. It’s up to you to retest your games and find out if and how they improved.

God of War I & II

Huge improvements made it so both God of War I and II are now Playable. Jarves’ SPU fixes fixed freezing cutscenes and finally brought us working Audio (previously the game was completely dead silent).
On the graphical side, kd-11 fixed broken lighting and shadows. This allows the game’s beauty to be finally fully enjoyed on RPCS3, as graphics are now perfect.

God of War II

God of War III

Oh boy. The game everyone kept asking endlessly for us to get fixed. It seems the time has finally come, as God of War III finally not only started properly booting with Jarves’ SPU fixes, it actually now goes Ingame!
But as nothing is a sea of roses, when we went Ingame, we found ourselves looking to an incredibly slow and graphically broken game (as we were already expecting from such an early emulator like RPCS3).
The game was running at ~1fps on battles, but the important detail here was that we were using SPU Interpreter, as SPU Recompiler wasn’t working due to an unimplemented instruction.
Jarves promptly implemented the missing instruction, and back ingame we went, this time with ~3fps instead of ~1fps. Although it may not seem like a lot, it is a ~3x increase on speed. Not bad as a first step towards achieving good framerates.

Interpreter vs. Fixed Recompiler
Next, kd-11 started looking into the graphical bugs. As described in kd-11’s RSX writeup above, this game uncovered many RSX related emulation bugs. As of now, work into debugging those is still ongoing, but some progress has already been made.

Here is a preview of the work-in-progress fixes that are currently being worked on (as of this post’s release). God of War 3 when? Soon!

God of War: Ascension

There’s still a weird looking bug with clipping on this one. Nevertheless, it also now goes Ingame!

Uncharted 1

Uncharted 1 now goes Ingame! Performance is not ideal yet, but progress on graphics has been done already as described by kd-11 in his above writeup.

Uncharted 2

Uncharted 2 previously crashed after the loading icon (spinning dagger). Now it shows intro and a few videos, and will crash after playing them.

Uncharted 3

Uncharted 3 Beta now shows title screen, Uncharted 3 Demo shows menus and Uncharted 3 (Disc) shows the Naughty Dog intro screen, but unfortunately none go Ingame yet.

Ratchet & Clank I, II, III, IV (Deadlocked/Gladiator)

Jarves’ fixes yet again saving the day, making all four mentioned Ratchet & Clank HD Remasters now go Ingame. After kd-11 fixed the R&C graphical issue (mentioned in RSX Improvements), all games started rendering proper graphics.
Sadly though, these games currently suffer from heavy flickering in textures, which is something we plan to debug and hopefully fix soon.

Ratchet and Clank: I, II, III, IV (Deadlocked/Gladiator)

Ratchet & Clank: Tools of Destruction

Ratchet & Clank: ToD now shows a couple of Intro screens before freezing.

LittleBigPlanet II

LittleBigPlanet II now goes Ingame, although for now it needs existing save data utility from a console (dev_hdd0/game/BCUS98245_USER1) in order to work.

LittleBigPlanet III

LittleBigPlanet III also goes Ingame, also needing existing save data utility from a console (dev_hdd0/game/BCUS98362_USER1).

WipEout HD

WipEout HD now goes past menus and goes Ingame, ready to race! Though do note it may be unstable, but despite that, the framerate is quite good.

inFamous 1

As most of you figured out from our progress report.. Yes, the last screenshot that was on it was inFamous 1. This game now boots and goes Ingame as well, however as stated in the video the full game gets stuck during the tutorial section and you can’t control your character. To get around this you can either load a save or play the demo version. Graphics are sadly heavily broken right now.

inFamous 2

And just like inFamous 1, inFamous 2 now boots to get ingame you need to play the demo version, as it currently requires the SPU interpreter option and doesn’t work with ASMJIT performance is lower than Infamous 1. Graphics are broken just like its predecessor.

Playstation All-Stars Battle Royale

Playstation All-Stars now goes Ingame while also rendering correct graphics. Sadly, the game is unstable with Vulkan and performance isn’t the best.

Heavenly Sword

Albeit a bit unstable at times, Heavenly Sword goes Ingame with good graphics.

Gran Turismo HD Concept

This title now also goes Ingame, and you can play through races. Graphics look good, but as of now they occasionally flicker. It also runs a bit slow, as one would expect.

Gran Turismo 5 Prologue

Gran Turismo 5 Prologue now goes to Menu, unfortunately with broken graphics.

Gran Turismo 5

Gran Turismo 5 now shows the copyright screen.

Gran Turismo 6

Gran Turismo 6 now shows… something.

The Last of Us

Yet another step towards getting the big boi to run in RPCS3. The Last of Us now goes further than the initial loading screen to display the Health Disclaimer and play some audio before dying.

Killzone 3

Killzone 3, which previously showed only a black screen, now shows Intro screens.

Motorstorm RC

Motorstorm RC now goes Ingame with a few graphical bugs.

Closing Words

These changes are a huge step in PS3 emulation, and now allow for huge AAA titles which whose emulation was eagerly awaited to start functioning.
While the games shown here aren’t in a Playable state yet, they’re now closer to reach such status than ever, as now most go Ingame and can be further debugged within RPCS3.
Lastly, do note that we haven’t extensively tested these changes with a broad range of games, so it’s up to you to find out which other games also improved, as surely many did!

Also, come check out our YouTube channel and Discord to stay up-to-date with any big news.

This blog post was written by Ani, ssshadow, Jarves and kd-11.

]]>
Lead Graphics Developer kd-11 Is Joining Nekotekina’s Patreon https://rpcs3.net/blog/2017/05/21/lead-graphics-developer-kd-11-is-joining-nekotekinas-patreon/ Sun, 21 May 2017 11:41:33 +0000 https://rpcs3.net/blog/?p=657 Continue reading Lead Graphics Developer kd-11 Is Joining Nekotekina’s Patreon]]> Veteran RPCS3 graphics developer kd-11 is joining Nekotekina’s Patreon. kd-11 has worked on RPCS3 since January 2016 and has since then fixed countless bugs in all graphics renderers and implemented a lot of missing functionality. Without his dedicated work, RPCS3 would certainly not be where it is today.

As you know lead core developer Nekotekina, who has worked on RPCS3 since 2013, launched his highly successful Patreon in January this year. Thanks to the overwhelming amount of support, he has been able to work on RPCS3 full time for 5 months now and the progress he has done is staggering. The RPCS3 team has discussed the best course of action for the road forward and have decided that the time is now right for kd-11 to join Nekotekina’s Patreon in order for him to obtain hardware necessary for development and testing.

The Purpose

As kd-11 works on the graphics side of things, especially the renderers using OpenGL, Vulkan, and D3D12 (Direct3D 12), modern hardware is required for development and testing. Ideally, he needs a modern AMD, Nvidia, and Intel GPU to easier identify bugs specific to one platform. Furthermore, kd-11 works as a consultant and therefore has the possibility to accept or turn down certain jobs. If support on Patreon reaches a certain level, he may be able to spend more time on the project.

As of now the goal is obtaining necessary hardware for development and testing:

  • – A modern AMD GPU that supports DirectX12 and Vulkan.
  • – A modern Nvidia GPU that supports DirectX12 and Vulkan.
  • – A modern Intel CPU where the iGPU supports DirectX12 and Vulkan

Roadmap

With the support of generous patrons kd-11 will be able to work on the following tasks:

Short term

  • – Investigate game specific bugs like the overly bright bloom in [redacted] or the overly dark lighting in Demon’s Souls.
  • – Improve performance and compatibility of all renderers.
  • – Enable Vulkan on Linux, which will bring a tremendous performance improvement for some games.
  • – Implement missing functionality that will fix various bugs in different games. For example, the broken shadows in many games including Demon’s Souls depend on this task.

Mid term

  • – Properly support some PlayStation 3 features like MSAA that are lacking at the moment.
  • – Implement RSX reports which are missing at the moment.

Long term

  • – Enable higher rendering resolution to play games at any resolution, for example 4K instead of 720p in Demon’s Souls or [redacted].
  • – Enable extra graphics options to support extra rendering features, such as custom anti-aliasing modes.

Closing words

kd-11 has recently done some significant performance improvements in graphics emulation. Check out the video below where many games are twice as fast, and some even more than that. Also do note that those aren’t all the games that received a boost from the mentioned changes as we couldn’t test all working games to find out, so you can find other games that will receive some boost on Vulkan.

You can support Lead Core Developer Nekotekina and Lead Graphics Developer kd-11 on Patreon with the link below. You can also find Nekotekina’s roadmap here.

 

 

Don’t forget to join our Discord server to chat with the developers and follow the latest progress on RPCS3.

]]>
Progress Report: Demon’s Souls Nearly Playable and RPCS3 v0.0.2 https://rpcs3.net/blog/2017/03/11/des/ Sat, 11 Mar 2017 13:11:17 +0000 https://rpcs3.net/blog/?p=325 Continue reading Progress Report: Demon’s Souls Nearly Playable and RPCS3 v0.0.2]]>

It finally happened! The PlayStation 3 emulator RPCS3 has launched one of the most iconic games on the platform: Demon’s Souls. Are you curious to know how it all happened? What the developers went through? Welcome to this first of hopefully many to come developer logs where we will now tell you everything.

It all began in our Discord channel where a user going by the nickname, Numan approached us with some interesting news. He claimed to have conducted a detailed investigation of what Demon’s Souls was trying to do when it was crashing one second after booting. He drew the conclusion that the game was trying to allocate memory pages of different sizes, access levels, and different attributes. When the game then tried to access a specific memory address, it crashed with an access violation. Consequently, these discoveries lead to a more accurate implementation of the function sys_memory_get_page_attribute() which was responsible for this particular crash. Suddenly the game booted up in RPCS3 for the first time ever and showed a loading animation!

The Beginning Hours

After loading for a while, the loading screen faded out and we faced a black screen and nothing more. Analysis showed that the game was trying to communicate with PSN and connect to the servers for online play. Some changes in the sceNp module were made to tell the game that “the console” is offline and no connections should be made. The game now loaded a bit further, started a few more thread… and we faced even more disappointment: still a black screen and nothing unusual in the logs. A dead end. For another day or two, no progress was made.

You know what they say about not being able to see what is right under one’s nose. A very common thing was happening; the game was loading encrypted .sdat files. However, the emulator was not decrypting these on the fly at this point in time (last week that is, now it does thanks to Jarveson). So the game loaded encrypted files which could not be processed and the game got stuck. When Numan went through the logs again and noticed this oversight, he made a big facepalm and then decrypted the 26 .sdat files manually. Then the miracle happened, the game started to show some introduction screens!

The game then complained about a lack of space on the hard disk. This problem was quickly circumvented by creating some empty directories that it failed to create itself. This will be fixed properly later on with some changes in the cellGame module.

The opening video now started to play, although one could only hear it as the display was black. The video was skipped and the game reached the main menu:

With much anticipation a new game was started!

And… we are ingame!

But the graphics are not very impressive. Let’s try again.

Much better. So what happened here? ssshadow channeled the power of the soul arts and managed to get the game to display the ingame graphics. However, it happened by accident, he played around with the ingame brightness slider while reloading the save. When setting brightness to zero, reloading, and then setting it to the maximum value of 10 graphics would sometimes randomly display. Most often however, they would still be black. This lucky person ran through the first tutorial level, killed all the enemies and was generally pleased by the performance.

Meanwhile it became obvious that much more work was still needed. The game makes use of many of the features the platform provides, and thanks to this many imperfections in the graphics implementation surfaced. Lead graphics developer kd-11 immediately started debugging and soon enough fixed the videos and the main menu:

The most difficult task still remained, to find the reason why the ingame graphics were almost always completely black. Kd-11 rolled up his sleeves and started to rewrite parts of the shader cache and image buffers. It took another full week of experimenting, debugging, and retesting but the actual reason for the missing graphic were finally found. The value of a uniform fragment shader variable responsible for overall scene brightness was found to be calculated to negative zero. The resulting vector was therefore nullified and the image was not visible (although still drawn correctly in the dark). During the search of a solution dozens of other bugs were detected and fixed in among many parts of the emulator the shader decompiler (https://github.com/RPCS3/rpcs3/pull/2482) which fixed a lot of issues in many other games too. Finally, at the end of the week the game consequently looked like this:

With a few more fixes the graphics and performance were improved even further. The game is mostly correctly displayed, special effects such as fog, motion blur, bloom, particle effects and much more are all there:

Last but not least it was time for Nekotekina to work his magic as well. Almost three weeks in the making he finally committed his reservations re-rewrite which not only increases performance in this game by some 50%, but also gives a nice boost to the overall performance of RPCS3 in general. For example, [redacted] is almost ten times faster than it was before, now reaching 10 – 30FPS on a fast CPU. This commit finally made it possible to reach a “smooth” 30FPS in many parts of Demon’s Souls:

At the moment, there are still several known problems with Demon’s Souls:

  • Performance. The game is very demanding of resources, and while Ryzen @ 4 ghz or 6 cores of Haswell-E can run some areas of the game at 30 fps, it can also drop down to as little as 10 fps in big open areas such as in front of The Boletarian Castle. One really wants a stable 30 fps (native frame rate, maybe someone will mod it to 60 fps), and preferably also on “normal” CPU’s. But there are both short and long term plans to improve performance, for example by making the LLVM recompiler not crash in this game.

  • The player character shadow is missing, and there are other minor graphical bugs here and there.

  • The sound is a bit unstable. It can work fine for a while, but after some 5-10 minutes it can suddenly stop. There are also problems where sound effects are repeated before they are finished or they sound very loud and strange.

  • The game can randomly get stuck on loading screens. Not critical as it auto-saves continuously.

RPCS3 v0.0.2

As you probably noticed by the title already, we are entering a new version (and no more Pre-Alpha now, just Alpha!). It has been a really long time since the last version bump (v0.0.1 Pre-Alpha on 17 Jun 2016). Since then, a lot of improvements were made, improvements big enough that we finally decided to finally bump the version again. The version will be officially bumped on GitHub as soon as the last pull requests related to Demon’s Souls are posted.

Resumed Changelog since v0.0.1 Pre-Alpha:

PPU/SPU
– PPU LLVM AOT recompiler reimplemented
– PPU LLVM caching implemented
– PPU thread scheduler implemented
– PPU breakpoints reimplemented
– PPU analyzer improved
– Various LV2 system improvements
– IdManager improvements
– Debugger fixed and enhanced
– PPU/SPU accuracy improvements

Memory
– Memory system cleanup
– sys_memory_get_page_attribute improvements

Graphics
A LOT of bugfixes and accuracy improvements for all Graphic backends. (There were really a lot of improvements here and we can’t list them all!)
– Shader decompiler improvements
– Several RSX bugfixes and accuracy improvements

HLE
– Major sys_net improvements
– cellOsk implemented
– cellVDec fixes and improvements
– Several other small improvements

Input
– MMJoystick implemented

Linux
– Several Linux specific bugfixes were made. Some are still being worked on as there are still a few Linux specific bugs.

Vita
– Initial package unpacking implemented
– Small Interpreter improvements

Logging
– Logging system cleanup
– TLS bugfixes and improvements

Misc
– Automatic LLE loading
– MSELF, SDAT, EDAT, SPRX: Decryption on the fly!
– Firmware update file (PS3UPDAT.PUP) installer
– XAudio fixes

Many other unlisted bugfixes and improvements

The Conclusion

Regardless, the fact that Demon’s Souls goes ingame and is playable to some extent is certainly a huge milestone for RPCS3. I would like to thank every developer who made this possible. Numan that did the initial investigations and got the first boot, Oil who helped work on the same issues, kd-11 that fixed countless of graphical issues, and Nekotekina who improved the overall performance. Of course even only tangentially related improvements by a lot of other people have helped a lot too. Jarvesson implemented automatic .sdat decryption that increases ease of use and ssshadow implemented cellOsk (on screen keyboard) earlier this year which this game uses for player name input in the beginning.

Do you want to try it out? It seems like only the US and EU disc versions of the game currently work. Simply download the latest RPCS3 build here and turn on the setting “write color buffers”. Also read the quickstart guide, check the forum thread, and ask for help on our Discord channel where all of this started.

You can support lead developer Nekotekina on Patreon. Your support will help speed up the development of the emulator so that one day this game will be perfectly playable from start to finish with good performance and accurate graphics.

]]>