diff --git a/docs/index.html b/docs/index.html index 04b35a205..e1402f31a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1536,7 +1536,6 @@ Cmd + PageDown - Switch display format in increasing order (NTSC/PAL/SECAM etc.) Control + f @@ -3676,35 +3675,35 @@ Ms Pac-Man (Stella extended codes): 3E 32K Tigervision .3E 3E+ 3E+ (TJ modified DASH) .3EP, .3E+ 3F 512K Tigervision .3F - 4A50 ²64K 4A50 + ram .4A5, .4A50 + 4A50 ²64K 4A50 + RAM .4A5, .4A50 4K 4K Atari .4K - 4KSC CPUWIZ 4K + ram .4KS, .4KSC + 4KSC CPUWIZ 4K + RAM .4KS, .4KSC AR ²Supercharger .AR BF CPUWIZ 256K .BF - BFSC CPUWIZ 256K + ram.BFS, .BFSC + BFSC CPUWIZ 256K + RAM.BFS, .BFSC BUS Experimental.BUS CDF Chris, Darrell, Fred (includes CDFJ).CDF CM ¹Spectravideo CompuMate .CM CTY ²CDW - Chetiry .CTY - CV Commavid extra ram .CV - CV+ Extended Commavid extra ram.CVP + CV Commavid extra RAM .CV + CV+ Extended Commavid extra RAM.CVP DASH Boulder Dash 2 .DAS, .DASH DF CPUWIZ 128K .DF - DFSC CPUWIZ 128K + ram.DFS, .DFSC + DFSC CPUWIZ 128K + RAM.DFS, .DFSC DPC Pitfall II .DPC DPC+Enhanced DPC .DPP, .DPC+ E0 8K Parker Bros .E0 E7 16K M-network .E7 E78K 8K M-network .E78, .E78K EF 64K Homestar Runner .EF - EFSC 64K Homestar Runner + ram.EFS, .EFSC + EFSC 64K Homestar Runner + RAM.EFS, .EFSC F0 Dynacom Megaboy .F0 F4 32K Atari .F4 - F4SC 32K Atari + ram .F4S, .F4SC + F4SC 32K Atari + RAM .F4S, .F4SC F6 16K Atari .F6 - F6SC 16K Atari + ram .F6S, .F6SC + F6SC 16K Atari + RAM .F6S, .F6SC F8 8K Atari .F8 - F8SC 8K Atari + ram .F8S, .F8SC + F8SC 8K Atari + RAM .F8S, .F8SC FA CBS RAM Plus .FA FA2 CBS RAM Plus 24/28K .FA2 FC Amiga Power Play Aracde 16/32K .FC diff --git a/src/common/PKeyboardHandler.cxx b/src/common/PKeyboardHandler.cxx index 07a20640a..456d50eb1 100644 --- a/src/common/PKeyboardHandler.cxx +++ b/src/common/PKeyboardHandler.cxx @@ -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}, diff --git a/src/emucore/Console.cxx b/src/emucore/Console.cxx index 4d313b50d..e2e6f184e 100644 --- a/src/emucore/Console.cxx +++ b/src/emucore/Console.cxx @@ -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()); - } + 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()); } diff --git a/src/emucore/EventHandler.cxx b/src/emucore/EventHandler.cxx index d0ec6d64c..c8fe185ed 100644 --- a/src/emucore/EventHandler.cxx +++ b/src/emucore/EventHandler.cxx @@ -420,7 +420,7 @@ void EventHandler::handleEvent(Event::Type event, Int32 value, bool repeated) return; case Event::YStartDecrease: - if (pressed) myOSystem.console().changeYStart(-1); + if (pressed) myOSystem.console().changeYStart(-1); return; case Event::YStartIncrease: @@ -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: diff --git a/src/emucore/tia/TIAConstants.hxx b/src/emucore/tia/TIAConstants.hxx index 1c134f4ed..00c488c78 100644 --- a/src/emucore/tia/TIAConstants.hxx +++ b/src/emucore/tia/TIAConstants.hxx @@ -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; diff --git a/src/gui/GameInfoDialog.cxx b/src/gui/GameInfoDialog.cxx index 77ea9059a..281f66102 100644 --- a/src/gui/GameInfoDialog.cxx +++ b/src/gui/GameInfoDialog.cxx @@ -120,20 +120,30 @@ 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, "%"); + "Blend ", 0, kPPBlendChanged, 4 * fontWidth, "%"); myPPBlend->setMinValue(0); myPPBlend->setMaxValue(100); 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(); diff --git a/src/gui/GameInfoDialog.hxx b/src/gui/GameInfoDialog.hxx index d3e09795f..75ac75511 100644 --- a/src/gui/GameInfoDialog.hxx +++ b/src/gui/GameInfoDialog.hxx @@ -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,8 +103,9 @@ class GameInfoDialog : public Dialog, public CommandSender EditTextWidget* myNote; enum { + kYStartChanged = 'YSch', kPhosphorChanged = 'PPch', - kPPBlendChanged = 'PBch', + kPPBlendChanged = 'PBch', kLeftCChanged = 'LCch', kRightCChanged = 'RCch', kMCtrlChanged = 'MCch',