Some more code pruning. Basically, all classname references to OpenGL

have been changed to 'SDL2'.  From this point on, the OpenGL-specific
code will be removed, and replaced by SDL2-specific hardware-accelerated
code.

Cleaned up (mostly) the API of FrameBuffer vs FrameBufferSDL2.  Since the
FrameBuffer class is an emucore object, it should have no knowledge of SDL,
or any particular rendering toolkit for that matter (just in case we want
to move to SDL3 eventually :) ).

At this point, all checks for OpenGL have been removed, so if you don't
have it on your system, Stella will fail to compile and/or run.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2832 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2013-09-28 00:51:10 +00:00
parent 40f9da7839
commit 9137b93c80
18 changed files with 424 additions and 513 deletions

64
configure vendored
View File

@ -14,12 +14,10 @@
CXXFLAGS="$CXXFLAGS $CPPFLAGS"
# default lib behaviour yes/no/auto
_opengl=auto
_libpng=auto
_zlib=auto
# default option behaviour yes/no
_build_gl=yes
_build_windowed=yes
_build_sound=yes
_build_debugger=yes
@ -201,10 +199,6 @@ Installation directories:
--datadir=DIR directory to install icons/data files [PREFIX/share]
Optional Features:
--enable-gl enable/disable OpenGL rendering support [enabled]
--disable-gl
--enable-windowed enable/disable windowed rendering modes [enabled]
--disable-windowed
--enable-sound enable/disable sound support [enabled]
--disable-sound
--enable-debugger enable/disable all debugger options [enabled]
@ -215,6 +209,8 @@ Optional Features:
--disable-cheats
--enable-thumb enable/disable Thumb ARM support [enabled]
--disable-thumb
--enable-windowed enable/disable windowed rendering modes [enabled]
--disable-windowed
--enable-shared build shared binary [enabled]
--enable-static build static binary (if possible) [disabled]
--disable-static
@ -244,10 +240,6 @@ done # for parm in ...
for ac_option in $@; do
case "$ac_option" in
--enable-gl) _build_gl=yes ;;
--disable-gl) _build_gl=no ;;
--enable-windowed) _build_windowed=yes ;;
--disable-windowed) _build_windowed=no ;;
--enable-sound) _build_sound=yes ;;
--disable-sound) _build_sound=no ;;
--enable-debugger) _build_debugger=yes ;;
@ -256,6 +248,8 @@ for ac_option in $@; do
--disable-joystick) _build_joystick=no ;;
--enable-cheats) _build_cheats=yes ;;
--disable-cheats) _build_cheats=no ;;
--enable-windowed) _build_windowed=yes ;;
--disable-windowed) _build_windowed=no ;;
--enable-thumb) _build_thumb=yes ;;
--disable-thumb) _build_thumb=no ;;
--enable-shared) _build_static=no ;;
@ -610,22 +604,6 @@ else
echo "none found, using built-in version"
fi
#
# Check for GL
#
echocheck "opengl"
if test "$_opengl" = auto ; then
_opengl=no
cat > $TMPC << EOF
#include <string.h>
#include <GL/gl.h>
#include <GL/glu.h>
int main(void) { return 0; }
EOF
cc_check $LDFLAGS $CXXFLAGS && _opengl=yes
fi
echo "$_opengl"
#
# figure out installation directories
#
@ -637,28 +615,6 @@ echo
echo_n "Summary:"
echo
if test "$_build_gl" = "yes" ; then
if test "$_opengl" = "yes" ; then
echo_n " OpenGL rendering enabled"
echo
else
echo_n " OpenGL rendering disabled (missing OpenGL headers)"
echo
_build_gl=no
fi
else
echo_n " OpenGL rendering disabled"
echo
fi
if test "$_build_windowed" = "yes" ; then
echo_n " Windowed rendering modes enabled"
echo
else
echo_n " Windowed rendering modes disabled"
echo
fi
if test "$_build_sound" = "yes" ; then
echo_n " Sound support enabled"
echo
@ -699,6 +655,14 @@ else
echo
fi
if test "$_build_windowed" = "yes" ; then
echo_n " Windowed rendering modes enabled"
echo
else
echo_n " Windowed rendering modes disabled"
echo
fi
if test "$_build_thumb" = yes ; then
echo_n " Thumb ARM emulation support enabled"
echo
@ -786,10 +750,6 @@ else
INCLUDES="$INCLUDES -I$ZLIB"
fi
if test "$_build_gl" = yes ; then
DEFINES="$DEFINES -DDISPLAY_OPENGL"
fi
if test "$_build_windowed" = yes ; then
DEFINES="$DEFINES -DWINDOWED_SUPPORT"
fi

View File

