[PYRA] Added PYRA Profile

This commit is contained in:
ptitSeb 2020-06-13 21:21:52 +02:00
parent 6ee27922c4
commit d1081324a2
3 changed files with 26 additions and 7 deletions

View File

@ -101,11 +101,15 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
add_compile_options(-Wall) add_compile_options(-Wall)
add_compile_options(-pipe) add_compile_options(-pipe)
add_compile_options(-fPIC) add_compile_options(-fPIC)
if(NOT PANDORA) if(NOT PANDORA AND NOT PYRA)
add_compile_options(-march=native) add_compile_options(-march=native)
endif() endif()
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm.*") if(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm.*")
if(PYRA)
add_compile_options(-mfpu=neon-vfpv4)
else()
add_compile_options(-mfpu=neon) add_compile_options(-mfpu=neon)
endif()
endif() endif()
add_compile_options(-fno-strict-aliasing) add_compile_options(-fno-strict-aliasing)
add_definitions(-D_REENTRANT=1) add_definitions(-D_REENTRANT=1)
@ -116,9 +120,13 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
## For C flags ## For C flags
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g -D_DEBUG=1 -DDEBUG=1 -O0") set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g -D_DEBUG=1 -DDEBUG=1 -O0")
if(PANDORA) if(PANDORA)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} -DNDEBUG=1 -D_NDEBUG=1 -g -O3 - -faligned-new -ffast-math") set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} -DNDEBUG=1 -D_NDEBUG=1 -g -O3 -faligned-new -ffast-math")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -DNDEBUG=1 -D_NDEBUG=1 -g -O3 -faligned-new -ffast-math") set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -DNDEBUG=1 -D_NDEBUG=1 -g -O3 -faligned-new -ffast-math")
set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS} -DNDEBUG=1 -D_NDEBUG=1 -Os -ffast-math") set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS} -DNDEBUG=1 -D_NDEBUG=1 -Os -ffast-math")
elseif(PYRA)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} -DNDEBUG=1 -D_NDEBUG=1 -g -O3 -marm -faligned-new -ffast-math")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -DNDEBUG=1 -D_NDEBUG=1 -g -O3 -marm -faligned-new -ffast-math")
set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS} -DNDEBUG=1 -D_NDEBUG=1 -Os -marm -ffast-math")
else() else()
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} -DNDEBUG=1 -D_NDEBUG=1 -g -O3 -fno-unsafe-math-optimizations") set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} -DNDEBUG=1 -D_NDEBUG=1 -g -O3 -fno-unsafe-math-optimizations")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -DNDEBUG=1 -D_NDEBUG=1 -g -O3 -fno-unsafe-math-optimizations") set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -DNDEBUG=1 -D_NDEBUG=1 -g -O3 -fno-unsafe-math-optimizations")
@ -131,6 +139,10 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -DNDEBUG=1 -D_NDEBUG=1 -O3 -faligned-new -ffast-math") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -DNDEBUG=1 -D_NDEBUG=1 -O3 -faligned-new -ffast-math")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS} -DNDEBUG=1 -D_NDEBUG=1 -g -O3 -faligned-new -ffast-math") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS} -DNDEBUG=1 -D_NDEBUG=1 -g -O3 -faligned-new -ffast-math")
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS} -DNDEBUG=1 -D_NDEBUG=1 -Os -ffast-math") set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS} -DNDEBUG=1 -D_NDEBUG=1 -Os -ffast-math")
elseif(PYRA)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -DNDEBUG=1 -D_NDEBUG=1 -O3 -marm -faligned-new -ffast-math")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS} -DNDEBUG=1 -D_NDEBUG=1 -g -O3 -marm -faligned-new -ffast-math")
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS} -DNDEBUG=1 -D_NDEBUG=1 -Os -marm -ffast-math")
else() else()
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -DNDEBUG=1 -D_NDEBUG=1 -O3 -fno-unsafe-math-optimizations") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -DNDEBUG=1 -D_NDEBUG=1 -O3 -fno-unsafe-math-optimizations")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS} -DNDEBUG=1 -D_NDEBUG=1 -g -O3 -fno-unsafe-math-optimizations") ## RAKE! Does -DNDEBUG=1 and -D_NDEBUG=1 mess with RelWithDebInfo? set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS} -DNDEBUG=1 -D_NDEBUG=1 -g -O3 -fno-unsafe-math-optimizations") ## RAKE! Does -DNDEBUG=1 and -D_NDEBUG=1 mess with RelWithDebInfo?
@ -246,6 +258,11 @@ if (PANDORA)
add_definitions(-DPLATFORM_PANDORA=1) add_definitions(-DPLATFORM_PANDORA=1)
endif() endif()
option(PYRA "Compile for Pyra" FALSE)
if (PYRA)
add_definitions(-DPLATFORM_PYRAA=1)
endif()
option(USE_TREMOR "Use Tremor instead of Vorbis" FALSE) option(USE_TREMOR "Use Tremor instead of Vorbis" FALSE)
if (USE_TREMOR) if (USE_TREMOR)
add_definitions(-DUSE_TREMOR=1) add_definitions(-DUSE_TREMOR=1)

