Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distorted garbage textures in "Lick It" demo #19435

Closed
4 of 5 tasks
ghost opened this issue Sep 5, 2024 · 10 comments · Fixed by #19459
Closed
4 of 5 tasks

Distorted garbage textures in "Lick It" demo #19435

ghost opened this issue Sep 5, 2024 · 10 comments · Fixed by #19459
Labels
GE emulation Backend-independent GPU issues
Milestone

Comments

@ghost
Copy link

ghost commented Sep 5, 2024

Game or games this happens in

Lick It

What area of the game

Everywhere

What happens

Distorted garbage textures

What should happen

Render correct textures

GE frame capture

Distorted garbage textures

Platform

Linux / BSD

Mobile device model or graphics card (GPU)

Mesa Intel(R) HD Graphics 520 (SKL GT2) or NVIDIA GeForce 940M/PCIe/SSE2

PPSSPP version affected

v1.17.1-1018-g450ac75ee

Last working version

No response

Graphics backend (3D API)

Vulkan

Checklist

  • Test in the latest git build in case it's already fixed.
  • Search for other reports of the same issue.
  • Try resetting settings or older versions and include if the issue is related.
  • Try changing graphics settings to determine if one causes the glitch (especially speed hacks or enhancements/replacements.)
  • Include logs or screenshots of issue.
