mirror of https://github.com/stella-emu/stella.git
fixed #383
if globally enabled, disable game specific stereo and phosphor elements changed global phosphor value label (Default -> Blend)
This commit is contained in:
parent
6d0614ef35
commit
c038df6343
|
@ -71,10 +71,18 @@ void TIASurface::initialize(const Console& console, const VideoMode& mode)
|
||||||
mySLineSurface->setDstSize(mode.image.width(), mode.image.height());
|
mySLineSurface->setDstSize(mode.image.width(), mode.image.height());
|
||||||
|
|
||||||
// Phosphor mode can be enabled either globally or per-ROM
|
// Phosphor mode can be enabled either globally or per-ROM
|
||||||
bool p_enable = myOSystem.settings().getString("tv.phosphor") == "always" ||
|
int p_blend = 0;
|
||||||
console.properties().get(Display_Phosphor) == "YES";
|
|
||||||
int p_blend = atoi(console.properties().get(Display_PPBlend).c_str());
|
if(myOSystem.settings().getString("tv.phosphor") == "always")
|
||||||
enablePhosphor(p_enable, p_blend);
|
{
|
||||||
|
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);
|
setNTSC(NTSCFilter::Preset(myOSystem.settings().getInt("tv.filter")), false);
|
||||||
|
|
||||||
// Scanline repeating is sensitive to non-integral vertical resolution,
|
// Scanline repeating is sensitive to non-integral vertical resolution,
|
||||||
|
|
|
@ -36,6 +36,7 @@
|
||||||
#include "TIASurface.hxx"
|
#include "TIASurface.hxx"
|
||||||
#include "TIA.hxx"
|
#include "TIA.hxx"
|
||||||
#include "Switches.hxx"
|
#include "Switches.hxx"
|
||||||
|
#include "AudioSettings.hxx"
|
||||||
|
|
||||||
#include "GameInfoDialog.hxx"
|
#include "GameInfoDialog.hxx"
|
||||||
|
|
||||||
|
@ -386,6 +387,8 @@ void GameInfoDialog::loadCartridgeProperties(const Properties& props)
|
||||||
myRarity->setText(props.get(Cartridge_Rarity));
|
myRarity->setText(props.get(Cartridge_Rarity));
|
||||||
myNote->setText(props.get(Cartridge_Note));
|
myNote->setText(props.get(Cartridge_Note));
|
||||||
mySound->setState(props.get(Cartridge_Sound) == "STEREO");
|
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");
|
myType->setSelected(props.get(Cartridge_Type), "AUTO");
|
||||||
|
|
||||||
if(instance().hasConsole() && myType->getSelectedTag().toString() == "AUTO")
|
if(instance().hasConsole() && myType->getSelectedTag().toString() == "AUTO")
|
||||||
|
@ -487,9 +490,12 @@ void GameInfoDialog::loadDisplayProperties(const Properties& props)
|
||||||
else
|
else
|
||||||
myHeightDetected->setLabel("");
|
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";
|
bool usePhosphor = props.get(Display_Phosphor) == "YES";
|
||||||
myPhosphor->setState(usePhosphor);
|
myPhosphor->setState(usePhosphor);
|
||||||
myPPBlend->setEnabled(usePhosphor);
|
myPhosphor->setEnabled(!alwaysPhosphor);
|
||||||
|
myPPBlend->setEnabled(!alwaysPhosphor && usePhosphor);
|
||||||
|
|
||||||
const string& blend = props.get(Display_PPBlend);
|
const string& blend = props.get(Display_PPBlend);
|
||||||
myPPBlend->setValue(atoi(blend.c_str()));
|
myPPBlend->setValue(atoi(blend.c_str()));
|
||||||
|
|
|
@ -272,14 +272,14 @@ VideoDialog::VideoDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
lwidth = font.getStringWidth("Intensity ");
|
lwidth = font.getStringWidth("Intensity ");
|
||||||
|
|
||||||
// TV Phosphor effect
|
// 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);
|
wid.push_back(myTVPhosphor);
|
||||||
ypos += lineHeight + VGAP;
|
ypos += lineHeight + VGAP;
|
||||||
|
|
||||||
// TV Phosphor default level
|
// TV Phosphor blend level
|
||||||
xpos += INDENT;
|
xpos += INDENT;
|
||||||
swidth = font.getMaxCharWidth() * 10;
|
swidth = font.getMaxCharWidth() * 10;
|
||||||
CREATE_CUSTOM_SLIDERS(PhosLevel, "Default ");
|
CREATE_CUSTOM_SLIDERS(PhosLevel, "Blend ");
|
||||||
ypos += 6;
|
ypos += 6;
|
||||||
|
|
||||||
// Scanline intensity and interpolation
|
// Scanline intensity and interpolation
|
||||||
|
@ -395,6 +395,7 @@ void VideoDialog::loadConfig()
|
||||||
|
|
||||||
// TV phosphor blend
|
// TV phosphor blend
|
||||||
myTVPhosLevel->setValue(instance().settings().getInt("tv.phosblend"));
|
myTVPhosLevel->setValue(instance().settings().getInt("tv.phosblend"));
|
||||||
|
handlePhosphorChange();
|
||||||
|
|
||||||
// TV scanline intensity and interpolation
|
// TV scanline intensity and interpolation
|
||||||
myTVScanIntense->setValue(instance().settings().getInt("tv.scanlines"));
|
myTVScanIntense->setValue(instance().settings().getInt("tv.scanlines"));
|
||||||
|
@ -475,10 +476,8 @@ void VideoDialog::saveConfig()
|
||||||
// TV phosphor mode
|
// TV phosphor mode
|
||||||
instance().settings().setValue("tv.phosphor",
|
instance().settings().setValue("tv.phosphor",
|
||||||
myTVPhosphor->getState() ? "always" : "byrom");
|
myTVPhosphor->getState() ? "always" : "byrom");
|
||||||
|
|
||||||
// TV phosphor blend
|
// TV phosphor blend
|
||||||
instance().settings().setValue("tv.phosblend", myTVPhosLevel->getValueLabel());
|
instance().settings().setValue("tv.phosblend", myTVPhosLevel->getValueLabel());
|
||||||
Properties::setDefault(Display_PPBlend, myTVPhosLevel->getValueLabel());
|
|
||||||
|
|
||||||
// TV scanline intensity and interpolation
|
// TV scanline intensity and interpolation
|
||||||
instance().settings().setValue("tv.scanlines", myTVScanIntense->getValueLabel());
|
instance().settings().setValue("tv.scanlines", myTVScanIntense->getValueLabel());
|
||||||
|
@ -581,6 +580,12 @@ void VideoDialog::loadTVAdjustables(NTSCFilter::Preset preset)
|
||||||
myTVGamma->setValue(adj.gamma);
|
myTVGamma->setValue(adj.gamma);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
void VideoDialog::handlePhosphorChange()
|
||||||
|
{
|
||||||
|
myTVPhosLevel->setEnabled(myTVPhosphor->getState());
|
||||||
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void VideoDialog::handleCommand(CommandSender* sender, int cmd,
|
void VideoDialog::handleCommand(CommandSender* sender, int cmd,
|
||||||
int data, int id)
|
int data, int id)
|
||||||
|
@ -615,6 +620,10 @@ void VideoDialog::handleCommand(CommandSender* sender, int cmd,
|
||||||
case kCloneCustomCmd: loadTVAdjustables(NTSCFilter::PRESET_CUSTOM);
|
case kCloneCustomCmd: loadTVAdjustables(NTSCFilter::PRESET_CUSTOM);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case kPhosphorChanged:
|
||||||
|
handlePhosphorChange();
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
Dialog::handleCommand(sender, cmd, data, 0);
|
Dialog::handleCommand(sender, cmd, data, 0);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -45,6 +45,7 @@ class VideoDialog : public Dialog
|
||||||
|
|
||||||
void handleTVModeChange(NTSCFilter::Preset);
|
void handleTVModeChange(NTSCFilter::Preset);
|
||||||
void loadTVAdjustables(NTSCFilter::Preset preset);
|
void loadTVAdjustables(NTSCFilter::Preset preset);
|
||||||
|
void handlePhosphorChange();
|
||||||
void handleCommand(CommandSender* sender, int cmd, int data, int id) override;
|
void handleCommand(CommandSender* sender, int cmd, int data, int id) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -98,15 +99,15 @@ class VideoDialog : public Dialog
|
||||||
ButtonWidget* myCloneCustom;
|
ButtonWidget* myCloneCustom;
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
kSpeedupChanged = 'VDSp',
|
kSpeedupChanged = 'VDSp',
|
||||||
|
|
||||||
kTVModeChanged = 'VDtv',
|
kTVModeChanged = 'VDtv',
|
||||||
|
kCloneCompositeCmd = 'CLcp',
|
||||||
kCloneCompositeCmd = 'CLcp',
|
kCloneSvideoCmd = 'CLsv',
|
||||||
kCloneSvideoCmd = 'CLsv',
|
kCloneRGBCmd = 'CLrb',
|
||||||
kCloneRGBCmd = 'CLrb',
|
kCloneBadCmd = 'CLbd',
|
||||||
kCloneBadCmd = 'CLbd',
|
kCloneCustomCmd = 'CLcu',
|
||||||
kCloneCustomCmd = 'CLcu'
|
kPhosphorChanged = 'VDph'
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in New Issue