diff --git a/DDrawCompat/Win32/DisplayMode.cpp b/DDrawCompat/Win32/DisplayMode.cpp index 6808f8b..141c8d2 100644 --- a/DDrawCompat/Win32/DisplayMode.cpp +++ b/DDrawCompat/Win32/DisplayMode.cpp @@ -132,6 +132,12 @@ namespace SIZE emulatedResolution = {}; if (lpDevMode) { + if ((lpDevMode->dmFields & DM_BITSPERPEL) && + 8 != lpDevMode->dmBitsPerPel && 16 != lpDevMode->dmBitsPerPel && 32 != lpDevMode->dmBitsPerPel) + { + return DISP_CHANGE_BADMODE; + } + targetDevMode = *lpDevMode; targetDevMode.dmFields |= DM_BITSPERPEL; targetDevMode.dmBitsPerPel = 32; diff --git a/DDrawCompat/Win32/Log.cpp b/DDrawCompat/Win32/Log.cpp index 82622f7..5ec97dc 100644 --- a/DDrawCompat/Win32/Log.cpp +++ b/DDrawCompat/Win32/Log.cpp @@ -51,6 +51,7 @@ namespace std::ostream& logDevMode(std::ostream& os, const DevMode& dm) { return Compat::LogStruct(os) + << Compat::hex(dm.dmFields) << dm.dmPelsWidth << dm.dmPelsHeight << dm.dmBitsPerPel