diff --git a/docs/index.html b/docs/index.html
index 393058df5..d408dacad 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -1525,13 +1525,13 @@
- Move display up (uses "Display.YStart") |
+ Move display up (uses "Display.VCenter") |
Alt + PageUp |
Cmd + PageUp |
- Move display down (uses "Display.YStart") |
+ Move display down (uses "Display.VCenter") |
Alt + PageDown |
Cmd + PageDown |
@@ -2004,18 +2004,15 @@
- -tia.inter <1|0> |
- Use interpolation for the TIA image (results in blending/smoothing
- of the image). |
+ -tia.vsizeadjust <-5 - 5> |
+ Adjust the display height of the TIA image
+ |
- -tia.aspectn <number> -tia.aspectp <number> |
- Specify the amount (as a percentage) to scale the
- TIA image width in NTSC and PAL mode. Since many video modes do not
- use square pixels, you can reduce width until the pixels appear square.
- Allowable values are 80 - 120; I find 85 - 90 gives the most authentic
- look for NTSC, and 105 - 110 for PAL. |
+ -tia.inter <1|0> |
+ Use interpolation for the TIA image (results in blending/smoothing
+ of the image). |
@@ -2572,8 +2569,8 @@
- -ystart <number> |
- Set "Display.YStart" property (0 - 64). |
+ -vcenter <number> |
+ Set "Display.VCenter" property (-5..5). |
@@ -2717,15 +2714,14 @@
Renderer | Use specified rendering mode | -video |
TIA palette | Palette for emulation mode | -palette |
TIA interpolation | Interpolation for TIA image | -tia.inter |
- TIA zoom | Zoom level for emulation mode | -tia.zoom |
- NTSC aspect | Width of TIA image in NTSC mode | -tia.aspectn |
- PAL aspect | Width of TIA image in PAL mode | -tia.aspectp |
+ TIA zoom | Zoom level for emulation mode | -tia.zoom |
+ V-Size adjust | Adjust height of TIA image | -tia.vsizeadjust |
Emul. speed | Emulation speed | -speed |
- VSync | Enable vertical synced updates | -vsync |
+ VSync | Enable vertical synced updates | -vsync |
Fullscreen | Self-explanatory - Note that colors may slightly change.
This depends on the OS and renderer used. | -fullscreen |
Stretch | In fullscreen mode, completely fill screen with TIA image | -tia.fs_stretch |
- Overscan | In fullscreen mode, add overscan to the TIA image | -tia.fs_overscan |
+ Overscan | In fullscreen mode, add overscan to the TIA image | -tia.fs_overscan |
Fast SuperCharger load | Skip progress loading bars for SuperCharger ROMs | -fastscbios |
Show UI messages | Overlay UI messages onscreen | -uimessages |
Center window | Attempt to center application windows, else position at last position | -center |
@@ -3749,9 +3745,9 @@ Ms Pac-Man (Stella extended codes):
- Display.YStart: |
- Indicates the scan-line to start displaying at.
- The value must be n such that 0 <= n <= 64.
+ | Display.VCenter: |
+ Indicates the offset for the vertical center of the display.
+ The value must be n such that -5 <= n <= 5.
|
diff --git a/src/common/PKeyboardHandler.cxx b/src/common/PKeyboardHandler.cxx
index d69264d0c..fcd09acb3 100644
--- a/src/common/PKeyboardHandler.cxx
+++ b/src/common/PKeyboardHandler.cxx
@@ -399,6 +399,7 @@ PhysicalKeyboardHandler::EventMappingArray PhysicalKeyboardHandler::DefaultCommo
{Event::ConsoleReset, KBDK_F2},
{Event::ConsoleColor, KBDK_F3},
{Event::ConsoleBlackWhite, KBDK_F4},
+ {Event::Console7800Pause, KBDK_F3, MOD3},
{Event::ConsoleLeftDiffA, KBDK_F5},
{Event::ConsoleLeftDiffB, KBDK_F6},
{Event::ConsoleRightDiffA, KBDK_F7},
diff --git a/src/emucore/Console.cxx b/src/emucore/Console.cxx
index 226d82e86..e94288c49 100644
--- a/src/emucore/Console.cxx
+++ b/src/emucore/Console.cxx
@@ -668,7 +668,11 @@ void Console::changeVerticalCenter(int direction)
if (vcenter != myTIA->vcenter()) myTIA->setVcenter(vcenter);
ss.str("");
- ss << "V-Center " << (vcenter > 0 ? "+" : "") << vcenter;
+ ss << "V-Center ";
+ if (!vcenter)
+ ss << "default";
+ else
+ ss << (vcenter > 0 ? "+" : "") << vcenter << "px";
myOSystem.frameBuffer().showMessage(ss.str());
}
@@ -685,24 +689,44 @@ void Console::updateVcenter(Int32 vcenter)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Console::changeScanlineAdjust(int direction)
{
- float newVsizeAdjust = myTIA->vsizeAdjust();
+ Int32 newAdjustVSize = myTIA->adjustVSize();;
if (direction != -1 && direction != +1) return;
if(direction == +1) // increase scanline adjustment
{
- newVsizeAdjust = std::min(myTIA->vsizeAdjust() + 0.5f, 5.f);
+ if (newAdjustVSize >= 5)
+ {
+ myOSystem.frameBuffer().showMessage("V-Size at maximum");
+ return;
+ }
+ newAdjustVSize++;
}
else if(direction == -1) // decrease scanline adjustment
{
- newVsizeAdjust = std::max(myTIA->vsizeAdjust() - 0.5f, -5.f);
+ if (newAdjustVSize <= -5)
+ {
+ myOSystem.frameBuffer().showMessage("V-Size at minimum");
+ return;
+ }
+ newAdjustVSize--;
}
- if (newVsizeAdjust != myTIA->vsizeAdjust()) {
- myTIA->setVsizeAdjust(newVsizeAdjust);
- myOSystem.settings().setValue("tia.vsizeadjust", newVsizeAdjust);
+ if (newAdjustVSize != myTIA->adjustVSize()) {
+ myTIA->setAdjustVSize(newAdjustVSize);
+ myOSystem.settings().setValue("tia.vsizeadjust", newAdjustVSize);
initializeVideo();
}
+
+ ostringstream ss;
+
+ ss << "V-Size ";
+ if (!newAdjustVSize)
+ ss << "default";
+ else
+ ss << (newAdjustVSize > 0 ? "+" : "") << newAdjustVSize << "%";
+
+ myOSystem.frameBuffer().showMessage(ss.str());
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -724,7 +748,7 @@ void Console::setTIAProperties()
myTIA->setLayout(FrameLayout::pal);
}
- myTIA->setVsizeAdjust(myOSystem.settings().getFloat("tia.vsizeadjust"));
+ myTIA->setAdjustVSize(myOSystem.settings().getInt("tia.vsizeadjust"));
myTIA->setVcenter(vcenter);
myEmulationTiming.updateFrameLayout(myTIA->frameLayout());
diff --git a/src/emucore/Event.hxx b/src/emucore/Event.hxx
index b07ba788d..9653ebde4 100644
--- a/src/emucore/Event.hxx
+++ b/src/emucore/Event.hxx
@@ -119,6 +119,8 @@ class Event
ToggleFrameStats, ToggleSAPortOrder,
+ // add new events from here to avoid that user remapped events get overwritten
+
LastType
};
@@ -131,7 +133,7 @@ class Event
LastGroup
};
- // Event list version, update if the id of existing event types changed
+ // Event list version, update only if the id of existing(!) event types changed
static constexpr Int32 VERSION = 2;
using EventSet = std::set;
diff --git a/src/emucore/Settings.cxx b/src/emucore/Settings.cxx
index 6c6818881..366e85307 100644
--- a/src/emucore/Settings.cxx
+++ b/src/emucore/Settings.cxx
@@ -50,7 +50,7 @@ Settings::Settings()
// TIA specific options
setPermanent("tia.zoom", "3");
setPermanent("tia.inter", "false");
- setPermanent("tia.vsizeadjust", 0.f);
+ setPermanent("tia.vsizeadjust", 0);
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.vsizeadjust");
- if(i < -5. || i > 5.) setValue("tia.vsizeadjust", 0.f);
+ i = getInt("tia.vsizeadjust");
+ if(i < -5 || i > 5) setValue("tia.vsizeadjust", 0);
s = getString("tia.dbgcolors");
sort(s.begin(), s.end());
@@ -403,14 +403,14 @@ void Settings::usage() const
<< " -audio.stereo <1|0> Enable stereo mode for all ROMs\n"
<< endl
#endif
- << " -tia.zoom Use the specified zoom level (windowed mode)\n"
+ << " -tia.zoom Use the specified zoom level (windowed mode)\n"
<< " for TIA image\n"
- << " -tia.inter <1|0> Enable interpolated (smooth) scaling for TIA\n"
+ << " -tia.vsizeadjust <-5..5> Adjust the vertical display size [percent]\n"
+ << " -tia.inter <1|0> Enable interpolated (smooth) scaling for TIA\n"
<< " image\n"
- << " -tia.vsizeadjust Adjust the vertical range of the image [percent]\n"
- << " -tia.fs_stretch <1|0> Stretch TIA image to fill fullscreen mode\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 Debug colors to use for each object (see manual\n"
+ << " -tia.dbgcolors Debug colors to use for each object (see manual\n"
<< " for description)\n"
<< endl
<< " -tv.filter <0-5> Set TV effects off (0) or to specified mode\n"
diff --git a/src/emucore/tia/TIA.hxx b/src/emucore/tia/TIA.hxx
index 0395496d3..0b3cb4eaf 100644
--- a/src/emucore/tia/TIA.hxx
+++ b/src/emucore/tia/TIA.hxx
@@ -264,8 +264,8 @@ class TIA : public Device
void setLayout(FrameLayout layout) { myFrameManager->setLayout(layout); }
FrameLayout frameLayout() const { return myFrameManager->layout(); }
- void setVsizeAdjust(float vsizeAdjust) { myFrameManager->setVsizeAdjust(vsizeAdjust); }
- float vsizeAdjust() const { return myFrameManager->vsizeAdjust(); }
+ void setAdjustVSize(Int32 adjustVSize) { myFrameManager->setAdjustVSize(adjustVSize); }
+ Int32 adjustVSize() const { return myFrameManager->adjustVSize(); }
/**
Enables/disables color-loss for PAL modes only.
diff --git a/src/emucore/tia/frame-manager/AbstractFrameManager.hxx b/src/emucore/tia/frame-manager/AbstractFrameManager.hxx
index f874987bb..d24923137 100644
--- a/src/emucore/tia/frame-manager/AbstractFrameManager.hxx
+++ b/src/emucore/tia/frame-manager/AbstractFrameManager.hxx
@@ -181,9 +181,9 @@ class AbstractFrameManager : public Serializable
virtual Int32 maxVcenter() const { return 0; }
- virtual void setVsizeAdjust(float vsizeAdjust) {}
+ virtual void setAdjustVSize(Int32 adjustVSize) {}
- virtual float vsizeAdjust() const { return 0; }
+ virtual Int32 adjustVSize() const { return 0; }
/**
* The corresponding start line.
diff --git a/src/emucore/tia/frame-manager/FrameManager.cxx b/src/emucore/tia/frame-manager/FrameManager.cxx
index 76b52fd55..5633de87e 100644
--- a/src/emucore/tia/frame-manager/FrameManager.cxx
+++ b/src/emucore/tia/frame-manager/FrameManager.cxx
@@ -121,9 +121,9 @@ void FrameManager::setVcenter(Int32 vcenter)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-void FrameManager::setVsizeAdjust(float vsizeAdjust)
+void FrameManager::setAdjustVSize(Int32 adjustVSize)
{
- myVsizeAdjust = vsizeAdjust;
+ myVSizeAdjust = adjustVSize;
recalculateMetrics();
}
@@ -244,10 +244,12 @@ void FrameManager::recalculateMetrics() {
throw runtime_error("frame manager: invalid TV mode");
}
- myHeight = BSPF::clamp(round(static_cast(baseHeight) * (1.f + myVsizeAdjust / 100.f)), 0, myFrameLines);
+ myHeight = BSPF::clamp(round(static_cast(baseHeight) * (1.f - myVSizeAdjust / 100.f)), 0, myFrameLines);
myYStart = BSPF::clamp(ystartBase + (baseHeight - static_cast(myHeight)) / 2 - myVcenter, 0, myFrameLines);
// TODO: why "- 1" here: ???
myMaxVcenter = BSPF::clamp(ystartBase + (baseHeight - static_cast(myHeight)) / 2 - 1, 0, TIAConstants::maxVcenter);
+ //cout << "myVSizeAdjust " << myVSizeAdjust << " " << myHeight << endl << std::flush;
+
myJitterEmulation.setYStart(myYStart);
}
diff --git a/src/emucore/tia/frame-manager/FrameManager.hxx b/src/emucore/tia/frame-manager/FrameManager.hxx
index d5f3c6ec6..33c837d10 100644
--- a/src/emucore/tia/frame-manager/FrameManager.hxx
+++ b/src/emucore/tia/frame-manager/FrameManager.hxx
@@ -52,9 +52,9 @@ class FrameManager: public AbstractFrameManager {
Int32 maxVcenter() const override { return myMaxVcenter; }
- void setVsizeAdjust(float vsizeAdjust) override;
+ void setAdjustVSize(Int32 adjustVSize) override;
- float vsizeAdjust() const override { return myVsizeAdjust; }
+ Int32 adjustVSize() 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 myVsizeAdjust{0.f};
+ Int32 myVSizeAdjust{0};
bool myJitterEnabled{false};
diff --git a/src/gui/VideoDialog.cxx b/src/gui/VideoDialog.cxx
index 12ae65bbd..00d91501a 100644
--- a/src/gui/VideoDialog.cxx
+++ b/src/gui/VideoDialog.cxx
@@ -86,7 +86,7 @@ VideoDialog::VideoDialog(OSystem& osystem, DialogContainer& parent,
fontWidth = font.getMaxCharWidth(),
buttonHeight = font.getLineHeight() + 4;
int xpos, ypos, tabID;
- int lwidth = font.getStringWidth("NTSC scanlines adjust "),
+ int lwidth = font.getStringWidth("V-Size adjust "),
pwidth = font.getStringWidth("XXXXxXXXX"),
swidth = font.getMaxCharWidth() * 10 - 2;
@@ -94,7 +94,7 @@ VideoDialog::VideoDialog(OSystem& osystem, DialogContainer& parent,
VariantList items;
// Set real dimensions
- setSize(65 * fontWidth + HBORDER * 2, 14 * (lineHeight + VGAP) + 14 + _th, max_w, max_h);
+ setSize(60 * fontWidth + HBORDER * 2, 14 * (lineHeight + VGAP) + 14 + _th, max_w, max_h);
// The tab widget
xpos = 2; ypos = 4;
@@ -136,12 +136,12 @@ VideoDialog::VideoDialog(OSystem& osystem, DialogContainer& parent,
ypos += lineHeight + VGAP;
// Aspect ratio (NTSC mode)
- myVsizeAdjust =
+ myVSizeAdjust =
new SliderWidget(myTab, font, xpos, ypos-1, swidth, lineHeight,
- "V-Size adjust ", lwidth, 0, fontWidth * 4, "", 0, true);
- myVsizeAdjust->setMinValue(-50); myVsizeAdjust->setMaxValue(50);
- myVsizeAdjust->setTickmarkIntervals(5);
- wid.push_back(myVsizeAdjust);
+ "V-Size adjust", lwidth, kVSizeChanged, fontWidth * 7, "%", 0, true);
+ myVSizeAdjust->setMinValue(-5); myVSizeAdjust->setMaxValue(5);
+ myVSizeAdjust->setTickmarkIntervals(2);
+ wid.push_back(myVSizeAdjust);
ypos += lineHeight + VGAP;
// Speed
@@ -159,7 +159,7 @@ VideoDialog::VideoDialog(OSystem& osystem, DialogContainer& parent,
wid.push_back(myUseVSync);
// Move over to the next column
- xpos += mySpeed->getWidth() + 28;
+ xpos += mySpeed->getWidth() + 44;
ypos = VBORDER;
// Fullscreen
@@ -342,9 +342,7 @@ void VideoDialog::loadConfig()
myTIAInterpolate->setState(instance().settings().getBool("tia.inter"));
// Aspect ratio setting (NTSC and PAL)
- myVsizeAdjust->setValue(
- round(instance().settings().getFloat("tia.vsizeadjust") * 10)
- );
+ myVSizeAdjust->setValue(instance().settings().getInt("tia.vsizeadjust"));
// Emulation speed
int speed = mapSpeed(instance().settings().getFloat("speed"));
@@ -403,22 +401,24 @@ void VideoDialog::saveConfig()
{
// Renderer setting
instance().settings().setValue("video",
- myRenderer->getSelectedTag().toString());
+ myRenderer->getSelectedTag().toString());
// TIA zoom levels
instance().settings().setValue("tia.zoom", myTIAZoom->getValue() / 100.0);
// TIA Palette
instance().settings().setValue("palette",
- myTIAPalette->getSelectedTag().toString());
+ myTIAPalette->getSelectedTag().toString());
// TIA interpolation
instance().settings().setValue("tia.inter", myTIAInterpolate->getState());
// Aspect ratio setting (NTSC and PAL)
- instance().settings().setValue("tia.vsizeadjust",
- static_cast(myVsizeAdjust->getValue()) / 10.f
- );
+ int oldAdjust = instance().settings().getInt("tia.vsizeadjust");
+ int newAdjust = myVSizeAdjust->getValue();
+ bool initializeVideo = oldAdjust != newAdjust;
+
+ instance().settings().setValue("tia.vsizeadjust", newAdjust);
// Speed
int speedup = mySpeed->getValue();
@@ -427,8 +427,6 @@ void VideoDialog::saveConfig()
// Fullscreen
instance().settings().setValue("fullscreen", myFullscreen->getState());
- /*instance().settings().setValue("fullscreenmode",
- myFullScreenMode->getSelectedTag().toString());*/
// Fullscreen stretch setting
instance().settings().setValue("tia.fs_stretch", myUseStretch->getState());
// Fullscreen overscan
@@ -448,25 +446,25 @@ void VideoDialog::saveConfig()
// Multi-threaded rendering
instance().settings().setValue("threads", myUseThreads->getState());
- if(instance().hasConsole())
+ if (instance().hasConsole())
instance().frameBuffer().tiaSurface().ntsc().enableThreading(myUseThreads->getState());
// TV Mode
instance().settings().setValue("tv.filter",
- myTVMode->getSelectedTag().toString());
+ myTVMode->getSelectedTag().toString());
// TV Custom adjustables
NTSCFilter::Adjustable adj;
- adj.hue = myTVHue->getValue();
- adj.saturation = myTVSatur->getValue();
- adj.contrast = myTVContrast->getValue();
- adj.brightness = myTVBright->getValue();
- adj.sharpness = myTVSharp->getValue();
- adj.gamma = myTVGamma->getValue();
- adj.resolution = myTVRes->getValue();
- adj.artifacts = myTVArtifacts->getValue();
- adj.fringing = myTVFringe->getValue();
- adj.bleed = myTVBleed->getValue();
+ adj.hue = myTVHue->getValue();
+ adj.saturation = myTVSatur->getValue();
+ adj.contrast = myTVContrast->getValue();
+ adj.brightness = myTVBright->getValue();
+ adj.sharpness = myTVSharp->getValue();
+ adj.gamma = myTVGamma->getValue();
+ adj.resolution = myTVRes->getValue();
+ adj.artifacts = myTVArtifacts->getValue();
+ adj.fringing = myTVFringe->getValue();
+ adj.bleed = myTVBleed->getValue();
instance().frameBuffer().tiaSurface().ntsc().setCustomAdjustables(adj);
// TV phosphor mode
@@ -478,7 +476,13 @@ void VideoDialog::saveConfig()
// TV scanline intensity
instance().settings().setValue("tv.scanlines", myTVScanIntense->getValueLabel());
- if (&instance().console()) instance().console().setTIAProperties();
+ if (instance().hasConsole())
+ {
+ instance().console().setTIAProperties();
+ // TODO: display the new screen (currently all blank)
+ if (initializeVideo)
+ instance().console().initializeVideo();
+ }
// Finally, issue a complete framebuffer re-initialization...
instance().createFrameBuffer();
@@ -498,7 +502,7 @@ void VideoDialog::setDefaults()
myTIAZoom->setValue(300);
myTIAPalette->setSelected("standard", "");
myTIAInterpolate->setState(false);
- myVsizeAdjust->setValue(0);
+ myVSizeAdjust->setValue(0);
mySpeed->setValue(0);
myFullscreen->setState(false);
@@ -615,6 +619,20 @@ void VideoDialog::handleCommand(CommandSender* sender, int cmd,
setDefaults();
break;
+ case kVSizeChanged:
+ {
+ int adjust = myVSizeAdjust->getValue();
+
+ if (!adjust)
+ {
+ myVSizeAdjust->setValueLabel("Default");
+ myVSizeAdjust->setValueUnit("");
+ }
+ else
+ myVSizeAdjust->setValueUnit("%");
+ break;
+ }
+
case kSpeedupChanged:
mySpeed->setValueLabel(formatSpeed(mySpeed->getValue()));
break;
diff --git a/src/gui/VideoDialog.hxx b/src/gui/VideoDialog.hxx
index 83be58716..34931481d 100644
--- a/src/gui/VideoDialog.hxx
+++ b/src/gui/VideoDialog.hxx
@@ -58,7 +58,7 @@ class VideoDialog : public Dialog
SliderWidget* myTIAZoom{nullptr};
PopUpWidget* myTIAPalette{nullptr};
CheckboxWidget* myTIAInterpolate{nullptr};
- SliderWidget* myVsizeAdjust{nullptr};
+ SliderWidget* myVSizeAdjust{nullptr};
SliderWidget* mySpeed{nullptr};
CheckboxWidget* myFullscreen{nullptr};
@@ -101,6 +101,7 @@ class VideoDialog : public Dialog
enum {
kSpeedupChanged = 'VDSp',
+ kVSizeChanged = 'VDVs',
kFullScreenChanged = 'VDFs',
kOverscanChanged = 'VDOv',
diff --git a/src/libretro/StellaLIBRETRO.cxx b/src/libretro/StellaLIBRETRO.cxx
index 673bc97f2..f475fbc0b 100644
--- a/src/libretro/StellaLIBRETRO.cxx
+++ b/src/libretro/StellaLIBRETRO.cxx
@@ -89,8 +89,8 @@ bool StellaLIBRETRO::create(bool logging)
settings.setValue("palette", video_palette);
settings.setValue("tia.zoom", 1);
+ settings.setValue("tia.vsizeadjust", 0);
settings.setValue("tia.inter", false);
- settings.setValue("tia.vsizeadjust", 0.f);
//fastscbios
// Fast loading of Supercharger BIOS