sharpemu icon indicating copy to clipboard operation
sharpemu copied to clipboard

Demon's Souls [PPSA01341]

Open par274 opened this issue 8 months ago • 68 comments

Game Name

Demon's Souls

Title ID

PPSA01341

Game Version

1.00

Current Status

Crashes on boot

Description

Stops around sceKernelGetTscFrequency or related modules.

Log File

PPSA01341.txt

Operating System

Windows 11

CPU

5800X3D

GPU

4070S

RAM

64 GB

Emulator Version / Commit

0.0.1

Renderer

Vulkan

Additional Notes

No response

par274 avatar Mar 12 '26 13:03 par274

I think this is the game where I've made the most progress. However, I don't think the problem stems from TSC.

par274 avatar Mar 12 '26 13:03 par274

New milestone;

**********************************************************************************************************
* BPE_VERIFY_OSRESULT_DEFAULT_VALUE() FAILURE: ?v

* File: BPE_VERIFY_OSRESULT_DEFAULT_VALUE() (-266380576)
* BuildVersion: ?v
                  IsAPackageBuild: sceGameUpdateInitialize() Bui* Running Duration:
* Message: X??
**********************************************************************************************************
**********************************************************************************************************
(null) FAILURE: (null)

par274 avatar Jun 14 '26 10:06 par274

New milestone but no videoOut.

It stop around TaskGraphThreadBP

par274 avatar Jun 21 '26 20:06 par274

https://github.com/par274/sharpemu/commit/01ebab90c0b91670a25c98602318e000f098b393 new milestone;

Demon's Souls now reached shader/resource initial loading.

des-playgo-20260623-154008.log

par274 avatar Jun 23 '26 12:06 par274

[LOADER][WARN] Import#127659 result: 1 (Up36PTk687E) rdi=0x00000000000000FF rsi=0x0000000000000000 rdx=0x00000000000000
00 rcx=0x0000000000000000 ret=0x0000000800945269
[LOADER][TRACE] videoout.register_buffers handle=1 group=0 start=0 count=2 fmt=0x8100000022000000 tile=0 1920x1080 pitc
h=1920

Good news.

des-video-20260623-191307.log

https://github.com/par274/sharpemu/commit/4ab614e68aec8c3faaa722cb1abacdff8d09be09

par274 avatar Jun 23 '26 16:06 par274

Demon's Souls is now create shader and showing splash image.

https://github.com/par274/sharpemu/commit/af35389bfdea88e190e52427a0cb8d0ad2211004

Image

PPSA01341.log

After this point, the game loops through the scePthreadMutexUnlock phases, meaning it hasn't "fully" entered the shader translator phase yet.

par274 avatar Jun 28 '26 20:06 par274

https://github.com/par274/sharpemu/commit/873f473b65d3d9947f3e0c966ce1ea52e1482e18

Demon's Souls has now progressed to reading save data and entering the PlayGo chunk phase.

des-playgo-trace-20260629-133803.log

par274 avatar Jun 29 '26 10:06 par274

Now reaching shader translator stage.

[LOADER][TRACE] videoout.submit_flip handle=1 index=-1 mode=1 arg=0 events=0

Image

des-videoout-20260629-135244.log

par274 avatar Jun 29 '26 11:06 par274

Shaders continues, the game now stays in a video loop without crashing. The next step is to convert the commands to SPIR-V/Vulkan.

Image

par274 avatar Jun 29 '26 14:06 par274

@par274 Does it work on the latest version?

SplaatSites avatar Jul 01 '26 19:07 SplaatSites

@par274 Does it work on the latest version?

Yes, it works on the latest version. A better question is: how far it gets.

Demon's Souls is currently one of the most advanced games running on the emulator. The game seems to continue streaming without any crash in the background, but we don't get any image output yet because the AGC shader translation and rendering pipeline aren't complete.

I have a significant amount of rendering work that hasn't been advanced yet, and each improvement moves the game further along the graphics rendering pipeline. Since Demon's Souls uses a large portion of the rendering engine, the progress made here is expected to benefit many other games as well.

par274 avatar Jul 01 '26 23:07 par274

@par274 Does it work on the latest version?

Yes, it works on the latest version. A better question is: how far it gets.

Demon's Souls is currently one of the most advanced games running on the emulator. The game seems to continue streaming without any crash in the background, but we don't get any image output yet because the AGC shader translation and rendering pipeline aren't complete.

I have a significant amount of rendering work that hasn't been advanced yet, and each improvement moves the game further along the graphics rendering pipeline. Since Demon's Souls uses a large portion of the rendering engine, the progress made here is expected to benefit many other games as well.

Like Bubsy 4D, Astro Bot and other 3D games?

SplaatSites avatar Jul 01 '26 23:07 SplaatSites

@par274 Does it work on the latest version?

