platform: Add miyoo support

Add support for the miyoo platform, another SDL-based platform with a
small cache CPU and its own input mappings.
This commit is contained in:
jSTE0 2022-02-18 22:33:17 +00:00 committed by irixxxx
parent f8aaa200cf
commit f507a70379
4 changed files with 33 additions and 4 deletions

View file

@ -49,7 +49,7 @@ endif
LINKOUT ?= -o LINKOUT ?= -o
endif 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 # very small caches, avoid optimization options making the binary much bigger
CFLAGS += -finline-limit=42 -fno-unroll-loops -fno-ipa-cp -ffast-math CFLAGS += -finline-limit=42 -fno-unroll-loops -fno-ipa-cp -ffast-math
# this gets you about 20% better execution speed on 32bit arm/mips # 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. # OpenDingux is a generic platform, really.
PLATFORM := generic PLATFORM := generic
endif endif
ifeq "$(PLATFORM)" "miyoo"
OBJS += platform/opendingux/inputmap.o
use_inputmap ?= 1
PLATFORM := generic
endif
ifeq ("$(PLATFORM)",$(filter "$(PLATFORM)","rpi1" "rpi2")) ifeq ("$(PLATFORM)",$(filter "$(PLATFORM)","rpi1" "rpi2"))
CFLAGS += -DHAVE_GLES -DRASPBERRY CFLAGS += -DHAVE_GLES -DRASPBERRY
CFLAGS += -I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads/ -I/opt/vc/include/interface/vmcs_host/linux/ CFLAGS += -I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads/ -I/opt/vc/include/interface/vmcs_host/linux/

View file

@ -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 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 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 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. For gp2x, wiz, and caanoo you may need to compile libpng first.

11
configure vendored
View file

@ -39,7 +39,7 @@ check_define()
# "" means "autodetect". # "" means "autodetect".
# TODO this is annoyingly messy. should have platform and device # 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" platform="generic"
sound_driver_list="oss alsa sdl" sound_driver_list="oss alsa sdl"
sound_drivers="" sound_drivers=""
@ -106,6 +106,13 @@ set_platform()
MFLAGS="-march=mips32r2" MFLAGS="-march=mips32r2"
platform="opendingux" 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) pandora)
sound_drivers="oss alsa" sound_drivers="oss alsa"
have_libavcodec="yes" have_libavcodec="yes"
@ -251,7 +258,7 @@ arm*)
esac esac
case "$platform" in case "$platform" in
rpi1 | rpi2 | generic | opendingux) rpi1 | rpi2 | generic | opendingux | miyoo)
need_sdl="yes" need_sdl="yes"
;; ;;
esac esac

View file

@ -29,8 +29,13 @@ const struct menu_keymap in_sdl_key_map[] = {
{ SDLK_DOWN, PBTN_DOWN }, { SDLK_DOWN, PBTN_DOWN },
{ SDLK_LEFT, PBTN_LEFT }, { SDLK_LEFT, PBTN_LEFT },
{ SDLK_RIGHT, PBTN_RIGHT }, { SDLK_RIGHT, PBTN_RIGHT },
#if defined(__MIYOO__)
{ SDLK_LALT, PBTN_MOK },
{ SDLK_LCTRL, PBTN_MBACK },
#else
{ SDLK_LCTRL, PBTN_MOK }, { SDLK_LCTRL, PBTN_MOK },
{ SDLK_LALT, PBTN_MBACK }, { SDLK_LALT, PBTN_MBACK },
#endif
{ SDLK_SPACE, PBTN_MA2 }, { SDLK_SPACE, PBTN_MA2 },
{ SDLK_LSHIFT, PBTN_MA3 }, { SDLK_LSHIFT, PBTN_MA3 },
{ SDLK_TAB, PBTN_L }, { SDLK_TAB, PBTN_L },
@ -56,9 +61,14 @@ const char * const _in_sdl_key_names[SDLK_LAST] = {
[SDLK_DOWN] = "DOWN", [SDLK_DOWN] = "DOWN",
[SDLK_LEFT] = "LEFT", [SDLK_LEFT] = "LEFT",
[SDLK_RIGHT] = "RIGHT", [SDLK_RIGHT] = "RIGHT",
#if defined(__MIYOO__)
[SDLK_LALT] = "A",
[SDLK_LCTRL] = "B",
#else
[SDLK_LCTRL] = "A", [SDLK_LCTRL] = "A",
[SDLK_LALT] = "B", [SDLK_LALT] = "B",
#if defined(__GCW0__) #endif
#if defined(__GCW0__) || defined(__MIYOO__)
[SDLK_LSHIFT] = "X", [SDLK_LSHIFT] = "X",
[SDLK_SPACE] = "Y", [SDLK_SPACE] = "Y",
#else #else
@ -77,6 +87,12 @@ const char * const _in_sdl_key_names[SDLK_LAST] = {
[SDLK_PAGEDOWN] = "R2", [SDLK_PAGEDOWN] = "R2",
[SDLK_KP_DIVIDE] = "L3", [SDLK_KP_DIVIDE] = "L3",
[SDLK_KP_PERIOD] = "R3", [SDLK_KP_PERIOD] = "R3",
#elif defined(__MIYOO__)
[SDLK_TAB] = "L1",
[SDLK_BACKSPACE] = "R1",
[SDLK_RALT] = "L2",
[SDLK_RSHIFT] = "R2",
[SDLK_RCTRL] = "R",
#else #else
[SDLK_TAB] = "L", [SDLK_TAB] = "L",
[SDLK_BACKSPACE] = "R", [SDLK_BACKSPACE] = "R",