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
|
|
|
|
//
|
2007-01-01 18:04:56 +00:00
|
|
|
// Copyright (c) 1995-2007 by Bradford W. Mott and the Stella team
|
2003-09-25 16:20:34 +00:00
|
|
|
//
|
|
|
|
// See the file "license" for information on usage and redistribution of
|
|
|
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
|
|
|
//
|
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
|
|
|
// $Id: FrameBuffer.cxx,v 1.118 2007-06-20 16:33:22 stephena Exp $
|
2003-09-25 16:20:34 +00:00
|
|
|
//============================================================================
|
|
|
|
|
2003-09-30 01:22:45 +00:00
|
|
|
#include <sstream>
|
|
|
|
|
2003-09-25 16:20:34 +00:00
|
|
|
#include "bspf.hxx"
|
|
|
|
#include "Console.hxx"
|
2003-09-26 00:32:00 +00:00
|
|
|
#include "Event.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"
|
2003-09-25 16:20:34 +00:00
|
|
|
#include "Settings.hxx"
|
|
|
|
#include "MediaSrc.hxx"
|
2003-10-17 18:02:16 +00:00
|
|
|
#include "FrameBuffer.hxx"
|
2005-06-08 18:45:09 +00:00
|
|
|
#include "Font.hxx"
|
2005-03-13 03:38:41 +00:00
|
|
|
#include "GuiUtils.hxx"
|
2005-03-10 22:59:40 +00:00
|
|
|
#include "Menu.hxx"
|
2005-08-29 18:36:42 +00:00
|
|
|
#include "CommandMenu.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"
|
2005-02-21 02:23:57 +00:00
|
|
|
#include "OSystem.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),
|
2006-01-11 13:25:20 +00:00
|
|
|
myScreen(0),
|
|
|
|
theRedrawTIAIndicator(true),
|
2006-01-10 20:37:00 +00:00
|
|
|
myUsePhosphor(false),
|
|
|
|
myPhosphorBlend(77),
|
2007-01-30 17:13:10 +00:00
|
|
|
myInitializedCount(0),
|
|
|
|
myPausedCount(0)
|
2003-09-25 16:20:34 +00:00
|
|
|
{
|
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)
|
|
|
|
{
|
|
|
|
}
|
2003-09-26 22:39:36 +00:00
|
|
|
|
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
|
|
|
void FrameBuffer::initialize(const string& title, uInt32 width, uInt32 height)
|
2003-10-17 18:02:16 +00:00
|
|
|
{
|
2005-02-22 18:41:16 +00:00
|
|
|
// Now (re)initialize the SDL video system
|
2006-12-03 01:13:45 +00:00
|
|
|
// These things only have to be done one per FrameBuffer creation
|
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(SDL_WasInit(SDL_INIT_VIDEO) == 0)
|
|
|
|
if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) < 0)
|
2005-02-22 18:41:16 +00:00
|
|
|
return;
|
|
|
|
|
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++;
|
2006-12-03 01:24:34 +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
|
|
|
myBaseDim.x = myBaseDim.y = 0;
|
|
|
|
myBaseDim.w = (uInt16) width;
|
|
|
|
myBaseDim.h = (uInt16) height;
|
2006-12-03 01:24:34 +00:00
|
|
|
|
|
|
|
// Set fullscreen flag
|
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
|
2006-12-03 01:24:34 +00:00
|
|
|
mySDLFlags = myOSystem->settings().getBool("fullscreen") ? SDL_FULLSCREEN : 0;
|
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
|
|
|
#else
|
|
|
|
mySDLFlags = 0;
|
|
|
|
#endif
|
2006-12-03 01:24:34 +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
|
|
|
// Set the available video modes for this framebuffer
|
|
|
|
setAvailableVidModes();
|
2005-04-29 19:05:06 +00:00
|
|
|
|
2005-02-21 02:23:57 +00:00
|
|
|
// Initialize video subsystem
|
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
|
|
|
VideoMode mode = getSavedVidMode();
|
|
|
|
initSubsystem(mode);
|
2005-05-12 18:45:21 +00:00
|
|
|
|
2006-12-03 01:24:34 +00:00
|
|
|
// Set window title and icon
|
|
|
|
setWindowTitle(title);
|
|
|
|
setWindowIcon();
|
|
|
|
|
2006-03-18 00:00:30 +00:00
|
|
|
// And refresh the display
|
|
|
|
myOSystem->eventHandler().refreshDisplay();
|
|
|
|
|
2005-06-07 21:22:39 +00:00
|
|
|
// Enable unicode so we can see translated key events
|
|
|
|
// (lowercase vs. uppercase characters)
|
|
|
|
SDL_EnableUNICODE(1);
|
|
|
|
|
2005-05-12 18:45:21 +00:00
|
|
|
// Erase any messages from a previous run
|
2006-03-19 18:17:48 +00:00
|
|
|
myMessage.counter = 0;
|
2006-12-11 00:15:34 +00:00
|
|
|
|
|
|
|
// Finally, show some information about the framebuffer,
|
|
|
|
// but only on the first initialization
|
|
|
|
if(myInitializedCount == 1 && myOSystem->settings().getBool("showinfo"))
|
|
|
|
cout << about() << endl;
|
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()
|
|
|
|
{
|
|
|
|
// Do any pre-frame stuff
|
|
|
|
preFrameUpdate();
|
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
|
|
|
|
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
|
|
|
|
myOSystem->console().mediaSource().update();
|
|
|
|
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
|
|
|
|
drawMediaSource();
|
2003-09-25 16:20:34 +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
|
|
|
|
if(theRedrawTIAIndicator)
|
|
|
|
drawMediaSource();
|
|
|
|
|
|
|
|
// 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
|
|
|
{
|
2005-05-28 17:25:41 +00:00
|
|
|
// Only update the screen if it's been invalidated
|
2005-06-23 14:33:12 +00:00
|
|
|
if(theRedrawTIAIndicator)
|
2005-02-27 23:41:19 +00:00
|
|
|
drawMediaSource();
|
|
|
|
|
2005-08-11 19:12:39 +00:00
|
|
|
myOSystem->menu().draw();
|
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:
|
|
|
|
{
|
|
|
|
// Only update the screen if it's been invalidated
|
|
|
|
if(theRedrawTIAIndicator)
|
|
|
|
drawMediaSource();
|
|
|
|
|
|
|
|
myOSystem->commandMenu().draw();
|
|
|
|
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:
|
|
|
|
{
|
2005-08-11 19:12:39 +00:00
|
|
|
myOSystem->launcher().draw();
|
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
|
|
|
{
|
2005-08-11 19:12:39 +00:00
|
|
|
myOSystem->debugger().draw();
|
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;
|
|
|
|
break;
|
2003-10-26 19:40:39 +00:00
|
|
|
}
|
|
|
|
|
2006-12-18 12:53:33 +00:00
|
|
|
// Draw any pending messages
|
|
|
|
if(myMessage.counter > 0)
|
|
|
|
drawMessage();
|
|
|
|
|
2003-10-26 19:40:39 +00:00
|
|
|
// Do any post-frame stuff
|
|
|
|
postFrameUpdate();
|
2005-07-20 17:33:03 +00:00
|
|
|
|
|
|
|
// The frame doesn't need to be completely redrawn anymore
|
2005-08-11 19:12:39 +00:00
|
|
|
theRedrawTIAIndicator = 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,
|
2006-03-25 00:34:17 +00:00
|
|
|
int color)
|
2005-03-13 03:38:41 +00:00
|
|
|
{
|
2005-07-20 18:44:38 +00:00
|
|
|
// Erase old messages on the screen
|
2006-03-19 18:17:48 +00:00
|
|
|
if(myMessage.counter > 0)
|
2005-07-20 18:44:38 +00:00
|
|
|
{
|
|
|
|
theRedrawTIAIndicator = true;
|
2006-03-15 23:14:01 +00:00
|
|
|
myOSystem->eventHandler().refreshDisplay();
|
2005-07-20 18:44:38 +00:00
|
|
|
}
|
|
|
|
|
2006-03-19 18:17:48 +00:00
|
|
|
// Precompute the message coordinates
|
|
|
|
myMessage.text = message;
|
2007-01-06 16:28:38 +00:00
|
|
|
myMessage.counter = myOSystem->frameRate() << 1; // Show message for 2 seconds
|
2006-03-19 18:17:48 +00:00
|
|
|
myMessage.color = color;
|
|
|
|
|
|
|
|
myMessage.w = myOSystem->font().getStringWidth(myMessage.text) + 10;
|
|
|
|
myMessage.h = myOSystem->font().getFontHeight() + 8;
|
|
|
|
|
|
|
|
switch(position)
|
|
|
|
{
|
|
|
|
case kTopLeft:
|
|
|
|
myMessage.x = 5;
|
|
|
|
myMessage.y = 5;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kTopCenter:
|
|
|
|
myMessage.x = (myBaseDim.w >> 1) - (myMessage.w >> 1);
|
|
|
|
myMessage.y = 5;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kTopRight:
|
|
|
|
myMessage.x = myBaseDim.w - myMessage.w - 5;
|
|
|
|
myMessage.y = 5;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kMiddleLeft:
|
|
|
|
myMessage.x = 5;
|
|
|
|
myMessage.y = (myBaseDim.h >> 1) - (myMessage.h >> 1);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kMiddleCenter:
|
|
|
|
myMessage.x = (myBaseDim.w >> 1) - (myMessage.w >> 1);
|
|
|
|
myMessage.y = (myBaseDim.h >> 1) - (myMessage.h >> 1);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kMiddleRight:
|
|
|
|
myMessage.x = myBaseDim.w - myMessage.w - 5;
|
|
|
|
myMessage.y = (myBaseDim.h >> 1) - (myMessage.h >> 1);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kBottomLeft:
|
|
|
|
myMessage.x = 5;//(myMessage.w >> 1);
|
|
|
|
myMessage.y = myBaseDim.h - myMessage.h - 5;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kBottomCenter:
|
|
|
|
myMessage.x = (myBaseDim.w >> 1) - (myMessage.w >> 1);
|
|
|
|
myMessage.y = myBaseDim.h - myMessage.h - 5;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kBottomRight:
|
|
|
|
myMessage.x = myBaseDim.w - myMessage.w - 5;
|
|
|
|
myMessage.y = myBaseDim.h - myMessage.h - 5;
|
|
|
|
break;
|
|
|
|
}
|
2005-03-13 03:38:41 +00:00
|
|
|
}
|
|
|
|
|
2005-08-29 18:36:42 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void FrameBuffer::hideMessage()
|
|
|
|
{
|
|
|
|
// Erase old messages on the screen
|
2006-03-19 18:17:48 +00:00
|
|
|
if(myMessage.counter > 0)
|
2006-05-24 17:37:33 +00:00
|
|
|
{
|
|
|
|
myMessage.counter = 0;
|
2006-11-11 20:20:16 +00:00
|
|
|
myOSystem->eventHandler().refreshDisplay(true); // Do this twice for
|
|
|
|
myOSystem->eventHandler().refreshDisplay(true); // double-buffered modes
|
2006-05-24 17:37:33 +00:00
|
|
|
}
|
2005-08-29 18:36:42 +00:00
|
|
|
}
|
|
|
|
|
2006-03-18 00:00:30 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
inline void FrameBuffer::drawMessage()
|
|
|
|
{
|
|
|
|
// Draw the bounded box and text
|
2006-03-19 18:17:48 +00:00
|
|
|
fillRect(myMessage.x+1, myMessage.y+2, myMessage.w-2, myMessage.h-4, kBGColor);
|
|
|
|
box(myMessage.x, myMessage.y+1, myMessage.w, myMessage.h-2, kColor, kColor);
|
|
|
|
drawString(&myOSystem->font(), myMessage.text, myMessage.x+1, myMessage.y+4,
|
|
|
|
myMessage.w, myMessage.color, kTextAlignCenter);
|
|
|
|
myMessage.counter--;
|
2006-03-18 00:00:30 +00:00
|
|
|
|
|
|
|
// Either erase the entire message (when time is reached),
|
|
|
|
// or show again this frame
|
Some configure work:
- removed TEXTURES_ARE_DIRTY logic, and just recreate the GL textures
when a screenmode changes
- enable checking for machine type and if nasm is available
- logic to enable scaler mode only when in OpenGL mode (still not complete
and defaults to off)
First pass at adding scaler code to OpenGL. Still much work TODO,
but the C version is working correctly (asm is causing crashes,
haven't figured out why). GL quad coordinates aren't properly
set yet, so the image always appears in the upper left corner, and
is not scaled to the window size. CPU usage is also quite high,
but I'm on a 1GHz laptop with i950 GL, so that may explain it.
Fixed long-standing bug in software rendering, where switching to a
lower-res screen while a message is being displayed would cause a
segfault.
Large refactoring of mainSDL. Specifically, OSystem now owns all
the subsystems except for Settings, taking responsibility for creating
and destroying them.
Properties fixes for 'Tomarc the Barbarian' and 'Gyruss'.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1136 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-10-22 18:58:46 +00:00
|
|
|
if(myMessage.counter == 0) // Force an immediate update
|
2006-03-18 00:00:30 +00:00
|
|
|
myOSystem->eventHandler().refreshDisplay(true);
|
|
|
|
else
|
2006-08-11 12:50:22 +00:00
|
|
|
addDirtyRect(myMessage.x, myMessage.y, myMessage.w, myMessage.h);
|
2006-03-18 00:00:30 +00:00
|
|
|
}
|
|
|
|
|
2006-05-15 12:24:09 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void FrameBuffer::refresh()
|
|
|
|
{
|
|
|
|
theRedrawTIAIndicator = 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
|
|
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-06-23 14:33:12 +00:00
|
|
|
theRedrawTIAIndicator = 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
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void FrameBuffer::setUIPalette(const uInt32* palette)
|
|
|
|
{
|
|
|
|
// Set palette for GUI
|
|
|
|
for(int i = 0; i < kNumColors-256; ++i)
|
|
|
|
{
|
|
|
|
Uint8 r = (palette[i] >> 16) & 0xff;
|
|
|
|
Uint8 g = (palette[i] >> 8) & 0xff;
|
|
|
|
Uint8 b = palette[i] & 0xff;
|
|
|
|
myDefPalette[i+256] = mapRGB(r, g, b);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-10-26 19:40:39 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
2005-05-01 20:11:07 +00:00
|
|
|
void FrameBuffer::toggleFullscreen()
|
2003-10-26 19:40:39 +00:00
|
|
|
{
|
2005-05-01 20:11:07 +00:00
|
|
|
setFullscreen(!myOSystem->settings().getBool("fullscreen"));
|
|
|
|
}
|
2003-10-26 19:40:39 +00:00
|
|
|
|
2005-05-01 20:11:07 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void FrameBuffer::setFullscreen(bool enable)
|
|
|
|
{
|
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
|
2005-03-28 00:04:54 +00:00
|
|
|
// Update the settings
|
2005-05-01 20:11:07 +00:00
|
|
|
myOSystem->settings().setBool("fullscreen", enable);
|
|
|
|
if(enable)
|
2005-03-28 00:04:54 +00:00
|
|
|
mySDLFlags |= SDL_FULLSCREEN;
|
|
|
|
else
|
|
|
|
mySDLFlags &= ~SDL_FULLSCREEN;
|
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
|
2005-03-28 00:04:54 +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
|
|
|
bool FrameBuffer::changeVidMode(int direction)
|
2005-03-28 00:04:54 +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
|
|
|
VideoMode oldmode = myCurrentModeList->current();
|
|
|
|
if(direction == +1)
|
|
|
|
myCurrentModeList->next();
|
|
|
|
else if(direction == -1)
|
|
|
|
myCurrentModeList->previous();
|
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
|
|
|
VideoMode newmode = myCurrentModeList->current();
|
|
|
|
if(!setVidMode(newmode))
|
|
|
|
return false;
|
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
|
|
|
myOSystem->eventHandler().refreshDisplay();
|
|
|
|
setCursorState();
|
|
|
|
showMessage(newmode.name);
|
|
|
|
|
|
|
|
// Determine which mode we're in, and save to the appropriate setting
|
|
|
|
if(fullScreen())
|
|
|
|
{
|
|
|
|
myOSystem->settings().setSize("fullres", newmode.screen_w, newmode.screen_h);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
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
|
|
|
EventHandler::State state = myOSystem->eventHandler().state();
|
|
|
|
bool inTIAMode = (state == EventHandler::S_EMULATE ||
|
2007-01-30 17:13:10 +00:00
|
|
|
state == EventHandler::S_PAUSE ||
|
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
|
|
|
state == EventHandler::S_MENU ||
|
|
|
|
state == EventHandler::S_CMDMENU);
|
2005-05-01 20:11:07 +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
|
|
|
if(inTIAMode)
|
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
|
|
|
myOSystem->settings().setInt("zoom_tia", newmode.zoom);
|
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
|
|
|
else
|
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
|
|
|
myOSystem->settings().setInt("zoom_ui", newmode.zoom);
|
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
|
|
|
|
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
|
|
|
return true;
|
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
|
|
|
/*
|
|
|
|
cerr << "New mode:" << endl
|
|
|
|
<< " screen w = " << newmode.screen_w << endl
|
|
|
|
<< " screen h = " << newmode.screen_h << endl
|
|
|
|
<< " image x = " << newmode.image_x << endl
|
|
|
|
<< " image y = " << newmode.image_y << endl
|
|
|
|
<< " image w = " << newmode.image_w << endl
|
|
|
|
<< " image h = " << newmode.image_h << endl
|
|
|
|
<< " zoom = " << newmode.zoom << endl
|
|
|
|
<< " name = " << newmode.name << endl
|
|
|
|
<< endl;
|
|
|
|
*/
|
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
|
|
|
{
|
2005-03-28 00:04:54 +00:00
|
|
|
bool isFullscreen = myOSystem->settings().getBool("fullscreen");
|
2005-05-06 22:50:15 +00:00
|
|
|
|
2005-03-28 00:04:54 +00:00
|
|
|
if(isFullscreen)
|
|
|
|
grabMouse(true);
|
2005-05-06 22:50:15 +00:00
|
|
|
else
|
|
|
|
grabMouse(myOSystem->settings().getBool("grabmouse"));
|
2003-10-26 19:40:39 +00:00
|
|
|
|
2005-03-28 00:04:54 +00:00
|
|
|
switch(myOSystem->eventHandler().state())
|
|
|
|
{
|
|
|
|
case EventHandler::S_EMULATE:
|
2007-01-30 17:13:10 +00:00
|
|
|
case EventHandler::S_PAUSE:
|
2005-05-06 22:50:15 +00:00
|
|
|
showCursor(false);
|
2005-03-28 00:04:54 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
showCursor(true);
|
|
|
|
}
|
2003-10-01 19:01:02 +00:00
|
|
|
}
|
|
|
|
|
2003-09-26 17:35:05 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
2005-03-28 00:04:54 +00:00
|
|
|
void FrameBuffer::showCursor(bool show)
|
2003-09-26 17:35:05 +00:00
|
|
|
{
|
2005-03-28 00:04:54 +00:00
|
|
|
if(show)
|
|
|
|
SDL_ShowCursor(SDL_ENABLE);
|
|
|
|
else
|
|
|
|
SDL_ShowCursor(SDL_DISABLE);
|
|
|
|
}
|
2003-09-26 22:39:36 +00:00
|
|
|
|
2005-03-28 00:04:54 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void FrameBuffer::grabMouse(bool grab)
|
|
|
|
{
|
|
|
|
if(grab)
|
|
|
|
SDL_WM_GrabInput(SDL_GRAB_ON);
|
|
|
|
else
|
|
|
|
SDL_WM_GrabInput(SDL_GRAB_OFF);
|
|
|
|
}
|
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-03-28 00:04:54 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
bool FrameBuffer::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
|
|
|
#ifdef WINDOWED_SUPPORT
|
|
|
|
return myOSystem->settings().getBool("fullscreen");
|
|
|
|
#else
|
|
|
|
return true;
|
|
|
|
#endif
|
2005-03-28 00:04:54 +00:00
|
|
|
}
|
2003-09-26 22:39:36 +00:00
|
|
|
|
2005-03-28 00:04:54 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void FrameBuffer::setWindowTitle(const string& title)
|
|
|
|
{
|
|
|
|
SDL_WM_SetCaption(title.c_str(), "stella");
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void FrameBuffer::setWindowIcon()
|
|
|
|
{
|
|
|
|
#ifndef MAC_OSX
|
2006-03-06 15:42:27 +00:00
|
|
|
#include "stella.xpm" // The Stella icon
|
|
|
|
|
2005-03-28 00:04:54 +00:00
|
|
|
// Set the window icon
|
|
|
|
uInt32 w, h, ncols, nbytes;
|
|
|
|
uInt32 rgba[256], icon[32 * 32];
|
|
|
|
uInt8 mask[32][4];
|
|
|
|
|
|
|
|
sscanf(stella_icon[0], "%d %d %d %d", &w, &h, &ncols, &nbytes);
|
|
|
|
if((w != 32) || (h != 32) || (ncols > 255) || (nbytes > 1))
|
|
|
|
{
|
|
|
|
cerr << "ERROR: Couldn't load the icon.\n";
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
for(uInt32 i = 0; i < ncols; i++)
|
|
|
|
{
|
|
|
|
unsigned char code;
|
|
|
|
char color[32];
|
|
|
|
uInt32 col;
|
|
|
|
|
|
|
|
sscanf(stella_icon[1 + i], "%c c %s", &code, color);
|
|
|
|
if(!strcmp(color, "None"))
|
|
|
|
col = 0x00000000;
|
|
|
|
else if(!strcmp(color, "black"))
|
|
|
|
col = 0xFF000000;
|
|
|
|
else if (color[0] == '#')
|
|
|
|
{
|
|
|
|
sscanf(color + 1, "%06x", &col);
|
|
|
|
col |= 0xFF000000;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
cerr << "ERROR: Couldn't load the icon.\n";
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
rgba[code] = col;
|
|
|
|
}
|
|
|
|
|
|
|
|
memset(mask, 0, sizeof(mask));
|
|
|
|
for(h = 0; h < 32; h++)
|
|
|
|
{
|
|
|
|
const char* line = stella_icon[1 + ncols + h];
|
|
|
|
for(w = 0; w < 32; w++)
|
|
|
|
{
|
|
|
|
icon[w + 32 * h] = rgba[(int)line[w]];
|
|
|
|
if(rgba[(int)line[w]] & 0xFF000000)
|
|
|
|
mask[h][w >> 3] |= 1 << (7 - (w & 0x07));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SDL_Surface *surface = SDL_CreateRGBSurfaceFrom(icon, 32, 32, 32,
|
|
|
|
32 * 4, 0xFF0000, 0x00FF00, 0x0000FF, 0xFF000000);
|
|
|
|
SDL_WM_SetIcon(surface, (unsigned char *) mask);
|
|
|
|
SDL_FreeSurface(surface);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void FrameBuffer::box(uInt32 x, uInt32 y, uInt32 w, uInt32 h,
|
2006-03-25 00:34:17 +00:00
|
|
|
int colorA, int colorB)
|
2005-03-28 00:04:54 +00:00
|
|
|
{
|
|
|
|
hLine(x + 1, y, x + w - 2, colorA);
|
|
|
|
hLine(x, y + 1, x + w - 1, colorA);
|
|
|
|
vLine(x, y + 1, y + h - 2, colorA);
|
|
|
|
vLine(x + 1, y, y + h - 1, colorA);
|
|
|
|
|
|
|
|
hLine(x + 1, y + h - 2, x + w - 1, colorB);
|
|
|
|
hLine(x + 1, y + h - 1, x + w - 2, colorB);
|
|
|
|
vLine(x + w - 1, y + 1, y + h - 2, colorB);
|
|
|
|
vLine(x + w - 2, y + 1, y + h - 1, colorB);
|
|
|
|
}
|
|
|
|
|
2005-04-04 02:19:22 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void FrameBuffer::frameRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h,
|
2006-03-25 00:34:17 +00:00
|
|
|
int color, FrameStyle style)
|
2005-04-04 02:19:22 +00:00
|
|
|
{
|
2005-06-25 16:35:36 +00:00
|
|
|
switch(style)
|
|
|
|
{
|
|
|
|
case kSolidLine:
|
|
|
|
hLine(x, y, x + w - 1, color);
|
|
|
|
hLine(x, y + h - 1, x + w - 1, color);
|
|
|
|
vLine(x, y, y + h - 1, color);
|
|
|
|
vLine(x + w - 1, y, y + h - 1, color);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kDashLine:
|
Huge GUI-related changes. The GUI in launcher/options/command modes
is now fully navigable via the keyboard be means of 'tab-like'
functionality. This means that eventually systems without a keyboard
will also be able to navigate the interface without resorting to the
buggy joymouse code (which is soon to be removed).
Laid the infrastructure for remapping GUI events, whereby (for example)
a widget checks for Event::UISelect for 'doing its thing', vs. looking
at the Enter/Return key. So widgets now respond to events, and events
can (eventually) be remapped to *any* device.
Currently, these UI events are as follows:
UIUp, UIDown, UILeft, UIRight, UIHome, UIEnd, UIPgUp, UIPgDown,
UIPrevDir, UINavNext, UINavPrev, UITabNext, UITabPrev, UISelect
At present, they're hardcoded to key events only, so pressing 'Return'
will send a UISelect, cursor up a UIUp, etc. When the remapping code
is complete, *any* input will be able to send these events, and that
remapping will be distinct from emulation mode. So, for example,
cursor up in GUI mode might generate a UIUp event, but in emulation
mode might generate a left joystick up event.
Modified 'tab' key while in emulation mode to only enter the options
menu. Once inside the menu, the tab key acts as navigation between
elements, and exiting the options menu requires navigating to the
'Exit menu' button.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1100 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-05-04 17:45:25 +00:00
|
|
|
unsigned int i, skip, lwidth = 0;
|
2005-06-25 16:35:36 +00:00
|
|
|
|
|
|
|
for(i = x, skip = 1; i < x+w-1; i=i+lwidth+1, ++skip)
|
|
|
|
{
|
|
|
|
if(skip % 2)
|
|
|
|
{
|
|
|
|
hLine(i, y, i + lwidth, color);
|
|
|
|
hLine(i, y + h - 1, i + lwidth, color);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for(i = y, skip = 1; i < y+h-1; i=i+lwidth+1, ++skip)
|
|
|
|
{
|
|
|
|
if(skip % 2)
|
|
|
|
{
|
|
|
|
vLine(x, i, i + lwidth, color);
|
|
|
|
vLine(x + w - 1, i, i + lwidth, color);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2005-04-04 02:19:22 +00:00
|
|
|
}
|
2005-06-08 18:45:09 +00:00
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
2005-06-14 01:11:48 +00:00
|
|
|
void FrameBuffer::drawString(const GUI::Font* font, const string& s,
|
2005-06-08 18:45:09 +00:00
|
|
|
int x, int y, int w,
|
2006-03-25 00:34:17 +00:00
|
|
|
int color, TextAlignment align,
|
2005-06-08 18:45:09 +00:00
|
|
|
int deltax, bool useEllipsis)
|
|
|
|
{
|
|
|
|
const int leftX = x, rightX = x + w;
|
|
|
|
unsigned int i;
|
2005-06-14 01:11:48 +00:00
|
|
|
int width = font->getStringWidth(s);
|
2005-06-08 18:45:09 +00:00
|
|
|
string str;
|
|
|
|
|
|
|
|
if(useEllipsis && width > w)
|
|
|
|
{
|
|
|
|
// String is too wide. So we shorten it "intelligently", by replacing
|
|
|
|
// parts of it by an ellipsis ("..."). There are three possibilities
|
|
|
|
// for this: replace the start, the end, or the middle of the string.
|
|
|
|
// What is best really depends on the context; but unless we want to
|
|
|
|
// make this configurable, replacing the middle probably is a good
|
|
|
|
// compromise.
|
2005-06-14 01:11:48 +00:00
|
|
|
const int ellipsisWidth = font->getStringWidth("...");
|
2005-06-08 18:45:09 +00:00
|
|
|
|
|
|
|
// SLOW algorithm to remove enough of the middle. But it is good enough for now.
|
|
|
|
const int halfWidth = (w - ellipsisWidth) / 2;
|
|
|
|
int w2 = 0;
|
|
|
|
|
|
|
|
for(i = 0; i < s.size(); ++i)
|
|
|
|
{
|
2005-06-14 01:11:48 +00:00
|
|
|
int charWidth = font->getCharWidth(s[i]);
|
2005-06-08 18:45:09 +00:00
|
|
|
if(w2 + charWidth > halfWidth)
|
|
|
|
break;
|
|
|
|
|
|
|
|
w2 += charWidth;
|
|
|
|
str += s[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
// At this point we know that the first 'i' chars are together 'w2'
|
|
|
|
// pixels wide. We took the first i-1, and add "..." to them.
|
|
|
|
str += "...";
|
|
|
|
|
|
|
|
// The original string is width wide. Of those we already skipped past
|
|
|
|
// w2 pixels, which means (width - w2) remain.
|
|
|
|
// The new str is (w2+ellipsisWidth) wide, so we can accomodate about
|
|
|
|
// (w - (w2+ellipsisWidth)) more pixels.
|
|
|
|
// Thus we skip ((width - w2) - (w - (w2+ellipsisWidth))) =
|
|
|
|
// (width + ellipsisWidth - w)
|
|
|
|
int skip = width + ellipsisWidth - w;
|
|
|
|
for(; i < s.size() && skip > 0; ++i)
|
2005-06-14 01:11:48 +00:00
|
|
|
skip -= font->getCharWidth(s[i]);
|
2005-06-08 18:45:09 +00:00
|
|
|
|
|
|
|
// Append the remaining chars, if any
|
|
|
|
for(; i < s.size(); ++i)
|
|
|
|
str += s[i];
|
|
|
|
|
2005-06-14 01:11:48 +00:00
|
|
|
width = font->getStringWidth(str);
|
2005-06-08 18:45:09 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
str = s;
|
|
|
|
|
|
|
|
if(align == kTextAlignCenter)
|
|
|
|
x = x + (w - width - 1)/2;
|
|
|
|
else if(align == kTextAlignRight)
|
|
|
|
x = x + w - width;
|
|
|
|
|
|
|
|
x += deltax;
|
|
|
|
for(i = 0; i < str.size(); ++i)
|
|
|
|
{
|
2005-06-14 01:11:48 +00:00
|
|
|
w = font->getCharWidth(str[i]);
|
2005-06-08 18:45:09 +00:00
|
|
|
if(x+w > rightX)
|
|
|
|
break;
|
|
|
|
if(x >= leftX)
|
|
|
|
drawChar(font, str[i], x, y, color);
|
|
|
|
|
|
|
|
x += w;
|
|
|
|
}
|
|
|
|
}
|
2005-07-02 01:28:43 +00:00
|
|
|
|
2006-01-10 02:09:34 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
uInt8 FrameBuffer::getPhosphor(uInt8 c1, uInt8 c2)
|
|
|
|
{
|
|
|
|
if(c2 > c1)
|
|
|
|
SWAP(c1, c2);
|
|
|
|
|
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
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
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 FrameBuffer::maxWindowSizeForScreen(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
|
|
|
|
uInt32 width = myBaseDim.w * 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
|
|
|
uInt32 height = myBaseDim.h * multiplier;
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
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
|
|
|
void FrameBuffer::setAvailableVidModes()
|
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
|
|
|
// First we look at windowed modes
|
|
|
|
// These can be sized exactly as required, since there's normally no
|
|
|
|
// restriction on window size (up the maximum size)
|
|
|
|
myWindowedModeList.clear();
|
|
|
|
int max_zoom = maxWindowSizeForScreen(myOSystem->desktopWidth(),
|
|
|
|
myOSystem->desktopHeight());
|
|
|
|
for(int i = 1; i <= max_zoom; ++i)
|
|
|
|
{
|
|
|
|
VideoMode m;
|
|
|
|
m.image_x = m.image_y = 0;
|
|
|
|
m.image_w = m.screen_w = myBaseDim.w * i;
|
|
|
|
m.image_h = m.screen_h = myBaseDim.h * i;
|
|
|
|
m.zoom = i;
|
|
|
|
ostringstream buf;
|
|
|
|
buf << "Zoom " << i << "x";
|
|
|
|
m.name = buf.str();
|
|
|
|
|
|
|
|
myWindowedModeList.add(m);
|
|
|
|
}
|
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
|
|
|
// Now consider the fullscreen modes
|
|
|
|
// There are often stricter requirements on these, and they're normally
|
|
|
|
// different depending on the OSystem in use
|
|
|
|
// As well, we usually can't get fullscreen modes in the exact size
|
|
|
|
// we want, so we need to calculate image offsets
|
|
|
|
myFullscreenModeList.clear();
|
|
|
|
const ResolutionList& res = myOSystem->supportedResolutions();
|
|
|
|
for(unsigned int i = 0; i < res.size(); ++i)
|
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
|
|
|
VideoMode m;
|
|
|
|
m.screen_w = res[i].width;
|
|
|
|
m.screen_h = res[i].height;
|
|
|
|
m.zoom = maxWindowSizeForScreen(m.screen_w, m.screen_h);
|
|
|
|
m.name = res[i].name;
|
|
|
|
|
|
|
|
// Auto-calculate 'smart' centering; platform-specific framebuffers are
|
|
|
|
// free to ignore or augment it
|
|
|
|
m.image_w = myBaseDim.w * m.zoom;
|
|
|
|
m.image_h = myBaseDim.h * m.zoom;
|
|
|
|
m.image_x = (m.screen_w - m.image_w) / 2;
|
|
|
|
m.image_y = (m.screen_h - m.image_h) / 2;
|
|
|
|
|
|
|
|
/*
|
|
|
|
cerr << "Fullscreen modes:" << endl
|
|
|
|
<< " Mode " << i << endl
|
|
|
|
<< " screen w = " << m.screen_w << endl
|
|
|
|
<< " screen h = " << m.screen_h << endl
|
|
|
|
<< " image x = " << m.image_x << endl
|
|
|
|
<< " image y = " << m.image_y << endl
|
|
|
|
<< " image w = " << m.image_w << endl
|
|
|
|
<< " image h = " << m.image_h << endl
|
|
|
|
<< " zoom = " << m.zoom << endl
|
|
|
|
<< endl;
|
|
|
|
*/
|
|
|
|
myFullscreenModeList.add(m);
|
2006-11-18 13:29:12 +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
|
|
|
}
|
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
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
VideoMode FrameBuffer::getSavedVidMode()
|
|
|
|
{
|
|
|
|
if(myOSystem->settings().getBool("fullscreen"))
|
2006-11-18 13:29:12 +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
|
|
|
// Point the modelist to fullscreen modes, and set the iterator to
|
|
|
|
// the mode closest to the given resolution
|
|
|
|
int w = -1, h = -1;
|
|
|
|
myOSystem->settings().getSize("fullres", w, h);
|
|
|
|
if(w < 0 || h < 0)
|
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
|
|
|
w = myOSystem->desktopWidth();
|
|
|
|
h = myOSystem->desktopHeight();
|
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
|
|
|
myCurrentModeList = &myFullscreenModeList;
|
|
|
|
myCurrentModeList->setByResolution(w, h);
|
2006-11-18 13:29:12 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
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
|
|
|
// Point the modelist to windowed modes, and set the iterator to
|
|
|
|
// the mode closest to the given zoom level
|
|
|
|
EventHandler::State state = myOSystem->eventHandler().state();
|
|
|
|
bool inTIAMode = (state == EventHandler::S_EMULATE ||
|
|
|
|
state == EventHandler::S_PAUSE ||
|
|
|
|
state == EventHandler::S_MENU ||
|
|
|
|
state == EventHandler::S_CMDMENU);
|
|
|
|
int zoom = (inTIAMode ? myOSystem->settings().getInt("zoom_tia") :
|
|
|
|
myOSystem->settings().getInt("zoom_ui") );
|
|
|
|
|
|
|
|
myCurrentModeList = &myWindowedModeList;
|
|
|
|
myCurrentModeList->setByZoom(zoom);
|
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
|
|
|
return myCurrentModeList->current();
|
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
|
|
|
}
|