added missing auto detection for manual selected display format "Auto-detect" (50Hz ROM after 60Hz formats)

This commit is contained in:
thrust26 2018-06-03 11:39:42 +02:00
parent f37651a46d
commit a3955553b8
2 changed files with 26 additions and 12 deletions

View File

@ -305,33 +305,41 @@ bool Console::load(Serializer& in)
void Console::toggleFormat(int direction)
{
string saveformat, message;
int format;
if(direction == 1)
myCurrentFormat = (myCurrentFormat + 1) % 7;
format = (myCurrentFormat + 1) % 7;
else if(direction == -1)
myCurrentFormat = myCurrentFormat > 0 ? (myCurrentFormat - 1) : 6;
format = myCurrentFormat > 0 ? (myCurrentFormat - 1) : 6;
setFormat(myCurrentFormat);
setFormat(format);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Console::setFormat(int format)
{
if(myCurrentFormat == format)
return;
string saveformat, message;
string autodetected = "";
bool reset = true;
myCurrentFormat = format;
switch(myCurrentFormat)
{
case 0: // auto-detect
{
string oldDisplayFormat = myDisplayFormat;
autodetectFrameLayout();
myTIA->update();
myDisplayFormat = myTIA->frameLayout() == FrameLayout::pal ? "PAL" : "NTSC";
autodetected = "*";
message = "Auto-detect mode: " + myDisplayFormat;
reset = oldDisplayFormat != myDisplayFormat;
saveformat = "AUTO";
myConsoleTiming = myTIA->frameLayout() == FrameLayout::pal ?
ConsoleTiming::pal : ConsoleTiming::ntsc;
autodetected = "*";
myConsoleTiming = myDisplayFormat == "PAL" ? ConsoleTiming::pal : ConsoleTiming::ntsc;
message = "Auto-detect mode: " + myDisplayFormat;
break;
}
case 1:
saveformat = myDisplayFormat = "NTSC";
myConsoleTiming = ConsoleTiming::ntsc;
@ -367,10 +375,13 @@ void Console::setFormat(int format)
myConsoleInfo.DisplayFormat = myDisplayFormat + autodetected;
setPalette(myOSystem.settings().getString("palette"));
setTIAProperties();
myTIA->frameReset();
initializeVideo(); // takes care of refreshing the screen
if(reset)
{
setPalette(myOSystem.settings().getString("palette"));
setTIAProperties();
myTIA->frameReset();
initializeVideo(); // takes care of refreshing the screen
}
myOSystem.frameBuffer().showMessage(message);

View File

@ -222,6 +222,9 @@ void TIASurface::enableScanlineInterpolation(bool enable)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void TIASurface::enablePhosphor(bool enable, int blend)
{
if(myUsePhosphor == enable && myPhosphorPercent == blend / 100.0)
return;
myUsePhosphor = enable;
if(blend >= 0)
myPhosphorPercent = blend / 100.0;