Yes, it works on the latest version. A better question is: how far it gets. Demon's Souls is currently one of the most advanced games running on the emulator. The game seems to continue streaming without any crash in the background, but we don't get any image output yet because the AGC shader translation and rendering pipeline aren't complete. I have a significant amount of rendering work that hasn't been advanced yet, and each improvement moves the game further along the graphics rendering pipeline. Since Demon's Souls uses a large portion of the rendering engine, the progress made here is expected to benefit many other games as well.

Like Bubsy 4D, Astro Bot and other 3D games?

Yes. As the graphics pipeline becomes more mature, achieving accurate images in other games will become significantly easier. Of course, each game has its own specific requirements during boot and initial run. I recently tested Astro Bot, but right now my entire focus is on completing the graphics processing pipeline before dedicating time to game-specific issues.

par274 avatar Jul 01 '26 23:07 par274

@par274 Does it work on the latest version?

Yes, it works on the latest version. A better question is: how far it gets. Demon's Souls is currently one of the most advanced games running on the emulator. The game seems to continue streaming without any crash in the background, but we don't get any image output yet because the AGC shader translation and rendering pipeline aren't complete. I have a significant amount of rendering work that hasn't been advanced yet, and each improvement moves the game further along the graphics rendering pipeline. Since Demon's Souls uses a large portion of the rendering engine, the progress made here is expected to benefit many other games as well.

Like Bubsy 4D, Astro Bot and other 3D games?

Yes. As the graphics pipeline becomes more mature, achieving accurate images in other games will become significantly easier. Of course, each game has its own specific requirements during boot and initial run. I recently tested Astro Bot, but right now my entire focus is on completing the graphics processing pipeline before dedicating time to game-specific issues.

Neat.

SplaatSites avatar Jul 01 '26 23:07 SplaatSites

And Astro Bot probably crashes on Sharpemu.

SplaatSites avatar Jul 01 '26 23:07 SplaatSites

And Astro Bot probably crashes on Sharpemu.

Actually, no. The current obstacle isn't the render engine, but the AVX-512 implementation. Astro Bot appears to be following "extended" AVX-512 instructions. We haven't progressed enough yet for graphics to become the limiting factor.

par274 avatar Jul 01 '26 23:07 par274

Actually, the PS5 CPU doesn't support AVX-512; it supports AVX2 at most. If Astro Bot really uses those instructions, I honestly have no idea where it gets them from, because it certainly isn't from the CPU.

dareksan3KY avatar Jul 09 '26 20:07 dareksan3KY

Actually, the PS5 CPU doesn't support AVX-512; it supports AVX2 at most. If Astro Bot really uses those instructions, I honestly have no idea where it gets them from, because it certainly isn't from the CPU.

According to a popular AI's answer, yes, it doesn't support it. However, in the real world, when translating processor instructions with JIT, if you use a decoder (like Iced), it will explicitly tell you "this requires AVX-512 instructions." Because if I hadn't included these basic instructions, no game would currently crash before even booting, let alone displaying the image.

Remember, Zen 2 processors certainly don't support AVX-512, but we never know what Sony is doing. Also, not supporting AVX-512 doesn't mean the game has completely abandoned that instruction set. So I'm seeing instructions that decode as AVX-512 during JIT translation. I'm still investigating whether this is expected guest code, a decoding issue, or something else.

I certainly can't take a definitive stance just because it's using this instruction set; I'll simply act according to what the decoder says. The game might be using fallback here, you could come up with a lot of theories.

par274 avatar Jul 09 '26 21:07 par274

Fixed slow resource loading. #32

par274 avatar Jul 09 '26 22:07 par274

Actually, the PS5 CPU doesn't support AVX-512; it supports AVX2 at most. If Astro Bot really uses those instructions, I honestly have no idea where it gets them from, because it certainly isn't from the CPU.

According to a popular AI's answer, yes, it doesn't support it. However, in the real world, when translating processor instructions with JIT, if you use a decoder (like Iced), it will explicitly tell you "this requires AVX-512 instructions." Because if I hadn't included these basic instructions, no game would currently crash before even booting, let alone displaying the image.

Remember, Zen 2 processors certainly don't support AVX-512, but we never know what Sony is doing. Also, not supporting AVX-512 doesn't mean the game has completely abandoned that instruction set. So I'm seeing instructions that decode as AVX-512 during JIT translation. I'm still investigating whether this is expected guest code, a decoding issue, or something else.

I certainly can't take a definitive stance just because it's using this instruction set; I'll simply act according to what the decoder says. The game might be using fallback here, you could come up with a lot of theories.

The game's engine might be including some xplat code that conditionally uses AVX512 based on if the CPU supports it or not (like via a cpuid-based check for example), I have seen this in few Xbox One/Series games as well despite the CPU there not having AVX512 too

unrelated question, I don't know how PS5 ELFs work but I was wondering why you are JIT'ing them through a decoder rather than mapping them directly, is it to make patching them easier or something like that?

ahmed605 avatar Jul 10 '26 19:07 ahmed605