EmuNewz Network
A few bugs in recent changes - Printable Version

+- EmuNewz Network (https://www.emunewz.net/forum)
+-- Forum: PSP Emulation (https://www.emunewz.net/forum/forumdisplay.php?fid=191)
+--- Forum: JPCSP Official Forum (https://www.emunewz.net/forum/forumdisplay.php?fid=51)
+---- Forum: svn trunk discussion (https://www.emunewz.net/forum/forumdisplay.php?fid=56)
+---- Thread: A few bugs in recent changes (/showthread.php?tid=10730)



A few bugs in recent changes - Itaru - 10-15-2011

I want to point out that the changes done in r2323 to jpcsp.graphics.RE.REShader specifically in the setShaderFlag() method (lines 556 to 561) cause missing graphics in some games when shader implementation of stencil test is enabled, ie. missing parts of walls in Persona 1, missing dancing silhouettes at the title screen in Hatsune Miku Project Diva 2nd, and missing faces & backgrounds in K-ON Houkago Live. Removing the "setFlag = false;" (line 559) fixes this problem. Of course, if that line is supposed to be there and the missing graphics is due to the stencil depth test not being complete/enabled yet in the source code, then please ignore.

Also, changes in r2345 cause saves in some games to be broken. I believe it's related to improper processing of the "Handle SAVEDATA in crypto mode" setting due to the changes in settings handling in r2345. Saves that I've made in previous revisions with that setting enabled are no longer recognized in r2345, but only in some games. Conversely, saves that I've made in previous revisions with that setting disabled can still be properly loaded in latest JPCSP with that setting enabled. I've attached log files for Persona 1 when loading saves. Encrypted saves for Hatsune Miku Project Diva 2nd are also not recognized in latest revision, but oddly enough the encrypted saves for The 3rd Birthday and Persona 2 work fine in the latest revision.

Furthermore, latest revision has a problem when trying to quit JPCSP after running a game. Closing the JPCSP window just hangs the emulator, and closing the console window causes unknown software exception in java.exe.

Please let me know if you need more info. Thanks!


RE: A few bugs in recent changes - legend80 - 10-15-2011

(10-15-2011, 01:25 PM)Itaru Wrote: I want to point out that the changes done in r2323 to jpcsp.graphics.RE.REShader specifically in the setShaderFlag() method (lines 556 to 561) cause missing graphics in some games when shader implementation of stencil test is enabled, ie. missing parts of walls in Persona 1, missing dancing silhouettes at the title screen in Hatsune Miku Project Diva 2nd, and missing faces & backgrounds in K-ON Houkago Live. Removing the "setFlag = false;" (line 559) fixes this problem. Of course, if that line is supposed to be there and the missing graphics is due to the stencil depth test not being complete/enabled yet in the source code, then please ignore.

Also, changes in r2345 cause saves in some games to be broken. I believe it's related to improper processing of the "Handle SAVEDATA in crypto mode" setting due to the changes in settings handling in r2345. Saves that I've made in previous revisions with that setting enabled are no longer recognized in r2345, but only in some games. Conversely, saves that I've made in previous revisions with that setting disabled can still be properly loaded in latest JPCSP with that setting enabled. I've attached log files for Persona 1 when loading saves. Encrypted saves for Hatsune Miku Project Diva 2nd are also not recognized in latest revision, but oddly enough the encrypted saves for The 3rd Birthday and Persona 2 work fine in the latest revision.

Furthermore, latest revision has a problem when trying to quit JPCSP after running a game. Closing the JPCSP window just hangs the emulator, and closing the console window causes unknown software exception in java.exe.

Please let me know if you need more info. Thanks!

I can definetely confirm the hang on exit issue.


RE: A few bugs in recent changes - gid15 - 10-16-2011

(10-15-2011, 01:25 PM)Itaru Wrote: I want to point out that the changes done in r2323 to jpcsp.graphics.RE.REShader specifically in the setShaderFlag() method (lines 556 to 561) cause missing graphics in some games when shader implementation of stencil test is enabled, ie. missing parts of walls in Persona 1, missing dancing silhouettes at the title screen in Hatsune Miku Project Diva 2nd, and missing faces & backgrounds in K-ON Houkago Live. Removing the "setFlag = false;" (line 559) fixes this problem. Of course, if that line is supposed to be there and the missing graphics is due to the stencil depth test not being complete/enabled yet in the source code, then please ignore.
I wanted to revert r2323, but I missed this change. I will check it.

(10-15-2011, 01:25 PM)Itaru Wrote: Also, changes in r2345 cause saves in some games to be broken. I believe it's related to improper processing of the "Handle SAVEDATA in crypto mode" setting due to the changes in settings handling in r2345. Saves that I've made in previous revisions with that setting enabled are no longer recognized in r2345, but only in some games. Conversely, saves that I've made in previous revisions with that setting disabled can still be properly loaded in latest JPCSP with that setting enabled. I've attached log files for Persona 1 when loading saves. Encrypted saves for Hatsune Miku Project Diva 2nd are also not recognized in latest revision, but oddly enough the encrypted saves for The 3rd Birthday and Persona 2 work fine in the latest revision.
I've reviewed again the code for the settings handling of "Handle SAVEDATA in crypto mode" and cannot find any problem, it should work like before. Could you do more testing, e.g. by adding a log in CryptoEngine.setSavedataCryptoStatus to check the value of the flag?

(10-15-2011, 01:25 PM)Itaru Wrote: Furthermore, latest revision has a problem when trying to quit JPCSP after running a game. Closing the JPCSP window just hangs the emulator, and closing the console window causes unknown software exception in java.exe.
This should now be fixed in r2352.

Thanks!
(10-15-2011, 01:25 PM)Itaru Wrote: I want to point out that the changes done in r2323 to jpcsp.graphics.RE.REShader specifically in the setShaderFlag() method (lines 556 to 561) cause missing graphics in some games when shader implementation of stencil test is enabled, ie. missing parts of walls in Persona 1, missing dancing silhouettes at the title screen in Hatsune Miku Project Diva 2nd, and missing faces & backgrounds in K-ON Houkago Live. Removing the "setFlag = false;" (line 559) fixes this problem. Of course, if that line is supposed to be there and the missing graphics is due to the stencil depth test not being complete/enabled yet in the source code, then please ignore.
Now reverted in r2353. Thank you for identifying this problem!


RE: A few bugs in recent changes - Itaru - 10-16-2011

(10-16-2011, 01:45 PM)gid15 Wrote: I've reviewed again the code for the settings handling of "Handle SAVEDATA in crypto mode" and cannot find any problem, it should work like before. Could you do more testing, e.g. by adding a log in CryptoEngine.setSavedataCryptoStatus to check the value of the flag?

Okay, I think I've found the problem. In r2345, you registered the cryptSavedataSettingsListener in the constructor for CryptoEngine. The problem with that is if the game has already been decrypted and the CryptoEngine is not used during game load, that listener is never registered and therefore the emu.cryptoSavedata setting is always disabled. It needs to be put somewhere else where it will always be registered since the encrypted savedata setting is not dependent on whether the game's encrypted or not. This explains why that setting works in some of my games and not in others. Smile

Oh, and thanks a lot for the other fixes!


RE: A few bugs in recent changes - gid15 - 10-16-2011

(10-16-2011, 04:36 PM)Itaru Wrote: Okay, I think I've found the problem. In r2345, you registered the cryptSavedataSettingsListener in the constructor for CryptoEngine. The problem with that is if the game has already been decrypted and the CryptoEngine is not used during game load, that listener is never registered and therefore the emu.cryptoSavedata setting is always disabled. It needs to be put somewhere else where it will always be registered since the encrypted savedata setting is not dependent on whether the game's encrypted or not. This explains why that setting works in some of my games and not in others. Smile
Good catch! Thank you for your code review!
Fixed in r2355...


RE: A few bugs in recent changes - Itaru - 10-16-2011

Awesome work, gid15!