diff options
author | Stephen Kennedy | 2008-07-22 00:15:13 +0000 |
---|---|---|
committer | Stephen Kennedy | 2008-07-22 00:15:13 +0000 |
commit | 0861fa4c00f0ecb82f3607127c8278d55f95376c (patch) | |
tree | d757c116b163a401f00859503a7db755b6627504 /backends/platform/psp | |
parent | a58080bd58bbcc9f7c710fade55620049bae14e4 (diff) | |
parent | e09eb75ef77d6e76b763b3a47540a530013a887f (diff) | |
download | scummvm-rg350-0861fa4c00f0ecb82f3607127c8278d55f95376c.tar.gz scummvm-rg350-0861fa4c00f0ecb82f3607127c8278d55f95376c.tar.bz2 scummvm-rg350-0861fa4c00f0ecb82f3607127c8278d55f95376c.zip |
Merged revisions 32879,32883,32895,32899,32902-32904,32910-32912,32923-32924,32930-32931,32938,32940,32948-32949,32951,32960-32964,32966-32970,32972-32974,32976,32978,32983,32986-32990,32992,32994,33002-33004,33006-33007,33009-33010,33014,33017,33021-33023,33030,33033,33052-33053,33056-33058,33061-33064,33068,33070,33072,33075,33078-33079,33083,33086-33087,33089,33094-33096,33098-33099,33104,33108-33109,33114-33117,33120,33135-33146,33160,33162,33165,33167-33169 via svnmerge from
https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk
svn-id: r33185
Diffstat (limited to 'backends/platform/psp')
-rw-r--r-- | backends/platform/psp/Makefile | 28 | ||||
-rw-r--r-- | backends/platform/psp/osys_psp.cpp | 50 | ||||
-rw-r--r-- | backends/platform/psp/osys_psp.h | 8 |
3 files changed, 65 insertions, 21 deletions
diff --git a/backends/platform/psp/Makefile b/backends/platform/psp/Makefile index aa27f388b9..ca09286c4d 100644 --- a/backends/platform/psp/Makefile +++ b/backends/platform/psp/Makefile @@ -2,10 +2,36 @@ # $URL$ # $Id$ +ENABLED=STATIC_PLUGIN + #control build DISABLE_SCALERS = true DISABLE_HQ_SCALERS = true +ENABLE_SCUMM = $(ENABLED) +ENABLE_SCUMM_7_8 = $(ENABLED) +#ENABLE_HE = $(ENABLED) +ENABLE_AGI = $(ENABLED) +ENABLE_AGOS = $(ENABLED) +#ENABLE_CINE = $(ENABLED) +#ENABLE_CRUISE = $(ENABLED) +ENABLE_DRASCULA = $(ENABLED) +ENABLE_GOB = $(ENABLED) +#ENABLE_IGOR = $(ENABLED) +ENABLE_KYRA = $(ENABLED) +ENABLE_LURE = $(ENABLED) +#ENABLE_M4 = $(ENABLED) +#ENABLE_MADE = $(ENABLED) +#ENABLE_PARALLACTION = $(ENABLED) +#ENABLE_QUEEN = $(ENABLED) +#ENABLE_SAGA = $(ENABLED) +ENABLE_SKY = $(ENABLED) +ENABLE_SWORD1 = $(ENABLED) +ENABLE_SWORD2 = $(ENABLED) +#ENABLE_TINSEL = $(ENABLED) +#ENABLE_TOUCHE = $(ENABLED) + + srcdir = ../../.. VPATH = $(srcdir) HAVE_GCC3 = false @@ -63,6 +89,8 @@ OBJS := psp_main.o \ kbd_l_c.o \ trace.o +DEPDIR = .deps + include $(srcdir)/Makefile.common PSP_EBOOT_SFO = param.sfo diff --git a/backends/platform/psp/osys_psp.cpp b/backends/platform/psp/osys_psp.cpp index 2d18b4bfd6..6e9b5980d4 100644 --- a/backends/platform/psp/osys_psp.cpp +++ b/backends/platform/psp/osys_psp.cpp @@ -72,7 +72,7 @@ const OSystem::GraphicsMode OSystem_PSP::s_supportedGraphicsModes[] = { }; -OSystem_PSP::OSystem_PSP() : _screenWidth(0), _screenHeight(0), _overlayWidth(0), _overlayHeight(0), _offscreen(0), _overlayBuffer(0), _overlayVisible(false), _shakePos(0), _mouseBuf(0), _prevButtons(0), _lastPadCheck(0), _padAccel(0) { +OSystem_PSP::OSystem_PSP() : _screenWidth(0), _screenHeight(0), _overlayWidth(0), _overlayHeight(0), _offscreen(0), _overlayBuffer(0), _overlayVisible(false), _shakePos(0), _mouseBuf(0), _prevButtons(0), _lastPadCheck(0), _padAccel(0), _mixer(0) { memset(_palette, 0, sizeof(_palette)); @@ -99,11 +99,11 @@ OSystem_PSP::~OSystem_PSP() { void OSystem_PSP::initBackend() { _savefile = new DefaultSaveFileManager(); - _mixer = new Audio::MixerImpl(this); _timer = new DefaultTimerManager(); - setSoundCallback(Audio::Mixer::mixCallback, _mixer); setTimerCallback(&timer_handler, 10); + setupMixer(); + OSystem::initBackend(); } @@ -586,7 +586,15 @@ void OSystem_PSP::deleteMutex(MutexRef mutex) { SDL_DestroyMutex((SDL_mutex *)mutex); } -bool OSystem_PSP::setSoundCallback(SoundProc proc, void *param) { +void OSystem_PSP::mixCallback(void *sys, byte *samples, int len) { + OSystem_PSP *this_ = (OSystem_PSP *)sys; + assert(this_); + + if (this_->_mixer) + this_->_mixer->mixCallback(samples, len); +} + +void OSystem_PSP::setupMixer(void) { SDL_AudioSpec desired; SDL_AudioSpec obtained; @@ -613,21 +621,29 @@ bool OSystem_PSP::setSoundCallback(SoundProc proc, void *param) { desired.format = AUDIO_S16SYS; desired.channels = 2; desired.samples = samples; - desired.callback = proc; - desired.userdata = param; + desired.callback = mixCallback; + desired.userdata = this; + + assert(!_mixer); + _mixer = new Audio::MixerImpl(this); + assert(_mixer); + if (SDL_OpenAudio(&desired, &obtained) != 0) { - return false; + warning("Could not open audio: %s", SDL_GetError()); + _samplesPerSec = 0; + _mixer->setReady(false); + } else { + // Note: This should be the obtained output rate, but it seems that at + // least on some platforms SDL will lie and claim it did get the rate + // even if it didn't. Probably only happens for "weird" rates, though. + _samplesPerSec = obtained.freq; + + // Tell the mixer that we are ready and start the sound processing + _mixer->setOutputRate(_samplesPerSec); + _mixer->setReady(true); + + SDL_PauseAudio(0); } - // Note: This should be the obtained output rate, but it seems that at - // least on some platforms SDL will lie and claim it did get the rate - // even if it didn't. Probably only happens for "weird" rates, though. - _samplesPerSec = obtained.freq; - SDL_PauseAudio(0); - return true; -} - -int OSystem_PSP::getOutputSampleRate() const { - return _samplesPerSec; } void OSystem_PSP::quit() { diff --git a/backends/platform/psp/osys_psp.h b/backends/platform/psp/osys_psp.h index 64514f6872..dca6ccb036 100644 --- a/backends/platform/psp/osys_psp.h +++ b/backends/platform/psp/osys_psp.h @@ -26,6 +26,7 @@ #include "common/scummsys.h" #include "common/system.h" #include "graphics/surface.h" +#include "sound/mixer_intern.h" #include "backends/fs/psp/psp-fs-factory.h" @@ -71,7 +72,7 @@ protected: SceCtrlData pad; Common::SaveFileManager *_savefile; - Audio::Mixer *_mixer; + Audio::MixerImpl *_mixer; Common::TimerManager *_timer; public: @@ -129,9 +130,8 @@ public: virtual void unlockMutex(MutexRef mutex); virtual void deleteMutex(MutexRef mutex); - typedef void (*SoundProc)(void *param, byte *buf, int len); - virtual bool setSoundCallback(SoundProc proc, void *param); - virtual int getOutputSampleRate() const; + static void mixCallback(void *sys, byte *samples, int len); + virtual void setupMixer(void); Common::SaveFileManager *getSavefileManager() { return _savefile; } Audio::Mixer *getMixer() { return _mixer; } |