Made TIA window always open at a multiple of the minimum bounds

- this means that 320x240 is now the default 'base' size, and zoom levels are based on that
- the TIA image is rendered into whatever sized window is active, meaning that NTSC and PAL modes now look similar

Removed some 'small screen' dead code in FrameBuffer.
This commit is contained in:
Stephen Anthony 2019-04-03 20:27:30 -02:30
parent 285583f959
commit be775b53e3
3 changed files with 13 additions and 26 deletions

View File

@ -616,7 +616,7 @@ FBInitStatus Console::initializeVideo(bool full)
const string& title = string("Stella ") + STELLA_VERSION + const string& title = string("Stella ") + STELLA_VERSION +
": \"" + myProperties.get(Cartridge_Name) + "\""; ": \"" + myProperties.get(Cartridge_Name) + "\"";
fbstatus = myOSystem.frameBuffer().createDisplay(title, fbstatus = myOSystem.frameBuffer().createDisplay(title,
myTIA->width() << 1, myTIA->height()); TIAConstants::viewableWidth, TIAConstants::viewableHeight);
if(fbstatus != FBInitStatus::Success) if(fbstatus != FBInitStatus::Success)
return fbstatus; return fbstatus;

View File

@ -88,8 +88,6 @@ bool FrameBuffer::initialize()
// We can probably add ifdefs to take care of corner cases, // We can probably add ifdefs to take care of corner cases,
// but that means we've failed to abstract it enough ... // but that means we've failed to abstract it enough ...
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
bool smallScreen = myDesktopSize.w < FBMinimum::Width ||
myDesktopSize.h < FBMinimum::Height;
// This font is used in a variety of situations when a really small // This font is used in a variety of situations when a really small
// font is needed; we let the specific widget/dialog decide when to // font is needed; we let the specific widget/dialog decide when to
@ -98,17 +96,13 @@ bool FrameBuffer::initialize()
// The general font used in all UI elements // The general font used in all UI elements
// This is determined by the size of the framebuffer // This is determined by the size of the framebuffer
myFont = make_unique<GUI::Font>(smallScreen ? GUI::stellaDesc : GUI::stellaMediumDesc); myFont = make_unique<GUI::Font>(GUI::stellaMediumDesc);
// The info font used in all UI elements // The info font used in all UI elements
// This is determined by the size of the framebuffer // This is determined by the size of the framebuffer
myInfoFont = make_unique<GUI::Font>(smallScreen ? GUI::stellaDesc : GUI::consoleDesc); myInfoFont = make_unique<GUI::Font>(GUI::consoleDesc);
// The font used by the ROM launcher // The font used by the ROM launcher
// Normally, this is configurable by the user, except in the case of
// very small screens
if(!smallScreen)
{
const string& lf = myOSystem.settings().getString("launcherfont"); const string& lf = myOSystem.settings().getString("launcherfont");
if(lf == "small") if(lf == "small")
myLauncherFont = make_unique<GUI::Font>(GUI::consoleDesc); myLauncherFont = make_unique<GUI::Font>(GUI::consoleDesc);
@ -116,9 +110,6 @@ bool FrameBuffer::initialize()
myLauncherFont = make_unique<GUI::Font>(GUI::stellaMediumDesc); myLauncherFont = make_unique<GUI::Font>(GUI::stellaMediumDesc);
else else
myLauncherFont = make_unique<GUI::Font>(GUI::stellaLargeDesc); myLauncherFont = make_unique<GUI::Font>(GUI::stellaLargeDesc);
}
else
myLauncherFont = make_unique<GUI::Font>(GUI::stellaDesc);
// Determine possible TIA windowed zoom levels // Determine possible TIA windowed zoom levels
uInt32 maxZoom = maxWindowSizeForScreen( uInt32 maxZoom = maxWindowSizeForScreen(
@ -126,8 +117,7 @@ bool FrameBuffer::initialize()
myDesktopSize.w, myDesktopSize.h); myDesktopSize.w, myDesktopSize.h);
// Figure our the smallest zoom level we can use // Figure our the smallest zoom level we can use
uInt32 firstZoom = smallScreen ? 1 : 2; for(uInt32 zoom = 2; zoom <= maxZoom; ++zoom)
for(uInt32 zoom = firstZoom; zoom <= maxZoom; ++zoom)
{ {
ostringstream desc; ostringstream desc;
desc << "Zoom " << zoom << "x"; desc << "Zoom " << zoom << "x";
@ -841,11 +831,8 @@ void FrameBuffer::setAvailableVidModes(uInt32 baseWidth, uInt32 baseHeight)
uInt32 aspect = myOSystem.settings().getInt(myOSystem.console().tia().frameLayout() == FrameLayout::ntsc ? uInt32 aspect = myOSystem.settings().getInt(myOSystem.console().tia().frameLayout() == FrameLayout::ntsc ?
"tia.aspectn" : "tia.aspectp"); "tia.aspectn" : "tia.aspectp");
// Figure our the smallest zoom level we can use // Determine all zoom levels
uInt32 firstZoom = 2; for(uInt32 zoom = 2; zoom <= maxZoom; ++zoom)
if(myDesktopSize.w < FBMinimum::Width || myDesktopSize.h < FBMinimum::Height)
firstZoom = 1;
for(uInt32 zoom = firstZoom; zoom <= maxZoom; ++zoom)
{ {
ostringstream desc; ostringstream desc;
desc << "Zoom " << zoom << "x"; desc << "Zoom " << zoom << "x";

View File

@ -100,7 +100,7 @@ void TIASurface::initialize(const Console& console, const VideoMode& mode)
mySLineSurface->setSrcSize(1, 2 * int(float(mode.image.height()) / mySLineSurface->setSrcSize(1, 2 * int(float(mode.image.height()) /
floor((float(mode.image.height()) / myTIA->height()) + 0.5))); floor((float(mode.image.height()) / myTIA->height()) + 0.5)));
#if 0 #if 1
cerr << "INITIALIZE:\n" cerr << "INITIALIZE:\n"
<< "TIA:\n" << "TIA:\n"
<< "src: " << myTiaSurface->srcRect() << endl << "src: " << myTiaSurface->srcRect() << endl