Reimplement y-start as "V-Center" in dialog and messages

Limit v-center range to +/-15 pixel
This commit is contained in:
thrust26 2019-12-16 12:41:39 +01:00
parent 980f5b92fa
commit c2fc39f44d
7 changed files with 77 additions and 42 deletions

View File

@ -1536,7 +1536,6 @@
<td>Cmd + PageDown</td>
</tr>
<tr>
<td>Switch display format in <i>increasing</i> order (NTSC/PAL/SECAM etc.)</td>
<td>Control + f</td>
@ -3676,35 +3675,35 @@ Ms Pac-Man (Stella extended codes):
<tr><td>3E </td><td>32K Tigervision </td><td>.3E </td></tr>
<tr><td>3E+ </td><td>3E+ (TJ modified DASH) </td><td>.3EP, .3E+ </td></tr>
<tr><td>3F </td><td>512K Tigervision </td><td>.3F </td></tr>
<tr><td>4A50 &#178;</td><td>64K 4A50 + ram </td><td>.4A5, .4A50 </td></tr>
<tr><td>4A50 &#178;</td><td>64K 4A50 + RAM </td><td>.4A5, .4A50 </td></tr>
<tr><td>4K </td><td>4K Atari </td><td>.4K </td></tr>
<tr><td>4KSC </td><td>CPUWIZ 4K + ram </td><td>.4KS, .4KSC </td></tr>
<tr><td>4KSC </td><td>CPUWIZ 4K + RAM </td><td>.4KS, .4KSC </td></tr>
<tr><td>AR &#178;</td><td>Supercharger </td><td>.AR </td></tr>
<tr><td>BF </td><td>CPUWIZ 256K </td><td>.BF </td></tr>
<tr><td>BFSC </td><td>CPUWIZ 256K + ram</td><td>.BFS, .BFSC </td></tr>
<tr><td>BFSC </td><td>CPUWIZ 256K + RAM</td><td>.BFS, .BFSC </td></tr>
<tr><td>BUS </td><td>Experimental</td><td>.BUS </td></tr>
<tr><td>CDF </td><td>Chris, Darrell, Fred (includes CDFJ)</td><td>.CDF </td></tr>
<tr><td>CM &#185;</td><td>Spectravideo CompuMate </td><td>.CM </td></tr>
<tr><td>CTY &#178;</td><td>CDW - Chetiry </td><td>.CTY </td></tr>
<tr><td>CV </td><td>Commavid extra ram </td><td>.CV </td></tr>
<tr><td>CV+ </td><td>Extended Commavid extra ram</td><td>.CVP </td></tr>
<tr><td>CV </td><td>Commavid extra RAM </td><td>.CV </td></tr>
<tr><td>CV+ </td><td>Extended Commavid extra RAM</td><td>.CVP </td></tr>
<tr><td>DASH </td><td>Boulder Dash 2 </td><td>.DAS, .DASH </td></tr>
<tr><td>DF </td><td>CPUWIZ 128K </td><td>.DF </td></tr>
<tr><td>DFSC </td><td>CPUWIZ 128K + ram</td><td>.DFS, .DFSC </td></tr>
<tr><td>DFSC </td><td>CPUWIZ 128K + RAM</td><td>.DFS, .DFSC </td></tr>
<tr><td>DPC </td><td>Pitfall II </td><td>.DPC </td></tr>
<tr><td>DPC+</td><td>Enhanced DPC </td><td>.DPP, .DPC+ </td></tr>
<tr><td>E0 </td><td>8K Parker Bros </td><td>.E0 </td></tr>
<tr><td>E7 </td><td>16K M-network </td><td>.E7 </td></tr>
<tr><td>E78K </td><td>8K M-network </td><td>.E78, .E78K </td></tr>
<tr><td>EF </td><td>64K Homestar Runner </td><td>.EF </td></tr>
<tr><td>EFSC </td><td>64K Homestar Runner + ram</td><td>.EFS, .EFSC </td></tr>
<tr><td>EFSC </td><td>64K Homestar Runner + RAM</td><td>.EFS, .EFSC </td></tr>
<tr><td>F0 </td><td>Dynacom Megaboy </td><td>.F0 </td></tr>
<tr><td>F4 </td><td>32K Atari </td><td>.F4 </td></tr>
<tr><td>F4SC </td><td>32K Atari + ram </td><td>.F4S, .F4SC </td></tr>
<tr><td>F4SC </td><td>32K Atari + RAM </td><td>.F4S, .F4SC </td></tr>
<tr><td>F6 </td><td>16K Atari </td><td>.F6 </td></tr>
<tr><td>F6SC </td><td>16K Atari + ram </td><td>.F6S, .F6SC </td></tr>
<tr><td>F6SC </td><td>16K Atari + RAM </td><td>.F6S, .F6SC </td></tr>
<tr><td>F8 </td><td>8K Atari </td><td>.F8 </td></tr>
<tr><td>F8SC </td><td>8K Atari + ram </td><td>.F8S, .F8SC </td></tr>
<tr><td>F8SC </td><td>8K Atari + RAM </td><td>.F8S, .F8SC </td></tr>
<tr><td>FA </td><td>CBS RAM Plus </td><td>.FA </td></tr>
<tr><td>FA2 </td><td>CBS RAM Plus 24/28K </td><td>.FA2 </td></tr>
<tr><td>FC </td><td>Amiga Power Play Aracde 16/32K </td><td>.FC </td></tr>

