fixed missing ConsoleInfo.DisplayFormat update

This commit is contained in:
thrust26 2018-06-02 17:18:10 +02:00
parent 4562e44d59
commit f37651a46d
2 changed files with 19 additions and 1 deletions

View File

@ -311,15 +311,26 @@ void Console::toggleFormat(int direction)
else if(direction == -1)
myCurrentFormat = myCurrentFormat > 0 ? (myCurrentFormat - 1) : 6;
setFormat(myCurrentFormat);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Console::setFormat(int format)
{
string saveformat, message;
string autodetected = "";
myCurrentFormat = format;
switch(myCurrentFormat)
{
case 0: // auto-detect
myTIA->update();
myDisplayFormat = myTIA->frameLayout() == FrameLayout::pal ? "PAL" : "NTSC";
autodetected = "*";
message = "Auto-detect mode: " + myDisplayFormat;
saveformat = "AUTO";
myConsoleTiming = myTIA->frameLayout() == FrameLayout::pal ?
ConsoleTiming::pal : ConsoleTiming::ntsc;
ConsoleTiming::pal : ConsoleTiming::ntsc;
break;
case 1:
saveformat = myDisplayFormat = "NTSC";
@ -354,6 +365,8 @@ void Console::toggleFormat(int direction)
}
myProperties.set(Display_Format, saveformat);
myConsoleInfo.DisplayFormat = myDisplayFormat + autodetected;
setPalette(myOSystem.settings().getString("palette"));
setTIAProperties();
myTIA->frameReset();

View File

@ -198,6 +198,11 @@ class Console : public Serializable
*/
void toggleFormat(int direction = 1);
/**
Set NTSC/PAL/SECAM (and variants) display format.
*/
void setFormat(int format);
/**
Toggle between the available palettes.
*/