hrydgard / ppsspp

A PSP emulator for Android, Windows, Mac and Linux, written in C++. Want to contribute? Join us on Discord at https://discord.gg/5NJB6dD or just send pull requests / issues. For discussion use the forums at forums.ppsspp.org.
https://www.ppsspp.org
Other
11.19k stars 2.17k forks source link

Screen animation issue (Kaitou Apricot & E'tude Prologue) #15232

Open glitchengineer opened 2 years ago

glitchengineer commented 2 years ago

Game or games this happens in

Kaitou Apricot Portable (ULJM05276) & E'tude Prologue Portable (ULJM05252)

What area of the game

Everytime the screen changes (new character appears on the screen or when the location changes).

What happens

The animation that is used to change the screen has color on it, when it should be completely black.

Here's E'tude Prologue: ULJM05252_00000

Here's Kaitou Apricot: ULJM05276_00000

In E'tude Prologue's case, the color seems to come from the loading screen: ULJM05252_00003

Not so sure with Kaitou Apricot: ULJM05276_00000

Also worth noting is that when I used a savestate and loaded it, the animation now uses whatever was on the screen in the savestate: ULJM05252_00005

EDIT:

I did some more testing with different settings and I think I managed to find what might cause the bug. Changing Rendering mode from Buffered rendering to Skip buffer effects seems to fix the animation: ULJM05252_00001

I also checked if the issue was also in an older version of PPSSPP (I tested it on version 1.11) and it was there. I changed the Rendering mode and it fixed the issue there too.

One more thing: before I changed the Rendering mode setting, I tried changed window size and rendering resolution ingame and in both cases the animation started to use what was on the screen at that moment (just like with savestates).

EDIT 2:

I tried the newest build to see if anything had changed and realized I hadn't even tried to use the Software renderer. The animations play correctly on that:

Apricot_Software

Comparison:

Apricot4

Other animations:

Apricot_Software2

Apricot_Software3

The GE dump using Software renderer is in the comments.

What should happen

I have tested both games on a real psp and the animation is meant to be black (or transparent).

EDIT:

The animation is meant to be transparent, not black.

GE frame capture

Not sure if it got captured, since it only lasts a fraction of a second: recording.zip

Platform

Windows

Mobile phone model or graphics card

NVIDIA GeForce GTX 1070

PPSSPP version affected

v1.12.3

Last working version

No response

Graphics backend (3D API)

OpenGL / GLES

Checklist

hrydgard commented 2 years ago

Why did you close it? Is it somehow fixed in the latest build?

unknownbrackets commented 2 years ago

Sounds like skip buffer effects works around it by skipping the effect, but there's likely a missing framebuffer download is my guess.

I'm going to reopen until it's confirmed this was fixed, since I don't know of any recent fixes to framebuffer downloads...

-[Unknown]

glitchengineer commented 2 years ago

@hrydgard @unknownbrackets

Sorry for closing the issue. I thought that the problem was with my settings and not with the emulation, since it started to work with changing the rendering mode.

I tested it again with build v1.12.3-491-gcc767622d and the animation doesn't work there (unless you change the rendering mode), so the issue is still there.

glitchengineer commented 2 years ago

I wanted to include the GE dump in the main post, but it wouldn't let me so here it is:

Recording2.zip

unknownbrackets commented 2 years ago

In that frame dump, it's 17/17 drawing the transition. The texture is a 512x512 texture from RAM, which has what looks like a partial transition applied to it via alpha.

I'm guessing this game copies the current rendering from VRAM to RAM every frame, modifying the alpha during or right after the transfer in RAM. The texture is 8888, so it's devoting 510 KB of RAM to this operation. Since the stride in RAM is 480, it's clearly been compacted compared to VRAM as part of the transfer.

This game clears in a straight-forward way before drawing, which tells us the safe area of RAM to update. We update this RAM only on the first frame after a hardware surface is created - that's why resizing, changing settings, loading a save state, or other such operations cause the rendering from that moment to be used (these operations all recreate hardware surfaces.)

We probably need to figure out what function in this game is accessing VRAM and create a hook for it to trigger a download from the hardware surface.

-[Unknown]