Skip to content
This repository has been archived by the owner on Mar 24, 2022. It is now read-only.

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

Open
PalMusicFan opened this issue Jun 21, 2019 · 3 comments

Comments

@PalMusicFan
Copy link

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
Copy link
Member

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
Copy link
Author

PalMusicFan commented Dec 19, 2019

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
Copy link
Author

It seems SDL_GetError() returns an empty string.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants