mirror of https://github.com/stella-emu/stella.git
reverse and limit vcenter
This commit is contained in:
parent
a530bdcfb7
commit
4580484835
|
@ -426,8 +426,8 @@ PhysicalKeyboardHandler::EventMappingArray PhysicalKeyboardHandler::DefaultCommo
|
|||
|
||||
{Event::VidmodeDecrease, KBDK_MINUS, MOD3},
|
||||
{Event::VidmodeIncrease, KBDK_EQUALS, MOD3},
|
||||
{Event::VCenterDecrease, KBDK_PAGEDOWN, MOD3},
|
||||
{Event::VCenterIncrease, KBDK_PAGEUP, MOD3},
|
||||
{Event::VCenterDecrease, KBDK_PAGEUP, MOD3},
|
||||
{Event::VCenterIncrease, KBDK_PAGEDOWN, MOD3},
|
||||
{Event::ScanlineAdjustDecrease, KBDK_PAGEDOWN, KBDM_SHIFT | MOD3},
|
||||
{Event::ScanlineAdjustIncrease, KBDK_PAGEUP, KBDM_SHIFT | MOD3},
|
||||
{Event::VolumeDecrease, KBDK_LEFTBRACKET, MOD3},
|
||||
|
|
|
@ -642,22 +642,20 @@ void Console::changeVerticalCenter(int direction)
|
|||
|
||||
if(direction == +1) // increase vcenter
|
||||
{
|
||||
if(vcenter >= TIAConstants::maxVcenter)
|
||||
{
|
||||
myOSystem.frameBuffer().showMessage("V-Center at minimum");
|
||||
return;
|
||||
}
|
||||
|
||||
++vcenter;
|
||||
}
|
||||
else if(direction == -1) // decrease vcenter
|
||||
{
|
||||
if (vcenter <= TIAConstants::minVcenter)
|
||||
if(vcenter >= myTIA->maxVcenter())
|
||||
{
|
||||
myOSystem.frameBuffer().showMessage("V-Center at maximum");
|
||||
return;
|
||||
}
|
||||
|
||||
++vcenter;
|
||||
}
|
||||
else if(direction == -1) // decrease vcenter
|
||||
{
|
||||
if (vcenter <= myTIA->minVcenter())
|
||||
{
|
||||
myOSystem.frameBuffer().showMessage("V-Center at minimum");
|
||||
return;
|
||||
}
|
||||
--vcenter;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -252,6 +252,8 @@ class TIA : public Device
|
|||
uInt32 width() const { return TIAConstants::H_PIXEL; }
|
||||
uInt32 height() const { return myFrameManager->height(); }
|
||||
Int32 vcenter() const { return myFrameManager->vcenter(); }
|
||||
Int32 minVcenter() const { return myFrameManager->minVcenter(); }
|
||||
Int32 maxVcenter() const { return myFrameManager->maxVcenter(); }
|
||||
uInt32 startLine() const { return myFrameManager->startLine(); }
|
||||
|
||||
/**
|
||||
|
|
|
@ -24,8 +24,8 @@ namespace TIAConstants {
|
|||
|
||||
static constexpr uInt32 frameBufferWidth = 160;
|
||||
static constexpr uInt32 frameBufferHeight = 320;
|
||||
static constexpr Int32 maxVcenter = 20; // limit to reasonable values
|
||||
static constexpr Int32 minVcenter = -20; // limit to reasonable values
|
||||
static constexpr Int32 maxVcenter = 20; // limit to reasonable values
|
||||
static constexpr uInt32 viewableWidth = 320;
|
||||
static constexpr uInt32 viewableHeight = 240;
|
||||
static constexpr uInt32 initialGarbageFrames = 10;
|
||||
|
|
|
@ -170,6 +170,17 @@ class AbstractFrameManager : public Serializable
|
|||
*/
|
||||
virtual Int32 vcenter() const { return 0; }
|
||||
|
||||
/**
|
||||
* The calculated minimal vcenter value.
|
||||
*/
|
||||
virtual Int32 minVcenter() const { return 0; }
|
||||
|
||||
/**
|
||||
* The calculated maximal vcenter value.
|
||||
*/
|
||||
virtual Int32 maxVcenter() const { return 0; }
|
||||
|
||||
|
||||
virtual void setAdjustScanlines(Int32 adjustScanlines) {}
|
||||
|
||||
virtual Int32 adjustScanlines() const { return 0; }
|
||||
|
|
|
@ -244,7 +244,9 @@ void FrameManager::recalculateMetrics() {
|
|||
}
|
||||
|
||||
myHeight = BSPF::clamp<uInt32>(baseHeight + myAdjustScanlines * 2, 0, myFrameLines);
|
||||
myYStart = BSPF::clamp<uInt32>(ystartBase + (baseHeight - static_cast<Int32>(myHeight)) / 2 + myVcenter, 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);
|
||||
|
||||
myJitterEmulation.setYStart(myYStart);
|
||||
}
|
||||
|
|
|
@ -48,6 +48,10 @@ class FrameManager: public AbstractFrameManager {
|
|||
|
||||
Int32 vcenter() const override { return myVcenter; }
|
||||
|
||||
Int32 minVcenter() const override { return TIAConstants::minVcenter; }
|
||||
|
||||
Int32 maxVcenter() const override { return myMaxVcenter; }
|
||||
|
||||
void setAdjustScanlines(Int32 adjustScanlines) override;
|
||||
|
||||
Int32 adjustScanlines() const override { return myAdjustScanlines; }
|
||||
|
@ -97,6 +101,7 @@ class FrameManager: public AbstractFrameManager {
|
|||
uInt32 myHeight{0};
|
||||
uInt32 myYStart{0};
|
||||
Int32 myVcenter{0};
|
||||
Int32 myMaxVcenter{0};
|
||||
Int32 myAdjustScanlines{0};
|
||||
|
||||
bool myJitterEnabled{false};
|
||||
|
|
Loading…
Reference in New Issue