From 70b504ea5a3f1a4903a412dbf06e914ac0807bc1 Mon Sep 17 00:00:00 2001 From: Alex Ferguson Date: Wed, 3 Nov 2010 18:31:43 +0200 Subject: stppc2x: Added recipe for stppc2x, a port of puzzles to SDL. * Added dirs-fix.patch, which changes the default directories for the game data to a systemwide /usr/share/games/stppc2x setting and changes the default font to DejaVuSans-Condensed. * Added enable-fullscreen.patch, which, um, makes the game fullscreen. * Added generic-keys.patch, which changes the game keys to more generic ones (for devices with QWERTY keyboards) and changes the default control system from mouse-emulation to keyboard controlled. * Added a modified Makefile, compatible to how OE handles CFLAGS and LDFLAGS by moving additional defines to INCS and LIBS, respectively. * Added no-music.patch, which disables music. Remember to add libsdl-mixer to DEPENDS if you decide not to apply this. * Added no-upper-mem.patch, which disables the OPTION_USE_UPPER_MEMORY hack, which makes stppc2x segfault on the Ben Nanonote and is useless outside of the GP2X. * Added stppc2x-extras.tar.gz, which contains modified versions of the stppc2x splash screen and help messages (respective to the generic-keys patch above). * Added stppc2x.desktop and accompanying stppc2x.png files. Signed-off-by: Alex Ferguson Signed-off-by: Kristoffer Ericson --- recipes/puzzles/stppc2x/Makefile | 232 ++++++++++++++++++++++++ recipes/puzzles/stppc2x/dir-fix.patch | 72 ++++++++ recipes/puzzles/stppc2x/enable-fullscreen.patch | 12 ++ recipes/puzzles/stppc2x/generic-keys.patch | 193 ++++++++++++++++++++ recipes/puzzles/stppc2x/no-music.patch | 12 ++ recipes/puzzles/stppc2x/no-upper-mem.patch | 12 ++ recipes/puzzles/stppc2x/stppc2x-extras.tar.gz | Bin 0 -> 78717 bytes recipes/puzzles/stppc2x/stppc2x.desktop | 8 + recipes/puzzles/stppc2x/stppc2x.png | Bin 0 -> 2168 bytes recipes/puzzles/stppc2x_svn.bb | 37 ++++ 10 files changed, 578 insertions(+) create mode 100644 recipes/puzzles/stppc2x/Makefile create mode 100644 recipes/puzzles/stppc2x/dir-fix.patch create mode 100644 recipes/puzzles/stppc2x/enable-fullscreen.patch create mode 100644 recipes/puzzles/stppc2x/generic-keys.patch create mode 100644 recipes/puzzles/stppc2x/no-music.patch create mode 100644 recipes/puzzles/stppc2x/no-upper-mem.patch create mode 100644 recipes/puzzles/stppc2x/stppc2x-extras.tar.gz create mode 100644 recipes/puzzles/stppc2x/stppc2x.desktop create mode 100644 recipes/puzzles/stppc2x/stppc2x.png create mode 100644 recipes/puzzles/stppc2x_svn.bb diff --git a/recipes/puzzles/stppc2x/Makefile b/recipes/puzzles/stppc2x/Makefile new file mode 100644 index 0000000000..881df78072 --- /dev/null +++ b/recipes/puzzles/stppc2x/Makefile @@ -0,0 +1,232 @@ +PROGRAM_NAME = stppc2x + +COMBINED = -DCOMBINED +# -DSTYLUS_BASED + +OBJ_SUFFIX = .o + +INCS = $(COMBINED) -Wall -Werror -Wno-char-subscripts +LIBS = -L. -lSDL -lSDL_gfx -lSDL_ttf -lSDL_image -ljpeg -lpng -lz -lpthread $(COMBINED) +# -lSDL_mixer + +.PHONY : clean +.PHONY : all + +all: + $(MAKE) executables + +executables: blackbox$(OBJ_SUFFIX) bridges$(OBJ_SUFFIX) combi$(OBJ_SUFFIX) cube$(OBJ_SUFFIX) dictionary$(OBJ_SUFFIX) divvy$(OBJ_SUFFIX) \ + dominosa$(OBJ_SUFFIX) drawing$(OBJ_SUFFIX) dsf$(OBJ_SUFFIX) fastevents$(OBJ_SUFFIX) fifteen$(OBJ_SUFFIX) filling$(OBJ_SUFFIX) \ + flip$(OBJ_SUFFIX) galaxies$(OBJ_SUFFIX) grid$(OBJ_SUFFIX) guess$(OBJ_SUFFIX) inertia$(OBJ_SUFFIX) iniparser$(OBJ_SUFFIX) \ + keen$(OBJ_SUFFIX) latin$(OBJ_SUFFIX) laydomino$(OBJ_SUFFIX) lightup$(OBJ_SUFFIX) list$(OBJ_SUFFIX) loopy$(OBJ_SUFFIX) magnets$(OBJ_SUFFIX) map$(OBJ_SUFFIX) \ + maxflow$(OBJ_SUFFIX) maze3d$(OBJ_SUFFIX) maze3dc$(OBJ_SUFFIX) midend$(OBJ_SUFFIX) mines$(OBJ_SUFFIX) misc$(OBJ_SUFFIX) \ + mosco$(OBJ_SUFFIX) net$(OBJ_SUFFIX) netslide$(OBJ_SUFFIX) pattern$(OBJ_SUFFIX) pegs$(OBJ_SUFFIX) random$(OBJ_SUFFIX) range$(OBJ_SUFFIX) rect$(OBJ_SUFFIX) \ + samegame$(OBJ_SUFFIX) sdl$(OBJ_SUFFIX) signpost$(OBJ_SUFFIX) singles$(OBJ_SUFFIX) sixteen$(OBJ_SUFFIX) slant$(OBJ_SUFFIX) slide$(OBJ_SUFFIX) smalloc$(OBJ_SUFFIX) \ + sokoban$(OBJ_SUFFIX) solo$(OBJ_SUFFIX) tents$(OBJ_SUFFIX) towers$(OBJ_SUFFIX) tree234$(OBJ_SUFFIX) twiddle$(OBJ_SUFFIX) unequal$(OBJ_SUFFIX) \ + untangle$(OBJ_SUFFIX) version$(OBJ_SUFFIX) + $(CC) -o $(PROGRAM_NAME) blackbox$(OBJ_SUFFIX) bridges$(OBJ_SUFFIX) combi$(OBJ_SUFFIX) cube$(OBJ_SUFFIX) dictionary$(OBJ_SUFFIX) \ + divvy$(OBJ_SUFFIX) dominosa$(OBJ_SUFFIX) drawing$(OBJ_SUFFIX) dsf$(OBJ_SUFFIX) fastevents$(OBJ_SUFFIX) fifteen$(OBJ_SUFFIX) \ + filling$(OBJ_SUFFIX) flip$(OBJ_SUFFIX) galaxies$(OBJ_SUFFIX) grid$(OBJ_SUFFIX) guess$(OBJ_SUFFIX) inertia$(OBJ_SUFFIX) \ + iniparser$(OBJ_SUFFIX) keen$(OBJ_SUFFIX) latin$(OBJ_SUFFIX) laydomino$(OBJ_SUFFIX) lightup$(OBJ_SUFFIX) list$(OBJ_SUFFIX) loopy$(OBJ_SUFFIX) magnets$(OBJ_SUFFIX) map$(OBJ_SUFFIX) \ + maxflow$(OBJ_SUFFIX) maze3d$(OBJ_SUFFIX) maze3dc$(OBJ_SUFFIX) midend$(OBJ_SUFFIX) mines$(OBJ_SUFFIX) misc$(OBJ_SUFFIX) mosco$(OBJ_SUFFIX) \ + net$(OBJ_SUFFIX) netslide$(OBJ_SUFFIX) pattern$(OBJ_SUFFIX) pegs$(OBJ_SUFFIX) random$(OBJ_SUFFIX) range$(OBJ_SUFFIX) rect$(OBJ_SUFFIX) samegame$(OBJ_SUFFIX) \ + sdl$(OBJ_SUFFIX) signpost$(OBJ_SUFFIX) singles$(OBJ_SUFFIX) sixteen$(OBJ_SUFFIX) slant$(OBJ_SUFFIX) slide$(OBJ_SUFFIX) smalloc$(OBJ_SUFFIX) sokoban$(OBJ_SUFFIX) \ + solo$(OBJ_SUFFIX) tents$(OBJ_SUFFIX) towers$(OBJ_SUFFIX) tree234$(OBJ_SUFFIX) twiddle$(OBJ_SUFFIX) unequal$(OBJ_SUFFIX) untangle$(OBJ_SUFFIX) \ + version$(OBJ_SUFFIX) $(LDFLAGS) $(LIBS) + +blackbox$(OBJ_SUFFIX): ./blackbox.c ./puzzles.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +bridges$(OBJ_SUFFIX): ./bridges.c ./puzzles.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +combi$(OBJ_SUFFIX): ./combi.c ./puzzles.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +cube$(OBJ_SUFFIX): ./cube.c ./puzzles.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +dictionary$(OBJ_SUFFIX): ./dictionary.c ./dictionary.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +divvy$(OBJ_SUFFIX): ./divvy.c ./puzzles.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +dominosa$(OBJ_SUFFIX): ./dominosa.c ./puzzles.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +drawing$(OBJ_SUFFIX): ./drawing.c ./puzzles.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +dsf$(OBJ_SUFFIX): ./dsf.c ./puzzles.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +fastevents$(OBJ_SUFFIX): ./fastevents.c ./fastevents.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +fifteen$(OBJ_SUFFIX): ./fifteen.c ./puzzles.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +filling$(OBJ_SUFFIX): ./filling.c ./puzzles.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +flip$(OBJ_SUFFIX): ./flip.c ./puzzles.h ./tree234.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +galaxies$(OBJ_SUFFIX): ./galaxies.c ./puzzles.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +grid$(OBJ_SUFFIX): ./grid.c ./puzzles.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +guess$(OBJ_SUFFIX): ./guess.c ./puzzles.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +inertia$(OBJ_SUFFIX): ./inertia.c ./puzzles.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +iniparser$(OBJ_SUFFIX): ./iniparser.c ./iniparser.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +keen$(OBJ_SUFFIX): ./keen.c ./puzzles.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +latin$(OBJ_SUFFIX): ./latin.c ./puzzles.h ./tree234.h ./maxflow.h ./latin.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +laydomino$(OBJ_SUFFIX): ./laydomino.c + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +lightup$(OBJ_SUFFIX): ./lightup.c ./puzzles.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +list$(OBJ_SUFFIX): ./list.c ./puzzles.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +loopy$(OBJ_SUFFIX): ./loopy.c ./grid.h ./puzzles.h ./tree234.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +magnets$(OBJ_SUFFIX): ./magnets.c ./puzzles.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +map$(OBJ_SUFFIX): ./map.c ./puzzles.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +maxflow$(OBJ_SUFFIX): ./maxflow.c ./maxflow.h ./puzzles.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +maze3d$(OBJ_SUFFIX): maze3d.c ./puzzles.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +maze3dc$(OBJ_SUFFIX): maze3dc.c ./puzzles.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +midend$(OBJ_SUFFIX): ./midend.c ./puzzles.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +mines$(OBJ_SUFFIX): ./mines.c ./tree234.h ./puzzles.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +misc$(OBJ_SUFFIX): ./misc.c ./puzzles.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +mosco$(OBJ_SUFFIX): ./mosco.c ./puzzles.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +net$(OBJ_SUFFIX): ./net.c ./puzzles.h ./tree234.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +netslide$(OBJ_SUFFIX): ./netslide.c ./puzzles.h ./tree234.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +pattern$(OBJ_SUFFIX): ./pattern.c ./puzzles.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +pegs$(OBJ_SUFFIX): ./pegs.c ./puzzles.h ./tree234.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +random$(OBJ_SUFFIX): ./random.c ./puzzles.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +rect$(OBJ_SUFFIX): ./rect.c ./puzzles.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +range$(OBJ_SUFFIX): ./range.c ./puzzles.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +samegame$(OBJ_SUFFIX): ./samegame.c ./puzzles.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +sdl$(OBJ_SUFFIX): ./sdl.c ./puzzles.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +signpost$(OBJ_SUFFIX): ./signpost.c ./puzzles.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +singles$(OBJ_SUFFIX): ./singles.c ./puzzles.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +sixteen$(OBJ_SUFFIX): ./sixteen.c ./puzzles.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +slant$(OBJ_SUFFIX): ./slant.c ./puzzles.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +slide$(OBJ_SUFFIX): ./slide.c ./puzzles.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +smalloc$(OBJ_SUFFIX): ./smalloc.c ./puzzles.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +sokoban$(OBJ_SUFFIX): ./sokoban.c ./puzzles.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +solo$(OBJ_SUFFIX): ./solo.c ./puzzles.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +tents$(OBJ_SUFFIX): ./tents.c ./puzzles.h ./maxflow.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +towers$(OBJ_SUFFIX): ./towers.c ./puzzles.h ./tree234.h ./maxflow.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +tree234$(OBJ_SUFFIX): ./tree234.c ./tree234.h ./puzzles.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +twiddle$(OBJ_SUFFIX): ./twiddle.c ./puzzles.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +unequal$(OBJ_SUFFIX): ./unequal.c ./puzzles.h ./latin.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +untangle$(OBJ_SUFFIX): ./untangle.c ./puzzles.h ./tree234.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +version$(OBJ_SUFFIX): ./version.c ./version.def + $(CC) $(CFLAGS) `cat version.def` -c version.c -o $@ + +windows$(OBJ_SUFFIX): ./windows.c ./puzzles.h ./resource.h + $(CC) $(CFLAGS) $(INCS) -c $< -o $@ + +install: + install -d $(DESTDIR)/usr/bin + install -d $(DESTDIR)/usr/share/pixmaps + install -d $(DESTDIR)/usr/share/applications + install -d $(DESTDIR)/usr/share/games/stppc2x/help + install -d $(DESTDIR)/usr/share/games/stppc2x/images + install -d $(DESTDIR)/usr/share/games/stppc2x/licenses + install -d $(DESTDIR)/usr/share/games/stppc2x/screenshots + + install -m 0755 stppc2x $(DESTDIR)/usr/bin + install -m 0644 *.sav $(DESTDIR)/usr/share/games/stppc2x + install -m 0644 credits.txt $(DESTDIR)/usr/share/games/stppc2x + install -m 0644 stppc2x.data $(DESTDIR)/usr/share/games/stppc2x + install -m 0644 help/*.txt $(DESTDIR)/usr/share/games/stppc2x/help + install -m 0644 images/*.png $(DESTDIR)/usr/share/games/stppc2x/images + install -m 0644 images/stppc2x.gif $(DESTDIR)/usr/share/games/stppc2x/images + install -m 0644 licences/* $(DESTDIR)/usr/share/games/stppc2x/licenses + install -m 0644 screenshots/* $(DESTDIR)/usr/share/games/stppc2x/screenshots + +clean: + rm *.o + rm stppc2x diff --git a/recipes/puzzles/stppc2x/dir-fix.patch b/recipes/puzzles/stppc2x/dir-fix.patch new file mode 100644 index 0000000000..ab69a1cfdf --- /dev/null +++ b/recipes/puzzles/stppc2x/dir-fix.patch @@ -0,0 +1,72 @@ +diff -ru stppc2x-read-only.orig/sdl.c stppc2x-read-only/sdl.c +--- stppc2x-read-only.orig/sdl.c 2010-10-12 23:52:57.437389988 +0300 ++++ stppc2x-read-only/sdl.c 2010-10-12 23:52:22.024060570 +0300 +@@ -193,52 +193,52 @@ + #define MAX_MOUSE_ACCELERATION (30) + + // Filename of a Truetype, Unicode-capable, monospaced font +-#define FIXED_FONT_FILENAME "fonts/DejaVuSansMono-Bold.ttf" ++#define FIXED_FONT_FILENAME "/usr/share/fonts/truetype/DejaVuSansCondensed-Bold.ttf" + + // Filename of a Truetype, Unicode-capable, variable-spaced font +-#define VARIABLE_FONT_FILENAME "fonts/DejaVuSansCondensed-Bold.ttf" ++#define VARIABLE_FONT_FILENAME "/usr/share/fonts/truetype/DejaVuSansCondensed-Bold.ttf" + + // Filename of a bitmap for the inital loading screen +-#define LOADING_SCREEN_FILENAME "images/loading.png" ++#define LOADING_SCREEN_FILENAME "/usr/share/games/stppc2x/images/loading.png" + + // Filename of a bitmap for the menu background image +-#define MENU_BACKGROUND_IMAGE "images/background.png" ++#define MENU_BACKGROUND_IMAGE "/usr/share/games/stppc2x/images/background.png" + + // Filename of a bitmap for the music credits image +-#define MENU_MUSIC_CREDITS_IMAGE "images/music.png" ++#define MENU_MUSIC_CREDITS_IMAGE "/usr/share/games/stppc2x/images/music.png" + + // Filename of a bitmap for the additional credits image +-#define MENU_ADDITIONAL_CREDITS_IMAGE "images/elisa.png" ++#define MENU_ADDITIONAL_CREDITS_IMAGE "/usr/share/games/stppc2x/images/elisa.png" + + // Filename of a bitmap for the menu "about" dialog +-#define MENU_ABOUT_IMAGE "images/about.png" ++#define MENU_ABOUT_IMAGE "/usr/share/games/stppc2x/images/about.png" + + // Filespec of bitmaps for the game previews +-#define MENU_PREVIEW_IMAGES "images/%s.png" ++#define MENU_PREVIEW_IMAGES "/usr/share/games/stppc2x/images/%s.png" + + // Filespec of helpfiles +-#define MENU_HELPFILES "help/%s.txt" ++#define MENU_HELPFILES "/usr/share/games/stppc2x/help/%s.txt" + + // Filespec of helpfiles +-#define MENU_KEY_HELPFILE "help/keys.txt" ++#define MENU_KEY_HELPFILE "/usr/share/games/stppc2x/help/keys.txt" + + // Filespec of helpfiles +-#define MENU_INGAME_KEY_HELPFILE "help/ingamekeys.txt" ++#define MENU_INGAME_KEY_HELPFILE "/usr/share/games/stppc2x/help/ingamekeys.txt" + + // Filename of the menu "game description" data +-#define MENU_DATA_FILENAME "stppc2x.data" ++#define MENU_DATA_FILENAME "/usr/share/games/stppc2x/stppc2x.data" + + // Filename of the global configuration INI file +-#define GLOBAL_CONFIG_FILENAME "stppc2x.ini" ++#define GLOBAL_CONFIG_FILENAME "/usr/share/games/stppc2x/stppc2x.ini" + + // Filename of the credits file. +-#define MENU_CREDITS_FILENAME "credits.txt" ++#define MENU_CREDITS_FILENAME "/usr/share/games/stppc2x/credits.txt" + + // Filespec of a saved screenshot +-#define SCREENSHOT_FILENAME "screenshots/screenshot%04u.bmp" ++#define SCREENSHOT_FILENAME "/usr/share/games/stppc2x/screenshots/screenshot%04u.bmp" + + // Path for music files +-#define MUSIC_PATH "music/" ++#define MUSIC_PATH "/usr/share/games/stppc2x/music/" + + // The longest internal name of any game to crop all filenames + // etc. to. Longest name is "Black Box" or "Rectangles" at the diff --git a/recipes/puzzles/stppc2x/enable-fullscreen.patch b/recipes/puzzles/stppc2x/enable-fullscreen.patch new file mode 100644 index 0000000000..c9756f30dc --- /dev/null +++ b/recipes/puzzles/stppc2x/enable-fullscreen.patch @@ -0,0 +1,12 @@ +diff -ru trunk.orig/sdl.c trunk/sdl.c +--- trunk.orig/sdl.c 2010-10-19 00:27:38.799005417 +0300 ++++ trunk/sdl.c 2010-10-19 00:33:52.958999818 +0300 +@@ -42,7 +42,7 @@ + // ============================== + + // Software - works perfectly, if a little slowly +-#define SDL_SURFACE_FLAGS SDL_SWSURFACE ++#define SDL_SURFACE_FLAGS (SDL_SWSURFACE | SDL_FULLSCREEN) + + // Hardware - flickers but works + // #define SDL_SURFACE_FLAGS SDL_HWSURFACE diff --git a/recipes/puzzles/stppc2x/generic-keys.patch b/recipes/puzzles/stppc2x/generic-keys.patch new file mode 100644 index 0000000000..ece3c581b9 --- /dev/null +++ b/recipes/puzzles/stppc2x/generic-keys.patch @@ -0,0 +1,193 @@ +diff -ru stppc2x-read-only.orig/sdl.c stppc2x-read-only/sdl.c +--- stppc2x-read-only.orig/sdl.c 2010-10-12 23:33:27.107507323 +0300 ++++ stppc2x-read-only/sdl.c 2010-10-12 23:39:15.560805458 +0300 +@@ -85,7 +85,6 @@ + // SDL library includes + // ==================== + #include +-#include + #include + #include + #include +@@ -3262,43 +3261,43 @@ + case SDL_KEYDOWN: + switch(event.key.keysym.sym) + { +- case SDLK_z: ++ case SDLK_BACKSPACE: + // Simulate pressing the Select key + emulate_event(SDL_JOYBUTTONDOWN, 0, 0, GP2X_BUTTON_SELECT); + break; + +- case SDLK_y: ++ case SDLK_w: + // Simulate pressing the Y key + emulate_event(SDL_JOYBUTTONDOWN, 0, 0, GP2X_BUTTON_Y); + break; + +- case SDLK_u: ++ case SDLK_F4: + // Simulate pressing the Vol- key + emulate_event(SDL_JOYBUTTONDOWN, 0, 0, GP2X_BUTTON_VOLDOWN); + break; + +- case SDLK_i: ++ case SDLK_F5: + // Simulate pressing the Vol+ key + emulate_event(SDL_JOYBUTTONDOWN, 0, 0, GP2X_BUTTON_VOLUP); + break; + +- case SDLK_p: ++ case SDLK_RETURN: + // Simulate pressing the Start key + emulate_event(SDL_JOYBUTTONDOWN, 0, 0, GP2X_BUTTON_START); + break; + +- case SDLK_q: ++ case SDLK_F8: + clear_statusbar(fe); + sdl_status_bar(fe,"Quitting..."); + cleanup_and_exit(fe, EXIT_SUCCESS); + break; + +- case SDLK_e: ++ case SDLK_z: + // Simulate pressing stick-click + emulate_event(SDL_JOYBUTTONDOWN, 0, 0, GP2X_BUTTON_CLICK); + break; + +- case SDLK_s: ++ case SDLK_F6: + // Simulate pressing the Vol+ and Vol- keys + emulate_event(SDL_JOYBUTTONDOWN, 0, 0, GP2X_BUTTON_VOLUP); + emulate_event(SDL_JOYBUTTONDOWN, 0, 0, GP2X_BUTTON_VOLDOWN); +@@ -3306,7 +3305,7 @@ + emulate_event(SDL_JOYBUTTONUP, 0, 0, GP2X_BUTTON_VOLDOWN); + break; + +- case SDLK_l: ++ case SDLK_q: + // Simulate pressing the L key + emulate_event(SDL_JOYBUTTONDOWN, 0, 0, GP2X_BUTTON_L); + break; +@@ -3316,17 +3315,17 @@ + emulate_event(SDL_JOYBUTTONDOWN, 0, 0, GP2X_BUTTON_A); + break; + +- case SDLK_b: ++ case SDLK_s: + // Simulate pressing the B key + emulate_event(SDL_JOYBUTTONDOWN, 0, 0, GP2X_BUTTON_B); + break; + +- case SDLK_x: ++ case SDLK_d: + // Simulate pressing the X key + emulate_event(SDL_JOYBUTTONDOWN, 0, 0, GP2X_BUTTON_X); + break; + +- case SDLK_r: ++ case SDLK_p: + // Simulate pressing the R key + emulate_event(SDL_JOYBUTTONDOWN, 0, 0, GP2X_BUTTON_R); + break; +@@ -3359,26 +3358,26 @@ + case SDL_KEYUP: + switch(event.key.keysym.sym) + { +- case SDLK_z: ++ case SDLK_BACKSPACE: + // Simulate pressing the Select key + emulate_event(SDL_JOYBUTTONUP, 0, 0, GP2X_BUTTON_SELECT); + break; + +- case SDLK_p: ++ case SDLK_RETURN: + emulate_event(SDL_JOYBUTTONUP, 0, 0, GP2X_BUTTON_START); + break; + +- case SDLK_u: ++ case SDLK_F4: + // Simulate releasing the Vol- key + emulate_event(SDL_JOYBUTTONUP, 0, 0, GP2X_BUTTON_VOLDOWN); + break; + +- case SDLK_i: ++ case SDLK_F5: + // Simulate releasing the Vol+ key + emulate_event(SDL_JOYBUTTONUP, 0, 0, GP2X_BUTTON_VOLUP); + break; + +- case SDLK_l: ++ case SDLK_q: + emulate_event(SDL_JOYBUTTONUP, 0, 0, GP2X_BUTTON_L); + break; + +@@ -3386,19 +3385,19 @@ + emulate_event(SDL_JOYBUTTONUP, 0, 0, GP2X_BUTTON_A); + break; + +- case SDLK_b: ++ case SDLK_s: + emulate_event(SDL_JOYBUTTONUP, 0, 0, GP2X_BUTTON_B); + break; + +- case SDLK_y: ++ case SDLK_w: + emulate_event(SDL_JOYBUTTONUP, 0, 0, GP2X_BUTTON_Y); + break; + +- case SDLK_x: ++ case SDLK_d: + emulate_event(SDL_JOYBUTTONUP, 0, 0, GP2X_BUTTON_X); + break; + +- case SDLK_r: ++ case SDLK_p: + emulate_event(SDL_JOYBUTTONUP, 0, 0, GP2X_BUTTON_R); + break; + +diff -ru trunk.orig/sdl.c trunk/sdl.c +--- trunk.orig/sdl.c 2010-10-13 18:49:21.789215058 +0300 ++++ trunk/sdl.c 2010-10-13 18:48:03.772555218 +0300 +@@ -2981,12 +2981,12 @@ + if((digit_to_input > 9) && (digit_to_input < 36)) + { + // 65 = ASCII value of "A" +- sprintf(digit_to_input_as_string, "Press X to enter a \'%c\'", digit_to_input + 65 - 10); ++ sprintf(digit_to_input_as_string, "Press D to enter a \'%c\'", digit_to_input + 65 - 10); + } + else + { + // 48 = ASCII value of "0" +- sprintf(digit_to_input_as_string, "Press X to enter a \'%c\'", digit_to_input + 48); ++ sprintf(digit_to_input_as_string, "Press D to enter a \'%c\'", digit_to_input + 48); + }; + sdl_status_bar(fe,digit_to_input_as_string); + } +@@ -3044,11 +3044,11 @@ + if((digit_to_input > 9) && (digit_to_input < 36)) + { + // 65 = ASCII value of "a" +- sprintf(digit_to_input_as_string, "Press X to enter a \'%c\'", digit_to_input + 65 - 10); ++ sprintf(digit_to_input_as_string, "Press D to enter a \'%c\'", digit_to_input + 65 - 10); + } + else + { +- sprintf(digit_to_input_as_string, "Press X to enter a \'%u\'", digit_to_input); ++ sprintf(digit_to_input_as_string, "Press D to enter a \'%u\'", digit_to_input); + }; + sdl_status_bar(fe,digit_to_input_as_string); + } +diff -ru trunk.orig/sdl.c trunk/sdl.c +--- trunk.orig/sdl.c 2010-10-19 02:26:24.719001658 +0300 ++++ trunk/sdl.c 2010-10-19 02:27:37.879000527 +0300 +@@ -5449,7 +5449,7 @@ + global_config->screenshots_enabled=FALSE; + global_config->screenshots_include_cursor=FALSE; + global_config->screenshots_include_statusbar=FALSE; +- global_config->control_system=FALSE; ++ global_config->control_system=TRUE; + global_config->music_volume=MIX_MAX_VOLUME; + for(i=0;i<10;i++) + global_config->tracks_to_play[i]=FALSE; diff --git a/recipes/puzzles/stppc2x/no-music.patch b/recipes/puzzles/stppc2x/no-music.patch new file mode 100644 index 0000000000..f4c5216ea9 --- /dev/null +++ b/recipes/puzzles/stppc2x/no-music.patch @@ -0,0 +1,12 @@ +diff -ru trunk.orig/sdl.c trunk/sdl.c +--- trunk.orig/sdl.c 2010-10-13 00:06:42.000000000 +0300 ++++ trunk/sdl.c 2010-10-13 01:17:47.776880717 +0300 +@@ -16,7 +16,7 @@ + // #define DEBUG_FUNCTIONS // Function calls + + //#define SCALELARGESCREEN +-#define BACKGROUND_MUSIC ++//#define BACKGROUND_MUSIC + + // Define this to implement kludges for certain game-specific options + // (Usually the ones that require floating point numbers but don't tell us) diff --git a/recipes/puzzles/stppc2x/no-upper-mem.patch b/recipes/puzzles/stppc2x/no-upper-mem.patch new file mode 100644 index 0000000000..34b392b702 --- /dev/null +++ b/recipes/puzzles/stppc2x/no-upper-mem.patch @@ -0,0 +1,12 @@ +diff -ru trunk.orig/smalloc.c trunk/smalloc.c +--- trunk.orig/smalloc.c 2010-10-13 01:03:15.985141137 +0300 ++++ trunk/smalloc.c 2010-10-13 01:02:37.993637339 +0300 +@@ -7,7 +7,7 @@ + // Define this to use nearly 32Mb of upper memory available on the GP2X + // which isn't normally accessible (or to fake such memory being available + // on non-GP2X hardware). +-#define OPTION_USE_UPPER_MEMORY ++// #define OPTION_USE_UPPER_MEMORY + + // Define this to pretend that "lower memory" is full and see what happens. + // #define DEBUG_PRETEND_MEMORY_FULL diff --git a/recipes/puzzles/stppc2x/stppc2x-extras.tar.gz b/recipes/puzzles/stppc2x/stppc2x-extras.tar.gz new file mode 100644 index 0000000000..f98e70eee0 Binary files /dev/null and b/recipes/puzzles/stppc2x/stppc2x-extras.tar.gz differ diff --git a/recipes/puzzles/stppc2x/stppc2x.desktop b/recipes/puzzles/stppc2x/stppc2x.desktop new file mode 100644 index 0000000000..fd2e96d15e --- /dev/null +++ b/recipes/puzzles/stppc2x/stppc2x.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=Puzzles +Exec=/usr/bin/stppc2x +Icon=stppc2x.png +Terminal=false +Type=Application +Categories=Game diff --git a/recipes/puzzles/stppc2x/stppc2x.png b/recipes/puzzles/stppc2x/stppc2x.png new file mode 100644 index 0000000000..9b74f9fce1 Binary files /dev/null and b/recipes/puzzles/stppc2x/stppc2x.png differ diff --git a/recipes/puzzles/stppc2x_svn.bb b/recipes/puzzles/stppc2x_svn.bb new file mode 100644 index 0000000000..380a75398d --- /dev/null +++ b/recipes/puzzles/stppc2x_svn.bb @@ -0,0 +1,37 @@ +DESCRIPTION = "stppc2x is an SDL port of Simon Tatham's Portable Puzzle Collection" +LICENSE = "GPLv2" + +DEPENDS = "virtual/libsdl libsdl-image libsdl-ttf" +RDEPENDS = "ttf-dejavu-sans-condensed" + +SRCREV = "185" +PV = "1.0+svnr${SRCPV}" +PR = "r0" + +FILES_${PN} = "/usr/bin /usr/share" + +SRC_URI = "svn://stppc2x.googlecode.com/svn/;module=trunk;proto=http \ + file://stppc2x-extras.tar.gz \ + file://no-upper-mem.patch \ + file://generic-keys.patch \ + file://no-music.patch \ + file://enable-fullscreen.patch \ + file://dir-fix.patch \ + file://stppc2x.desktop \ + file://stppc2x.png \ + file://Makefile" + +S = "${WORKDIR}/trunk" + +do_configure() { + mv ${WORKDIR}/Makefile ${S} + mv ${WORKDIR}/extras/help/* ${S}/help + mv ${WORKDIR}/extras/images/* ${S}/images +} + +do_install() { + oe_runmake install DESTDIR=${D} + + install -m 0644 ${WORKDIR}/stppc2x.png ${D}${datadir}/pixmaps + install -m 0644 ${WORKDIR}/stppc2x.desktop ${D}${datadir}/applications +} -- cgit 1.2.3-korg