@ -17,19 +17,17 @@
// $Id$
//============================================================================
#ifdef DISPLAY_OPENGL
#include <cmath>
#include "Font.hxx"
#include "FrameBufferGL.hxx"
#include "FrameBufferSDL2.hxx"
#include "TIA.hxx"
#include "NTSCFilter.hxx"
#include "FBSurfaceTIA.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FBSurfaceTIA::FBSurfaceTIA(FrameBufferGL& buffer)
FBSurfaceTIA::FBSurfaceTIA(FrameBufferSDL2& buffer)
: myFB(buffer),
myGL(myFB.p_gl),
myTexture(NULL),
@ -44,8 +42,8 @@ FBSurfaceTIA::FBSurfaceTIA(FrameBufferGL& buffer)
// Texture width is set to contain all possible sizes for a TIA image,
// including Blargg filtering
myTexWidth = FrameBufferGL::power_of_two(ATARI_NTSC_OUT_WIDTH(160));
myTexHeight = FrameBufferGL::power_of_two(320);
myTexWidth = FrameBufferSDL2::power_of_two(ATARI_NTSC_OUT_WIDTH(160));
myTexHeight = FrameBufferSDL2::power_of_two(320);
// Create a surface in the same format as the parent GL class
const SDL_PixelFormat& pf = myFB.myPixelFormat;
@ -95,7 +93,7 @@ void FBSurfaceTIA::update()
// a post-processing filter by blending several frames.
switch(myFB.myFilterType)
{
case FrameBufferGL::kNormal:
case FrameBufferSDL2::kNormal:
{
uInt32 bufofsY = 0;
uInt32 screenofsY = 0;
@ -110,7 +108,7 @@ void FBSurfaceTIA::update()
}
break;
}
case FrameBufferGL::kPhosphor:
case FrameBufferSDL2::kPhosphor:
{
uInt32 bufofsY = 0;
uInt32 screenofsY = 0;
@ -128,13 +126,13 @@ void FBSurfaceTIA::update()
}
break;
}
case FrameBufferGL::kBlarggNormal:
case FrameBufferSDL2::kBlarggNormal:
{
myFB.myNTSCFilter.blit_single(currentFrame, width, height,
buffer, myTexture->pitch);
break;
}
case FrameBufferGL::kBlarggPhosphor:
case FrameBufferSDL2::kBlarggPhosphor:
{
myFB.myNTSCFilter.blit_double(currentFrame, previousFrame, width, height,
buffer, myTexture->pitch);
@ -391,5 +389,3 @@ void FBSurfaceTIA::setTIAPalette(const uInt32* palette)
{
myFB.myNTSCFilter.setTIAPalette(myFB, palette);
}
#endif

View File

@ -20,11 +20,9 @@
#ifndef FB_SURFACE_TIA_HXX
#define FB_SURFACE_TIA_HXX
#ifdef DISPLAY_OPENGL
#include "bspf.hxx"
#include "FrameBuffer.hxx"
#include "FrameBufferGL.hxx"
#include "FrameBufferSDL2.hxx"
/**
A surface suitable for OpenGL rendering mode, but specifically for
@ -36,10 +34,10 @@
*/
class FBSurfaceTIA : public FBSurface
{
friend class FrameBufferGL;
friend class FrameBufferSDL2;
public:
FBSurfaceTIA(FrameBufferGL& buffer);
FBSurfaceTIA(FrameBufferSDL2& buffer);
virtual ~FBSurfaceTIA();
// TIA surfaces don't implement most of the drawing primitives,
@ -65,8 +63,8 @@ class FBSurfaceTIA : public FBSurface
void updateCoords();
private:
FrameBufferGL& myFB;
const FrameBufferGL::GLpointers& myGL;
FrameBufferSDL2& myFB;
const FrameBufferSDL2::GLpointers& myGL;
const TIA* myTIA;
SDL_Surface* myTexture;
uInt32 myPitch;
@ -85,6 +83,4 @@ class FBSurfaceTIA : public FBSurface
GLfloat myScanlineIntensityF;
};
#endif // DISPLAY_OPENGL
#endif

View File

@ -17,15 +17,11 @@
// $Id$
//============================================================================
#ifdef DISPLAY_OPENGL
#include "Font.hxx"
#include "FrameBufferGL.hxx"
#include "FBSurfaceGL.hxx"
#include "FBSurfaceUI.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FBSurfaceGL::FBSurfaceGL(FrameBufferGL& buffer, uInt32 width, uInt32 height)
FBSurfaceUI::FBSurfaceUI(FrameBufferSDL2& buffer, uInt32 width, uInt32 height)
: myFB(buffer),
myGL(myFB.p_gl),
myTexture(NULL),
@ -37,8 +33,8 @@ FBSurfaceGL::FBSurfaceGL(FrameBufferGL& buffer, uInt32 width, uInt32 height)
myImageH(height)
{
// Fill buffer struct with valid data
myTexWidth = FrameBufferGL::power_of_two(myImageW);
myTexHeight = FrameBufferGL::power_of_two(myImageH);
myTexWidth = FrameBufferSDL2::power_of_two(myImageW);
myTexHeight = FrameBufferSDL2::power_of_two(myImageH);
myTexCoordW = (GLfloat) myImageW / myTexWidth;
myTexCoordH = (GLfloat) myImageH / myTexHeight;
@ -55,7 +51,7 @@ FBSurfaceGL::FBSurfaceGL(FrameBufferGL& buffer, uInt32 width, uInt32 height)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FBSurfaceGL::~FBSurfaceGL()
FBSurfaceUI::~FBSurfaceUI()
{
if(myTexture)
SDL_FreeSurface(myTexture);
@ -64,7 +60,7 @@ FBSurfaceGL::~FBSurfaceGL()
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FBSurfaceGL::hLine(uInt32 x, uInt32 y, uInt32 x2, uInt32 color)
void FBSurfaceUI::hLine(uInt32 x, uInt32 y, uInt32 x2, uInt32 color)
{
uInt32* buffer = (uInt32*) myTexture->pixels + y * myPitch + x;
while(x++ <= x2)
@ -72,7 +68,7 @@ void FBSurfaceGL::hLine(uInt32 x, uInt32 y, uInt32 x2, uInt32 color)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FBSurfaceGL::vLine(uInt32 x, uInt32 y, uInt32 y2, uInt32 color)
void FBSurfaceUI::vLine(uInt32 x, uInt32 y, uInt32 y2, uInt32 color)
{
uInt32* buffer = (uInt32*) myTexture->pixels + y * myPitch + x;
while(y++ <= y2)
@ -83,7 +79,7 @@ void FBSurfaceGL::vLine(uInt32 x, uInt32 y, uInt32 y2, uInt32 color)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FBSurfaceGL::fillRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h, uInt32 color)
void FBSurfaceUI::fillRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h, uInt32 color)
{
// Fill the rectangle
SDL_Rect tmp;
@ -95,7 +91,7 @@ void FBSurfaceGL::fillRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h, uInt32 color)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FBSurfaceGL::drawChar(const GUI::Font& font, uInt8 chr,
void FBSurfaceUI::drawChar(const GUI::Font& font, uInt8 chr,
uInt32 tx, uInt32 ty, uInt32 color)
{
const FontDesc& desc = font.desc();
@ -144,7 +140,7 @@ void FBSurfaceGL::drawChar(const GUI::Font& font, uInt8 chr,
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FBSurfaceGL::drawBitmap(uInt32* bitmap, uInt32 tx, uInt32 ty,
void FBSurfaceUI::drawBitmap(uInt32* bitmap, uInt32 tx, uInt32 ty,
uInt32 color, uInt32 h)
{
uInt32* buffer = (uInt32*) myTexture->pixels + ty * myPitch + tx;
@ -161,7 +157,7 @@ void FBSurfaceGL::drawBitmap(uInt32* bitmap, uInt32 tx, uInt32 ty,
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FBSurfaceGL::drawPixels(uInt32* data, uInt32 tx, uInt32 ty, uInt32 numpixels)
void FBSurfaceUI::drawPixels(uInt32* data, uInt32 tx, uInt32 ty, uInt32 numpixels)
{
uInt32* buffer = (uInt32*) myTexture->pixels + ty * myPitch + tx;
@ -170,9 +166,9 @@ void FBSurfaceGL::drawPixels(uInt32* data, uInt32 tx, uInt32 ty, uInt32 numpixel
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FBSurfaceGL::drawSurface(const FBSurface* surface, uInt32 tx, uInt32 ty)
void FBSurfaceUI::drawSurface(const FBSurface* surface, uInt32 tx, uInt32 ty)
{
const FBSurfaceGL* s = (const FBSurfaceGL*) surface;
const FBSurfaceUI* s = (const FBSurfaceUI*) surface;
SDL_Rect dstrect;
dstrect.x = tx;
@ -187,7 +183,7 @@ void FBSurfaceGL::drawSurface(const FBSurface* surface, uInt32 tx, uInt32 ty)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FBSurfaceGL::addDirtyRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h)
void FBSurfaceUI::addDirtyRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h)
{
// OpenGL mode doesn't make use of dirty rectangles
// It's faster to just update the entire surface
@ -195,14 +191,14 @@ void FBSurfaceGL::addDirtyRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FBSurfaceGL::getPos(uInt32& x, uInt32& y) const
void FBSurfaceUI::getPos(uInt32& x, uInt32& y) const
{
x = myImageX;
y = myImageY;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FBSurfaceGL::setPos(uInt32 x, uInt32 y)
void FBSurfaceUI::setPos(uInt32 x, uInt32 y)
{
if(myImageX != x || myImageY != y)
{
@ -213,7 +209,7 @@ void FBSurfaceGL::setPos(uInt32 x, uInt32 y)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FBSurfaceGL::setWidth(uInt32 w)
void FBSurfaceUI::setWidth(uInt32 w)
{
// This method can't be used with 'scaled' surface (aka TIA surfaces)
// That shouldn't really matter, though, as all the UI stuff isn't scaled,
@ -227,7 +223,7 @@ void FBSurfaceGL::setWidth(uInt32 w)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FBSurfaceGL::setHeight(uInt32 h)
void FBSurfaceUI::setHeight(uInt32 h)
{
// This method can't be used with 'scaled' surface (aka TIA surfaces)
// That shouldn't really matter, though, as all the UI stuff isn't scaled,
@ -241,14 +237,14 @@ void FBSurfaceGL::setHeight(uInt32 h)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FBSurfaceGL::translateCoords(Int32& x, Int32& y) const
void FBSurfaceUI::translateCoords(Int32& x, Int32& y) const
{
x -= myImageX;
y -= myImageY;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FBSurfaceGL::update()
void FBSurfaceUI::update()
{
if(mySurfaceIsDirty)
{
@ -287,7 +283,7 @@ void FBSurfaceGL::update()
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FBSurfaceGL::free()
void FBSurfaceUI::free()
{
myGL.DeleteTextures(1, &myTexID);
if(myFB.myVBOAvailable)
@ -295,12 +291,12 @@ void FBSurfaceGL::free()
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FBSurfaceGL::reload()
void FBSurfaceUI::reload()
{
// This does a 'soft' reset of the surface
// It seems that on some system (notably, OSX), creating a new SDL window
// destroys the GL context, requiring a reload of all textures
// However, destroying the entire FBSurfaceGL object is wasteful, since
// However, destroying the entire FBSurfaceUI object is wasteful, since
// it will also regenerate SDL software surfaces (which are not required
// to be regenerated)
// Basically, all that needs to be done is to re-call glTexImage2D with a
@ -331,7 +327,7 @@ void FBSurfaceGL::reload()
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FBSurfaceGL::updateCoords()
void FBSurfaceUI::updateCoords()
{
// Vertex coordinates for texture
// Upper left (x,y)
@ -368,5 +364,3 @@ void FBSurfaceGL::updateCoords()
myGL.BufferData(GL_ARRAY_BUFFER, 16*sizeof(GLfloat), myCoord, GL_STATIC_DRAW);
}
}
#endif

View File

@ -17,14 +17,11 @@
// $Id$
//============================================================================
#ifndef FB_SURFACE_GL_HXX
#define FB_SURFACE_GL_HXX
#ifdef DISPLAY_OPENGL
#ifndef FB_SURFACE_UI_HXX
#define FB_SURFACE_UI_HXX
#include "bspf.hxx"
#include "FrameBuffer.hxx"
#include "FrameBufferGL.hxx"
#include "FrameBufferSDL2.hxx"
/**
A surface suitable for OpenGL rendering mode, used for various UI dialogs.
@ -32,13 +29,13 @@
@author Stephen Anthony
*/
class FBSurfaceGL : public FBSurface
class FBSurfaceUI : public FBSurface
{
friend class FrameBufferGL;
friend class FrameBufferSDL2;
public:
FBSurfaceGL(FrameBufferGL& buffer, uInt32 width, uInt32 height);
virtual ~FBSurfaceGL();
FBSurfaceUI(FrameBufferSDL2& buffer, uInt32 width, uInt32 height);
virtual ~FBSurfaceUI();
// Normal surfaces need all drawing primitives
void hLine(uInt32 x, uInt32 y, uInt32 x2, uInt32 color);
@ -64,8 +61,8 @@ class FBSurfaceGL : public FBSurface
void updateCoords();
private:
FrameBufferGL& myFB;
const FrameBufferGL::GLpointers& myGL;
FrameBufferSDL2& myFB;
const FrameBufferSDL2::GLpointers& myGL;
SDL_Surface* myTexture;
GLuint myTexID, myVBOID;
@ -79,6 +76,4 @@ class FBSurfaceGL : public FBSurface
uInt32 myPitch;
};
#endif // DISPLAY_OPENGL
#endif

View File

@ -17,8 +17,6 @@
// $Id$
//============================================================================
#ifdef DISPLAY_OPENGL
#include <SDL.h>
#include <SDL_syswm.h>
#include <sstream>
@ -33,19 +31,26 @@
#include "Settings.hxx"
#include "TIA.hxx"
#include "FBSurfaceGL.hxx"
#include "FBSurfaceUI.hxx"
#include "FBSurfaceTIA.hxx"
#include "FrameBufferGL.hxx"
#include "FrameBufferSDL2.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FrameBufferGL::FrameBufferGL(OSystem* osystem)
FrameBufferSDL2::FrameBufferSDL2(OSystem* osystem)
: FrameBuffer(osystem),
myFilterType(kNormal),
myScreen(0),
mySDLFlags(0),
myTiaSurface(NULL),
myDirtyFlag(true)
{
// Added from MediaFactory /////////////////////////
const string& gl_lib = osystem->settings().getString("gl_lib");
loadLibrary(gl_lib);
////////////////////////////////////////////////////
// We need a pixel format for palette value calculations
// It's done this way (vs directly accessing a FBSurfaceGL object)
// It's done this way (vs directly accessing a FBSurfaceUI object)
// since the structure may be needed before any FBSurface's have
// been created
// Note: alpha disabled for now, since it's not used
@ -57,14 +62,14 @@ FrameBufferGL::FrameBufferGL(OSystem* osystem)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FrameBufferGL::~FrameBufferGL()
FrameBufferSDL2::~FrameBufferSDL2()
{
// We're taking responsibility for this surface
delete myTiaSurface;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool FrameBufferGL::loadLibrary(const string& library)
bool FrameBufferSDL2::loadLibrary(const string& library)
{
if(myLibraryLoaded)
return true;
@ -80,7 +85,7 @@ bool FrameBufferGL::loadLibrary(const string& library)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool FrameBufferGL::loadFuncs(GLFunctionality functionality)
bool FrameBufferSDL2::loadFuncs(GLFunctionality functionality)
{
#define OGL_INIT(NAME,RET,FUNC,PARAMS) \
p_gl.NAME = (RET(APIENTRY*)PARAMS) SDL_GL_GetProcAddress(#FUNC); if(!p_gl.NAME) return false
@ -139,9 +144,23 @@ bool FrameBufferGL::loadFuncs(GLFunctionality functionality)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool FrameBufferGL::initSubsystem(VideoMode& mode)
bool FrameBufferSDL2::initSubsystem(VideoMode& mode, bool full)
{
// Now (re)initialize the SDL video system
// These things only have to be done one per FrameBuffer creation
if(SDL_WasInit(SDL_INIT_VIDEO) == 0)
{
if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) < 0)
{
ostringstream buf;
buf << "ERROR: Couldn't initialize SDL: " << SDL_GetError() << endl;
myOSystem->logMessage(buf.str(), 0);
return false;
}
}
mySDLFlags |= SDL_OPENGL;
setHint(kFullScreen, full);
// Set up the OpenGL attributes
myDepth = SDL_GetVideoInfo()->vfmt->BitsPerPixel;
@ -174,7 +193,7 @@ bool FrameBufferGL::initSubsystem(VideoMode& mode)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string FrameBufferGL::about() const
string FrameBufferSDL2::about() const
{
ostringstream out;
out << "Video rendering: OpenGL mode" << endl
@ -190,7 +209,7 @@ string FrameBufferGL::about() const
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool FrameBufferGL::setVidMode(VideoMode& mode)
bool FrameBufferSDL2::setVidMode(VideoMode& mode)
{
bool inTIAMode =
myOSystem->eventHandler().state() != EventHandler::S_LAUNCHER &&
@ -329,7 +348,23 @@ bool FrameBufferGL::setVidMode(VideoMode& mode)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FrameBufferGL::invalidate()
void FrameBufferSDL2::setHint(FBHint hint, bool enabled)
{
int flag = 0;
switch(hint)
{
case kFullScreen:
flag = SDL_FULLSCREEN;
break;
}
if(enabled)
mySDLFlags |= flag;
else
mySDLFlags &= ~flag;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FrameBufferSDL2::invalidate()
{
p_gl.Clear(GL_COLOR_BUFFER_BIT);
if(myTiaSurface)
@ -337,14 +372,103 @@ void FrameBufferGL::invalidate()
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FrameBufferGL::drawTIA(bool fullRedraw)
void FrameBufferSDL2::showCursor(bool show)
{
SDL_ShowCursor(show ? SDL_ENABLE : SDL_DISABLE);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FrameBufferSDL2::grabMouse(bool grab)
{
SDL_WM_GrabInput(grab ? SDL_GRAB_ON : SDL_GRAB_OFF);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool FrameBufferSDL2::fullScreen() const
{
#ifdef WINDOWED_SUPPORT
return mySDLFlags & SDL_FULLSCREEN;
#else
return true;
#endif
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FrameBufferSDL2::setWindowTitle(const string& title)
{
SDL_WM_SetCaption(title.c_str(), "stella");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FrameBufferSDL2::setWindowIcon()
{
#if !defined(BSPF_MAC_OSX) && !defined(BSPF_UNIX)
#include "stella.xpm" // The Stella icon
// Set the window icon
uInt32 w, h, ncols, nbytes;
uInt32 rgba[256], icon[32 * 32];
uInt8 mask[32][4];
sscanf(stella_icon[0], "%u %u %u %u", &w, &h, &ncols, &nbytes);
if((w != 32) || (h != 32) || (ncols > 255) || (nbytes > 1))
{
myOSystem->logMessage("ERROR: Couldn't load the application icon.", 0);
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
{
myOSystem->logMessage("ERROR: Couldn't load the application icon.", 0);
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 FrameBufferSDL2::drawTIA(bool fullRedraw)
{
// The TIA surface takes all responsibility for drawing
myTiaSurface->update();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FrameBufferGL::postFrameUpdate()
void FrameBufferSDL2::postFrameUpdate()
{
if(myDirtyFlag)
{
@ -355,7 +479,7 @@ void FrameBufferGL::postFrameUpdate()
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FrameBufferGL::enablePhosphor(bool enable, int blend)
void FrameBufferSDL2::enablePhosphor(bool enable, int blend)
{
if(myTiaSurface)
{
@ -367,7 +491,7 @@ void FrameBufferGL::enablePhosphor(bool enable, int blend)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FrameBufferGL::enableNTSC(bool enable)
void FrameBufferSDL2::enableNTSC(bool enable)
{
if(myTiaSurface)
{
@ -384,7 +508,7 @@ void FrameBufferGL::enableNTSC(bool enable)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 FrameBufferGL::enableScanlines(int relative, int absolute)
uInt32 FrameBufferSDL2::enableScanlines(int relative, int absolute)
{
int intensity = myTiaSurface->myScanlineIntensityI;
if(myTiaSurface)
@ -401,7 +525,7 @@ uInt32 FrameBufferGL::enableScanlines(int relative, int absolute)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FrameBufferGL::enableScanlineInterpolation(bool enable)
void FrameBufferSDL2::enableScanlineInterpolation(bool enable)
{
if(myTiaSurface)
{
@ -411,23 +535,23 @@ void FrameBufferGL::enableScanlineInterpolation(bool enable)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FrameBufferGL::setTIAPalette(const uInt32* palette)
void FrameBufferSDL2::setTIAPalette(const uInt32* palette)
{
FrameBuffer::setTIAPalette(palette);
myTiaSurface->setTIAPalette(palette);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FBSurface* FrameBufferGL::createSurface(int w, int h, bool isBase) const
FBSurface* FrameBufferSDL2::createSurface(int w, int h, bool isBase) const
{
// Ignore 'isBase' argument; all GL surfaces are separate
// Also, this method will only be called for use in external dialogs.
// and never used for TIA surfaces
return new FBSurfaceGL((FrameBufferGL&)*this, w, h);
return new FBSurfaceUI((FrameBufferSDL2&)*this, w, h);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FrameBufferGL::scanline(uInt32 row, uInt8* data) const
void FrameBufferSDL2::scanline(uInt32 row, uInt8* data) const
{
// Invert the row, since OpenGL rows start at the bottom
// of the framebuffer
@ -439,7 +563,7 @@ void FrameBufferGL::scanline(uInt32 row, uInt8* data) const
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string FrameBufferGL::effectsInfo() const
string FrameBufferSDL2::effectsInfo() const
{
ostringstream buf;
switch(myFilterType)
@ -465,9 +589,7 @@ string FrameBufferGL::effectsInfo() const
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool FrameBufferGL::myLibraryLoaded = false;
bool FrameBufferSDL2::myLibraryLoaded = false;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool FrameBufferGL::myVBOAvailable = false;
#endif // DISPLAY_OPENGL
bool FrameBufferSDL2::myVBOAvailable = false;

View File

@ -17,17 +17,15 @@
// $Id$
//============================================================================
#ifndef FRAMEBUFFER_GL_HXX
#define FRAMEBUFFER_GL_HXX
#ifdef DISPLAY_OPENGL
#ifndef FRAMEBUFFER_SDL2_HXX
#define FRAMEBUFFER_SDL2_HXX
#include <SDL.h>
#include <SDL_opengl.h>
#include <SDL_syswm.h>
class OSystem;
class FBSurfaceGL;
class FBSurfaceUI;
class FBSurfaceTIA;
class TIA;
@ -35,31 +33,32 @@ class TIA;
#include "FrameBuffer.hxx"
/**
This class implements an SDL OpenGL framebuffer.
This class implements a standard SDL2 2D, hardware accelerated framebuffer.
Behind the scenes, it may be using Direct3D, OpenGL(ES), etc.
@author Stephen Anthony
@version $Id$
*/
class FrameBufferGL : public FrameBuffer
class FrameBufferSDL2 : public FrameBuffer
{
friend class FBSurfaceGL;
friend class FBSurfaceUI;
friend class FBSurfaceTIA;
public:
/**
Creates a new OpenGL framebuffer
*/
FrameBufferGL(OSystem* osystem);
FrameBufferSDL2(OSystem* osystem);
/**
Destructor
*/
virtual ~FrameBufferGL();
virtual ~FrameBufferSDL2();
/**
Check if OpenGL is available on this system, and then opens it.
If any errors occur, we shouldn't attempt to instantiate a
FrameBufferGL object.
FrameBufferSDL2 object.
@param library The filename of the OpenGL library
*/
@ -68,6 +67,27 @@ class FrameBufferGL : public FrameBuffer
//////////////////////////////////////////////////////////////////////
// The following are derived from public methods in FrameBuffer.hxx
//////////////////////////////////////////////////////////////////////
/**
Toggles the use of grabmouse (only has effect in emulation mode).
The method changes the 'grabmouse' setting and saves it.
*/
void toggleGrabMouse();
/**
Shows or hides the cursor based on the given boolean value.
*/
void showCursor(bool show);
/**
Answers if the display is currently in fullscreen mode.
*/
bool fullScreen() const;
/**
Set the title for the main window.
*/
void setWindowTitle(const string& title);
/**
Enable/disable phosphor effect.
*/
@ -134,10 +154,11 @@ class FrameBufferGL : public FrameBuffer
with the given video mode. Normally, it will also call setVidMode().
@param mode The video mode to use
@param full Whether this is a fullscreen or windowed mode
@return False on any errors, else true
*/
bool initSubsystem(VideoMode& mode);
bool initSubsystem(VideoMode& mode, bool full);
/**
This method is called to change to the given video mode. If the mode
@ -149,6 +170,15 @@ class FrameBufferGL : public FrameBuffer
*/
bool setVidMode(VideoMode& mode);
/**
Sets a hint that the underlying renderer may use; it is also free
to ignore it completely.
@param hint The hint to set
@param enabled Whether the hint should be turned on or off
*/
void setHint(FBHint hint, bool enabled);
/**
This method is called to invalidate the contents of the entire
framebuffer (ie, mark the current content as invalid, and erase it on
@ -166,6 +196,16 @@ class FrameBufferGL : public FrameBuffer
*/
FBSurface* createSurface(int w, int h, bool useBase = false) const;
/**
Grabs or ungrabs the mouse based on the given boolean value.
*/
void grabMouse(bool grab);
/**
Set the icon for the main SDL window.
*/
void setWindowIcon();
/**
This method should be called anytime the TIA needs to be redrawn
to the screen (full indicating that a full redraw is required).
@ -217,6 +257,15 @@ class FrameBufferGL : public FrameBuffer
}
private:
// The SDL video buffer
SDL_Surface* myScreen;
// SDL initialization flags
// This is set by the base FrameBuffer class, and read by the derived classes
// If a FrameBuffer is successfully created, the derived classes must modify
// it to point to the actual flags used by the SDL_Surface
uInt32 mySDLFlags;
// The lower-most base surface (will always be a TIA surface,
// since Dialog surfaces are allocated by the Dialog class directly).
FBSurfaceTIA* myTiaSurface;
@ -280,6 +329,4 @@ class FrameBufferGL : public FrameBuffer
GLpointers p_gl;
};
#endif // DISPLAY_OPENGL
#endif

View File

@ -30,10 +30,10 @@
#include "System.hxx"
#include "OSystem.hxx"
#include "Console.hxx"
#include "SoundSDL.hxx"
#include "SoundSDL2.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SoundSDL::SoundSDL(OSystem* osystem)
SoundSDL2::SoundSDL2(OSystem* osystem)
: Sound(osystem),
myIsEnabled(false),
myIsInitializedFlag(false),
@ -43,7 +43,7 @@ SoundSDL::SoundSDL(OSystem* osystem)
myIsMuted(true),
myVolume(100)
{
myOSystem->logMessage("SoundSDL::SoundSDL started ...", 2);
myOSystem->logMessage("SoundSDL2::SoundSDL2 started ...", 2);
// The sound system is opened only once per program run, to eliminate
// issues with opening and closing it multiple times
@ -87,11 +87,11 @@ SoundSDL::SoundSDL(OSystem* osystem)
myIsInitializedFlag = true;
SDL_PauseAudio(1);
myOSystem->logMessage("SoundSDL::SoundSDL initialized", 2);
myOSystem->logMessage("SoundSDL2::SoundSDL2 initialized", 2);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SoundSDL::~SoundSDL()
SoundSDL2::~SoundSDL2()
{
// Close the SDL audio system if it's initialized
if(myIsInitializedFlag)
@ -100,22 +100,22 @@ SoundSDL::~SoundSDL()
myIsEnabled = myIsInitializedFlag = false;
}
myOSystem->logMessage("SoundSDL destroyed", 2);
myOSystem->logMessage("SoundSDL2 destroyed", 2);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void SoundSDL::setEnabled(bool state)
void SoundSDL2::setEnabled(bool state)
{
myOSystem->settings().setValue("sound", state);
myOSystem->logMessage(state ? "SoundSDL::setEnabled(true)" :
"SoundSDL::setEnabled(false)", 2);
myOSystem->logMessage(state ? "SoundSDL2::setEnabled(true)" :
"SoundSDL2::setEnabled(false)", 2);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void SoundSDL::open()
void SoundSDL2::open()
{
myOSystem->logMessage("SoundSDL::open started ...", 2);
myOSystem->logMessage("SoundSDL2::open started ...", 2);
myIsEnabled = false;
mute(true);
if(!myIsInitializedFlag || !myOSystem->settings().getBool("sound"))
@ -148,11 +148,11 @@ void SoundSDL::open()
myIsEnabled = true;
mute(false);
myOSystem->logMessage("SoundSDL::open finished", 2);
myOSystem->logMessage("SoundSDL2::open finished", 2);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void SoundSDL::close()
void SoundSDL2::close()
{
if(myIsInitializedFlag)
{
@ -161,12 +161,12 @@ void SoundSDL::close()
myLastRegisterSetCycle = 0;
myTIASound.reset();
myRegWriteQueue.clear();
myOSystem->logMessage("SoundSDL::close", 2);
myOSystem->logMessage("SoundSDL2::close", 2);
}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void SoundSDL::mute(bool state)
void SoundSDL2::mute(bool state)
{
if(myIsInitializedFlag)
{
@ -176,7 +176,7 @@ void SoundSDL::mute(bool state)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void SoundSDL::reset()
void SoundSDL2::reset()
{
if(myIsInitializedFlag)
{
@ -189,7 +189,7 @@ void SoundSDL::reset()
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void SoundSDL::setVolume(Int32 percent)
void SoundSDL2::setVolume(Int32 percent)
{
if(myIsInitializedFlag && (percent >= 0) && (percent <= 100))
{
@ -202,7 +202,7 @@ void SoundSDL::setVolume(Int32 percent)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void SoundSDL::adjustVolume(Int8 direction)
void SoundSDL2::adjustVolume(Int8 direction)
{
ostringstream strval;
string message;
@ -228,20 +228,20 @@ void SoundSDL::adjustVolume(Int8 direction)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void SoundSDL::adjustCycleCounter(Int32 amount)
void SoundSDL2::adjustCycleCounter(Int32 amount)
{
myLastRegisterSetCycle += amount;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void SoundSDL::setChannels(uInt32 channels)
void SoundSDL2::setChannels(uInt32 channels)
{
if(channels == 1 || channels == 2)
myNumChannels = channels;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void SoundSDL::setFrameRate(float framerate)
void SoundSDL2::setFrameRate(float framerate)
{
// Recalculate since frame rate has changed
// FIXME - should we clear out the queue or adjust the values in it?
@ -250,7 +250,7 @@ void SoundSDL::setFrameRate(float framerate)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void SoundSDL::set(uInt16 addr, uInt8 value, Int32 cycle)
void SoundSDL2::set(uInt16 addr, uInt8 value, Int32 cycle)
{
SDL_LockAudio();
@ -276,7 +276,7 @@ void SoundSDL::set(uInt16 addr, uInt8 value, Int32 cycle)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void SoundSDL::processFragment(Int16* stream, uInt32 length)
void SoundSDL2::processFragment(Int16* stream, uInt32 length)
{
uInt32 channels = myHardwareSpec.channels;
length = length / channels;
@ -357,9 +357,9 @@ void SoundSDL::processFragment(Int16* stream, uInt32 length)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void SoundSDL::callback(void* udata, uInt8* stream, int len)
void SoundSDL2::callback(void* udata, uInt8* stream, int len)
{
SoundSDL* sound = (SoundSDL*)udata;
SoundSDL2* sound = (SoundSDL2*)udata;
if(sound->myIsEnabled)
{
// The callback is requesting 8-bit (unsigned) data, but the TIA sound
@ -370,7 +370,7 @@ void SoundSDL::callback(void* udata, uInt8* stream, int len)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool SoundSDL::save(Serializer& out) const
bool SoundSDL2::save(Serializer& out) const
{
try
{
@ -400,7 +400,7 @@ bool SoundSDL::save(Serializer& out) const
}
catch(...)
{
myOSystem->logMessage("ERROR: SoundSDL::save", 0);
myOSystem->logMessage("ERROR: SoundSDL2::save", 0);
return false;
}
@ -408,7 +408,7 @@ bool SoundSDL::save(Serializer& out) const
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool SoundSDL::load(Serializer& in)
bool SoundSDL2::load(Serializer& in)
{
try
{
@ -441,7 +441,7 @@ bool SoundSDL::load(Serializer& in)
}
catch(...)
{
myOSystem->logMessage("ERROR: SoundSDL::load", 0);
myOSystem->logMessage("ERROR: SoundSDL2::load", 0);
return false;
}
@ -449,7 +449,7 @@ bool SoundSDL::load(Serializer& in)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SoundSDL::RegWriteQueue::RegWriteQueue(uInt32 capacity)
SoundSDL2::RegWriteQueue::RegWriteQueue(uInt32 capacity)
: myCapacity(capacity),
myBuffer(0),
mySize(0),
@ -460,19 +460,19 @@ SoundSDL::RegWriteQueue::RegWriteQueue(uInt32 capacity)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SoundSDL::RegWriteQueue::~RegWriteQueue()
SoundSDL2::RegWriteQueue::~RegWriteQueue()
{
delete[] myBuffer;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void SoundSDL::RegWriteQueue::clear()
void SoundSDL2::RegWriteQueue::clear()
{
myHead = myTail = mySize = 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void SoundSDL::RegWriteQueue::dequeue()
void SoundSDL2::RegWriteQueue::dequeue()
{
if(mySize > 0)
{
@ -482,7 +482,7 @@ void SoundSDL::RegWriteQueue::dequeue()
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
double SoundSDL::RegWriteQueue::duration()
double SoundSDL2::RegWriteQueue::duration()
{
double duration = 0.0;
for(uInt32 i = 0; i < mySize; ++i)
@ -493,7 +493,7 @@ double SoundSDL::RegWriteQueue::duration()
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void SoundSDL::RegWriteQueue::enqueue(const RegWrite& info)
void SoundSDL2::RegWriteQueue::enqueue(const RegWrite& info)
{
// If an attempt is made to enqueue more than the queue can hold then
// we'll enlarge the queue's capacity.
@ -506,20 +506,20 @@ void SoundSDL::RegWriteQueue::enqueue(const RegWrite& info)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SoundSDL::RegWrite& SoundSDL::RegWriteQueue::front()
SoundSDL2::RegWrite& SoundSDL2::RegWriteQueue::front()
{
assert(mySize != 0);
return myBuffer[myHead];
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 SoundSDL::RegWriteQueue::size() const
uInt32 SoundSDL2::RegWriteQueue::size() const
{
return mySize;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void SoundSDL::RegWriteQueue::grow()
void SoundSDL2::RegWriteQueue::grow()
{
RegWrite* buffer = new RegWrite[myCapacity * 2];
for(uInt32 i = 0; i < mySize; ++i)

View File

@ -19,8 +19,8 @@
#ifdef SOUND_SUPPORT
#ifndef SOUND_SDL_HXX
#define SOUND_SDL_HXX
#ifndef SOUND_SDL2_HXX
#define SOUND_SDL2_HXX
class OSystem;
@ -36,19 +36,19 @@ class OSystem;
@author Stephen Anthony and Bradford W. Mott
@version $Id$
*/
class SoundSDL : public Sound
class SoundSDL2 : public Sound
{
public:
/**
Create a new sound object. The init method must be invoked before
using the object.
*/
SoundSDL(OSystem* osystem);
SoundSDL2(OSystem* osystem);
/**
Destructor
*/
virtual ~SoundSDL();
virtual ~SoundSDL2();
public:
/**

View File

@ -3,10 +3,10 @@ MODULE := src/common
MODULE_OBJS := \
src/common/mainSDL.o \
src/common/Base.o \
src/common/SoundSDL.o \
src/common/FrameBufferGL.o \
src/common/FBSurfaceGL.o \
src/common/FrameBufferSDL2.o \
src/common/FBSurfaceUI.o \
src/common/FBSurfaceTIA.o \
src/common/SoundSDL2.o \
src/common/FSNodeZIP.o \
src/common/PNGLibrary.o \
src/common/MouseControl.o \

View File

@ -42,8 +42,6 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FrameBuffer::FrameBuffer(OSystem* osystem)
: myOSystem(osystem),
myScreen(0),
mySDLFlags(0),
myRedrawEntireFrame(true),
myUsePhosphor(false),
myPhosphorBlend(77),
@ -72,19 +70,6 @@ FrameBuffer::~FrameBuffer(void)
FBInitStatus FrameBuffer::initialize(const string& title,
uInt32 width, uInt32 height)
{
ostringstream buf;
// Now (re)initialize the SDL video system
// These things only have to be done one per FrameBuffer creation
if(SDL_WasInit(SDL_INIT_VIDEO) == 0)
{
if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) < 0)
{
buf << "ERROR: Couldn't initialize SDL: " << SDL_GetError() << endl;
myOSystem->logMessage(buf.str(), 0);
return kFailComplete;
}
}
myInitializedCount++;
// A 'windowed' system is defined as one where the window size can be
@ -97,7 +82,7 @@ FBInitStatus FrameBuffer::initialize(const string& title,
// If the WINDOWED_SUPPORT macro is defined, we treat the system as the
// former type; if not, as the latter type
uInt32 flags = mySDLFlags;
bool useFullscreen = false;
#ifdef WINDOWED_SUPPORT
// We assume that a desktop size of at least 640x480 means that we're
// running on a 'large' system, and the window size requirements can
@ -112,10 +97,10 @@ FBInitStatus FrameBuffer::initialize(const string& title,
if(myOSystem->desktopWidth() < width || myOSystem->desktopHeight() < height)
return kFailTooLarge;
flags |= SDL_FULLSCREEN;
useFullscreen = true;
}
else
flags &= ~SDL_FULLSCREEN;
useFullscreen = false;
#else
// Make sure this mode is even possible
// We only really need to worry about it in non-windowed environments,
@ -124,9 +109,6 @@ FBInitStatus FrameBuffer::initialize(const string& title,
return kFailTooLarge;
#endif
// Only update the actual flags if no errors were detected
mySDLFlags = flags;
// Set the available video modes for this framebuffer
setAvailableVidModes(width, height);
@ -138,7 +120,7 @@ FBInitStatus FrameBuffer::initialize(const string& title,
setWindowTitle(title);
if(myInitializedCount == 1) setWindowIcon();
if(initSubsystem(mode))
if(initSubsystem(mode, useFullscreen))
{
centerAppWindow(mode);
@ -646,18 +628,6 @@ void FrameBuffer::setTIAPalette(const uInt32* palette)
Uint8 b = palette[i] & 0xff;
myDefPalette[i] = mapRGB(r, g, b);
if(SDL_BYTEORDER == SDL_LIL_ENDIAN)
{
myDefPalette24[i][0] = b;
myDefPalette24[i][1] = g;
myDefPalette24[i][2] = r;
}
else
{
myDefPalette24[i][0] = r;
myDefPalette24[i][1] = g;
myDefPalette24[i][2] = b;
}
}
// Set palette for phosphor effect
@ -694,18 +664,6 @@ void FrameBuffer::setUIPalette(const uInt32* palette)
Uint8 b = palette[i] & 0xff;
myDefPalette[j] = mapRGB(r, g, b);
if(SDL_BYTEORDER == SDL_LIL_ENDIAN)
{
myDefPalette24[j][0] = b;
myDefPalette24[j][1] = g;
myDefPalette24[j][2] = r;
}
else
{
myDefPalette24[j][0] = r;
myDefPalette24[j][1] = g;
myDefPalette24[j][2] = b;
}
}
}
@ -730,10 +688,8 @@ void FrameBuffer::setFullscreen(bool enable)
{
#ifdef WINDOWED_SUPPORT
// '-1' means fullscreen mode is completely disabled
if(enable && myOSystem->settings().getString("fullscreen") != "-1" )
mySDLFlags |= SDL_FULLSCREEN;
else
mySDLFlags &= ~SDL_FULLSCREEN;
bool full = enable && myOSystem->settings().getString("fullscreen") != "-1";
setHint(kFullScreen, full);
// Do a dummy call to getSavedVidMode to set up the modelists
// and have it point to the correct 'current' mode
@ -830,95 +786,6 @@ void FrameBuffer::toggleGrabMouse()
setCursorState();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FrameBuffer::showCursor(bool show)
{
SDL_ShowCursor(show ? SDL_ENABLE : SDL_DISABLE);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FrameBuffer::grabMouse(bool grab)
{
SDL_WM_GrabInput(grab ? SDL_GRAB_ON : SDL_GRAB_OFF);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool FrameBuffer::fullScreen() const
{
#ifdef WINDOWED_SUPPORT
return mySDLFlags & SDL_FULLSCREEN;
#else
return true;
#endif
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FrameBuffer::setWindowTitle(const string& title)
{
SDL_WM_SetCaption(title.c_str(), "stella");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FrameBuffer::setWindowIcon()
{
#if !defined(BSPF_MAC_OSX) && !defined(BSPF_UNIX)
#include "stella.xpm" // The Stella icon
// Set the window icon
uInt32 w, h, ncols, nbytes;
uInt32 rgba[256], icon[32 * 32];
uInt8 mask[32][4];
sscanf(stella_icon[0], "%u %u %u %u", &w, &h, &ncols, &nbytes);
if((w != 32) || (h != 32) || (ncols > 255) || (nbytes > 1))
{
myOSystem->logMessage("ERROR: Couldn't load the application icon.", 0);
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
{
myOSystem->logMessage("ERROR: Couldn't load the application icon.", 0);
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
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt8 FrameBuffer::getPhosphor(uInt8 c1, uInt8 c2) const
{

View File

@ -21,7 +21,6 @@
#define FRAMEBUFFER_HXX
#include <map>
#include <SDL.h>
class FBSurface;
class OSystem;
@ -54,6 +53,12 @@ enum FBInitStatus {
kFailNotSupported,
};
// Various hints that the FrameBuffer can pass to the underlying
// video renderer (this will expand as required
enum FBHint {
kFullScreen = 0x1
};
// Positions for onscreen/overlaid messages
enum MessagePosition {
kTopLeft,
@ -241,21 +246,6 @@ class FrameBuffer
*/
void toggleGrabMouse();
/**
Shows or hides the cursor based on the given boolean value.
*/
virtual void showCursor(bool show);
/**
Answers if the display is currently in fullscreen mode.
*/
bool fullScreen() const;
/**
Set the title for the main SDL window.
*/
void setWindowTitle(const string& title);
/**
Get the supported TIA filters for the given framebuffer type.
*/
@ -317,10 +307,25 @@ class FrameBuffer
uInt8 getPhosphor(uInt8 c1, uInt8 c2) const;
//////////////////////////////////////////////////////////////////////
// The following methods are system-specific and *may* be implemented
// in derived classes.
// The following methods are system-specific and can/must be
// implemented in derived classes.
//////////////////////////////////////////////////////////////////////
public:
/**
Shows or hides the cursor based on the given boolean value.
*/
virtual void showCursor(bool show) = 0;
/**
Answers if the display is currently in fullscreen mode.
*/
virtual bool fullScreen() const = 0;
/**
Set the title for the main window.
*/
virtual void setWindowTitle(const string& title) = 0;
/**
Enable/disable NTSC filtering effects.
*/
@ -331,22 +336,6 @@ class FrameBuffer
*/
virtual string effectsInfo() const { return "None / not available"; }
private:
/**
Change scanline intensity and interpolation.
@param relative If non-zero, change current intensity by
'relative' amount, otherwise set to 'absolute'
@return New current intensity
*/
virtual uInt32 enableScanlines(int relative, int absolute = 50) { return absolute; }
virtual void enableScanlineInterpolation(bool enable) { }
//////////////////////////////////////////////////////////////////////
// The following methods are system-specific and *must* be implemented
// in derived classes.
//////////////////////////////////////////////////////////////////////
public:
/**
Enable/disable phosphor effect.
*/
@ -411,11 +400,11 @@ class FrameBuffer
uInt8 avail; // 0x1 bit -> software, 0x2 bit -> opengl
};
// Contains all relevant info for the dimensions of an SDL screen
// Also takes care of the case when the SDL image should be 'centered'
// Contains all relevant info for the dimensions of a video screen
// Also takes care of the case when the image should be 'centered'
// within the given screen
// image_XXX are the image offsets into the SDL screen
// screen_XXX are the dimensions of the SDL screen itself
// image_XXX are the image offsets into the screen
// screen_XXX are the dimensions of the screen itself
// Also contains relevant info for the graphics mode/filter to use
// when rendering the image
struct VideoMode {
@ -436,11 +425,13 @@ class FrameBuffer
This method is called to initialize the video subsystem
with the given video mode. Normally, it will also call setVidMode().
@param title The title for
@param mode The video mode to use
@param full Whether this is a fullscreen or windowed mode
@return False on any errors, else true
*/
virtual bool initSubsystem(VideoMode& mode) = 0;
virtual bool initSubsystem(VideoMode& mode, bool full) = 0;
/**
This method is called to change to the given video mode. If the mode
@ -452,6 +443,15 @@ class FrameBuffer
*/
virtual bool setVidMode(VideoMode& mode) = 0;
/**
Sets a hint that the underlying renderer may use; it is also free
to ignore it completely.
@param hint The hint to set
@param enabled Whether the hint should be turned on or off
*/
virtual void setHint(FBHint hint, bool enabled) = 0;
/**
This method is called to invalidate the contents of the entire
framebuffer (ie, mark the current content as invalid, and erase it on
@ -469,6 +469,26 @@ class FrameBuffer
*/
virtual FBSurface* createSurface(int w, int h, bool useBase = false) const = 0;
/**
Change scanline intensity and interpolation.
@param relative If non-zero, change current intensity by
'relative' amount, otherwise set to 'absolute'
@return New current intensity
*/
virtual uInt32 enableScanlines(int relative, int absolute = 50) { return absolute; }
virtual void enableScanlineInterpolation(bool enable) { }
/**
Grabs or ungrabs the mouse based on the given boolean value.
*/
virtual void grabMouse(bool grab) = 0;
/**
Set the icon for the main window.
*/
virtual void setWindowIcon() = 0;
/**
This method should be called anytime the TIA needs to be redrawn
to the screen (full indicating that a full redraw is required).
@ -495,15 +515,6 @@ class FrameBuffer
// The parent system for the framebuffer
OSystem* myOSystem;
// The SDL video buffer
SDL_Surface* myScreen;
// SDL initialization flags
// This is set by the base FrameBuffer class, and read by the derived classes
// If a FrameBuffer is successfully created, the derived classes must modify
// it to point to the actual flags used by the SDL_Surface
uInt32 mySDLFlags;
// Indicates if the entire frame need to redrawn
bool myRedrawEntireFrame;
@ -518,28 +529,13 @@ class FrameBuffer
// TIA palettes for normal and phosphor modes
// 'myDefPalette' also contains the UI palette
// The '24' version of myDefPalette is used in 24-bit colour mode,
// eliminating having to deal with endian and shift issues
// Phosphor mode doesn't have a corresponding '24' mode, since it
// would require a 192KB lookup table
Uint32 myDefPalette[256+kNumColors];
Uint32 myAvgPalette[256][256];
Uint8 myDefPalette24[256+kNumColors][3];
// Names of the TIA filters that can be used for this framebuffer
VariantList myTIAFilters;
private:
/**
Grabs or ungrabs the mouse based on the given boolean value.
*/
void grabMouse(bool grab);
/**
Set the icon for the main SDL window.
*/
void setWindowIcon();
/**
Draw pending messages.
*/
@ -622,7 +618,7 @@ class FrameBuffer
// any image 'centering'
GUI::Rect myImageRect;
// Dimensions of the SDL window (not always the same as the image)
// Dimensions of the main window (not always the same as the image)
GUI::Rect myScreenRect;
// Used for onscreen messages and frame statistics
@ -653,11 +649,11 @@ class FrameBuffer
/**
This class is basically a thin wrapper around an SDL_Surface structure.
We do it this way so the SDL stuff won't be dragged into the depths of
the codebase. All drawing is done into FBSurfaces, which are then
drawn into the FrameBuffer. Each FrameBuffer-derived class is
responsible for extending an FBSurface object suitable to the
This class is basically a thin wrapper around the video toolkit 'surface'
structure. We do it this way so the actual video toolkit won't be dragged
into the depths of the codebase. All drawing is done into FBSurfaces,
which are then drawn into the FrameBuffer. Each FrameBuffer-derived class
is responsible for extending an FBSurface object suitable to the
FrameBuffer type.
@author Stephen Anthony

View File

@ -23,14 +23,10 @@
#include "OSystem.hxx"
#include "Settings.hxx"
#include "FrameBuffer.hxx"
#ifdef DISPLAY_OPENGL
#include "FrameBufferGL.hxx"
#endif
#include "FrameBufferSDL2.hxx"
#include "Sound.hxx"
#ifdef SOUND_SUPPORT
#include "SoundSDL.hxx"
#include "SoundSDL2.hxx"
#else
#include "SoundNull.hxx"
#endif
@ -40,7 +36,9 @@
for the various ports of Stella, and always returns a valid media object
based on the specific port and restrictions on that port.
I think you can see why this mess was put into a factory class :)
As of SDL2, this code is greatly simplified. However, it remains here
in case we ever have multiple backend implementations again (should
not be necessary since SDL2 covers this nicely).
@author Stephen Anthony
@version $Id$
@ -50,35 +48,16 @@ class MediaFactory
public:
static FrameBuffer* createVideo(OSystem* osystem)
{
FrameBuffer* fb = (FrameBuffer*) NULL;
// OpenGL mode *may* fail, so we check for it first
#ifdef DISPLAY_OPENGL
if(osystem->settings().getString("video") == "gl")
{
const string& gl_lib = osystem->settings().getString("gl_lib");
if(FrameBufferGL::loadLibrary(gl_lib))
fb = new FrameBufferGL(osystem);
}
#endif
// This should never happen
assert(fb != NULL);
return fb;
return new FrameBufferSDL2(osystem);
}
static Sound* createAudio(OSystem* osystem)
{
Sound* sound = (Sound*) NULL;
#ifdef SOUND_SUPPORT
sound = new SoundSDL(osystem);
return new SoundSDL2(osystem);
#else
sound = new SoundNull(osystem);
return new SoundNull(osystem);
#endif
return sound;
}
};

View File

@ -98,9 +98,6 @@ OSystem::OSystem()
myMillisAtStart = (uInt32)(time(NULL) * 1000);
// Get built-in features
#ifdef DISPLAY_OPENGL
myFeatures += "OpenGL ";
#endif
#ifdef SOUND_SUPPORT
myFeatures += "Sound ";
#endif
@ -393,22 +390,19 @@ FBInitStatus OSystem::createFrameBuffer()
case EventHandler::S_PAUSE:
case EventHandler::S_MENU:
case EventHandler::S_CMDMENU:
fbstatus = myConsole->initializeVideo();
if(fbstatus != kSuccess)
goto fallback;
if((fbstatus = myConsole->initializeVideo()) != kSuccess)
return fbstatus;
break; // S_EMULATE, S_PAUSE, S_MENU, S_CMDMENU
case EventHandler::S_LAUNCHER:
fbstatus = myLauncher->initializeVideo();
if(fbstatus != kSuccess)
goto fallback;
if((fbstatus = myLauncher->initializeVideo()) != kSuccess)
return fbstatus;
break; // S_LAUNCHER
#ifdef DEBUGGER_SUPPORT
case EventHandler::S_DEBUGGER:
fbstatus = myDebugger->initializeVideo();
if(fbstatus != kSuccess)
goto fallback;
if((fbstatus = myDebugger->initializeVideo()) != kSuccess)
return fbstatus;
break; // S_DEBUGGER
#endif
@ -428,29 +422,6 @@ FBInitStatus OSystem::createFrameBuffer()
}
return fbstatus;
// GOTO are normally considered evil, unless well documented :)
// If initialization of video system fails while in OpenGL mode
// because OpenGL is unavailable, attempt to fallback to software mode
// Otherwise, pass the error to the parent
fallback:
if(fbstatus == kFailNotSupported && myFrameBuffer &&
myFrameBuffer->type() == kDoubleBuffer)
{
logMessage("ERROR: OpenGL mode failed, fallback to software", 0);
delete myFrameBuffer; myFrameBuffer = NULL;
mySettings->setValue("video", "soft");
FBInitStatus newstatus = createFrameBuffer();
if(newstatus == kSuccess)
{
setFramerate(60);
myFrameBuffer->showMessage("OpenGL mode failed, fallback to software",
kMiddleCenter, true);
}
return newstatus;
}
else
return fbstatus;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -511,16 +482,6 @@ string OSystem::createConsole(const FilesystemNode& rom, const string& md5sum,
#ifdef CHEATCODE_SUPPORT
myCheatManager->loadCheats(myRomMD5);
#endif
//////////////////////////////////////////////////////////////////////////
// For some reason, ATI video drivers for OpenGL in Win32 cause problems
// if the sound isn't initialized before the video
// According to the SDL documentation, it shouldn't matter what order the
// systems are initialized, but apparently it *does* matter
// For now, I'll just reverse the ordering, as suggested by 'zagon' at
// http://www.atariage.com/forums/index.php?showtopic=126090&view=findpost&p=1648693
// Hopefully it won't break anything else
//////////////////////////////////////////////////////////////////////////
myConsole->initializeAudio();
myEventHandler->reset(EventHandler::S_EMULATE);
myEventHandler->setMouseControllerMode(mySettings->getString("usemouse"));
if(createFrameBuffer() != kSuccess) // Takes care of initializeVideo()
@ -529,6 +490,7 @@ string OSystem::createConsole(const FilesystemNode& rom, const string& md5sum,
myEventHandler->reset(EventHandler::S_LAUNCHER);
return "ERROR: Couldn't create framebuffer for console";
}
myConsole->initializeAudio();
if(showmessage)
{

View File

@ -287,7 +287,7 @@ void Settings::validate()
s = getString("timing");
if(s != "sleep" && s != "busy") setInternal("timing", "sleep");
#ifdef DISPLAY_OPENGL
//FIXSDL
i = getInt("gl_aspectn");
if(i < 80 || i > 120) setInternal("gl_aspectn", "100");
i = getInt("gl_aspectp");
@ -295,8 +295,7 @@ void Settings::validate()
i = getInt("tv_filter");
if(i < 0 || i > 5) setInternal("tv_filter", "0");
#endif
//////////////////
#ifdef SOUND_SUPPORT
i = getInt("volume");
@ -356,7 +355,7 @@ void Settings::usage()
<< endl
<< " -video <type> Type is one of the following:\n"
<< " soft SDL software mode\n"
#ifdef DISPLAY_OPENGL
// FIXSDL
<< " gl SDL OpenGL mode\n"
<< endl
<< " -gl_lib <name> Specify the OpenGL library\n"
@ -381,7 +380,6 @@ void Settings::usage()
<< " -tv_fringing <value> Set TV effects custom fringing to value 1.0 - 1.0\n"
<< " -tv_bleed <value> Set TV effects custom bleed to value 1.0 - 1.0\n"
<< endl
#endif
<< " -tia_filter <filter> Use the specified filter in emulation mode\n"
<< " -fullscreen <1|0|-1> Use fullscreen mode (1 or 0), or disable switching to fullscreen entirely\n"
<< " -fullres <auto|WxH> The resolution to use in fullscreen mode\n"

View File

@ -33,7 +33,6 @@
#include "StringList.hxx"
#include "Widget.hxx"
#include "TabWidget.hxx"
#include "FrameBufferGL.hxx"
#include "NTSCFilter.hxx"
#include "VideoDialog.hxx"
@ -78,9 +77,9 @@ VideoDialog::VideoDialog(OSystem* osystem, DialogContainer* parent,
items.clear();
items.push_back("Software", "soft");
#ifdef DISPLAY_OPENGL
//FIXSDL
items.push_back("OpenGL", "gl");
#endif
/////////////
myRendererPopup = new PopUpWidget(myTab, font, xpos, ypos, pwidth, lineHeight,
items, "(*) ", lwidth);
wid.push_back(myRendererPopup);
@ -337,7 +336,7 @@ VideoDialog::VideoDialog(OSystem* osystem, DialogContainer* parent,
addBGroupToFocusList(wid);
// Disable certain functions when we know they aren't present
#ifndef DISPLAY_OPENGL
//FIXSDL
myGLFilterPopup->clearFlags(WIDGET_ENABLED);
myNAspectRatioSlider->clearFlags(WIDGET_ENABLED);
myNAspectRatioLabel->clearFlags(WIDGET_ENABLED);
@ -378,7 +377,7 @@ VideoDialog::VideoDialog(OSystem* osystem, DialogContainer* parent,
myCloneRGB->clearFlags(WIDGET_ENABLED);
myCloneBad->clearFlags(WIDGET_ENABLED);
myCloneCustom->clearFlags(WIDGET_ENABLED);
#endif
//////////////////////////
#ifndef WINDOWED_SUPPORT
myFullscreenCheckbox->clearFlags(WIDGET_ENABLED);
myCenterCheckbox->clearFlags(WIDGET_ENABLED);

View File

@ -102,7 +102,7 @@
<AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\yacc;..\emucore;..\common;..\common\tv_filters;..\gui;..\debugger\gui;..\debugger;..\windows;..\cheat;..\zlib;..\libpng;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>BSPF_WINDOWS;WIN32;NDEBUG;JOYSTICK_SUPPORT;DEBUGGER_SUPPORT;THUMB_SUPPORT;DISPLAY_OPENGL;WINDOWED_SUPPORT;SOUND_SUPPORT;CHEATCODE_SUPPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>BSPF_WINDOWS;WIN32;NDEBUG;JOYSTICK_SUPPORT;DEBUGGER_SUPPORT;THUMB_SUPPORT;WINDOWED_SUPPORT;SOUND_SUPPORT;CHEATCODE_SUPPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
@ -134,7 +134,7 @@ SDLmain.lib
<AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\yacc;..\emucore;..\common;..\common\tv_filters;..\gui;..\debugger\gui;..\debugger;..\windows;..\cheat;..\zlib;..\libpng;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>BSPF_WINDOWS;WIN32;NDEBUG;JOYSTICK_SUPPORT;DEBUGGER_SUPPORT;THUMB_SUPPORT;DISPLAY_OPENGL;WINDOWED_SUPPORT;SOUND_SUPPORT;CHEATCODE_SUPPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>BSPF_WINDOWS;WIN32;NDEBUG;JOYSTICK_SUPPORT;DEBUGGER_SUPPORT;THUMB_SUPPORT;WINDOWED_SUPPORT;SOUND_SUPPORT;CHEATCODE_SUPPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
@ -164,7 +164,7 @@ SDLmain.lib
<OmitFramePointers>true</OmitFramePointers>
<WholeProgramOptimization>false</WholeProgramOptimization>
<AdditionalIncludeDirectories>..\yacc;..\emucore;..\common;..\common\tv_filters;..\gui;..\debugger\gui;..\debugger;..\windows;..\cheat;..\zlib;..\libpng;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>BSPF_WINDOWS;WIN32;NDEBUG;JOYSTICK_SUPPORT;DEBUGGER_SUPPORT;THUMB_SUPPORT;DISPLAY_OPENGL;WINDOWED_SUPPORT;SOUND_SUPPORT;CHEATCODE_SUPPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>BSPF_WINDOWS;WIN32;NDEBUG;JOYSTICK_SUPPORT;DEBUGGER_SUPPORT;THUMB_SUPPORT;WINDOWED_SUPPORT;SOUND_SUPPORT;CHEATCODE_SUPPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<PrecompiledHeader>
@ -198,7 +198,7 @@ SDLmain.lib
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
<OmitFramePointers>true</OmitFramePointers>
<AdditionalIncludeDirectories>..\yacc;..\emucore;..\common;..\common\tv_filters;..\gui;..\debugger\gui;..\debugger;..\windows;..\cheat;..\zlib;..\libpng;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>BSPF_WINDOWS;WIN32;NDEBUG;JOYSTICK_SUPPORT;DEBUGGER_SUPPORT;THUMB_SUPPORT;DISPLAY_OPENGL;WINDOWED_SUPPORT;SOUND_SUPPORT;CHEATCODE_SUPPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>BSPF_WINDOWS;WIN32;NDEBUG;JOYSTICK_SUPPORT;DEBUGGER_SUPPORT;THUMB_SUPPORT;WINDOWED_SUPPORT;SOUND_SUPPORT;CHEATCODE_SUPPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<PrecompiledHeader>
@ -224,9 +224,9 @@ SDLmain.lib
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\common\Base.cxx" />
<ClCompile Include="..\common\FBSurfaceGL.cxx" />
<ClCompile Include="..\common\FBSurfaceUI.cxx" />
<ClCompile Include="..\common\FBSurfaceTIA.cxx" />
<ClCompile Include="..\common\FrameBufferGL.cxx" />
<ClCompile Include="..\common\FrameBufferSDL2.cxx" />
<ClCompile Include="..\common\FSNodeZIP.cxx" />
<ClCompile Include="..\common\MouseControl.cxx" />
<ClCompile Include="..\common\tv_filters\atari_ntsc.c" />
@ -288,7 +288,7 @@ SDLmain.lib
<ClCompile Include="SDL_win32_main.c" />
<ClCompile Include="SerialPortWINDOWS.cxx" />
<ClCompile Include="SettingsWINDOWS.cxx" />
<ClCompile Include="..\common\SoundSDL.cxx" />
<ClCompile Include="..\common\SoundSDL2.cxx" />
<ClCompile Include="..\emucore\AtariVox.cxx" />
<ClCompile Include="..\emucore\Booster.cxx" />
<ClCompile Include="..\emucore\Cart.cxx" />
@ -456,9 +456,9 @@ SDLmain.lib
<ClInclude Include="..\common\Array.hxx" />
<ClInclude Include="..\common\Base.hxx" />
<ClInclude Include="..\common\bspf.hxx" />
<ClInclude Include="..\common\FBSurfaceGL.hxx" />
<ClInclude Include="..\common\FBSurfaceUI.hxx" />
<ClInclude Include="..\common\FBSurfaceTIA.hxx" />
<ClInclude Include="..\common\FrameBufferGL.hxx" />
<ClInclude Include="..\common\FrameBufferSDL2.hxx" />
<ClInclude Include="..\common\FSNodeFactory.hxx" />
<ClInclude Include="..\common\FSNodeZIP.hxx" />
<ClInclude Include="..\common\MouseControl.hxx" />
@ -533,7 +533,7 @@ SDLmain.lib
<ClInclude Include="SerialPortWINDOWS.hxx" />
<ClInclude Include="SettingsWINDOWS.hxx" />
<ClInclude Include="..\common\SharedPtr.hxx" />
<ClInclude Include="..\common\SoundSDL.hxx" />
<ClInclude Include="..\common\SoundSDL2.hxx" />
<ClInclude Include="..\common\Stack.hxx" />
<ClInclude Include="..\common\Version.hxx" />
<ClInclude Include="..\common\VideoModeList.hxx" />

View File

@ -51,7 +51,7 @@
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\common\FrameBufferGL.cxx">
<ClCompile Include="..\common\FrameBufferSDL2.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="FSNodeWINDOWS.cxx">
@ -75,7 +75,7 @@
<ClCompile Include="SettingsWINDOWS.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\common\SoundSDL.cxx">
<ClCompile Include="..\common\SoundSDL2.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\emucore\AtariVox.cxx">
@ -567,7 +567,7 @@
<ClCompile Include="..\gui\LoggerDialog.cxx">
<Filter>Source Files\gui</Filter>
</ClCompile>
<ClCompile Include="..\common\FBSurfaceGL.cxx">
<ClCompile Include="..\common\FBSurfaceUI.cxx">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\common\FBSurfaceTIA.cxx">
@ -731,7 +731,7 @@
<ClInclude Include="..\common\bspf.hxx">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\common\FrameBufferGL.hxx">
<ClInclude Include="..\common\FrameBufferSDL2.hxx">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="HomeFinder.hxx">
@ -752,7 +752,7 @@
<ClInclude Include="..\common\SharedPtr.hxx">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\common\SoundSDL.hxx">
<ClInclude Include="..\common\SoundSDL2.hxx">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\common\Stack.hxx">
@ -1265,7 +1265,7 @@
<ClInclude Include="..\gui\LoggerDialog.hxx">
<Filter>Header Files\gui</Filter>
</ClInclude>
<ClInclude Include="..\common\FBSurfaceGL.hxx">
<ClInclude Include="..\common\FBSurfaceUI.hxx">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\common\FBSurfaceTIA.hxx">