mirror of https://github.com/stella-emu/stella.git
o added specific PSP Framebuffer, derived from FrameBufferSoft. Just changed the createScreen Method to reflect the PSP specific windows size for HW and SW display modes.
o Just meant as a placeholder to get the psp build working again and for further improvements o No optimized Routines yet ! git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@783 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
1417e20102
commit
ba3ca9a4ba
|
@ -0,0 +1,119 @@
|
|||
//============================================================================
|
||||
//
|
||||
// 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
|
||||
//
|
||||
// Copyright (c) 1995-2005 by Bradford W. Mott and the Stella team
|
||||
//
|
||||
// See the file "license" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id: FrameBufferPSP.cxx,v 1.1 2005-09-18 14:35:59 optixx Exp $
|
||||
//============================================================================
|
||||
|
||||
#include <SDL.h>
|
||||
#include <SDL_syswm.h>
|
||||
#include <sstream>
|
||||
|
||||
#include "Console.hxx"
|
||||
#include "FrameBufferPSP.hxx"
|
||||
#include "MediaSrc.hxx"
|
||||
#include "Settings.hxx"
|
||||
#include "OSystem.hxx"
|
||||
#include "Font.hxx"
|
||||
#include "GuiUtils.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
FrameBufferPSP::FrameBufferPSP(OSystem* osystem)
|
||||
: FrameBufferSoft(osystem)
|
||||
{
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
FrameBufferPSP::~FrameBufferPSP()
|
||||
{
|
||||
delete myRectList;
|
||||
delete myOverlayRectList;
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool FrameBufferPSP::initSubsystem()
|
||||
{
|
||||
// Set up the rectangle list to be used in the dirty update
|
||||
delete myRectList;
|
||||
myRectList = new RectList();
|
||||
delete myOverlayRectList;
|
||||
myOverlayRectList = new RectList();
|
||||
|
||||
#ifdef PSP_DEBUG
|
||||
fprintf(stdout, "FrameBufferPSP::initSubsystem\n");
|
||||
#endif
|
||||
if(!myRectList || !myOverlayRectList)
|
||||
{
|
||||
cerr << "ERROR: Unable to get memory for SDL rects" << endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Create the screen
|
||||
if(!createScreen())
|
||||
return false;
|
||||
|
||||
// Show some info
|
||||
if(myOSystem->settings().getBool("showinfo"))
|
||||
cout << "Video rendering: Software mode" << endl << endl;
|
||||
|
||||
// Precompute the GUI palette
|
||||
// We abuse the concept of 'enum' by referring directly to the integer values
|
||||
for(uInt8 i = 0; i < kNumColors-256; i++)
|
||||
myPalette[i+256] = mapRGB(ourGUIColors[i][0], ourGUIColors[i][1], ourGUIColors[i][2]);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool FrameBufferPSP::createScreen()
|
||||
{
|
||||
myScreenDim.x = myScreenDim.y = 0;
|
||||
|
||||
myScreenDim.w = myBaseDim.w;
|
||||
myScreenDim.h = myBaseDim.h;
|
||||
|
||||
// In software mode, the image and screen dimensions are always the same
|
||||
myImageDim = myScreenDim;
|
||||
if (mySDLFlags & SDL_HWSURFACE )
|
||||
{
|
||||
/* double buff is broken */
|
||||
mySDLFlags = SDL_HWSURFACE;
|
||||
myScreenDim.w = myDesktopDim.w;
|
||||
myScreenDim.h = myDesktopDim.w;
|
||||
#ifdef PSP_DEBUG
|
||||
fprintf(stdout, "FrameBufferPSP::createScreen Hardware Mode "
|
||||
"myScreenDim.w='%i' myScreenDim.h='%i'\n",
|
||||
myScreenDim.w,myScreenDim.h);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef PSP_DEBUG
|
||||
fprintf(stdout, "FrameBufferPSP::createScreen Software Mode "
|
||||
"myScreenDim.w='%i' myScreenDim.h='%i'\n",
|
||||
myScreenDim.w,myScreenDim.h);
|
||||
#endif
|
||||
}
|
||||
|
||||
myScreen = SDL_SetVideoMode(myScreenDim.w, myScreenDim.h, 0, mySDLFlags);
|
||||
if(myScreen == NULL)
|
||||
{
|
||||
fprintf(stdout,"ERROR: Unable to open SDL window: %s\n",SDL_GetError());
|
||||
return false;
|
||||
}
|
||||
myOSystem->eventHandler().refreshDisplay();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
//============================================================================
|
||||
//
|
||||
// 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
|
||||
//
|
||||
// Copyright (c) 1995-2005 by Bradford W. Mott and the Stella team
|
||||
//
|
||||
// See the file "license" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id: FrameBufferPSP.hxx,v 1.1 2005-09-18 14:35:59 optixx Exp $
|
||||
//============================================================================
|
||||
|
||||
#ifndef FRAMEBUFFER_PSP_HXX
|
||||
#define FRAMEBUFFER_PSP_HXX
|
||||
|
||||
|
||||
|
||||
#include "Font.hxx"
|
||||
#include "bspf.hxx"
|
||||
#include "GuiUtils.hxx"
|
||||
#include "FrameBufferSoft.hxx"
|
||||
|
||||
|
||||
/**
|
||||
This class implements an SDL software framebuffer.
|
||||
|
||||
@author Stephen Anthony
|
||||
@version $Id: FrameBufferPSP.hxx,v 1.1 2005-09-18 14:35:59 optixx Exp $
|
||||
*/
|
||||
class FrameBufferPSP : public FrameBufferSoft
|
||||
{
|
||||
public:
|
||||
/**
|
||||
Creates a new software framebuffer
|
||||
*/
|
||||
FrameBufferPSP(OSystem* osystem);
|
||||
|
||||
/**
|
||||
Destructor
|
||||
*/
|
||||
virtual ~FrameBufferPSP();
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// The following methods are derived from FrameBuffer.hxx
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
This method is called to initialize software video mode.
|
||||
Return false if any operation fails, otherwise return true.
|
||||
*/
|
||||
virtual bool initSubsystem();
|
||||
|
||||
/**
|
||||
This method is called whenever the screen needs to be recreated.
|
||||
It updates the global screen variable.
|
||||
*/
|
||||
virtual bool createScreen();
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
|
@ -3,8 +3,8 @@ MODULE := src/psp
|
|||
MODULE_OBJS := \
|
||||
src/psp/FSNodePSP.o \
|
||||
src/psp/OSystemPSP.o \
|
||||
src/psp/SettingsPSP.o
|
||||
|
||||
src/psp/SettingsPSP.o \
|
||||
src/psp/FrameBufferPSP.o
|
||||
MODULE_DIRS += \
|
||||
src/psp
|
||||
|
||||
|
|
Loading…
Reference in New Issue