diff options
author | David-John Willis | 2011-05-26 14:08:04 +0100 |
---|---|---|
committer | David-John Willis | 2011-06-11 17:07:08 +0100 |
commit | 7878c1ec4933dcedf20ab20e15a671a2209c4838 (patch) | |
tree | 1384eaddb4bab5a5ff8631c360d2afb15d042e19 /backends/platform | |
parent | f759ff17046be2ef2bcc0c068d1ae2cfbed3e520 (diff) | |
download | scummvm-rg350-7878c1ec4933dcedf20ab20e15a671a2209c4838.tar.gz scummvm-rg350-7878c1ec4933dcedf20ab20e15a671a2209c4838.tar.bz2 scummvm-rg350-7878c1ec4933dcedf20ab20e15a671a2209c4838.zip |
GP2X: Remove remnants of the old GP2X backend.
The GP2X is now folded into the GPH backend (as the GP2X device).
Diffstat (limited to 'backends/platform')
-rwxr-xr-x | backends/platform/gp2x/build/clean.sh | 17 | ||||
-rw-r--r-- | backends/platform/gp2x/gp2x-common.h | 49 | ||||
-rw-r--r-- | backends/platform/gp2x/gp2x-hw.cpp | 228 | ||||
-rw-r--r-- | backends/platform/gp2x/gp2x-hw.h | 62 | ||||
-rw-r--r-- | backends/platform/gp2x/gp2x-main.cpp | 50 | ||||
-rw-r--r-- | backends/platform/gp2x/gp2x-mem.cpp | 84 | ||||
-rw-r--r-- | backends/platform/gp2x/gp2x-mem.h | 51 | ||||
-rw-r--r-- | backends/platform/gp2x/gp2x.cpp | 208 | ||||
-rw-r--r-- | backends/platform/gp2x/module.mk | 15 |
9 files changed, 0 insertions, 764 deletions
diff --git a/backends/platform/gp2x/build/clean.sh b/backends/platform/gp2x/build/clean.sh deleted file mode 100755 index 0979f6c7d6..0000000000 --- a/backends/platform/gp2x/build/clean.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -echo Quick script to make building all the time less painful. - -# Set the paths up here to support the build. - -export PATH=/opt/open2x/gcc-4.1.1-glibc-2.3.6/arm-open2x-linux/bin:$PATH -export PATH=/opt/open2x/gcc-4.1.1-glibc-2.3.6/bin:$PATH -export CXX=arm-open2x-linux-g++ -export CC=arm-open2x-linux-gcc -export CXXFLAGS=-march=armv4t -export LDFLAGS=-static - -cd ../../../.. - -echo Cleaning ScummVM for GP2X. -make clean diff --git a/backends/platform/gp2x/gp2x-common.h b/backends/platform/gp2x/gp2x-common.h deleted file mode 100644 index 7efdd7164c..0000000000 --- a/backends/platform/gp2x/gp2x-common.h +++ /dev/null @@ -1,49 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef PLATFORM_SDL_GP2X_H -#define PLATFORM_SDL_GP2X_H - -#include "backends/base-backend.h" -#include "backends/platform/sdl/sdl.h" -#include "backends/platform/sdl/posix/posix.h" -#include "backends/graphics/gp2xsdl/gp2xsdl-graphics.h" -#include "backends/events/gp2xsdl/gp2xsdl-events.h" - -#ifndef PATH_MAX - #define PATH_MAX 255 -#endif - -class OSystem_GP2X : public OSystem_POSIX { -public: - OSystem_GP2X() {} - - void initBackend(); - void quit(); - void addSysArchivesToSearchSet(Common::SearchSet &s, int priority = 0); - void initSDL(); - -protected: - -}; - -#endif diff --git a/backends/platform/gp2x/gp2x-hw.cpp b/backends/platform/gp2x/gp2x-hw.cpp deleted file mode 100644 index 074c668b5f..0000000000 --- a/backends/platform/gp2x/gp2x-hw.cpp +++ /dev/null @@ -1,228 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -/* - * GP2X: Hardware Stuff. - * Thanks to Rlyeh, Snaff, Squidge, Hermes, PS2Reality and RobBrown - * for there help with us all getting to grips with this. - * - */ - -// Disable symbol overrides so that we can use system headers. -#define FORBIDDEN_SYMBOL_ALLOW_ALL - -#include "gp2x-common.h" - -#include "gp2x-hw.h" -#include "gp2x-mem.h" - -// Linux includes to let us goof about with the system in a 'standard' way. -#include <fcntl.h> -#include <pthread.h> -#include <signal.h> -#include <stdlib.h> -#include <stdio.h> -#include <string.h> -#include <sys/mman.h> -#include <sys/ioctl.h> -#include <sys/soundcard.h> -#include <sys/time.h> -#include <unistd.h> - -extern "C" { -static unsigned long gp2x_dev[8]={0,0,0,0,0,0,0,0};//, gp2x_ticks_per_second; -} - -namespace GP2X_HW { - -enum { - VOLUME_NOCHG = 0, - VOLUME_DOWN = 1, - VOLUME_UP = 2, - VOLUME_CHANGE_RATE = 8, - VOLUME_MIN = 0, - VOLUME_INITIAL = 60, - VOLUME_MAX = 100 -}; - -int volumeLevel = VOLUME_INITIAL; - -/* system registers */ -static struct -{ - unsigned short SYSCLKENREG,SYSCSETREG,FPLLVSETREG,DUALINT920,DUALINT940,DUALCTRL940; -} -system_reg; - -static unsigned short dispclockdiv; - -static volatile unsigned short *MEM_REG; - -#define SYS_CLK_FREQ 7372800 - -void deviceInit() { - // Open devices - if (!gp2x_dev[0]) gp2x_dev[0] = open("/dev/mixer", O_RDWR); - if (!gp2x_dev[1]) gp2x_dev[1] = open("/dev/batt", O_RDONLY); - if (!gp2x_dev[2]) gp2x_dev[2] = open("/dev/mem", O_RDWR); -} - -void deviceDeinit() { - // Close devices - { - int i; - for (i=0;i<8;i++) - { - if (gp2x_dev[i]) - { - close(gp2x_dev[i]); - } - } - } - - MEM_REG[0x91c>>1] = system_reg.SYSCSETREG; - MEM_REG[0x910>>1] = system_reg.FPLLVSETREG; - MEM_REG[0x3B40>>1] = system_reg.DUALINT920; - MEM_REG[0x3B42>>1] = system_reg.DUALINT940; - MEM_REG[0x3B48>>1] = system_reg.DUALCTRL940; - MEM_REG[0x904>>1] = system_reg.SYSCLKENREG; - MEM_REG[0x924>>1] = dispclockdiv; - - unpatchMMU(); -} - -void mixerMoveVolume(int direction) { - if (volumeLevel <= 10) { - if (direction == VOLUME_UP) volumeLevel += VOLUME_CHANGE_RATE/2; - if (direction == VOLUME_DOWN) volumeLevel -= VOLUME_CHANGE_RATE/2; - } else { - if(direction == VOLUME_UP) volumeLevel += VOLUME_CHANGE_RATE; - if(direction == VOLUME_DOWN) volumeLevel -= VOLUME_CHANGE_RATE; - } - - if (volumeLevel < VOLUME_MIN) volumeLevel = VOLUME_MIN; - if (volumeLevel > VOLUME_MAX) volumeLevel = VOLUME_MAX; - - unsigned long soundDev = open("/dev/mixer", O_RDWR); - - if(soundDev) { - int vol = ((volumeLevel << 8) | volumeLevel); - ioctl(soundDev, SOUND_MIXER_WRITE_PCM, &vol); - close(soundDev); - } -} - -void setCpuspeed(unsigned int mhz) -{ - set_FCLK(mhz); - set_DCLK_Div(0); - set_920_Div(0); -} - -int getBattLevel() { - int devbatt; - unsigned short currentval=0; - devbatt = open("/dev/batt", O_RDONLY); - read (devbatt, ¤tval, 2); - close (devbatt); - return (currentval); -} - -void set_display_clock_div(unsigned div) -{ - div=((div & 63) | 64)<<8; - MEM_REG[0x924>>1]=(MEM_REG[0x924>>1] & ~(255<<8)) | div; -} - - -void set_FCLK(unsigned MHZ) -{ - unsigned v; - unsigned mdiv,pdiv=3,scale=0; - MHZ*=1000000; - mdiv=(MHZ*pdiv)/SYS_CLK_FREQ; - mdiv=((mdiv-8)<<8) & 0xff00; - pdiv=((pdiv-2)<<2) & 0xfc; - scale&=3; - v=mdiv | pdiv | scale; - MEM_REG[0x910>>1]=v; -} - - -void set_920_Div(unsigned short div) -{ - unsigned short v; - v = MEM_REG[0x91c>>1] & (~0x3); - MEM_REG[0x91c>>1] = (div & 0x7) | v; -} - - -void set_DCLK_Div( unsigned short div ) -{ - unsigned short v; - v = (unsigned short)( MEM_REG[0x91c>>1] & (~(0x7 << 6)) ); - MEM_REG[0x91c>>1] = ((div & 0x7) << 6) | v; -} - - -void Disable_940(void) -{ - MEM_REG[0x3B42>>1]; - MEM_REG[0x3B42>>1]=0; - MEM_REG[0x3B46>>1]=0xffff; - MEM_REG[0x3B48>>1]|= (1 << 7); - MEM_REG[0x904>>1]&=0xfffe; -} - -void gp2x_video_wait_vsync(void) -{ - MEM_REG[0x2846>>1]=(MEM_REG[0x2846>>1] | 0x20) & ~2; - while (!(MEM_REG[0x2846>>1] & 2)); -} - -} /* namespace GP2X_HW */ - -namespace GPH { - -enum { - /* Touchscreen TapMode */ - TAPMODE_LEFT = 0, - TAPMODE_RIGHT = 1, - TAPMODE_HOVER = 2 -}; - -int tapmodeLevel = TAPMODE_LEFT; - -void ToggleTapMode() { - if (tapmodeLevel == TAPMODE_LEFT) { - tapmodeLevel = TAPMODE_RIGHT; - } else if (tapmodeLevel == TAPMODE_RIGHT) { - tapmodeLevel = TAPMODE_HOVER; - } else if (tapmodeLevel == TAPMODE_HOVER) { - tapmodeLevel = TAPMODE_LEFT; - } else { - tapmodeLevel = TAPMODE_LEFT; - } -} - - -} /* namespace GPH */ diff --git a/backends/platform/gp2x/gp2x-hw.h b/backends/platform/gp2x/gp2x-hw.h deleted file mode 100644 index 3c66400124..0000000000 --- a/backends/platform/gp2x/gp2x-hw.h +++ /dev/null @@ -1,62 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -/* - * GP2X: Hardware Stuff. - * - */ - -#ifndef GP2X_HW_H -#define GP2X_HW_H - -namespace GP2X_HW { - -#define GP2X_MAXVOL 100 // Highest level permitted by GP2X's mixer -#define SYS_CLK_FREQ 7372800 // Clock Frequency - -extern int volumeLevel; - -extern void deviceInit(); -extern void deviceDeinit(); -extern void mixerMoveVolume(int); -extern void setCpuspeed(unsigned int cpuspeed); -extern int getBattLevel(); - -extern void save_system_regs(void); /* save some registers */ -extern void set_display_clock_div(unsigned div); -extern void set_FCLK(unsigned MHZ); /* adjust the clock frequency (in Mhz units) */ -extern void set_920_Div(unsigned short div); /* 0 to 7 divider (freq=FCLK/(1+div)) */ -extern void set_DCLK_Div(unsigned short div); /* 0 to 7 divider (freq=FCLK/(1+div)) */ -extern void Disable_940(void); /* 940t down */ -extern void gp2x_video_wait_vsync(void); - -} /* namespace GP2X_HW */ - -namespace GPH { - -extern int tapmodeLevel; - -extern void ToggleTapMode(); - -} /* namespace GPH */ - -#endif //GP2X_HW_H diff --git a/backends/platform/gp2x/gp2x-main.cpp b/backends/platform/gp2x/gp2x-main.cpp deleted file mode 100644 index f1ee5ed5f3..0000000000 --- a/backends/platform/gp2x/gp2x-main.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "backends/platform/gp2x/gp2x-common.h" -#include "backends/plugins/sdl/sdl-provider.h" -#include "base/main.h" - -#if defined(GP2X) -int main(int argc, char *argv[]) { - - // Create our OSystem instance - g_system = new OSystem_GP2X(); - assert(g_system); - - // Pre initialize the backend - ((OSystem_GP2X *)g_system)->init(); - -#ifdef DYNAMIC_MODULES - PluginManager::instance().addPluginProvider(new SDLPluginProvider()); -#endif - - // Invoke the actual ScummVM main entry point: - int res = scummvm_main(argc, argv); - - // Free OSystem - delete (OSystem_GP2X *)g_system; - - return res; -} - -#endif diff --git a/backends/platform/gp2x/gp2x-mem.cpp b/backends/platform/gp2x/gp2x-mem.cpp deleted file mode 100644 index 8d22bf8130..0000000000 --- a/backends/platform/gp2x/gp2x-mem.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -/* - * GP2X: Memory tweaking stuff. - * - */ - -// Disable symbol overrides so that we can use system headers. -#define FORBIDDEN_SYMBOL_ALLOW_ALL - -#include <stdio.h> -#include <signal.h> -#include <setjmp.h> -#include <stdlib.h> -#include <fcntl.h> -#include <sys/mman.h> -#include <unistd.h> -#include <string.h> - -#include "backends/platform/gp2x/gp2x-mem.h" - -extern "C" { -static volatile unsigned short *gp2x_memregs; -} - -void SetClock (unsigned c) { - unsigned v; - unsigned mdiv,pdiv=3,scale=0; - - // Set ARM920t clock - c *= 1000000; - mdiv = (c*pdiv) / SYS_CLK_FREQ; - mdiv = ((mdiv-8)<<8) & 0xff00; - pdiv = ((pdiv-2)<<2) & 0xfc; - scale &= 3; - v = mdiv | pdiv | scale; - gp2x_memregs[0x910>>1] = v; -} - -void patchMMU (void) { - //volatile unsigned int *secbuf = (unsigned int *)malloc (204800); - - printf ("Reconfiguring cached memory regions...\n"); - - //hackpgtable(); - //printf ("Sucess...\n"); - - system("/sbin/rmmod mmuhack"); - system("/sbin/insmod -f mmuhack.o"); - - int mmufd = open("/dev/mmuhack", O_RDWR); - - if(mmufd < 0) { - printf ("Upper memory uncached (attempt failed, access to upper memory will be slower)...\n"); - } else { - printf ("Upper memory cached...\n"); - close(mmufd); - } -} - -void unpatchMMU (void) { - printf ("Restoreing cached memory regions...\n"); - system("/sbin/rmmod mmuhack"); -} diff --git a/backends/platform/gp2x/gp2x-mem.h b/backends/platform/gp2x/gp2x-mem.h deleted file mode 100644 index b2cd00a587..0000000000 --- a/backends/platform/gp2x/gp2x-mem.h +++ /dev/null @@ -1,51 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -/* - * GP2X: Memory Stuff. - * - */ - -#ifndef GP2X_MEM_H -#define GP2X_MEM_H - -#ifdef __cplusplus -extern "C" { -#endif - -// Use Squidge's MMU patch rather then myown (his is neater). -// The effect if not that great but cacheing the upper RAM is no bad thing (tm) ;). - -//extern void InitRam (void); -//extern void CloseRam (void); -// Set ARM920t clock frequency -extern void SetClock (unsigned c); -extern void patchMMU (void); -extern void unpatchMMU (void); - -#define SYS_CLK_FREQ 7372800 - -#ifdef __cplusplus - } -#endif - -#endif //GP2X_MEM_H diff --git a/backends/platform/gp2x/gp2x.cpp b/backends/platform/gp2x/gp2x.cpp deleted file mode 100644 index 0e28a6b738..0000000000 --- a/backends/platform/gp2x/gp2x.cpp +++ /dev/null @@ -1,208 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -/* - * GP2X: Main backend. - * - */ - -// Disable symbol overrides so that we can use system headers. -#define FORBIDDEN_SYMBOL_ALLOW_ALL - -#include "backends/platform/sdl/sdl-sys.h" -#include "backends/platform/gp2x/gp2x-common.h" -#include "backends/platform/gp2x/gp2x-hw.h" -#include "backends/platform/gp2x/gp2x-mem.h" - -#include "backends/saves/default/default-saves.h" - -#include "common/config-manager.h" -#include "common/debug.h" - -// Disable for normal serial logging. -#define DUMP_STDOUT - -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <limits.h> -#include <errno.h> -#include <sys/stat.h> - -void OSystem_GP2X::initBackend() { - // Setup default save path to be workingdir/saves - char savePath[PATH_MAX + 1]; - char workDirName[PATH_MAX + 1]; - - if (getcwd(workDirName, PATH_MAX) == NULL) { - error("Could not obtain current working directory"); - } else { - printf("Current working directory: %s\n", workDirName); - } - - strcpy(savePath, workDirName); - strcat(savePath, "/saves"); - printf("Current save directory: %s\n", savePath); - struct stat sb; - if (stat(savePath, &sb) == -1) - if (errno == ENOENT) // Create the dir if it does not exist - if (mkdir(savePath, 0755) != 0) - warning("mkdir for '%s' failed", savePath); - - ConfMan.registerDefault("savepath", savePath); - - #ifdef DUMP_STDOUT - // The GP2X has a serial console but most users do not use this so we - // output all our STDOUT and STDERR to files for debug purposes. - char STDOUT_FILE[PATH_MAX + 1]; - char STDERR_FILE[PATH_MAX + 1]; - - strcpy(STDOUT_FILE, workDirName); - strcpy(STDERR_FILE, workDirName); - strcat(STDOUT_FILE, "/scummvm.stdout.txt"); - strcat(STDERR_FILE, "/scummvm.stderr.txt"); - - /* Flush the output in case anything is queued */ - fclose(stdout); - fclose(stderr); - - /* Redirect standard input and standard output */ - FILE *newfp = freopen(STDOUT_FILE, "w", stdout); - if (newfp == NULL) { - #if !defined(stdout) - stdout = fopen(STDOUT_FILE, "w"); - #else - newfp = fopen(STDOUT_FILE, "w"); - if (newfp) { - *stdout = *newfp; - } - #endif - } - - newfp = freopen(STDERR_FILE, "w", stderr); - if (newfp == NULL) { - #if !defined(stderr) - stderr = fopen(STDERR_FILE, "w"); - #else - newfp = fopen(STDERR_FILE, "w"); - if (newfp) { - *stderr = *newfp; - } - #endif - } - - setbuf(stderr, NULL); - printf("%s\n", "Debug: STDOUT and STDERR redirected to text files."); - #endif /* DUMP_STDOUT */ - - // Setup other defaults. - ConfMan.registerDefault("aspect_ratio", true); - - /* Up default volume values as we use a seperate system level volume anyway. */ - ConfMan.registerDefault("music_volume", 192); - ConfMan.registerDefault("sfx_volume", 192); - ConfMan.registerDefault("speech_volume", 192); - ConfMan.registerDefault("autosave_period", 3 * 60); // Trigger autosave every 3 minutes - On low batts 4 mins is about your warning time. - - ConfMan.setBool("FM_low_quality", true); - - /* Initialize any GP2X specific stuff we may want (Batt Status, scaler etc.) */ - GP2X_HW::deviceInit(); - - /* Set Default hardware mixer volume to a preset level (VOLUME_INITIAL). This is done to 'reset' volume level if set by other apps. */ - GP2X_HW::mixerMoveVolume(0); - - // Create the events manager - if (_eventSource == 0) - _eventSource = new GP2XSdlEventSource(); - - // Create the graphics manager - if (_graphicsManager == 0) - _graphicsManager = new GP2XSdlGraphicsManager(_eventSource); - - /* Pass to POSIX method to do the heavy lifting */ - OSystem_POSIX::initBackend(); -} - -void OSystem_GP2X::initSDL() { - // Check if SDL has not been initialized - if (!_initedSDL) { - uint32 sdlFlags = SDL_INIT_EVENTTHREAD; - if (ConfMan.hasKey("disable_sdl_parachute")) - sdlFlags |= SDL_INIT_NOPARACHUTE; - - // Initialize SDL (SDL Subsystems are initiliazed in the corresponding sdl managers) - if (SDL_Init(sdlFlags) == -1) - error("Could not initialize SDL: %s", SDL_GetError()); - - // Enable unicode support if possible - SDL_EnableUNICODE(1); - - _initedSDL = true; - } -} - -void OSystem_GP2X::addSysArchivesToSearchSet(Common::SearchSet &s, int priority) { - /* Setup default extra data paths for engine data files and plugins */ - char workDirName[PATH_MAX + 1]; - - if (getcwd(workDirName, PATH_MAX) == NULL) { - error("Error: Could not obtain current working directory"); - } - - Common::FSNode workdirNode(workDirName); - if (workdirNode.exists() && workdirNode.isDirectory()) { - s.add("__GP2X_WORKDIR__", new Common::FSDirectory(workDirName), priority); - } - - char enginedataPath[PATH_MAX+1]; - - strcpy(enginedataPath, workDirName); - strcat(enginedataPath, "/engine-data"); - - Common::FSNode engineNode(enginedataPath); - if (engineNode.exists() && engineNode.isDirectory()) { - s.add("__GP2X_ENGDATA__", new Common::FSDirectory(enginedataPath), priority); - } - - char pluginsPath[PATH_MAX+1]; - - strcpy(pluginsPath, workDirName); - strcat(pluginsPath, "/plugins"); - - Common::FSNode pluginsNode(pluginsPath); - if (pluginsNode.exists() && pluginsNode.isDirectory()) { - s.add("__GP2X_PLUGINS__", new Common::FSDirectory(pluginsPath), priority); - } -} - -void OSystem_GP2X::quit() { - GP2X_HW::deviceDeinit(); - - #ifdef DUMP_STDOUT - printf("%s\n", "Debug: STDOUT and STDERR text files closed."); - fclose(stdout); - fclose(stderr); - #endif /* DUMP_STDOUT */ - - OSystem_POSIX::quit(); -} diff --git a/backends/platform/gp2x/module.mk b/backends/platform/gp2x/module.mk deleted file mode 100644 index 4846f162cb..0000000000 --- a/backends/platform/gp2x/module.mk +++ /dev/null @@ -1,15 +0,0 @@ -MODULE := backends/platform/gp2x - -MODULE_OBJS := \ - gp2x-hw.o \ - gp2x-main.o \ - gp2x-mem.o \ - gp2x.o - -# We don't use rules.mk but rather manually update OBJS and MODULE_DIRS. -MODULE_OBJS := $(addprefix $(MODULE)/, $(MODULE_OBJS)) -OBJS := $(MODULE_OBJS) $(OBJS) -MODULE_DIRS += $(sort $(dir $(MODULE_OBJS))) - -# Hack to ensure the SDL backend is built so we can use OSystem_SDL. --include $(srcdir)/backends/platform/sdl/module.mk |