From f507a70379d01dc591f238525f151a396bb16e99 Mon Sep 17 00:00:00 2001 From: jSTE0 <98854293+jSTE0@users.noreply.github.com> Date: Fri, 18 Feb 2022 22:33:17 +0000 Subject: [PATCH] platform: Add miyoo support Add support for the miyoo platform, another SDL-based platform with a small cache CPU and its own input mappings. --- Makefile | 7 ++++++- README.md | 1 + configure | 11 +++++++++-- platform/opendingux/inputmap.c | 18 +++++++++++++++++- 4 files changed, 33 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index ce1938e4..c6174aea 100644 --- a/Makefile +++ b/Makefile @@ -49,7 +49,7 @@ endif LINKOUT ?= -o endif -ifeq ("$(PLATFORM)",$(filter "$(PLATFORM)","gp2x" "opendingux" "rpi1")) +ifeq ("$(PLATFORM)",$(filter "$(PLATFORM)","gp2x" "opendingux" "miyoo" "rpi1")) # very small caches, avoid optimization options making the binary much bigger CFLAGS += -finline-limit=42 -fno-unroll-loops -fno-ipa-cp -ffast-math # this gets you about 20% better execution speed on 32bit arm/mips @@ -117,6 +117,11 @@ use_inputmap ?= 1 # OpenDingux is a generic platform, really. PLATFORM := generic endif +ifeq "$(PLATFORM)" "miyoo" +OBJS += platform/opendingux/inputmap.o +use_inputmap ?= 1 +PLATFORM := generic +endif ifeq ("$(PLATFORM)",$(filter "$(PLATFORM)","rpi1" "rpi2")) CFLAGS += -DHAVE_GLES -DRASPBERRY CFLAGS += -I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads/ -I/opt/vc/include/interface/vmcs_host/linux/ diff --git a/README.md b/README.md index 3a5b3fe0..154ff510 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,7 @@ dingux|dingux with ubuntu mips gcc 5.4|CROSS_COMPILE=mipsel-linux-gnu- CFLAGS="- retrofw|retrofw|CROSS_COMPILE=mipsel-linux- CFLAGS="-I $TC/include -I $TC/include/SDL -Wno-unused-result" LDFLAGS="--sysroot $TC/mipsel-buildroot-linux-uclibc/sysroot" ./configure --platform=retrofw gcw0|gcw0|CROSS_COMPILE=mipsel-gcw0-linux-uclibc- CFLAGS="-I$TC/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/include -I$TC/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/include/SDL" LDFLAGS="--sysroot $TC/usr/mipsel-gcw0-linux-uclibc/sysroot" ./configure --platform=gcw0 rg350|rg350|CROSS_COMPILE=mipsel-linux- CFLAGS="-I$TC/usr/include -I$TC/usr/include/SDL" LDFLAGS="--sysroot $TC -L$TC/lib" ./configure --platform=rg350 +miyoo|miyoo|CROSS_COMPILE=arm-miyoo-linux-uclibcgnueabi- CFLAGS="-I$TC/arm-miyoo-linux-uclibcgnueabi/sysroot/usr/include -I$TC/arm-miyoo-linux-uclibcgnueabi/sysroot/usr/include/SDL" LDFLAGS="--sysroot $TC/arm-miyoo-linux-uclibcgnueabi/sysroot" ./configure --platform=miyoo For gp2x, wiz, and caanoo you may need to compile libpng first. diff --git a/configure b/configure index 4019c2ed..c67b9a0c 100755 --- a/configure +++ b/configure @@ -39,7 +39,7 @@ check_define() # "" means "autodetect". # TODO this is annoyingly messy. should have platform and device -platform_list="generic pandora gp2x wiz caanoo dingux retrofw gcw0 rg350 opendingux rpi1 rpi2 psp" +platform_list="generic pandora gp2x wiz caanoo dingux retrofw gcw0 rg350 opendingux miyoo rpi1 rpi2 psp" platform="generic" sound_driver_list="oss alsa sdl" sound_drivers="" @@ -106,6 +106,13 @@ set_platform() MFLAGS="-march=mips32r2" platform="opendingux" ;; + miyoo) + # Miyoo BittBoy, PocketGO 1, PowKiddy V90/Q90 with Allwinner F1C100s + sound_drivers="sdl" + CFLAGS="$CFLAGS -D__MIYOO__" + MFLAGS="-mcpu=arm926ej-s -marm" + platform="miyoo" + ;; pandora) sound_drivers="oss alsa" have_libavcodec="yes" @@ -251,7 +258,7 @@ arm*) esac case "$platform" in -rpi1 | rpi2 | generic | opendingux) +rpi1 | rpi2 | generic | opendingux | miyoo) need_sdl="yes" ;; esac diff --git a/platform/opendingux/inputmap.c b/platform/opendingux/inputmap.c index 7c8c348f..b8851715 100644 --- a/platform/opendingux/inputmap.c +++ b/platform/opendingux/inputmap.c @@ -29,8 +29,13 @@ const struct menu_keymap in_sdl_key_map[] = { { SDLK_DOWN, PBTN_DOWN }, { SDLK_LEFT, PBTN_LEFT }, { SDLK_RIGHT, PBTN_RIGHT }, +#if defined(__MIYOO__) + { SDLK_LALT, PBTN_MOK }, + { SDLK_LCTRL, PBTN_MBACK }, +#else { SDLK_LCTRL, PBTN_MOK }, { SDLK_LALT, PBTN_MBACK }, +#endif { SDLK_SPACE, PBTN_MA2 }, { SDLK_LSHIFT, PBTN_MA3 }, { SDLK_TAB, PBTN_L }, @@ -56,9 +61,14 @@ const char * const _in_sdl_key_names[SDLK_LAST] = { [SDLK_DOWN] = "DOWN", [SDLK_LEFT] = "LEFT", [SDLK_RIGHT] = "RIGHT", +#if defined(__MIYOO__) + [SDLK_LALT] = "A", + [SDLK_LCTRL] = "B", +#else [SDLK_LCTRL] = "A", [SDLK_LALT] = "B", -#if defined(__GCW0__) +#endif +#if defined(__GCW0__) || defined(__MIYOO__) [SDLK_LSHIFT] = "X", [SDLK_SPACE] = "Y", #else @@ -77,6 +87,12 @@ const char * const _in_sdl_key_names[SDLK_LAST] = { [SDLK_PAGEDOWN] = "R2", [SDLK_KP_DIVIDE] = "L3", [SDLK_KP_PERIOD] = "R3", +#elif defined(__MIYOO__) + [SDLK_TAB] = "L1", + [SDLK_BACKSPACE] = "R1", + [SDLK_RALT] = "L2", + [SDLK_RSHIFT] = "R2", + [SDLK_RCTRL] = "R", #else [SDLK_TAB] = "L", [SDLK_BACKSPACE] = "R", -- 2.39.2