diff --git a/src/Makefile b/src/Makefile index f25d34ec2..3952c1743 100644 --- a/src/Makefile +++ b/src/Makefile @@ -528,18 +528,12 @@ ifdef PANDORA all: pre-build $(BIN)/$(PNDNAME) endif -ifdef PSP -all: pre-build $(BIN)/$(BINNAME) post-build -endif - -ifndef PSP ifdef MINGW ifndef SDL all: pre-build $(BIN)/$(EXENAME) dll endif endif -endif ifdef SDL all: pre-build $(BIN)/$(EXENAME) @@ -601,12 +595,10 @@ endif # mac os x lsdlsrb2 does not like objcopy ifndef MACOSX -ifndef PSP $(OBJCOPY) $(BIN)/$(EXENAME) $(BIN)/$(DBGNAME) $(OBJCOPY) --strip-debug $(BIN)/$(EXENAME) -$(OBJCOPY) --add-gnu-debuglink=$(BIN)/$(DBGNAME) $(BIN)/$(EXENAME) endif -endif ifndef NOUPX -$(UPX) $(UPX_OPTS) $(BIN)/$(EXENAME) endif diff --git a/src/Makefile.cfg b/src/Makefile.cfg index 679727c90..bf9aa5feb 100644 --- a/src/Makefile.cfg +++ b/src/Makefile.cfg @@ -211,7 +211,6 @@ endif #indicate platform and what interface use with ifndef WINCE -ifndef PSP ifndef WII ifndef LINUX ifndef FREEBSD @@ -230,7 +229,6 @@ endif endif endif endif -endif #determine the interface directory (where you put all i_*.c) i_cdmus_o=$(OBJDIR)/i_cdmus.o @@ -336,15 +334,6 @@ ifdef MINGW OBJDIR:=$(OBJDIR)/Mingw BIN:=$(BIN)/Mingw else -ifdef PSP - INTERFACE=sdl12 - NONX86=1 - SDL=1 - SDL12=1 - OBJDIR:=$(OBJDIR)/PSP - BIN:=$(BIN)/PSP - NOUPX=1 -else ifdef WINCE INTERFACE=sdl12 NONX86=1 @@ -370,7 +359,6 @@ endif endif endif endif -endif ifdef GP2X ifdef SDL diff --git a/src/command.c b/src/command.c index fc81a362d..8c275c23e 100644 --- a/src/command.c +++ b/src/command.c @@ -1255,7 +1255,7 @@ static void Got_NetVar(UINT8 **p, INT32 playernum) CONS_Alert(CONS_WARNING, "Netvar not found with netid %hu\n", netid); return; } -#if 0 //defined (GP2X) || defined (PSP) +#if 0 //defined (GP2X) CONS_Printf("Netvar received: %s [netid=%d] value %s\n", cvar->name, netid, svalue); #endif DEBFILE(va("Netvar received: %s [netid=%d] value %s\n", cvar->name, netid, svalue)); diff --git a/src/d_main.c b/src/d_main.c index b2f586607..39188d7cd 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -1005,7 +1005,7 @@ void D_SRB2Main(void) if (!userhome) { -#if ((defined (__unix__) && !defined (MSDOS)) || defined(__APPLE__) || defined (UNIXCOMMON)) && !defined (__CYGWIN__) && !defined (PSP) && !defined(GP2X) +#if ((defined (__unix__) && !defined (MSDOS)) || defined(__APPLE__) || defined (UNIXCOMMON)) && !defined (__CYGWIN__) && !defined(GP2X) I_Error("Please set $HOME to your home directory\n"); #elif defined (_WIN32_WCE) && 0 if (dedicated) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index a234f3c0c..58c2d7acd 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -249,7 +249,7 @@ consvar_t cv_usejoystick = {"use_joystick", "1", CV_SAVE|CV_CALL, usejoystick_co I_InitJoystick, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_usejoystick2 = {"use_joystick2", "2", CV_SAVE|CV_CALL, usejoystick_cons_t, I_InitJoystick2, 0, NULL, NULL, 0, 0, NULL}; -#elif defined (PSP) || defined (GP2X) || defined (_NDS) //only one joystick +#elif defined (GP2X) || defined (_NDS) //only one joystick consvar_t cv_usejoystick = {"use_joystick", "1", CV_SAVE|CV_CALL, usejoystick_cons_t, I_InitJoystick, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_usejoystick2 = {"use_joystick2", "0", CV_SAVE|CV_CALL, usejoystick_cons_t, diff --git a/src/doomdef.h b/src/doomdef.h index 2a9f7b1f3..1d2b941e0 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -548,12 +548,12 @@ extern const char *compdate, *comptime, *comprevision, *compbranch; /// Most modifications should probably enable this. //#define SAVEGAME_OTHERVERSIONS -#if !defined (_NDS) && !defined (_PSP) +#if !defined (_NDS) /// Shuffle's incomplete OpenGL sorting code. #define SHUFFLE // This has nothing to do with sorting, why was it disabled? #endif -#if !defined (_NDS) && !defined (_PSP) +#if !defined (_NDS) /// Allow the use of the SOC RESETINFO command. /// \note Builds that are tight on memory should disable this. /// This stops the game from storing backups of the states, sprites, and mobjinfo tables. diff --git a/src/doomtype.h b/src/doomtype.h index d4ebbb92d..618e5665a 100644 --- a/src/doomtype.h +++ b/src/doomtype.h @@ -105,9 +105,7 @@ typedef long ssize_t; #define strncasecmp strnicmp #define strcasecmp strcmpi #endif -#ifdef _PSP - #include -#elif (defined (__unix__) && !defined (MSDOS)) || defined(__APPLE__) || defined (UNIXCOMMON) +#if (defined (__unix__) && !defined (MSDOS)) || defined(__APPLE__) || defined (UNIXCOMMON) #undef stricmp #define stricmp(x,y) strcasecmp(x,y) #undef strnicmp @@ -141,7 +139,7 @@ typedef long ssize_t; #endif #endif //macintosh -#if defined (PC_DOS) || defined (_WIN32) || defined (_WII) || defined (_PSP) || defined (__HAIKU__) || defined(_NDS) +#if defined (PC_DOS) || defined (_WIN32) || defined (_WII) || defined (__HAIKU__) || defined(_NDS) #define HAVE_DOSSTR_FUNCS #endif diff --git a/src/g_game.c b/src/g_game.c index 9d3933aaf..7e667cc05 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -395,21 +395,9 @@ consvar_t cv_fireaxis = {"joyaxis_fire", "LAnalog", CV_SAVE, joyaxis_cons_t, NUL consvar_t cv_firenaxis = {"joyaxis_firenormal", "RAnalog", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; #else consvar_t cv_turnaxis = {"joyaxis_turn", "X-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -#ifdef PSP -consvar_t cv_moveaxis = {"joyaxis_move", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -#else consvar_t cv_moveaxis = {"joyaxis_move", "Y-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -#endif -#ifdef PSP -consvar_t cv_sideaxis = {"joyaxis_side", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -#else consvar_t cv_sideaxis = {"joyaxis_side", "Z-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -#endif -#ifdef PSP -consvar_t cv_lookaxis = {"joyaxis_look", "Y-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -#else consvar_t cv_lookaxis = {"joyaxis_look", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -#endif consvar_t cv_fireaxis = {"joyaxis_fire", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_firenaxis = {"joyaxis_firenormal", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; #endif @@ -424,11 +412,7 @@ consvar_t cv_firenaxis2 = {"joyaxis2_firenormal", "RAnalog", CV_SAVE, joyaxis_co #else consvar_t cv_turnaxis2 = {"joyaxis2_turn", "X-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_moveaxis2 = {"joyaxis2_move", "Y-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -#ifdef _PSP -consvar_t cv_sideaxis2 = {"joyaxis2_side", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -#else consvar_t cv_sideaxis2 = {"joyaxis2_side", "Z-Axis", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -#endif consvar_t cv_lookaxis2 = {"joyaxis2_look", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_fireaxis2 = {"joyaxis2_fire", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_firenaxis2 = {"joyaxis2_firenormal", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; diff --git a/src/g_input.c b/src/g_input.c index d7e883735..3dcf01c00 100644 --- a/src/g_input.c +++ b/src/g_input.c @@ -268,7 +268,7 @@ static keyname_t keynames[] = {KEY_MOUSE1+0,"MOUSE1"}, {KEY_MOUSE1+1,"MOUSE2"}, {KEY_MOUSE1+2,"MOUSE3"}, -#if !defined (_PSP) && !defined (_WII) +#if !defined (_WII) {KEY_MOUSE1+3,"MOUSE4"}, {KEY_MOUSE1+4,"MOUSE5"}, {KEY_MOUSE1+5,"MOUSE6"}, @@ -278,7 +278,7 @@ static keyname_t keynames[] = {KEY_2MOUSE1+0,"SEC_MOUSE2"}, // BP: sorry my mouse handler swap button 1 and 2 {KEY_2MOUSE1+1,"SEC_MOUSE1"}, {KEY_2MOUSE1+2,"SEC_MOUSE3"}, -#if !defined (_PSP) && !defined (_WII) +#if !defined (_WII) {KEY_2MOUSE1+3,"SEC_MOUSE4"}, {KEY_2MOUSE1+4,"SEC_MOUSE5"}, {KEY_2MOUSE1+5,"SEC_MOUSE6"}, @@ -290,19 +290,7 @@ static keyname_t keynames[] = {KEY_2MOUSEWHEELUP, "Wheel 2 UP"}, {KEY_2MOUSEWHEELDOWN, "Wheel 2 Down"}, -#ifdef _PSP - {KEY_JOY1+0, "TRIANGLE"}, - {KEY_JOY1+1, "CIRCLE" }, - {KEY_JOY1+2, "CROSS" }, - {KEY_JOY1+3, "SQUARE" }, - {KEY_JOY1+4, "LTRIGGER"}, - {KEY_JOY1+5, "RTRIGGER"}, - {KEY_JOY1+6, "SELECT" }, - {KEY_JOY1+7, "START" }, - {KEY_JOY1+8, "HOME" }, - {KEY_JOY1+9, "HOLD" }, -#define NOMOREJOYBTN_1S -#elif defined (GP2X) +#if defined (GP2X) {KEY_JOY1+0, "JOYA"}, {KEY_JOY1+1, "JOYY"}, {KEY_JOY1+2, "JOYB"}, @@ -420,7 +408,7 @@ static keyname_t keynames[] = {KEY_HAT1+1, "HATDOWN"}, {KEY_HAT1+2, "HATLEFT"}, {KEY_HAT1+3, "HATRIGHT"}, -#if !defined (_PSP) && !defined (_WII) +#if !defined (_WII) {KEY_HAT1+4, "HATUP2"}, {KEY_HAT1+5, "HATDOWN2"}, {KEY_HAT1+6, "HATLEFT2"}, @@ -438,7 +426,7 @@ static keyname_t keynames[] = {KEY_DBLMOUSE1+0, "DBLMOUSE1"}, {KEY_DBLMOUSE1+1, "DBLMOUSE2"}, {KEY_DBLMOUSE1+2, "DBLMOUSE3"}, -#if !defined (_PSP) && !defined (_WII) +#if !defined (_WII) {KEY_DBLMOUSE1+3, "DBLMOUSE4"}, {KEY_DBLMOUSE1+4, "DBLMOUSE5"}, {KEY_DBLMOUSE1+5, "DBLMOUSE6"}, @@ -448,7 +436,7 @@ static keyname_t keynames[] = {KEY_DBL2MOUSE1+0, "DBLSEC_MOUSE2"}, // BP: sorry my mouse handler swap button 1 and 2 {KEY_DBL2MOUSE1+1, "DBLSEC_MOUSE1"}, {KEY_DBL2MOUSE1+2, "DBLSEC_MOUSE3"}, -#if !defined (_PSP) && !defined (_WII) +#if !defined (_WII) {KEY_DBL2MOUSE1+3, "DBLSEC_MOUSE4"}, {KEY_DBL2MOUSE1+4, "DBLSEC_MOUSE5"}, {KEY_DBL2MOUSE1+5, "DBLSEC_MOUSE6"}, @@ -456,18 +444,7 @@ static keyname_t keynames[] = {KEY_DBL2MOUSE1+7, "DBLSEC_MOUSE8"}, #endif -#ifdef _PSP - {KEY_DBLJOY1+0, "DBLTRIANGLE"}, - {KEY_DBLJOY1+1, "DBLCIRCLE" }, - {KEY_DBLJOY1+2, "DBLCROSS" }, - {KEY_DBLJOY1+3, "DBLSQUARE" }, - {KEY_DBLJOY1+4, "DBLLTRIGGER"}, - {KEY_DBLJOY1+5, "DBLRTRIGGER"}, - {KEY_DBLJOY1+6, "DBLSELECT" }, - {KEY_DBLJOY1+7, "DBLSTART" }, - {KEY_DBLJOY1+8, "DBLHOME" }, - {KEY_DBLJOY1+9, "DBLHOLD" }, -#elif defined (GP2X) +#if defined (GP2X) {KEY_DBLJOY1+0, "DBLJOYA"}, {KEY_DBLJOY1+1, "DBLJOYY"}, {KEY_DBLJOY1+2, "DBLJOYB"}, @@ -584,7 +561,7 @@ static keyname_t keynames[] = {KEY_DBLHAT1+1, "DBLHATDOWN"}, {KEY_DBLHAT1+2, "DBLHATLEFT"}, {KEY_DBLHAT1+3, "DBLHATRIGHT"}, -#if !defined (_PSP) && !defined (_WII) +#if !defined (_WII) {KEY_DBLHAT1+4, "DBLHATUP2"}, {KEY_DBLHAT1+5, "DBLHATDOWN2"}, {KEY_DBLHAT1+6, "DBLHATLEFT2"}, @@ -599,19 +576,7 @@ static keyname_t keynames[] = {KEY_DBLHAT1+15, "DBLHATRIGHT4"}, #endif -#ifdef _PSP - {KEY_2JOY1+0, "SEC_TRIANGLE"}, - {KEY_2JOY1+1, "SEC_CIRCLE" }, - {KEY_2JOY1+2, "SEC_CROSS" }, - {KEY_2JOY1+3, "SEC_SQUARE" }, - {KEY_2JOY1+4, "SEC_LTRIGGER"}, - {KEY_2JOY1+5, "SEC_RTRIGGER"}, - {KEY_2JOY1+6, "SEC_SELECT" }, - {KEY_2JOY1+7, "SEC_START" }, - {KEY_2JOY1+8, "SEC_HOME" }, - {KEY_2JOY1+9, "SEC_HOLD" }, -#define NOMOREJOYBTN_2S -#elif defined (WMINPUT) +#if defined (WMINPUT) {KEY_2JOY1+0, "SEC_JOYB"}, {KEY_2JOY1+1, "SEC_JOYA"}, {KEY_2JOY1+2, "SEC_JOYUP"}, @@ -709,7 +674,7 @@ static keyname_t keynames[] = {KEY_2HAT1+1, "SEC_HATDOWN"}, {KEY_2HAT1+2, "SEC_HATLEFT"}, {KEY_2HAT1+3, "SEC_HATRIGHT"}, -#if !defined (_PSP) && !defined (_WII) +#if !defined (_WII) {KEY_2HAT1+4, "SEC_HATUP2"}, {KEY_2HAT1+5, "SEC_HATDOWN2"}, {KEY_2HAT1+6, "SEC_HATLEFT2"}, @@ -724,19 +689,7 @@ static keyname_t keynames[] = {KEY_2HAT1+15, "SEC_HATRIGHT4"}, #endif -#ifdef _PSP - {KEY_DBL2JOY1+0, "DBLSEC_TRIANGLE"}, - {KEY_DBL2JOY1+1, "DBLSEC_CIRCLE" }, - {KEY_DBL2JOY1+2, "DBLSEC_CROSS" }, - {KEY_DBL2JOY1+3, "DBLSEC_SQUARE" }, - {KEY_DBL2JOY1+4, "DBLSEC_LTRIGGER"}, - {KEY_DBL2JOY1+5, "DBLSEC_RTRIGGER"}, - {KEY_DBL2JOY1+6, "DBLSEC_SELECT" }, - {KEY_DBL2JOY1+7, "DBLSEC_START" }, - {KEY_DBL2JOY1+8, "DBLSEC_HOME" }, - {KEY_DBL2JOY1+9, "DBLSEC_HOLD" }, -#define NOMOREJOYBTN_2DBL -#elif defined (WMINPUT) +#if defined (WMINPUT) {KEY_DBL2JOY1+0, "DBLSEC_JOYB"}, {KEY_DBL2JOY1+1, "DBLSEC_JOYA"}, {KEY_DBL2JOY1+2, "DBLSEC_JOYUP"}, @@ -832,7 +785,7 @@ static keyname_t keynames[] = {KEY_DBL2HAT1+1, "DBLSEC_HATDOWN"}, {KEY_DBL2HAT1+2, "DBLSEC_HATLEFT"}, {KEY_DBL2HAT1+3, "DBLSEC_HATRIGHT"}, -#if !defined (_PSP) && !defined (_WII) +#if !defined (_WII) {KEY_DBL2HAT1+4, "DBLSEC_HATUP2"}, {KEY_DBL2HAT1+5, "DBLSEC_HATDOWN2"}, {KEY_DBL2HAT1+6, "DBLSEC_HATLEFT2"}, @@ -947,24 +900,7 @@ INT32 G_KeyStringtoNum(const char *keystr) return 0; } -#ifdef _PSP -void G_Controldefault(void) -{ - gamecontrol[gc_forward ][0] = KEY_HAT1+0; // Up - gamecontrol[gc_backward ][0] = KEY_HAT1+1; // Down - gamecontrol[gc_turnleft ][0] = KEY_HAT1+2; // Left - gamecontrol[gc_turnright ][0] = KEY_HAT1+3; // Right - gamecontrol[gc_strafeleft ][0] = KEY_JOY1+4; // L - gamecontrol[gc_straferight][0] = KEY_JOY1+5; // R - gamecontrol[gc_tossflag ][0] = KEY_JOY1+0; // Triangle - gamecontrol[gc_use ][0] = KEY_JOY1+1; // Circle - gamecontrol[gc_camtoggle ][0] = KEY_JOY1+6; // Select - gamecontrol[gc_camreset ][0] = KEY_JOY1+3; // Square - gamecontrol[gc_centerview ][0] = KEY_JOY1+9; // Hold - gamecontrol[gc_pause ][0] = KEY_JOY1+8; // Start - gamecontrol[gc_jump ][0] = KEY_JOY1+2; // Cross -} -#elif defined (GP2X) +#if defined (GP2X) void G_Controldefault(void) { gamecontrol[gc_fire ][0] = KEY_JOY1+0; //A diff --git a/src/g_input.h b/src/g_input.h index a2697c9db..892ef9c7a 100644 --- a/src/g_input.h +++ b/src/g_input.h @@ -23,12 +23,7 @@ #define NUMKEYS 256 -#ifdef _PSP -#define MOUSEBUTTONS 3 -#define JOYBUTTONS 14 // 10 buttons -#define JOYHATS 1 // 1 hat -#define JOYAXISSET 1 // 1 Set of 2 axises -#elif defined (_WII) +#if defined (_WII) #define MOUSEBUTTONS 3 #define JOYBUTTONS 20 // 20 buttons #define JOYHATS 1 // 1 hat diff --git a/src/m_misc.c b/src/m_misc.c index a0efb8bf4..8928494c8 100644 --- a/src/m_misc.c +++ b/src/m_misc.c @@ -58,7 +58,7 @@ typedef off_t off64_t; #if defined (_WIN32) #define PRIdS "Iu" -#elif defined (_PSP) || defined (DJGPP) || defined (_WII) || defined (_NDS) +#elif defined (DJGPP) || defined (_WII) || defined (_NDS) #define PRIdS "u" #else #define PRIdS "zu" diff --git a/src/m_misc.h b/src/m_misc.h index 4f1256764..14f590516 100644 --- a/src/m_misc.h +++ b/src/m_misc.h @@ -40,11 +40,7 @@ void M_SaveFrame(void); void M_StopMovie(void); // the file where game vars and settings are saved -#ifdef PSP -#define CONFIGFILENAME "srb2psp.cfg" -#else #define CONFIGFILENAME "config.cfg" -#endif INT32 M_MapNumber(char first, char second); diff --git a/src/s_sound.c b/src/s_sound.c index 07f5e18f0..53279729c 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -64,7 +64,7 @@ consvar_t sndserver_arg = {"sndserver_arg", "-quiet", CV_SAVE, NULL, 0, NULL, NU #if defined (_WIN32_WCE) || defined(GP2X) consvar_t cv_samplerate = {"samplerate", "11025", 0, CV_Unsigned, NULL, 11025, NULL, NULL, 0, 0, NULL}; //Alam: For easy hacking? -#elif defined(_PSP) || defined(_WINDOWS) +#elif defined(_WINDOWS) consvar_t cv_samplerate = {"samplerate", "44100", 0, CV_Unsigned, NULL, 44100, NULL, NULL, 0, 0, NULL}; //Alam: For easy hacking? #elif defined(_WII) consvar_t cv_samplerate = {"samplerate", "32000", 0, CV_Unsigned, NULL, 32000, NULL, NULL, 0, 0, NULL}; //Alam: For easy hacking? @@ -93,7 +93,7 @@ static void Captioning_OnChange(void) consvar_t cv_closedcaptioning = {"closedcaptioning", "Off", CV_SAVE|CV_CALL, CV_OnOff, Captioning_OnChange, 0, NULL, NULL, 0, 0, NULL}; // number of channels available -#if defined (_WIN32_WCE) || defined (PSP) || defined(GP2X) +#if defined (_WIN32_WCE) || defined(GP2X) consvar_t cv_numChannels = {"snd_channels", "8", CV_SAVE|CV_CALL, CV_Unsigned, SetChannelsNum, 0, NULL, NULL, 0, 0, NULL}; #else consvar_t cv_numChannels = {"snd_channels", "32", CV_SAVE|CV_CALL, CV_Unsigned, SetChannelsNum, 0, NULL, NULL, 0, 0, NULL}; @@ -1379,7 +1379,7 @@ static boolean S_DigMusic(const char *mname, boolean looping) void S_ChangeMusic(const char *mmusic, UINT16 mflags, boolean looping) { -#if defined (_WIN32_WCE) || defined (PSP) || defined(GP2X) +#if defined (_WIN32_WCE) || defined(GP2X) S_ClearSfx(); #endif diff --git a/src/screen.h b/src/screen.h index 5f1f4bee3..79f8e5cf0 100644 --- a/src/screen.h +++ b/src/screen.h @@ -28,7 +28,7 @@ #endif // quickhack for V_Init()... to be cleaned up -#if defined (_WIN32_WCE) || defined (PSP) || defined (NOPOSTPROCESSING) +#if defined (_WIN32_WCE) || defined (NOPOSTPROCESSING) #define NUMSCREENS 2 #else #define NUMSCREENS 5 @@ -43,7 +43,7 @@ // we try to re-allocate a minimum of buffers for stability of the memory, // so all the small-enough tables based on screen size, are allocated once // and for all at the maximum size. -#if defined (_WIN32_WCE) || defined (_PSP) || defined (_NDS) +#if defined (_WIN32_WCE) || defined (_NDS) #define MAXVIDWIDTH 320 #define MAXVIDHEIGHT 200 #elif defined (GP2X) diff --git a/src/sdl12/Makefile.cfg b/src/sdl12/Makefile.cfg index cd7309c26..8c2eb7bd0 100644 --- a/src/sdl12/Makefile.cfg +++ b/src/sdl12/Makefile.cfg @@ -14,10 +14,6 @@ ifdef PANDORA include sdl12/SRB2Pandora/Makefile.cfg endif #ifdef PANDORA -ifdef PSP -include sdl12/SRB2PSP/Makefile.cfg -endif #ifdef PSP - ifdef WINCE include sdl12/SRB2CE/Makefile.cfg endif #ifef WINCE diff --git a/src/sdl12/SRB2PSP/ICON0.png b/src/sdl12/SRB2PSP/ICON0.png deleted file mode 100644 index 140230c1e..000000000 Binary files a/src/sdl12/SRB2PSP/ICON0.png and /dev/null differ diff --git a/src/sdl12/SRB2PSP/Makefile.cfg b/src/sdl12/SRB2PSP/Makefile.cfg deleted file mode 100644 index 5e4c0ba2f..000000000 --- a/src/sdl12/SRB2PSP/Makefile.cfg +++ /dev/null @@ -1,126 +0,0 @@ -# -# Makefile.cfg for SRB2/PSP -# - -# -#hmmm, the PSP -# - - PSPSDK=$(shell psp-config -p) - PSPDEV=$(shell psp-config -d) - PSPPREFIX=$(shell psp-config -P) - STRIP=psp-strip - MKSFO?=mksfoex -d MEMSIZE=1 - #MKSFO=mksfo - PACK_PBP=pack-pbp - FIXUP=psp-fixup-imports - HOSTCC:=$(CC) - CC=$(PSPDEV)/bin/psp-gcc - OBJCOPY=psp-objcopy - OBJDUMP=psp-objdump -ifdef FIXEDPRX - PRXGEN=psp-prxgen -else - PRXGEN=$(OBJCOPY) -endif -ifndef PRXSIGN - SIGNER:=$(PSPDEV)/bin/$(OBJCOPY) -endif - -ifndef ECHO - MKSFO:=@$(MKSFO) - PACK_PBP:=@$(PACK_PBP) - FIXUP:=@$(FIXUP) - PRXGEN:=@$(PRXGEN) -endif - - PSP_EBOOT_TITLE=SRB2-PSP vME - PSP_EBOOT_SFO=$(BIN)/PARAM.SFO - PSP_EBOOT_ICON=sdl12/SRB2PSP/ICON0.png - PSP_EBOOT_ICON1=NULL - PSP_EBOOT_UNKPNG=NULL - PSP_EBOOT_PIC1=sdl12/SRB2PSP/PIC1.png - PSP_EBOOT_SND0=NULL - PSP_EBOOT_PSAR=NULL - - SIGNER?=sdl12/SRB2PSP/psp-prxsign/psp-prxsign - - SDL=1 - PREFIX=psp - NONX86=1 - #NOHW=1 - NOHS=1 - NOMD5=1 - NONET=1 #No TCPIP code - NOPNG=1 #No Screenshot - - OPTS=-I$(PSPPREFIX)/include -I$(PSPSDK)/include - OPTS+=-DUNIXCOMMON -DFORCESDLMAIN -G0 - WFLAGS+=-Wno-undef - WFLAGS+=-O1 - LIBS=-lm - SDL_CONFIG?=$(PSPPREFIX)/bin/sdl-config - #SDL_CFLAGS?=-I$(PSPDEV)/psp/include/SDL - #SDL_LDFLAGS?=-lSDLmain -lSDL -lglut -lGLU -lGL -lpspgu -lpspaudiolib -lpspaudio -lpsphprm -lpspvfpu -lpsprtc -ifndef NOMIXER - LIBS:=-liberty -lvorbisfile -lvorbis -logg -lSDL $(LIBS) -endif -ifndef NOHW - OPTS+=-DSTATIC_OPENGL -DMINI_GL_COMPATIBILITY - LIBS+=-lGLU -lGL -lm -endif - #PSPSDK_LIBS=-L$(PSPSDK)/lib -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk - #LIBS+=$(PSPSDK_LIBS) -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -ifdef FIXEDPRX - LDFLAGS := -specs=$(PSPSDK)/lib/prxspecs -Wl,-q,-T$(PSPSDK)/lib/linkfile.prx $(LDFLAGS) - LIBS+=$(PSPSDK)/lib/prxexports.o -endif - -ifeq ($(PSP_FW_VERSION),) -PSP_FW_VERSION=150 -endif - - CPPFLAGS:=-D_PSP_FW_VERSION=$(PSP_FW_VERSION) $(CPPFLAGS) - - - # name of the exefile - EXENAME?=SRB2PSP.elf - PRXNAME?=SRB2PSP.prx - DBGNAME?=SRB2PSP.debug - -post-build: $(BIN)/EBOOT.PBP - -kxploit: $(BIN)/$(EXENAME) $(PSP_EBOOT_SFO) - -$(MKDIR) "$(BIN)/kxploit/srb2" - @echo emitting kxploit/srb2/ - $(STRIP) $(BIN)/$(EXENAME) -o $(BIN)/kxploit/srb2/EBOOT.PBP - @echo emitting kxploit/srb2% - -$(MKDIR) "$(BIN)/kxploit/srb2%/" - $(PACK_PBP) "$(BIN)/kxploit/srb2%/EBOOT.PBP" $(PSP_EBOOT_SFO) $(PSP_EBOOT_ICON) \ - $(PSP_EBOOT_ICON1) $(PSP_EBOOT_UNKPNG) $(PSP_EBOOT_PIC1) \ - $(PSP_EBOOT_SND0) NULL $(PSP_EBOOT_PSAR) - -sdl12/SRB2PSP/psp-prxsign/psp-prxsign: - -$(MAKE) -C sdl12/SRB2PSP/psp-prxsign CFLAGS=-pipe CC="$(HOSTCC)" - -fix-up: $(BIN)/$(EXENAME) - @echo Running psp-fixup-imports on $(EXENAME) - $(FIXUP) $(BIN)/$(EXENAME) - -$(BIN)/$(PRXNAME): $(BIN)/$(EXENAME) fix-up - @echo Building $(PRXNAME) out of $(EXENAME) - $(PRXGEN) $(BIN)/$(EXENAME) $@ - -$(BIN)/EBOOT.PBP: $(BIN)/$(PRXNAME) $(SIGNER) $(PSP_EBOOT_SFO) - @echo Signing and running pack-pbp to make PBP - $(SIGNER) $(BIN)/$(PRXNAME) $(BIN)/$(PRXNAME).sign - $(PACK_PBP) $@ $(PSP_EBOOT_SFO) $(PSP_EBOOT_ICON) \ - $(PSP_EBOOT_ICON1) $(PSP_EBOOT_UNKPNG) $(PSP_EBOOT_PIC1) \ - $(PSP_EBOOT_SND0) $(BIN)/$(PRXNAME).sign $(PSP_EBOOT_PSAR) - $(REMOVE) $(BIN)/$(PRXNAME).sign - -$(PSP_EBOOT_SFO): - -$(MKDIR) $(BIN) - $(MKSFO) '$(PSP_EBOOT_TITLE)' $@ - -#include $(PSPSDK)/lib/build.mak diff --git a/src/sdl12/SRB2PSP/PIC1.png b/src/sdl12/SRB2PSP/PIC1.png deleted file mode 100644 index 0722a96bc..000000000 Binary files a/src/sdl12/SRB2PSP/PIC1.png and /dev/null differ diff --git a/src/sdl12/SRB2PSP/psp-prxsign/.gitignore b/src/sdl12/SRB2PSP/psp-prxsign/.gitignore deleted file mode 100644 index 6a07f1a5a..000000000 --- a/src/sdl12/SRB2PSP/psp-prxsign/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/psp-prxsign -/psp-prxsign.exe diff --git a/src/sdl12/SRB2PSP/psp-prxsign/Makefile b/src/sdl12/SRB2PSP/psp-prxsign/Makefile deleted file mode 100644 index 4a9b7da0f..000000000 --- a/src/sdl12/SRB2PSP/psp-prxsign/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -EXE=psp-prxsign -SRC=main.c cmac.c -OBJ=$(SRC:.c=.o)# replaces the .c from SRC with .o - -OPENSSL_PKGCONFIG?=openssl -OPENSSL_CFLAGS?=$(shell pkg-config $(OPENSSL_PKGCONFIG) --cflags) -OPENSSL_LDFLAGS?=$(shell pkg-config $(OPENSSL_PKGCONFIG) --libs) - -CFLAGS+=$(OPENSSL_CFLAGS) -LDFLAGS+=$(OPENSSL_LDFLAGS) - -.PHONY : all # .PHONY ignores files named all - -all: $(EXE) # all is dependent on $(BIN) to be complete - - -$(EXE): $(OBJ) # $(EXE) is dependent on all of the files in $(OBJ) to exist - $(CC) $^ $(LDFLAGS) -o $@ - -.PHONY : clean # .PHONY ignores files named clean -clean: - -$(RM) $(OBJ) $(EXE) diff --git a/src/sdl12/SRB2PSP/psp-prxsign/cmac.c b/src/sdl12/SRB2PSP/psp-prxsign/cmac.c deleted file mode 100644 index f527f7a71..000000000 --- a/src/sdl12/SRB2PSP/psp-prxsign/cmac.c +++ /dev/null @@ -1,130 +0,0 @@ -#include "cmac.h" - -#define AES_128 0 -unsigned char const_Rb[16] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x87 -}; -unsigned char const_Zero[16] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; - -void xor_128(unsigned char *a, unsigned char *b, unsigned char *out) -{ - int i; - for (i=0;i<16; i++) - { - out[i] = a[i] ^ b[i]; - } -} - -/* AES-CMAC Generation Function */ - -static inline void leftshift_onebit(unsigned char *input,unsigned char *output) -{ - int i; - unsigned char overflow = 0; - - for ( i=15; i>=0; i-- ) - { - output[i] = input[i] << 1; - output[i] |= overflow; - overflow = (input[i] & 0x80)?1:0; - } -} - -void generate_subkey(unsigned char *key, unsigned char *K1, unsigned char *K2) -{ - unsigned char L[16]; - unsigned char Z[16]; - unsigned char tmp[16]; - int i; - - for ( i=0; i<16; i++ ) Z[i] = 0; - - AES_KEY aes; - AES_set_encrypt_key(key, 128, &aes); - - AES_encrypt(Z, L, &aes); - - if ( (L[0] & 0x80) == 0 ) /* If MSB(L) = 0, then K1 = L << 1 */ - { - leftshift_onebit(L,K1); - } else { /* Else K1 = ( L << 1 ) (+) Rb */ - leftshift_onebit(L,tmp); - xor_128(tmp,const_Rb,K1); - } - - if ( (K1[0] & 0x80) == 0 ) - { - leftshift_onebit(K1,K2); - } else { - leftshift_onebit(K1,tmp); - xor_128(tmp,const_Rb,K2); - } -} - -static inline void padding ( unsigned char *lastb, unsigned char *pad, int length ) -{ - int j; - - /* original last block */ - for ( j=0; j<16; j++ ) - { - if ( j < length ) - { - pad[j] = lastb[j]; - } else if ( j == length ) { - pad[j] = 0x80; - } else { - pad[j] = 0x00; - } - } -} - -void AES_CMAC ( unsigned char *key, unsigned char *input, int length, unsigned char *mac ) -{ - unsigned char X[16],Y[16], M_last[16], padded[16]; - unsigned char K1[16], K2[16]; - int n, i, flag; - generate_subkey(key,K1,K2); - - n = (length+15) / 16; /* n is number of rounds */ - - if ( n == 0 ) - { - n = 1; - flag = 0; - } else { - if ( (length%16) == 0 ) { /* last block is a complete block */ - flag = 1; - } else { /* last block is not complete block */ - flag = 0; - } - - } - - if ( flag ) { /* last block is complete block */ - xor_128(&input[16*(n-1)],K1,M_last); - } else { - padding(&input[16*(n-1)],padded,length%16); - xor_128(padded,K2,M_last); - } - AES_KEY aes; - AES_set_encrypt_key(key, 128, &aes); - - for ( i=0; i<16; i++ ) X[i] = 0; - for ( i=0; i -#include - -void xor_128(unsigned char *a, unsigned char *b, unsigned char *out); -void generate_subkey(unsigned char *key, unsigned char *K1, unsigned char *K2); -void AES_CMAC(unsigned char *key, unsigned char *input, int length, unsigned char *mac); - -#endif diff --git a/src/sdl12/SRB2PSP/psp-prxsign/kirk_header.h b/src/sdl12/SRB2PSP/psp-prxsign/kirk_header.h deleted file mode 100644 index 76c921ef0..000000000 --- a/src/sdl12/SRB2PSP/psp-prxsign/kirk_header.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef __kirk_header__ -#define __kirk_header__ - -static unsigned int size_kirk_header = 272; -static unsigned char kirk_header[] __attribute__((aligned(16))) = { - 0x2a, 0x4f, 0x3c, 0x49, 0x8a, 0x73, 0x4e, 0xd1, 0xf4, 0x55, 0x93, 0x0b, 0x9b, 0x69, 0xdc, 0x65, - 0x73, 0x22, 0x69, 0xd3, 0x73, 0x96, 0x7a, 0x60, 0x66, 0x8c, 0x88, 0xcf, 0x2f, 0x83, 0x58, 0xbc, - 0xb2, 0x00, 0x0a, 0x11, 0x72, 0x43, 0xc5, 0xde, 0xef, 0xbb, 0x2c, 0xbf, 0x97, 0x79, 0x6b, 0x9c, - 0x10, 0x1e, 0x7c, 0x57, 0x0e, 0xdb, 0x1d, 0x61, 0x6e, 0xb5, 0xf9, 0x3d, 0x35, 0xe9, 0x5c, 0xd8, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x33, 0x55, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x7e, 0x50, 0x53, 0x50, 0x00, 0x02, 0x00, 0x00, 0x01, 0x01, 0x22, 0x74, 0x69, 0x66, 0x70, 0x73, - 0x70, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 0x33, 0x55, 0x00, 0x50, 0x34, 0x55, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x40, 0x67, 0x3d, 0x00, 0x50, 0x55, 0x0a, 0x01, 0x10, 0x00, 0x40, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x6b, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x4c, 0x6b, 0x3d, 0x00, 0xcc, 0xbb, 0x11, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, -}; - -#endif diff --git a/src/sdl12/SRB2PSP/psp-prxsign/main.c b/src/sdl12/SRB2PSP/psp-prxsign/main.c deleted file mode 100644 index a970ae6c1..000000000 --- a/src/sdl12/SRB2PSP/psp-prxsign/main.c +++ /dev/null @@ -1,190 +0,0 @@ -#include -#include -#include -#include -#include -#include "cmac.h" -#include "kirk_header.h" -#include "psp_header.h" - -typedef unsigned char byte; - -typedef struct { - byte key[16]; - byte ckey[16]; - byte head_hash[16]; - byte data_hash[16]; - byte unused[32]; - int unk1; // 1 - int unk2; // 0 - int unk3[2]; - int datasize; - int dataoffset; - int unk4[6]; -} kirk1head_t; - -// secret kirk command 1 key -byte kirk_key[] = { - 0x98, 0xc9, 0x40, 0x97, 0x5c, 0x1d, 0x10, 0xe8, 0x7f, 0xe6, 0x0e, 0xa3, 0xfd, 0x03, 0xa8, 0xba -}; - -int main(int argc, char **argv) -{ - int i, relrem, size, fullsize, blocks, datasize; - size_t j; - kirk1head_t kirk; - byte iv[16]; - byte cmac[32]; - byte subk[32]; - byte psph[0x150]; - byte *datablob; - byte *filebuff; - FILE *f; - AES_KEY aesKey; - Elf32_Ehdr *ehdr; - Elf32_Shdr *shdr; - Elf32_Rel *relo; - - if(argc < 3) { - printf("Usage: %s unsigned.prx signed.prx\n", argv[0]); - return 1; - } - - // clean kirk header, use modified PRXdecrypter to get it - /*f = fopen(argv[1], "rb"); - if(!f) { - printf("failed to open %s\n", argv[1]); - return 1; - } - fread(&kirk, 1, sizeof(kirk1head_t), f); - fclose(f);*/ - //memcpy(&kirk, kirk_header, size_kirk_header); - memcpy(&kirk, kirk_header, sizeof(kirk1head_t)); - - datasize = kirk.datasize; - if(datasize % 16) datasize += 16 - (datasize % 16); - - // original ~PSP header - /*f = fopen(argv[2], "rb"); - if(!f) { - free(datablob); - printf("failed to open %s\n", argv[2]); - return 1; - } - fread(psph, 1, 0x150, f); - fclose(f);*/ - memcpy(&psph, psp_header, size_psp_header); - - // file to encrypt - f = fopen(argv[1], "rb"); - if(!f) { - printf("psp-prxsign: Unable to open PRX\n"); - return 1; - } - fseek(f, 0, SEEK_END); - size = ftell(f); - if(size > datasize - 16) { - fclose(f); - printf("psp-prxsign: PRX is too large\n"); - return 1; - } - printf("%s : %i\n", argv[1], size); - fseek(f, 0, SEEK_SET); - - fullsize = datasize + 0x30 + kirk.dataoffset; - - // datablob holds everything needed to calculate data HASH - datablob = malloc(fullsize); - if(!datablob) { - fclose(f); - printf("psp-prxsign: Failed to allocate memory for blob\n"); - return 1; - } - memset(datablob, 0, fullsize); - memcpy(datablob, &kirk.unk1, 0x30); - memcpy(datablob + 0x30, psph, kirk.dataoffset); - filebuff = datablob + 0x30 + kirk.dataoffset; - - int whocares = fread(filebuff, 1, size, f); - (void)whocares; - fclose(f); - - // remove relocations type 7 - relrem = 0; - ehdr = (void *)filebuff; - if(!memcmp(ehdr->e_ident, ELFMAG, 4) && ehdr->e_shnum) { - shdr = (void *)(filebuff + ehdr->e_shoff); - for(i = 0; i < ehdr->e_shnum; i++) { - if(shdr[i].sh_type == 0x700000A0) { - relo = (void *)(filebuff + shdr[i].sh_offset); - for(j = 0; j < shdr[i].sh_size / sizeof(Elf32_Rel); j++) { - if((relo[j].r_info & 0xFF) == 7) { - relo[j].r_info = 0; - relrem++; - } - } - } - } - } - //printf("%i relocations type 7 removed\ncalculating ...\n", relrem); - - // get AES/CMAC key - AES_set_decrypt_key(kirk_key, 128, &aesKey); - memset(iv, 0, 16); - AES_cbc_encrypt(kirk.key, kirk.key, 32, &aesKey, iv, AES_DECRYPT); - - // check header hash, optional - // if you take correct kirk header, hash is always correct -/* AES_CMAC(kirk.ckey, datablob, 0x30, cmac); - if(memcmp(cmac, kirk.head_hash, 16)) { - free(datablob); - printf("header hash invalid\n"); - return 1; - } -*/ - - // encrypt input file - AES_set_encrypt_key(kirk.key, 128, &aesKey); - memset(iv, 0, 16); - AES_cbc_encrypt(filebuff, filebuff, datasize, &aesKey, iv, AES_ENCRYPT); - - // make CMAC correct - generate_subkey(kirk.ckey, subk, subk + 16); - AES_set_encrypt_key(kirk.ckey, 128, &aesKey); - blocks = fullsize / 16; - memset(cmac, 0, 16); - for(i = 0; i < blocks - 1; i++) { - xor_128(cmac, &datablob[16 * i], cmac + 16); - AES_encrypt(cmac + 16, cmac, &aesKey); - } - - AES_set_decrypt_key(kirk.ckey, 128, &aesKey); - AES_decrypt(kirk.data_hash, iv, &aesKey); - xor_128(cmac, iv, iv); - xor_128(iv, subk, &datablob[16 * (blocks-1)]); - // check it, optional - // it works, this is only if you want to change something -/* AES_CMAC(kirk.ckey, datablob, fullsize, cmac); - if(memcmp(cmac, kirk.data_hash, 16)) { - fclose(f); - free(datablob); - printf("data hash calculation error\n"); - return 1; - } -*/ - f = fopen(argv[2], "wb"); - if(!f) { - free(datablob); - printf("psp-prxsign: Failed to write signed PRX\n"); - return 1; - } - //printf("saving ...\n"); - // save ~PSP header - fwrite(psph, 1, 0x150, f); - // save encrypted file - fwrite(filebuff, 1, fullsize - 0x30 - kirk.dataoffset, f); - fclose(f); - free(datablob); - //printf("everything done\n"); - return 0; -} diff --git a/src/sdl12/SRB2PSP/psp-prxsign/psp_header.h b/src/sdl12/SRB2PSP/psp-prxsign/psp_header.h deleted file mode 100644 index 7faef832c..000000000 --- a/src/sdl12/SRB2PSP/psp-prxsign/psp_header.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef __psp_header__ -#define __psp_header__ - -static unsigned int size_psp_header = 336; -static unsigned char psp_header[] __attribute__((aligned(16))) = { - 0x7e, 0x50, 0x53, 0x50, 0x00, 0x02, 0x00, 0x00, 0x01, 0x01, 0x22, 0x74, 0x69, 0x66, 0x70, 0x73, - 0x70, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 0x33, 0x55, 0x00, 0x50, 0x34, 0x55, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x40, 0x67, 0x3d, 0x00, 0x50, 0x55, 0x0a, 0x01, 0x10, 0x00, 0x40, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x6b, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x4c, 0x6b, 0x3d, 0x00, 0xcc, 0xbb, 0x11, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, - 0x90, 0x82, 0x4c, 0x48, 0xa3, 0x53, 0xb2, 0x1b, 0x13, 0x95, 0x2f, 0xf1, 0x0b, 0x90, 0x9c, 0x11, - 0x61, 0x40, 0x20, 0x67, 0xf8, 0xdb, 0xfc, 0x95, 0x5c, 0xbe, 0x8c, 0x80, 0xf3, 0x92, 0x03, 0x01, - 0xb0, 0xbe, 0xf5, 0xf8, 0xa1, 0xaf, 0xaf, 0xa8, 0x38, 0x26, 0x63, 0x09, 0x26, 0x0e, 0xb7, 0xd5, - 0x00, 0x33, 0x55, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x5c, 0x3e, 0x03, 0x22, 0xe5, 0x7d, 0xb9, 0xd1, 0x13, 0x67, 0x97, 0xa3, 0x5b, 0xd8, 0x77, 0x1f, - 0xf0, 0x05, 0xf3, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x87, 0x4a, 0xd7, 0x37, - 0xc2, 0x8f, 0x15, 0x43, 0x33, 0x93, 0x4d, 0x5b, 0xc0, 0x6e, 0xe4, 0x00, 0xc6, 0x0a, 0x71, 0x11, - 0x98, 0xb6, 0xc3, 0xb7, 0x59, 0x66, 0x21, 0xa8, 0x65, 0xf6, 0x53, 0xa9, 0x7a, 0x48, 0x17, 0xb6, -}; - -#endif diff --git a/src/sdl12/i_main.c b/src/sdl12/i_main.c index 930096373..180be311e 100644 --- a/src/sdl12/i_main.c +++ b/src/sdl12/i_main.c @@ -39,15 +39,6 @@ static char gateway[16] = {0}; static char netmask[16] = {0}; #endif -#ifdef _PSP -#include -#include -PSP_HEAP_SIZE_KB(24*1024); -PSP_MAIN_THREAD_ATTR(PSP_THREAD_ATTR_USER | PSP_THREAD_ATTR_VFPU); -PSP_MAIN_THREAD_NAME("SRB2"); -PSP_MAIN_THREAD_STACK_SIZE_KB(256); -#endif - #ifdef HAVE_SDL #ifdef HAVE_TTF diff --git a/src/sdl12/i_system.c b/src/sdl12/i_system.c index 1d577b742..1b62e81e4 100644 --- a/src/sdl12/i_system.c +++ b/src/sdl12/i_system.c @@ -78,9 +78,6 @@ typedef BOOL (WINAPI *p_SetProcessAffinityMask) (HANDLE, DWORD_PTR); #define HAVE_SDLCPUINFO #endif -#ifdef _PSP -//#include -#else #if defined (__unix__) || defined(__APPLE__) || (defined (UNIXCOMMON) && !defined (__HAIKU__) && !defined (_WII)) #if defined (__linux__) #include @@ -96,9 +93,8 @@ typedef BOOL (WINAPI *p_SetProcessAffinityMask) (HANDLE, DWORD_PTR); #include #endif #endif -#endif -#if defined (__linux__) || (defined (UNIXCOMMON) && !defined (_PSP) && !defined (__HAIKU__) && !defined (_WII)) +#if defined (__linux__) || (defined (UNIXCOMMON) && !defined (__HAIKU__) && !defined (_WII)) #ifndef NOTERMIOS #include #include // ioctl @@ -147,13 +143,6 @@ typedef BOOL (WINAPI *p_SetProcessAffinityMask) (HANDLE, DWORD_PTR); #define DEFAULTWADLOCATION2 "usb:/srb2wii" #define DEFAULTSEARCHPATH1 "sd:/srb2wii" #define DEFAULTSEARCHPATH2 "usb:/srb2wii" -#elif defined (_PSP) -#define NOCWD -#define NOHOME -#define DEFAULTWADLOCATION1 "host0:/bin/Resources" -#define DEFAULTWADLOCATION2 "ms0:/PSP/GAME/SRB2PSP" -#define DEFAULTSEARCHPATH1 "host0:/" -#define DEFAULTSEARCHPATH2 "ms0:/PSP/GAME/SRB2PSP" #elif defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON) #define DEFAULTWADLOCATION1 "/usr/local/share/games/SRB2" #define DEFAULTWADLOCATION2 "/usr/local/games/SRB2" @@ -972,11 +961,6 @@ void I_GetJoystickEvents(void) event.type = ev_keydown; else event.type = ev_keyup; -#ifdef _PSP - if (i == 12) - event.data1 = KEY_ESCAPE; - else -#endif event.data1 = KEY_JOY1 + i; D_PostEvent(&event); } @@ -2436,9 +2420,7 @@ void I_ShutdownSystem(void) void I_GetDiskFreeSpace(INT64 *freespace) { -#if defined (_PSP) - *freespace = 0; -#elif defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON) +#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON) #if defined (SOLARIS) || defined (__HAIKU__) || defined (_WII) *freespace = INT32_MAX; return; @@ -2485,9 +2467,6 @@ char *I_GetUserName(void) #ifdef GP2X static char username[MAXPLAYERNAME] = "GP2XUSER"; return username; -#elif defined (PSP) - static char username[MAXPLAYERNAME] = "PSPUSER"; - return username; #elif !defined (_WIN32_WCE) static char username[MAXPLAYERNAME]; char *p; @@ -2667,7 +2646,7 @@ static const char *locateWad(void) if (((envstr = I_GetEnv("SRB2WADDIR")) != NULL) && isWadPathOk(envstr)) return envstr; -#if defined(_WIN32_WCE) || defined(_PSP) +#if defined(_WIN32_WCE) // examine argv[0] strcpy(returnWadPath, myargv[0]); pathonly(returnWadPath); @@ -2792,12 +2771,7 @@ const char *I_LocateWad(void) // quick fix for compil UINT32 I_GetFreeMem(UINT32 *total) { -#if defined (_PSP) - // PSP - if (total) - *total = 32<<20; - return 16<<20; -#elif defined (FREEBSD) +#if defined (FREEBSD) struct vmmeter sum; kvm_t *kd; struct nlist namelist[] = diff --git a/src/sdl12/i_video.c b/src/sdl12/i_video.c index 00e1a1b3d..8ddec5804 100644 --- a/src/sdl12/i_video.c +++ b/src/sdl12/i_video.c @@ -54,7 +54,7 @@ #ifdef HAVE_IMAGE #include "SDL_image.h" -#elseif !(defined (_WIN32_WCE) || defined (PSP) || defined(GP2X)) +#elseif !(defined (_WIN32_WCE) || defined(GP2X)) #define LOAD_XPM //I want XPM! #include "IMG_xpm.c" //Alam: I don't want to add SDL_Image.dll/so #define HAVE_IMAGE //I have SDL_Image, sortof @@ -105,7 +105,7 @@ #endif // maximum number of windowed modes (see windowedModes[][]) -#if defined (_WIN32_WCE) || defined (PSP) || defined(GP2X) +#if defined (_WIN32_WCE) || defined(GP2X) #define MAXWINMODES (1) #elif defined (WII) #define MAXWINMODES (8) @@ -163,14 +163,10 @@ static const Uint32 surfaceFlagsW = SDL_HWPALETTE; //Can't handle WinCE cha #else static const Uint32 surfaceFlagsW = SDL_HWPALETTE/*|SDL_RESIZABLE*/; #endif -#ifdef _PSP -static const Uint32 surfaceFlagsF = SDL_HWSURFACE|SDL_FULLSCREEN; -#else static const Uint32 surfaceFlagsF = SDL_HWPALETTE|SDL_FULLSCREEN; -#endif static SDL_bool mousegrabok = SDL_TRUE; #define HalfWarpMouse(x,y) SDL_WarpMouse((Uint16)(x/2),(Uint16)(y/2)) -#if defined (_WIN32_WCE) || defined (PSP) || defined(GP2X) +#if defined (_WIN32_WCE) || defined(GP2X) static SDL_bool videoblitok = SDL_TRUE; #else static SDL_bool videoblitok = SDL_FALSE; @@ -180,7 +176,7 @@ static SDL_bool exposevideo = SDL_FALSE; // windowed video modes from which to choose from. static INT32 windowedModes[MAXWINMODES][2] = { -#if !(defined (_WIN32_WCE) || defined (PSP) || defined (GP2X)) +#if !(defined (_WIN32_WCE) || defined (GP2X)) #ifndef WII {1920,1200}, // 1.60,6.00 {1680,1050}, // 1.60,5.25 @@ -223,9 +219,6 @@ static void SDLSetMode(INT32 width, INT32 height, INT32 bpp, Uint32 flags) #ifdef _WII bpp = 16; // 8-bit mode poo #endif -#ifdef PSP - bpp = 16; -#endif #ifdef GP2X bpp = 16; #ifdef HAVE_GP2XSDL @@ -628,7 +621,7 @@ static void VID_Command_Info_f (void) static void VID_Command_ModeList_f(void) { -#if !defined (_WIN32_WCE) && !defined (_PSP) && !defined(GP2X) +#if !defined (_WIN32_WCE) && !defined(GP2X) INT32 i; #ifdef HWRENDER if (rendermode == render_opengl) @@ -901,21 +894,6 @@ static inline void SDLJoyRemap(event_t *event) } //I_OutputMsg("Button %i: event key %i and type: %i\n", button, event->data1, event->type); } -#elif defined(_PSP) - if (event->data1 > KEY_JOY1 + 9 + 2) // All button after D-Pad and Select/Start - event->data1 -= 4; // remap D-pad to Hats, offset of -4 - else if (event->data1 == KEY_JOY1 + 6) // Down - event->data1 = KEY_HAT1+1; - else if (event->data1 == KEY_JOY1 + 7) // Left - event->data1 = KEY_HAT1+2; - else if (event->data1 == KEY_JOY1 + 8) // Up - event->data1 = KEY_HAT1+0; - else if (event->data1 == KEY_JOY1 + 9) // Right - event->data1 = KEY_HAT1+3; - else if (event->data1 == KEY_JOY1 + 10) // Select - event->data1 = KEY_TAB; - else if (event->data1 == KEY_JOY1 + 11) // Start - event->data1 = KEY_ESCAPE; #else (void)event; #endif @@ -1262,7 +1240,7 @@ static inline boolean I_SkipFrame(void) skip = !skip; -#if 0 //(defined (GP2X) || defined (PSP)) +#if 0 //defined (GP2X) return skip; #endif @@ -1833,11 +1811,7 @@ void I_StartupGraphics(void) #ifdef FILTERS CV_RegisterVar (&cv_filter); #endif -#ifdef _PSP // pitch is 0, mod of 0 crash - disable_mouse = true; -#else disable_mouse = M_CheckParm("-nomouse"); -#endif if (disable_mouse) I_PutEnv(SDLNOMOUSE); if (!I_GetEnv("SDL_VIDEO_CENTERED")) diff --git a/src/sdl12/ogl_sdl.c b/src/sdl12/ogl_sdl.c index 8fda4aeb6..0790d5eff 100644 --- a/src/sdl12/ogl_sdl.c +++ b/src/sdl12/ogl_sdl.c @@ -62,13 +62,8 @@ PFNglGetIntegerv pglGetIntegerv; PFNglGetString pglGetString; #endif -#ifdef _PSP -static const Uint32 WOGLFlags = SDL_HWSURFACE|SDL_OPENGL/*|SDL_RESIZABLE*/; -static const Uint32 FOGLFlags = SDL_HWSURFACE|SDL_OPENGL|SDL_FULLSCREEN; -#else static const Uint32 WOGLFlags = SDL_OPENGL/*|SDL_RESIZABLE*/; static const Uint32 FOGLFlags = SDL_OPENGL|SDL_FULLSCREEN; -#endif /** \brief SDL video display surface */ diff --git a/src/sdl12/sdl_sound.c b/src/sdl12/sdl_sound.c index 990136ef7..261d7f622 100644 --- a/src/sdl12/sdl_sound.c +++ b/src/sdl12/sdl_sound.c @@ -85,7 +85,7 @@ // mixing buffer, and the samplerate of the raw data. // Needed for calling the actual sound output. -#if defined (_WIN32_WCE) || defined (PSP) || defined(GP2X) +#if defined (_WIN32_WCE) || defined(GP2X) #define NUM_CHANNELS MIX_CHANNELS #else #define NUM_CHANNELS MIX_CHANNELS*4 @@ -93,7 +93,7 @@ #define INDEXOFSFX(x) ((sfxinfo_t *)x - S_sfx) -#if defined (_WIN32_WCE) || defined (PSP) +#if defined (_WIN32_WCE) static Uint16 samplecount = 512; //Alam: .5KB samplecount at 11025hz is 46.439909297052154195011337868481ms of buffer #elif defined(GP2X) static Uint16 samplecount = 128; @@ -1225,13 +1225,7 @@ void I_StartupSound(void) audio.samples /= 2; } -#if defined (_PSP) && defined (HAVE_MIXER) // Bug in PSP's SDL_OpenAudio, can not open twice - I_SetChannels(); - sound_started = true; - Snd_Mutex = SDL_CreateMutex(); -#else if (nosound) -#endif return; #ifdef HW3SOUND @@ -1513,7 +1507,7 @@ void I_InitMusic(void) #endif I_OutputMsg("Linked with SDL_mixer version: %d.%d.%d\n", MIXlinked->major, MIXlinked->minor, MIXlinked->patch); -#if !(defined (PSP) || defined(GP2X) || defined (WII)) +#if !(defined(GP2X) || defined (WII)) if (audio.freq < 44100 && !M_CheckParm ("-freq")) //I want atleast 44Khz { audio.samples = (Uint16)(audio.samples*(INT32)(44100/audio.freq)); diff --git a/src/z_zone.c b/src/z_zone.c index eecb6e808..a30b160a3 100644 --- a/src/z_zone.c +++ b/src/z_zone.c @@ -220,7 +220,7 @@ static void *xm(size_t size) if (p == NULL) { -#if defined (_NDS) | defined (_PSP) +#if defined (_NDS) // Temporary-ish debugging measure Command_Memfree_f(); #endif