@ghost ghost changed the title Distorted garbage textures in [Lick It](https://www.pouet.net/prod.php?which=25858) Distorted garbage textures in "Lick It" demo Sep 5, 2024
@hrydgard hrydgard added this to the v1.18.0 milestone Sep 5, 2024
@hrydgard hrydgard added the GE emulation Backend-independent GPU issues label Sep 5, 2024
@anr2me
Copy link
Collaborator

anr2me commented Sep 5, 2024

Wow even software renderer doesn't work for this game
image
But that texture that looked like lines at the top right of the screen, looked similar to an image that have a different width with the visible framebuffer that being rendered as a continues pixel array (where pixels that supposed to go to the next row ended at the right side of the current row)

PS: I also saw this in the logs Core\Compatibility.cpp:153 N[G3D]: UnitsPerMeter for EBOO00649: 0.000000
Does UnitsPerMeter allowed to be 0? (i don't know what is UnitsPerPeter)

@hrydgard
Copy link
Owner

hrydgard commented Sep 6, 2024

UnitsPerMeter is only for VR, so it's not related.

This is really surprising, probably the game is doing something slightly invalid when specifying the texture that we are not handling the same as the hardware. Will need to investigate.

@hrydgard
Copy link
Owner

hrydgard commented Sep 7, 2024

This is probably not a rendering problem, the log shows stuff like:

26:17:499 TRSI_LICK_IT I[PRINTF]: HLE\sceIo.cpp:1197 stdout: [DB] loading PNG ms0:/PSP/GAME/__SCE__LICKIT/data/textures/scene4_prod_noblur.png failed ! error -1
26:17:499 TRSI_LICK_IT I[PRINTF]: HLE\sceIo.cpp:1197 stdout: [scene4_preRender] load blurred production Texture
26:17:516 TRSI_LICK_IT I[PRINTF]: HLE\sceIo.cpp:1197 stdout: [DB] loading PNG ms0:/PSP/GAME/__SCE__LICKIT/data/textures/scene4_prod_blur.png failed ! error -1
26:17:516 TRSI_LICK_IT I[PRINTF]: HLE\sceIo.cpp:1197 stdout: [SCENE4_TEST] scene4_preRender ended

So it's just failing to load the textures, and texturing from garbage memory.

The question now is why it fails to load the texture. It uses the old PSP 1.5 "swap trick" with the real executable in __SCE__LICKIT and the icon and stuff in %__SCE__LICKIT, but I don't see how that would affect the texture loading.. maybe some relative path thing we're getting wrong, and it gets confused?

Because it seems it doesn't even attempt to do any I/O, it just claims the texture loads failed!

Anyway, deprioritizing.

@hrydgard hrydgard modified the milestones: v1.18.0, v1.19.0 Sep 7, 2024
@anr2me
Copy link
Collaborator

anr2me commented Sep 7, 2024

Right, after sceIoOpen it read from STDIN instead of the opened fd, and then close the fd and claimed it failed, strange indeed

01:36:389 TRSI_LICK_IT D[SCEIO]: HLE\sceIo.cpp:1284 21=sceIoWrite(1, 08b72fa0, 21)
01:36:390 TRSI_LICK_IT I[PRINTF]: HLE\sceIo.cpp:1197 stdout: [Drain_preRender] load Color texture
01:36:390 TRSI_LICK_IT D[SCEIO]: HLE\sceIo.cpp:1284 25=sceIoWrite(1, 08b72fa0, 25)
01:36:396 TRSI_LICK_IT D[SCEIO]: HLE\sceIo.cpp:1610 4=sceIoOpen(ms0:/PSP/GAME/__SCE__LICKIT/data/textures/start_logo1_color.png, 1, 438)
01:36:399 TRSI_LICK_IT D[SCEIO]: HLE\sceIo.cpp:1061 sceIoRead STDIN
01:36:399 TRSI_LICK_IT D[SCEIO]: HLE\sceIo.cpp:1156 0=sceIoRead(3, 0bfbfca8, 8)
01:36:399 TRSI_LICK_IT D[SCEIO]: HLE\sceIo.cpp:1616 sceIoClose(4)
01:36:399 TRSI_LICK_IT I[PRINTF]: HLE\sceIo.cpp:1197 stdout: [DB] loading PNG ms0:/PSP/GAME/__SCE__LICKIT/data/textures/start_logo1_color.png failed ! error -1
01:36:399 TRSI_LICK_IT D[SCEIO]: HLE\sceIo.cpp:1284 63=sceIoWrite(1, 08b72fa0, 63)
01:36:399 TRSI_LICK_IT I[PRINTF]: HLE\sceIo.cpp:1197 stdout: [Drain_preRender] load B&W texture
01:36:399 TRSI_LICK_IT D[SCEIO]: HLE\sceIo.cpp:1284 23=sceIoWrite(1, 08b72fa0, 23)
01:36:402 TRSI_LICK_IT D[SCEIO]: HLE\sceIo.cpp:1610 4=sceIoOpen(ms0:/PSP/GAME/__SCE__LICKIT/data/textures/start_logo1_nocolor.png, 1, 438)
01:36:403 TRSI_LICK_IT D[SCEIO]: HLE\sceIo.cpp:1061 sceIoRead STDIN
01:36:403 TRSI_LICK_IT D[SCEIO]: HLE\sceIo.cpp:1156 0=sceIoRead(3, 0bfbfca8, 8)
01:36:403 TRSI_LICK_IT D[SCEIO]: HLE\sceIo.cpp:1616 sceIoClose(4)
01:36:403 TRSI_LICK_IT I[PRINTF]: HLE\sceIo.cpp:1197 stdout: [DB] loading PNG ms0:/PSP/GAME/__SCE__LICKIT/data/textures/start_logo1_nocolor.png failed ! error -1

PS: after this game crashed (due to invalid memory access) and showing purple screen, i tried to close PPSSPP using the [X] button, but PPSSPP crashed instead.
image

@hrydgard
Copy link
Owner

hrydgard commented Sep 9, 2024

Oh, I guess I had my logging settings wrong, I didn't see the stdin read... I guess we'll need to api-trace this on hardware to get some clues.

Hm, that crash-upon-crash is unexpected...

@anr2me
Copy link
Collaborator

anr2me commented Sep 9, 2024

Btw, does reading STDIN means reading the last opened file? i don't understand why the game didn't use the outputted fd when reading it.

@sum2012
Copy link
Collaborator

sum2012 commented Sep 14, 2024

(upload lickit here prevent lose)
tt-lickit_psp.zip
Jpcsp run it no problem
jpcsp io debug log
jpcsplog.zip

@hrydgard
Copy link
Owner

hrydgard commented Sep 14, 2024

Interesting, seems the game just assumes the returned ID is 3, which JPCSP returns, while we return 4. So we probably have different behavior in file descriptor allocation... Maybe 3 should only be forced to be stdin after some function has been called?

06:10:15 DEBUG hle.IoFileMgrForUser - TRSI_LICK_IT - sceIoWrite returning 0x5A
06:10:15 DEBUG hle.IoFileMgrForUser - TRSI_LICK_IT - sceIoOpen filename=0x09FBF6E0('ms0:/PSP/GAME/tt-lickit_psp/__SCE__LICKIT/data/samples/thxmono22.wav'), flags=0x1, permissions=0x1B6
06:10:15  INFO hle.IoFileMgrForUser - TRSI_LICK_IT - hleIoOpen filename = ms0:/PSP/GAME/tt-lickit_psp/__SCE__LICKIT/data/samples/thxmono22.wav flags = 1 permissions = 0666
06:10:15 DEBUG hle.IoFileMgrForUser - TRSI_LICK_IT - PSP_O_RDONLY
06:10:15 DEBUG hle.IoFileMgrForUser - TRSI_LICK_IT - hleIoOpen assigned id=0x3
06:10:15 DEBUG hle.IoFileMgrForUser - TRSI_LICK_IT - sceIoOpen returning 0x3
06:10:15  INFO compiler - TRSI_LICK_IT - Replacing CodeBlock at 0x0897D6DC by Native Code 'memcpy'
06:10:15 DEBUG hle.IoFileMgrForUser - TRSI_LICK_IT - sceIoLseek id=0x3, offset=0x0, whence=0x1

@sum2012
Copy link
Collaborator

sum2012 commented Sep 15, 2024

I fix the game :)
3

@hrydgard
Copy link
Owner

hrydgard commented Sep 15, 2024

Yeah, that takes care of it indeed, and is correct. Too bad this demo really isn't a great production though! :)

@hrydgard hrydgard modified the milestones: v1.19.0, v1.18.0 Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GE emulation Backend-independent GPU issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants