01-27-2012, 11:30 AM
01-29-2012, 04:25 PM
then you can either dump the fonts from your psp or play on it instead.
the fonts in jpcsp are still not perfect.
the fonts in jpcsp are still not perfect.
01-30-2012, 05:51 AM
(01-29-2012, 04:25 PM)serio Wrote: [ -> ]then you can either dump the fonts from your psp or play on it instead.Ok, I did what you told me and now the texts is readable. But it still has the error like this:
the fonts in jpcsp are still not perfect.
[attachment=7871]
[attachment=7872]
[attachment=7873]
01-30-2012, 07:29 AM
(01-30-2012, 05:51 AM)MunoKen Wrote: [ -> ](01-29-2012, 04:25 PM)serio Wrote: [ -> ]then you can either dump the fonts from your psp or play on it instead.Ok, I did what you told me and now the texts is readable. But it still has the error like this:
the fonts in jpcsp are still not perfect.
does it do that if you don't resize the window?
01-30-2012, 04:30 PM
(01-30-2012, 07:29 AM)hyakki Wrote: [ -> ](01-30-2012, 05:51 AM)MunoKen Wrote: [ -> ](01-29-2012, 04:25 PM)serio Wrote: [ -> ]then you can either dump the fonts from your psp or play on it instead.Ok, I did what you told me and now the texts is readable. But it still has the error like this:
the fonts in jpcsp are still not perfect.
does it do that if you don't resize the window?
Yes, it does like what it did!!!
[attachment=7874]
03-09-2012, 03:57 PM
I've improved 2 font functions in r2467. Could you try again if there is any improvement? Do not forget the log file!
11-23-2012, 08:23 PM
The problem still persists. It looks like the cause of it is CR (0x0D) linebreaks being ignored. I've looked into RAM dump and that's how this text is represented:
There is also another version of text in memory, which seems to be straight loaded from game's files, not formated for output. Game inserts 0A 00 for automatic line wrapping, and so it works, but not the manual line-breaks, which retain 0D 00.
Code:
53 00 6F 00 2C 00 20 00 6E 00 6F 00 74 00 68 00
69 00 6E 00 67 00 20 00 68 00 61 00 73 00 20 00
63 00 68 00 61 00 6E 00 67 00 65 00 64 00 2E 00
2E 00 2E 00 0D 00 0D 00 41 00 6C 00 74 00 68 00
6F 00 75 00 67 00 68 00 20 00 74 00 68 00 65 00
20 00 77 00 6F 00 72 00 64 00 20 00 22 00 6D 00
69 00 72 00 61 00 63 00 6C 00 65 00 22 00 20 00
69 00 73 00 20 00 6E 00 6F 00 74 00 20 00 65 00
78 00 61 00 63 00 74 00 6C 00 79 00 20 00 69 00
6E 00 20 00 6F 00 75 00 72 00 20 00 0A 00 76 00
6F 00 63 00 61 00 62 00 75 00 6C 00 61 00 72 00
79 00 2C 00 20 00 77 00 6F 00 75 00 6C 00 64 00
6E 00 27 00 74 00 20 00 79 00 6F 00 75 00 20 00
61 00 67 00 72 00 65 00 65 00 20 00 74 00 68 00
61 00 74 00 20 00 79 00 6F 00 75 00 72 00 20 00
65 00 78 00 69 00 73 00 74 00 65 00 6E 00 63 00
65 00 20 00 69 00 74 00 73 00 65 00 6C 00 66 00
20 00 69 00 73 00 20 00 61 00 20 00 6D 00 69 00
72 00 61 00 63 00 6C 00 65 00 20 00 6F 00 66 00
20 00 0A 00 73 00 6F 00 72 00 74 00 73 00 3F
12-03-2012, 06:28 PM
I've investigated the problem a bit further. The game is calling sceFontGetCharInfo with 0xD as char argument:
It's not present in the font (jpn0.pgf, even if it's extracted from PSP), so font.fontInfo.getCharInfo() results in null and JPCSP tries to provide default DebugFont values. Looks like it's not what game expects to get. Simply initializing pspCharInfo and not setting anything fixes manual line breaks in game, so I've added a check if char code is higher or equal to 0x20. Characters below are not supposed to be printable anyway, so I hope it won't have any negative side effects.
Code:
50736 user_main DEBUG hle.sceFont sceFontGetCharInfo charCode=000D (
)
50741 user_main DEBUG hle.sceFont sceFontGetCharInfo returning bitmapWidth=16, bitmapHeight=16, bitmapLeft=0, bitmapTop=0, sfp26Width=1024, sfp26Height=1024, sfp26Ascender=0, sfp26Descender=0, sfp26BearingHX=0, sfp26BearingHY=0, sfp26BearingVX=0, sfp26BearingVY=0, sfp26AdvanceH=1024, sfp26AdvanceV=1024
12-04-2012, 04:39 PM
(12-03-2012, 06:28 PM)NeKit Wrote: [ -> ]I've investigated the problem a bit further. The game is calling sceFontGetCharInfo with 0xD as char argument:Nice finding!
It's not present in the font (jpn0.pgf, even if it's extracted from PSP), so font.fontInfo.getCharInfo() results in null and JPCSP tries to provide default DebugFont values. Looks like it's not what game expects to get. Simply initializing pspCharInfo and not setting anything fixes manual line breaks in game, so I've added a check if char code is higher or equal to 0x20. Characters below are not supposed to be printable anyway, so I hope it won't have any negative side effects.Code:50736 user_main DEBUG hle.sceFont sceFontGetCharInfo charCode=000D (
)
50741 user_main DEBUG hle.sceFont sceFontGetCharInfo returning bitmapWidth=16, bitmapHeight=16, bitmapLeft=0, bitmapTop=0, sfp26Width=1024, sfp26Height=1024, sfp26Ascender=0, sfp26Descender=0, sfp26BearingHX=0, sfp26BearingHY=0, sfp26BearingVX=0, sfp26BearingVY=0, sfp26AdvanceH=1024, sfp26AdvanceV=1024
Fix added in r2895: I've tested it on a real PSP to implement the proper behavior.
Thank you!