mirror of https://github.com/stella-emu/stella.git
When in 'small' window mode and attempting to open PAL ROMs larger than the
screen size (vertically), the window will open in partially truncated mode, where the top of the PAL image is cut off. This normally won't be a problem, as it's mostly blank space anyway. App window centering is now honoured when changing video zoom levels, not just when changing eventhandler states. Bumped version # for another test release. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2135 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
cb6d2cf602
commit
f3483ca8b1
10
Changes.txt
10
Changes.txt
|
@ -12,6 +12,14 @@
|
||||||
Release History
|
Release History
|
||||||
===========================================================================
|
===========================================================================
|
||||||
|
|
||||||
|
3.2.1 to 3.2.2: (September 17, 2010)
|
||||||
|
|
||||||
|
* Fixed bug with window centering; if enabled and the the window was
|
||||||
|
larger than the desktop, the window would be moved offscreen.
|
||||||
|
|
||||||
|
-Have fun!
|
||||||
|
|
||||||
|
|
||||||
3.2 to 3.2.1: (August 25, 2010)
|
3.2 to 3.2.1: (August 25, 2010)
|
||||||
|
|
||||||
* Improved behaviour of joystick 'hat' movement. This should fix bugs
|
* Improved behaviour of joystick 'hat' movement. This should fix bugs
|
||||||
|
@ -24,8 +32,6 @@
|
||||||
* Added game properties info and snapshot for the newly released
|
* Added game properties info and snapshot for the newly released
|
||||||
'Halo 2600' ROM.
|
'Halo 2600' ROM.
|
||||||
|
|
||||||
-Have fun!
|
|
||||||
|
|
||||||
|
|
||||||
3.1.2 to 3.2: (August 20, 2010)
|
3.1.2 to 3.2: (August 20, 2010)
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
|
||||||
#define STELLA_VERSION "3.3_test4"
|
#define STELLA_VERSION "3.3_test5"
|
||||||
#define STELLA_BUILD atoi("$Rev$" + 6)
|
#define STELLA_BUILD atoi("$Rev$" + 6)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -152,6 +152,15 @@ Console::Console(OSystem* osystem, Cartridge* cart, const Properties& props)
|
||||||
// For example, if a PAL ROM is forced to be NTSC, it will use NTSC-like
|
// For example, if a PAL ROM is forced to be NTSC, it will use NTSC-like
|
||||||
// properties (60Hz, 262 scanlines, etc) and cycle between NTSC-like modes
|
// properties (60Hz, 262 scanlines, etc) and cycle between NTSC-like modes
|
||||||
// The TIA will self-adjust the framerate if necessary
|
// The TIA will self-adjust the framerate if necessary
|
||||||
|
|
||||||
|
// TODO - query these values directly from the TIA if value is 'AUTO'
|
||||||
|
uInt32 ystart = atoi(myProperties.get(Display_YStart).c_str());
|
||||||
|
if(ystart < 0) ystart = 0;
|
||||||
|
else if(ystart > 64) ystart = 64;
|
||||||
|
uInt32 height = atoi(myProperties.get(Display_Height).c_str());
|
||||||
|
if(height < 210) height = 210;
|
||||||
|
else if(height > 256) height = 256;
|
||||||
|
|
||||||
if(myDisplayFormat == "NTSC" || myDisplayFormat == "PAL60" ||
|
if(myDisplayFormat == "NTSC" || myDisplayFormat == "PAL60" ||
|
||||||
myDisplayFormat == "SECAM60")
|
myDisplayFormat == "SECAM60")
|
||||||
{
|
{
|
||||||
|
@ -165,8 +174,24 @@ Console::Console(OSystem* osystem, Cartridge* cart, const Properties& props)
|
||||||
myFramerate = 50.0;
|
myFramerate = 50.0;
|
||||||
myConsoleInfo.InitialFrameRate = "50";
|
myConsoleInfo.InitialFrameRate = "50";
|
||||||
|
|
||||||
if(myProperties.get(Display_Height) == "210")
|
// PAL ROMs normally need at least 250 lines
|
||||||
myProperties.set(Display_Height, "250");
|
height = BSPF_max(height, 250u);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Make sure these values fit within the bounds of the desktop
|
||||||
|
// If not, attempt to center vertically
|
||||||
|
if(height <= myOSystem->desktopHeight())
|
||||||
|
{
|
||||||
|
myTIA->setYStart(ystart);
|
||||||
|
myTIA->setHeight(height);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ystart += height - myOSystem->desktopHeight();
|
||||||
|
ystart = BSPF_min(ystart, 64u);
|
||||||
|
height = myOSystem->desktopHeight();
|
||||||
|
myTIA->setYStart(ystart);
|
||||||
|
myTIA->setHeight(height);
|
||||||
}
|
}
|
||||||
|
|
||||||
const string& md5 = myProperties.get(Cartridge_MD5);
|
const string& md5 = myProperties.get(Cartridge_MD5);
|
||||||
|
@ -421,7 +446,7 @@ FBInitStatus Console::initializeVideo(bool full)
|
||||||
|
|
||||||
if(full)
|
if(full)
|
||||||
{
|
{
|
||||||
string title = string("Stella ") + STELLA_VERSION +
|
const string& title = string("Stella ") + STELLA_VERSION +
|
||||||
": \"" + myProperties.get(Cartridge_Name) + "\"";
|
": \"" + myProperties.get(Cartridge_Name) + "\"";
|
||||||
fbstatus = myOSystem->frameBuffer().initialize(title,
|
fbstatus = myOSystem->frameBuffer().initialize(title,
|
||||||
myTIA->width() << 1, myTIA->height());
|
myTIA->width() << 1, myTIA->height());
|
||||||
|
@ -500,11 +525,9 @@ void Console::fry() const
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void Console::changeYStart(int direction)
|
void Console::changeYStart(int direction)
|
||||||
{
|
{
|
||||||
Int32 ystart = atoi(myProperties.get(Display_YStart).c_str());
|
uInt32 ystart = myTIA->ystart();
|
||||||
ostringstream strval;
|
|
||||||
string message;
|
|
||||||
|
|
||||||
if(direction == +1) // increase YStart
|
if(direction == +1) // increase YStart
|
||||||
{
|
{
|
||||||
ystart++;
|
ystart++;
|
||||||
if(ystart > 64)
|
if(ystart > 64)
|
||||||
|
@ -525,27 +548,25 @@ void Console::changeYStart(int direction)
|
||||||
else
|
else
|
||||||
return;
|
return;
|
||||||
|
|
||||||
strval << ystart;
|
myTIA->setYStart(ystart);
|
||||||
myProperties.set(Display_YStart, strval.str());
|
|
||||||
myTIA->frameReset();
|
myTIA->frameReset();
|
||||||
myOSystem->frameBuffer().refresh();
|
myOSystem->frameBuffer().refresh();
|
||||||
|
|
||||||
message = "YStart ";
|
ostringstream val;
|
||||||
message += strval.str();
|
val << ystart;
|
||||||
myOSystem->frameBuffer().showMessage(message);
|
myOSystem->frameBuffer().showMessage("YStart " + val.str());
|
||||||
|
myProperties.set(Display_YStart, val.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void Console::changeHeight(int direction)
|
void Console::changeHeight(int direction)
|
||||||
{
|
{
|
||||||
Int32 height = atoi(myProperties.get(Display_Height).c_str());
|
uInt32 height = myTIA->height();
|
||||||
ostringstream strval;
|
|
||||||
string message;
|
|
||||||
|
|
||||||
if(direction == +1) // increase Height
|
if(direction == +1) // increase Height
|
||||||
{
|
{
|
||||||
height++;
|
height++;
|
||||||
if(height > 256)
|
if(height > 256 || height > myOSystem->desktopHeight())
|
||||||
{
|
{
|
||||||
myOSystem->frameBuffer().showMessage("Height at maximum");
|
myOSystem->frameBuffer().showMessage("Height at maximum");
|
||||||
return;
|
return;
|
||||||
|
@ -554,7 +575,7 @@ void Console::changeHeight(int direction)
|
||||||
else if(direction == -1) // decrease Height
|
else if(direction == -1) // decrease Height
|
||||||
{
|
{
|
||||||
height--;
|
height--;
|
||||||
if(height < 200)
|
if(height < 210)
|
||||||
{
|
{
|
||||||
myOSystem->frameBuffer().showMessage("Height at minimum");
|
myOSystem->frameBuffer().showMessage("Height at minimum");
|
||||||
return;
|
return;
|
||||||
|
@ -563,14 +584,14 @@ void Console::changeHeight(int direction)
|
||||||
else
|
else
|
||||||
return;
|
return;
|
||||||
|
|
||||||
strval << height;
|
myTIA->setHeight(height);
|
||||||
myProperties.set(Display_Height, strval.str());
|
|
||||||
myTIA->frameReset();
|
myTIA->frameReset();
|
||||||
initializeVideo(); // takes care of refreshing the screen
|
initializeVideo(); // takes care of refreshing the screen
|
||||||
|
|
||||||
message = "Height ";
|
ostringstream val;
|
||||||
message += strval.str();
|
val << height;
|
||||||
myOSystem->frameBuffer().showMessage(message);
|
myOSystem->frameBuffer().showMessage("Height " + val.str());
|
||||||
|
myProperties.set(Display_Height, val.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
|
@ -129,15 +129,7 @@ FBInitStatus FrameBuffer::initialize(const string& title, uInt32 width, uInt32 h
|
||||||
|
|
||||||
if(initSubsystem(mode))
|
if(initSubsystem(mode))
|
||||||
{
|
{
|
||||||
// Attempt to center the application window in non-fullscreen mode
|
centerAppWindow(mode);
|
||||||
if(!fullScreen() && myOSystem->settings().getBool("center"))
|
|
||||||
{
|
|
||||||
int x = mode.screen_w >= myOSystem->desktopWidth() ? 0 :
|
|
||||||
((myOSystem->desktopWidth() - mode.screen_w) >> 1);
|
|
||||||
int y = mode.screen_h >= myOSystem->desktopHeight() ? 0 :
|
|
||||||
((myOSystem->desktopHeight() - mode.screen_h) >> 1);
|
|
||||||
myOSystem->setAppWindowPos(x, y, mode.screen_w, mode.screen_h);
|
|
||||||
}
|
|
||||||
|
|
||||||
myImageRect.setWidth(mode.image_w);
|
myImageRect.setWidth(mode.image_w);
|
||||||
myImageRect.setHeight(mode.image_h);
|
myImageRect.setHeight(mode.image_h);
|
||||||
|
@ -696,6 +688,8 @@ bool FrameBuffer::changeVidMode(int direction)
|
||||||
VideoMode vidmode = myCurrentModeList->current(myOSystem->settings(), fullScreen());
|
VideoMode vidmode = myCurrentModeList->current(myOSystem->settings(), fullScreen());
|
||||||
if(setVidMode(vidmode))
|
if(setVidMode(vidmode))
|
||||||
{
|
{
|
||||||
|
centerAppWindow(vidmode);
|
||||||
|
|
||||||
myImageRect.setWidth(vidmode.image_w);
|
myImageRect.setWidth(vidmode.image_w);
|
||||||
myImageRect.setHeight(vidmode.image_h);
|
myImageRect.setHeight(vidmode.image_h);
|
||||||
myImageRect.moveTo(vidmode.image_x, vidmode.image_y);
|
myImageRect.moveTo(vidmode.image_x, vidmode.image_y);
|
||||||
|
@ -1015,6 +1009,20 @@ FrameBuffer::VideoMode FrameBuffer::getSavedVidMode()
|
||||||
return myCurrentModeList->current(myOSystem->settings(), fullScreen());
|
return myCurrentModeList->current(myOSystem->settings(), fullScreen());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
void FrameBuffer::centerAppWindow(const VideoMode& mode)
|
||||||
|
{
|
||||||
|
// Attempt to center the application window in non-fullscreen mode
|
||||||
|
if(!fullScreen() && myOSystem->settings().getBool("center"))
|
||||||
|
{
|
||||||
|
int x = mode.screen_w >= myOSystem->desktopWidth() ? 0 :
|
||||||
|
((myOSystem->desktopWidth() - mode.screen_w) >> 1);
|
||||||
|
int y = mode.screen_h >= myOSystem->desktopHeight() ? 0 :
|
||||||
|
((myOSystem->desktopHeight() - mode.screen_h) >> 1);
|
||||||
|
myOSystem->setAppWindowPos(x, y, mode.screen_w, mode.screen_h);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
FrameBuffer::VideoModeList::VideoModeList()
|
FrameBuffer::VideoModeList::VideoModeList()
|
||||||
: myIdx(-1)
|
: myIdx(-1)
|
||||||
|
|
|
@ -516,6 +516,11 @@ class FrameBuffer
|
||||||
*/
|
*/
|
||||||
VideoMode getSavedVidMode();
|
VideoMode getSavedVidMode();
|
||||||
|
|
||||||
|
/**
|
||||||
|
Attempt to center the application window in windowed mode.
|
||||||
|
*/
|
||||||
|
void centerAppWindow(const VideoMode& mode);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/**
|
/**
|
||||||
This class implements an iterator around an array of VideoMode objects.
|
This class implements an iterator around an array of VideoMode objects.
|
||||||
|
|
|
@ -42,6 +42,9 @@ TIA::TIA(Console& console, Sound& sound, Settings& settings)
|
||||||
: myConsole(console),
|
: myConsole(console),
|
||||||
mySound(sound),
|
mySound(sound),
|
||||||
mySettings(settings),
|
mySettings(settings),
|
||||||
|
myFrameWidth(160),
|
||||||
|
myFrameYStart(34),
|
||||||
|
myFrameHeight(210),
|
||||||
myMaximumNumberOfScanlines(262),
|
myMaximumNumberOfScanlines(262),
|
||||||
myColorLossEnabled(false),
|
myColorLossEnabled(false),
|
||||||
myPartialFrameFlag(false),
|
myPartialFrameFlag(false),
|
||||||
|
@ -226,15 +229,6 @@ void TIA::frameReset()
|
||||||
// Reset pixel pointer and drawing flag
|
// Reset pixel pointer and drawing flag
|
||||||
myFramePointer = myCurrentFrameBuffer;
|
myFramePointer = myCurrentFrameBuffer;
|
||||||
|
|
||||||
// Make sure all these are within bounds
|
|
||||||
myFrameWidth = 160;
|
|
||||||
myFrameYStart = atoi(myConsole.properties().get(Display_YStart).c_str());
|
|
||||||
if(myFrameYStart < 0) myFrameYStart = 0;
|
|
||||||
else if(myFrameYStart > 64) myFrameYStart = 64;
|
|
||||||
myFrameHeight = atoi(myConsole.properties().get(Display_Height).c_str());
|
|
||||||
if(myFrameHeight < 210) myFrameHeight = 210;
|
|
||||||
else if(myFrameHeight > 256) myFrameHeight = 256;
|
|
||||||
|
|
||||||
// Calculate color clock offsets for starting and stopping frame drawing
|
// Calculate color clock offsets for starting and stopping frame drawing
|
||||||
// Note that although we always start drawing at scanline zero, the
|
// Note that although we always start drawing at scanline zero, the
|
||||||
// framebuffer that is exposed outside the class actually starts at 'ystart'
|
// framebuffer that is exposed outside the class actually starts at 'ystart'
|
||||||
|
|
|
@ -69,7 +69,7 @@ class TIA : public Device
|
||||||
void reset();
|
void reset();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Reset frame to change XStart/YStart/Width/Height properties
|
Reset frame to current YStart/Height properties
|
||||||
*/
|
*/
|
||||||
void frameReset();
|
void frameReset();
|
||||||
|
|
||||||
|
@ -189,6 +189,15 @@ class TIA : public Device
|
||||||
*/
|
*/
|
||||||
inline uInt32 width() const { return myFrameWidth; }
|
inline uInt32 width() const { return myFrameWidth; }
|
||||||
inline uInt32 height() const { return myFrameHeight; }
|
inline uInt32 height() const { return myFrameHeight; }
|
||||||
|
inline uInt32 ystart() const { return myFrameYStart; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
Changes the current Height/YStart properties.
|
||||||
|
Note that calls to these method(s) must be eventually followed by
|
||||||
|
::frameReset() for the changes to take effect.
|
||||||
|
*/
|
||||||
|
void setHeight(uInt32 height) { myFrameHeight = height; }
|
||||||
|
void setYStart(uInt32 ystart) { myFrameYStart = ystart; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Enables/disables auto-frame calculation. If enabled, the TIA
|
Enables/disables auto-frame calculation. If enabled, the TIA
|
||||||
|
|
|
@ -48,7 +48,7 @@ InputDialog::InputDialog(OSystem* osystem, DialogContainer* parent,
|
||||||
WidgetArray wid;
|
WidgetArray wid;
|
||||||
|
|
||||||
// Set real dimensions
|
// Set real dimensions
|
||||||
_w = BSPF_min(49 * fontWidth + 10, max_w);
|
_w = BSPF_min(50 * fontWidth + 10, max_w);
|
||||||
_h = BSPF_min(12 * (lineHeight + 4) + 10, max_h);
|
_h = BSPF_min(12 * (lineHeight + 4) + 10, max_h);
|
||||||
|
|
||||||
// The tab widget
|
// The tab widget
|
||||||
|
|
Loading…
Reference in New Issue