pspdev / psp-packages

https://pspdev.github.io/psp-packages/
The Unlicense
23 stars 13 forks source link

SDL2_ttf render functions crash on a real system #45

Open Mode8fx opened 2 years ago

Mode8fx commented 2 years ago

When using render functions from SDL2_ttf, a program compiles and runs fine in PPSSPP, but crashes on a real system. After compiling the pspdev version of SDL2_ttf, however, these functions work as intended.

For full disclosure, the functions I attempted to run were TTF_RenderText_Solid and TTF_RenderUTF8_Solid, and they were tested on a Vita running Adrenaline.

sharkwouter commented 2 years ago

Thanks for the report. I'll take a look at what's going on.

sharkwouter commented 2 years ago

@Mips96 could you do another test and if there is an issue, share the a code example?

KorigamiK commented 1 year ago

@Mips96 could you do another test and if there is an issue, share the a code example?

TTF_RenderUTF8_Blended_Wrapped TTF_RenderUTF8_Blended TTF_RenderUTF8_Solid are tested and see to be working for me.

However the default methods TTF_RenderText_Solid TTF_RenderText_Blended and similar don't work and instantly crash the program on execution. The error can be traced back to sdl_ttf.o using psplink.

I don't mind using the lesser res methods instead of the default methods, but this should at least be mentioned in the docs and should be removed from the header file.

sharkwouter commented 1 year ago

Thanks for testing @KorigamiK. These function are intended to work, but I personally haven't used them, so I had not run into this. Do you have a small example where this function is used so I can do some testing?

KorigamiK commented 1 year ago

Thanks for testing @KorigamiK. These function are intended to work, but I personally haven't used them, so I had not run into this. Do you have a small example where this function is used so I can do some testing?

Sure, I’ll get back to you

sharkwouter commented 1 year ago

@KorigamiK have you gotten to making an example? I'd like to work on this tonight and it would be good to have.

pggkun commented 1 year ago

@sharkwouter I noticed the same issue. The SDL TTF crashes only on a real device. Here is an example I've made: https://github.com/pggkun/PSP-SDL-TTF-Sample

The functions I've tested was TTF_RenderText_Solid and TTF_RenderUTF8_Solid both crashed on a PSP 2000

sharkwouter commented 1 year ago

So I did some debugging and came to the following conclusions:

So I don't really know how to debug this much further and what is causing this. It might be related with the PSP version of SDL not being able to update textures for some reason. Although that would cause corruption, not crashes, for afaik. So at the end of the day, I don't know.

Since the latest version of SDL2_ttf is not more broken, I am going to update it now.