Start of purging 'Display_Height' from the codebase.

- We've already removed it from the UI, now it's removed from consideration altogether
- For now, NTSC ROMS use 240, PAL 250; this will change when we get aspect ratio working
This commit is contained in:
Stephen Anthony 2019-03-09 16:27:33 -03:30
parent 91c98ceed2
commit a5ca6b8ca5
13 changed files with 3454 additions and 3515 deletions

View File

@ -25,6 +25,8 @@
- delayed player 1 swap
- stuffed player move
* Completely removed 'Display_Height' stuff. (TODO: doc)
* Disabled some developer options for 'Player settings'. (TODO: doc)
* Enhanced command dialog. (TODO: doc)

View File

@ -1362,18 +1362,6 @@
<td>Cmd + PageDown</td>
</tr>
<tr>
<td>Set "Display.Height" to next <i>larger</i> value</td>
<td>Control + PageUp</td>
<td>Control + PageUp</td>
</tr>
<tr>
<td>Set "Display.Height" to next <i>smaller</i> value</td>
<td>Control + PageDown</td>
<td>Control + PageDown</td>
</tr>
<tr>
<td>Toggle frame stats (scanline count/FPS/BS type etc.)</td>
<td>Alt + L</td>

View File

@ -516,14 +516,6 @@ void PhysicalKeyboardHandler::handleEvent(StellaKey key, StellaMod mod, bool sta
myOSystem.reloadConsole();
break;
case KBDK_PAGEUP: // Ctrl-PageUp increases Height
myOSystem.console().changeHeight(+1);
break;
case KBDK_PAGEDOWN: // Ctrl-PageDown decreases Height
myOSystem.console().changeHeight(-1);
break;
case KBDK_RIGHTBRACKET: // Ctrl-] toggles sound
myOSystem.sound().toggleMute();
break;

View File

@ -743,38 +743,6 @@ void Console::updateYStart(uInt32 ystart)
if (ystart != myTIA->ystart()) myTIA->setYStart(ystart);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Console::changeHeight(int direction)
{
uInt32 height = myTIA->height();
uInt32 dheight = myOSystem.frameBuffer().desktopSize().h;
if(direction == +1) // increase Height
{
++height;
if(height > TIAConstants::maxViewableHeight || height > dheight)
{
myOSystem.frameBuffer().showMessage("Height at maximum");
return;
}
}
else if(direction == -1) // decrease Height
{
--height;
if(height < TIAConstants::minViewableHeight) height = 0;
}
else
return;
myTIA->setHeight(height);
initializeVideo(); // takes care of refreshing the screen
ostringstream val;
val << height;
myOSystem.frameBuffer().showMessage("Height " + val.str());
myProperties.set(Display_Height, val.str());
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Console::setTIAProperties()
{
@ -786,9 +754,10 @@ void Console::setTIAProperties()
myYStartAutodetected = true;
}
uInt32 height = atoi(myProperties.get(Display_Height).c_str());
if(height != 0)
height = BSPF::clamp(height, TIAConstants::minViewableHeight, TIAConstants::maxViewableHeight);
// FIXME - Remove concept of 'height' entirely
// The height will eventually be constant, and the aspect scaling will take care
// of differences in NTSC vs. PAL
uInt32 height = TIAConstants::viewableHeight;
if(myDisplayFormat == "NTSC" || myDisplayFormat == "PAL60" ||
myDisplayFormat == "SECAM60")
@ -800,7 +769,7 @@ void Console::setTIAProperties()
{
// Assume we've got ~312 scanlines (PAL-like format)
// PAL ROMs normally need at least 250 lines
if (height != 0) height = std::max(height, 250u);
height = std::max(height, 250u);
myTIA->setLayout(FrameLayout::pal);
}

View File

@ -256,13 +256,6 @@ class Console : public Serializable, public ConsoleIO
*/
void changeYStart(int direction);
/**
Change the "Display.Height" variable.
@param direction +1 indicates increase, -1 indicates decrease.
*/
void changeHeight(int direction);
/**
Returns the current framerate.
*/

File diff suppressed because it is too large Load Diff

View File

@ -84,7 +84,7 @@ class FrameBuffer
{
public:
enum {
kTIAMinW = 320u, kTIAMinH = TIAConstants::minViewableHeight,
kTIAMinW = 320u, kTIAMinH = TIAConstants::viewableHeight,
kFBMinW = 640u, kFBMinH = 480u
};

View File

@ -516,7 +516,6 @@ unique_ptr<Console> OSystem::openConsole(const FilesystemNode& romfile, string&
CMDLINE_PROPS_UPDATE("tv", Console_TelevisionType);
CMDLINE_PROPS_UPDATE("format", Display_Format);
CMDLINE_PROPS_UPDATE("ystart", Display_YStart);
CMDLINE_PROPS_UPDATE("height", Display_Height);
CMDLINE_PROPS_UPDATE("pp", Display_Phosphor);
CMDLINE_PROPS_UPDATE("ppblend", Display_PPBlend);

View File

@ -253,7 +253,6 @@ void Properties::print() const
<< get(Controller_MouseAxis) << "|"
<< get(Display_Format) << "|"
<< get(Display_YStart) << "|"
<< get(Display_Height) << "|"
<< get(Display_Phosphor) << "|"
<< get(Display_PPBlend)
<< endl;
@ -299,7 +298,6 @@ void Properties::printHeader()
<< "Controller_MouseAxis|"
<< "Display_Format|"
<< "Display_YStart|"
<< "Display_Height|"
<< "Display_Phosphor|"
<< "Display_PPBlend"
<< endl;
@ -326,7 +324,6 @@ string Properties::ourDefaultProperties[LastPropType] = {
"AUTO", // Controller.MouseAxis
"AUTO", // Display.Format
"0", // Display.YStart
"0", // Display.Height
"NO", // Display.Phosphor
"0" // Display.PPBlend
};
@ -352,7 +349,6 @@ const char* const Properties::ourPropertyNames[LastPropType] = {
"Controller.MouseAxis",
"Display.Format",
"Display.YStart",
"Display.Height",
"Display.Phosphor",
"Display.PPBlend"
};

View File

@ -40,7 +40,6 @@ enum PropertyType {
Controller_MouseAxis,
Display_Format,
Display_YStart,
Display_Height,
Display_Phosphor,
Display_PPBlend,
LastPropType

View File

@ -24,7 +24,7 @@ namespace TIAConstants {
constexpr uInt32 frameBufferHeight = 320;
constexpr uInt32 maxYStart = 64;
constexpr uInt32 minViewableHeight = 240, maxViewableHeight = 240; // FIXME - remove this (or at least use only one)
constexpr uInt32 viewableHeight = 240;
constexpr uInt32 initialGarbageFrames = 10;
static constexpr uInt16

View File

@ -35,8 +35,8 @@ RomInfoWidget::RomInfoWidget(GuiObject* boss, const GUI::Font& font,
: Widget(boss, font, x, y, w, h),
mySurfaceIsValid(false),
myHaveProperties(false),
myAvail(w > 400 ? GUI::Size(640, TIAConstants::maxViewableHeight*2) :
GUI::Size(320, TIAConstants::maxViewableHeight))
myAvail(w > 400 ? GUI::Size(640, TIAConstants::viewableHeight*2) :
GUI::Size(320, TIAConstants::viewableHeight))
{
_flags = WIDGET_ENABLED;
_bgcolor = kDlgColor;
@ -84,7 +84,7 @@ void RomInfoWidget::parseProperties(const FilesystemNode& node)
// only draw certain parts of it
if(mySurface == nullptr)
{
mySurface = instance().frameBuffer().allocateSurface(320*2, TIAConstants::maxViewableHeight*2);
mySurface = instance().frameBuffer().allocateSurface(320*2, TIAConstants::viewableHeight*2);
mySurface->attributes().smoothing = true;
mySurface->applyAttributes();

View File

@ -22,9 +22,8 @@ my %prop_type = (
"Controller.MouseAxis" => 16,
"Display.Format" => 17,
"Display.YStart" => 18,
"Display.Height" => 19,
"Display.Phosphor" => 20,
"Display.PPBlend" => 21
"Display.Phosphor" => 19,
"Display.PPBlend" => 20
);
my @prop_type_as_string = (
"Cartridge.MD5",
@ -46,7 +45,6 @@ my @prop_type_as_string = (
"Controller.MouseAxis",
"Display.Format",
"Display.YStart",
"Display.Height",
"Display.Phosphor",
"Display.PPBlend"
);
@ -71,7 +69,6 @@ my @prop_defaults = (
"AUTO",
"AUTO",
"0",
"0",
"NO",
"0"
);