if globally enabled, disable game specific stereo and phosphor elements
changed global phosphor value label (Default -> Blend)
This commit is contained in:
thrust26 2018-09-20 10:20:12 +02:00
parent 6d0614ef35
commit c038df6343
4 changed files with 42 additions and 18 deletions

View File

@ -71,10 +71,18 @@ void TIASurface::initialize(const Console& console, const VideoMode& mode)
mySLineSurface->setDstSize(mode.image.width(), mode.image.height());
// Phosphor mode can be enabled either globally or per-ROM
bool p_enable = myOSystem.settings().getString("tv.phosphor") == "always" ||
console.properties().get(Display_Phosphor) == "YES";
int p_blend = atoi(console.properties().get(Display_PPBlend).c_str());
enablePhosphor(p_enable, p_blend);
int p_blend = 0;
if(myOSystem.settings().getString("tv.phosphor") == "always")
{
p_blend = myOSystem.settings().getInt("tv.phosblend");
}
else if(console.properties().get(Display_Phosphor) == "YES")
{
p_blend = atoi(console.properties().get(Display_PPBlend).c_str());
}
enablePhosphor(p_blend != 0, p_blend);
setNTSC(NTSCFilter::Preset(myOSystem.settings().getInt("tv.filter")), false);
// Scanline repeating is sensitive to non-integral vertical resolution,

View File

@ -36,6 +36,7 @@
#include "TIASurface.hxx"
#include "TIA.hxx"
#include "Switches.hxx"
#include "AudioSettings.hxx"
#include "GameInfoDialog.hxx"
@ -386,6 +387,8 @@ void GameInfoDialog::loadCartridgeProperties(const Properties& props)
myRarity->setText(props.get(Cartridge_Rarity));
myNote->setText(props.get(Cartridge_Note));
mySound->setState(props.get(Cartridge_Sound) == "STEREO");
// if stereo is always enabled, disable game specific stereo setting
mySound->setEnabled(!instance().audioSettings().stereo());
myType->setSelected(props.get(Cartridge_Type), "AUTO");
if(instance().hasConsole() && myType->getSelectedTag().toString() == "AUTO")
@ -487,9 +490,12 @@ void GameInfoDialog::loadDisplayProperties(const Properties& props)
else
myHeightDetected->setLabel("");
// if phosphor is always enabled, disable game specific phosphor settings
bool alwaysPhosphor = instance().settings().getString("tv.phosphor") == "always";
bool usePhosphor = props.get(Display_Phosphor) == "YES";
myPhosphor->setState(usePhosphor);
myPPBlend->setEnabled(usePhosphor);
myPhosphor->setEnabled(!alwaysPhosphor);
myPPBlend->setEnabled(!alwaysPhosphor && usePhosphor);
const string& blend = props.get(Display_PPBlend);
myPPBlend->setValue(atoi(blend.c_str()));

View File

@ -272,14 +272,14 @@ VideoDialog::VideoDialog(OSystem& osystem, DialogContainer& parent,
lwidth = font.getStringWidth("Intensity ");
// TV Phosphor effect
myTVPhosphor = new CheckboxWidget(myTab, font, xpos, ypos + 1, "Phosphor for all ROMs");
myTVPhosphor = new CheckboxWidget(myTab, font, xpos, ypos + 1, "Phosphor for all ROMs", kPhosphorChanged);
wid.push_back(myTVPhosphor);
ypos += lineHeight + VGAP;
// TV Phosphor default level
// TV Phosphor blend level
xpos += INDENT;
swidth = font.getMaxCharWidth() * 10;
CREATE_CUSTOM_SLIDERS(PhosLevel, "Default ");
CREATE_CUSTOM_SLIDERS(PhosLevel, "Blend ");
ypos += 6;
// Scanline intensity and interpolation
@ -395,6 +395,7 @@ void VideoDialog::loadConfig()
// TV phosphor blend
myTVPhosLevel->setValue(instance().settings().getInt("tv.phosblend"));
handlePhosphorChange();
// TV scanline intensity and interpolation
myTVScanIntense->setValue(instance().settings().getInt("tv.scanlines"));
@ -475,10 +476,8 @@ void VideoDialog::saveConfig()
// TV phosphor mode
instance().settings().setValue("tv.phosphor",
myTVPhosphor->getState() ? "always" : "byrom");
// TV phosphor blend
instance().settings().setValue("tv.phosblend", myTVPhosLevel->getValueLabel());
Properties::setDefault(Display_PPBlend, myTVPhosLevel->getValueLabel());
// TV scanline intensity and interpolation
instance().settings().setValue("tv.scanlines", myTVScanIntense->getValueLabel());
@ -581,6 +580,12 @@ void VideoDialog::loadTVAdjustables(NTSCFilter::Preset preset)
myTVGamma->setValue(adj.gamma);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void VideoDialog::handlePhosphorChange()
{
myTVPhosLevel->setEnabled(myTVPhosphor->getState());
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void VideoDialog::handleCommand(CommandSender* sender, int cmd,
int data, int id)
@ -615,6 +620,10 @@ void VideoDialog::handleCommand(CommandSender* sender, int cmd,
case kCloneCustomCmd: loadTVAdjustables(NTSCFilter::PRESET_CUSTOM);
break;
case kPhosphorChanged:
handlePhosphorChange();
break;
default:
Dialog::handleCommand(sender, cmd, data, 0);
break;

View File

@ -45,6 +45,7 @@ class VideoDialog : public Dialog
void handleTVModeChange(NTSCFilter::Preset);
void loadTVAdjustables(NTSCFilter::Preset preset);
void handlePhosphorChange();
void handleCommand(CommandSender* sender, int cmd, int data, int id) override;
private:
@ -98,15 +99,15 @@ class VideoDialog : public Dialog
ButtonWidget* myCloneCustom;
enum {
kSpeedupChanged = 'VDSp',
kSpeedupChanged = 'VDSp',
kTVModeChanged = 'VDtv',
kCloneCompositeCmd = 'CLcp',
kCloneSvideoCmd = 'CLsv',
kCloneRGBCmd = 'CLrb',
kCloneBadCmd = 'CLbd',
kCloneCustomCmd = 'CLcu'
kTVModeChanged = 'VDtv',
kCloneCompositeCmd = 'CLcp',
kCloneSvideoCmd = 'CLsv',
kCloneRGBCmd = 'CLrb',
kCloneBadCmd = 'CLbd',
kCloneCustomCmd = 'CLcu',
kPhosphorChanged = 'VDph'
};
private: