all repos — mgba @ 1325da2958200c0a91efdfa8fff22e20f0418bda

mGBA Game Boy Advance Emulator

PSP2: Update for newer vitasdk
Jeffrey Pfau jeffrey@endrift.com
Mon, 21 Sep 2015 00:01:24 -0700
commit

1325da2958200c0a91efdfa8fff22e20f0418bda

parent

a58458b9438354970adb306d79caa53735c90807

3 files changed, 12 insertions(+), 3 deletions(-)

jump to
M CMakeLists.txtCMakeLists.txt

@@ -194,7 +194,11 @@

include(CheckFunctionExists) check_function_exists(strdup HAVE_STRDUP) check_function_exists(strndup HAVE_STRNDUP) -check_function_exists(localtime_r HAVE_LOCALTIME_R) +if(NOT PSP2) + check_function_exists(localtime_r HAVE_LOCALTIME_R) +else() + set(HAVE_LOCALTIME_R OFF) +endif() if(NOT CMAKE_SYSTEM_NAME STREQUAL "Generic") check_function_exists(snprintf_l HAVE_SNPRINTF_L) if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
M src/platform/psp2/CMakeLists.txtsrc/platform/psp2/CMakeLists.txt

@@ -1,6 +1,7 @@

find_program(FIXUP vita-elf-create) find_program(OBJCOPY ${cross_prefix}objcopy) find_file(NIDDB db.json PATHS ${VITASDK}) +find_file(EXTRADB extra.json PATHS ${VITASDK}) find_program(STRIP ${cross_prefix}strip) file(GLOB OS_SRC ${CMAKE_SOURCE_DIR}/src/platform/psp2/psp2-*.c)

@@ -10,7 +11,7 @@

list(APPEND VFS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/sce-vfs.c) set(VFS_SRC ${VFS_SRC} PARENT_SCOPE) -set(OS_LIB -lvita2d -lSceCtrl_stub -lSceRtc_stub -lSceGxm_stub -lSceDisplay_stub -lSceAudio_stub -lSceMotion_stub -lScePower_stub -lSceTouch_stub -lpng -lz -l${M_LIBRARY}) +set(OS_LIB -lvita2d -lSceCtrl_stub -lSceRtc_stub -lSceGxm_stub -lSceDisplay_stub -lSceAudio_stub -lSceMotion_stub -lScePower_stub -lSceTouch_stub -lSceCommonDialog_stub -lpng -lz -l${M_LIBRARY}) set(OBJCOPY_CMD ${OBJCOPY} -I binary -O elf32-littlearm -B arm) list(APPEND GUI_SRC ${CMAKE_CURRENT_SOURCE_DIR}/gui-font.c)

@@ -30,7 +31,7 @@ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})

add_custom_target(${BINARY_NAME}.velf ALL ${STRIP} --strip-unneeded -go ${BINARY_NAME}-stripped.elf ${BINARY_NAME}.elf - COMMAND ${FIXUP} ${BINARY_NAME}-stripped.elf ${BINARY_NAME}.velf ${NIDDB} + COMMAND ${FIXUP} ${BINARY_NAME}-stripped.elf ${BINARY_NAME}.velf ${NIDDB} ${EXTRADB} DEPENDS ${BINARY_NAME}.elf) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${BINARY_NAME}.velf DESTINATION . COMPONENT ${BINARY_NAME}-psp2)
M src/util/formatting.csrc/util/formatting.c

@@ -83,7 +83,11 @@ localtime_s(date, t);

return date; #elif defined(PSP2) SceRtcTime sceRtc; + uint64_t tick, localtick; sceRtcSetTime_t(&sceRtc, *t); + sceRtcGetTick(&sceRtc, &tick); + sceRtcConvertUtcToLocalTime(&tick, &localtick); + sceRtcSetTick(&sceRtc, &localtick); date->tm_year = sceRtc.year; date->tm_mon = sceRtc.month; date->tm_mday = sceRtc.day;