View File

@ -431,8 +431,8 @@ PhysicalKeyboardHandler::EventMappingArray PhysicalKeyboardHandler::DefaultCommo
{Event::VidmodeDecrease, KBDK_MINUS, MOD3},
{Event::VidmodeIncrease, KBDK_EQUALS, MOD3},
{Event::YStartDecrease, KBDK_PAGEUP, MOD3},
{Event::YStartIncrease, KBDK_PAGEDOWN, MOD3},
{Event::YStartDecrease, KBDK_PAGEDOWN, MOD3},
{Event::YStartIncrease, KBDK_PAGEUP, MOD3},
{Event::VolumeDecrease, KBDK_LEFTBRACKET, MOD3},
{Event::VolumeIncrease, KBDK_RIGHTBRACKET, MOD3},
{Event::SoundToggle, KBDK_RIGHTBRACKET, KBDM_CTRL},

View File

@ -687,7 +687,7 @@ void Console::changeYStart(int direction)
{
if(ystart >= TIAConstants::maxYStart)
{
myOSystem.frameBuffer().showMessage("YStart at maximum");
myOSystem.frameBuffer().showMessage("V-Center at minimum");
return;
}
@ -696,9 +696,10 @@ void Console::changeYStart(int direction)
}
else if(direction == -1) // decrease YStart
{
if(ystart == 0)
if (ystart <= TIAConstants::minYStart)
{
throw runtime_error("cannot happen");
myOSystem.frameBuffer().showMessage("V-Center at maximum");
return;
}
--ystart;
@ -707,26 +708,16 @@ void Console::changeYStart(int direction)
else
return;
if(ystart == 0) {
redetectYStart();
ystart = myAutodetectedYstart;
myYStartAutodetected = true;
myProperties.set(PropType::Display_YStart, "0");
}
else {
ostringstream ss;
ss << ystart;
myProperties.set(PropType::Display_YStart, ss.str());
}
if (ystart != myTIA->ystart()) myTIA->setYStart(ystart);
ostringstream ss;
if(myAutodetectedYstart == ystart) ss << "YStart " << ystart << " (Auto)";
else ss << "YStart " << ystart;
// use vertical center instead of y-start for display
int vCenter = TIAConstants::defaultYStart - ystart;
ss.str("");
ss << "V-Center " << vCenter;
myOSystem.frameBuffer().showMessage(ss.str());
}

View File

