PSP: got rid of SDL

svn-id: r49903
This commit is contained in:
Yotam Barnoy 2010-06-16 09:04:27 +00:00
parent 4ac81f3d18
commit e7e8808aff
6 changed files with 2 additions and 70 deletions

View file

@ -124,17 +124,13 @@ CXXFLAGS += -pg -g
LDFLAGS += -pg
endif
# SDL Libs and Flags
SDLFLAGS := $(shell $(PSPBIN)/sdl-config --cflags)
SDLLIBS := $(shell $(PSPBIN)/sdl-config --libs)
# PSP LIBS
PSPLIBS = -lpspprof -lpspvfpu -lpspdebug -lpspgu -lpspge -lpspdisplay -lpspctrl -lpspsdk \
-lpsputility -lpspuser -lpsppower -lpsphprm -lpspsdk -lpsprtc -lpspaudio -lpspaudiocodec \
-lpspkernel
# Add in PSPSDK includes and libraries.
CXXFLAGS += $(SDLFLAGS)
LIBS += -lpng -lSDL -lz $(findstring -lGL,$(SDLLIBS)) -lstdc++ -lc -lm $(filter -L%,$(SDLLIBS)) $(PSPLIBS)
LIBS += -lpng -lz -lstdc++ -lc -lm $(PSPLIBS)
OBJS := powerman.o \
psp_main.o \

View file

@ -99,8 +99,6 @@ To build ScummVM for PSP you need:
Note: This usually gets installed by the PSP toolchain,
so you don't have to do it manually.
- SDL (svn co svn://svn.pspdev.org/psp/trunk/SDL)
- zlib (svn co svn://svn.pspdev.org/psp/trunk/zlib)
- libPNG (svn co svn://svn.pspdev.org/psp/trunk/libpng)

View file

@ -99,8 +99,6 @@ To build ScummVM for PSP you need:
Note: This usually gets installed by the PSP toolchain,
so you don't have to do it manually.
- SDL (svn co svn://svn.pspdev.org/psp/trunk/SDL)
- zlib (svn co svn://svn.pspdev.org/psp/trunk/zlib)
- libPNG (svn co svn://svn.pspdev.org/psp/trunk/libpng)

View file

@ -48,8 +48,6 @@
#include "backends/platform/psp/trace.h"
#define USE_PSP_AUDIO
#define SAMPLES_PER_SEC 44100
static int timer_handler(int t) {
@ -58,14 +56,6 @@ static int timer_handler(int t) {
return t;
}
void OSystem_PSP::initSDL() {
#ifdef USE_PSP_AUDIO
SDL_Init(0);
#else
SDL_Init(SDL_INIT_AUDIO);
#endif
}
OSystem_PSP::~OSystem_PSP() {}
#define PSP_SCREEN_WIDTH 480
@ -89,8 +79,6 @@ void OSystem_PSP::initBackend() {
_inputHandler.setKeyboard(&_keyboard);
_inputHandler.init();
initSDL();
_savefile = new PSPSaveFileManager;
_timer = new DefaultTimerManager();
@ -388,7 +376,6 @@ void OSystem_PSP::setupMixer(void) {
assert(!_mixer);
#ifdef USE_PSP_AUDIO
if (!_audio.open(samplesPerSec, 2, samples, mixCallback, this)) {
PSP_ERROR("failed to open audio\n");
return;
@ -398,46 +385,10 @@ void OSystem_PSP::setupMixer(void) {
assert(_mixer);
_mixer->setReady(true);
_audio.unpause();
#else
SDL_AudioSpec obtained;
SDL_AudioSpec desired;
memset(&desired, 0, sizeof(desired));
desired.freq = samplesPerSec;
desired.format = AUDIO_S16SYS;
desired.channels = 2;
desired.samples = samples;
desired.callback = mixCallback;
desired.userdata = this;
if (SDL_OpenAudio(&desired, &obtained) != 0) {
warning("Could not open audio: %s", SDL_GetError());
_mixer = new Audio::MixerImpl(this, samplesPerSec);
assert(_mixer);
_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;
// Create the mixer instance and start the sound processing
_mixer = new Audio::MixerImpl(this, samplesPerSec);
assert(_mixer);
_mixer->setReady(true);
SDL_PauseAudio(0);
}
#endif /* USE_PSP_AUDIO */
}
void OSystem_PSP::quit() {
#ifdef USE_PSP_AUDIO
_audio.close();
#else
SDL_CloseAudio();
#endif
SDL_Quit();
sceKernelExitGame();
}

View file

@ -42,8 +42,6 @@
#include "backends/timer/psp/timer.h"
#include "backends/platform/psp/thread.h"
#include <SDL.h>
class OSystem_PSP : public BaseBackend {
private:
@ -64,8 +62,6 @@ private:
PspTimer _pspTimer;
PspRtc _pspRtc;
void initSDL();
public:
OSystem_PSP() : _savefile(0), _mixer(0), _timer(0), _pendingUpdate(false), _pendingUpdateCounter(0) {}
~OSystem_PSP();

9
configure vendored
View file

@ -2484,14 +2484,7 @@ case $_backend in
;;
psp)
DEFINES="$DEFINES -D__PSP__ -DDISABLE_TEXT_CONSOLE -DDISABLE_COMMAND_LINE -DDISABLE_DOSBOX_OPL"
INCLUDES="$INCLUDES -I$PSPDEV/psp/include/SDL"
LIBS="$LIBS -lpng -lSDL -Wl,-Map,mapfile.txt"
SDLLIBS=`$PSPDEV/psp/bin/sdl-config --libs`
if `echo "$SDLLIBS" | grep ".*-lGL.*" 1>/dev/null 2>&1`
then
LIBS="$LIBS -lGL"
fi
LIBS="$LIBS -lpng -Wl,-Map,mapfile.txt"
;;
samsungtv)
find_sdlconfig