pspdev / psplibraries

A script to automatically build open-source libraries for PSP homebrew development.
47 stars 45 forks source link

If "bpp" is 8, repeated SDL_SetVideoMode calling will cause Display error. #37

Open PalMusicFan opened 5 years ago

PalMusicFan commented 5 years ago

Hello! The homebrew game I am porting is a 256-color game with bpp 16 video clips. So repeated SDL_SetVideoMode calling is needed. Although there is no problem of setting bpp to 8 for the first time and then setting bpp to 16 for the video clips, I found that once the bpp 8 SDL_SetVideoMode is called again, Display error appears. After that, bpp 16 SDL_SetVideoMode works but I can not get a correct bpp 8 Video Mode again. Even setting bpp to 8 twice without bpp 16 Video Mode causes the error.

Thanks!

carstene1ns commented 4 years ago

Display error appears

Can you be more specific? e.g. what does SDL_GetError() return in this case?

One thing i see in the SDL port is, that we use an indexed shadow surface for 8 bit mode. I guess there is some cleanup missing, when there are multiple calls to reset the mode.

PalMusicFan commented 4 years ago

I have made a demo to demonstrate the error. The following screenshot shows what the error looks like.

EBOO00649_00006

Here is the demo with source code. This demo displays a bmp with a palette for 5 seconds, then do the same thing again, and we could see the error. Then it switchs to bpp 16 mode, which works well.

SDLTest.zip

PalMusicFan commented 4 years ago

It seems SDL_GetError() returns an empty string.