[SDLUI] Corrupted graphics with SDL1 only.
Versatile Commodore Emulator
Brought to you by:
blackystardust,
gpz
I build VICE with SDLUI interface but I discovered that it shows corrupted graphics.
See attached screenshot.
It is interesting to see that SDL1 produces bad video output, but SDL2 works fine instead.
After I have seen this defect, I deleted all files and I created a new build, but the problem still exists.
Tested with mingw-w64 for x86_64.
Configured with:
configure --enable-silent-rules --host=x86_64-w64-mingw32 --enable-sdlui
Sincerely.
it would help if you could go back some revisions and tell when it broke
currently I cannot reproduce this, xvic sdl1 looks fine on my setup.
Can you please try to start xvic with -default as the parameter and see if the screen is normal or not.
Also please give us some more information, what OS is it running on ??
"x86_64-w64-mingw32" means 64-bit Windows (I assume version 10).
Last edit: Greg King 2021-07-17
I meant which version of windows, because on my windows 7 setup I do not get the wrong looking xvic screen.
WFM with trunk on win10x64 (20h2). We'll need a more info on your setup to replicate.
If I configure with
--disable-hwscaleoption before compiling the emulators, the bug disappears.I verified that it happens with both i686 and x86_64 toolchains.
I'm using a notebook Acer Nitro 5, with Windows 10 ver. 21H1 (but I doubt that this is important).
I tried to replace SDL.DLL included into MinGW-w64 with the precompiled libraries that I downloaded from libsdl.org, but nothing changed.
can you please try a compile of rev 40334 with hwscale enabled and see if the screen is still wrong.
I tested latest stable vice-3.5, which is surely much older and the problem happens here too.
With this version, I tested only x86_64 since i686 is broken by the error described inside patch #297.
Is there a reason you want/need to use SDL1 instead of SDL2 ??
Hello, after some hours of debugging, I found the cause of the problem.
Attached patch fixes the bug.
Sincerely.
Patch looks OK, i'll leave it to dqh to sanity check and apply :)
I'm guessing it's the 24 bit color case that you saw the issue with?
My display is 32bit, but inside SDL, the cAlphaBits of PIXELFORMATDESCRIPTOR was left to zero and this caused the bad graphic output.
https://docs.microsoft.com/en-us/windows/win32/api/wingdi/ns-wingdi-pixelformatdescriptor
Then, i'm amazed it hadn't caused issues for others. That said, can't imagine many people use the SDL1 version on Windows.
Applied in r40377, thanks for these patches