From: Paul Cercueil Date: Mon, 7 Oct 2013 19:06:54 +0000 (+0200) Subject: Add support for the OpenDingux platform X-Git-Tag: v1.91~9 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d4bea61c8f1e5fb1a68c401610bd424c052ef636;p=picodrive.git Add support for the OpenDingux platform --- diff --git a/.gitignore b/.gitignore index 9f71eb92..b7ef852d 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,6 @@ mds/ cfg/ libs/ obj/ +.opk_data +PicoDrive +PicoDrive.opk diff --git a/Makefile b/Makefile index 67ba86f1..0df793e8 100644 --- a/Makefile +++ b/Makefile @@ -55,7 +55,21 @@ asm_cdpico = 0 asm_cdmemory = 0 endif -# frontend +ifeq "$(PLATFORM)" "opendingux" +opk: $(TARGET).opk + +$(TARGET).opk: $(TARGET) + $(RM) -rf .opk_data + cp -r platform/opendingux/data .opk_data + cp $< .opk_data/PicoDrive + $(STRIP) .opk_data/PicoDrive + mksquashfs .opk_data $@ -all-root -noappend -no-exports -no-xattrs + +OBJS += platform/opendingux/inputmap.o + +# OpenDingux is a generic platform, really. +PLATFORM := generic +endif ifeq "$(PLATFORM)" "generic" OBJS += platform/linux/emu.o platform/linux/blit.o # FIXME OBJS += platform/common/plat_sdl.o @@ -156,6 +170,7 @@ target_: $(TARGET) clean: $(RM) $(TARGET) $(OBJS) + $(RM) -r .opk_data $(TARGET): $(OBJS) $(CC) -o $@ $(CFLAGS) $^ $(LDFLAGS) $(LDLIBS) diff --git a/configure b/configure index 453d5309..29b45e1f 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" +platform_list="generic pandora gp2x opendingux" platform="generic" sound_driver_list="oss alsa sdl" sound_drivers="" @@ -51,6 +51,7 @@ optimize_arm920="no" CC="${CC-${CROSS_COMPILE}gcc}" CXX="${CXX-${CROSS_COMPILE}g++}" AS="${AS-${CROSS_COMPILE}as}" +STRIP="${STRIP-${CROSS_COMPILE}strip}" SDL_CONFIG="`$CC --print-sysroot`/usr/bin/sdl-config" MAIN_LDLIBS="$LDLIBS -lm" config_mak="config.mak" @@ -68,6 +69,9 @@ set_platform() case "$platform" in generic) ;; + opendingux) + sound_drivers="sdl" + ;; pandora) sound_drivers="oss alsa" optimize_cortexa8="yes" @@ -111,7 +115,7 @@ if [ "$show_help" = "yes" ]; then echo " --sound-drivers=LIST sound output drivers [guessed]" echo " available: $sound_driver_list" echo "influential environment variables:" - echo " CROSS_COMPILE CC CXX AS CFLAGS ASFLAGS LDFLAGS LDLIBS" + echo " CROSS_COMPILE CC CXX AS STRIP CFLAGS ASFLAGS LDFLAGS LDLIBS" exit 1 fi @@ -225,7 +229,7 @@ arm*) esac case "$platform" in -generic) +generic | opendingux) need_sdl="yes" ;; esac @@ -361,6 +365,7 @@ echo >> $config_mak echo "CC = $CC" >> $config_mak echo "CXX = $CXX" >> $config_mak echo "AS = $AS" >> $config_mak +echo "STRIP = $STRIP" >> $config_mak echo "CFLAGS += $CFLAGS" >> $config_mak echo "ASFLAGS += $ASFLAGS" >> $config_mak echo "LDFLAGS += $LDFLAGS" >> $config_mak diff --git a/platform/common/plat_sdl.c b/platform/common/plat_sdl.c index 63039d44..4404691a 100644 --- a/platform/common/plat_sdl.c +++ b/platform/common/plat_sdl.c @@ -72,12 +72,15 @@ const struct menu_keymap in_sdl_joy_map[] __attribute__((weak)) = { SDLK_WORLD_3, PBTN_MA3 }, }; +extern const char * const in_sdl_key_names[] __attribute__((weak)); + static const struct in_pdata in_sdl_platform_data = { .defbinds = in_sdl_defbinds, .key_map = in_sdl_key_map, .kmap_size = sizeof(in_sdl_key_map) / sizeof(in_sdl_key_map[0]), .joy_map = in_sdl_joy_map, .jmap_size = sizeof(in_sdl_joy_map) / sizeof(in_sdl_joy_map[0]), + .key_names = in_sdl_key_names, }; /* YUV stuff */ diff --git a/platform/libpicofe b/platform/libpicofe index c19e28f6..d685ce46 160000 --- a/platform/libpicofe +++ b/platform/libpicofe @@ -1 +1 @@ -Subproject commit c19e28f62660cdaed26698234cff9c084517b34c +Subproject commit d685ce4625e9f3b25b0852d31960cb429da06a9d diff --git a/platform/opendingux/data/default.gcw0.desktop b/platform/opendingux/data/default.gcw0.desktop new file mode 100644 index 00000000..80458bd8 --- /dev/null +++ b/platform/opendingux/data/default.gcw0.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Name=Picodrive +Comment=A megadrive/genesis emulator +Exec=PicoDrive +Terminal=false +Type=Application +StartupNotify=true +Icon=megadrive +Categories=emulators; diff --git a/platform/opendingux/data/megadrive.png b/platform/opendingux/data/megadrive.png new file mode 100644 index 00000000..e1bc5f8d Binary files /dev/null and b/platform/opendingux/data/megadrive.png differ diff --git a/platform/opendingux/data/skin/background.png b/platform/opendingux/data/skin/background.png new file mode 100644 index 00000000..5dc2bb66 Binary files /dev/null and b/platform/opendingux/data/skin/background.png differ diff --git a/platform/opendingux/data/skin/font.png b/platform/opendingux/data/skin/font.png new file mode 100644 index 00000000..707a5b43 Binary files /dev/null and b/platform/opendingux/data/skin/font.png differ diff --git a/platform/opendingux/data/skin/readme.txt b/platform/opendingux/data/skin/readme.txt new file mode 100644 index 00000000..0f9e4150 --- /dev/null +++ b/platform/opendingux/data/skin/readme.txt @@ -0,0 +1,7 @@ +The skin images can be customized, but there are several limitations: + +background.png - must be 320x240 image with 24bit RGB colors. +font.png - must be 128x160 8bit grayscale image. +selector.png - must be 8x10 8bit grayscale image. + +Font and selector colors can be changed by editing skin.txt. diff --git a/platform/opendingux/data/skin/skin.txt b/platform/opendingux/data/skin/skin.txt new file mode 100644 index 00000000..7f5bdb46 --- /dev/null +++ b/platform/opendingux/data/skin/skin.txt @@ -0,0 +1,3 @@ +// html-style hex color codes, ex. ff0000 is red, 0000ff is blue, etc. +text_color=ffffff +selection_color=0000c0 diff --git a/platform/opendingux/inputmap.c b/platform/opendingux/inputmap.c new file mode 100644 index 00000000..0398fc68 --- /dev/null +++ b/platform/opendingux/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_LSHIFT, IN_BINDTYPE_PLAYER12, GBTN_A }, + { SDLK_LALT, IN_BINDTYPE_PLAYER12, GBTN_B }, + { SDLK_LCTRL, IN_BINDTYPE_PLAYER12, GBTN_C }, + { SDLK_RETURN, IN_BINDTYPE_PLAYER12, GBTN_START }, + { SDLK_ESCAPE, IN_BINDTYPE_EMU, PEVB_MENU }, + { SDLK_TAB, IN_BINDTYPE_EMU, PEVB_PICO_PPREV }, + { SDLK_BACKSPACE, IN_BINDTYPE_EMU, PEVB_PICO_PNEXT }, + { SDLK_BACKSPACE, IN_BINDTYPE_EMU, PEVB_STATE_SAVE }, + { SDLK_TAB, IN_BINDTYPE_EMU, PEVB_STATE_LOAD }, + { SDLK_SPACE, IN_BINDTYPE_EMU, PEVB_FF }, + { 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_LCTRL, PBTN_MOK }, + { SDLK_LALT, PBTN_MBACK }, + { SDLK_SPACE, PBTN_MA2 }, + { SDLK_LSHIFT, PBTN_MA3 }, + { SDLK_TAB, PBTN_L }, + { SDLK_BACKSPACE, PBTN_R }, +}; + +const char * const in_sdl_key_names[SDLK_LAST] = { + [SDLK_UP] = "UP", + [SDLK_DOWN] = "DOWN", + [SDLK_LEFT] = "LEFT", + [SDLK_RIGHT] = "RIGHT", + [SDLK_LCTRL] = "A", + [SDLK_LALT] = "B", + [SDLK_LSHIFT] = "X", + [SDLK_SPACE] = "Y", + [SDLK_TAB] = "L", + [SDLK_BACKSPACE] = "R", + [SDLK_RETURN] = "START", + [SDLK_ESCAPE] = "SELECT", + [SDLK_POWER] = "POWER", + [SDLK_PAUSE] = "LOCK", +};