View File

@ -50,7 +50,7 @@ BOOL PeekMessage(MSG *msg, void *hwnd, UINT wMsgFilterMin,
case SDL_KEYUP: case SDL_KEYUP:
if (sdlevent.key.keysym.sym == SDLK_BACKQUOTE) if (sdlevent.key.keysym.sym == SDLK_BACKQUOTE)
msg->unicode = '~'; // !!! FIXME: this is all a hack. msg->unicode = '~'; // !!! FIXME: this is all a hack.
#ifdef PLATFORM_PANDORA #if defined(PLATFORM_PANDORA) || defined(PPLATFORM_PTRA)
if(sdlevent.key.keysym.sym == SDLK_RCTRL) { if(sdlevent.key.keysym.sym == SDLK_RCTRL) {
msg->message = (sdlevent.type==SDL_KEYDOWN)?WM_RBUTTONDOWN:WM_RBUTTONUP; 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_RSHIFT) {
@ -114,7 +114,7 @@ void DispatchMessage(MSG *msg)
SHORT GetKeyState(int vk) SHORT GetKeyState(int vk)
{ {
SHORT retval = 0; SHORT retval = 0;
#ifdef PLATFORM_PANDORA #if defined(PLATFORM_PANDORA) || defined(PLATFORM_PYRA)
Uint8 *keystate = SDL_GetKeyboardState(NULL); Uint8 *keystate = SDL_GetKeyboardState(NULL);
#endif #endif
@ -123,7 +123,7 @@ SHORT GetKeyState(int vk)
case VK_LBUTTON: case VK_LBUTTON:
if (SDL_GetMouseState(NULL, NULL) & SDL_BUTTON_LMASK) if (SDL_GetMouseState(NULL, NULL) & SDL_BUTTON_LMASK)
retval = 0x8000; retval = 0x8000;
#ifdef PLATFORM_PANDORA #if defined(PLATFORM_PANDORA) || defined(PLATFORM_PYRA)
if(keystate[SDL_SCANCODE_RSHIFT]) if(keystate[SDL_SCANCODE_RSHIFT])
retval = 0x8000; retval = 0x8000;
#endif #endif
@ -132,7 +132,7 @@ SHORT GetKeyState(int vk)
case VK_RBUTTON: case VK_RBUTTON:
if (SDL_GetMouseState(NULL, NULL) & SDL_BUTTON_RMASK) if (SDL_GetMouseState(NULL, NULL) & SDL_BUTTON_RMASK)
retval = 0x8000; retval = 0x8000;
#ifdef PLATFORM_PANDORA #if defined(PLATFORM_PANDORA) || defined(PLATFORM_PYRA)
if(keystate[SDL_SCANCODE_RCTRL]) if(keystate[SDL_SCANCODE_RCTRL])
retval = 0x8000; retval = 0x8000;
#endif #endif
@ -145,7 +145,7 @@ SHORT GetKeyState(int vk)
default: default:
STUBBED("this can't possibly be right, yeah?"); STUBBED("this can't possibly be right, yeah?");
#ifdef PLATFORM_PANDORA #if defined(PLATFORM_PANDORA) || defined(PLATFORM_PYRA)
if (keystate[SDL_GetScancodeFromKey((SDL_Keycode)vk)]) if (keystate[SDL_GetScancodeFromKey((SDL_Keycode)vk)])
#else #else
if (SDL_GetKeyboardState(NULL)[SDL_GetScancodeFromKey((SDL_Keycode)vk)]) if (SDL_GetKeyboardState(NULL)[SDL_GetScancodeFromKey((SDL_Keycode)vk)])

View File

@ -216,6 +216,8 @@ static void DetectCPU(void)
sys_bCPUHasCMOV = bCMOV!=0; sys_bCPUHasCMOV = bCMOV!=0;
#ifdef PLATFORM_PANDORA #ifdef PLATFORM_PANDORA
sys_iCPUMHz = 400; // conservative, ARM -> x86 cpu translation is not 1 to 1. sys_iCPUMHz = 400; // conservative, ARM -> x86 cpu translation is not 1 to 1.
#elif defined(PLATFORM_PYRA)
sys_iCPUMHz = 1000;
#else #else
sys_iCPUMHz = INDEX(_pTimer->tm_llCPUSpeedHZ/1E6); sys_iCPUMHz = INDEX(_pTimer->tm_llCPUSpeedHZ/1E6);
#endif #endif