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 - delayed player 1 swap
- stuffed player move - stuffed player move
* Completely removed 'Display_Height' stuff. (TODO: doc)
* Disabled some developer options for 'Player settings'. (TODO: doc) * Disabled some developer options for 'Player settings'. (TODO: doc)
* Enhanced command dialog. (TODO: doc) * Enhanced command dialog. (TODO: doc)

View File

@ -1362,18 +1362,6 @@
<td>Cmd + PageDown</td> <td>Cmd + PageDown</td>
</tr> </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> <tr>
<td>Toggle frame stats (scanline count/FPS/BS type etc.)</td> <td>Toggle frame stats (scanline count/FPS/BS type etc.)</td>
<td>Alt + L</td> <td>Alt + L</td>

View File

@ -516,14 +516,6 @@ void PhysicalKeyboardHandler::handleEvent(StellaKey key, StellaMod mod, bool sta
myOSystem.reloadConsole(); myOSystem.reloadConsole();
break; 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 case KBDK_RIGHTBRACKET: // Ctrl-] toggles sound
myOSystem.sound().toggleMute(); myOSystem.sound().toggleMute();
break; break;

View File

@ -743,38 +743,6 @@ void Console::updateYStart(uInt32 ystart)
if (ystart != myTIA->ystart()) myTIA->setYStart(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() void Console::setTIAProperties()
{ {
@ -786,9 +754,10 @@ void Console::setTIAProperties()
myYStartAutodetected = true; myYStartAutodetected = true;
} }
uInt32 height = atoi(myProperties.get(Display_Height).c_str()); // FIXME - Remove concept of 'height' entirely
if(height != 0) // The height will eventually be constant, and the aspect scaling will take care
height = BSPF::clamp(height, TIAConstants::minViewableHeight, TIAConstants::maxViewableHeight); // of differences in NTSC vs. PAL
uInt32 height = TIAConstants::viewableHeight;
if(myDisplayFormat == "NTSC" || myDisplayFormat == "PAL60" || if(myDisplayFormat == "NTSC" || myDisplayFormat == "PAL60" ||
myDisplayFormat == "SECAM60") myDisplayFormat == "SECAM60")
@ -800,7 +769,7 @@ void Console::setTIAProperties()
{ {
// Assume we've got ~312 scanlines (PAL-like format) // Assume we've got ~312 scanlines (PAL-like format)
// PAL ROMs normally need at least 250 lines // 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); myTIA->setLayout(FrameLayout::pal);
} }

View File

@ -256,13 +256,6 @@ class Console : public Serializable, public ConsoleIO
*/ */
void changeYStart(int direction); 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. Returns the current framerate.
*/ */

File diff suppressed because it is too large Load Diff

View File

@ -84,7 +84,7 @@ class FrameBuffer
{ {
public: public:
enum { enum {
kTIAMinW = 320u, kTIAMinH = TIAConstants::minViewableHeight, kTIAMinW = 320u, kTIAMinH = TIAConstants::viewableHeight,
kFBMinW = 640u, kFBMinH = 480u 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("tv", Console_TelevisionType);
CMDLINE_PROPS_UPDATE("format", Display_Format); CMDLINE_PROPS_UPDATE("format", Display_Format);
CMDLINE_PROPS_UPDATE("ystart", Display_YStart); CMDLINE_PROPS_UPDATE("ystart", Display_YStart);
CMDLINE_PROPS_UPDATE("height", Display_Height);
CMDLINE_PROPS_UPDATE("pp", Display_Phosphor); CMDLINE_PROPS_UPDATE("pp", Display_Phosphor);
CMDLINE_PROPS_UPDATE("ppblend", Display_PPBlend); CMDLINE_PROPS_UPDATE("ppblend", Display_PPBlend);

View File

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

View File

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

View File

@ -24,7 +24,7 @@ namespace TIAConstants {
constexpr uInt32 frameBufferHeight = 320; constexpr uInt32 frameBufferHeight = 320;
constexpr uInt32 maxYStart = 64; 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; constexpr uInt32 initialGarbageFrames = 10;
static constexpr uInt16 static constexpr uInt16

View File

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

View File

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