PSP: got rid of SDL
svn-id: r49903
This commit is contained in:
parent
4ac81f3d18
commit
e7e8808aff
6 changed files with 2 additions and 70 deletions
|
@ -124,17 +124,13 @@ CXXFLAGS += -pg -g
|
||||||
LDFLAGS += -pg
|
LDFLAGS += -pg
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# SDL Libs and Flags
|
|
||||||
SDLFLAGS := $(shell $(PSPBIN)/sdl-config --cflags)
|
|
||||||
SDLLIBS := $(shell $(PSPBIN)/sdl-config --libs)
|
|
||||||
# PSP LIBS
|
# PSP LIBS
|
||||||
PSPLIBS = -lpspprof -lpspvfpu -lpspdebug -lpspgu -lpspge -lpspdisplay -lpspctrl -lpspsdk \
|
PSPLIBS = -lpspprof -lpspvfpu -lpspdebug -lpspgu -lpspge -lpspdisplay -lpspctrl -lpspsdk \
|
||||||
-lpsputility -lpspuser -lpsppower -lpsphprm -lpspsdk -lpsprtc -lpspaudio -lpspaudiocodec \
|
-lpsputility -lpspuser -lpsppower -lpsphprm -lpspsdk -lpsprtc -lpspaudio -lpspaudiocodec \
|
||||||
-lpspkernel
|
-lpspkernel
|
||||||
|
|
||||||
# Add in PSPSDK includes and libraries.
|
# Add in PSPSDK includes and libraries.
|
||||||
CXXFLAGS += $(SDLFLAGS)
|
LIBS += -lpng -lz -lstdc++ -lc -lm $(PSPLIBS)
|
||||||
LIBS += -lpng -lSDL -lz $(findstring -lGL,$(SDLLIBS)) -lstdc++ -lc -lm $(filter -L%,$(SDLLIBS)) $(PSPLIBS)
|
|
||||||
|
|
||||||
OBJS := powerman.o \
|
OBJS := powerman.o \
|
||||||
psp_main.o \
|
psp_main.o \
|
||||||
|
|
|
@ -99,8 +99,6 @@ To build ScummVM for PSP you need:
|
||||||
Note: This usually gets installed by the PSP toolchain,
|
Note: This usually gets installed by the PSP toolchain,
|
||||||
so you don't have to do it manually.
|
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)
|
- zlib (svn co svn://svn.pspdev.org/psp/trunk/zlib)
|
||||||
|
|
||||||
- libPNG (svn co svn://svn.pspdev.org/psp/trunk/libpng)
|
- libPNG (svn co svn://svn.pspdev.org/psp/trunk/libpng)
|
||||||
|
|
|
@ -99,8 +99,6 @@ To build ScummVM for PSP you need:
|
||||||
Note: This usually gets installed by the PSP toolchain,
|
Note: This usually gets installed by the PSP toolchain,
|
||||||
so you don't have to do it manually.
|
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)
|
- zlib (svn co svn://svn.pspdev.org/psp/trunk/zlib)
|
||||||
|
|
||||||
- libPNG (svn co svn://svn.pspdev.org/psp/trunk/libpng)
|
- libPNG (svn co svn://svn.pspdev.org/psp/trunk/libpng)
|
||||||
|
|
|
@ -48,8 +48,6 @@
|
||||||
|
|
||||||
#include "backends/platform/psp/trace.h"
|
#include "backends/platform/psp/trace.h"
|
||||||
|
|
||||||
#define USE_PSP_AUDIO
|
|
||||||
|
|
||||||
#define SAMPLES_PER_SEC 44100
|
#define SAMPLES_PER_SEC 44100
|
||||||
|
|
||||||
static int timer_handler(int t) {
|
static int timer_handler(int t) {
|
||||||
|
@ -58,14 +56,6 @@ static int timer_handler(int t) {
|
||||||
return 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() {}
|
OSystem_PSP::~OSystem_PSP() {}
|
||||||
|
|
||||||
#define PSP_SCREEN_WIDTH 480
|
#define PSP_SCREEN_WIDTH 480
|
||||||
|
@ -89,8 +79,6 @@ void OSystem_PSP::initBackend() {
|
||||||
_inputHandler.setKeyboard(&_keyboard);
|
_inputHandler.setKeyboard(&_keyboard);
|
||||||
_inputHandler.init();
|
_inputHandler.init();
|
||||||
|
|
||||||
initSDL();
|
|
||||||
|
|
||||||
_savefile = new PSPSaveFileManager;
|
_savefile = new PSPSaveFileManager;
|
||||||
|
|
||||||
_timer = new DefaultTimerManager();
|
_timer = new DefaultTimerManager();
|
||||||
|
@ -388,7 +376,6 @@ void OSystem_PSP::setupMixer(void) {
|
||||||
|
|
||||||
assert(!_mixer);
|
assert(!_mixer);
|
||||||
|
|
||||||
#ifdef USE_PSP_AUDIO
|
|
||||||
if (!_audio.open(samplesPerSec, 2, samples, mixCallback, this)) {
|
if (!_audio.open(samplesPerSec, 2, samples, mixCallback, this)) {
|
||||||
PSP_ERROR("failed to open audio\n");
|
PSP_ERROR("failed to open audio\n");
|
||||||
return;
|
return;
|
||||||
|
@ -398,46 +385,10 @@ void OSystem_PSP::setupMixer(void) {
|
||||||
assert(_mixer);
|
assert(_mixer);
|
||||||
_mixer->setReady(true);
|
_mixer->setReady(true);
|
||||||
_audio.unpause();
|
_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() {
|
void OSystem_PSP::quit() {
|
||||||
#ifdef USE_PSP_AUDIO
|
|
||||||
_audio.close();
|
_audio.close();
|
||||||
#else
|
|
||||||
SDL_CloseAudio();
|
|
||||||
#endif
|
|
||||||
SDL_Quit();
|
|
||||||
sceKernelExitGame();
|
sceKernelExitGame();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,8 +42,6 @@
|
||||||
#include "backends/timer/psp/timer.h"
|
#include "backends/timer/psp/timer.h"
|
||||||
#include "backends/platform/psp/thread.h"
|
#include "backends/platform/psp/thread.h"
|
||||||
|
|
||||||
#include <SDL.h>
|
|
||||||
|
|
||||||
class OSystem_PSP : public BaseBackend {
|
class OSystem_PSP : public BaseBackend {
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -64,8 +62,6 @@ private:
|
||||||
PspTimer _pspTimer;
|
PspTimer _pspTimer;
|
||||||
PspRtc _pspRtc;
|
PspRtc _pspRtc;
|
||||||
|
|
||||||
void initSDL();
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
OSystem_PSP() : _savefile(0), _mixer(0), _timer(0), _pendingUpdate(false), _pendingUpdateCounter(0) {}
|
OSystem_PSP() : _savefile(0), _mixer(0), _timer(0), _pendingUpdate(false), _pendingUpdateCounter(0) {}
|
||||||
~OSystem_PSP();
|
~OSystem_PSP();
|
||||||
|
|
9
configure
vendored
9
configure
vendored
|
@ -2484,14 +2484,7 @@ case $_backend in
|
||||||
;;
|
;;
|
||||||
psp)
|
psp)
|
||||||
DEFINES="$DEFINES -D__PSP__ -DDISABLE_TEXT_CONSOLE -DDISABLE_COMMAND_LINE -DDISABLE_DOSBOX_OPL"
|
DEFINES="$DEFINES -D__PSP__ -DDISABLE_TEXT_CONSOLE -DDISABLE_COMMAND_LINE -DDISABLE_DOSBOX_OPL"
|
||||||
INCLUDES="$INCLUDES -I$PSPDEV/psp/include/SDL"
|
LIBS="$LIBS -lpng -Wl,-Map,mapfile.txt"
|
||||||
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
|
|
||||||
;;
|
;;
|
||||||
samsungtv)
|
samsungtv)
|
||||||
find_sdlconfig
|
find_sdlconfig
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue