diff options
Diffstat (limited to 'backends')
-rw-r--r-- | backends/events/dinguxsdl/dinguxsdl-events.cpp | 60 | ||||
-rwxr-xr-x | backends/platform/dingux/build.trimui.sh | 3 | ||||
-rw-r--r-- | backends/platform/dingux/dingux.mk | 24 | ||||
-rw-r--r-- | backends/platform/sdl/sdl.cpp | 2 |
4 files changed, 89 insertions, 0 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(); |