mirror of
https://github.com/RetroDECK/Supermodel.git
synced 2024-11-22 13:55:38 +00:00
The model 3 (actually model 1,2 and 3) all used some crazy refresh rate of 57.524hz. If your screen refresh rate is 60hz, supermodel will work fine, but really run too fast. Anyway if you create a custom refresh rate, supermodel will automatically pick this, and set it when the emulator is in fullscreen mode. Apparently this works with most monitors, even cheapo low end ones.
To active set your command line to: -res=1920,1080 -vsync -fullscreen -true-hz Replace the resolution with whatever your monitor's native resolution is.
This commit is contained in:
parent
984f78ad1b
commit
25604512f4
|
@ -119,7 +119,7 @@ static bool SetGLGeometry(unsigned *xOffsetPtr, unsigned *yOffsetPtr, unsigned *
|
|||
float yRes = float(*yResPtr);
|
||||
if (keepAspectRatio)
|
||||
{
|
||||
float model3Ratio = 496.0/384.0;
|
||||
float model3Ratio = float(496.0/384.0);
|
||||
if (yRes < (xRes/model3Ratio))
|
||||
xRes = yRes*model3Ratio;
|
||||
if (xRes < (yRes*model3Ratio))
|
||||
|
@ -176,6 +176,42 @@ static void GLAPIENTRY DebugCallback(GLenum source, GLenum type, GLuint id, GLen
|
|||
printf("OGLDebug:: 0x%X: %s\n", id, message);
|
||||
}
|
||||
|
||||
// In windows with an nvidia card (sorry not tested anything else) you can customise the resolution.
|
||||
// This also allows you to set a totally custom refresh rate. Apparently you can drive most monitors at
|
||||
// 57.5fps with no issues. Anyway this code will automatically pick up your custom refresh rate, and set it if it exists
|
||||
// It it doesn't exist, then it'll probably just default to 60 or whatever your refresh rate is.
|
||||
static void SetFullScreenRefreshRate()
|
||||
{
|
||||
float refreshRateHz = std::abs(s_runtime_config["RefreshRate"].ValueAs<float>());
|
||||
|
||||
if (refreshRateHz > 57.f && refreshRateHz < 58.f) {
|
||||
|
||||
int display_in_use = 0; /* Only using first display */
|
||||
|
||||
int display_mode_count = SDL_GetNumDisplayModes(display_in_use);
|
||||
if (display_mode_count < 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < display_mode_count; ++i) {
|
||||
|
||||
SDL_DisplayMode mode;
|
||||
|
||||
if (SDL_GetDisplayMode(display_in_use, i, &mode) != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (SDL_BITSPERPIXEL(mode.format) >= 24 && mode.refresh_rate == 58 && mode.w == totalXRes && mode.h == totalYRes) {
|
||||
int result = SDL_SetWindowDisplayMode(s_window, &mode);
|
||||
if (result == 0) {
|
||||
printf("Custom fullscreen mode set: %ix%i@57.524 Hz\n", mode.w, mode.h);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* CreateGLScreen():
|
||||
*
|
||||
|
@ -1049,6 +1085,9 @@ int Supermodel(const Game &game, ROMSet *rom_set, IEmulator *Model3, CInputs *In
|
|||
SDL_SetWindowTitle(s_window, baseTitleStr);
|
||||
SDL_SetWindowSize(s_window, totalXRes, totalYRes);
|
||||
SDL_SetWindowPosition(s_window, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED);
|
||||
|
||||
SetFullScreenRefreshRate();
|
||||
|
||||
bool stretch = s_runtime_config["Stretch"].ValueAs<bool>();
|
||||
bool fullscreen = s_runtime_config["FullScreen"].ValueAs<bool>();
|
||||
if (OKAY != ResizeGLScreen(&xOffset, &yOffset ,&xRes, &yRes, &totalXRes, &totalYRes, !stretch, fullscreen))
|
||||
|
|
|
@ -42,5 +42,7 @@ namespace FileSystemPath
|
|||
case Screenshots:
|
||||
return "";
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue