2009-01-10 18:42:49 +00:00
|
|
|
//============================================================================
|
2003-09-25 16:20:34 +00:00
|
|
|
//
|
|
|
|
// SSSS tt lll lll
|
|
|
|
// SS SS tt ll ll
|
|
|
|
// SS tttttt eeee ll ll aaaa
|
|
|
|
// SSSS tt ee ee ll ll aa
|
|
|
|
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
|
|
|
|
// SS SS tt ee ll ll aa aa
|
|
|
|
// SSSS ttt eeeee llll llll aaaaa
|
|
|
|
//
|
2014-01-12 17:23:42 +00:00
|
|
|
// Copyright (c) 1995-2014 by Bradford W. Mott, Stephen Anthony
|
2010-04-10 21:37:23 +00:00
|
|
|
// and the Stella Team
|
2003-09-25 16:20:34 +00:00
|
|
|
//
|
2010-01-10 03:23:32 +00:00
|
|
|
// See the file "License.txt" for information on usage and redistribution of
|
2003-09-25 16:20:34 +00:00
|
|
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
|
|
|
//
|
2009-05-13 13:55:40 +00:00
|
|
|
// $Id$
|
2003-09-25 16:20:34 +00:00
|
|
|
//============================================================================
|
|
|
|
|
Reworked 'fullres' argument to also accept the 'auto' option. In this case,
fullscreen resolutions will be automatically chosen based on the required
size for the window. The image will be centered and keep the same aspect
ratio, however, so operation will still work correctly on widescreen
monitors. 'Auto' will be the new default. Otherwise, if a specific
resolution is requested, Stella will try to accomodate it *only* if it fits
into the resolution; otherwise the smallest resolution that fits will be
used.
Removed 'zoom_ui' and 'zoom_tia'. The UI can now only be at 1x mode.
Aded 'tia_filter' commandline argument, which specifies to the filter
to use when rendering the tia image. For now, these accept 'zoom1x',
'zoom2x'..., up to 'zoom10x', and duplicate previous behaviour. Eventually,
Scalexx and HQxx filters may be added. Still TODO is add this to the UI.
First pass at making the standard build use a minimum of zoom2x for the TIA,
so the UI can be larger and use a better looking font. There's still work
to do in this area, especially for those ports with limited hardware that
support zoom1x only.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1544 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2008-07-22 14:54:39 +00:00
|
|
|
#include <algorithm>
|
2003-09-30 01:22:45 +00:00
|
|
|
#include <sstream>
|
|
|
|
|
2003-09-25 16:20:34 +00:00
|
|
|
#include "bspf.hxx"
|
2007-09-03 18:37:24 +00:00
|
|
|
|
|
|
|
#include "CommandMenu.hxx"
|
2003-09-25 16:20:34 +00:00
|
|
|
#include "Console.hxx"
|
The first version of a GUI for event remapping is here!
Now for the things that aren't finished yet:
- Only the most basic functions can be remapped. If you
erase the mapping for those that can't yet be remapped,
you'll have to delete the 'keymap' line from stellarc and
start over.
- Core events can only be remapped to other keys on the keyboard.
I haven't got the joystick remapping working yet (but it should
be easy to do).
- The TIA needs to be modified to show 320 pixels horizontally.
Right now, I'm using 8 pixel-width fonts on a framebuffer of
160 pixels, so there's not a lot of horizontal real estate.
So text will probably overwrite other stuff. This is cosmetic,
and WILL be fixed.
- Modification of the TIA will break every frontends rendering
code. It had to be done sometime ...
- I haven't yet added any user feedback mechanism for the user. So when
you go into remap mode and are about to remap a key, you won't
know it :) I'll be adding arrows (like in XMAME) ...
I've added a "Game Information" menu, which shows things like Game name,
manufacturer, rarity, type, etc. Basically stuff from the stella.pro file.
It has no purpose other than for coolness :)
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@193 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-09-28 21:59:24 +00:00
|
|
|
#include "EventHandler.hxx"
|
2007-09-03 18:37:24 +00:00
|
|
|
#include "Event.hxx"
|
2005-06-08 18:45:09 +00:00
|
|
|
#include "Font.hxx"
|
2014-02-05 22:09:57 +00:00
|
|
|
#include "StellaFont.hxx"
|
|
|
|
#include "StellaMediumFont.hxx"
|
|
|
|
#include "StellaLargeFont.hxx"
|
|
|
|
#include "ConsoleFont.hxx"
|
Added first pass of the ROM launcher. When you press 'Start' in the ROM
launcher, it launches Frostbite. Then pressing 'Escape' goes back to the
launcher, and you're able to then launch Frostbite again! Success !!!
Still TODO is actually get a ROM listing and use the selected game, but
the fact that it works multiple times for some game means that the
infrastructure is working correctly :)
Changed behaviour of the 'Escape' key. Specifically, it now only acts
as a key to enter ROM launcher mode. In the case where the emulation
was started without the launcher, the key will now do nothing. From now
on, the only way to quit Stella is Ctrl-Q (or equivalent for OSX),
close the window, or from the 'Quit' button.
Also, the 'Enter launcher mode' event will eventually be made remappable,
as will the 'Enter menu mode' event (currently the 'Tab' key).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@412 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-05-06 18:39:00 +00:00
|
|
|
#include "Launcher.hxx"
|
2007-09-03 18:37:24 +00:00
|
|
|
#include "Menu.hxx"
|
2005-02-21 02:23:57 +00:00
|
|
|
#include "OSystem.hxx"
|
2007-09-03 18:37:24 +00:00
|
|
|
#include "Settings.hxx"
|
2009-01-19 16:52:32 +00:00
|
|
|
#include "TIA.hxx"
|
2007-09-03 18:37:24 +00:00
|
|
|
|
2014-04-30 16:53:21 +00:00
|
|
|
#include "FBSurface.hxx"
|
2007-09-03 18:37:24 +00:00
|
|
|
#include "FrameBuffer.hxx"
|
2005-08-24 22:54:30 +00:00
|
|
|
|
2006-12-15 16:43:12 +00:00
|
|
|
#ifdef DEBUGGER_SUPPORT
|
2005-08-24 22:54:30 +00:00
|
|
|
#include "Debugger.hxx"
|
|
|
|
#endif
|
|
|
|
|
2003-09-25 16:20:34 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
2005-02-21 20:43:53 +00:00
|
|
|
FrameBuffer::FrameBuffer(OSystem* osystem)
|
Reworked the mapping of joysticks yet again. After some thought, it
made no sense to restrict Stella to only work with two joysticks, since
there's no reason one couldn't use four devices, with each one emulating
a paddle (once I get paddle remapping done). So I've removed that
restriction, and also removed the 'leftport' and 'rightport' arguments.
The one case where remapping a joystick *does* make sense is for
multiple Stelladaptors. In that case, there might only be one
Stelladaptor installed, but you'd like it to emulate the right virtual
port. Previously this wasn't possible, but now it is with the addition
of the 'sa1' and 'sa2' commandline arguments. These arguments accept
either 'left' or 'right', specifying which virtual port to emulate.
Updated the InputDialog virtual device tab for remapping Stelladaptors.
Shortened some keynames in EventHandler, so that the actual character is
used (for example, ? instead of QUESTION).
Some fixes for the OS/2 port.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@884 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-11-19 22:26:14 +00:00
|
|
|
: myOSystem(osystem),
|
2008-08-04 11:56:12 +00:00
|
|
|
myRedrawEntireFrame(true),
|
2006-01-10 20:37:00 +00:00
|
|
|
myUsePhosphor(false),
|
|
|
|
myPhosphorBlend(77),
|
2007-01-30 17:13:10 +00:00
|
|
|
myInitializedCount(0),
|
2010-04-14 15:41:42 +00:00
|
|
|
myPausedCount(0)
|
2003-09-25 16:20:34 +00:00
|
|
|
{
|
First pass at adding a cart-specific bankswitch/info tab to the
debugger. In the process, I had to spend several days extending
the UI/dialog class to actually contain multiple tabs. This was
harder than expected, and it still isn't quite finished. In many
ways, we're beginning to reach the limits of the current code; it
was never designed for a full-fledged, graphically rich UI.
For now the tab is empty, but eventually it will contain general
info about the ROM bankswitch type (size, virtual layout, etc),
but also cart-specific info, including the ability to change
banks, which can be vary greatly among the different schemes.
Eventually, it may even allow to see/modify very cart-specific
info (like display RAM in DPC, etc).
Better handle errors in opening the serial port (AtariVox support)
for Windows and OSX.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2678 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-03-31 00:10:05 +00:00
|
|
|
myMsg.surface = myStatsMsg.surface = NULL;
|
|
|
|
myMsg.enabled = myStatsMsg.enabled = false;
|
2012-05-12 22:21:59 +00:00
|
|
|
|
|
|
|
// Load NTSC filter settings
|
|
|
|
myNTSCFilter.loadConfig(myOSystem->settings());
|
2003-10-17 18:02:16 +00:00
|
|
|
}
|
2003-10-01 19:01:02 +00:00
|
|
|
|
2003-10-17 18:02:16 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
FrameBuffer::~FrameBuffer(void)
|
|
|
|
{
|
2014-02-05 22:09:57 +00:00
|
|
|
delete myFont;
|
|
|
|
delete myInfoFont;
|
|
|
|
delete mySmallFont;
|
|
|
|
delete myLauncherFont;
|
|
|
|
|
2008-12-12 18:32:53 +00:00
|
|
|
// Free all allocated surfaces
|
|
|
|
while(!mySurfaceList.empty())
|
|
|
|
{
|
|
|
|
delete (*mySurfaceList.begin()).second;
|
|
|
|
mySurfaceList.erase(mySurfaceList.begin());
|
|
|
|
}
|
2003-10-17 18:02:16 +00:00
|
|
|
}
|
2003-09-26 22:39:36 +00:00
|
|
|
|
2003-10-17 18:02:16 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
2014-02-05 22:09:57 +00:00
|
|
|
bool FrameBuffer::initialize()
|
|
|
|
{
|
2014-03-07 22:12:39 +00:00
|
|
|
// Get desktop resolution and supported renderers
|
2014-04-29 14:52:35 +00:00
|
|
|
uInt32 query_w, query_h;
|
|
|
|
queryHardware(query_w, query_h, myRenderers);
|
2014-02-05 22:09:57 +00:00
|
|
|
|
2014-02-22 17:31:16 +00:00
|
|
|
// Check the 'maxres' setting, which is an undocumented developer feature
|
|
|
|
// that specifies the desktop size (not normally set)
|
|
|
|
const GUI::Size& s = myOSystem->settings().getSize("maxres");
|
|
|
|
if(s.w > 0 && s.h > 0)
|
|
|
|
{
|
2014-04-29 14:52:35 +00:00
|
|
|
query_w = s.w;
|
|
|
|
query_h = s.h;
|
2014-02-22 17:31:16 +00:00
|
|
|
}
|
2014-04-28 16:47:10 +00:00
|
|
|
// Various parts of the codebase assume a minimum screen size
|
2014-04-29 14:52:35 +00:00
|
|
|
myDesktopSize.w = BSPF_max(query_w, (uInt32)kFBMinW);
|
|
|
|
myDesktopSize.h = BSPF_max(query_h, (uInt32)kFBMinH);
|
2014-02-05 22:09:57 +00:00
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
|
// Create fonts to draw text
|
|
|
|
// NOTE: the logic determining appropriate font sizes is done here,
|
|
|
|
// so that the UI classes can just use the font they expect,
|
|
|
|
// and not worry about it
|
|
|
|
// This logic should also take into account the size of the
|
|
|
|
// framebuffer, and try to be intelligent about font sizes
|
|
|
|
// We can probably add ifdefs to take care of corner cases,
|
|
|
|
// but that means we've failed to abstract it enough ...
|
|
|
|
////////////////////////////////////////////////////////////////////
|
2014-04-29 14:52:35 +00:00
|
|
|
bool smallScreen = myDesktopSize.w < (uInt32)kFBMinW ||
|
|
|
|
myDesktopSize.h < (uInt32)kFBMinH;
|
2014-02-05 22:09:57 +00:00
|
|
|
|
|
|
|
// 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
|
|
|
|
// use it
|
|
|
|
mySmallFont = new GUI::Font(GUI::stellaDesc);
|
|
|
|
|
|
|
|
// The general font used in all UI elements
|
|
|
|
// This is determined by the size of the framebuffer
|
|
|
|
myFont = new GUI::Font(smallScreen ? GUI::stellaDesc : GUI::stellaMediumDesc);
|
|
|
|
|
|
|
|
// The info font used in all UI elements
|
|
|
|
// This is determined by the size of the framebuffer
|
|
|
|
myInfoFont = new GUI::Font(smallScreen ? GUI::stellaDesc : GUI::consoleDesc);
|
|
|
|
|
|
|
|
// 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");
|
|
|
|
if(lf == "small")
|
|
|
|
myLauncherFont = new GUI::Font(GUI::consoleDesc);
|
|
|
|
else if(lf == "medium")
|
|
|
|
myLauncherFont = new GUI::Font(GUI::stellaMediumDesc);
|
|
|
|
else
|
|
|
|
myLauncherFont = new GUI::Font(GUI::stellaLargeDesc);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
myLauncherFont = new GUI::Font(GUI::stellaDesc);
|
|
|
|
|
2014-04-28 16:47:10 +00:00
|
|
|
// Determine possible TIA windowed zoom levels
|
|
|
|
uInt32 maxZoom = maxWindowSizeForScreen((uInt32)kTIAMinW, (uInt32)kTIAMinH,
|
2014-04-29 14:52:35 +00:00
|
|
|
myDesktopSize.w, myDesktopSize.h);
|
2014-04-28 16:47:10 +00:00
|
|
|
|
|
|
|
// Figure our the smallest zoom level we can use
|
|
|
|
uInt32 firstZoom = smallScreen ? 1 : 2;
|
|
|
|
for(uInt32 zoom = firstZoom; zoom <= maxZoom; ++zoom)
|
|
|
|
{
|
|
|
|
ostringstream desc;
|
|
|
|
desc << "Zoom " << zoom << "x";
|
|
|
|
myTIAZoomLevels.push_back(desc.str(), zoom);
|
|
|
|
}
|
|
|
|
|
2014-02-05 22:09:57 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
FBInitStatus FrameBuffer::createDisplay(const string& title,
|
|
|
|
uInt32 width, uInt32 height)
|
2003-10-17 18:02:16 +00:00
|
|
|
{
|
Added 'WINDOWED_SUPPORT' compile-time argument, which can be used for
those systems which don't actually have a windowing environment. When
this is set, toggling from fullscreen will not be possible, and certain
window-related UI functions will not be accessible.
Completely revamped video subsystem. Windowed and fullscreen modes are
now dealt with separately. Windows can be zoomed using the 'zoom_ui'
and 'zoom_tia' arguments. Fullscreen modes are now set by resolution,
not zoom, so you can specify to always use a certain fullscreen
resolution, and the images will be scaled appropriately. This also
fixes the fullscreen issues on widescreen monitors; just select a
widescreen video mode, and the aspect ratio will always be correct.
Removed dirty-rect support for software rendering of the TIA image,
as it ended up being slower than just updating the entire image.
For those resolutions where it will start to slow down (1024x768 or
higher), one should be using OpenGL.
Fixed issue in Windows when returning from fullscreen mode made the
window constantly 'shrink' in size. It was related to auto-detecting
the desktop resolution, which is really the job of SDL. As such, all
further releases of Stella will require SDL 1.2.10, which includes
this auto-detection code internally.
Made ROM launcher resizable, configurable in sizes from 320x240
to 800x600. Updated the UIDialog to change these quantities from the
UI (Stella will need to be restarted for it to take effect).
Removed aspect ratio support, since it was causing problems, and the
new fullscreen mode work has made it obsolete. i *may* consider it
again in the future, if there's sufficient demand.
Added 'fullres' commandline argument, used to set the fullscreen
resolution.
Added 'launcherres' commandline argument, used to set the ROM
launcher resolution. This replaces 'launchersize' argument, which
has been removed.
Changed 'scale_ui' and 'scale_tia' to 'zoom_ui' and 'zoom_tia',
respectively. Their function remains the same.
Changed meaning of 'gl_fsmax' argument to specify what modes to use
fullscreen OpenGL scaling (previously, this was a boolean, and
didn't consider different modes).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1323 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2007-06-20 16:33:23 +00:00
|
|
|
myInitializedCount++;
|
2014-04-29 14:52:35 +00:00
|
|
|
myScreenTitle = title;
|
2006-12-03 01:24:34 +00:00
|
|
|
|
2010-07-22 15:41:46 +00:00
|
|
|
// A 'windowed' system is defined as one where the window size can be
|
|
|
|
// larger than the screen size, as there's some sort of window manager
|
|
|
|
// that takes care of it (all current desktop systems fall in this category)
|
|
|
|
// However, some systems have no concept of windowing, and have hard limits
|
|
|
|
// on how large a window can be (ie, the size of the 'desktop' is the
|
|
|
|
// absolute upper limit on window size)
|
|
|
|
//
|
|
|
|
// If the WINDOWED_SUPPORT macro is defined, we treat the system as the
|
|
|
|
// former type; if not, as the latter type
|
2006-12-03 01:24:34 +00:00
|
|
|
|
2013-09-28 00:51:10 +00:00
|
|
|
bool useFullscreen = false;
|
2009-06-05 14:05:23 +00:00
|
|
|
#ifdef WINDOWED_SUPPORT
|
2014-04-28 16:47:10 +00:00
|
|
|
// We assume that a desktop of at least minimum acceptable size means that
|
|
|
|
// we're running on a 'large' system, and the window size requirements
|
|
|
|
// can be relaxed
|
2010-07-22 15:41:46 +00:00
|
|
|
// Otherwise, we treat the system as if WINDOWED_SUPPORT is not defined
|
2014-04-29 14:52:35 +00:00
|
|
|
if(myDesktopSize.w < (uInt32)kFBMinW &&
|
|
|
|
myDesktopSize.h < (uInt32)kFBMinH &&
|
|
|
|
(myDesktopSize.w < width || myDesktopSize.h < height))
|
2010-07-22 15:41:46 +00:00
|
|
|
return kFailTooLarge;
|
2010-11-07 16:19:26 +00:00
|
|
|
|
2014-04-29 14:52:35 +00:00
|
|
|
// FIXSDL - remove size limitations here?
|
2010-11-07 16:19:26 +00:00
|
|
|
if(myOSystem->settings().getString("fullscreen") == "1")
|
|
|
|
{
|
2014-04-29 14:52:35 +00:00
|
|
|
if(myDesktopSize.w < width || myDesktopSize.h < height)
|
2010-11-07 16:19:26 +00:00
|
|
|
return kFailTooLarge;
|
|
|
|
|
2013-09-28 00:51:10 +00:00
|
|
|
useFullscreen = true;
|
2010-11-07 16:19:26 +00:00
|
|
|
}
|
|
|
|
else
|
2013-09-28 00:51:10 +00:00
|
|
|
useFullscreen = false;
|
2010-07-22 15:41:46 +00:00
|
|
|
#else
|
|
|
|
// Make sure this mode is even possible
|
|
|
|
// We only really need to worry about it in non-windowed environments,
|
|
|
|
// where requesting a window that's too large will probably cause a crash
|
2014-04-29 14:52:35 +00:00
|
|
|
if(myDesktopSize.w < width || myDesktopSize.h < height)
|
2010-07-22 15:41:46 +00:00
|
|
|
return kFailTooLarge;
|
2009-06-05 14:05:23 +00:00
|
|
|
#endif
|
|
|
|
|
2008-06-19 12:01:31 +00:00
|
|
|
// Set the available video modes for this framebuffer
|
|
|
|
setAvailableVidModes(width, height);
|
2008-04-02 21:22:16 +00:00
|
|
|
|
2008-06-19 12:01:31 +00:00
|
|
|
// Initialize video subsystem (make sure we get a valid mode)
|
2014-03-08 22:15:02 +00:00
|
|
|
string pre_about = about();
|
2014-04-28 16:47:10 +00:00
|
|
|
const VideoMode& mode = getSavedVidMode(useFullscreen);
|
|
|
|
myImageRect = mode.image;
|
|
|
|
myScreenSize = mode.screen;
|
|
|
|
if(width <= myScreenSize.w && height <= myScreenSize.h)
|
2008-05-30 19:07:55 +00:00
|
|
|
{
|
2014-04-29 14:52:35 +00:00
|
|
|
if(setVideoMode(myScreenTitle, mode, useFullscreen))
|
2008-06-19 12:01:31 +00:00
|
|
|
{
|
2009-06-05 14:05:23 +00:00
|
|
|
// Did we get the requested fullscreen state?
|
2014-04-28 16:47:10 +00:00
|
|
|
myOSystem->settings().setValue("fullscreen", fullScreen());
|
2009-08-07 11:45:14 +00:00
|
|
|
setCursorState();
|
2008-06-19 12:01:31 +00:00
|
|
|
}
|
2010-08-11 21:53:19 +00:00
|
|
|
else
|
|
|
|
{
|
2012-12-22 20:17:33 +00:00
|
|
|
myOSystem->logMessage("ERROR: Couldn't initialize video subsystem", 0);
|
2010-08-11 21:53:19 +00:00
|
|
|
return kFailNotSupported;
|
|
|
|
}
|
2008-05-30 19:07:55 +00:00
|
|
|
}
|
2008-06-19 12:01:31 +00:00
|
|
|
else
|
2010-07-22 15:41:46 +00:00
|
|
|
return kFailTooLarge;
|
2005-05-12 18:45:21 +00:00
|
|
|
|
|
|
|
// Erase any messages from a previous run
|
2008-06-19 12:01:31 +00:00
|
|
|
myMsg.counter = 0;
|
|
|
|
|
|
|
|
// Create surfaces for TIA statistics and general messages
|
|
|
|
myStatsMsg.color = kBtnTextColor;
|
2014-02-05 22:09:57 +00:00
|
|
|
myStatsMsg.w = infoFont().getMaxCharWidth() * 24 + 2;
|
|
|
|
myStatsMsg.h = (infoFont().getFontHeight() + 2) * 2;
|
2008-12-25 23:05:16 +00:00
|
|
|
|
2008-12-27 23:27:32 +00:00
|
|
|
if(myStatsMsg.surface == NULL)
|
2008-12-12 15:51:07 +00:00
|
|
|
{
|
First pass at adding a cart-specific bankswitch/info tab to the
debugger. In the process, I had to spend several days extending
the UI/dialog class to actually contain multiple tabs. This was
harder than expected, and it still isn't quite finished. In many
ways, we're beginning to reach the limits of the current code; it
was never designed for a full-fledged, graphically rich UI.
For now the tab is empty, but eventually it will contain general
info about the ROM bankswitch type (size, virtual layout, etc),
but also cart-specific info, including the ability to change
banks, which can be vary greatly among the different schemes.
Eventually, it may even allow to see/modify very cart-specific
info (like display RAM in DPC, etc).
Better handle errors in opening the serial port (AtariVox support)
for Windows and OSX.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2678 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-03-31 00:10:05 +00:00
|
|
|
uInt32 surfaceID = allocateSurface(myStatsMsg.w, myStatsMsg.h);
|
|
|
|
myStatsMsg.surface = surface(surfaceID);
|
2008-12-12 15:51:07 +00:00
|
|
|
}
|
2008-12-25 23:05:16 +00:00
|
|
|
if(myMsg.surface == NULL)
|
2008-12-12 15:51:07 +00:00
|
|
|
{
|
2014-04-28 16:47:10 +00:00
|
|
|
uInt32 surfaceID = allocateSurface((uInt32)kFBMinW, font().getFontHeight()+10);
|
First pass at adding a cart-specific bankswitch/info tab to the
debugger. In the process, I had to spend several days extending
the UI/dialog class to actually contain multiple tabs. This was
harder than expected, and it still isn't quite finished. In many
ways, we're beginning to reach the limits of the current code; it
was never designed for a full-fledged, graphically rich UI.
For now the tab is empty, but eventually it will contain general
info about the ROM bankswitch type (size, virtual layout, etc),
but also cart-specific info, including the ability to change
banks, which can be vary greatly among the different schemes.
Eventually, it may even allow to see/modify very cart-specific
info (like display RAM in DPC, etc).
Better handle errors in opening the serial port (AtariVox support)
for Windows and OSX.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2678 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-03-31 00:10:05 +00:00
|
|
|
myMsg.surface = surface(surfaceID);
|
2008-12-12 15:51:07 +00:00
|
|
|
}
|
2006-12-11 00:15:34 +00:00
|
|
|
|
2014-01-31 16:23:10 +00:00
|
|
|
// Take care of some items that are only done once per framebuffer creation.
|
2010-04-29 12:46:07 +00:00
|
|
|
if(myInitializedCount == 1)
|
2014-01-31 16:23:10 +00:00
|
|
|
{
|
2014-03-08 22:15:02 +00:00
|
|
|
myOSystem->logMessage(about(), 1);
|
2014-01-31 16:23:10 +00:00
|
|
|
setUIPalette();
|
|
|
|
setWindowIcon();
|
|
|
|
}
|
2014-03-08 22:15:02 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
string post_about = about();
|
|
|
|
if(post_about != pre_about)
|
|
|
|
myOSystem->logMessage(post_about, 1);
|
|
|
|
}
|
2008-05-30 19:07:55 +00:00
|
|
|
|
2010-07-22 15:41:46 +00:00
|
|
|
return kSuccess;
|
2003-10-26 19:40:39 +00:00
|
|
|
}
|
The first version of a GUI for event remapping is here!
Now for the things that aren't finished yet:
- Only the most basic functions can be remapped. If you
erase the mapping for those that can't yet be remapped,
you'll have to delete the 'keymap' line from stellarc and
start over.
- Core events can only be remapped to other keys on the keyboard.
I haven't got the joystick remapping working yet (but it should
be easy to do).
- The TIA needs to be modified to show 320 pixels horizontally.
Right now, I'm using 8 pixel-width fonts on a framebuffer of
160 pixels, so there's not a lot of horizontal real estate.
So text will probably overwrite other stuff. This is cosmetic,
and WILL be fixed.
- Modification of the TIA will break every frontends rendering
code. It had to be done sometime ...
- I haven't yet added any user feedback mechanism for the user. So when
you go into remap mode and are about to remap a key, you won't
know it :) I'll be adding arrows (like in XMAME) ...
I've added a "Game Information" menu, which shows things like Game name,
manufacturer, rarity, type, etc. Basically stuff from the stella.pro file.
It has no purpose other than for coolness :)
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@193 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-09-28 21:59:24 +00:00
|
|
|
|
2003-10-26 19:40:39 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void FrameBuffer::update()
|
|
|
|
{
|
2005-02-27 23:41:19 +00:00
|
|
|
// Determine which mode we are in (from the EventHandler)
|
|
|
|
// Take care of S_EMULATE mode here, otherwise let the GUI
|
|
|
|
// figure out what to draw
|
|
|
|
switch(myOSystem->eventHandler().state())
|
Huge changes across the map. Lets see if I can remember it all ...
There is now an SDL OpenGL port with filtering and alpha-blending.
It's a work in progress right now, but is already quite stable.
It's not as optimized as the software version yet, but this will
change as well. For now, you have to compile the SDL version in
either normal software mode or OpenGL mode. This will change
before the 1.4 release.
When entering menu mode, the emulation is now suspended. And when
pause is pressed, you can't enter menu mode. Because of these changes,
CPU use has dropped dramatically when viewing menus. This will benefit
all ports, since menus are now redrawn only when necessary, instead of
at the current framerate.
For a reference, on a Pentium-IV 2.4GHz, the software SDL version
maxes CPU usage at 9%, and the SDL OpenGL version at 13.5%. This is
at 60 fps and a zoomlevel of 4. While some small improvements can
(possibly) be made to the OpenGL version, I think we'll soon be hitting
the glass ceiling.
Work on the Porting.txt document is progressing, and I estimate it to
be 45% complete.
The Windows version still doesn't compile, and I still haven't looked
at it. Rest assured that it will be done before 1.4. There will be
a simultaneous release, even if the Linux versions are finished.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@200 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-11-06 22:22:33 +00:00
|
|
|
{
|
2005-02-27 23:41:19 +00:00
|
|
|
case EventHandler::S_EMULATE:
|
|
|
|
{
|
OK, some huge changes across the board, so lets see if I get it all:
After much request, added ability to access the settings menu from the
ROM browser dialog. This menu now contains almost all items that can
be selected in Stella, and can be accessed in-game as before.
Completely removed pause functionality from the core code. It made
sense back when Stella was a single-mode program: there were two modes;
emulation and pause. Now that there are other event modes, the
EventHandler state machine is getting too complicated. If you want to
pause, you can simply enter one of the in-game menus. Related to this,
when the app is minimized, Stella enters the menu dialog state.
Previously, minimizing the app caused a pause, but since there was no
onscreen feedback, many people assumed the app locked up.
Added centering to all Dialog boxes, which is done dynamically, as they're
placed on the dialog stack to be drawn to the screen.
Cleaned up the API of Console/FrameBuffer/OSystem classes wrt to palettes
and timing. Parts of each were being done in different classes; now it
should be more consistent.
Started infrastructure for user-selectable UI palettes. For now, there's
no way to change it in the GUI, and it defaults to the normal palette.
Eventually, there will be several choices selectable from an in-game
menu.
Removed '-channels' commandline argument, since that feature can be
set from the ROM properties.
Added '128' to the choices for fragment size in AudioDialog.
Tweaked the OpenGL dynamic loading code to test both the given GL
lib, and if that fails to use auto-detection. It seems in the OSX port,
the first approach works for some people, and not the other (and vice-versa),
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1255 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-12-30 22:26:29 +00:00
|
|
|
// Run the console for one frame
|
2009-01-12 15:11:55 +00:00
|
|
|
// Note that the debugger can cause a breakpoint to occur, which changes
|
|
|
|
// the EventHandler state 'behind our back' - we need to check for that
|
2009-01-19 16:52:32 +00:00
|
|
|
myOSystem->console().tia().update();
|
2009-01-12 15:11:55 +00:00
|
|
|
#ifdef DEBUGGER_SUPPORT
|
|
|
|
if(myOSystem->eventHandler().state() != EventHandler::S_EMULATE) break;
|
|
|
|
#endif
|
OK, some huge changes across the board, so lets see if I get it all:
After much request, added ability to access the settings menu from the
ROM browser dialog. This menu now contains almost all items that can
be selected in Stella, and can be accessed in-game as before.
Completely removed pause functionality from the core code. It made
sense back when Stella was a single-mode program: there were two modes;
emulation and pause. Now that there are other event modes, the
EventHandler state machine is getting too complicated. If you want to
pause, you can simply enter one of the in-game menus. Related to this,
when the app is minimized, Stella enters the menu dialog state.
Previously, minimizing the app caused a pause, but since there was no
onscreen feedback, many people assumed the app locked up.
Added centering to all Dialog boxes, which is done dynamically, as they're
placed on the dialog stack to be drawn to the screen.
Cleaned up the API of Console/FrameBuffer/OSystem classes wrt to palettes
and timing. Parts of each were being done in different classes; now it
should be more consistent.
Started infrastructure for user-selectable UI palettes. For now, there's
no way to change it in the GUI, and it defaults to the normal palette.
Eventually, there will be several choices selectable from an in-game
menu.
Removed '-channels' commandline argument, since that feature can be
set from the ROM properties.
Added '128' to the choices for fragment size in AudioDialog.
Tweaked the OpenGL dynamic loading code to test both the given GL
lib, and if that fails to use auto-detection. It seems in the OSX port,
the first approach works for some people, and not the other (and vice-versa),
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1255 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-12-30 22:26:29 +00:00
|
|
|
if(myOSystem->eventHandler().frying())
|
|
|
|
myOSystem->console().fry();
|
2006-01-11 20:28:07 +00:00
|
|
|
|
OK, some huge changes across the board, so lets see if I get it all:
After much request, added ability to access the settings menu from the
ROM browser dialog. This menu now contains almost all items that can
be selected in Stella, and can be accessed in-game as before.
Completely removed pause functionality from the core code. It made
sense back when Stella was a single-mode program: there were two modes;
emulation and pause. Now that there are other event modes, the
EventHandler state machine is getting too complicated. If you want to
pause, you can simply enter one of the in-game menus. Related to this,
when the app is minimized, Stella enters the menu dialog state.
Previously, minimizing the app caused a pause, but since there was no
onscreen feedback, many people assumed the app locked up.
Added centering to all Dialog boxes, which is done dynamically, as they're
placed on the dialog stack to be drawn to the screen.
Cleaned up the API of Console/FrameBuffer/OSystem classes wrt to palettes
and timing. Parts of each were being done in different classes; now it
should be more consistent.
Started infrastructure for user-selectable UI palettes. For now, there's
no way to change it in the GUI, and it defaults to the normal palette.
Eventually, there will be several choices selectable from an in-game
menu.
Removed '-channels' commandline argument, since that feature can be
set from the ROM properties.
Added '128' to the choices for fragment size in AudioDialog.
Tweaked the OpenGL dynamic loading code to test both the given GL
lib, and if that fails to use auto-detection. It seems in the OSX port,
the first approach works for some people, and not the other (and vice-versa),
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1255 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-12-30 22:26:29 +00:00
|
|
|
// And update the screen
|
2009-01-19 16:52:32 +00:00
|
|
|
drawTIA(myRedrawEntireFrame);
|
2003-09-25 16:20:34 +00:00
|
|
|
|
2008-05-20 13:42:50 +00:00
|
|
|
// Show frame statistics
|
2008-06-19 12:01:31 +00:00
|
|
|
if(myStatsMsg.enabled)
|
2008-05-20 13:42:50 +00:00
|
|
|
{
|
2009-01-01 00:08:59 +00:00
|
|
|
const ConsoleInfo& info = myOSystem->console().about();
|
2008-05-20 13:42:50 +00:00
|
|
|
char msg[30];
|
2012-05-01 19:09:28 +00:00
|
|
|
BSPF_snprintf(msg, 30, "%3u @ %3.2ffps => %s",
|
2009-01-19 16:52:32 +00:00
|
|
|
myOSystem->console().tia().scanlines(),
|
2009-02-01 22:17:09 +00:00
|
|
|
myOSystem->console().getFramerate(), info.DisplayFormat.c_str());
|
2008-06-19 12:01:31 +00:00
|
|
|
myStatsMsg.surface->fillRect(0, 0, myStatsMsg.w, myStatsMsg.h, kBGColor);
|
2014-02-05 22:09:57 +00:00
|
|
|
myStatsMsg.surface->drawString(infoFont(),
|
2009-01-01 00:08:59 +00:00
|
|
|
msg, 1, 1, myStatsMsg.w, myStatsMsg.color, kTextAlignLeft);
|
2014-02-05 22:09:57 +00:00
|
|
|
myStatsMsg.surface->drawString(infoFont(),
|
2009-02-01 22:17:09 +00:00
|
|
|
info.BankSwitch, 1, 15, myStatsMsg.w, myStatsMsg.color, kTextAlignLeft);
|
2008-08-04 11:56:12 +00:00
|
|
|
myStatsMsg.surface->addDirtyRect(0, 0, 0, 0); // force a full draw
|
2009-02-01 22:17:09 +00:00
|
|
|
myStatsMsg.surface->setPos(myImageRect.x() + 1, myImageRect.y() + 1);
|
2014-05-02 15:58:57 +00:00
|
|
|
myStatsMsg.surface->render();
|
2008-05-20 13:42:50 +00:00
|
|
|
}
|
2005-02-27 23:41:19 +00:00
|
|
|
break; // S_EMULATE
|
Huge changes across the map. Lets see if I can remember it all ...
There is now an SDL OpenGL port with filtering and alpha-blending.
It's a work in progress right now, but is already quite stable.
It's not as optimized as the software version yet, but this will
change as well. For now, you have to compile the SDL version in
either normal software mode or OpenGL mode. This will change
before the 1.4 release.
When entering menu mode, the emulation is now suspended. And when
pause is pressed, you can't enter menu mode. Because of these changes,
CPU use has dropped dramatically when viewing menus. This will benefit
all ports, since menus are now redrawn only when necessary, instead of
at the current framerate.
For a reference, on a Pentium-IV 2.4GHz, the software SDL version
maxes CPU usage at 9%, and the SDL OpenGL version at 13.5%. This is
at 60 fps and a zoomlevel of 4. While some small improvements can
(possibly) be made to the OpenGL version, I think we'll soon be hitting
the glass ceiling.
Work on the Porting.txt document is progressing, and I estimate it to
be 45% complete.
The Windows version still doesn't compile, and I still haven't looked
at it. Rest assured that it will be done before 1.4. There will be
a simultaneous release, even if the Linux versions are finished.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@200 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-11-06 22:22:33 +00:00
|
|
|
}
|
2003-10-26 19:40:39 +00:00
|
|
|
|
2007-01-30 17:13:10 +00:00
|
|
|
case EventHandler::S_PAUSE:
|
|
|
|
{
|
|
|
|
// Only update the screen if it's been invalidated
|
2008-08-04 11:56:12 +00:00
|
|
|
if(myRedrawEntireFrame)
|
2009-01-19 16:52:32 +00:00
|
|
|
drawTIA(true);
|
2007-01-30 17:13:10 +00:00
|
|
|
|
|
|
|
// Show a pause message every 5 seconds
|
|
|
|
if(myPausedCount++ >= 7*myOSystem->frameRate())
|
|
|
|
{
|
|
|
|
myPausedCount = 0;
|
|
|
|
showMessage("Paused", kMiddleCenter);
|
|
|
|
}
|
|
|
|
break; // S_PAUSE
|
|
|
|
}
|
|
|
|
|
2005-03-13 03:38:41 +00:00
|
|
|
case EventHandler::S_MENU:
|
2005-02-27 23:41:19 +00:00
|
|
|
{
|
2009-01-10 18:42:49 +00:00
|
|
|
// When onscreen messages are enabled in double-buffer mode,
|
|
|
|
// a full redraw is required
|
2014-03-08 22:57:16 +00:00
|
|
|
myOSystem->menu().draw(myMsg.enabled && isDoubleBuffered());
|
2005-07-20 15:52:58 +00:00
|
|
|
break; // S_MENU
|
2005-02-27 23:41:19 +00:00
|
|
|
}
|
Huge changes across the map. Lets see if I can remember it all ...
There is now an SDL OpenGL port with filtering and alpha-blending.
It's a work in progress right now, but is already quite stable.
It's not as optimized as the software version yet, but this will
change as well. For now, you have to compile the SDL version in
either normal software mode or OpenGL mode. This will change
before the 1.4 release.
When entering menu mode, the emulation is now suspended. And when
pause is pressed, you can't enter menu mode. Because of these changes,
CPU use has dropped dramatically when viewing menus. This will benefit
all ports, since menus are now redrawn only when necessary, instead of
at the current framerate.
For a reference, on a Pentium-IV 2.4GHz, the software SDL version
maxes CPU usage at 9%, and the SDL OpenGL version at 13.5%. This is
at 60 fps and a zoomlevel of 4. While some small improvements can
(possibly) be made to the OpenGL version, I think we'll soon be hitting
the glass ceiling.
Work on the Porting.txt document is progressing, and I estimate it to
be 45% complete.
The Windows version still doesn't compile, and I still haven't looked
at it. Rest assured that it will be done before 1.4. There will be
a simultaneous release, even if the Linux versions are finished.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@200 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-11-06 22:22:33 +00:00
|
|
|
|
2005-08-29 18:36:42 +00:00
|
|
|
case EventHandler::S_CMDMENU:
|
|
|
|
{
|
2009-01-10 18:42:49 +00:00
|
|
|
// When onscreen messages are enabled in double-buffer mode,
|
|
|
|
// a full redraw is required
|
2014-03-08 22:57:16 +00:00
|
|
|
myOSystem->commandMenu().draw(myMsg.enabled && isDoubleBuffered());
|
2005-08-29 18:36:42 +00:00
|
|
|
break; // S_CMDMENU
|
|
|
|
}
|
|
|
|
|
Added first pass of the ROM launcher. When you press 'Start' in the ROM
launcher, it launches Frostbite. Then pressing 'Escape' goes back to the
launcher, and you're able to then launch Frostbite again! Success !!!
Still TODO is actually get a ROM listing and use the selected game, but
the fact that it works multiple times for some game means that the
infrastructure is working correctly :)
Changed behaviour of the 'Escape' key. Specifically, it now only acts
as a key to enter ROM launcher mode. In the case where the emulation
was started without the launcher, the key will now do nothing. From now
on, the only way to quit Stella is Ctrl-Q (or equivalent for OSX),
close the window, or from the 'Quit' button.
Also, the 'Enter launcher mode' event will eventually be made remappable,
as will the 'Enter menu mode' event (currently the 'Tab' key).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@412 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-05-06 18:39:00 +00:00
|
|
|
case EventHandler::S_LAUNCHER:
|
|
|
|
{
|
2009-01-10 18:42:49 +00:00
|
|
|
// When onscreen messages are enabled in double-buffer mode,
|
|
|
|
// a full redraw is required
|
2014-03-08 22:57:16 +00:00
|
|
|
myOSystem->launcher().draw(myMsg.enabled && isDoubleBuffered());
|
2005-07-20 15:52:58 +00:00
|
|
|
break; // S_LAUNCHER
|
Added first pass of the ROM launcher. When you press 'Start' in the ROM
launcher, it launches Frostbite. Then pressing 'Escape' goes back to the
launcher, and you're able to then launch Frostbite again! Success !!!
Still TODO is actually get a ROM listing and use the selected game, but
the fact that it works multiple times for some game means that the
infrastructure is working correctly :)
Changed behaviour of the 'Escape' key. Specifically, it now only acts
as a key to enter ROM launcher mode. In the case where the emulation
was started without the launcher, the key will now do nothing. From now
on, the only way to quit Stella is Ctrl-Q (or equivalent for OSX),
close the window, or from the 'Quit' button.
Also, the 'Enter launcher mode' event will eventually be made remappable,
as will the 'Enter menu mode' event (currently the 'Tab' key).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@412 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-05-06 18:39:00 +00:00
|
|
|
}
|
2004-06-23 03:43:47 +00:00
|
|
|
|
2006-12-15 16:43:12 +00:00
|
|
|
#ifdef DEBUGGER_SUPPORT
|
2005-02-27 23:41:19 +00:00
|
|
|
case EventHandler::S_DEBUGGER:
|
2005-06-23 14:33:12 +00:00
|
|
|
{
|
2009-01-10 18:42:49 +00:00
|
|
|
// When onscreen messages are enabled in double-buffer mode,
|
|
|
|
// a full redraw is required
|
2014-03-08 22:57:16 +00:00
|
|
|
myOSystem->debugger().draw(myMsg.enabled && isDoubleBuffered());
|
2005-05-27 18:00:49 +00:00
|
|
|
break; // S_DEBUGGER
|
2005-06-23 14:33:12 +00:00
|
|
|
}
|
2005-08-24 22:54:30 +00:00
|
|
|
#endif
|
2005-02-27 23:41:19 +00:00
|
|
|
|
2005-08-24 22:54:30 +00:00
|
|
|
default:
|
2005-02-27 23:41:19 +00:00
|
|
|
return;
|
2003-10-26 19:40:39 +00:00
|
|
|
}
|
|
|
|
|
2006-12-18 12:53:33 +00:00
|
|
|
// Draw any pending messages
|
2009-01-10 18:42:49 +00:00
|
|
|
if(myMsg.enabled)
|
2006-12-18 12:53:33 +00:00
|
|
|
drawMessage();
|
|
|
|
|
2008-12-04 16:53:26 +00:00
|
|
|
// Do any post-frame stuff
|
2008-08-04 11:56:12 +00:00
|
|
|
postFrameUpdate();
|
|
|
|
|
2005-07-20 17:33:03 +00:00
|
|
|
// The frame doesn't need to be completely redrawn anymore
|
2008-08-04 11:56:12 +00:00
|
|
|
myRedrawEntireFrame = false;
|
2003-09-25 16:20:34 +00:00
|
|
|
}
|
|
|
|
|
2005-03-13 03:38:41 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
2006-03-19 18:17:48 +00:00
|
|
|
void FrameBuffer::showMessage(const string& message, MessagePosition position,
|
2012-01-03 20:52:45 +00:00
|
|
|
bool force)
|
2005-03-13 03:38:41 +00:00
|
|
|
{
|
Revamped the result on floating pins for TIA reads. Previously, this was
controlled by 'tiafloat', which has now been removed. Now, all
undriven pins take on the last value on the databus. This fixes a bug
in those reads where bit 6 or bits 6 & 7 are also undriven (previously,
these bits would always be zero, and only bits 0-5 were from lastdatabus.
Added new commandline argument 'tiadriven', which defaults to false.
In this default case, relevant bits take on values from the databus.
If true, relevant bits still take on databus values, but some are
randomly driven high as well. This helps to expose bugs when
developers assume the values for undriven/floating bits.
Added 'uimessages' commandline argument and associated UI item. When
disabled, messages which are normally shown in-game are disabled.
Certain messages which indicate a serious error are still shown, however.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1900 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2009-11-10 20:12:50 +00:00
|
|
|
// Only show messages if they've been enabled
|
|
|
|
if(!(force || myOSystem->settings().getBool("uimessages")))
|
|
|
|
return;
|
|
|
|
|
2005-07-20 18:44:38 +00:00
|
|
|
// Erase old messages on the screen
|
2008-06-19 12:01:31 +00:00
|
|
|
if(myMsg.counter > 0)
|
2005-07-20 18:44:38 +00:00
|
|
|
{
|
2008-08-04 11:56:12 +00:00
|
|
|
myRedrawEntireFrame = true;
|
2008-12-27 23:27:32 +00:00
|
|
|
refresh();
|
2005-07-20 18:44:38 +00:00
|
|
|
}
|
|
|
|
|
2006-03-19 18:17:48 +00:00
|
|
|
// Precompute the message coordinates
|
2008-06-19 12:01:31 +00:00
|
|
|
myMsg.text = message;
|
|
|
|
myMsg.counter = uInt32(myOSystem->frameRate()) << 1; // Show message for 2 seconds
|
2012-01-03 20:52:45 +00:00
|
|
|
myMsg.color = kBtnTextColor;
|
2006-03-19 18:17:48 +00:00
|
|
|
|
2014-02-05 22:09:57 +00:00
|
|
|
myMsg.w = font().getStringWidth(myMsg.text) + 10;
|
|
|
|
myMsg.h = font().getFontHeight() + 8;
|
2008-06-19 12:01:31 +00:00
|
|
|
myMsg.surface->setWidth(myMsg.w);
|
|
|
|
myMsg.surface->setHeight(myMsg.h);
|
2009-01-10 18:42:49 +00:00
|
|
|
myMsg.position = position;
|
|
|
|
myMsg.enabled = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void FrameBuffer::toggleFrameStats()
|
|
|
|
{
|
|
|
|
showFrameStats(!myOSystem->settings().getBool("stats"));
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void FrameBuffer::showFrameStats(bool enable)
|
|
|
|
{
|
2013-05-08 23:34:42 +00:00
|
|
|
myOSystem->settings().setValue("stats", enable);
|
2009-01-10 18:42:49 +00:00
|
|
|
myStatsMsg.enabled = enable;
|
|
|
|
refresh();
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void FrameBuffer::enableMessages(bool enable)
|
|
|
|
{
|
|
|
|
if(enable)
|
|
|
|
{
|
2010-04-14 15:41:42 +00:00
|
|
|
// Only re-enable frame stats if they were already enabled before
|
2009-01-10 18:42:49 +00:00
|
|
|
myStatsMsg.enabled = myOSystem->settings().getBool("stats");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// Temporarily disable frame stats
|
|
|
|
myStatsMsg.enabled = false;
|
2006-03-19 18:17:48 +00:00
|
|
|
|
2009-01-10 18:42:49 +00:00
|
|
|
// Erase old messages on the screen
|
|
|
|
myMsg.enabled = false;
|
|
|
|
myMsg.counter = 0;
|
|
|
|
|
|
|
|
refresh();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
inline void FrameBuffer::drawMessage()
|
|
|
|
{
|
|
|
|
// Draw the bounded box and text
|
|
|
|
switch(myMsg.position)
|
2006-03-19 18:17:48 +00:00
|
|
|
{
|
|
|
|
case kTopLeft:
|
2008-06-19 12:01:31 +00:00
|
|
|
myMsg.x = 5;
|
|
|
|
myMsg.y = 5;
|
2006-03-19 18:17:48 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case kTopCenter:
|
2008-06-19 12:01:31 +00:00
|
|
|
myMsg.x = (myImageRect.width() - myMsg.w) >> 1;
|
|
|
|
myMsg.y = 5;
|
2006-03-19 18:17:48 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case kTopRight:
|
2008-06-19 12:01:31 +00:00
|
|
|
myMsg.x = myImageRect.width() - myMsg.w - 5;
|
|
|
|
myMsg.y = 5;
|
2006-03-19 18:17:48 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case kMiddleLeft:
|
2008-06-19 12:01:31 +00:00
|
|
|
myMsg.x = 5;
|
|
|
|
myMsg.y = (myImageRect.height() - myMsg.h) >> 1;
|
2006-03-19 18:17:48 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case kMiddleCenter:
|
2008-06-19 12:01:31 +00:00
|
|
|
myMsg.x = (myImageRect.width() - myMsg.w) >> 1;
|
|
|
|
myMsg.y = (myImageRect.height() - myMsg.h) >> 1;
|
2006-03-19 18:17:48 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case kMiddleRight:
|
2008-06-19 12:01:31 +00:00
|
|
|
myMsg.x = myImageRect.width() - myMsg.w - 5;
|
|
|
|
myMsg.y = (myImageRect.height() - myMsg.h) >> 1;
|
2006-03-19 18:17:48 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case kBottomLeft:
|
2008-06-19 12:01:31 +00:00
|
|
|
myMsg.x = 5;
|
|
|
|
myMsg.y = myImageRect.height() - myMsg.h - 5;
|
2006-03-19 18:17:48 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case kBottomCenter:
|
2008-06-19 12:01:31 +00:00
|
|
|
myMsg.x = (myImageRect.width() - myMsg.w) >> 1;
|
|
|
|
myMsg.y = myImageRect.height() - myMsg.h - 5;
|
2006-03-19 18:17:48 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case kBottomRight:
|
2008-06-19 12:01:31 +00:00
|
|
|
myMsg.x = myImageRect.width() - myMsg.w - 5;
|
|
|
|
myMsg.y = myImageRect.height() - myMsg.h - 5;
|
2006-03-19 18:17:48 +00:00
|
|
|
break;
|
|
|
|
}
|
2005-03-13 03:38:41 +00:00
|
|
|
|
2008-06-19 12:01:31 +00:00
|
|
|
myMsg.surface->setPos(myMsg.x + myImageRect.x(), myMsg.y + myImageRect.y());
|
2012-01-03 20:52:45 +00:00
|
|
|
myMsg.surface->fillRect(1, 1, myMsg.w-2, myMsg.h-2, kBtnColor);
|
|
|
|
myMsg.surface->box(0, 0, myMsg.w, myMsg.h, kColor, kShadowColor);
|
2014-02-05 22:09:57 +00:00
|
|
|
myMsg.surface->drawString(font(), myMsg.text, 4, 4,
|
|
|
|
myMsg.w, myMsg.color, kTextAlignLeft);
|
2008-06-19 12:01:31 +00:00
|
|
|
myMsg.counter--;
|
2006-03-18 00:00:30 +00:00
|
|
|
|
|
|
|
// Either erase the entire message (when time is reached),
|
|
|
|
// or show again this frame
|
2008-06-19 12:01:31 +00:00
|
|
|
if(myMsg.counter == 0) // Force an immediate update
|
2009-01-10 18:42:49 +00:00
|
|
|
{
|
|
|
|
myMsg.enabled = false;
|
2008-12-27 23:27:32 +00:00
|
|
|
refresh();
|
2009-01-10 18:42:49 +00:00
|
|
|
}
|
2006-03-18 00:00:30 +00:00
|
|
|
else
|
2008-06-19 12:01:31 +00:00
|
|
|
{
|
2009-01-10 18:42:49 +00:00
|
|
|
myMsg.surface->addDirtyRect(0, 0, 0, 0);
|
2014-05-02 15:58:57 +00:00
|
|
|
myMsg.surface->render();
|
2008-06-19 12:01:31 +00:00
|
|
|
}
|
2006-03-18 00:00:30 +00:00
|
|
|
}
|
|
|
|
|
2006-05-15 12:24:09 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void FrameBuffer::refresh()
|
|
|
|
{
|
2008-12-27 23:27:32 +00:00
|
|
|
// This method partly duplicates the behaviour in ::update()
|
|
|
|
// Here, however, make sure to redraw *all* surfaces applicable to the
|
|
|
|
// current EventHandler state
|
|
|
|
// We also check for double-buffered modes, and when present
|
|
|
|
// update both buffers accordingly
|
|
|
|
//
|
|
|
|
// This method is in essence a FULL refresh, putting all rendering
|
|
|
|
// buffers in a known, fully redrawn state
|
|
|
|
|
|
|
|
switch(myOSystem->eventHandler().state())
|
|
|
|
{
|
|
|
|
case EventHandler::S_EMULATE:
|
|
|
|
case EventHandler::S_PAUSE:
|
2010-07-22 15:41:46 +00:00
|
|
|
invalidate();
|
2009-01-19 16:52:32 +00:00
|
|
|
drawTIA(true);
|
2014-03-08 22:57:16 +00:00
|
|
|
if(isDoubleBuffered())
|
2010-07-22 15:41:46 +00:00
|
|
|
{
|
2010-10-27 14:07:52 +00:00
|
|
|
postFrameUpdate();
|
2010-07-22 15:41:46 +00:00
|
|
|
invalidate();
|
2009-01-19 16:52:32 +00:00
|
|
|
drawTIA(true);
|
2010-07-22 15:41:46 +00:00
|
|
|
}
|
2008-12-27 23:27:32 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case EventHandler::S_MENU:
|
2010-07-22 15:41:46 +00:00
|
|
|
invalidate();
|
2009-01-19 16:52:32 +00:00
|
|
|
drawTIA(true);
|
2008-12-27 23:27:32 +00:00
|
|
|
myOSystem->menu().draw(true);
|
2014-03-08 22:57:16 +00:00
|
|
|
if(isDoubleBuffered())
|
2008-12-27 23:27:32 +00:00
|
|
|
{
|
|
|
|
postFrameUpdate();
|
2010-07-22 15:41:46 +00:00
|
|
|
invalidate();
|
2009-01-19 16:52:32 +00:00
|
|
|
drawTIA(true);
|
2008-12-27 23:27:32 +00:00
|
|
|
myOSystem->menu().draw(true);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case EventHandler::S_CMDMENU:
|
2010-07-22 15:41:46 +00:00
|
|
|
invalidate();
|
2009-01-19 16:52:32 +00:00
|
|
|
drawTIA(true);
|
2008-12-27 23:27:32 +00:00
|
|
|
myOSystem->commandMenu().draw(true);
|
2014-03-08 22:57:16 +00:00
|
|
|
if(isDoubleBuffered())
|
2008-12-27 23:27:32 +00:00
|
|
|
{
|
|
|
|
postFrameUpdate();
|
2010-07-22 15:41:46 +00:00
|
|
|
invalidate();
|
2009-01-19 16:52:32 +00:00
|
|
|
drawTIA(true);
|
2008-12-27 23:27:32 +00:00
|
|
|
myOSystem->commandMenu().draw(true);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case EventHandler::S_LAUNCHER:
|
2010-07-22 15:41:46 +00:00
|
|
|
invalidate();
|
2008-12-27 23:27:32 +00:00
|
|
|
myOSystem->launcher().draw(true);
|
2014-03-08 22:57:16 +00:00
|
|
|
if(isDoubleBuffered())
|
2008-12-27 23:27:32 +00:00
|
|
|
{
|
|
|
|
postFrameUpdate();
|
2010-07-22 15:41:46 +00:00
|
|
|
invalidate();
|
2008-12-27 23:27:32 +00:00
|
|
|
myOSystem->launcher().draw(true);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
#ifdef DEBUGGER_SUPPORT
|
|
|
|
case EventHandler::S_DEBUGGER:
|
2010-07-22 15:41:46 +00:00
|
|
|
invalidate();
|
2008-12-27 23:27:32 +00:00
|
|
|
myOSystem->debugger().draw(true);
|
2014-03-08 22:57:16 +00:00
|
|
|
if(isDoubleBuffered())
|
2008-12-27 23:27:32 +00:00
|
|
|
{
|
|
|
|
postFrameUpdate();
|
2010-07-22 15:41:46 +00:00
|
|
|
invalidate();
|
2008-12-27 23:27:32 +00:00
|
|
|
myOSystem->debugger().draw(true);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2006-05-15 12:24:09 +00:00
|
|
|
}
|
|
|
|
|
2012-05-14 15:06:06 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void FrameBuffer::setNTSC(NTSCFilter::Preset preset, bool show)
|
|
|
|
{
|
|
|
|
ostringstream buf;
|
2014-03-08 22:15:02 +00:00
|
|
|
if(preset == NTSCFilter::PRESET_OFF)
|
2012-05-14 15:06:06 +00:00
|
|
|
{
|
2014-03-08 22:15:02 +00:00
|
|
|
enableNTSC(false);
|
|
|
|
buf << "TV filtering disabled";
|
2012-05-14 15:06:06 +00:00
|
|
|
}
|
|
|
|
else
|
2014-03-08 22:15:02 +00:00
|
|
|
{
|
|
|
|
enableNTSC(true);
|
|
|
|
const string& mode = myNTSCFilter.setPreset(preset);
|
|
|
|
buf << "TV filtering (" << mode << " mode)";
|
|
|
|
}
|
|
|
|
myOSystem->settings().setValue("tv.filter", (int)preset);
|
2012-05-14 15:06:06 +00:00
|
|
|
|
|
|
|
if(show) showMessage(buf.str());
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void FrameBuffer::setScanlineIntensity(int amount)
|
|
|
|
{
|
|
|
|
ostringstream buf;
|
2014-03-08 22:15:02 +00:00
|
|
|
if(ntscEnabled())
|
2012-05-14 15:06:06 +00:00
|
|
|
{
|
2014-03-08 22:15:02 +00:00
|
|
|
uInt32 intensity = enableScanlines(amount);
|
|
|
|
buf << "Scanline intensity at " << intensity << "%";
|
|
|
|
myOSystem->settings().setValue("tv.scanlines", intensity);
|
2012-05-14 15:06:06 +00:00
|
|
|
}
|
|
|
|
else
|
2014-03-08 22:15:02 +00:00
|
|
|
buf << "Scanlines only available in TV filtering mode";
|
2012-05-14 15:06:06 +00:00
|
|
|
|
|
|
|
showMessage(buf.str());
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void FrameBuffer::toggleScanlineInterpolation()
|
|
|
|
{
|
|
|
|
ostringstream buf;
|
2014-03-08 22:15:02 +00:00
|
|
|
if(ntscEnabled())
|
2012-05-14 15:06:06 +00:00
|
|
|
{
|
2014-03-08 22:15:02 +00:00
|
|
|
bool enable = !myOSystem->settings().getBool("tv.scaninter");
|
|
|
|
enableScanlineInterpolation(enable);
|
|
|
|
buf << "Scanline interpolation " << (enable ? "enabled" : "disabled");
|
|
|
|
myOSystem->settings().setValue("tv.scaninter", enable);
|
2012-05-14 15:06:06 +00:00
|
|
|
}
|
|
|
|
else
|
2014-03-08 22:15:02 +00:00
|
|
|
buf << "Scanlines only available in TV filtering mode";
|
2012-05-14 15:06:06 +00:00
|
|
|
|
|
|
|
showMessage(buf.str());
|
|
|
|
}
|
|
|
|
|
2008-12-12 15:51:07 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
2014-03-02 02:02:00 +00:00
|
|
|
uInt32 FrameBuffer::allocateSurface(int w, int h)
|
2008-12-12 15:51:07 +00:00
|
|
|
{
|
|
|
|
// Create a new surface
|
2014-03-02 02:02:00 +00:00
|
|
|
FBSurface* surface = createSurface(w, h);
|
2008-12-12 15:51:07 +00:00
|
|
|
|
|
|
|
// Add it to the list
|
2013-04-25 14:03:11 +00:00
|
|
|
mySurfaceList.insert(make_pair((uInt32)mySurfaceList.size(), surface));
|
2008-12-12 15:51:07 +00:00
|
|
|
|
|
|
|
// Return a reference to it
|
2010-04-14 15:41:42 +00:00
|
|
|
return mySurfaceList.size() - 1;
|
2008-12-12 15:51:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
First pass at adding a cart-specific bankswitch/info tab to the
debugger. In the process, I had to spend several days extending
the UI/dialog class to actually contain multiple tabs. This was
harder than expected, and it still isn't quite finished. In many
ways, we're beginning to reach the limits of the current code; it
was never designed for a full-fledged, graphically rich UI.
For now the tab is empty, but eventually it will contain general
info about the ROM bankswitch type (size, virtual layout, etc),
but also cart-specific info, including the ability to change
banks, which can be vary greatly among the different schemes.
Eventually, it may even allow to see/modify very cart-specific
info (like display RAM in DPC, etc).
Better handle errors in opening the serial port (AtariVox support)
for Windows and OSX.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2678 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-03-31 00:10:05 +00:00
|
|
|
FBSurface* FrameBuffer::surface(uInt32 id) const
|
2008-12-12 15:51:07 +00:00
|
|
|
{
|
First pass at adding a cart-specific bankswitch/info tab to the
debugger. In the process, I had to spend several days extending
the UI/dialog class to actually contain multiple tabs. This was
harder than expected, and it still isn't quite finished. In many
ways, we're beginning to reach the limits of the current code; it
was never designed for a full-fledged, graphically rich UI.
For now the tab is empty, but eventually it will contain general
info about the ROM bankswitch type (size, virtual layout, etc),
but also cart-specific info, including the ability to change
banks, which can be vary greatly among the different schemes.
Eventually, it may even allow to see/modify very cart-specific
info (like display RAM in DPC, etc).
Better handle errors in opening the serial port (AtariVox support)
for Windows and OSX.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2678 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-03-31 00:10:05 +00:00
|
|
|
map<uInt32,FBSurface*>::const_iterator iter = mySurfaceList.find(id);
|
2008-12-12 15:51:07 +00:00
|
|
|
return iter != mySurfaceList.end() ? iter->second : NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
2011-08-19 14:30:15 +00:00
|
|
|
void FrameBuffer::resetSurfaces(FBSurface* tiasurface)
|
2008-12-12 15:51:07 +00:00
|
|
|
{
|
2008-12-20 23:32:46 +00:00
|
|
|
// Free all resources for each surface, then reload them
|
|
|
|
// Due to possible timing and/or synchronization issues, all free()'s
|
|
|
|
// are done first, then all reload()'s
|
|
|
|
// Any derived FrameBuffer classes that call this method should be
|
|
|
|
// aware of these restrictions, and act accordingly
|
|
|
|
|
First pass at adding a cart-specific bankswitch/info tab to the
debugger. In the process, I had to spend several days extending
the UI/dialog class to actually contain multiple tabs. This was
harder than expected, and it still isn't quite finished. In many
ways, we're beginning to reach the limits of the current code; it
was never designed for a full-fledged, graphically rich UI.
For now the tab is empty, but eventually it will contain general
info about the ROM bankswitch type (size, virtual layout, etc),
but also cart-specific info, including the ability to change
banks, which can be vary greatly among the different schemes.
Eventually, it may even allow to see/modify very cart-specific
info (like display RAM in DPC, etc).
Better handle errors in opening the serial port (AtariVox support)
for Windows and OSX.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2678 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-03-31 00:10:05 +00:00
|
|
|
map<uInt32,FBSurface*>::iterator iter;
|
2008-12-12 15:51:07 +00:00
|
|
|
for(iter = mySurfaceList.begin(); iter != mySurfaceList.end(); ++iter)
|
2008-12-20 23:32:46 +00:00
|
|
|
iter->second->free();
|
2011-08-19 14:30:15 +00:00
|
|
|
if(tiasurface)
|
|
|
|
tiasurface->free();
|
2008-12-20 23:32:46 +00:00
|
|
|
for(iter = mySurfaceList.begin(); iter != mySurfaceList.end(); ++iter)
|
2008-12-12 15:51:07 +00:00
|
|
|
iter->second->reload();
|
2011-08-19 14:30:15 +00:00
|
|
|
if(tiasurface)
|
|
|
|
tiasurface->reload();
|
2008-12-12 15:51:07 +00:00
|
|
|
}
|
|
|
|
|
2009-01-03 15:44:13 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
2009-09-01 11:54:59 +00:00
|
|
|
uInt32 FrameBuffer::tiaPixel(uInt32 idx, uInt8 shift) const
|
2009-01-03 15:44:13 +00:00
|
|
|
{
|
2009-09-01 11:54:59 +00:00
|
|
|
uInt8 c = *(myOSystem->console().tia().currentFrameBuffer() + idx) | shift;
|
|
|
|
uInt8 p = *(myOSystem->console().tia().previousFrameBuffer() + idx) | shift;
|
2009-01-03 15:44:13 +00:00
|
|
|
|
2009-01-03 22:57:12 +00:00
|
|
|
return (!myUsePhosphor ? myDefPalette[c] : myAvgPalette[c][p]);
|
2009-01-03 15:44:13 +00:00
|
|
|
}
|
|
|
|
|
2003-10-26 19:40:39 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
OK, some huge changes across the board, so lets see if I get it all:
After much request, added ability to access the settings menu from the
ROM browser dialog. This menu now contains almost all items that can
be selected in Stella, and can be accessed in-game as before.
Completely removed pause functionality from the core code. It made
sense back when Stella was a single-mode program: there were two modes;
emulation and pause. Now that there are other event modes, the
EventHandler state machine is getting too complicated. If you want to
pause, you can simply enter one of the in-game menus. Related to this,
when the app is minimized, Stella enters the menu dialog state.
Previously, minimizing the app caused a pause, but since there was no
onscreen feedback, many people assumed the app locked up.
Added centering to all Dialog boxes, which is done dynamically, as they're
placed on the dialog stack to be drawn to the screen.
Cleaned up the API of Console/FrameBuffer/OSystem classes wrt to palettes
and timing. Parts of each were being done in different classes; now it
should be more consistent.
Started infrastructure for user-selectable UI palettes. For now, there's
no way to change it in the GUI, and it defaults to the normal palette.
Eventually, there will be several choices selectable from an in-game
menu.
Removed '-channels' commandline argument, since that feature can be
set from the ROM properties.
Added '128' to the choices for fragment size in AudioDialog.
Tweaked the OpenGL dynamic loading code to test both the given GL
lib, and if that fails to use auto-detection. It seems in the OSX port,
the first approach works for some people, and not the other (and vice-versa),
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1255 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-12-30 22:26:29 +00:00
|
|
|
void FrameBuffer::setTIAPalette(const uInt32* palette)
|
2003-10-26 19:40:39 +00:00
|
|
|
{
|
2006-01-10 02:09:34 +00:00
|
|
|
int i, j;
|
2003-10-26 19:40:39 +00:00
|
|
|
|
2006-01-10 02:09:34 +00:00
|
|
|
// Set palette for normal fill
|
|
|
|
for(i = 0; i < 256; ++i)
|
|
|
|
{
|
OK, some huge changes across the board, so lets see if I get it all:
After much request, added ability to access the settings menu from the
ROM browser dialog. This menu now contains almost all items that can
be selected in Stella, and can be accessed in-game as before.
Completely removed pause functionality from the core code. It made
sense back when Stella was a single-mode program: there were two modes;
emulation and pause. Now that there are other event modes, the
EventHandler state machine is getting too complicated. If you want to
pause, you can simply enter one of the in-game menus. Related to this,
when the app is minimized, Stella enters the menu dialog state.
Previously, minimizing the app caused a pause, but since there was no
onscreen feedback, many people assumed the app locked up.
Added centering to all Dialog boxes, which is done dynamically, as they're
placed on the dialog stack to be drawn to the screen.
Cleaned up the API of Console/FrameBuffer/OSystem classes wrt to palettes
and timing. Parts of each were being done in different classes; now it
should be more consistent.
Started infrastructure for user-selectable UI palettes. For now, there's
no way to change it in the GUI, and it defaults to the normal palette.
Eventually, there will be several choices selectable from an in-game
menu.
Removed '-channels' commandline argument, since that feature can be
set from the ROM properties.
Added '128' to the choices for fragment size in AudioDialog.
Tweaked the OpenGL dynamic loading code to test both the given GL
lib, and if that fails to use auto-detection. It seems in the OSX port,
the first approach works for some people, and not the other (and vice-versa),
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1255 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-12-30 22:26:29 +00:00
|
|
|
Uint8 r = (palette[i] >> 16) & 0xff;
|
|
|
|
Uint8 g = (palette[i] >> 8) & 0xff;
|
|
|
|
Uint8 b = palette[i] & 0xff;
|
2003-10-26 19:40:39 +00:00
|
|
|
|
2006-03-25 00:34:17 +00:00
|
|
|
myDefPalette[i] = mapRGB(r, g, b);
|
2005-03-28 00:04:54 +00:00
|
|
|
}
|
|
|
|
|
2006-01-10 02:09:34 +00:00
|
|
|
// Set palette for phosphor effect
|
2006-03-24 19:59:52 +00:00
|
|
|
for(i = 0; i < 256; ++i)
|
2006-01-10 02:09:34 +00:00
|
|
|
{
|
2006-03-24 19:59:52 +00:00
|
|
|
for(j = 0; j < 256; ++j)
|
2006-01-10 02:09:34 +00:00
|
|
|
{
|
OK, some huge changes across the board, so lets see if I get it all:
After much request, added ability to access the settings menu from the
ROM browser dialog. This menu now contains almost all items that can
be selected in Stella, and can be accessed in-game as before.
Completely removed pause functionality from the core code. It made
sense back when Stella was a single-mode program: there were two modes;
emulation and pause. Now that there are other event modes, the
EventHandler state machine is getting too complicated. If you want to
pause, you can simply enter one of the in-game menus. Related to this,
when the app is minimized, Stella enters the menu dialog state.
Previously, minimizing the app caused a pause, but since there was no
onscreen feedback, many people assumed the app locked up.
Added centering to all Dialog boxes, which is done dynamically, as they're
placed on the dialog stack to be drawn to the screen.
Cleaned up the API of Console/FrameBuffer/OSystem classes wrt to palettes
and timing. Parts of each were being done in different classes; now it
should be more consistent.
Started infrastructure for user-selectable UI palettes. For now, there's
no way to change it in the GUI, and it defaults to the normal palette.
Eventually, there will be several choices selectable from an in-game
menu.
Removed '-channels' commandline argument, since that feature can be
set from the ROM properties.
Added '128' to the choices for fragment size in AudioDialog.
Tweaked the OpenGL dynamic loading code to test both the given GL
lib, and if that fails to use auto-detection. It seems in the OSX port,
the first approach works for some people, and not the other (and vice-versa),
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1255 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-12-30 22:26:29 +00:00
|
|
|
uInt8 ri = (palette[i] >> 16) & 0xff;
|
|
|
|
uInt8 gi = (palette[i] >> 8) & 0xff;
|
|
|
|
uInt8 bi = palette[i] & 0xff;
|
|
|
|
uInt8 rj = (palette[j] >> 16) & 0xff;
|
|
|
|
uInt8 gj = (palette[j] >> 8) & 0xff;
|
|
|
|
uInt8 bj = palette[j] & 0xff;
|
2006-03-24 19:59:52 +00:00
|
|
|
|
2006-03-25 00:34:17 +00:00
|
|
|
Uint8 r = (Uint8) getPhosphor(ri, rj);
|
|
|
|
Uint8 g = (Uint8) getPhosphor(gi, gj);
|
|
|
|
Uint8 b = (Uint8) getPhosphor(bi, bj);
|
2006-03-24 19:59:52 +00:00
|
|
|
|
2006-03-25 00:34:17 +00:00
|
|
|
myAvgPalette[i][j] = mapRGB(r, g, b);
|
2006-01-10 02:09:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-08-04 11:56:12 +00:00
|
|
|
myRedrawEntireFrame = true;
|
2003-10-26 19:40:39 +00:00
|
|
|
}
|
|
|
|
|
OK, some huge changes across the board, so lets see if I get it all:
After much request, added ability to access the settings menu from the
ROM browser dialog. This menu now contains almost all items that can
be selected in Stella, and can be accessed in-game as before.
Completely removed pause functionality from the core code. It made
sense back when Stella was a single-mode program: there were two modes;
emulation and pause. Now that there are other event modes, the
EventHandler state machine is getting too complicated. If you want to
pause, you can simply enter one of the in-game menus. Related to this,
when the app is minimized, Stella enters the menu dialog state.
Previously, minimizing the app caused a pause, but since there was no
onscreen feedback, many people assumed the app locked up.
Added centering to all Dialog boxes, which is done dynamically, as they're
placed on the dialog stack to be drawn to the screen.
Cleaned up the API of Console/FrameBuffer/OSystem classes wrt to palettes
and timing. Parts of each were being done in different classes; now it
should be more consistent.
Started infrastructure for user-selectable UI palettes. For now, there's
no way to change it in the GUI, and it defaults to the normal palette.
Eventually, there will be several choices selectable from an in-game
menu.
Removed '-channels' commandline argument, since that feature can be
set from the ROM properties.
Added '128' to the choices for fragment size in AudioDialog.
Tweaked the OpenGL dynamic loading code to test both the given GL
lib, and if that fails to use auto-detection. It seems in the OSX port,
the first approach works for some people, and not the other (and vice-versa),
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1255 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-12-30 22:26:29 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
2014-01-31 16:23:10 +00:00
|
|
|
void FrameBuffer::setUIPalette()
|
OK, some huge changes across the board, so lets see if I get it all:
After much request, added ability to access the settings menu from the
ROM browser dialog. This menu now contains almost all items that can
be selected in Stella, and can be accessed in-game as before.
Completely removed pause functionality from the core code. It made
sense back when Stella was a single-mode program: there were two modes;
emulation and pause. Now that there are other event modes, the
EventHandler state machine is getting too complicated. If you want to
pause, you can simply enter one of the in-game menus. Related to this,
when the app is minimized, Stella enters the menu dialog state.
Previously, minimizing the app caused a pause, but since there was no
onscreen feedback, many people assumed the app locked up.
Added centering to all Dialog boxes, which is done dynamically, as they're
placed on the dialog stack to be drawn to the screen.
Cleaned up the API of Console/FrameBuffer/OSystem classes wrt to palettes
and timing. Parts of each were being done in different classes; now it
should be more consistent.
Started infrastructure for user-selectable UI palettes. For now, there's
no way to change it in the GUI, and it defaults to the normal palette.
Eventually, there will be several choices selectable from an in-game
menu.
Removed '-channels' commandline argument, since that feature can be
set from the ROM properties.
Added '128' to the choices for fragment size in AudioDialog.
Tweaked the OpenGL dynamic loading code to test both the given GL
lib, and if that fails to use auto-detection. It seems in the OSX port,
the first approach works for some people, and not the other (and vice-versa),
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1255 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-12-30 22:26:29 +00:00
|
|
|
{
|
|
|
|
// Set palette for GUI
|
2009-02-06 23:53:34 +00:00
|
|
|
for(int i = 0, j = 256; i < kNumColors-256; ++i, ++j)
|
OK, some huge changes across the board, so lets see if I get it all:
After much request, added ability to access the settings menu from the
ROM browser dialog. This menu now contains almost all items that can
be selected in Stella, and can be accessed in-game as before.
Completely removed pause functionality from the core code. It made
sense back when Stella was a single-mode program: there were two modes;
emulation and pause. Now that there are other event modes, the
EventHandler state machine is getting too complicated. If you want to
pause, you can simply enter one of the in-game menus. Related to this,
when the app is minimized, Stella enters the menu dialog state.
Previously, minimizing the app caused a pause, but since there was no
onscreen feedback, many people assumed the app locked up.
Added centering to all Dialog boxes, which is done dynamically, as they're
placed on the dialog stack to be drawn to the screen.
Cleaned up the API of Console/FrameBuffer/OSystem classes wrt to palettes
and timing. Parts of each were being done in different classes; now it
should be more consistent.
Started infrastructure for user-selectable UI palettes. For now, there's
no way to change it in the GUI, and it defaults to the normal palette.
Eventually, there will be several choices selectable from an in-game
menu.
Removed '-channels' commandline argument, since that feature can be
set from the ROM properties.
Added '128' to the choices for fragment size in AudioDialog.
Tweaked the OpenGL dynamic loading code to test both the given GL
lib, and if that fails to use auto-detection. It seems in the OSX port,
the first approach works for some people, and not the other (and vice-versa),
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1255 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-12-30 22:26:29 +00:00
|
|
|
{
|
2014-01-31 16:23:10 +00:00
|
|
|
Uint8 r = (ourGUIColors[i] >> 16) & 0xff;
|
|
|
|
Uint8 g = (ourGUIColors[i] >> 8) & 0xff;
|
|
|
|
Uint8 b = ourGUIColors[i] & 0xff;
|
2009-02-06 23:53:34 +00:00
|
|
|
|
|
|
|
myDefPalette[j] = mapRGB(r, g, b);
|
OK, some huge changes across the board, so lets see if I get it all:
After much request, added ability to access the settings menu from the
ROM browser dialog. This menu now contains almost all items that can
be selected in Stella, and can be accessed in-game as before.
Completely removed pause functionality from the core code. It made
sense back when Stella was a single-mode program: there were two modes;
emulation and pause. Now that there are other event modes, the
EventHandler state machine is getting too complicated. If you want to
pause, you can simply enter one of the in-game menus. Related to this,
when the app is minimized, Stella enters the menu dialog state.
Previously, minimizing the app caused a pause, but since there was no
onscreen feedback, many people assumed the app locked up.
Added centering to all Dialog boxes, which is done dynamically, as they're
placed on the dialog stack to be drawn to the screen.
Cleaned up the API of Console/FrameBuffer/OSystem classes wrt to palettes
and timing. Parts of each were being done in different classes; now it
should be more consistent.
Started infrastructure for user-selectable UI palettes. For now, there's
no way to change it in the GUI, and it defaults to the normal palette.
Eventually, there will be several choices selectable from an in-game
menu.
Removed '-channels' commandline argument, since that feature can be
set from the ROM properties.
Added '128' to the choices for fragment size in AudioDialog.
Tweaked the OpenGL dynamic loading code to test both the given GL
lib, and if that fails to use auto-detection. It seems in the OSX port,
the first approach works for some people, and not the other (and vice-versa),
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1255 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-12-30 22:26:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-01-10 18:52:55 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void FrameBuffer::stateChanged(EventHandler::State state)
|
|
|
|
{
|
|
|
|
// Make sure any onscreen messages are removed
|
|
|
|
myMsg.enabled = false;
|
|
|
|
myMsg.counter = 0;
|
|
|
|
|
|
|
|
myRedrawEntireFrame = true;
|
|
|
|
}
|
|
|
|
|
2005-05-01 20:11:07 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void FrameBuffer::setFullscreen(bool enable)
|
|
|
|
{
|
2014-04-28 16:47:10 +00:00
|
|
|
cerr << "setFullscreen: " << enable << endl;
|
|
|
|
enableFullscreen(enable);
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-02-19 15:34:22 +00:00
|
|
|
#if 0 //FIXSDL
|
Added 'WINDOWED_SUPPORT' compile-time argument, which can be used for
those systems which don't actually have a windowing environment. When
this is set, toggling from fullscreen will not be possible, and certain
window-related UI functions will not be accessible.
Completely revamped video subsystem. Windowed and fullscreen modes are
now dealt with separately. Windows can be zoomed using the 'zoom_ui'
and 'zoom_tia' arguments. Fullscreen modes are now set by resolution,
not zoom, so you can specify to always use a certain fullscreen
resolution, and the images will be scaled appropriately. This also
fixes the fullscreen issues on widescreen monitors; just select a
widescreen video mode, and the aspect ratio will always be correct.
Removed dirty-rect support for software rendering of the TIA image,
as it ended up being slower than just updating the entire image.
For those resolutions where it will start to slow down (1024x768 or
higher), one should be using OpenGL.
Fixed issue in Windows when returning from fullscreen mode made the
window constantly 'shrink' in size. It was related to auto-detecting
the desktop resolution, which is really the job of SDL. As such, all
further releases of Stella will require SDL 1.2.10, which includes
this auto-detection code internally.
Made ROM launcher resizable, configurable in sizes from 320x240
to 800x600. Updated the UIDialog to change these quantities from the
UI (Stella will need to be restarted for it to take effect).
Removed aspect ratio support, since it was causing problems, and the
new fullscreen mode work has made it obsolete. i *may* consider it
again in the future, if there's sufficient demand.
Added 'fullres' commandline argument, used to set the fullscreen
resolution.
Added 'launcherres' commandline argument, used to set the ROM
launcher resolution. This replaces 'launchersize' argument, which
has been removed.
Changed 'scale_ui' and 'scale_tia' to 'zoom_ui' and 'zoom_tia',
respectively. Their function remains the same.
Changed meaning of 'gl_fsmax' argument to specify what modes to use
fullscreen OpenGL scaling (previously, this was a boolean, and
didn't consider different modes).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1323 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2007-06-20 16:33:23 +00:00
|
|
|
#ifdef WINDOWED_SUPPORT
|
2009-08-07 11:45:14 +00:00
|
|
|
// '-1' means fullscreen mode is completely disabled
|
2013-09-28 00:51:10 +00:00
|
|
|
bool full = enable && myOSystem->settings().getString("fullscreen") != "-1";
|
|
|
|
setHint(kFullScreen, full);
|
2003-10-26 19:40:39 +00:00
|
|
|
|
Added 'WINDOWED_SUPPORT' compile-time argument, which can be used for
those systems which don't actually have a windowing environment. When
this is set, toggling from fullscreen will not be possible, and certain
window-related UI functions will not be accessible.
Completely revamped video subsystem. Windowed and fullscreen modes are
now dealt with separately. Windows can be zoomed using the 'zoom_ui'
and 'zoom_tia' arguments. Fullscreen modes are now set by resolution,
not zoom, so you can specify to always use a certain fullscreen
resolution, and the images will be scaled appropriately. This also
fixes the fullscreen issues on widescreen monitors; just select a
widescreen video mode, and the aspect ratio will always be correct.
Removed dirty-rect support for software rendering of the TIA image,
as it ended up being slower than just updating the entire image.
For those resolutions where it will start to slow down (1024x768 or
higher), one should be using OpenGL.
Fixed issue in Windows when returning from fullscreen mode made the
window constantly 'shrink' in size. It was related to auto-detecting
the desktop resolution, which is really the job of SDL. As such, all
further releases of Stella will require SDL 1.2.10, which includes
this auto-detection code internally.
Made ROM launcher resizable, configurable in sizes from 320x240
to 800x600. Updated the UIDialog to change these quantities from the
UI (Stella will need to be restarted for it to take effect).
Removed aspect ratio support, since it was causing problems, and the
new fullscreen mode work has made it obsolete. i *may* consider it
again in the future, if there's sufficient demand.
Added 'fullres' commandline argument, used to set the fullscreen
resolution.
Added 'launcherres' commandline argument, used to set the ROM
launcher resolution. This replaces 'launchersize' argument, which
has been removed.
Changed 'scale_ui' and 'scale_tia' to 'zoom_ui' and 'zoom_tia',
respectively. Their function remains the same.
Changed meaning of 'gl_fsmax' argument to specify what modes to use
fullscreen OpenGL scaling (previously, this was a boolean, and
didn't consider different modes).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1323 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2007-06-20 16:33:23 +00:00
|
|
|
// Do a dummy call to getSavedVidMode to set up the modelists
|
|
|
|
// and have it point to the correct 'current' mode
|
|
|
|
getSavedVidMode();
|
2003-10-26 19:40:39 +00:00
|
|
|
|
Added 'WINDOWED_SUPPORT' compile-time argument, which can be used for
those systems which don't actually have a windowing environment. When
this is set, toggling from fullscreen will not be possible, and certain
window-related UI functions will not be accessible.
Completely revamped video subsystem. Windowed and fullscreen modes are
now dealt with separately. Windows can be zoomed using the 'zoom_ui'
and 'zoom_tia' arguments. Fullscreen modes are now set by resolution,
not zoom, so you can specify to always use a certain fullscreen
resolution, and the images will be scaled appropriately. This also
fixes the fullscreen issues on widescreen monitors; just select a
widescreen video mode, and the aspect ratio will always be correct.
Removed dirty-rect support for software rendering of the TIA image,
as it ended up being slower than just updating the entire image.
For those resolutions where it will start to slow down (1024x768 or
higher), one should be using OpenGL.
Fixed issue in Windows when returning from fullscreen mode made the
window constantly 'shrink' in size. It was related to auto-detecting
the desktop resolution, which is really the job of SDL. As such, all
further releases of Stella will require SDL 1.2.10, which includes
this auto-detection code internally.
Made ROM launcher resizable, configurable in sizes from 320x240
to 800x600. Updated the UIDialog to change these quantities from the
UI (Stella will need to be restarted for it to take effect).
Removed aspect ratio support, since it was causing problems, and the
new fullscreen mode work has made it obsolete. i *may* consider it
again in the future, if there's sufficient demand.
Added 'fullres' commandline argument, used to set the fullscreen
resolution.
Added 'launcherres' commandline argument, used to set the ROM
launcher resolution. This replaces 'launchersize' argument, which
has been removed.
Changed 'scale_ui' and 'scale_tia' to 'zoom_ui' and 'zoom_tia',
respectively. Their function remains the same.
Changed meaning of 'gl_fsmax' argument to specify what modes to use
fullscreen OpenGL scaling (previously, this was a boolean, and
didn't consider different modes).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1323 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2007-06-20 16:33:23 +00:00
|
|
|
// Do a mode change to the 'current' mode by not passing a '+1' or '-1'
|
|
|
|
// to changeVidMode()
|
|
|
|
changeVidMode(0);
|
|
|
|
#endif
|
2014-02-19 15:34:22 +00:00
|
|
|
#endif
|
2005-03-28 00:04:54 +00:00
|
|
|
}
|
|
|
|
|
2014-04-28 16:47:10 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void FrameBuffer::toggleFullscreen()
|
|
|
|
{
|
|
|
|
setFullscreen(!fullScreen());
|
|
|
|
}
|
|
|
|
|
2005-03-28 00:04:54 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
2014-04-29 14:52:35 +00:00
|
|
|
bool FrameBuffer::changeWindowedVidMode(int direction)
|
2005-03-28 00:04:54 +00:00
|
|
|
{
|
2014-04-29 14:52:35 +00:00
|
|
|
#ifdef WINDOWED_SUPPORT
|
2008-06-19 12:01:31 +00:00
|
|
|
EventHandler::State state = myOSystem->eventHandler().state();
|
2014-04-29 14:52:35 +00:00
|
|
|
bool tiaMode = (state != EventHandler::S_DEBUGGER &&
|
|
|
|
state != EventHandler::S_LAUNCHER);
|
2008-06-19 12:01:31 +00:00
|
|
|
|
2014-04-29 14:52:35 +00:00
|
|
|
// Ignore any attempts to change video size while in invalid modes
|
|
|
|
if(!tiaMode || fullScreen())
|
Reworked 'fullres' argument to also accept the 'auto' option. In this case,
fullscreen resolutions will be automatically chosen based on the required
size for the window. The image will be centered and keep the same aspect
ratio, however, so operation will still work correctly on widescreen
monitors. 'Auto' will be the new default. Otherwise, if a specific
resolution is requested, Stella will try to accomodate it *only* if it fits
into the resolution; otherwise the smallest resolution that fits will be
used.
Removed 'zoom_ui' and 'zoom_tia'. The UI can now only be at 1x mode.
Aded 'tia_filter' commandline argument, which specifies to the filter
to use when rendering the tia image. For now, these accept 'zoom1x',
'zoom2x'..., up to 'zoom10x', and duplicate previous behaviour. Eventually,
Scalexx and HQxx filters may be added. Still TODO is add this to the UI.
First pass at making the standard build use a minimum of zoom2x for the TIA,
so the UI can be larger and use a better looking font. There's still work
to do in this area, especially for those ports with limited hardware that
support zoom1x only.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1544 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2008-07-22 14:54:39 +00:00
|
|
|
return false;
|
|
|
|
|
|
|
|
if(direction == +1)
|
|
|
|
myCurrentModeList->next();
|
|
|
|
else if(direction == -1)
|
|
|
|
myCurrentModeList->previous();
|
2014-04-29 14:52:35 +00:00
|
|
|
else
|
|
|
|
return false;
|
Added preliminary framework for using advanced scalers. Right now,
functionality is exactly the same as before; Alt-Equals goes to the
next valid scaler, and Alt-Minus goes to the previous one.
What were previously zoomed modes are now treated as scalers, named
'Zoom1x', 'Zoom2x', etc. Various scalexx and hqxx modes will also be made
available.
For now, and probably forever, these advanced scaling modes will only
be available for OpenGL, since if you don't have a card that can handle
GL well, the scalers will probably be too much anyway. Also, the advanced
scaling will not be available in UI mode, only OpenGL emulation mode.
The UI (Launcher, Debugger) and emulation modes are now scaled separately,
specified with the new settings 'scale_ui' and 'scale_tia'. The 'zoom'
setting has been removed.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1133 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-10-14 20:08:29 +00:00
|
|
|
|
2014-04-29 14:52:35 +00:00
|
|
|
const VideoMode& mode = myCurrentModeList->current();
|
|
|
|
myImageRect = mode.image;
|
|
|
|
myScreenSize = mode.screen;
|
|
|
|
if(setVideoMode(myScreenTitle, mode, false))
|
2008-06-19 12:01:31 +00:00
|
|
|
{
|
2014-04-29 14:52:35 +00:00
|
|
|
showMessage(mode.description);
|
|
|
|
myOSystem->settings().setValue("tia.zoom", mode.zoom);
|
2008-12-28 21:01:55 +00:00
|
|
|
refresh();
|
2014-04-29 14:52:35 +00:00
|
|
|
return true;
|
2008-06-19 12:01:31 +00:00
|
|
|
}
|
2014-02-19 15:34:22 +00:00
|
|
|
#endif
|
2014-04-29 14:52:35 +00:00
|
|
|
return false;
|
2003-10-26 19:40:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
2005-03-28 00:04:54 +00:00
|
|
|
void FrameBuffer::setCursorState()
|
2003-10-26 19:40:39 +00:00
|
|
|
{
|
2011-06-02 20:53:01 +00:00
|
|
|
// Always grab mouse in fullscreen or during emulation (if enabled),
|
2011-05-06 14:29:39 +00:00
|
|
|
// and don't show the cursor during emulation
|
|
|
|
bool emulation =
|
|
|
|
myOSystem->eventHandler().state() == EventHandler::S_EMULATE;
|
2011-06-02 20:53:01 +00:00
|
|
|
grabMouse(fullScreen() ||
|
|
|
|
(emulation && myOSystem->settings().getBool("grabmouse")));
|
2011-05-06 14:29:39 +00:00
|
|
|
showCursor(!emulation);
|
2003-10-01 19:01:02 +00:00
|
|
|
}
|
|
|
|
|
2011-06-07 13:40:59 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void FrameBuffer::toggleGrabMouse()
|
|
|
|
{
|
|
|
|
bool state = myOSystem->settings().getBool("grabmouse");
|
2013-05-08 23:34:42 +00:00
|
|
|
myOSystem->settings().setValue("grabmouse", !state);
|
2011-06-07 13:40:59 +00:00
|
|
|
setCursorState();
|
|
|
|
}
|
|
|
|
|
2006-01-10 02:09:34 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
2011-06-07 13:40:59 +00:00
|
|
|
uInt8 FrameBuffer::getPhosphor(uInt8 c1, uInt8 c2) const
|
2006-01-10 02:09:34 +00:00
|
|
|
{
|
|
|
|
if(c2 > c1)
|
2007-07-31 15:46:21 +00:00
|
|
|
BSPF_swap(c1, c2);
|
2006-01-10 02:09:34 +00:00
|
|
|
|
2006-01-10 20:37:00 +00:00
|
|
|
return ((c1 - c2) * myPhosphorBlend)/100 + c2;
|
2006-01-10 02:09:34 +00:00
|
|
|
}
|
|
|
|
|
Added preliminary framework for using advanced scalers. Right now,
functionality is exactly the same as before; Alt-Equals goes to the
next valid scaler, and Alt-Minus goes to the previous one.
What were previously zoomed modes are now treated as scalers, named
'Zoom1x', 'Zoom2x', etc. Various scalexx and hqxx modes will also be made
available.
For now, and probably forever, these advanced scaling modes will only
be available for OpenGL, since if you don't have a card that can handle
GL well, the scalers will probably be too much anyway. Also, the advanced
scaling will not be available in UI mode, only OpenGL emulation mode.
The UI (Launcher, Debugger) and emulation modes are now scaled separately,
specified with the new settings 'scale_ui' and 'scale_tia'. The 'zoom'
setting has been removed.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1133 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-10-14 20:08:29 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
2008-06-19 12:01:31 +00:00
|
|
|
uInt32 FrameBuffer::maxWindowSizeForScreen(uInt32 baseWidth, uInt32 baseHeight,
|
|
|
|
uInt32 screenWidth, uInt32 screenHeight)
|
Added preliminary framework for using advanced scalers. Right now,
functionality is exactly the same as before; Alt-Equals goes to the
next valid scaler, and Alt-Minus goes to the previous one.
What were previously zoomed modes are now treated as scalers, named
'Zoom1x', 'Zoom2x', etc. Various scalexx and hqxx modes will also be made
available.
For now, and probably forever, these advanced scaling modes will only
be available for OpenGL, since if you don't have a card that can handle
GL well, the scalers will probably be too much anyway. Also, the advanced
scaling will not be available in UI mode, only OpenGL emulation mode.
The UI (Launcher, Debugger) and emulation modes are now scaled separately,
specified with the new settings 'scale_ui' and 'scale_tia'. The 'zoom'
setting has been removed.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1133 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-10-14 20:08:29 +00:00
|
|
|
{
|
Added 'WINDOWED_SUPPORT' compile-time argument, which can be used for
those systems which don't actually have a windowing environment. When
this is set, toggling from fullscreen will not be possible, and certain
window-related UI functions will not be accessible.
Completely revamped video subsystem. Windowed and fullscreen modes are
now dealt with separately. Windows can be zoomed using the 'zoom_ui'
and 'zoom_tia' arguments. Fullscreen modes are now set by resolution,
not zoom, so you can specify to always use a certain fullscreen
resolution, and the images will be scaled appropriately. This also
fixes the fullscreen issues on widescreen monitors; just select a
widescreen video mode, and the aspect ratio will always be correct.
Removed dirty-rect support for software rendering of the TIA image,
as it ended up being slower than just updating the entire image.
For those resolutions where it will start to slow down (1024x768 or
higher), one should be using OpenGL.
Fixed issue in Windows when returning from fullscreen mode made the
window constantly 'shrink' in size. It was related to auto-detecting
the desktop resolution, which is really the job of SDL. As such, all
further releases of Stella will require SDL 1.2.10, which includes
this auto-detection code internally.
Made ROM launcher resizable, configurable in sizes from 320x240
to 800x600. Updated the UIDialog to change these quantities from the
UI (Stella will need to be restarted for it to take effect).
Removed aspect ratio support, since it was causing problems, and the
new fullscreen mode work has made it obsolete. i *may* consider it
again in the future, if there's sufficient demand.
Added 'fullres' commandline argument, used to set the fullscreen
resolution.
Added 'launcherres' commandline argument, used to set the ROM
launcher resolution. This replaces 'launchersize' argument, which
has been removed.
Changed 'scale_ui' and 'scale_tia' to 'zoom_ui' and 'zoom_tia',
respectively. Their function remains the same.
Changed meaning of 'gl_fsmax' argument to specify what modes to use
fullscreen OpenGL scaling (previously, this was a boolean, and
didn't consider different modes).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1323 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2007-06-20 16:33:23 +00:00
|
|
|
uInt32 multiplier = 1;
|
|
|
|
for(;;)
|
Added preliminary framework for using advanced scalers. Right now,
functionality is exactly the same as before; Alt-Equals goes to the
next valid scaler, and Alt-Minus goes to the previous one.
What were previously zoomed modes are now treated as scalers, named
'Zoom1x', 'Zoom2x', etc. Various scalexx and hqxx modes will also be made
available.
For now, and probably forever, these advanced scaling modes will only
be available for OpenGL, since if you don't have a card that can handle
GL well, the scalers will probably be too much anyway. Also, the advanced
scaling will not be available in UI mode, only OpenGL emulation mode.
The UI (Launcher, Debugger) and emulation modes are now scaled separately,
specified with the new settings 'scale_ui' and 'scale_tia'. The 'zoom'
setting has been removed.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1133 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-10-14 20:08:29 +00:00
|
|
|
{
|
Added 'WINDOWED_SUPPORT' compile-time argument, which can be used for
those systems which don't actually have a windowing environment. When
this is set, toggling from fullscreen will not be possible, and certain
window-related UI functions will not be accessible.
Completely revamped video subsystem. Windowed and fullscreen modes are
now dealt with separately. Windows can be zoomed using the 'zoom_ui'
and 'zoom_tia' arguments. Fullscreen modes are now set by resolution,
not zoom, so you can specify to always use a certain fullscreen
resolution, and the images will be scaled appropriately. This also
fixes the fullscreen issues on widescreen monitors; just select a
widescreen video mode, and the aspect ratio will always be correct.
Removed dirty-rect support for software rendering of the TIA image,
as it ended up being slower than just updating the entire image.
For those resolutions where it will start to slow down (1024x768 or
higher), one should be using OpenGL.
Fixed issue in Windows when returning from fullscreen mode made the
window constantly 'shrink' in size. It was related to auto-detecting
the desktop resolution, which is really the job of SDL. As such, all
further releases of Stella will require SDL 1.2.10, which includes
this auto-detection code internally.
Made ROM launcher resizable, configurable in sizes from 320x240
to 800x600. Updated the UIDialog to change these quantities from the
UI (Stella will need to be restarted for it to take effect).
Removed aspect ratio support, since it was causing problems, and the
new fullscreen mode work has made it obsolete. i *may* consider it
again in the future, if there's sufficient demand.
Added 'fullres' commandline argument, used to set the fullscreen
resolution.
Added 'launcherres' commandline argument, used to set the ROM
launcher resolution. This replaces 'launchersize' argument, which
has been removed.
Changed 'scale_ui' and 'scale_tia' to 'zoom_ui' and 'zoom_tia',
respectively. Their function remains the same.
Changed meaning of 'gl_fsmax' argument to specify what modes to use
fullscreen OpenGL scaling (previously, this was a boolean, and
didn't consider different modes).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1323 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2007-06-20 16:33:23 +00:00
|
|
|
// Figure out the zoomed size of the window
|
2008-06-19 12:01:31 +00:00
|
|
|
uInt32 width = baseWidth * multiplier;
|
|
|
|
uInt32 height = baseHeight * multiplier;
|
Added preliminary framework for using advanced scalers. Right now,
functionality is exactly the same as before; Alt-Equals goes to the
next valid scaler, and Alt-Minus goes to the previous one.
What were previously zoomed modes are now treated as scalers, named
'Zoom1x', 'Zoom2x', etc. Various scalexx and hqxx modes will also be made
available.
For now, and probably forever, these advanced scaling modes will only
be available for OpenGL, since if you don't have a card that can handle
GL well, the scalers will probably be too much anyway. Also, the advanced
scaling will not be available in UI mode, only OpenGL emulation mode.
The UI (Launcher, Debugger) and emulation modes are now scaled separately,
specified with the new settings 'scale_ui' and 'scale_tia'. The 'zoom'
setting has been removed.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1133 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-10-14 20:08:29 +00:00
|
|
|
|
Added 'WINDOWED_SUPPORT' compile-time argument, which can be used for
those systems which don't actually have a windowing environment. When
this is set, toggling from fullscreen will not be possible, and certain
window-related UI functions will not be accessible.
Completely revamped video subsystem. Windowed and fullscreen modes are
now dealt with separately. Windows can be zoomed using the 'zoom_ui'
and 'zoom_tia' arguments. Fullscreen modes are now set by resolution,
not zoom, so you can specify to always use a certain fullscreen
resolution, and the images will be scaled appropriately. This also
fixes the fullscreen issues on widescreen monitors; just select a
widescreen video mode, and the aspect ratio will always be correct.
Removed dirty-rect support for software rendering of the TIA image,
as it ended up being slower than just updating the entire image.
For those resolutions where it will start to slow down (1024x768 or
higher), one should be using OpenGL.
Fixed issue in Windows when returning from fullscreen mode made the
window constantly 'shrink' in size. It was related to auto-detecting
the desktop resolution, which is really the job of SDL. As such, all
further releases of Stella will require SDL 1.2.10, which includes
this auto-detection code internally.
Made ROM launcher resizable, configurable in sizes from 320x240
to 800x600. Updated the UIDialog to change these quantities from the
UI (Stella will need to be restarted for it to take effect).
Removed aspect ratio support, since it was causing problems, and the
new fullscreen mode work has made it obsolete. i *may* consider it
again in the future, if there's sufficient demand.
Added 'fullres' commandline argument, used to set the fullscreen
resolution.
Added 'launcherres' commandline argument, used to set the ROM
launcher resolution. This replaces 'launchersize' argument, which
has been removed.
Changed 'scale_ui' and 'scale_tia' to 'zoom_ui' and 'zoom_tia',
respectively. Their function remains the same.
Changed meaning of 'gl_fsmax' argument to specify what modes to use
fullscreen OpenGL scaling (previously, this was a boolean, and
didn't consider different modes).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1323 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2007-06-20 16:33:23 +00:00
|
|
|
if((width > screenWidth) || (height > screenHeight))
|
|
|
|
break;
|
Added preliminary framework for using advanced scalers. Right now,
functionality is exactly the same as before; Alt-Equals goes to the
next valid scaler, and Alt-Minus goes to the previous one.
What were previously zoomed modes are now treated as scalers, named
'Zoom1x', 'Zoom2x', etc. Various scalexx and hqxx modes will also be made
available.
For now, and probably forever, these advanced scaling modes will only
be available for OpenGL, since if you don't have a card that can handle
GL well, the scalers will probably be too much anyway. Also, the advanced
scaling will not be available in UI mode, only OpenGL emulation mode.
The UI (Launcher, Debugger) and emulation modes are now scaled separately,
specified with the new settings 'scale_ui' and 'scale_tia'. The 'zoom'
setting has been removed.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1133 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-10-14 20:08:29 +00:00
|
|
|
|
Added 'WINDOWED_SUPPORT' compile-time argument, which can be used for
those systems which don't actually have a windowing environment. When
this is set, toggling from fullscreen will not be possible, and certain
window-related UI functions will not be accessible.
Completely revamped video subsystem. Windowed and fullscreen modes are
now dealt with separately. Windows can be zoomed using the 'zoom_ui'
and 'zoom_tia' arguments. Fullscreen modes are now set by resolution,
not zoom, so you can specify to always use a certain fullscreen
resolution, and the images will be scaled appropriately. This also
fixes the fullscreen issues on widescreen monitors; just select a
widescreen video mode, and the aspect ratio will always be correct.
Removed dirty-rect support for software rendering of the TIA image,
as it ended up being slower than just updating the entire image.
For those resolutions where it will start to slow down (1024x768 or
higher), one should be using OpenGL.
Fixed issue in Windows when returning from fullscreen mode made the
window constantly 'shrink' in size. It was related to auto-detecting
the desktop resolution, which is really the job of SDL. As such, all
further releases of Stella will require SDL 1.2.10, which includes
this auto-detection code internally.
Made ROM launcher resizable, configurable in sizes from 320x240
to 800x600. Updated the UIDialog to change these quantities from the
UI (Stella will need to be restarted for it to take effect).
Removed aspect ratio support, since it was causing problems, and the
new fullscreen mode work has made it obsolete. i *may* consider it
again in the future, if there's sufficient demand.
Added 'fullres' commandline argument, used to set the fullscreen
resolution.
Added 'launcherres' commandline argument, used to set the ROM
launcher resolution. This replaces 'launchersize' argument, which
has been removed.
Changed 'scale_ui' and 'scale_tia' to 'zoom_ui' and 'zoom_tia',
respectively. Their function remains the same.
Changed meaning of 'gl_fsmax' argument to specify what modes to use
fullscreen OpenGL scaling (previously, this was a boolean, and
didn't consider different modes).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1323 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2007-06-20 16:33:23 +00:00
|
|
|
++multiplier;
|
|
|
|
}
|
|
|
|
return multiplier > 1 ? multiplier - 1 : 1;
|
Added preliminary framework for using advanced scalers. Right now,
functionality is exactly the same as before; Alt-Equals goes to the
next valid scaler, and Alt-Minus goes to the previous one.
What were previously zoomed modes are now treated as scalers, named
'Zoom1x', 'Zoom2x', etc. Various scalexx and hqxx modes will also be made
available.
For now, and probably forever, these advanced scaling modes will only
be available for OpenGL, since if you don't have a card that can handle
GL well, the scalers will probably be too much anyway. Also, the advanced
scaling will not be available in UI mode, only OpenGL emulation mode.
The UI (Launcher, Debugger) and emulation modes are now scaled separately,
specified with the new settings 'scale_ui' and 'scale_tia'. The 'zoom'
setting has been removed.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1133 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-10-14 20:08:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
2008-06-19 12:01:31 +00:00
|
|
|
void FrameBuffer::setAvailableVidModes(uInt32 baseWidth, uInt32 baseHeight)
|
Added preliminary framework for using advanced scalers. Right now,
functionality is exactly the same as before; Alt-Equals goes to the
next valid scaler, and Alt-Minus goes to the previous one.
What were previously zoomed modes are now treated as scalers, named
'Zoom1x', 'Zoom2x', etc. Various scalexx and hqxx modes will also be made
available.
For now, and probably forever, these advanced scaling modes will only
be available for OpenGL, since if you don't have a card that can handle
GL well, the scalers will probably be too much anyway. Also, the advanced
scaling will not be available in UI mode, only OpenGL emulation mode.
The UI (Launcher, Debugger) and emulation modes are now scaled separately,
specified with the new settings 'scale_ui' and 'scale_tia'. The 'zoom'
setting has been removed.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1133 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-10-14 20:08:29 +00:00
|
|
|
{
|
Added 'WINDOWED_SUPPORT' compile-time argument, which can be used for
those systems which don't actually have a windowing environment. When
this is set, toggling from fullscreen will not be possible, and certain
window-related UI functions will not be accessible.
Completely revamped video subsystem. Windowed and fullscreen modes are
now dealt with separately. Windows can be zoomed using the 'zoom_ui'
and 'zoom_tia' arguments. Fullscreen modes are now set by resolution,
not zoom, so you can specify to always use a certain fullscreen
resolution, and the images will be scaled appropriately. This also
fixes the fullscreen issues on widescreen monitors; just select a
widescreen video mode, and the aspect ratio will always be correct.
Removed dirty-rect support for software rendering of the TIA image,
as it ended up being slower than just updating the entire image.
For those resolutions where it will start to slow down (1024x768 or
higher), one should be using OpenGL.
Fixed issue in Windows when returning from fullscreen mode made the
window constantly 'shrink' in size. It was related to auto-detecting
the desktop resolution, which is really the job of SDL. As such, all
further releases of Stella will require SDL 1.2.10, which includes
this auto-detection code internally.
Made ROM launcher resizable, configurable in sizes from 320x240
to 800x600. Updated the UIDialog to change these quantities from the
UI (Stella will need to be restarted for it to take effect).
Removed aspect ratio support, since it was causing problems, and the
new fullscreen mode work has made it obsolete. i *may* consider it
again in the future, if there's sufficient demand.
Added 'fullres' commandline argument, used to set the fullscreen
resolution.
Added 'launcherres' commandline argument, used to set the ROM
launcher resolution. This replaces 'launchersize' argument, which
has been removed.
Changed 'scale_ui' and 'scale_tia' to 'zoom_ui' and 'zoom_tia',
respectively. Their function remains the same.
Changed meaning of 'gl_fsmax' argument to specify what modes to use
fullscreen OpenGL scaling (previously, this was a boolean, and
didn't consider different modes).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1323 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2007-06-20 16:33:23 +00:00
|
|
|
myWindowedModeList.clear();
|
Reworked 'fullres' argument to also accept the 'auto' option. In this case,
fullscreen resolutions will be automatically chosen based on the required
size for the window. The image will be centered and keep the same aspect
ratio, however, so operation will still work correctly on widescreen
monitors. 'Auto' will be the new default. Otherwise, if a specific
resolution is requested, Stella will try to accomodate it *only* if it fits
into the resolution; otherwise the smallest resolution that fits will be
used.
Removed 'zoom_ui' and 'zoom_tia'. The UI can now only be at 1x mode.
Aded 'tia_filter' commandline argument, which specifies to the filter
to use when rendering the tia image. For now, these accept 'zoom1x',
'zoom2x'..., up to 'zoom10x', and duplicate previous behaviour. Eventually,
Scalexx and HQxx filters may be added. Still TODO is add this to the UI.
First pass at making the standard build use a minimum of zoom2x for the TIA,
so the UI can be larger and use a better looking font. There's still work
to do in this area, especially for those ports with limited hardware that
support zoom1x only.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1544 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2008-07-22 14:54:39 +00:00
|
|
|
myFullscreenModeList.clear();
|
2008-06-19 12:01:31 +00:00
|
|
|
|
2014-04-28 16:47:10 +00:00
|
|
|
// Check if zooming is allowed for this state (currently only allowed
|
|
|
|
// for TIA screens)
|
|
|
|
EventHandler::State state = myOSystem->eventHandler().state();
|
|
|
|
bool tiaMode = (state != EventHandler::S_DEBUGGER &&
|
|
|
|
state != EventHandler::S_LAUNCHER);
|
Added 'WINDOWED_SUPPORT' compile-time argument, which can be used for
those systems which don't actually have a windowing environment. When
this is set, toggling from fullscreen will not be possible, and certain
window-related UI functions will not be accessible.
Completely revamped video subsystem. Windowed and fullscreen modes are
now dealt with separately. Windows can be zoomed using the 'zoom_ui'
and 'zoom_tia' arguments. Fullscreen modes are now set by resolution,
not zoom, so you can specify to always use a certain fullscreen
resolution, and the images will be scaled appropriately. This also
fixes the fullscreen issues on widescreen monitors; just select a
widescreen video mode, and the aspect ratio will always be correct.
Removed dirty-rect support for software rendering of the TIA image,
as it ended up being slower than just updating the entire image.
For those resolutions where it will start to slow down (1024x768 or
higher), one should be using OpenGL.
Fixed issue in Windows when returning from fullscreen mode made the
window constantly 'shrink' in size. It was related to auto-detecting
the desktop resolution, which is really the job of SDL. As such, all
further releases of Stella will require SDL 1.2.10, which includes
this auto-detection code internally.
Made ROM launcher resizable, configurable in sizes from 320x240
to 800x600. Updated the UIDialog to change these quantities from the
UI (Stella will need to be restarted for it to take effect).
Removed aspect ratio support, since it was causing problems, and the
new fullscreen mode work has made it obsolete. i *may* consider it
again in the future, if there's sufficient demand.
Added 'fullres' commandline argument, used to set the fullscreen
resolution.
Added 'launcherres' commandline argument, used to set the ROM
launcher resolution. This replaces 'launchersize' argument, which
has been removed.
Changed 'scale_ui' and 'scale_tia' to 'zoom_ui' and 'zoom_tia',
respectively. Their function remains the same.
Changed meaning of 'gl_fsmax' argument to specify what modes to use
fullscreen OpenGL scaling (previously, this was a boolean, and
didn't consider different modes).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1323 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2007-06-20 16:33:23 +00:00
|
|
|
|
2014-04-28 16:47:10 +00:00
|
|
|
// TIA mode allows zooming at integral factors in windowed modes,
|
|
|
|
// and also non-integral factors in fullscreen mode
|
|
|
|
if(tiaMode)
|
2008-06-19 12:01:31 +00:00
|
|
|
{
|
2014-04-28 16:47:10 +00:00
|
|
|
// TIA windowed modes
|
|
|
|
uInt32 maxZoom = maxWindowSizeForScreen(baseWidth, baseHeight,
|
2014-04-29 14:52:35 +00:00
|
|
|
myDesktopSize.w, myDesktopSize.h);
|
2009-01-14 20:31:07 +00:00
|
|
|
|
2014-04-28 16:47:10 +00:00
|
|
|
// Aspect ratio
|
|
|
|
bool ntsc = myOSystem->console().about().InitialFrameRate == "60";
|
|
|
|
uInt32 aspect = myOSystem->settings().getInt(ntsc ?
|
|
|
|
"tia.aspectn" : "tia.aspectp");
|
2009-01-14 20:31:07 +00:00
|
|
|
|
2014-04-28 16:47:10 +00:00
|
|
|
// Figure our the smallest zoom level we can use
|
|
|
|
uInt32 firstZoom = 2;
|
2014-04-29 14:52:35 +00:00
|
|
|
if(myDesktopSize.w < 640 || myDesktopSize.h < 480)
|
2014-04-28 16:47:10 +00:00
|
|
|
firstZoom = 1;
|
|
|
|
for(uInt32 zoom = firstZoom; zoom <= maxZoom; ++zoom)
|
2008-06-19 12:01:31 +00:00
|
|
|
{
|
2014-04-28 16:47:10 +00:00
|
|
|
ostringstream desc;
|
|
|
|
desc << "Zoom " << zoom << "x";
|
|
|
|
|
|
|
|
VideoMode mode(baseWidth*zoom, baseHeight*zoom,
|
|
|
|
baseWidth*zoom, baseHeight*zoom, false, zoom, desc.str());
|
|
|
|
mode.applyAspectCorrection(aspect);
|
|
|
|
myWindowedModeList.add(mode);
|
2008-06-19 12:01:31 +00:00
|
|
|
}
|
Added preliminary framework for using advanced scalers. Right now,
functionality is exactly the same as before; Alt-Equals goes to the
next valid scaler, and Alt-Minus goes to the previous one.
What were previously zoomed modes are now treated as scalers, named
'Zoom1x', 'Zoom2x', etc. Various scalexx and hqxx modes will also be made
available.
For now, and probably forever, these advanced scaling modes will only
be available for OpenGL, since if you don't have a card that can handle
GL well, the scalers will probably be too much anyway. Also, the advanced
scaling will not be available in UI mode, only OpenGL emulation mode.
The UI (Launcher, Debugger) and emulation modes are now scaled separately,
specified with the new settings 'scale_ui' and 'scale_tia'. The 'zoom'
setting has been removed.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1133 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-10-14 20:08:29 +00:00
|
|
|
|
2014-04-28 16:47:10 +00:00
|
|
|
// TIA fullscreen mode
|
|
|
|
// GUI::Size screen(myDesktopWidth, myDesktopHeight);
|
|
|
|
myFullscreenModeList.add(
|
2014-04-29 14:52:35 +00:00
|
|
|
VideoMode(baseWidth, baseHeight, myDesktopSize.w, myDesktopSize.h, true)
|
2014-04-28 16:47:10 +00:00
|
|
|
);
|
Reworked 'fullres' argument to also accept the 'auto' option. In this case,
fullscreen resolutions will be automatically chosen based on the required
size for the window. The image will be centered and keep the same aspect
ratio, however, so operation will still work correctly on widescreen
monitors. 'Auto' will be the new default. Otherwise, if a specific
resolution is requested, Stella will try to accomodate it *only* if it fits
into the resolution; otherwise the smallest resolution that fits will be
used.
Removed 'zoom_ui' and 'zoom_tia'. The UI can now only be at 1x mode.
Aded 'tia_filter' commandline argument, which specifies to the filter
to use when rendering the tia image. For now, these accept 'zoom1x',
'zoom2x'..., up to 'zoom10x', and duplicate previous behaviour. Eventually,
Scalexx and HQxx filters may be added. Still TODO is add this to the UI.
First pass at making the standard build use a minimum of zoom2x for the TIA,
so the UI can be larger and use a better looking font. There's still work
to do in this area, especially for those ports with limited hardware that
support zoom1x only.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1544 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2008-07-22 14:54:39 +00:00
|
|
|
|
2014-04-28 16:47:10 +00:00
|
|
|
}
|
|
|
|
else // UI mode
|
2008-06-19 12:01:31 +00:00
|
|
|
{
|
2014-04-28 16:47:10 +00:00
|
|
|
// Windowed and fullscreen mode differ only in screen size
|
|
|
|
myWindowedModeList.add(
|
|
|
|
VideoMode(baseWidth, baseHeight, baseWidth, baseHeight, false)
|
|
|
|
);
|
|
|
|
myFullscreenModeList.add(
|
2014-04-29 14:52:35 +00:00
|
|
|
VideoMode(baseWidth, baseHeight, myDesktopSize.w, myDesktopSize.h, true)
|
2014-04-28 16:47:10 +00:00
|
|
|
);
|
2006-11-18 13:29:12 +00:00
|
|
|
}
|
2014-04-28 16:47:10 +00:00
|
|
|
|
2014-04-30 16:53:21 +00:00
|
|
|
#if 0 //FIXSDL
|
2014-04-28 16:47:10 +00:00
|
|
|
cerr << "Windowed modes:\n" << myWindowedModeList << endl
|
|
|
|
<< "Fullscreen modes:\n" << myFullscreenModeList << endl
|
|
|
|
<< endl;
|
2014-04-30 16:53:21 +00:00
|
|
|
#endif
|
Added 'WINDOWED_SUPPORT' compile-time argument, which can be used for
those systems which don't actually have a windowing environment. When
this is set, toggling from fullscreen will not be possible, and certain
window-related UI functions will not be accessible.
Completely revamped video subsystem. Windowed and fullscreen modes are
now dealt with separately. Windows can be zoomed using the 'zoom_ui'
and 'zoom_tia' arguments. Fullscreen modes are now set by resolution,
not zoom, so you can specify to always use a certain fullscreen
resolution, and the images will be scaled appropriately. This also
fixes the fullscreen issues on widescreen monitors; just select a
widescreen video mode, and the aspect ratio will always be correct.
Removed dirty-rect support for software rendering of the TIA image,
as it ended up being slower than just updating the entire image.
For those resolutions where it will start to slow down (1024x768 or
higher), one should be using OpenGL.
Fixed issue in Windows when returning from fullscreen mode made the
window constantly 'shrink' in size. It was related to auto-detecting
the desktop resolution, which is really the job of SDL. As such, all
further releases of Stella will require SDL 1.2.10, which includes
this auto-detection code internally.
Made ROM launcher resizable, configurable in sizes from 320x240
to 800x600. Updated the UIDialog to change these quantities from the
UI (Stella will need to be restarted for it to take effect).
Removed aspect ratio support, since it was causing problems, and the
new fullscreen mode work has made it obsolete. i *may* consider it
again in the future, if there's sufficient demand.
Added 'fullres' commandline argument, used to set the fullscreen
resolution.
Added 'launcherres' commandline argument, used to set the ROM
launcher resolution. This replaces 'launchersize' argument, which
has been removed.
Changed 'scale_ui' and 'scale_tia' to 'zoom_ui' and 'zoom_tia',
respectively. Their function remains the same.
Changed meaning of 'gl_fsmax' argument to specify what modes to use
fullscreen OpenGL scaling (previously, this was a boolean, and
didn't consider different modes).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1323 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2007-06-20 16:33:23 +00:00
|
|
|
}
|
Added preliminary framework for using advanced scalers. Right now,
functionality is exactly the same as before; Alt-Equals goes to the
next valid scaler, and Alt-Minus goes to the previous one.
What were previously zoomed modes are now treated as scalers, named
'Zoom1x', 'Zoom2x', etc. Various scalexx and hqxx modes will also be made
available.
For now, and probably forever, these advanced scaling modes will only
be available for OpenGL, since if you don't have a card that can handle
GL well, the scalers will probably be too much anyway. Also, the advanced
scaling will not be available in UI mode, only OpenGL emulation mode.
The UI (Launcher, Debugger) and emulation modes are now scaled separately,
specified with the new settings 'scale_ui' and 'scale_tia'. The 'zoom'
setting has been removed.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1133 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-10-14 20:08:29 +00:00
|
|
|
|
Added 'WINDOWED_SUPPORT' compile-time argument, which can be used for
those systems which don't actually have a windowing environment. When
this is set, toggling from fullscreen will not be possible, and certain
window-related UI functions will not be accessible.
Completely revamped video subsystem. Windowed and fullscreen modes are
now dealt with separately. Windows can be zoomed using the 'zoom_ui'
and 'zoom_tia' arguments. Fullscreen modes are now set by resolution,
not zoom, so you can specify to always use a certain fullscreen
resolution, and the images will be scaled appropriately. This also
fixes the fullscreen issues on widescreen monitors; just select a
widescreen video mode, and the aspect ratio will always be correct.
Removed dirty-rect support for software rendering of the TIA image,
as it ended up being slower than just updating the entire image.
For those resolutions where it will start to slow down (1024x768 or
higher), one should be using OpenGL.
Fixed issue in Windows when returning from fullscreen mode made the
window constantly 'shrink' in size. It was related to auto-detecting
the desktop resolution, which is really the job of SDL. As such, all
further releases of Stella will require SDL 1.2.10, which includes
this auto-detection code internally.
Made ROM launcher resizable, configurable in sizes from 320x240
to 800x600. Updated the UIDialog to change these quantities from the
UI (Stella will need to be restarted for it to take effect).
Removed aspect ratio support, since it was causing problems, and the
new fullscreen mode work has made it obsolete. i *may* consider it
again in the future, if there's sufficient demand.
Added 'fullres' commandline argument, used to set the fullscreen
resolution.
Added 'launcherres' commandline argument, used to set the ROM
launcher resolution. This replaces 'launchersize' argument, which
has been removed.
Changed 'scale_ui' and 'scale_tia' to 'zoom_ui' and 'zoom_tia',
respectively. Their function remains the same.
Changed meaning of 'gl_fsmax' argument to specify what modes to use
fullscreen OpenGL scaling (previously, this was a boolean, and
didn't consider different modes).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1323 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2007-06-20 16:33:23 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
2014-04-28 16:47:10 +00:00
|
|
|
const FrameBuffer::VideoMode& FrameBuffer::getSavedVidMode(bool fullscreen)
|
Added 'WINDOWED_SUPPORT' compile-time argument, which can be used for
those systems which don't actually have a windowing environment. When
this is set, toggling from fullscreen will not be possible, and certain
window-related UI functions will not be accessible.
Completely revamped video subsystem. Windowed and fullscreen modes are
now dealt with separately. Windows can be zoomed using the 'zoom_ui'
and 'zoom_tia' arguments. Fullscreen modes are now set by resolution,
not zoom, so you can specify to always use a certain fullscreen
resolution, and the images will be scaled appropriately. This also
fixes the fullscreen issues on widescreen monitors; just select a
widescreen video mode, and the aspect ratio will always be correct.
Removed dirty-rect support for software rendering of the TIA image,
as it ended up being slower than just updating the entire image.
For those resolutions where it will start to slow down (1024x768 or
higher), one should be using OpenGL.
Fixed issue in Windows when returning from fullscreen mode made the
window constantly 'shrink' in size. It was related to auto-detecting
the desktop resolution, which is really the job of SDL. As such, all
further releases of Stella will require SDL 1.2.10, which includes
this auto-detection code internally.
Made ROM launcher resizable, configurable in sizes from 320x240
to 800x600. Updated the UIDialog to change these quantities from the
UI (Stella will need to be restarted for it to take effect).
Removed aspect ratio support, since it was causing problems, and the
new fullscreen mode work has made it obsolete. i *may* consider it
again in the future, if there's sufficient demand.
Added 'fullres' commandline argument, used to set the fullscreen
resolution.
Added 'launcherres' commandline argument, used to set the ROM
launcher resolution. This replaces 'launchersize' argument, which
has been removed.
Changed 'scale_ui' and 'scale_tia' to 'zoom_ui' and 'zoom_tia',
respectively. Their function remains the same.
Changed meaning of 'gl_fsmax' argument to specify what modes to use
fullscreen OpenGL scaling (previously, this was a boolean, and
didn't consider different modes).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1323 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2007-06-20 16:33:23 +00:00
|
|
|
{
|
2007-07-11 15:08:13 +00:00
|
|
|
EventHandler::State state = myOSystem->eventHandler().state();
|
|
|
|
|
2014-04-28 16:47:10 +00:00
|
|
|
if(fullscreen)
|
Added 'WINDOWED_SUPPORT' compile-time argument, which can be used for
those systems which don't actually have a windowing environment. When
this is set, toggling from fullscreen will not be possible, and certain
window-related UI functions will not be accessible.
Completely revamped video subsystem. Windowed and fullscreen modes are
now dealt with separately. Windows can be zoomed using the 'zoom_ui'
and 'zoom_tia' arguments. Fullscreen modes are now set by resolution,
not zoom, so you can specify to always use a certain fullscreen
resolution, and the images will be scaled appropriately. This also
fixes the fullscreen issues on widescreen monitors; just select a
widescreen video mode, and the aspect ratio will always be correct.
Removed dirty-rect support for software rendering of the TIA image,
as it ended up being slower than just updating the entire image.
For those resolutions where it will start to slow down (1024x768 or
higher), one should be using OpenGL.
Fixed issue in Windows when returning from fullscreen mode made the
window constantly 'shrink' in size. It was related to auto-detecting
the desktop resolution, which is really the job of SDL. As such, all
further releases of Stella will require SDL 1.2.10, which includes
this auto-detection code internally.
Made ROM launcher resizable, configurable in sizes from 320x240
to 800x600. Updated the UIDialog to change these quantities from the
UI (Stella will need to be restarted for it to take effect).
Removed aspect ratio support, since it was causing problems, and the
new fullscreen mode work has made it obsolete. i *may* consider it
again in the future, if there's sufficient demand.
Added 'fullres' commandline argument, used to set the fullscreen
resolution.
Added 'launcherres' commandline argument, used to set the ROM
launcher resolution. This replaces 'launchersize' argument, which
has been removed.
Changed 'scale_ui' and 'scale_tia' to 'zoom_ui' and 'zoom_tia',
respectively. Their function remains the same.
Changed meaning of 'gl_fsmax' argument to specify what modes to use
fullscreen OpenGL scaling (previously, this was a boolean, and
didn't consider different modes).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1323 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2007-06-20 16:33:23 +00:00
|
|
|
myCurrentModeList = &myFullscreenModeList;
|
2008-06-19 12:01:31 +00:00
|
|
|
else
|
|
|
|
myCurrentModeList = &myWindowedModeList;
|
|
|
|
|
|
|
|
// Now select the best resolution depending on the state
|
|
|
|
// UI modes (launcher and debugger) have only one supported resolution
|
|
|
|
// so the 'current' one is the only valid one
|
|
|
|
if(state == EventHandler::S_DEBUGGER || state == EventHandler::S_LAUNCHER)
|
2014-04-28 16:47:10 +00:00
|
|
|
myCurrentModeList->setZoom(1);
|
|
|
|
else
|
|
|
|
myCurrentModeList->setZoom(myOSystem->settings().getInt("tia.zoom"));
|
|
|
|
|
|
|
|
return myCurrentModeList->current();
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
//
|
|
|
|
// VideoMode implementation
|
|
|
|
//
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
FrameBuffer::VideoMode::VideoMode()
|
|
|
|
: fullscreen(false),
|
|
|
|
zoom(1),
|
|
|
|
description("")
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
FrameBuffer::VideoMode::VideoMode(uInt32 iw, uInt32 ih, uInt32 sw, uInt32 sh,
|
|
|
|
bool full, uInt32 z, const string& desc)
|
|
|
|
: fullscreen(full),
|
|
|
|
zoom(z),
|
|
|
|
description(desc)
|
|
|
|
{
|
|
|
|
sw = BSPF_max(sw, (uInt32)FrameBuffer::kTIAMinW);
|
|
|
|
sh = BSPF_max(sh, (uInt32)FrameBuffer::kTIAMinH);
|
|
|
|
iw = BSPF_min(iw, sw);
|
|
|
|
ih = BSPF_min(ih, sh);
|
|
|
|
int ix = (sw - iw) >> 1;
|
|
|
|
int iy = (sh - ih) >> 1;
|
|
|
|
image = GUI::Rect(ix, iy, ix+iw, iy+ih);
|
|
|
|
screen = GUI::Size(sw, sh);
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void FrameBuffer::VideoMode::applyAspectCorrection(uInt32 aspect, uInt32 stretch)
|
|
|
|
{
|
|
|
|
// Width is modified by aspect ratio; other factors may be applied below
|
|
|
|
uInt32 iw = (uInt32)(float(image.width() * aspect) / 100.0);
|
|
|
|
uInt32 ih = image.height();
|
|
|
|
|
|
|
|
if(stretch)
|
2008-06-19 12:01:31 +00:00
|
|
|
{
|
2014-04-28 16:47:10 +00:00
|
|
|
#if 0
|
|
|
|
// Fullscreen mode stretching
|
|
|
|
if(fullScreen() &&
|
|
|
|
(mode.image_w < mode.screen_w) && (mode.image_h < mode.screen_h))
|
|
|
|
{
|
|
|
|
float stretchFactor = 1.0;
|
|
|
|
float scaleX = float(mode.image_w) / mode.screen_w;
|
|
|
|
float scaleY = float(mode.image_h) / mode.screen_h;
|
|
|
|
|
|
|
|
// Scale to actual or integral factors
|
|
|
|
if(myOSystem->settings().getBool("gl_fsscale"))
|
|
|
|
{
|
|
|
|
// Scale to full (non-integral) available space
|
|
|
|
if(scaleX > scaleY)
|
|
|
|
stretchFactor = float(mode.screen_w) / mode.image_w;
|
|
|
|
else
|
|
|
|
stretchFactor = float(mode.screen_h) / mode.image_h;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// Only scale to an integral amount
|
|
|
|
if(scaleX > scaleY)
|
|
|
|
{
|
|
|
|
int bw = mode.image_w / mode.gfxmode.zoom;
|
|
|
|
stretchFactor = float(int(mode.screen_w / bw) * bw) / mode.image_w;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
int bh = mode.image_h / mode.gfxmode.zoom;
|
|
|
|
stretchFactor = float(int(mode.screen_h / bh) * bh) / mode.image_h;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
mode.image_w = (Uint16) (stretchFactor * mode.image_w);
|
|
|
|
mode.image_h = (Uint16) (stretchFactor * mode.image_h);
|
|
|
|
}
|
|
|
|
#endif
|
2008-07-04 14:27:17 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-04-28 16:47:10 +00:00
|
|
|
// In non-stretch mode, the screen size changes to match the image width
|
|
|
|
// Height is never modified in this mode
|
|
|
|
screen.w = iw;
|
2008-07-04 14:27:17 +00:00
|
|
|
}
|
|
|
|
|
2014-04-28 16:47:10 +00:00
|
|
|
// Now re-calculate the dimensions
|
|
|
|
iw = BSPF_min(iw, (uInt32)screen.w);
|
|
|
|
ih = BSPF_min(ih, (uInt32)screen.h);
|
|
|
|
|
|
|
|
image.moveTo((screen.w - iw) >> 1, (screen.h - ih) >> 1);
|
|
|
|
image.setWidth(iw);
|
|
|
|
image.setHeight(ih);
|
2008-07-04 14:27:17 +00:00
|
|
|
}
|
|
|
|
|
2014-04-28 16:47:10 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
//
|
|
|
|
// VideoModeList implementation
|
|
|
|
//
|
2008-07-04 14:27:17 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
FrameBuffer::VideoModeList::VideoModeList()
|
2009-06-05 14:05:23 +00:00
|
|
|
: myIdx(-1)
|
2008-07-04 14:27:17 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
FrameBuffer::VideoModeList::~VideoModeList()
|
|
|
|
{
|
|
|
|
clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
2014-04-28 16:47:10 +00:00
|
|
|
void FrameBuffer::VideoModeList::add(const VideoMode& mode)
|
2008-07-04 14:27:17 +00:00
|
|
|
{
|
|
|
|
myModeList.push_back(mode);
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void FrameBuffer::VideoModeList::clear()
|
|
|
|
{
|
|
|
|
myModeList.clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
bool FrameBuffer::VideoModeList::isEmpty() const
|
|
|
|
{
|
|
|
|
return myModeList.isEmpty();
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
uInt32 FrameBuffer::VideoModeList::size() const
|
|
|
|
{
|
|
|
|
return myModeList.size();
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
Reworked 'fullres' argument to also accept the 'auto' option. In this case,
fullscreen resolutions will be automatically chosen based on the required
size for the window. The image will be centered and keep the same aspect
ratio, however, so operation will still work correctly on widescreen
monitors. 'Auto' will be the new default. Otherwise, if a specific
resolution is requested, Stella will try to accomodate it *only* if it fits
into the resolution; otherwise the smallest resolution that fits will be
used.
Removed 'zoom_ui' and 'zoom_tia'. The UI can now only be at 1x mode.
Aded 'tia_filter' commandline argument, which specifies to the filter
to use when rendering the tia image. For now, these accept 'zoom1x',
'zoom2x'..., up to 'zoom10x', and duplicate previous behaviour. Eventually,
Scalexx and HQxx filters may be added. Still TODO is add this to the UI.
First pass at making the standard build use a minimum of zoom2x for the TIA,
so the UI can be larger and use a better looking font. There's still work
to do in this area, especially for those ports with limited hardware that
support zoom1x only.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1544 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2008-07-22 14:54:39 +00:00
|
|
|
void FrameBuffer::VideoModeList::previous()
|
2008-07-04 14:27:17 +00:00
|
|
|
{
|
|
|
|
--myIdx;
|
|
|
|
if(myIdx < 0) myIdx = myModeList.size() - 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
2014-04-28 16:47:10 +00:00
|
|
|
const FrameBuffer::VideoMode& FrameBuffer::VideoModeList::current() const
|
2008-07-04 14:27:17 +00:00
|
|
|
{
|
|
|
|
return myModeList[myIdx];
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
Reworked 'fullres' argument to also accept the 'auto' option. In this case,
fullscreen resolutions will be automatically chosen based on the required
size for the window. The image will be centered and keep the same aspect
ratio, however, so operation will still work correctly on widescreen
monitors. 'Auto' will be the new default. Otherwise, if a specific
resolution is requested, Stella will try to accomodate it *only* if it fits
into the resolution; otherwise the smallest resolution that fits will be
used.
Removed 'zoom_ui' and 'zoom_tia'. The UI can now only be at 1x mode.
Aded 'tia_filter' commandline argument, which specifies to the filter
to use when rendering the tia image. For now, these accept 'zoom1x',
'zoom2x'..., up to 'zoom10x', and duplicate previous behaviour. Eventually,
Scalexx and HQxx filters may be added. Still TODO is add this to the UI.
First pass at making the standard build use a minimum of zoom2x for the TIA,
so the UI can be larger and use a better looking font. There's still work
to do in this area, especially for those ports with limited hardware that
support zoom1x only.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1544 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2008-07-22 14:54:39 +00:00
|
|
|
void FrameBuffer::VideoModeList::next()
|
2008-07-04 14:27:17 +00:00
|
|
|
{
|
|
|
|
myIdx = (myIdx + 1) % myModeList.size();
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
2014-04-28 16:47:10 +00:00
|
|
|
void FrameBuffer::VideoModeList::setZoom(uInt32 zoom)
|
2008-07-04 14:27:17 +00:00
|
|
|
{
|
2014-04-28 16:47:10 +00:00
|
|
|
for(uInt32 i = 0; i < myModeList.size(); ++i)
|
2008-07-04 14:27:17 +00:00
|
|
|
{
|
2014-04-28 16:47:10 +00:00
|
|
|
if(myModeList[i].zoom == zoom)
|
2008-07-04 14:27:17 +00:00
|
|
|
{
|
|
|
|
myIdx = i;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
myIdx = 0;
|
|
|
|
}
|
|
|
|
|
2014-01-31 16:23:10 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
/*
|
|
|
|
Palette is defined as follows:
|
|
|
|
// Base colors
|
|
|
|
kColor Normal foreground color (non-text)
|
|
|
|
kBGColor Normal background color (non-text)
|
|
|
|
kShadowColor Item is disabled
|
|
|
|
kTextColor Normal text color
|
|
|
|
kTextColorHi Highlighted text color
|
|
|
|
kTextColorEm Emphasized text color
|
|
|
|
|
|
|
|
// UI elements (dialog and widgets)
|
|
|
|
kDlgColor Dialog background
|
|
|
|
kWidColor Widget background
|
|
|
|
kWidFrameColor Border for currently selected widget
|
|
|
|
|
|
|
|
// Button colors
|
|
|
|
kBtnColor Normal button background
|
|
|
|
kBtnColorHi Highlighted button background
|
|
|
|
kBtnTextColor Normal button font color
|
|
|
|
kBtnTextColorHi Highlighted button font color
|
|
|
|
|
|
|
|
// Checkbox colors
|
|
|
|
kCheckColor Color of 'X' in checkbox
|
|
|
|
|
|
|
|
// Scrollbar colors
|
|
|
|
kScrollColor Normal scrollbar color
|
|
|
|
kScrollColorHi Highlighted scrollbar color
|
|
|
|
|
|
|
|
// Debugger colors
|
|
|
|
kDbgChangedColor Background color for changed cells
|
|
|
|
kDbgChangedTextColor Text color for changed cells
|
|
|
|
kDbgColorHi Highlighted color in debugger data cells
|
|
|
|
*/
|
|
|
|
uInt32 FrameBuffer::ourGUIColors[kNumColors-256] = {
|
|
|
|
0x686868, 0x000000, 0x404040, 0x000000, 0x62a108, 0x9f0000,
|
|
|
|
0xc9af7c, 0xf0f0cf, 0xc80000,
|
|
|
|
0xac3410, 0xd55941, 0xffffff, 0xffd652,
|
|
|
|
0xac3410,
|
|
|
|
0xac3410, 0xd55941,
|
|
|
|
0xac3410, 0xd55941,
|
|
|
|
0xc80000, 0x00ff00, 0xc8c8ff
|
|
|
|
};
|