Ok, looks like I've finally found the reason for the crashing at some battles. The culprit appears to be sceKernelExtendThreadStack not being implemented properly. A quick look at some assembly code shows that the calling thread shouldn't terminate immediately after (or during) the call to sceKernelExtendThreadStack, as it expects to continue execution. Commenting out lines 50 and 55 in ThreadManForUser.java in modules630 allowed the castle battle to load correctly.
As for the corrupt text with Catalyst drivers... it appears that the game gives an incorrect number of mipmaps while supplying only one 512x512 texture for each level of the mipmap. The Catalyst driver doesn't seem to load anything (as this is an incorrectly defined mipmap), so you get a corrupt texture. All I did was implement a check to see if each level of the mipmap has half the width and height of the preceding level, and if it failed, only load the first level of the mipmap (the developers might want to do something different).
Loading from a save on the first battle seems to break the tutorial in the castle battle, so play from the beginning. Saves after that seem to work, but don't bet on it. Expect AI controlled characters to stop moving, thus stopping the game. This might be related to the error Gashet talks about.
There is also an issue where the currently playing audio track will cut out, but I've yet to look into it.
Interesting. Did you try to dump the textures to see if it supplied a correctly downsized image (even if the dimension was wrong) or if it used the same picture on each level ?
Just a hint to look at the images: under "Debug -> Tools -> Image Viewer", you can display an image directly if you know its address, size and clut parameters.
Always include a complete log file at INFO level in your reports. Thanks! How to post a log
It's been a little while since I looked at the text issue, but from what I remember when the game sets the texture up it defines it as using 8 levels of mipmaps and it only ever supplies one address for the texture (which I had confirmed was the lettering used for text using the image viewer), with dimensions 512x512. I think it only gave that address and dimensions for the first couple of levels, and then gave an address of 0 for the rest (and 0 for other parameters as well, iirc). My assumption was that Catalyst will ignore invalid mipmaps, so I only checked to see if the widths and heights were correctly defined for the fix.
Also, I might have been too hasty in saying that sceKernelExtendThreadStack shouldn't terminate the calling thread. All I can really say is that the game definitely loaded battles when I removed the lines I mentioned. I was able to play halfway through the first chapter without incident as long as I hadn't loaded from a savegame. When I did load from a save, sometimes the AI controlled characters would fail to move, essentially stopping the game (but not freezing it; this will always happen in the Almorica castle battle). It LOOKS like a particular thread is being starved. I can see a context switch to it, but it gets switched out before the call to syncThreadImmediately. I'm still trying to look into it.
I'm fairly certain that the warning about the missing directory 'ULUS10565SQEXTACO' is simply the game checking for an installation to the memory stick.
(10-15-2011, 11:12 PM)Drake Wrote: It's been a little while since I looked at the text issue, but from what I remember when the game sets the texture up it defines it as using 8 levels of mipmaps and it only ever supplies one address for the texture (which I had confirmed was the lettering used for text using the image viewer), with dimensions 512x512. I think it only gave that address and dimensions for the first couple of levels, and then gave an address of 0 for the rest (and 0 for other parameters as well, iirc). My assumption was that Catalyst will ignore invalid mipmaps, so I only checked to see if the widths and heights were correctly defined for the fix.
I've added WARNing messages when invalid mipmaps have been detected. Could someone post an updated log file at INFO level with r2350?
Thanks!
Always include a complete log file at INFO level in your reports. Thanks! How to post a log
(10-16-2011, 08:31 AM)hyakki Wrote: here is info log from r2350 , from new game till where it stops working at the castle.
Thanks!
The following sequence can be found:
Code:
Texture mipmap with invalid dimension at level 1: (512x512)@0x041B7B90 -> (512x512)@0x041B7B90
... and this invalid Texture mipmap will be used with mipmap_mode=1, mipmap_bias=1
Texture mipmap with invalid dimension at level 1: (128x128)@0x041C9BB0 -> (512x512)@0x041B7B90
Texture mipmap with invalid dimension at level 1: (512x512)@0x041C0BA0 -> (512x512)@0x041C0BA0
... and this invalid Texture mipmap will be used with mipmap_mode=1, mipmap_bias=1
Cases 1 and 3: identical textures are built for level 0 and level 1 and the texture from level 1 is used.
Case 2: a new level 0 is defined, and the level 1 is a left-over from a previous texture. But level 1 is not used.
I will try a fix.
Always include a complete log file at INFO level in your reports. Thanks! How to post a log
10-16-2011, 11:05 AM (This post was last modified: 10-16-2011, 11:05 AM by digiadventures.)
(10-16-2011, 09:40 AM)gid15 Wrote: I will try a fix.
A fix for game crashing or ati problem ? Or are they related? If not,could you please also include Drake's fix for game crashing for us people who dont know how to comment out assembly code and then compile jpcsp
(10-16-2011, 08:31 AM)hyakki Wrote: here is info log from r2350 , from new game till where it stops working at the castle.
Thanks!
The following sequence can be found:
Code:
Texture mipmap with invalid dimension at level 1: (512x512)@0x041B7B90 -> (512x512)@0x041B7B90
... and this invalid Texture mipmap will be used with mipmap_mode=1, mipmap_bias=1
Texture mipmap with invalid dimension at level 1: (128x128)@0x041C9BB0 -> (512x512)@0x041B7B90
Texture mipmap with invalid dimension at level 1: (512x512)@0x041C0BA0 -> (512x512)@0x041C0BA0
... and this invalid Texture mipmap will be used with mipmap_mode=1, mipmap_bias=1
Cases 1 and 3: identical textures are built for level 0 and level 1 and the texture from level 1 is used.
Case 2: a new level 0 is defined, and the level 1 is a left-over from a previous texture. But level 1 is not used.
I will try a fix.
A fix for the mipmaps problem with the Catalyst driver is available in r2351.
Thank you Drake for the analysis!
Always include a complete log file at INFO level in your reports. Thanks! How to post a log
r2351: this is what it does now when trying to start the battle before going black screen (yes, I started a new game. i'm using a geforce gtx 460 btw, no ati card)