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
clean:
$(RM) $(TARGET) $(OBJS)
+ $(RM) -r .opk_data
$(TARGET): $(OBJS)
$(CC) -o $@ $(CFLAGS) $^ $(LDFLAGS) $(LDLIBS)
# 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=""
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"
case "$platform" in
generic)
;;
+ opendingux)
+ sound_drivers="sdl"
+ ;;
pandora)
sound_drivers="oss alsa"
optimize_cortexa8="yes"
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
esac
case "$platform" in
-generic)
+generic | opendingux)
need_sdl="yes"
;;
esac
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
{ 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 */
--- /dev/null
+#include <stdlib.h>
+#include <SDL_keysym.h>
+
+#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",
+};