aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorptitSeb2017-11-30 19:18:45 +0100
committerptitSeb2017-11-30 19:18:45 +0100
commitc5e4535f9ac06c25bd37529b351fbbf927e82683 (patch)
tree8f19cdcc97cc954d26bbfd71d5fad9880f83153d
parent7f40970f2ce3a54fab59245628e1e10cae148957 (diff)
downloadhydracastlelabyrinth-c5e4535f9ac06c25bd37529b351fbbf927e82683.tar.gz
hydracastlelabyrinth-c5e4535f9ac06c25bd37529b351fbbf927e82683.tar.bz2
hydracastlelabyrinth-c5e4535f9ac06c25bd37529b351fbbf927e82683.zip
Added PYRA and CHIP support
-rw-r--r--CMakeLists.txt11
-rw-r--r--src/main.c8
-rw-r--r--src/sdl/input.c13
3 files changed, 28 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0ef299f..8c2a26c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,9 +1,18 @@
cmake_minimum_required(VERSION 2.8)
option(PANDORA "Set to ON if targeting an OpenPandora device" ${PANDORA})
+option(PYRA "Set to ON if targeting an DragonBox Pyra device" ${PANDORA})
+option(CHIP "Set to ON if targeting an PocketCHIP device" ${PANDORA})
+
if(PANDORA)
- add_definitions(-DPANDORA -DARM -DNEON)
+ add_definitions(-DPANDORA)
+endif()
+if(PYRA)
+ add_definitions(-DPYRA)
+endif()
+if(CHIP)
+ add_definitions(-DCHIP)
endif()
#create a _SDL2 later?
diff --git a/src/main.c b/src/main.c
index 475ba5c..cd09738 100644
--- a/src/main.c
+++ b/src/main.c
@@ -39,12 +39,18 @@ int main(int argc, char **argv)
osSetSpeedupEnable(false);
#endif
#ifdef _SDL
- #ifdef PANDORA
+ #if defined(PANDORA) || defined(PYRA) || defined(CHIP)
wantFullscreen = 1;
#else
wantFullscreen = 0;
#endif
+ #ifdef CHIP
+ screenScale = 1;
+ #elif defined(PYRA)
+ screenScale = 3;
+ #else
screenScale = 2;
+ #endif
useJoystick = 1;
// get command line arguments
for (int i=1; i<argc; i++)
diff --git a/src/sdl/input.c b/src/sdl/input.c
index adba574..26fbbf1 100644
--- a/src/sdl/input.c
+++ b/src/sdl/input.c
@@ -51,7 +51,7 @@ void Input_KeyEvent(SDL_Event* evt)
case SDLK_DOWN: bDown = w; break;
case SDLK_LEFT: bLeft = w; break;
case SDLK_RIGHT: bRight = w; break;
-#ifdef PANDORA
+#if defined(PANDORA) || defined(PYRA)
case SDLK_PAGEUP: bFaceUp = w; break;
case SDLK_PAGEDOWN: bFaceDown = w; break;
case SDLK_END: bFaceLeft = w; break; // reversing, so (B) is sword
@@ -59,7 +59,16 @@ void Input_KeyEvent(SDL_Event* evt)
case SDLK_RCTRL: bR = w; break;
case SDLK_RSHIFT: bL = w; break;
case SDLK_LCTRL: bSelect = w; break;
- case SDLK_LALT: bStart = w; break;
+ case SDLK_LALT: bStart = w; break;
+#elif defined(CHIP)
+ case SDLK_MINUS: bFaceUp = w; break;
+ case SDLK_o: bFaceDown = w; break;
+ case SDLK_0: bFaceLeft = w; break;
+ case SDLK_EQUALS: bFaceRight = w; break;
+ case SDLK_1: bR = w; break;
+ case SDLK_2: bL = w; break;
+ case SDLK_SPACE: bSelect = w; break;
+ case SDLK_RETURN: bStart = w; break;
#else
case SDLK_e: bFaceUp = w; break;
case SDLK_x: bFaceDown = w; break;