aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backends/events/dinguxsdl/dinguxsdl-events.cpp60
-rwxr-xr-xbackends/platform/dingux/build.trimui.sh3
-rw-r--r--backends/platform/dingux/dingux.mk24
-rw-r--r--backends/platform/sdl/sdl.cpp2
-rwxr-xr-xconfigure57
5 files changed, 144 insertions, 2 deletions
diff --git a/backends/events/dinguxsdl/dinguxsdl-events.cpp b/backends/events/dinguxsdl/dinguxsdl-events.cpp
index 7730e8f915..7087883362 100644
--- a/backends/events/dinguxsdl/dinguxsdl-events.cpp
+++ b/backends/events/dinguxsdl/dinguxsdl-events.cpp
@@ -26,6 +26,33 @@
#include "backends/events/dinguxsdl/dinguxsdl-events.h"
+#ifdef TRIMUI
+/******
+ * Trimui keymap
+ * Dingoo button
+ * A -> Left Button BUT_Y
+ * B -> right button BUT_B
+ * X -> F5 BUT_START
+ * Y -> '.' BUT_X
+ * R -> '0' BUT_A
+ * Select -> VK BUT_SELECT
+ * Start -> ESC TRIG_R
+ * Menu -> Menu TRIG_L
+ */
+
+#define PAD_UP SDLK_UP
+#define PAD_DOWN SDLK_DOWN
+#define PAD_LEFT SDLK_LEFT
+#define PAD_RIGHT SDLK_RIGHT
+#define BUT_A SDLK_BACKSPACE
+#define BUT_B SDLK_LCTRL
+#define BUT_X SDLK_LALT
+#define BUT_Y SDLK_SPACE
+#define BUT_SELECT SDLK_RCTRL
+#define BUT_START SDLK_LSHIFT
+#define TRIG_L SDLK_ESCAPE
+#define TRIG_R SDLK_RETURN
+#else
#ifndef GCW0
#define PAD_UP SDLK_UP
#define PAD_DOWN SDLK_DOWN
@@ -68,6 +95,7 @@
#define TRIG_R SDLK_ESCAPE
#endif
+#endif
bool DINGUXSdlEventSource::remapKey(SDL_Event &ev, Common::Event &event) {
if (ev.key.keysym.sym == PAD_UP) {
@@ -146,6 +174,17 @@ bool DINGUXSdlEventSource::remapKey(SDL_Event &ev, Common::Event &event) {
ev.key.keysym.sym = SDLK_PERIOD;
ev.key.keysym.mod = (SDLMod)0;
ev.key.keysym.unicode = '.';
+ event.kbd.keycode = Common::KEYCODE_PERIOD;
+ event.kbd.ascii = '.';
+ event.kbd.flags = 0;
+
+ if (ev.type == SDL_KEYDOWN) {
+ event.type = Common::EVENT_KEYDOWN;
+ } else {
+ event.type = Common::EVENT_KEYUP;
+ }
+
+ return true;
} else if (ev.key.keysym.sym == TRIG_L) { // global menu
ev.key.keysym.sym = SDLK_F5;
event.kbd.keycode = Common::KEYCODE_F5;
@@ -182,9 +221,30 @@ bool DINGUXSdlEventSource::remapKey(SDL_Event &ev, Common::Event &event) {
#endif
} else if (ev.key.keysym.sym == BUT_START) { // F5, menu in some games
ev.key.keysym.sym = SDLK_F5;
+ event.kbd.keycode = Common::KEYCODE_F5;
+ event.kbd.ascii = Common::ASCII_F5;
+ event.kbd.flags = 0;
+
+ if (ev.type == SDL_KEYDOWN) {
+ event.type = Common::EVENT_KEYDOWN;
+ } else {
+ event.type = Common::EVENT_KEYUP;
+ }
+ return true;
} else if (ev.key.keysym.sym == TRIG_R) { // ESC
ev.key.keysym.sym = SDLK_ESCAPE;
+ event.kbd.keycode = Common::KEYCODE_ESCAPE;
+ event.kbd.ascii = Common::ASCII_ESCAPE;
+ event.kbd.flags = 0;
+
+ if (ev.type == SDL_KEYDOWN) {
+ event.type = Common::EVENT_KEYDOWN;
+ } else {
+ event.type = Common::EVENT_KEYUP;
+ }
+
+ return true;
} else {
event.kbd.keycode = (Common::KeyCode)ev.key.keysym.sym;
event.kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod, ev.key.keysym.unicode);
diff --git a/backends/platform/dingux/build.trimui.sh b/backends/platform/dingux/build.trimui.sh
new file mode 100755
index 0000000000..5b38e7e3a5
--- /dev/null
+++ b/backends/platform/dingux/build.trimui.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+ ../../../configure --host=trimui --with-mad-prefix=/opt/trimui-toolchain/arm-buildroot-linux-gnueabi/sysroot/usr --enable-plugins --default-dynamic --disable-all-unstable-engines --disable-flac --disable-debug --disable-highres --enable-release --disable-hq-scalers --disable-mt32emu --disable-lua --disable-nuked-opl && make && make trimui-dist
diff --git a/backends/platform/dingux/dingux.mk b/backends/platform/dingux/dingux.mk
index 0ecd1c2ed2..1d38e7511e 100644
--- a/backends/platform/dingux/dingux.mk
+++ b/backends/platform/dingux/dingux.mk
@@ -3,6 +3,7 @@ DINGUX_EXE_STRIPPED := scummvm_stripped$(EXEEXT)
bundle_name = dingux-dist/scummvm
gcw0_bundle = gcw0-opk
miyoo_compile = /opt/miyoo/usr/bin/arm-linux-strip
+trimui_strip = $(CROSS_COMPILE)strip
f=$(shell which $(STRIP))
libloc = $(shell dirname $(f))
@@ -64,6 +65,29 @@ endif
$(CP) $(srcdir)/backends/platform/dingux/README.MIYOO $(bundle_name)/
$(CP) $(srcdir)/backends/platform/dingux/scummvm.png $(bundle_name)/
+trimui-dist: all
+ $(MKDIR) $(bundle_name)
+ $(trimui_strip) $(EXECUTABLE) -o $(bundle_name)/scummvm.elf
+ $(CP) $(DIST_FILES_THEMES) $(bundle_name)/
+ifdef DIST_FILES_ENGINEDATA
+ $(CP) $(DIST_FILES_ENGINEDATA) $(bundle_name)/
+endif
+ifdef DIST_FILES_NETWORKING
+ $(CP) $(DIST_FILES_NETWORKING) $(bundle_name)/
+endif
+ifdef DIST_FILES_VKEYBD
+ $(CP) $(DIST_FILES_VKEYBD) $(bundle_name)/
+endif
+ $(CP) $(DIST_FILES_DOCS) $(bundle_name)/
+ifdef DYNAMIC_MODULES
+ $(MKDIR) $(bundle_name)/plugins
+ $(CP) $(PLUGINS) $(bundle_name)/plugins
+ $(trimui_strip) $(bundle_name)/plugins/*
+endif
+
+ $(CP) $(srcdir)/backends/platform/dingux/README.MIYOO $(bundle_name)/
+ $(CP) $(srcdir)/backends/platform/dingux/scummvm.png $(bundle_name)/
+
# Special target for generationg GCW-Zero OPK bundle
$(gcw0_bundle): all GeneralUser\ GS\ FluidSynth\ v1.44.sf2
$(MKDIR) $(gcw0_bundle)
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index b3436dbef8..c0414fc9ed 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -149,8 +149,10 @@ void OSystem_SDL::init() {
// Disable OS cursor
SDL_ShowCursor(SDL_DISABLE);
+#ifndef TRIMUI
if (!_logger)
_logger = new Backends::Log::Log(this);
+#endif
if (_logger) {
Common::WriteStream *logFile = createLogFile();
diff --git a/configure b/configure
index b0de33e8d3..38f57e57a8 100755
--- a/configure
+++ b/configure
@@ -1001,6 +1001,7 @@ Special configuration feature:
samsungtv for Samsung TV
switch for Nintendo Switch
tizen for Samsung Tizen
+ trimui for TrimUI S
webos for HP Palm WebOS
wii for Nintendo Wii
@@ -1774,6 +1775,11 @@ tizen)
_host_cpu=arm
_host_alias=arm-linux-gnueabi
;;
+trimui)
+ _host_os=linux
+ _host_cpu=arm
+ _host_alias=arm-buildroot-linux-gnueabi
+ ;;
webos)
_host_os=webos
_host_cpu=arm
@@ -3519,6 +3525,37 @@ if test -n "$_host"; then
# Tizen relies on the OpenGL ES output thus we always enable it.
_opengl_mode=gles
;;
+ trimui)
+ _sysroot=`$CXX --print-sysroot`
+ _sdlpath=$_sysroot/usr/bin
+ append_var DEFINES "-DTRIMUI -DDINGUX -DGCW0"
+ append_var DEFINES "-DDISABLE_DOSBOX_OPL"
+ append_var DEFINES "-DREDUCE_MEMORY_USAGE"
+ append_var CXXFLAGS "-msoft-float"
+ _backend="dingux"
+ _mt32emu=no
+ _nuked_opl=no
+ _optimization_level=-Ofast
+ # Disable alsa midi to get the port build on OpenDingux toolchain
+ _alsa=no
+ # Disable cloud and SDL_Net due to outdated toolchain
+ _cloud=no
+ _sdlnet=no
+ _libcurl=no
+ _vkeybd=yes
+ _build_hq_scalers=no
+ _mad=yes
+ _build_scalers=yes
+ # Force disable vorbis on dingux, it has terrible performance compared to tremor
+ _vorbis=no
+ # Force disable seq on dingux, no way to use it and it would get enabled by default with configure
+ _seq_midi=no
+ _sdlconfig=sdl-config
+ _savegame_timestamp=no
+ _port_mk="backends/platform/dingux/dingux.mk"
+ static_libs=''
+ dynamic_libs=''
+ ;;
webos)
_backend="webos"
_port_mk="backends/platform/webos/webos.mk"
@@ -3589,7 +3626,7 @@ case $_backend in
append_var LDFLAGS "-lronin -lm"
fi
;;
- dingux | miyoo)
+ dingux | miyoo | trimui)
append_var DEFINES "-DDINGUX"
_sdl=auto
;;
@@ -3869,7 +3906,7 @@ fi
# Enable 16bit support only for backends which support it
#
case $_backend in
- 3ds | android | androidsdl | dingux | miyoo | dc | gph | iphone | ios7 | maemo | openpandora | psp | psp2 | samsungtv | sdl | switch | tizen | webos | wii)
+ 3ds | android | androidsdl | dingux | miyoo | dc | gph | iphone | ios7 | maemo | openpandora | psp | psp2 | samsungtv | sdl | switch | tizen | trimui | webos | wii)
if test "$_16bit" = auto ; then
_16bit=yes
else
@@ -5761,6 +5798,22 @@ case $_backend in
# than pick up anything unhygenic from the Android libs.
LIBS="-Wl,-Bstatic $static_libs -Wl,-Bdynamic -lgcc $system_libs -llog -landroid -lGLESv1_CM"
;;
+ dingux)
+ if test "$_host" = trimui; then
+ for lib in $LIBS; do
+ case $lib in
+ -lmad|-lvorbisidec|-logg)
+ static_libs="$static_libs $lib"
+ ;;
+ *)
+ dynamic_libs="$dynamic_libs $lib"
+ ;;
+ esac
+ done
+
+ LIBS="-Wl,-Bstatic $static_libs -Wl,-Bdynamic $dynamic_libs"
+ fi
+ ;;
n64)
# Move some libs down here, otherwise some symbols requires by libvorbis aren't found
# during linking stage