@ -1830,10 +1830,10 @@ EventHandler::EmulActionList EventHandler::ourEmulActionList = { {
{ Event::ToggleFullScreen, "Toggle fullscreen", "" },
{ Event::OverscanDecrease, "Decrease overscan in fullscreen mode", "" },
{ Event::OverscanIncrease, "Increase overscan in fullscreen mode", "" },
{ Event::YStartIncrease, "Move display up", "" },
{ Event::YStartDecrease, "Move display down", "" },
{ Event::FormatDecrease, "Decrease display format", "" },
{ Event::FormatIncrease, "Increase display format", "" },
{ Event::YStartDecrease, "Move display up", "" },
{ Event::YStartIncrease, "Move display down", "" },
{ Event::TogglePalette, "Switch palette (Standard/Z26/User)", "" },
// TV effects:

View File

@ -24,7 +24,9 @@ namespace TIAConstants {
static constexpr uInt32 frameBufferWidth = 160;
static constexpr uInt32 frameBufferHeight = 320;
static constexpr uInt32 maxYStart = 64; // TODO - this may be removed
static constexpr uInt32 defaultYStart = 34; // TODO: PAL-50 might need a different value here
static constexpr uInt32 minYStart = defaultYStart - 15; // limit to reasonable values
static constexpr uInt32 maxYStart = defaultYStart + 15; // limit to reasonable values
static constexpr uInt32 viewableWidth = 320;
static constexpr uInt32 viewableHeight = 240;
static constexpr uInt32 initialGarbageFrames = 10;

View File

@ -120,12 +120,13 @@ GameInfoDialog::GameInfoDialog(
myFormatDetected = new StaticTextWidget(myTab, ifont, myFormat->getRight() + 8, ypos + 4, "SECAM60 detected");
// Phosphor
ypos += lineHeight + VGAP * 2;
ypos += lineHeight + VGAP;
myPhosphor = new CheckboxWidget(myTab, font, HBORDER, ypos + 1, "Phosphor (enabled for all ROMs)", kPhosphorChanged);
wid.push_back(myPhosphor);
ypos += lineHeight + VGAP;
ypos += lineHeight + VGAP * 0;
myPPBlend = new SliderWidget(myTab, font,
HBORDER + 20, ypos,
"Blend ", 0, kPPBlendChanged, 4 * fontWidth, "%");
@ -133,7 +134,16 @@ GameInfoDialog::GameInfoDialog(
myPPBlend->setTickmarkIntervals(2);
wid.push_back(myPPBlend);
ypos += lineHeight + VGAP * 4;
ypos += lineHeight + VGAP;
t = new StaticTextWidget(myTab, font, HBORDER, ypos + 1, "V-Center ");
myVCenter = new SliderWidget(myTab, font, t->getRight() + 2, ypos,
"", 0, kYStartChanged, 7 * fontWidth, "px");
myVCenter->setMinValue(TIAConstants::minYStart - TIAConstants::defaultYStart);
myVCenter->setMaxValue(TIAConstants::maxYStart - TIAConstants::defaultYStart);
myVCenter->setTickmarkIntervals(4);
wid.push_back(myVCenter);
ypos += lineHeight + VGAP * 3;
mySound = new CheckboxWidget(myTab, font, HBORDER, ypos + 1, "Stereo sound");
wid.push_back(mySound);
@ -446,6 +456,21 @@ void GameInfoDialog::loadEmulationProperties(const Properties& props)
const string& blend = props.get(PropType::Display_PPBlend);
myPPBlend->setValue(atoi(blend.c_str()));
// set vertical center (y-start)
int vCenter = atoi(props.get(PropType::Display_YStart).c_str());
if (vCenter)
{
// convert y-start into v-center
vCenter = TIAConstants::defaultYStart - vCenter;
myVCenter->setValueLabel(vCenter);
}
else
{
myVCenter->setValueLabel("default");
}
myVCenter->setValue(vCenter);
myVCenter->setValueUnit(vCenter ? "px" : "");
mySound->setState(props.get(PropType::Cart_Sound) == "STEREO");
// if stereo is always enabled, disable game specific stereo setting
mySound->setEnabled(!instance().audioSettings().stereo());
@ -521,6 +546,11 @@ void GameInfoDialog::saveConfig()
myGameProperties.set(PropType::Display_Phosphor, myPhosphor->getState() ? "YES" : "NO");
myGameProperties.set(PropType::Display_PPBlend, myPPBlend->getValueLabel() == "Off" ? "0" :
myPPBlend->getValueLabel());
int vCenter = myVCenter->getValue();
if (vCenter)
// convert v-center into y-start
vCenter = TIAConstants::defaultYStart - vCenter;
myGameProperties.set(PropType::Display_YStart, std::to_string(vCenter));
myGameProperties.set(PropType::Cart_Sound, mySound->getState() ? "STEREO" : "MONO");
// Console properties
@ -563,6 +593,7 @@ void GameInfoDialog::saveConfig()
// update 'Emulation' tab settings immediately
instance().console().setFormat(myFormat->getSelected());
instance().frameBuffer().tiaSurface().enablePhosphor(myPhosphor->getState(), myPPBlend->getValue());
instance().console().updateYStart(vCenter);
instance().console().initializeAudio();
// update 'Console' tab settings immediately
@ -761,6 +792,16 @@ void GameInfoDialog::handleCommand(CommandSender* sender, int cmd,
myPPBlend->setValueUnit("%");
break;
case kYStartChanged:
if (myVCenter->getValue() == 0)
{
myVCenter->setValueLabel("Default");
myVCenter->setValueUnit("");
}
else
myVCenter->setValueUnit("px");
break;
case kMCtrlChanged:
{
bool state = myMouseControl->getState();

View File

@ -67,6 +67,7 @@ class GameInfoDialog : public Dialog, public CommandSender
PopUpWidget* myStartBank;
PopUpWidget* myFormat;
StaticTextWidget* myFormatDetected;
SliderWidget* myVCenter;
CheckboxWidget* myPhosphor;
SliderWidget* myPPBlend;
CheckboxWidget* mySound;
@ -102,6 +103,7 @@ class GameInfoDialog : public Dialog, public CommandSender
EditTextWidget* myNote;
enum {
kYStartChanged = 'YSch',
kPhosphorChanged = 'PPch',
kPPBlendChanged = 'PBch',
kLeftCChanged = 'LCch',