fix compilation / modularization update
svn-id: r25487
This commit is contained in:
parent
b14bb6206a
commit
fb76c7d2e5
2 changed files with 40 additions and 2 deletions
|
@ -30,6 +30,10 @@
|
||||||
#include "common/rect.h"
|
#include "common/rect.h"
|
||||||
#include "osys_psp.h"
|
#include "osys_psp.h"
|
||||||
|
|
||||||
|
#include "backends/saves/default/default-saves.h"
|
||||||
|
#include "backends/timer/default/default-timer.h"
|
||||||
|
#include "sound/mixer.h"
|
||||||
|
|
||||||
#include "common/config-manager.h"
|
#include "common/config-manager.h"
|
||||||
|
|
||||||
#include <pspgu.h>
|
#include <pspgu.h>
|
||||||
|
@ -51,6 +55,12 @@ void putPixel(uint16 x, uint16 y, unsigned long colour) {
|
||||||
*(unsigned short *)(DrawBuffer + (y << 9) + x ) = colour;
|
*(unsigned short *)(DrawBuffer + (y << 9) + x ) = colour;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int timer_handler(int t) {
|
||||||
|
DefaultTimerManager *tm = (DefaultTimerManager *)g_system->getTimerManager();
|
||||||
|
tm->handler();
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
const OSystem::GraphicsMode OSystem_PSP::s_supportedGraphicsModes[] = {
|
const OSystem::GraphicsMode OSystem_PSP::s_supportedGraphicsModes[] = {
|
||||||
{ "320x200 (centered)", "320x200 16-bit centered", CENTERED_320X200 },
|
{ "320x200 (centered)", "320x200 16-bit centered", CENTERED_320X200 },
|
||||||
{ "353x272 (best-fit, centered)", "353x272 16-bit centered", CENTERED_435X272 },
|
{ "353x272 (best-fit, centered)", "353x272 16-bit centered", CENTERED_435X272 },
|
||||||
|
@ -81,6 +91,18 @@ OSystem_PSP::~OSystem_PSP() {
|
||||||
if (_mouseBuf) free(_mouseBuf);
|
if (_mouseBuf) free(_mouseBuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void OSystem_PSP::initBackend() {
|
||||||
|
_savefile = new DefaultSaveFileManager();
|
||||||
|
_mixer = new Audio::Mixer();
|
||||||
|
_timer = new DefaultTimerManager();
|
||||||
|
setSoundCallback(Audio::Mixer::mixCallback, _mixer);
|
||||||
|
setTimerCallback(&timer_handler, 10);
|
||||||
|
|
||||||
|
OSystem::initBackend();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool OSystem_PSP::hasFeature(Feature f) {
|
bool OSystem_PSP::hasFeature(Feature f) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,6 +41,10 @@ namespace Graphics {
|
||||||
struct Surface;
|
struct Surface;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace Common {
|
||||||
|
class SaveFileManager;
|
||||||
|
class TimerManager;
|
||||||
|
}
|
||||||
|
|
||||||
class OSystem_PSP : public OSystem {
|
class OSystem_PSP : public OSystem {
|
||||||
public:
|
public:
|
||||||
|
@ -73,11 +77,17 @@ protected:
|
||||||
uint32 _samplesPerSec;
|
uint32 _samplesPerSec;
|
||||||
SceCtrlData pad;
|
SceCtrlData pad;
|
||||||
|
|
||||||
|
Common::SaveFileManager *_savefile;
|
||||||
|
Audio::Mixer *_mixer;
|
||||||
|
Common::TimerManager *_timer;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
OSystem_PSP();
|
OSystem_PSP();
|
||||||
virtual ~OSystem_PSP();
|
virtual ~OSystem_PSP();
|
||||||
|
|
||||||
|
virtual void initBackend();
|
||||||
|
|
||||||
virtual bool hasFeature(Feature f);
|
virtual bool hasFeature(Feature f);
|
||||||
virtual void setFeatureState(Feature f, bool enable);
|
virtual void setFeatureState(Feature f, bool enable);
|
||||||
virtual bool getFeatureState(Feature f);
|
virtual bool getFeatureState(Feature f);
|
||||||
|
@ -117,6 +127,7 @@ public:
|
||||||
virtual uint32 getMillis();
|
virtual uint32 getMillis();
|
||||||
virtual void delayMillis(uint msecs);
|
virtual void delayMillis(uint msecs);
|
||||||
|
|
||||||
|
typedef int (*TimerProc)(int interval);
|
||||||
virtual void setTimerCallback(TimerProc callback, int interval);
|
virtual void setTimerCallback(TimerProc callback, int interval);
|
||||||
|
|
||||||
virtual MutexRef createMutex(void);
|
virtual MutexRef createMutex(void);
|
||||||
|
@ -124,10 +135,15 @@ public:
|
||||||
virtual void unlockMutex(MutexRef mutex);
|
virtual void unlockMutex(MutexRef mutex);
|
||||||
virtual void deleteMutex(MutexRef mutex);
|
virtual void deleteMutex(MutexRef mutex);
|
||||||
|
|
||||||
|
typedef void (*SoundProc)(void *param, byte *buf, int len);
|
||||||
virtual bool setSoundCallback(SoundProc proc, void *param);
|
virtual bool setSoundCallback(SoundProc proc, void *param);
|
||||||
virtual void clearSoundCallback();
|
virtual void clearSoundCallback();
|
||||||
virtual int getOutputSampleRate() const;
|
virtual int getOutputSampleRate() const;
|
||||||
|
|
||||||
|
Common::SaveFileManager *getSavefileManager() { return _savefile; }
|
||||||
|
Audio::Mixer *getMixer() { return _mixer; }
|
||||||
|
Common::TimerManager *getTimerManager() { return _timer; }
|
||||||
|
|
||||||
virtual void quit();
|
virtual void quit();
|
||||||
|
|
||||||
virtual void setWindowCaption(const char *caption);
|
virtual void setWindowCaption(const char *caption);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue