mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-29 20:50:58 +00:00
Gutted the GP2X
This commit is contained in:
parent
89619761f3
commit
23d28e6b8c
15 changed files with 24 additions and 307 deletions
|
@ -345,12 +345,6 @@ endif
|
|||
endif
|
||||
endif
|
||||
|
||||
ifdef GP2X
|
||||
ifdef SDL
|
||||
SDL12=1
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef ARCHNAME
|
||||
OBJDIR:=$(OBJDIR)/$(ARCHNAME)
|
||||
BIN:=$(BIN)/$(ARCHNAME)
|
||||
|
|
|
@ -1255,9 +1255,6 @@ 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)
|
||||
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));
|
||||
|
||||
Setvalue(cvar, svalue, stealth);
|
||||
|
|
|
@ -979,7 +979,7 @@ void D_SRB2Main(void)
|
|||
setbuf(stdout, NULL); // non-buffered output
|
||||
#endif
|
||||
|
||||
#if defined (_WIN32_WCE) //|| defined (_DEBUG) || defined (GP2X)
|
||||
#if defined (_WIN32_WCE) //|| defined (_DEBUG)
|
||||
devparm = M_CheckParm("-nodebug") == 0;
|
||||
#else
|
||||
devparm = M_CheckParm("-debug") != 0;
|
||||
|
@ -1005,7 +1005,7 @@ void D_SRB2Main(void)
|
|||
|
||||
if (!userhome)
|
||||
{
|
||||
#if ((defined (__unix__) && !defined (MSDOS)) || defined(__APPLE__) || defined (UNIXCOMMON)) && !defined (__CYGWIN__) && !defined(GP2X)
|
||||
#if ((defined (__unix__) && !defined (MSDOS)) || defined(__APPLE__) || defined (UNIXCOMMON)) && !defined (__CYGWIN__)
|
||||
I_Error("Please set $HOME to your home directory\n");
|
||||
#elif defined (_WIN32_WCE) && 0
|
||||
if (dedicated)
|
||||
|
@ -1419,10 +1419,7 @@ const char *D_Home(void)
|
|||
userhome = M_GetNextParm();
|
||||
else
|
||||
{
|
||||
#if defined (GP2X)
|
||||
usehome = false; //let use the CWD
|
||||
return NULL;
|
||||
#elif !((defined (__unix__) && !defined (MSDOS)) || defined(__APPLE__) || defined (UNIXCOMMON)) && !defined (__APPLE__) && !defined(_WIN32_WCE)
|
||||
#if !((defined (__unix__) && !defined (MSDOS)) || defined(__APPLE__) || defined (UNIXCOMMON)) && !defined (__APPLE__) && !defined(_WIN32_WCE)
|
||||
if (FIL_FileOK(CONFIGFILENAME))
|
||||
usehome = false; // Let's NOT use home
|
||||
else
|
||||
|
|
|
@ -244,7 +244,7 @@ INT32 cv_debug;
|
|||
consvar_t cv_usemouse = {"use_mouse", "On", CV_SAVE|CV_CALL,usemouse_cons_t, I_StartupMouse, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_usemouse2 = {"use_mouse2", "Off", CV_SAVE|CV_CALL,usemouse_cons_t, I_StartupMouse2, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
#if defined (GP2X) || defined (_NDS) //only one joystick
|
||||
#if 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,
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
// Use Mixer interface?
|
||||
#ifdef HAVE_MIXER
|
||||
//#if !defined(_WIN32_WCE) && !defined(GP2X)
|
||||
//#if !defined(_WIN32_WCE)
|
||||
#define SOUND SOUND_MIXER
|
||||
#define NOHS // No HW3SOUND
|
||||
#ifdef HW3SOUND
|
||||
|
@ -381,7 +381,7 @@ enum {
|
|||
};
|
||||
|
||||
// Name of local directory for config files and savegames
|
||||
#if !defined(_WIN32_WCE) && !defined(GP2X)
|
||||
#if !defined(_WIN32_WCE)
|
||||
#if (((defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON)) && !defined (__CYGWIN__)) && !defined (__APPLE__)
|
||||
#define DEFAULTDIR ".srb2"
|
||||
#else
|
||||
|
|
|
@ -286,17 +286,7 @@ static keyname_t keynames[] =
|
|||
{KEY_2MOUSEWHEELUP, "Wheel 2 UP"},
|
||||
{KEY_2MOUSEWHEELDOWN, "Wheel 2 Down"},
|
||||
|
||||
#if defined (GP2X)
|
||||
{KEY_JOY1+0, "JOYA"},
|
||||
{KEY_JOY1+1, "JOYY"},
|
||||
{KEY_JOY1+2, "JOYB"},
|
||||
{KEY_JOY1+3, "JOYX"},
|
||||
{KEY_JOY1+4, "JOYL"},
|
||||
{KEY_JOY1+5, "JOYR"},
|
||||
{KEY_JOY1+6, "JOYVOLUP"},
|
||||
{KEY_JOY1+7, "JOYVOLDOWN"},
|
||||
{KEY_JOY1+8, "JOYSELECT"},
|
||||
#elif defined (_NDS)
|
||||
#if defined (_NDS)
|
||||
{KEY_JOY1+0, "JOYA"},
|
||||
{KEY_JOY1+1, "JOYB"},
|
||||
{KEY_JOY1+2, "JOYX"},
|
||||
|
@ -378,18 +368,7 @@ static keyname_t keynames[] =
|
|||
{KEY_DBL2MOUSE1+6, "DBLSEC_MOUSE7"},
|
||||
{KEY_DBL2MOUSE1+7, "DBLSEC_MOUSE8"},
|
||||
|
||||
#if defined (GP2X)
|
||||
{KEY_DBLJOY1+0, "DBLJOYA"},
|
||||
{KEY_DBLJOY1+1, "DBLJOYY"},
|
||||
{KEY_DBLJOY1+2, "DBLJOYB"},
|
||||
{KEY_DBLJOY1+3, "DBLJOYX"},
|
||||
{KEY_DBLJOY1+4, "DBLJOYL"},
|
||||
{KEY_DBLJOY1+5, "DBLJOYR"},
|
||||
{KEY_DBLJOY1+6, "DBLJOYVOLUP"},
|
||||
{KEY_DBLJOY1+7, "DBLJOYVOLDOWN"},
|
||||
{KEY_DBLJOY1+8, "DBLJOYSELECT"},
|
||||
#define NOMOREJOYBTN_1DBL
|
||||
#elif defined (_NDS)
|
||||
#if defined (_NDS)
|
||||
{KEY_DBLJOY1+0, "DBLJOYA"},
|
||||
{KEY_DBLJOY1+1, "DBLJOYB"},
|
||||
{KEY_DBLJOY1+2, "DBLJOYX"},
|
||||
|
@ -656,20 +635,7 @@ INT32 G_KeyStringtoNum(const char *keystr)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if defined (GP2X)
|
||||
void G_Controldefault(void)
|
||||
{
|
||||
gamecontrol[gc_fire ][0] = KEY_JOY1+0; //A
|
||||
gamecontrol[gc_forward ][0] = KEY_JOY1+1; //Y
|
||||
gamecontrol[gc_jump ][0] = KEY_JOY1+2; //B
|
||||
gamecontrol[gc_use ][0] = KEY_JOY1+3; //X
|
||||
gamecontrol[gc_strafeleft ][0] = KEY_JOY1+4; //L
|
||||
gamecontrol[gc_straferight][0] = KEY_JOY1+5; //R
|
||||
gamecontrol[gc_lookup ][0] = KEY_JOY1+6; //U
|
||||
gamecontrol[gc_lookdown ][0] = KEY_JOY1+7; //D
|
||||
gamecontrol[gc_pause ][0] = KEY_JOY1+8; //S
|
||||
}
|
||||
#elif defined (_NDS)
|
||||
#if defined (_NDS)
|
||||
void G_Controldefault(void)
|
||||
{
|
||||
gamecontrol[gc_fire ][0] = KEY_JOY1+2; //X
|
||||
|
|
|
@ -62,7 +62,7 @@ consvar_t sndserver_arg = {"sndserver_arg", "-quiet", CV_SAVE, NULL, 0, NULL, NU
|
|||
#define SURROUND
|
||||
#endif
|
||||
|
||||
#if defined (_WIN32_WCE) || defined(GP2X)
|
||||
#if defined (_WIN32_WCE)
|
||||
consvar_t cv_samplerate = {"samplerate", "11025", 0, CV_Unsigned, NULL, 11025, NULL, NULL, 0, 0, NULL}; //Alam: For easy hacking?
|
||||
#elif defined(_WINDOWS)
|
||||
consvar_t cv_samplerate = {"samplerate", "44100", 0, CV_Unsigned, NULL, 44100, NULL, NULL, 0, 0, NULL}; //Alam: For easy hacking?
|
||||
|
@ -91,7 +91,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(GP2X)
|
||||
#if defined (_WIN32_WCE)
|
||||
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};
|
||||
|
@ -1377,7 +1377,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(GP2X)
|
||||
#if defined (_WIN32_WCE)
|
||||
S_ClearSfx();
|
||||
#endif
|
||||
|
||||
|
|
|
@ -46,9 +46,6 @@
|
|||
#if defined (_WIN32_WCE) || defined (_NDS)
|
||||
#define MAXVIDWIDTH 320
|
||||
#define MAXVIDHEIGHT 200
|
||||
#elif defined (GP2X)
|
||||
#define MAXVIDWIDTH 320 //720
|
||||
#define MAXVIDHEIGHT 240 //576
|
||||
#else
|
||||
#define MAXVIDWIDTH 1920 // don't set this too high because actually
|
||||
#define MAXVIDHEIGHT 1200 // lots of tables are allocated with the MAX size.
|
||||
|
|
|
@ -52,37 +52,6 @@ ifdef FREEBSD
|
|||
LIBS+=-lipx -lkvm
|
||||
endif
|
||||
|
||||
#
|
||||
#here is GP2x (arm-gp2x-linux)
|
||||
#
|
||||
ifdef GP2X
|
||||
PNG_CONFIG?=$(PREFIX)-libpng12-config
|
||||
ifdef STATIC #need a better setting name
|
||||
CFLAGS+=-I$(OPEN2X)/include
|
||||
ifndef NOMIXER
|
||||
LIBS+=-lvorbisidec
|
||||
ifdef MIKMOD
|
||||
LIBS+=-lmikmod
|
||||
endif
|
||||
ifdef SMPEGLIB
|
||||
LIBS+=-lsmpeg
|
||||
LD=$(CXX)
|
||||
endif
|
||||
endif
|
||||
NONET=1
|
||||
endif
|
||||
ifndef ARCHNAME
|
||||
"error"
|
||||
endif
|
||||
NONX86=1
|
||||
NOHW=1
|
||||
NOHS=1
|
||||
NOMD5=1
|
||||
WFLAGS+=-O0
|
||||
OPTS+=-DGP2X -ffast-math -mcpu=arm920t
|
||||
EXENAME?=SRB2GP2X.gpe
|
||||
endif
|
||||
|
||||
ifndef NOHW
|
||||
OPTS+=-I/usr/X11R6/include
|
||||
LDFLAGS+=-L/usr/X11R6/lib
|
||||
|
|
|
@ -37,10 +37,6 @@
|
|||
#pragma warning(default : 4214 4244)
|
||||
#endif
|
||||
|
||||
#ifdef GP2X
|
||||
#define NOLOADSO
|
||||
#endif
|
||||
|
||||
#if SDL_VERSION_ATLEAST(1,2,6) && !defined (NOLOADSO)
|
||||
#include "SDL_loadso.h" // 1.2.6+
|
||||
#elif !defined (NOLOADSO)
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
#ifdef HAVE_SDL
|
||||
|
||||
#if defined (_WIN32_WCE) || defined(GP2X)
|
||||
#if defined (_WIN32_WCE)
|
||||
#define NOSDLCD
|
||||
#endif
|
||||
|
||||
|
|
|
@ -121,7 +121,7 @@ int main(int argc, char **argv)
|
|||
logdir = D_Home();
|
||||
|
||||
#ifdef LOGMESSAGES
|
||||
#if defined(_WIN32_WCE) || defined(GP2X)
|
||||
#if defined(_WIN32_WCE)
|
||||
logstream = fopen(va("%s.log",argv[0]), "a");
|
||||
#elif defined (DEFAULTDIR)
|
||||
if (logdir)
|
||||
|
|
|
@ -128,14 +128,7 @@ typedef BOOL (WINAPI *p_SetProcessAffinityMask) (HANDLE, DWORD_PTR);
|
|||
#endif
|
||||
|
||||
// Locations for searching the srb2.srb
|
||||
#ifdef GP2X
|
||||
#define DEFAULTWADLOCATION1 "/mnt/sd"
|
||||
#define DEFAULTWADLOCATION2 "/mnt/sd/SRB2"
|
||||
#define DEFAULTWADLOCATION3 "/tmp/mnt/sd"
|
||||
#define DEFAULTWADLOCATION4 "/tmp/mnt/sd/SRB2"
|
||||
#define DEFAULTSEARCHPATH1 "/mnt/sd"
|
||||
#define DEFAULTSEARCHPATH2 "/tmp/mnt/sd"
|
||||
#elif defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
|
||||
#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
|
||||
#define DEFAULTWADLOCATION1 "/usr/local/share/games/SRB2"
|
||||
#define DEFAULTWADLOCATION2 "/usr/local/games/SRB2"
|
||||
#define DEFAULTWADLOCATION3 "/usr/share/games/SRB2"
|
||||
|
@ -203,9 +196,6 @@ static void JoyReset(SDLJoyInfo_t *JoySet)
|
|||
{
|
||||
if (JoySet->dev)
|
||||
{
|
||||
#ifdef GP2X //GP2X's SDL does an illegal free on the 1st joystick...
|
||||
if (SDL_JoystickIndex(JoySet->dev) != 0)
|
||||
#endif
|
||||
SDL_JoystickClose(JoySet->dev);
|
||||
}
|
||||
JoySet->dev = NULL;
|
||||
|
@ -417,9 +407,7 @@ static void I_StartupConsole(void)
|
|||
signal(SIGTTIN, SIG_IGN);
|
||||
signal(SIGTTOU, SIG_IGN);
|
||||
|
||||
#if !defined(GP2X) //read is bad on GP2X
|
||||
consolevent = !M_CheckParm("-noconsole");
|
||||
#endif
|
||||
framebuffer = M_CheckParm("-framebuffer");
|
||||
|
||||
if (framebuffer)
|
||||
|
@ -835,22 +823,12 @@ INT32 I_GetKey (void)
|
|||
//
|
||||
void I_JoyScale(void)
|
||||
{
|
||||
#ifdef GP2X
|
||||
if (JoyInfo.dev && SDL_JoystickIndex(JoyInfo.dev) == 0)
|
||||
Joystick.bGamepadStyle = true;
|
||||
else
|
||||
#endif
|
||||
Joystick.bGamepadStyle = cv_joyscale.value==0;
|
||||
JoyInfo.scale = Joystick.bGamepadStyle?1:cv_joyscale.value;
|
||||
}
|
||||
|
||||
void I_JoyScale2(void)
|
||||
{
|
||||
#ifdef GP2X
|
||||
if (JoyInfo2.dev && SDL_JoystickIndex(JoyInfo2.dev) == 0)
|
||||
Joystick.bGamepadStyle = true;
|
||||
else
|
||||
#endif
|
||||
Joystick2.bGamepadStyle = cv_joyscale2.value==0;
|
||||
JoyInfo2.scale = Joystick2.bGamepadStyle?1:cv_joyscale2.value;
|
||||
}
|
||||
|
@ -2099,7 +2077,7 @@ void I_StartupTimer(void)
|
|||
pfntimeGetTime = (p_timeGetTime)GetProcAddress(winmm, "timeGetTime");
|
||||
}
|
||||
I_AddExitFunc(I_ShutdownTimer);
|
||||
#elif 0 //#elif !defined(GP2X) // GP2X have broken pthreads?
|
||||
#elif 0
|
||||
if (SDL_InitSubSystem(SDL_INIT_TIMER) < 0)
|
||||
I_Error("SRB2: Needs SDL_Timer, Error: %s", SDL_GetError());
|
||||
#endif
|
||||
|
@ -2124,11 +2102,7 @@ INT32 I_StartupSystem(void)
|
|||
SDLcompiled.major, SDLcompiled.minor, SDLcompiled.patch);
|
||||
I_OutputMsg("Linked with SDL version: %d.%d.%d\n",
|
||||
SDLlinked->major, SDLlinked->minor, SDLlinked->patch);
|
||||
#if 0 //#ifdef GP2X //start up everything
|
||||
if (SDL_Init(SDL_INIT_NOPARACHUTE|SDL_INIT_EVERYTHING) < 0)
|
||||
#else
|
||||
if (SDL_Init(SDL_INIT_NOPARACHUTE) < 0)
|
||||
#endif
|
||||
I_Error("SRB2: SDL System Error: %s", SDL_GetError()); //Alam: Oh no....
|
||||
#ifndef NOMUMBLE
|
||||
I_SetupMumble();
|
||||
|
@ -2179,10 +2153,6 @@ void I_Quit(void)
|
|||
}
|
||||
death:
|
||||
W_Shutdown();
|
||||
#ifdef GP2X
|
||||
chdir("/usr/gp2x");
|
||||
execl("/usr/gp2x/gp2xmenu", "/usr/gp2x/gp2xmenu", NULL);
|
||||
#endif
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
@ -2279,10 +2249,6 @@ void I_Error(const char *error, ...)
|
|||
va_end(argptr);
|
||||
#endif
|
||||
W_Shutdown();
|
||||
#ifdef GP2X
|
||||
chdir("/usr/gp2x");
|
||||
execl("/usr/gp2x/gp2xmenu", "/usr/gp2x/gp2xmenu", NULL);
|
||||
#endif
|
||||
exit(-1); // recursive errors detected
|
||||
}
|
||||
}
|
||||
|
@ -2333,10 +2299,6 @@ void I_Error(const char *error, ...)
|
|||
W_Shutdown();
|
||||
#if defined (PARANOIA) && defined (__CYGWIN__)
|
||||
*(INT32 *)2 = 4; //Alam: Debug!
|
||||
#endif
|
||||
#ifdef GP2X
|
||||
chdir("/usr/gp2x");
|
||||
execl("/usr/gp2x/gp2xmenu", "/usr/gp2x/gp2xmenu", NULL);
|
||||
#endif
|
||||
exit(-1);
|
||||
}
|
||||
|
@ -2456,10 +2418,7 @@ void I_GetDiskFreeSpace(INT64 *freespace)
|
|||
|
||||
char *I_GetUserName(void)
|
||||
{
|
||||
#ifdef GP2X
|
||||
static char username[MAXPLAYERNAME] = "GP2XUSER";
|
||||
return username;
|
||||
#elif !defined (_WIN32_WCE)
|
||||
#if !defined (_WIN32_WCE)
|
||||
static char username[MAXPLAYERNAME];
|
||||
char *p;
|
||||
#ifdef _WIN32
|
||||
|
|
|
@ -35,11 +35,6 @@
|
|||
#pragma warning(default : 4214 4244)
|
||||
#endif
|
||||
|
||||
#if SDL_VERSION_ATLEAST(1,2,9) && defined (GP2X)
|
||||
#define HAVE_GP2XSDL
|
||||
#include "SDL_gp2x.h"
|
||||
#endif
|
||||
|
||||
#if SDL_VERSION_ATLEAST(1,3,0)
|
||||
#define SDLK_EQUALS SDLK_KP_EQUALSAS400
|
||||
#define SDLK_LMETA SDLK_LGUI
|
||||
|
@ -54,7 +49,7 @@
|
|||
|
||||
#ifdef HAVE_IMAGE
|
||||
#include "SDL_image.h"
|
||||
#elseif !(defined (_WIN32_WCE) || defined(GP2X))
|
||||
#elseif !defined (_WIN32_WCE)
|
||||
#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
|
||||
|
@ -99,7 +94,7 @@
|
|||
#endif
|
||||
|
||||
// maximum number of windowed modes (see windowedModes[][])
|
||||
#if defined (_WIN32_WCE) || defined(GP2X)
|
||||
#if defined (_WIN32_WCE)
|
||||
#define MAXWINMODES (1)
|
||||
#else
|
||||
#define MAXWINMODES (27)
|
||||
|
@ -118,11 +113,7 @@ rendermode_t rendermode=render_soft;
|
|||
boolean highcolor = false;
|
||||
|
||||
// synchronize page flipping with screen refresh
|
||||
#if defined(GP2X) && !defined(HAVE_GP2XSDL)
|
||||
consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
#else
|
||||
consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
#endif
|
||||
static consvar_t cv_stretch = {"stretch", "Off", CV_SAVE|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
UINT8 graphics_started = 0; // Is used in console.c and screen.c
|
||||
|
@ -158,7 +149,7 @@ static const Uint32 surfaceFlagsW = SDL_HWPALETTE/*|SDL_RESIZABLE*/;
|
|||
static const Uint32 surfaceFlagsF = SDL_HWPALETTE|SDL_FULLSCREEN;
|
||||
static SDL_bool mousegrabok = SDL_TRUE;
|
||||
#define HalfWarpMouse(x,y) SDL_WarpMouse((Uint16)(x/2),(Uint16)(y/2))
|
||||
#if defined (_WIN32_WCE) || defined(GP2X)
|
||||
#if defined (_WIN32_WCE)
|
||||
static SDL_bool videoblitok = SDL_TRUE;
|
||||
#else
|
||||
static SDL_bool videoblitok = SDL_FALSE;
|
||||
|
@ -168,7 +159,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 (GP2X))
|
||||
#if !defined (_WIN32_WCE)
|
||||
{1920,1200}, // 1.60,6.00
|
||||
{1680,1050}, // 1.60,5.25
|
||||
{1600,1200}, // 1.33,5.00
|
||||
|
@ -206,12 +197,6 @@ static void SDLSetMode(INT32 width, INT32 height, INT32 bpp, Uint32 flags)
|
|||
if (bpp < 16)
|
||||
bpp = 16; // 256 mode poo
|
||||
#endif
|
||||
#ifdef GP2X
|
||||
bpp = 16;
|
||||
#ifdef HAVE_GP2XSDL
|
||||
height = 240;
|
||||
#endif
|
||||
#endif
|
||||
#ifdef FILTERS
|
||||
bpp = Setupf2x(width, height, bpp);
|
||||
#endif
|
||||
|
@ -231,9 +216,6 @@ static void SDLSetMode(INT32 width, INT32 height, INT32 bpp, Uint32 flags)
|
|||
SDL_DC_EmulateMouse(SDL_FALSE);
|
||||
SDL_DC_EmulateKeyboard(SDL_TRUE);
|
||||
#endif
|
||||
#ifdef HAVE_GP2XSDL
|
||||
SDL_ShowCursor(SDL_DISABLE); //For GP2X Open2x
|
||||
#endif
|
||||
#ifdef FILTERS
|
||||
if (vidSurface && preSurface && f2xSurface)
|
||||
{
|
||||
|
@ -604,7 +586,7 @@ static void VID_Command_Info_f (void)
|
|||
|
||||
static void VID_Command_ModeList_f(void)
|
||||
{
|
||||
#if !defined (_WIN32_WCE) && !defined(GP2X)
|
||||
#if !defined (_WIN32_WCE)
|
||||
INT32 i;
|
||||
#ifdef HWRENDER
|
||||
if (rendermode == render_opengl)
|
||||
|
@ -752,134 +734,7 @@ static inline VOID ResetAero(VOID)
|
|||
|
||||
static inline void SDLJoyRemap(event_t *event)
|
||||
{
|
||||
#if defined(GP2X)
|
||||
#define GP2X_BUTTON_UP (0)
|
||||
#define GP2X_BUTTON_DOWN (4)
|
||||
#define GP2X_BUTTON_LEFT (2)
|
||||
#define GP2X_BUTTON_RIGHT (6)
|
||||
#define GP2X_BUTTON_UPLEFT (1)
|
||||
#define GP2X_BUTTON_UPRIGHT (7)
|
||||
#define GP2X_BUTTON_DOWNLEFT (3)
|
||||
#define GP2X_BUTTON_DOWNRIGHT (5)
|
||||
#define GP2X_BUTTON_CLICK (18)
|
||||
#define GP2X_BUTTON_A (12)
|
||||
#define GP2X_BUTTON_B (13)
|
||||
#define GP2X_BUTTON_X (14)
|
||||
#define GP2X_BUTTON_Y (15)
|
||||
#define GP2X_BUTTON_L (10)
|
||||
#define GP2X_BUTTON_R (11)
|
||||
#define GP2X_BUTTON_START (8)
|
||||
#define GP2X_BUTTON_SELECT (9)
|
||||
#define GP2X_BUTTON_VOLUP (16)
|
||||
#define GP2X_BUTTON_VOLDOWN (17)
|
||||
if ((event->type == ev_keydown || event->type == ev_keyup) && (KEY_JOY1 <= event->data1 && event->data1 <= KEY_JOY1+JOYBUTTONS))
|
||||
{
|
||||
INT32 button = event->data1-KEY_JOY1;
|
||||
if (button <= 7)
|
||||
{
|
||||
static UINT8 DPAD = 0;
|
||||
if (event->type == ev_keyup)
|
||||
{
|
||||
event->type = ev_console;
|
||||
DPAD &= ~(1<<button);
|
||||
}
|
||||
else
|
||||
{
|
||||
event->type = ev_joystick;
|
||||
DPAD |= 1<<button;
|
||||
}
|
||||
event->data2 = event->data3 = INT32_MAX;
|
||||
if ((DPAD & (1<<GP2X_BUTTON_UP)) && ((DPAD & (1<<GP2X_BUTTON_UPLEFT)) || (DPAD & (1<<GP2X_BUTTON_UPRIGHT))))
|
||||
button = GP2X_BUTTON_UP;
|
||||
if ((DPAD & (1<<GP2X_BUTTON_LEFT)) && ((DPAD & (1<<GP2X_BUTTON_UPLEFT)) || (DPAD & (1<<GP2X_BUTTON_DOWNLEFT))))
|
||||
button = GP2X_BUTTON_LEFT;
|
||||
if ((DPAD & (1<<GP2X_BUTTON_DOWN)) && ((DPAD & (1<<GP2X_BUTTON_DOWNLEFT)) || (DPAD & (1<<GP2X_BUTTON_DOWNRIGHT))))
|
||||
button = GP2X_BUTTON_DOWN;
|
||||
if ((DPAD & (1<<GP2X_BUTTON_RIGHT)) && ((DPAD & (1<<GP2X_BUTTON_UPRIGHT)) || (DPAD & (1<<GP2X_BUTTON_DOWNRIGHT))))
|
||||
button = GP2X_BUTTON_RIGHT;
|
||||
if (DPAD == 0)
|
||||
{
|
||||
event->type = ev_joystick;
|
||||
event->data2 = event->data3 = 0;
|
||||
}
|
||||
else switch (button)
|
||||
{
|
||||
case GP2X_BUTTON_UP:
|
||||
event->data3 = -1;
|
||||
break;
|
||||
case GP2X_BUTTON_DOWN:
|
||||
event->data3 = 1;
|
||||
break;
|
||||
case GP2X_BUTTON_LEFT:
|
||||
event->data2 = -1;
|
||||
break;
|
||||
case GP2X_BUTTON_RIGHT:
|
||||
event->data2 = 1;
|
||||
break;
|
||||
case GP2X_BUTTON_UPLEFT:
|
||||
event->data2 = -1;
|
||||
event->data3 = -1;
|
||||
break;
|
||||
case GP2X_BUTTON_UPRIGHT:
|
||||
event->data2 = 1;
|
||||
event->data3 = -1;
|
||||
break;
|
||||
case GP2X_BUTTON_DOWNLEFT:
|
||||
event->data2 = -1;
|
||||
event->data3 = 1;
|
||||
break;
|
||||
case GP2X_BUTTON_DOWNRIGHT:
|
||||
event->data2 = 1;
|
||||
event->data3 = 1;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
event->data1 = 0;
|
||||
return;
|
||||
}
|
||||
else switch (button)
|
||||
{
|
||||
case GP2X_BUTTON_CLICK:
|
||||
event->data1 = KEY_ENTER;
|
||||
break;
|
||||
case GP2X_BUTTON_A:
|
||||
event->data1 = KEY_JOY1+0;
|
||||
break;
|
||||
case GP2X_BUTTON_B:
|
||||
event->data1 = KEY_JOY1+2;
|
||||
break;
|
||||
case GP2X_BUTTON_X:
|
||||
event->data1 = KEY_JOY1+3;
|
||||
break;
|
||||
case GP2X_BUTTON_Y:
|
||||
event->data1 = KEY_JOY1+1;
|
||||
break;
|
||||
case GP2X_BUTTON_L:
|
||||
event->data1 = KEY_JOY1+4;
|
||||
break;
|
||||
case GP2X_BUTTON_R:
|
||||
event->data1 = KEY_JOY1+5;
|
||||
break;
|
||||
case GP2X_BUTTON_START:
|
||||
event->data1 = KEY_ESCAPE;
|
||||
break;
|
||||
case GP2X_BUTTON_SELECT:
|
||||
event->data1 = KEY_JOY1+8;
|
||||
break;
|
||||
case GP2X_BUTTON_VOLUP:
|
||||
event->data1 = KEY_JOY1+6;
|
||||
break;
|
||||
case GP2X_BUTTON_VOLDOWN:
|
||||
event->data1 = KEY_JOY1+7;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
//I_OutputMsg("Button %i: event key %i and type: %i\n", button, event->data1, event->type);
|
||||
}
|
||||
#else
|
||||
(void)event;
|
||||
#endif
|
||||
}
|
||||
|
||||
static INT32 SDLJoyAxis(const Sint16 axis, evtype_t which)
|
||||
|
@ -1223,10 +1078,6 @@ static inline boolean I_SkipFrame(void)
|
|||
|
||||
skip = !skip;
|
||||
|
||||
#if 0 //defined (GP2X)
|
||||
return skip;
|
||||
#endif
|
||||
|
||||
switch (gamestate)
|
||||
{
|
||||
case GS_LEVEL:
|
||||
|
|
|
@ -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(GP2X)
|
||||
#if defined (_WIN32_WCE)
|
||||
#define NUM_CHANNELS MIX_CHANNELS
|
||||
#else
|
||||
#define NUM_CHANNELS MIX_CHANNELS*4
|
||||
|
@ -95,8 +95,6 @@
|
|||
|
||||
#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;
|
||||
#else
|
||||
static Uint16 samplecount = 1024; //Alam: 1KB samplecount at 22050hz is 46.439909297052154195011337868481ms of buffer
|
||||
#endif
|
||||
|
@ -151,15 +149,10 @@ static SDL_bool musicStarted = SDL_FALSE;
|
|||
#ifdef HAVE_MIXER
|
||||
static SDL_mutex *Msc_Mutex = NULL;
|
||||
/* FIXME: Make this file instance-specific */
|
||||
#ifdef GP2X
|
||||
#define MIDI_PATH "/mnt/sd/srb2"
|
||||
#define MIDI_PATH2 "/tmp/mnt/sd/srb2"
|
||||
#else
|
||||
#define MIDI_PATH srb2home
|
||||
#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
|
||||
#define MIDI_PATH2 "/tmp"
|
||||
#endif
|
||||
#endif
|
||||
#define MIDI_TMPFILE "srb2music"
|
||||
#define MIDI_TMPFILE2 "srb2wav"
|
||||
static INT32 musicvol = 62;
|
||||
|
@ -174,7 +167,7 @@ static SDL_bool canlooping = SDL_TRUE;
|
|||
|
||||
#if SDL_MIXER_VERSION_ATLEAST(1,2,7)
|
||||
#define USE_RWOPS // ok, USE_RWOPS is in here
|
||||
#if defined (_WIN32_WCE) //|| defined(_WIN32) || defined(GP2X)
|
||||
#if defined (_WIN32_WCE) //|| defined(_WIN32)
|
||||
#undef USE_RWOPS
|
||||
#endif
|
||||
#endif
|
||||
|
@ -1505,13 +1498,11 @@ void I_InitMusic(void)
|
|||
#endif
|
||||
I_OutputMsg("Linked with SDL_mixer version: %d.%d.%d\n",
|
||||
MIXlinked->major, MIXlinked->minor, MIXlinked->patch);
|
||||
#if !defined(GP2X)
|
||||
if (audio.freq < 44100 && !M_CheckParm ("-freq")) //I want atleast 44Khz
|
||||
{
|
||||
audio.samples = (Uint16)(audio.samples*(INT32)(44100/audio.freq));
|
||||
audio.freq = 44100; //Alam: to keep it around the same XX ms
|
||||
}
|
||||
#endif
|
||||
|
||||
if (sound_started
|
||||
#ifdef HW3SOUND
|
||||
|
|
Loading…
Reference in a new issue