Added PYRA option (also inverted Shoulder buttons function on Pandora/Pyra build)

This commit is contained in:
ptitSeb 2021-08-02 08:59:05 +02:00
parent 7aabe0bd70
commit f777ad622b
8 changed files with 23 additions and 17 deletions

View File

@ -106,10 +106,16 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
endif()
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm.*")
if(PYRA)
add_compile_options(-mfpu=neon-vfpv4)
elseif(NOT (MACOSX AND CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64"))
add_compile_options(-mfpu=neon)
add_compile_options(-mfpu=neon-vfpv4)
add_compile_options(-mcpu=cortex-a15)
add_compile_options(-mfloat-abi=hard)
add_compile_options(-marm)
elseif(NOT (MACOSX AND CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64"))
add_compile_options(-mfpu=neon)
else()
add_compile_options(-mfpu=neon)
endif()
add_compile_options(-fsigned-char)
endif()
add_compile_options(-fno-strict-aliasing)
add_definitions(-D_REENTRANT=1)

View File

@ -50,10 +50,10 @@ BOOL PeekMessage(MSG *msg, void *hwnd, UINT wMsgFilterMin,
case SDL_KEYUP:
if (sdlevent.key.keysym.sym == SDLK_BACKQUOTE)
msg->unicode = '~'; // !!! FIXME: this is all a hack.
#if defined(PLATFORM_PANDORA) || defined(PLATFORM_PYRA)
if(sdlevent.key.keysym.sym == SDLK_RCTRL) {
#if defined(PLATFORM_PANDORA) || defined(PPLATFORM_PYRA)
if(sdlevent.key.keysym.sym == SDLK_RSHIFT) {
msg->message = (sdlevent.type==SDL_KEYDOWN)?WM_RBUTTONDOWN:WM_RBUTTONUP;
} else if(sdlevent.key.keysym.sym == SDLK_RSHIFT) {
} else if(sdlevent.key.keysym.sym == SDLK_RCTRL) {
msg->message = (sdlevent.type==SDL_KEYDOWN)?WM_LBUTTONDOWN:WM_LBUTTONUP;
} else
#endif
@ -115,7 +115,7 @@ SHORT GetKeyState(int vk)
{
SHORT retval = 0;
#if defined(PLATFORM_PANDORA) || defined(PLATFORM_PYRA)
Uint8 *keystate = SDL_GetKeyboardState(NULL);
const Uint8 *keystate = SDL_GetKeyboardState(NULL);
#endif
switch (vk)
@ -124,7 +124,7 @@ SHORT GetKeyState(int vk)
if (SDL_GetMouseState(NULL, NULL) & SDL_BUTTON_LMASK)
retval = 0x8000;
#if defined(PLATFORM_PANDORA) || defined(PLATFORM_PYRA)
if(keystate[SDL_SCANCODE_RSHIFT])
if(keystate[SDL_SCANCODE_RCTRL])
retval = 0x8000;
#endif
break;
@ -133,7 +133,7 @@ SHORT GetKeyState(int vk)
if (SDL_GetMouseState(NULL, NULL) & SDL_BUTTON_RMASK)
retval = 0x8000;
#if defined(PLATFORM_PANDORA) || defined(PLATFORM_PYRA)
if(keystate[SDL_SCANCODE_RCTRL])
if(keystate[SDL_SCANCODE_RSHIFT])
retval = 0x8000;
#endif
break;

View File

@ -288,11 +288,11 @@ static void SetKeyFromEvent(const SDL_Event *event, const BOOL bDown)
return;
} // if
#ifdef PLATFORM_PANDORA
if(event->key.keysym.sym==SDLK_RSHIFT) {
#if defined(PLATFORM_PANDORA) || defined(PLATFORM_PYRA)
if(event->key.keysym.sym==SDLK_RCTRL) {
_abKeysPressed[KID_MOUSE1] = bDown;
return;
} else if(event->key.keysym.sym==SDLK_RCTRL) {
} else if(event->key.keysym.sym==SDLK_RSHIFT) {
_abKeysPressed[KID_MOUSE2] = bDown;
return;
}

View File

@ -887,7 +887,7 @@ nextRowO:
UWORD words[4];
WORD iwords[4];
UBYTE bytes[8];
};
} __attribute__((packed)); //avoid optimisation and BUSERROR on Pyra build
for (int i=0; i<pixHeight; i++) {
int idx = i&3;
uConv dith;

View File

@ -370,7 +370,7 @@ void Quaternion<Type>::FromEuler(const Vector<Type, 3> &a)
template<class Type>
Type Quaternion<Type>::EPS(Type orig) const
{
#ifdef PLATFORM_PANDORA
#if defined(PLATFORM_PANDORA) || defined(PLATFORM_PYRA)
if ((orig <= 1e-4f) && (orig >= -1e-4f))
#else
if ((orig <= 10e-6f) && (orig >= -10e-6f))

View File

@ -310,7 +310,7 @@ Rect ExtractPolygonsInBox(CTerrain *ptrTerrain, const FLOATaabbox3D &bboxExtract
if(!bFixSize) {
// max vector of bbox in incremented for one, because first vertex is at 0,0,0 in world and in heightmap is at 1,1
#ifdef __arm__
#ifdef PLATFORM_PANDORA
#if defined(PLATFORM_PANDORA) || defined(PLATFORM_PYRA)
#define Isinf(a) (((*(unsigned int*)&a)&0x7fffffff)==0x7f800000)
#else
#define Isinf isinff

View File

@ -48,7 +48,7 @@ static inline void BoxToGrid(
FLOAT fMaxX = boxEntity.Max()(1);
FLOAT fMaxZ = boxEntity.Max()(3);
#ifdef __arm__
#ifdef PLATFORM_PANDORA
#if defined(PLATFORM_PANDORA) || defined(PLATFORM_PYRA)
#define Isinf(a) (((*(unsigned int*)&a)&0x7fffffff)==0x7f800000)
#else
#define Isinf isinff

View File

@ -286,7 +286,7 @@ static void UpdatePauseState(void)
void LimitFrameRate(void)
{
// do not limit FPS on the Pandora, it's not powerfull enough and doesn't "iconise" games either
#ifndef PLATFORM_PANDORA
#if !defined(PLATFORM_PANDORA) && !defined(PLATFORM_PYRA)
// measure passed time for each loop
static CTimerValue tvLast(-1.0f);
CTimerValue tvNow = _pTimer->GetHighPrecisionTimer();