Skip to content

Instantly share code, notes, and snippets.

@bb010g
Created July 20, 2020 08:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bb010g/75a00101d18d1ebabb2c776747a3e7f4 to your computer and use it in GitHub Desktop.
Save bb010g/75a00101d18d1ebabb2c776747a3e7f4 to your computer and use it in GitHub Desktop.
X-Moto 0.4.2 PSP
diff --git a/changes.txt b/changes.txt
new file mode 100644
index 0000000..3aba1b5
--- /dev/null
+++ b/changes.txt
@@ -0,0 +1,9 @@
+Change log file for X-Moto-PSP
+
+version 0.2 (2008-12-28)
+ * fix compilation with latest SDK
+ * reduce physics iterations to speed up the game
+ * button to enable fps and ugly mode
+
+version 0.1 (2008-12-07)
+ * initial version
diff --git a/readme.txt b/readme.txt
new file mode 100644
index 0000000..3933d28
--- /dev/null
+++ b/readme.txt
@@ -0,0 +1,15 @@
+X-Moto-PSP
+http://royale.zerezo.com/psp/
+
+Install:
+ * Copy the X-Moto-PSP folder to your GAME3xx/4xx/5xx folder.
+
+Controls:
+ * up/cross: throttle
+ * down/square: brake
+ * left/left trigger: left flip
+ * right/right trigger: right flip
+ * circle: change direction
+ * triangle: zoom out
+ * select: enable fps and ugly mode
+ * start: restart level
diff --git a/src/GameInit.cpp b/src/GameInit.cpp
index 47524a7..8bd336e 100644
--- a/src/GameInit.cpp
+++ b/src/GameInit.cpp
@@ -1,3 +1,52 @@
+#ifdef _PSP_FW_VERSION
+#include <pspkernel.h>
+#include <stdlib.h>
+PSP_MODULE_INFO("X-Moto-PSP", 0, 1, 0);
+PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER);
+PSP_HEAP_SIZE_MAX();
+
+enum
+{
+ PSP_BUTTON_X,
+ PSP_BUTTON_A,
+ PSP_BUTTON_B,
+ PSP_BUTTON_Y,
+ PSP_BUTTON_L,
+ PSP_BUTTON_R,
+ PSP_BUTTON_DOWN,
+ PSP_BUTTON_LEFT,
+ PSP_BUTTON_UP,
+ PSP_BUTTON_RIGHT,
+ PSP_BUTTON_SELECT,
+ PSP_BUTTON_START,
+ PSP_NUM_BUTTONS
+};
+
+int psp_exit_callback(int arg1, int arg2, void *common)
+{
+ exit(0);
+ return 0;
+}
+
+int psp_callback_thread(SceSize args, void *argp)
+{
+ int cbid;
+ cbid = sceKernelCreateCallback("Exit Callback", psp_exit_callback, NULL);
+ sceKernelRegisterExitCallback(cbid);
+ sceKernelSleepThreadCB();
+ return 0;
+}
+
+int psp_setup_callbacks(void)
+{
+ int thid = 0;
+ thid = sceKernelCreateThread("update_thread", psp_callback_thread, 0x11, 0xFA0, 0, 0);
+ if(thid >= 0)
+ sceKernelStartThread(thid, 0, 0);
+ return thid;
+}
+#endif
+
/*=============================================================================
XMOTO
@@ -57,6 +106,50 @@ int SDL_main(int nNumArgs, char **ppcArgs) {
#else
int main(int nNumArgs, char **ppcArgs) {
#endif
+#ifdef _PSP_FW_VERSION
+pspDebugScreenInit();
+pspDebugScreenPrintf("\n\n Starting X-Moto-PSP 0.2...\n\n http://royale.zerezo.com/psp/\n\n");
+psp_setup_callbacks();
+atexit(sceKernelExitGame);
+
+/* ugly menu to choose level */
+char temp[99];
+int level = 0, start = 0;
+pspDebugScreenPrintf("\n Choose your level, press START to continue.\n\n level: %d\n", level);
+SDL_Init(SDL_INIT_VIDEO|SDL_INIT_TIMER|SDL_INIT_JOYSTICK);
+SDL_JoystickOpen(0);
+SDL_JoystickEventState(SDL_ENABLE);
+while (!start)
+{
+ SDL_Event event;
+ while (SDL_PollEvent(&event)) if (event.type == SDL_JOYBUTTONDOWN)
+ {
+ switch (event.jbutton.button)
+ {
+ case PSP_BUTTON_RIGHT:
+ case PSP_BUTTON_L:
+ case PSP_BUTTON_UP:
+ level++;
+ pspDebugScreenPrintf(" level: %d\n", level);
+ break;
+ case PSP_BUTTON_LEFT:
+ case PSP_BUTTON_R:
+ case PSP_BUTTON_DOWN:
+ if (level > 0) level--;
+ pspDebugScreenPrintf(" level: %d\n", level);
+ break;
+ case PSP_BUTTON_START:
+ case PSP_BUTTON_SELECT:
+ start = 1;
+ break;
+ }
+ }
+}
+SDL_JoystickClose(0);
+sprintf(temp, "_iL%.2d_", level);
+GameApp::instance()->setSpecificLevelId(temp);
+#endif
+
/* Start application */
try {
/* Setup basic info */
@@ -236,7 +329,10 @@ void GameApp::run_load(int nNumArgs, char** ppcArgs) {
/* load levels */
if(pDb->levels_isIndexUptodate() == false) {
+#ifndef _PSP_FW_VERSION
+ /* too slow for the PSP */
LevelsManager::instance()->reloadLevelsFromLvl(pDb, v_useGraphics ? this : NULL);
+#endif
}
LevelsManager::instance()->reloadExternalLevels(pDb, v_useGraphics ? this : NULL);
@@ -328,6 +424,7 @@ void GameApp::run_load(int nNumArgs, char** ppcArgs) {
_UpdateLoadingScreen(0, GAMETEXT_INITMENUS);
+#ifndef _PSP_FW_VERSION
/* Load sounds */
try {
for(unsigned int i=0; i<Theme::instance()->getSoundsList().size(); i++) {
@@ -338,6 +435,7 @@ void GameApp::run_load(int nNumArgs, char** ppcArgs) {
Logger::Log("*** Warning *** : %s\n", e.getMsg().c_str());
/* hum, not cool */
}
+#endif
Logger::Log(" %d sound%s loaded",Sound::getNumSamples(),Sound::getNumSamples()==1?"":"s");
@@ -365,6 +463,7 @@ void GameApp::run_load(int nNumArgs, char** ppcArgs) {
m_PlaySpecificLevelId = m_PlaySpecificLevelFile;
}
}
+
if((m_PlaySpecificLevelId != "")) {
/* ======= PLAY SPECIFIC LEVEL ======= */
StateManager::instance()->pushState(new StatePreplayingGame(m_PlaySpecificLevelId, false));
@@ -412,14 +511,58 @@ void GameApp::manageEvent(SDL_Event* Event) {
static float fLastMouseClickTime = 0.0f;
int nX,nY;
+#ifdef _PSP_FW_VERSION
+/* hack: map PSP buttons with expected keys */
+switch (Event->jbutton.button)
+{
+ case PSP_BUTTON_LEFT:
+ case PSP_BUTTON_L:
+ Event->key.keysym.sym = SDLK_LEFT;
+ break;
+ case PSP_BUTTON_RIGHT:
+ case PSP_BUTTON_R:
+ Event->key.keysym.sym = SDLK_RIGHT;
+ break;
+ case PSP_BUTTON_UP:
+ case PSP_BUTTON_B:
+ Event->key.keysym.sym = SDLK_UP;
+ break;
+ case PSP_BUTTON_DOWN:
+ case PSP_BUTTON_Y:
+ Event->key.keysym.sym = SDLK_DOWN;
+ break;
+ case PSP_BUTTON_A:
+ Event->key.keysym.sym = SDLK_SPACE;
+ break;
+ case PSP_BUTTON_X:
+ Event->key.keysym.sym = SDLK_TAB;
+ break;
+ case PSP_BUTTON_START:
+ Event->key.keysym.sym = SDLK_RETURN;
+ break;
+ case PSP_BUTTON_SELECT:
+ static int fps_or_mode;
+ if (Event->type == SDL_JOYBUTTONDOWN)
+ fps_or_mode = !fps_or_mode;
+ if (fps_or_mode)
+ Event->key.keysym.sym = SDLK_F7;
+ else
+ Event->key.keysym.sym = SDLK_F9;
+ break;
+}
+Event->key.keysym.mod = (SDLMod) 0;
+#endif
+
/* What event? */
switch(Event->type) {
+ case SDL_JOYBUTTONDOWN:
case SDL_KEYDOWN:
if((Event->key.keysym.unicode&0xff80)==0) {
ch = Event->key.keysym.unicode & 0x7F;
}
keyDown(Event->key.keysym.sym, Event->key.keysym.mod, ch);
break;
+ case SDL_JOYBUTTONUP:
case SDL_KEYUP:
keyUp(Event->key.keysym.sym, Event->key.keysym.mod);
break;
@@ -613,10 +756,11 @@ void GameApp::_Wait()
v_fg = v_fm->getGlyph(GAMETEXT_LOADING);
v_fh = v_fg->realHeight();
v_fm->printString(v_fg,
- getDrawLib()->getDispWidth()/2 - 256,
- getDrawLib()->getDispHeight()/2 - 30,
+ getDrawLib()->getDispWidth()/2 - 156,
+ getDrawLib()->getDispHeight()/2 - 60,
MAKE_COLOR(255,255,255, 255));
+#ifndef _PSP_FW_VERSION
getDrawLib()->drawBox(Vector2f(getDrawLib()->getDispWidth()/2 - 256,
getDrawLib()->getDispHeight()/2 - 30),
Vector2f(getDrawLib()->getDispWidth()/2 - 256 + (512.0f*fDone),
@@ -628,12 +772,13 @@ void GameApp::_Wait()
Vector2f(getDrawLib()->getDispWidth()/2 - 256 + (512.0f*fDone),
getDrawLib()->getDispHeight()/2 - 30 + v_fh + v_border),
0,MAKE_COLOR(255,255,255,255));
+#endif
v_fm = getDrawLib()->getFontSmall();
v_fg = v_fm->getGlyph(NextTask);
v_fm->printString(v_fg,
- getDrawLib()->getDispWidth()/2 - 256,
- getDrawLib()->getDispHeight()/2 -30 + v_fh + 2,
+ getDrawLib()->getDispWidth()/2 - 156,
+ getDrawLib()->getDispHeight()/2 -60 + v_fh + 2,
MAKE_COLOR(255,255,255,255));
getDrawLib()->flushGraphics();
}
diff --git a/src/Makefile.psp b/src/Makefile.psp
new file mode 100644
index 0000000..17126a5
--- /dev/null
+++ b/src/Makefile.psp
@@ -0,0 +1,39 @@
+TARGET = xmoto
+OBJS = AttractMode.oxx BikeAnchors.oxx BikeController.oxx BikeGhost.oxx Bike.oxx BikeParameters.oxx BikePlayer.oxx Block.oxx BSP.oxx CameraAnimation.oxx Camera.oxx CheckWwwThread.oxx Collision.oxx Color.oxx CRCHash.oxx Credits.oxx DBuffer.oxx DownloadGhostThread.oxx DrawLibOpenGL.oxx DrawLib.oxx DrawLibSDLgfx.oxx Entity.oxx Environment.oxx FileCompression.oxx GameEvents.oxx GameInit.oxx Game.oxx GameSerializer.oxx GUIBestTimes.oxx GUIButtonDrawn.oxx GUIButton.oxx GUIEdit.oxx GUIFrame.oxx GUIList.oxx GUI.oxx GUIStatic.oxx GUITabView.oxx GUIXMoto.oxx Image.oxx Input.oxx Level.oxx LevelsManager.oxx Locales.oxx Log.oxx LuaLibGame.oxx md5file.oxx md5.o Packager.oxx PolyDraw.oxx RendererFBO.oxx Renderer.oxx Replay.oxx Scene.oxx ScriptDynamicObjects.oxx SkyApparence.oxx SomersaultCounter.oxx Sound.oxx StateCheckWww.oxx StateCreditsMode.oxx StateDeadJust.oxx StateDeadMenu.oxx StateDownloadGhost.oxx StateEditProfile.oxx StateEditWebConfig.oxx StateFinished.oxx StateHelp.oxx StateLevelInfoViewer.oxx StateLevelPackViewer.oxx StateMainMenu.oxx StateManager.oxx StateMenu.oxx StateMessageBox.oxx StateMultiUpdate.oxx StatePause.oxx StatePlaying.oxx StatePreplayingCredits.oxx StatePreplayingGame.oxx StatePreplaying.oxx StatePreplayingReplay.oxx StateReplaying.oxx StateRequestKey.oxx StateScene.oxx StateUpdateDb.oxx StateUpdate.oxx StateUpdateRoomsList.oxx StateUpdateTheme.oxx StateUpdateThemesList.oxx StateUpgradeLevels.oxx StateUploadAllHighscores.oxx StateUploadHighscore.oxx svn_version.oxx SwapEndian.oxx SysMessage.oxx System.oxx Text.oxx Theme.oxx tim_io_stdio.oxx tim_jpeg.oxx tim_memory_crt.oxx tim.oxx tim_png.oxx tinystr.oxx tinyxmlerror.oxx tinyxml.oxx tinyxmlparser.oxx Trainer.oxx Universe.oxx UpdateDbThread.oxx UpdateRoomsListThread.oxx UpdateThemesListThread.oxx UpdateThemeThread.oxx UpgradeLevelsThread.oxx UploadAllHighscoresThread.oxx UploadHighscoreThread.oxx UserConfig.oxx utf8.oxx VBezier.oxx VFileIO.oxx VideoRecorder.oxx VMath.oxx VTexture.oxx VXml.oxx WWW.oxx XMArgs.oxx XMBuild.oxx xmDatabase_fixes.oxx xmDatabase_levels.oxx xmDatabase.oxx xmDatabase_profiles.oxx xmDatabase_replays.oxx xmDatabase_stats.oxx xmDatabase_themes.oxx xmDatabase_web.oxx XMSession.oxx XMThread.oxx XMThreads.oxx Zone.oxx
+
+PSP_FW_VERSION = 371
+FLAGS = -O2 -G0 -Wall -g -fno-rtti
+
+EXTRA_TARGETS = EBOOT.PBP
+PSP_EBOOT_TITLE = X-Moto-PSP
+PSP_EBOOT_ICON = icon.png
+PSP_EBOOT_PIC1 = screenshot.png
+
+PSPSDK=$(shell psp-config --pspsdk-path)
+PSPBIN = $(PSPSDK)/../bin
+
+FLAGS += -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"xmoto\" -DVERSION=\"0.4.2\" -D_GNU_SOURCE=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DXMOTO_LITTLE_ENDIAN=1 -DHAVE_SQLITE3_H=1 -DHAVE_LIBSQLITE3=1 -DHAVE_LIBZ=1 -DHAVE_LIBJPEG=1 -DHAVE_LIBPNG=1 -DHAVE_LIBBZ2=1 -DHAVE_LIBGLU=1 -DHAVE_LIBSDL_MIXER=1 -DHAVE_LIBSDL_TTF=1 -DHAVE_PTHREAD=1 -DHAVE_LIBCURL=1 -DHAVE_VISIBILITY=1 -DHAVE_STDINT_H_WITH_UINTMAX=1 -DHAVE_ALLOCA_H=1 -DHAVE_ALLOCA=1 -DHAVE_STDLIB_H=1 -DHAVE_UNISTD_H=1 -DHAVE_GETPAGESIZE=1 -DHAVE_MMAP=1 -DINTDIV0_RAISES_SIGFPE=1 -DHAVE_INTTYPES_H_WITH_UINTMAX=1 -DHAVE_UNSIGNED_LONG_LONG_INT=1 -DHAVE_UNSIGNED_LONG_LONG=1 -DHAVE_UINTMAX_T=1 -DHAVE_INTTYPES_H=1 -DUSE_POSIX_THREADS=1 -DUSE_POSIX_THREADS_WEAK=1 -DHAVE_PTHREAD_RWLOCK=1 -DHAVE_PTHREAD_MUTEX_RECURSIVE=1 -DHAVE_BUILTIN_EXPECT=1 -DHAVE_ARGZ_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_LIMITS_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_PARAM_H=1 -DHAVE_GETCWD=1 -DHAVE_GETEGID=1 -DHAVE_GETEUID=1 -DHAVE_GETGID=1 -DHAVE_GETUID=1 -DHAVE_MEMPCPY=1 -DHAVE_MUNMAP=1 -DHAVE_STPCPY=1 -DHAVE_STRCASECMP=1 -DHAVE_STRDUP=1 -DHAVE_STRTOUL=1 -DHAVE_TSEARCH=1 -DHAVE_ARGZ_COUNT=1 -DHAVE_ARGZ_STRINGIFY=1 -DHAVE_ARGZ_NEXT=1 -DHAVE___FSETLOCKING=1 -DHAVE_DECL_FEOF_UNLOCKED=1 -DHAVE_DECL_FGETS_UNLOCKED=1 -DHAVE_ICONV=1 -DICONV_CONST= -DHAVE_NL_LOCALE_NAME=1 -DHAVE_LONG_LONG_INT=1 -DHAVE_LONG_DOUBLE=1 -DHAVE_WCHAR_T=1 -DHAVE_WINT_T=1 -DHAVE_INTMAX_T=1 -DHAVE_POSIX_PRINTF=1 -DHAVE_STDINT_H=1 -DHAVE_STDINT_H=1 -DHAVE_STDDEF_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_ASPRINTF=1 -DHAVE_FWPRINTF=1 -DHAVE_PUTENV=1 -DHAVE_SETENV=1 -DHAVE_SETLOCALE=1 -DHAVE_SNPRINTF=1 -DHAVE_WCSLEN=1 -DHAVE_DECL__SNPRINTF=0 -DHAVE_DECL__SNWPRINTF=0 -DHAVE_DECL_GETC_UNLOCKED=1 -DHAVE_LANGINFO_CODESET=1 -DHAVE_LC_MESSAGES=1 -DENABLE_NLS=1 -DHAVE_GETTEXT=0 -DHAVE_DCGETTEXT=1 -I. -DNOMMGR
+FLAGS += -DGAMEDATADIR=\".\" -DLOCALESDIR=\"po\" -DASIAN_TTF_FILE=\"\" -DALLOW_ZOOMING=0 -D_GNU_SOURCE=1 -D_REENTRANT -D'SVN_REV=""'
+FLAGS += -D_PSP_FW_VERSION=371 -DUSE_OPENGL=1 -DUSE_SDLGFX=0
+FLAGS += -DHAVE_LUA_H=1 -I/usr/local/pspdev/psp/sdk/include/ -I/usr/local/pspdev/psp/include/SDL
+
+LIBS = -lc -lg -lstdc++ -lcurl -lode -llua -lSDL_ttf -lSDL_mixer -lGLU -lglut -lbz2 -lpng -ljpeg -lz -lsqlite3 -lfreetype -llua -lSDL_gfx
+LIBS += -L/usr/local/pspdev/psp/lib -lSDL -lm -lGL -lpspvfpu -L/usr/local/pspdev/psp/sdk/lib -lpspdebug -lpspgu -lpspctrl -lpspge -lpspdisplay -lpsphprm -lpspsdk -lpsprtc -lpspaudio -lc -lpspuser -lpsputility -lpspkernel -lpspnet_inet -lpspirkeyb -lpsppower
+LIBS += $(shell $(PSPBIN)/curl-config --libs)
+LIBS += -lvorbisfile -lvorbis -logg -lsmpeg -Wl,-z,muldefs
+
+LINK.c = $(CXX)
+
+PSPSDK=$(shell psp-config --pspsdk-path)
+PSPBIN = $(PSPSDK)/../bin
+
+include $(PSPSDK)/lib/build.mak
+
+all: $(OBJS)
+ @echo 'Success!'
+
+%.oxx:
+ $(CXX) $(FLAGS) -c -o $@ `find -name $*.cpp`
+
+%.o:
+ $(CC) $(FLAGS) -c -o $@ `find -name $*.c`
diff --git a/src/PhysSettings.h b/src/PhysSettings.h
index 15c4877..7d18431 100644
--- a/src/PhysSettings.h
+++ b/src/PhysSettings.h
@@ -34,7 +34,7 @@ if you want to be able to play levels besides your own...
#define PHYS_WORLD_CFM 0.000001f /* global constant force mix */
#define PHYS_WORLD_GRAV -9.81f /* Grav. acceleration */
#define PHYS_SPEED 0.6f /* simulation speed factor */
-#define PHYS_QSTEP_ITERS 10
+#define PHYS_QSTEP_ITERS 5
#define PHYS_STEP_SIZE 1
/* Bike geometrical settings */
diff --git a/src/Renderer.cpp b/src/Renderer.cpp
index 22c71f2..f72c570 100644
--- a/src/Renderer.cpp
+++ b/src/Renderer.cpp
@@ -1738,6 +1738,7 @@ void GameRenderer::_RenderDynamicBlocks(MotoGame* i_scene, bool bBackground) {
for(unsigned int j=0;j<m_StaticGeoms[geom]->Polys.size();j++) {
GeomPoly *pPoly = m_StaticGeoms[geom]->Polys[j];
+#ifndef _PSP_FW_VERSION
((DrawLibOpenGL*)GameApp::instance()->getDrawLib())->glBindBufferARB(GL_ARRAY_BUFFER_ARB, pPoly->nVertexBufferID);
glVertexPointer(2,GL_FLOAT,0,(char *)NULL);
@@ -1745,6 +1746,7 @@ void GameRenderer::_RenderDynamicBlocks(MotoGame* i_scene, bool bBackground) {
glTexCoordPointer(2,GL_FLOAT,0,(char *)NULL);
glDrawArrays(GL_POLYGON,0,pPoly->nNumVertices);
+#endif
}
} else {
for(unsigned int j=0;j<m_StaticGeoms[geom]->Polys.size();j++) {
@@ -1791,6 +1793,7 @@ void GameRenderer::_RenderBlockEdges(Block* pBlock)
for(unsigned int j=0;j<m_edgeGeoms[geom]->Polys.size();j++) {
GeomPoly *pPoly = m_edgeGeoms[geom]->Polys[j];
+#ifndef _PSP_FW_VERSION
((DrawLibOpenGL*)GameApp::instance()->getDrawLib())->glBindBufferARB(GL_ARRAY_BUFFER_ARB, pPoly->nVertexBufferID);
glVertexPointer(2,GL_FLOAT,0,(char *)NULL);
@@ -1798,13 +1801,16 @@ void GameRenderer::_RenderBlockEdges(Block* pBlock)
glTexCoordPointer(2,GL_FLOAT,0,(char *)NULL);
glDrawArrays(GL_QUADS, 0, pPoly->nNumVertices);
+#endif
}
} else {
for(unsigned int j=0;j<m_edgeGeoms[geom]->Polys.size();j++) {
GeomPoly *pPoly = m_edgeGeoms[geom]->Polys[j];
+#ifndef _PSP_FW_VERSION
glVertexPointer(2, GL_FLOAT, 0, pPoly->pVertices);
glTexCoordPointer(2, GL_FLOAT, 0, pPoly->pTexCoords);
glDrawArrays(GL_QUADS, 0, pPoly->nNumVertices);
+#endif
}
}
}
diff --git a/src/VCommon.h b/src/VCommon.h
index eac1ca9..3b15a60 100644
--- a/src/VCommon.h
+++ b/src/VCommon.h
@@ -79,7 +79,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include <stdio.h>
#include <math.h>
-#if !defined(WIN32) && !defined(__APPLE__) && !defined(__MACH__)
+#if !defined(WIN32) && !defined(__APPLE__) && !defined(__MACH__) && !defined(_PSP_FW_VERSION)
#if defined(__FreeBSD__) || defined(__OpenBSD__)
#include <sys/endian.h>
#else
diff --git a/src/VFileIO.cpp b/src/VFileIO.cpp
index 67604a7..d033aad 100644
--- a/src/VFileIO.cpp
+++ b/src/VFileIO.cpp
@@ -73,7 +73,7 @@ std::string win32_getUserDir(bool i_asUtf8 = false) {
}
#endif
-#ifndef WIN32
+#if !defined(WIN32) && !defined(_PSP_FW_VERSION)
void strlwr(char *pc) {
for(unsigned int i=0; i<strlen(pc); i++) pc[i] = tolower(pc[i]);
}
@@ -1071,11 +1071,15 @@ void FS::init(const std::string& AppDir, const std::string& i_binFile, const std
if(i_userDirPath != "") {
m_UserDir = m_UserDirUTF8 = i_userDirPath;
} else {
+#ifdef _PSP_FW_VERSION
+ m_UserDir = std::string("config");
+#else
m_UserDir = getenv("HOME");
if(!isDir(m_UserDir))
throw Exception("invalid user home directory");
m_UserDir = m_UserDir + std::string("/.") + AppDir;
+#endif
m_UserDirUTF8 = m_UserDir;
}
diff --git a/src/drawlib/DrawLibOpenGL.cpp b/src/drawlib/DrawLibOpenGL.cpp
index ab5c54a..4e9476c 100644
--- a/src/drawlib/DrawLibOpenGL.cpp
+++ b/src/drawlib/DrawLibOpenGL.cpp
@@ -300,7 +300,11 @@ void DrawLibOpenGL::init(unsigned int nDispWidth,unsigned int nDispHeight,unsign
#endif
/* Init OpenGL extensions */
+#ifdef _PSP_FW_VERSION
+ if (1) {
+#else
if(m_bDontUseGLExtensions) {
+#endif
m_bVBOSupported = false;
m_bFBOSupported = false;
m_bShadersSupported = false;
diff --git a/src/drawlib/DrawLibSDLgfx.cpp b/src/drawlib/DrawLibSDLgfx.cpp
index f1c7426..e34f512 100644
--- a/src/drawlib/DrawLibSDLgfx.cpp
+++ b/src/drawlib/DrawLibSDLgfx.cpp
@@ -25,6 +25,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "Game.h"
#include "helpers/Log.h"
#include "Image.h"
+#include "VFileIO.h"
#ifdef ENABLE_SDLGFX
#include "PolyDraw.h"
diff --git a/src/image/tim_jpeg.cpp b/src/image/tim_jpeg.cpp
index 13779a3..bd8743f 100644
--- a/src/image/tim_jpeg.cpp
+++ b/src/image/tim_jpeg.cpp
@@ -36,7 +36,7 @@ extern "C" {
/*==============================================================================
Hmm, stricmp() is microsoftish
==============================================================================*/
-#if !defined(WIN32)
+#if !defined(WIN32) && !defined(_PSP_FW_VERSION)
static int stricmp(char *pc1,char *pc2) {
int s1 = strlen(pc1);
int s2 = strlen(pc2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment