mirror of https://github.com/stella-emu/stella.git
Cleanup, adjustscanlines is now vsizeadjust.
This commit is contained in:
parent
5b99e3e998
commit
1dc31af9dd
|
@ -685,25 +685,22 @@ void Console::updateVcenter(Int32 vcenter)
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void Console::changeScanlineAdjust(int direction)
|
||||
{
|
||||
// Get correct setting, depending on whether we're in NTSC or PAL
|
||||
// Int32 adjust = myOSystem.settings().getInt("tia.adjustscanlines.ntsc");
|
||||
|
||||
float newAdjustScanliens = myTIA->adjustScanlines();;
|
||||
float newVsizeAdjust = myTIA->vsizeAdjust();
|
||||
|
||||
if (direction != -1 && direction != +1) return;
|
||||
|
||||
if(direction == +1) // increase scanline adjustment
|
||||
{
|
||||
newAdjustScanliens = std::min(myTIA->adjustScanlines() + 0.5f, 5.f);
|
||||
newVsizeAdjust = std::min(myTIA->vsizeAdjust() + 0.5f, 5.f);
|
||||
}
|
||||
else if(direction == -1) // decrease scanline adjustment
|
||||
{
|
||||
newAdjustScanliens = std::max(myTIA->adjustScanlines() - 0.5f, -5.f);
|
||||
newVsizeAdjust = std::max(myTIA->vsizeAdjust() - 0.5f, -5.f);
|
||||
}
|
||||
|
||||
if (newAdjustScanliens != myTIA->adjustScanlines()) {
|
||||
myTIA->setAdjustScanlines(newAdjustScanliens);
|
||||
myOSystem.settings().setValue("tia.adjustscanlines", newAdjustScanliens);
|
||||
if (newVsizeAdjust != myTIA->vsizeAdjust()) {
|
||||
myTIA->setVsizeAdjust(newVsizeAdjust);
|
||||
myOSystem.settings().setValue("tia.vsizeadjust", newVsizeAdjust);
|
||||
initializeVideo();
|
||||
}
|
||||
}
|
||||
|
@ -727,7 +724,7 @@ void Console::setTIAProperties()
|
|||
myTIA->setLayout(FrameLayout::pal);
|
||||
}
|
||||
|
||||
myTIA->setAdjustScanlines(myOSystem.settings().getFloat("tia.adjustscanlines"));
|
||||
myTIA->setVsizeAdjust(myOSystem.settings().getFloat("tia.vsizeadjust"));
|
||||
myTIA->setVcenter(vcenter);
|
||||
|
||||
myEmulationTiming.updateFrameLayout(myTIA->frameLayout());
|
||||
|
|
|
@ -50,7 +50,7 @@ Settings::Settings()
|
|||
// TIA specific options
|
||||
setPermanent("tia.zoom", "3");
|
||||
setPermanent("tia.inter", "false");
|
||||
setPermanent("tia.adjustscanlines", 0.f);
|
||||
setPermanent("tia.vsizeadjust", 0.f);
|
||||
setPermanent("fullscreen", "false");
|
||||
setPermanent("tia.fs_stretch", "false");
|
||||
setPermanent("tia.fs_overscan", "0");
|
||||
|
@ -254,8 +254,8 @@ void Settings::validate()
|
|||
f = getFloat("speed");
|
||||
if (f <= 0) setValue("speed", "1.0");
|
||||
|
||||
i = getFloat("tia.adjustscanlines");
|
||||
if(i < -5. || i > 5.) setValue("tia.adjustscanlines", 0.f);
|
||||
i = getFloat("tia.vsizeadjust");
|
||||
if(i < -5. || i > 5.) setValue("tia.vsizeadjust", 0.f);
|
||||
|
||||
s = getString("tia.dbgcolors");
|
||||
sort(s.begin(), s.end());
|
||||
|
@ -407,7 +407,7 @@ void Settings::usage() const
|
|||
<< " for TIA image\n"
|
||||
<< " -tia.inter <1|0> Enable interpolated (smooth) scaling for TIA\n"
|
||||
<< " image\n"
|
||||
<< " -tia.adjustscanlines <float> Adjust the visible number if TIA scanlines [percent]\n"
|
||||
<< " -tia.vsizeadjust <float> Adjust the vertical range of the image [percent]\n"
|
||||
<< " -tia.fs_stretch <1|0> Stretch TIA image to fill fullscreen mode\n"
|
||||
<< " -tia.fs_overscan <0-10> Add overscan to TIA image in fill fullscreen mode\n"
|
||||
<< " -tia.dbgcolors <string> Debug colors to use for each object (see manual\n"
|
||||
|
|
|
@ -264,8 +264,8 @@ class TIA : public Device
|
|||
void setLayout(FrameLayout layout) { myFrameManager->setLayout(layout); }
|
||||
FrameLayout frameLayout() const { return myFrameManager->layout(); }
|
||||
|
||||
void setAdjustScanlines(float adjustScanlines) { myFrameManager->setAdjustScanlines(adjustScanlines); }
|
||||
float adjustScanlines() const { return myFrameManager->adjustScanlines(); }
|
||||
void setVsizeAdjust(float vsizeAdjust) { myFrameManager->setVsizeAdjust(vsizeAdjust); }
|
||||
float vsizeAdjust() const { return myFrameManager->vsizeAdjust(); }
|
||||
|
||||
/**
|
||||
Enables/disables color-loss for PAL modes only.
|
||||
|
|
|
@ -181,9 +181,9 @@ class AbstractFrameManager : public Serializable
|
|||
virtual Int32 maxVcenter() const { return 0; }
|
||||
|
||||
|
||||
virtual void setAdjustScanlines(float adjustScanlines) {}
|
||||
virtual void setVsizeAdjust(float vsizeAdjust) {}
|
||||
|
||||
virtual float adjustScanlines() const { return 0; }
|
||||
virtual float vsizeAdjust() const { return 0; }
|
||||
|
||||
/**
|
||||
* The corresponding start line.
|
||||
|
|
|
@ -121,9 +121,9 @@ void FrameManager::setVcenter(Int32 vcenter)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void FrameManager::setAdjustScanlines(float adjustScanlines)
|
||||
void FrameManager::setVsizeAdjust(float vsizeAdjust)
|
||||
{
|
||||
myAdjustScanlines = adjustScanlines;
|
||||
myVsizeAdjust = vsizeAdjust;
|
||||
recalculateMetrics();
|
||||
}
|
||||
|
||||
|
@ -244,12 +244,10 @@ void FrameManager::recalculateMetrics() {
|
|||
throw runtime_error("frame manager: invalid TV mode");
|
||||
}
|
||||
|
||||
myHeight = BSPF::clamp<uInt32>(round(static_cast<float>(baseHeight) * (1.f + myAdjustScanlines / 100.f)), 0, myFrameLines);
|
||||
myHeight = BSPF::clamp<uInt32>(round(static_cast<float>(baseHeight) * (1.f + myVsizeAdjust / 100.f)), 0, myFrameLines);
|
||||
myYStart = BSPF::clamp<uInt32>(ystartBase + (baseHeight - static_cast<Int32>(myHeight)) / 2 - myVcenter, 0, myFrameLines);
|
||||
// TODO: why "- 1" here: ???
|
||||
myMaxVcenter = BSPF::clamp<Int32>(ystartBase + (baseHeight - static_cast<Int32>(myHeight)) / 2 - 1, 0, TIAConstants::maxVcenter);
|
||||
|
||||
cout << myAdjustScanlines << " " << myHeight << endl << std::flush;
|
||||
|
||||
myJitterEmulation.setYStart(myYStart);
|
||||
}
|
||||
|
|
|
@ -52,9 +52,9 @@ class FrameManager: public AbstractFrameManager {
|
|||
|
||||
Int32 maxVcenter() const override { return myMaxVcenter; }
|
||||
|
||||
void setAdjustScanlines(float adjustScanlines) override;
|
||||
void setVsizeAdjust(float vsizeAdjust) override;
|
||||
|
||||
float adjustScanlines() const override { return myAdjustScanlines; }
|
||||
float vsizeAdjust() const override { return myVsizeAdjust; }
|
||||
|
||||
uInt32 startLine() const override { return myYStart; }
|
||||
|
||||
|
@ -102,7 +102,7 @@ class FrameManager: public AbstractFrameManager {
|
|||
uInt32 myYStart{0};
|
||||
Int32 myVcenter{0};
|
||||
Int32 myMaxVcenter{0};
|
||||
float myAdjustScanlines{0.f};
|
||||
float myVsizeAdjust{0.f};
|
||||
|
||||
bool myJitterEnabled{false};
|
||||
|
||||
|
|
|
@ -136,12 +136,12 @@ VideoDialog::VideoDialog(OSystem& osystem, DialogContainer& parent,
|
|||
ypos += lineHeight + VGAP;
|
||||
|
||||
// Aspect ratio (NTSC mode)
|
||||
myAdjustScanlines =
|
||||
myVsizeAdjust =
|
||||
new SliderWidget(myTab, font, xpos, ypos-1, swidth, lineHeight,
|
||||
"Scanlines adjust ", lwidth, 0, fontWidth * 4, "", 0, true);
|
||||
myAdjustScanlines->setMinValue(-50); myAdjustScanlines->setMaxValue(50);
|
||||
myAdjustScanlines->setTickmarkIntervals(5);
|
||||
wid.push_back(myAdjustScanlines);
|
||||
"V-Size adjust ", lwidth, 0, fontWidth * 4, "", 0, true);
|
||||
myVsizeAdjust->setMinValue(-50); myVsizeAdjust->setMaxValue(50);
|
||||
myVsizeAdjust->setTickmarkIntervals(5);
|
||||
wid.push_back(myVsizeAdjust);
|
||||
ypos += lineHeight + VGAP;
|
||||
|
||||
// Speed
|
||||
|
@ -342,8 +342,8 @@ void VideoDialog::loadConfig()
|
|||
myTIAInterpolate->setState(instance().settings().getBool("tia.inter"));
|
||||
|
||||
// Aspect ratio setting (NTSC and PAL)
|
||||
myAdjustScanlines->setValue(
|
||||
round(instance().settings().getFloat("tia.adjustscanlines") * 10)
|
||||
myVsizeAdjust->setValue(
|
||||
round(instance().settings().getFloat("tia.vsizeadjust") * 10)
|
||||
);
|
||||
|
||||
// Emulation speed
|
||||
|
@ -416,8 +416,8 @@ void VideoDialog::saveConfig()
|
|||
instance().settings().setValue("tia.inter", myTIAInterpolate->getState());
|
||||
|
||||
// Aspect ratio setting (NTSC and PAL)
|
||||
instance().settings().setValue("tia.adjustscanlines",
|
||||
static_cast<float>(myAdjustScanlines->getValue()) / 10.f
|
||||
instance().settings().setValue("tia.vsizeadjust",
|
||||
static_cast<float>(myVsizeAdjust->getValue()) / 10.f
|
||||
);
|
||||
|
||||
// Speed
|
||||
|
@ -498,7 +498,7 @@ void VideoDialog::setDefaults()
|
|||
myTIAZoom->setValue(300);
|
||||
myTIAPalette->setSelected("standard", "");
|
||||
myTIAInterpolate->setState(false);
|
||||
myAdjustScanlines->setValue(0);
|
||||
myVsizeAdjust->setValue(0);
|
||||
mySpeed->setValue(0);
|
||||
|
||||
myFullscreen->setState(false);
|
||||
|
|
|
@ -58,7 +58,7 @@ class VideoDialog : public Dialog
|
|||
SliderWidget* myTIAZoom{nullptr};
|
||||
PopUpWidget* myTIAPalette{nullptr};
|
||||
CheckboxWidget* myTIAInterpolate{nullptr};
|
||||
SliderWidget* myAdjustScanlines{nullptr};
|
||||
SliderWidget* myVsizeAdjust{nullptr};
|
||||
SliderWidget* mySpeed{nullptr};
|
||||
|
||||
CheckboxWidget* myFullscreen{nullptr};
|
||||
|
|
|
@ -90,7 +90,7 @@ bool StellaLIBRETRO::create(bool logging)
|
|||
|
||||
settings.setValue("tia.zoom", 1);
|
||||
settings.setValue("tia.inter", false);
|
||||
settings.setValue("tia.", 0.f);
|
||||
settings.setValue("tia.vsizeadjust", 0.f);
|
||||
|
||||
//fastscbios
|
||||
// Fast loading of Supercharger BIOS
|
||||
|
|
Loading…
Reference in New Issue