PSP2: Fix psp2sdk build
Jeffrey Pfau jeffrey@endrift.com
Sat, 29 Aug 2015 15:32:44 -0700
4 files changed,
17 insertions(+),
1 deletions(-)
M
src/gba/hardware.c
→
src/gba/hardware.c
@@ -9,6 +9,10 @@ #include "gba/io.h"
#include "gba/serialize.h" #include "util/hash.h" +#ifdef PSP2 +#include <psp2/rtc.h> +#endif + const int GBA_LUX_LEVELS[10] = { 5, 11, 18, 27, 42, 62, 84, 109, 139, 183 }; static void _readPins(struct GBACartridgeHardware* hw);@@ -279,6 +283,16 @@ }
struct tm date; #ifdef _WIN32 localtime_s(&date, &t); +#elif defined(PSP2) + SceRtcTime sceRtc; + sceRtcSetTime_t(&sceRtc, t); + date.tm_year = sceRtc.year; + date.tm_mon = sceRtc.month; + date.tm_mday = sceRtc.day; + date.tm_hour = sceRtc.hour; + date.tm_min = sceRtc.minutes; + date.tm_sec = sceRtc.seconds; + date.tm_wday = sceRtcGetDayOfWeek(sceRtc.year, sceRtc.month, sceRtc.day); #else localtime_r(&t, &date); #endif
M
src/platform/psp2/CMakeLists.txt
→
src/platform/psp2/CMakeLists.txt
@@ -2,7 +2,7 @@ file(GLOB PLATFORM_SRC ${CMAKE_SOURCE_DIR}/src/platform/psp2/*.c)
execute_process(COMMAND ${OBJCOPY} -I binary -O elf32-littlearm -B arm font.png ${CMAKE_BINARY_DIR}/font.o WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/res) -set(PLATFORM_LIBRARY -lvita2d -lSceCtrl_stub -lSceRtc_stub -lSceGxm_stub -lSceDisplay_stub -lSceAudio_stub -lpng -lz -lm) +set(PLATFORM_LIBRARY -lvita2d -lSceCtrl_stub -lSceRtc_stub -lSceGxm_stub -lSceDisplay_stub -lSceAudio_stub -lpng -lz -l${M_LIBRARY}) add_executable(${BINARY_NAME}.elf ${PLATFORM_SRC} ${GUI_SRC} ${CMAKE_BINARY_DIR}/font.o) target_link_libraries(${BINARY_NAME}.elf ${BINARY_NAME} ${PLATFORM_LIBRARY})
M
src/platform/psp2/CMakeToolchain.psp2sdk
→
src/platform/psp2/CMakeToolchain.psp2sdk
@@ -49,5 +49,6 @@ set(OBJCOPY ${cross_prefix}objcopy)
set(PSP2 ON) add_definitions(-DPSP2) +set(M_LIBRARY m_stub) set(CMAKE_C_COMPILER_WORKS 1) # Skip test
M
src/platform/psp2/CMakeToolchain.vitasdk
→
src/platform/psp2/CMakeToolchain.vitasdk
@@ -35,3 +35,4 @@ set(NIDDB ${VITASDK}/db.json)
set(PSP2 ON) add_definitions(-DPSP2) +set(M_LIBRARY m)