diff --git a/Makefile b/Makefile old mode 100644 new mode 100755 index 2903a6894..28712606f --- a/Makefile +++ b/Makefile @@ -123,7 +123,19 @@ endif ifeq "$(PLATFORM)" "libretro" OBJS += platform/libretro/libretro.o endif - +ifeq "$(PLATFORM)" "gameshell" +CFLAGS += -DGAMESHELL +CFLAGS += -DHAVE_GLES +LDFLAGS += -lEGL -lGL +OBJS += platform/gameshell/inputmap.o +OBJS += platform/linux/emu.o platform/linux/blit.o # FIXME +OBJS += platform/common/plat_sdl.o +OBJS += platform/libpicofe/plat_sdl.o platform/libpicofe/in_sdl.o +OBJS += platform/libpicofe/plat_dummy.o +OBJS += platform/libpicofe/gl.o +OBJS += platform/libpicofe/gl_platform.o +USE_FRONTEND = 1 +endif ifeq "$(USE_FRONTEND)" "1" # common diff --git a/PicoDrive.png b/PicoDrive.png new file mode 100755 index 000000000..d9169f185 Binary files /dev/null and b/PicoDrive.png differ diff --git a/PicoDrive.sh b/PicoDrive.sh new file mode 100755 index 000000000..b4906f0cf --- /dev/null +++ b/PicoDrive.sh @@ -0,0 +1 @@ +./PicoDrive diff --git a/configure b/configure index 1310ab2c9..ff432f072 100755 --- a/configure +++ b/configure @@ -31,7 +31,7 @@ check_define() # setting options to "yes" or "no" will make that choice default, # "" means "autodetect". -platform_list="generic pandora gp2x opendingux rpi1 rpi2" +platform_list="generic pandora gp2x opendingux rpi1 rpi2 gameshell" platform="generic" sound_driver_list="oss alsa sdl" sound_drivers="" @@ -81,6 +81,9 @@ set_platform() opendingux) sound_drivers="sdl" ;; + gameshell) + # sound_drivers="sdl" + ;; pandora) sound_drivers="oss alsa" optimize_cortexa8="yes" @@ -246,7 +249,7 @@ arm*) esac case "$platform" in -rpi1 | rpi2 | generic | opendingux) +rpi1 | rpi2 | generic | opendingux | gameshell) need_sdl="yes" ;; esac @@ -406,6 +409,6 @@ if [ "$platform" = "g1p2x" ]; then fi # use pandora's skin (for now) -test -e skin || ln -s platform/pandora/skin skin +test -e skin || ln -s platform/gameshell/data/skin skin # vim:shiftwidth=2:expandtab diff --git a/platform/common/menu_pico.c b/platform/common/menu_pico.c old mode 100644 new mode 100755 diff --git a/platform/gameshell/data/megadrive.png b/platform/gameshell/data/megadrive.png new file mode 100755 index 000000000..e1bc5f8d4 Binary files /dev/null and b/platform/gameshell/data/megadrive.png differ diff --git a/platform/gameshell/inputmap.c b/platform/gameshell/inputmap.c new file mode 100755 index 000000000..002bfe94e --- /dev/null +++ b/platform/gameshell/inputmap.c @@ -0,0 +1,55 @@ +#include +#include + +#include "../libpicofe/input.h" +#include "../libpicofe/in_sdl.h" +#include "../common/input_pico.h" + +const struct in_default_bind in_sdl_defbinds[] = { + { SDLK_UP, IN_BINDTYPE_PLAYER12, GBTN_UP }, + { SDLK_DOWN, IN_BINDTYPE_PLAYER12, GBTN_DOWN }, + { SDLK_LEFT, IN_BINDTYPE_PLAYER12, GBTN_LEFT }, + { SDLK_RIGHT, IN_BINDTYPE_PLAYER12, GBTN_RIGHT }, + { SDLK_j, IN_BINDTYPE_PLAYER12, GBTN_A }, + { SDLK_k, IN_BINDTYPE_PLAYER12, GBTN_B }, + { SDLK_u, IN_BINDTYPE_PLAYER12, GBTN_C }, + { SDLK_RETURN, IN_BINDTYPE_PLAYER12, GBTN_START }, + { SDLK_ESCAPE, IN_BINDTYPE_EMU, PEVB_MENU }, + { SDLK_KP_MINUS, IN_BINDTYPE_EMU, PEVB_PICO_PPREV }, + { SDLK_KP_PLUS, IN_BINDTYPE_EMU, PEVB_PICO_PNEXT }, + { SDLK_BACKSPACE, IN_BINDTYPE_EMU, PEVB_STATE_SAVE }, + { 0, 0, 0 }, + { 0, 0, 0 }, + { 0, 0, 0 } +}; + +const struct menu_keymap in_sdl_key_map[] = +{ + { SDLK_UP, PBTN_UP }, + { SDLK_DOWN, PBTN_DOWN }, + { SDLK_LEFT, PBTN_LEFT }, + { SDLK_RIGHT, PBTN_RIGHT }, + { SDLK_j, PBTN_MOK }, + { SDLK_k, PBTN_MBACK }, + { SDLK_u, PBTN_MA2 }, + { SDLK_i, PBTN_MA3 }, + { SDLK_KP_MINUS, PBTN_L }, + { SDLK_KP_PLUS, PBTN_R }, +}; + +const char * const in_sdl_key_names[SDLK_LAST] = { + [SDLK_UP] = "UP", + [SDLK_DOWN] = "DOWN", + [SDLK_LEFT] = "LEFT", + [SDLK_RIGHT] = "RIGHT", + [SDLK_j] = "A", + [SDLK_k] = "B", + [SDLK_u] = "X", + [SDLK_i] = "Y", + [SDLK_RETURN] = "START", + [SDLK_SPACE] = "SELECT", + [SDLK_ESCAPE] = "MENU", + [SDLK_KP_MINUS] = "-", + [SDLK_KP_PLUS] = "+", + [SDLK_BACKSPACE] = "Shift-MENU" +};