mirror of https://github.com/stella-emu/stella.git
reworked Palette settings a bit
This commit is contained in:
parent
7873bddee5
commit
f37f841750
Binary file not shown.
Before Width: | Height: | Size: 9.6 KiB After Width: | Height: | Size: 9.1 KiB |
|
@ -3654,8 +3654,7 @@
|
||||||
<table border="1" cellpadding="4">
|
<table border="1" cellpadding="4">
|
||||||
<tr><th>Item</th><th>Brief description</th><th>For more information,<br>see <a href="#CommandLine">Command Line</a></th></tr>
|
<tr><th>Item</th><th>Brief description</th><th>For more information,<br>see <a href="#CommandLine">Command Line</a></th></tr>
|
||||||
<tr><td>Palette</td><td>Palette used for emulation mode</td><td>-palette</td></tr>
|
<tr><td>Palette</td><td>Palette used for emulation mode</td><td>-palette</td></tr>
|
||||||
<tr><td>NTSC phase</td><td>Adjust phase shift of 'Custom' NTSC palette</td><td>-pal.phase_ntsc</td></tr>
|
<tr><td>NTSC/PAL phase</td><td>Adjust phase shift of 'Custom' NTSC or PAL (depends on game) palette. </td><td>-pal.phase_ntsc, -pal.phase_pal</td></tr>
|
||||||
<tr><td>PAL phase</td><td>Adjust phase shift of 'Custom' PAL palette</td><td>-pal.phase_pal</td></tr>
|
|
||||||
<tr><td>R</td><td>Adjust red scale and shift of 'Custom' palette</td><td>-pal.red_scale, -pal.red_shift</td></tr>
|
<tr><td>R</td><td>Adjust red scale and shift of 'Custom' palette</td><td>-pal.red_scale, -pal.red_shift</td></tr>
|
||||||
<tr><td>G</td><td>Adjust green scale and shift of 'Custom' palette</td><td>-pal.green_scale, -pal.green_shift</td></tr>
|
<tr><td>G</td><td>Adjust green scale and shift of 'Custom' palette</td><td>-pal.green_scale, -pal.green_shift</td></tr>
|
||||||
<tr><td>B</td><td>Adjust blue scale and shift of 'Custom' palette</td><td>-pal.blue_scale, -pal.blue_shift</td></tr>
|
<tr><td>B</td><td>Adjust blue scale and shift of 'Custom' palette</td><td>-pal.blue_scale, -pal.blue_shift</td></tr>
|
||||||
|
|
|
@ -233,24 +233,10 @@ void VideoAudioDialog::addPaletteTab()
|
||||||
const int pswidth = swidth - INDENT + lwidth - plWidth;
|
const int pswidth = swidth - INDENT + lwidth - plWidth;
|
||||||
xpos += INDENT;
|
xpos += INDENT;
|
||||||
|
|
||||||
myPhaseShiftNtsc =
|
myPhaseShift =
|
||||||
new SliderWidget(myTab, _font, xpos, ypos - 1, pswidth, lineHeight,
|
new SliderWidget(myTab, _font, xpos, ypos - 1, pswidth, lineHeight,
|
||||||
"NTSC phase", plWidth, kNtscShiftChanged, fontWidth * 5);
|
"NTSC phase", plWidth, kPhaseShiftChanged, fontWidth * 5);
|
||||||
myPhaseShiftNtsc->setMinValue((PaletteHandler::DEF_NTSC_SHIFT - PaletteHandler::MAX_PHASE_SHIFT) * 10);
|
wid.push_back(myPhaseShift);
|
||||||
myPhaseShiftNtsc->setMaxValue((PaletteHandler::DEF_NTSC_SHIFT + PaletteHandler::MAX_PHASE_SHIFT) * 10);
|
|
||||||
myPhaseShiftNtsc->setTickmarkIntervals(4);
|
|
||||||
myPhaseShiftNtsc->setToolTip("Adjust NTSC phase shift of 'Custom' palette.");
|
|
||||||
wid.push_back(myPhaseShiftNtsc);
|
|
||||||
ypos += lineHeight + VGAP;
|
|
||||||
|
|
||||||
myPhaseShiftPal =
|
|
||||||
new SliderWidget(myTab, _font, xpos, ypos - 1, pswidth, lineHeight,
|
|
||||||
"PAL phase", plWidth, kPalShiftChanged, fontWidth * 5);
|
|
||||||
myPhaseShiftPal->setMinValue((PaletteHandler::DEF_PAL_SHIFT - PaletteHandler::MAX_PHASE_SHIFT) * 10);
|
|
||||||
myPhaseShiftPal->setMaxValue((PaletteHandler::DEF_PAL_SHIFT + PaletteHandler::MAX_PHASE_SHIFT) * 10);
|
|
||||||
myPhaseShiftPal->setTickmarkIntervals(4);
|
|
||||||
myPhaseShiftPal->setToolTip("Adjust PAL phase shift of 'Custom' palette.");
|
|
||||||
wid.push_back(myPhaseShiftPal);
|
|
||||||
ypos += lineHeight + VGAP;
|
ypos += lineHeight + VGAP;
|
||||||
|
|
||||||
const int rgblWidth = _font.getStringWidth("R ");
|
const int rgblWidth = _font.getStringWidth("R ");
|
||||||
|
@ -312,7 +298,7 @@ void VideoAudioDialog::addPaletteTab()
|
||||||
myTVBlueShift->setTickmarkIntervals(2);
|
myTVBlueShift->setTickmarkIntervals(2);
|
||||||
myTVBlueShift->setToolTip("Adjust blue shift of 'Custom' palette.");
|
myTVBlueShift->setToolTip("Adjust blue shift of 'Custom' palette.");
|
||||||
wid.push_back(myTVBlueShift);
|
wid.push_back(myTVBlueShift);
|
||||||
ypos += lineHeight + VGAP;
|
ypos += lineHeight + VGAP * 2;
|
||||||
xpos -= INDENT;
|
xpos -= INDENT;
|
||||||
|
|
||||||
CREATE_CUSTOM_SLIDERS(Hue, "Hue ", kPaletteUpdated)
|
CREATE_CUSTOM_SLIDERS(Hue, "Hue ", kPaletteUpdated)
|
||||||
|
@ -322,7 +308,7 @@ void VideoAudioDialog::addPaletteTab()
|
||||||
CREATE_CUSTOM_SLIDERS(Gamma, "Gamma ", kPaletteUpdated)
|
CREATE_CUSTOM_SLIDERS(Gamma, "Gamma ", kPaletteUpdated)
|
||||||
|
|
||||||
// The resulting palette
|
// The resulting palette
|
||||||
xpos = myPhaseShiftNtsc->getRight() + fontWidth * 2;
|
xpos = myPhaseShift->getRight() + fontWidth * 2;
|
||||||
addPalette(xpos, VBORDER, _w - 2 * 2 - HBORDER - xpos,
|
addPalette(xpos, VBORDER, _w - 2 * 2 - HBORDER - xpos,
|
||||||
myTVGamma->getBottom() - myTIAPalette->getTop());
|
myTVGamma->getBottom() - myTIAPalette->getTop());
|
||||||
|
|
||||||
|
@ -599,9 +585,29 @@ void VideoAudioDialog::loadConfig()
|
||||||
myTIAPalette->setSelected(myPalette, PaletteHandler::SETTING_STANDARD);
|
myTIAPalette->setSelected(myPalette, PaletteHandler::SETTING_STANDARD);
|
||||||
|
|
||||||
// Palette adjustables
|
// Palette adjustables
|
||||||
|
bool isPAL = instance().hasConsole()
|
||||||
|
&& instance().console().timing() == ConsoleTiming::pal;
|
||||||
|
|
||||||
instance().frameBuffer().tiaSurface().paletteHandler().getAdjustables(myPaletteAdj);
|
instance().frameBuffer().tiaSurface().paletteHandler().getAdjustables(myPaletteAdj);
|
||||||
myPhaseShiftNtsc->setValue(myPaletteAdj.phaseNtsc);
|
if(isPAL)
|
||||||
myPhaseShiftPal->setValue(myPaletteAdj.phasePal);
|
{
|
||||||
|
myPhaseShift->setLabel("PAL phase");
|
||||||
|
myPhaseShift->setMinValue((PaletteHandler::DEF_PAL_SHIFT - PaletteHandler::MAX_PHASE_SHIFT) * 10);
|
||||||
|
myPhaseShift->setMaxValue((PaletteHandler::DEF_PAL_SHIFT + PaletteHandler::MAX_PHASE_SHIFT) * 10);
|
||||||
|
myPhaseShift->setTickmarkIntervals(4);
|
||||||
|
myPhaseShift->setToolTip("Adjust PAL phase shift of 'Custom' palette.");
|
||||||
|
myPhaseShift->setValue(myPaletteAdj.phasePal);
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
myPhaseShift->setLabel("NTSC phase");
|
||||||
|
myPhaseShift->setMinValue((PaletteHandler::DEF_NTSC_SHIFT - PaletteHandler::MAX_PHASE_SHIFT) * 10);
|
||||||
|
myPhaseShift->setMaxValue((PaletteHandler::DEF_NTSC_SHIFT + PaletteHandler::MAX_PHASE_SHIFT) * 10);
|
||||||
|
myPhaseShift->setTickmarkIntervals(4);
|
||||||
|
myPhaseShift->setToolTip("Adjust NTSC phase shift of 'Custom' palette.");
|
||||||
|
myPhaseShift->setValue(myPaletteAdj.phaseNtsc);
|
||||||
|
}
|
||||||
myTVRedScale->setValue(myPaletteAdj.redScale);
|
myTVRedScale->setValue(myPaletteAdj.redScale);
|
||||||
myTVRedShift->setValue(myPaletteAdj.redShift);
|
myTVRedShift->setValue(myPaletteAdj.redShift);
|
||||||
myTVGreenScale->setValue(myPaletteAdj.greenScale);
|
myTVGreenScale->setValue(myPaletteAdj.greenScale);
|
||||||
|
@ -846,9 +852,14 @@ void VideoAudioDialog::setDefaults()
|
||||||
}
|
}
|
||||||
|
|
||||||
case 1: // Palettes
|
case 1: // Palettes
|
||||||
|
{
|
||||||
|
bool isPAL = instance().hasConsole()
|
||||||
|
&& instance().console().timing() == ConsoleTiming::pal;
|
||||||
|
|
||||||
myTIAPalette->setSelected(PaletteHandler::SETTING_STANDARD);
|
myTIAPalette->setSelected(PaletteHandler::SETTING_STANDARD);
|
||||||
myPhaseShiftNtsc->setValue(PaletteHandler::DEF_NTSC_SHIFT * 10);
|
myPhaseShift->setValue(isPAL
|
||||||
myPhaseShiftPal->setValue(PaletteHandler::DEF_PAL_SHIFT * 10);
|
? PaletteHandler::DEF_PAL_SHIFT * 10
|
||||||
|
: PaletteHandler::DEF_NTSC_SHIFT * 10);
|
||||||
myTVRedScale->setValue(50);
|
myTVRedScale->setValue(50);
|
||||||
myTVRedShift->setValue(PaletteHandler::DEF_RGB_SHIFT);
|
myTVRedShift->setValue(PaletteHandler::DEF_RGB_SHIFT);
|
||||||
myTVGreenScale->setValue(50);
|
myTVGreenScale->setValue(50);
|
||||||
|
@ -863,6 +874,7 @@ void VideoAudioDialog::setDefaults()
|
||||||
handlePaletteChange();
|
handlePaletteChange();
|
||||||
handlePaletteUpdate();
|
handlePaletteUpdate();
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case 2: // TV effects
|
case 2: // TV effects
|
||||||
{
|
{
|
||||||
|
@ -940,8 +952,7 @@ void VideoAudioDialog::handlePaletteChange()
|
||||||
{
|
{
|
||||||
bool enable = myTIAPalette->getSelectedTag().toString() == "custom";
|
bool enable = myTIAPalette->getSelectedTag().toString() == "custom";
|
||||||
|
|
||||||
myPhaseShiftNtsc->setEnabled(enable);
|
myPhaseShift->setEnabled(enable);
|
||||||
myPhaseShiftPal->setEnabled(enable);
|
|
||||||
myTVRedScale->setEnabled(enable);
|
myTVRedScale->setEnabled(enable);
|
||||||
myTVRedShift->setEnabled(enable);
|
myTVRedShift->setEnabled(enable);
|
||||||
myTVGreenScale->setEnabled(enable);
|
myTVGreenScale->setEnabled(enable);
|
||||||
|
@ -969,8 +980,19 @@ void VideoAudioDialog::handlePaletteUpdate()
|
||||||
myTIAPalette->getSelectedTag().toString());
|
myTIAPalette->getSelectedTag().toString());
|
||||||
// Palette adjustables
|
// Palette adjustables
|
||||||
PaletteHandler::Adjustable paletteAdj;
|
PaletteHandler::Adjustable paletteAdj;
|
||||||
paletteAdj.phaseNtsc = myPhaseShiftNtsc->getValue();
|
bool isPAL = instance().hasConsole()
|
||||||
paletteAdj.phasePal = myPhaseShiftPal->getValue();
|
&& instance().console().timing() == ConsoleTiming::pal;
|
||||||
|
|
||||||
|
if(isPAL)
|
||||||
|
{
|
||||||
|
paletteAdj.phaseNtsc = myPaletteAdj.phaseNtsc; // unchanged
|
||||||
|
paletteAdj.phasePal = myPhaseShift->getValue();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
paletteAdj.phaseNtsc = myPhaseShift->getValue();
|
||||||
|
paletteAdj.phasePal = myPaletteAdj.phasePal; // unchanged
|
||||||
|
}
|
||||||
paletteAdj.redScale = myTVRedScale->getValue();
|
paletteAdj.redScale = myTVRedScale->getValue();
|
||||||
paletteAdj.redShift = myTVRedShift->getValue();
|
paletteAdj.redShift = myTVRedShift->getValue();
|
||||||
paletteAdj.greenScale = myTVGreenScale->getValue();
|
paletteAdj.greenScale = myTVGreenScale->getValue();
|
||||||
|
@ -1057,12 +1079,8 @@ void VideoAudioDialog::handleCommand(CommandSender* sender, int cmd,
|
||||||
handlePaletteUpdate();
|
handlePaletteUpdate();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kNtscShiftChanged:
|
case kPhaseShiftChanged:
|
||||||
handleShiftChanged(myPhaseShiftNtsc);
|
handleShiftChanged(myPhaseShift);
|
||||||
break;
|
|
||||||
|
|
||||||
case kPalShiftChanged:
|
|
||||||
handleShiftChanged(myPhaseShiftPal);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kRedShiftChanged:
|
case kRedShiftChanged:
|
||||||
|
@ -1185,6 +1203,7 @@ void VideoAudioDialog::addPalette(int x, int y, int w, int h)
|
||||||
{
|
{
|
||||||
myColor[idx][lum] = new ColorWidget(myTab, _font, x + lwidth + lum * COLW, y + idx * COLH,
|
myColor[idx][lum] = new ColorWidget(myTab, _font, x + lwidth + lum * COLW, y + idx * COLH,
|
||||||
COLW + 1, COLH + 1, 0, false);
|
COLW + 1, COLH + 1, 0, false);
|
||||||
|
myColor[idx][lum]->clearFlags(FLAG_CLEARBG | FLAG_RETAIN_FOCUS | FLAG_MOUSE_FOCUS | FLAG_BORDER);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,8 +104,7 @@ class VideoAudioDialog : public Dialog
|
||||||
|
|
||||||
// Palettes
|
// Palettes
|
||||||
PopUpWidget* myTIAPalette{nullptr};
|
PopUpWidget* myTIAPalette{nullptr};
|
||||||
SliderWidget* myPhaseShiftNtsc{nullptr};
|
SliderWidget* myPhaseShift{nullptr};
|
||||||
SliderWidget* myPhaseShiftPal{nullptr};
|
|
||||||
SliderWidget* myTVRedScale{nullptr};
|
SliderWidget* myTVRedScale{nullptr};
|
||||||
SliderWidget* myTVRedShift{nullptr};
|
SliderWidget* myTVRedShift{nullptr};
|
||||||
SliderWidget* myTVGreenScale{nullptr};
|
SliderWidget* myTVGreenScale{nullptr};
|
||||||
|
@ -143,8 +142,7 @@ class VideoAudioDialog : public Dialog
|
||||||
kOverscanChanged = 'VDOv',
|
kOverscanChanged = 'VDOv',
|
||||||
|
|
||||||
kPaletteChanged = 'VDpl',
|
kPaletteChanged = 'VDpl',
|
||||||
kNtscShiftChanged = 'VDns',
|
kPhaseShiftChanged = 'VDps',
|
||||||
kPalShiftChanged = 'VDps',
|
|
||||||
kRedShiftChanged = 'VDrs',
|
kRedShiftChanged = 'VDrs',
|
||||||
kGreenShiftChanged = 'VDgs',
|
kGreenShiftChanged = 'VDgs',
|
||||||
kBlueShiftChanged = 'VDbs',
|
kBlueShiftChanged = 'VDbs',
|
||||||
|
|
Loading…
Reference in New Issue