diff --git a/packages/multimedia/gmu/config/gmu.conf b/packages/multimedia/gmu/config/gmu.conf index f42659cc2..2efceff69 100644 --- a/packages/multimedia/gmu/config/gmu.conf +++ b/packages/multimedia/gmu/config/gmu.conf @@ -44,7 +44,7 @@ SDL.SecondsUntilBacklightPowerOff=0 SDL.SmallCoverArtworkAlignment=right SDL.TimeDisplay=elapsed SDL.Width=1280 -SDL.InputConfigFile=gmuinput.caanoo.conf +SDL.InputConfigFile=/storage/.config/gmu/gmuinput.conf SDL.KeyMap=caanoo.keymap Log.File=gmutracks.log Notify.Enable=yes diff --git a/packages/multimedia/gmu/config/gmuinput.conf b/packages/multimedia/gmu/config/gmuinput.conf new file mode 100644 index 000000000..0477f4bdd --- /dev/null +++ b/packages/multimedia/gmu/config/gmuinput.conf @@ -0,0 +1,17 @@ +FullKeyboard=no +JoyButton-0=@DEVICE_BTN_SOUTH@,A +JoyButton-1=@DEVICE_BTN_WEST@,X +JoyButton-2=@DEVICE_BTN_EAST@,B +JoyButton-3=@DEVICE_BTN_NORTH@,Y +JoyButton-4=@DEVICE_BTN_START@,Lock +JoyButton-5=@DEVICE_BTN_THUMBL@,HelpI +JoyButton-6=@DEVICE_BTN_THUMBR@,HelpII +JoyButton-7=@DEVICE_BTN_TR2@,StickClick +JoyButton-8=@DEVICE_BTN_TL@,L +JoyButton-9=@DEVICE_BTN_TR@,R +JoyButton-10=@DEVICE_BTN_SELECT@,Home +JoyButton-11=@DEVICE_BTN_START@,Unlock,R +JoyAxis-0=-1,Left +JoyAxis-1=1,Right +JoyAxis-2=-2,Up +JoyAxis-3=2,Down diff --git a/packages/multimedia/gmu/package.mk b/packages/multimedia/gmu/package.mk index 63ae1fb2d..77509d18a 100644 --- a/packages/multimedia/gmu/package.mk +++ b/packages/multimedia/gmu/package.mk @@ -29,7 +29,7 @@ make_target() { post_makeinstall_target() { mkdir -p ${INSTALL}/usr/config/gmu/playlists - cp -f ${PKG_DIR}/config/gmu.conf ${INSTALL}/usr/config/gmu + cp -f ${PKG_DIR}/config/* ${INSTALL}/usr/config/gmu mkdir -p ${INSTALL}/usr/bin cp -f ${PKG_DIR}/scripts/start_gmu.sh ${INSTALL}/usr/bin diff --git a/packages/multimedia/gmu/patches/002-no-input-path.patch b/packages/multimedia/gmu/patches/002-no-input-path.patch new file mode 100644 index 000000000..383e02611 --- /dev/null +++ b/packages/multimedia/gmu/patches/002-no-input-path.patch @@ -0,0 +1,13 @@ +diff --git a/src/frontends/sdl/sdl.c b/src/frontends/sdl/sdl.c +index 7a31fc0..a6b114d 100644 +--- a/src/frontends/sdl/sdl.c ++++ b/src/frontends/sdl/sdl.c +@@ -110,7 +110,7 @@ static void input_device_config(void) + gmu_core_config_acquire_lock(); + inputconf = cfg_get_key_value(config, "SDL.InputConfigFile"); + if (!inputconf) inputconf = "gmuinput.conf"; +- snprintf(tmp, 255, "%s/%s", gmu_core_get_config_dir(), inputconf); ++ snprintf(tmp, 255, "%s", inputconf); + tmp[255] = '\0'; + gmu_core_config_release_lock(); + input_config_init(tmp); diff --git a/packages/multimedia/gmu/scripts/start_gmu.sh b/packages/multimedia/gmu/scripts/start_gmu.sh index b7e7a17af..0c470b123 100644 --- a/packages/multimedia/gmu/scripts/start_gmu.sh +++ b/packages/multimedia/gmu/scripts/start_gmu.sh @@ -8,6 +8,7 @@ jslisten set "-HUP gmu.bin" GMUPATH="/storage/.config/gmu" GMUCONFIG="${GMUPATH}/gmu.conf" +GMUINPUT="${GMUPATH}/gmuinput.conf" if [ -d "/storage/.local/share/gmu" ] then @@ -43,5 +44,16 @@ then PLAYLIST="-l \"${1}\"" fi +### Set up controls +for CONTROL in DEVICE_BTN_SOUTH DEVICE_BTN_EAST DEVICE_BTN_NORTH \ + DEVICE_BTN_WEST DEVICE_BTN_TL DEVICE_BTN_TR \ + DEVICE_BTN_TL2 DEVICE_BTN_TR2 DEVICE_BTN_SELECT \ + DEVICE_BTN_START DEVICE_BTN_MODE DEVICE_BTN_THUMBL \ + DEVICE_BTN_THUMBR DEVICE_BTN_DPAD_UP DEVICE_BTN_DPAD_DOWN \ + DEVICE_BTN_DPAD_LEFT DEVICE_BTN_DPAD_RIGHT +do + sed -i "s~@${CONTROL}@~${!CONTROL}~g" ${GMUINPUT} +done + cd /usr/local/share/gmu /usr/local/bin/gmu.bin -d /usr/local/etc/gmu -c /storage/.config/gmu/gmu.conf ${PLAYLIST}