From df695802dd6c105936d32c0e7ae5951d19a4d198 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Sun, 24 Jul 2016 13:40:45 -0700 Subject: [PATCH] PSP2: Initial changes for VPK packaging --- src/platform/psp2/CMakeLists.txt | 23 +++++++++++++++++++---- src/platform/psp2/main.c | 2 +- src/platform/psp2/threading.h | 2 +- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/platform/psp2/CMakeLists.txt b/src/platform/psp2/CMakeLists.txt index b374b61a3..23f24fbf0 100644 --- a/src/platform/psp2/CMakeLists.txt +++ b/src/platform/psp2/CMakeLists.txt @@ -1,20 +1,21 @@ find_program(FIXUP vita-elf-create) +find_program(MAKE_FSELF vita-make-fself) +find_program(MAKE_SFO vita-mksfoex) find_program(OBJCOPY ${cross_prefix}objcopy) find_file(NIDDB db.json PATHS ${VITASDK} ${VITASDK}/bin ${VITASDK}/share) -find_file(EXTRADB extra.json PATHS ${VITASDK}${VITASDK}/bin ${VITASDK}/share) find_program(STRIP ${cross_prefix}strip) set(OS_DEFINES IOAPI_NO_64) set(OS_DEFINES ${OS_DEFINES} PARENT_SCOPE) -file(GLOB OS_SRC ${CMAKE_SOURCE_DIR}/src/platform/psp2/psp2-*.c) +file(GLOB OS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/psp2-*.c) set(OS_SRC ${OS_SRC} PARENT_SCOPE) source_group("PS Vita-specific code" FILES ${OS_SRC}) list(APPEND CORE_VFS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/sce-vfs.c) set(CORE_VFS_SRC ${CORE_VFS_SRC} PARENT_SCOPE) -set(OS_LIB -lvita2d -lSceCtrl_stub -lSceGxm_stub -lSceDisplay_stub -lSceAudio_stub -lSceMotion_stub -lScePower_stub -lSceTouch_stub -lSceCommonDialog_stub -l${M_LIBRARY}) +set(OS_LIB -lvita2d -lSceCtrl_stub -lSceGxm_stub -lSceDisplay_stub -lSceAudio_stub -lSceCommonDialog_stub -lSceMotion_stub -lScePower_stub -lSceSysmodule_stub -lSceTouch_stub -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) @@ -44,7 +45,21 @@ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/backdrop.o 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} ${EXTRADB} + COMMAND ${FIXUP} ${BINARY_NAME}-stripped.elf ${BINARY_NAME}.velf ${NIDDB} DEPENDS ${BINARY_NAME}.elf) +add_custom_target(sce_sys ${CMAKE_COMMAND} -E make_directory sce_sys) + +add_custom_target(param.sfo + ${MAKE_SFO} ${PROJECT_NAME} -s TITLE_ID=MGBA4VITA sce_sys/param.sfo + DEPENDS sce_sys) + +add_custom_target(eboot.bin + ${MAKE_FSELF} ${BINARY_NAME}.velf eboot.bin + DEPENDS ${BINARY_NAME}.velf) + +add_custom_target(${BINARY_NAME}.vpk ALL + zip -r ${BINARY_NAME}.vpk sce_sys eboot.bin + DEPENDS eboot.bin head.bin param.sfo) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${BINARY_NAME}.velf DESTINATION . COMPONENT ${BINARY_NAME}-psp2) diff --git a/src/platform/psp2/main.c b/src/platform/psp2/main.c index 5855ce041..cf5096220 100644 --- a/src/platform/psp2/main.c +++ b/src/platform/psp2/main.c @@ -98,7 +98,7 @@ int main() { struct mGUIRunner runner = { .params = { PSP2_HORIZONTAL_PIXELS, PSP2_VERTICAL_PIXELS, - font, "cache0:", _drawStart, _drawEnd, + font, "ux0:", _drawStart, _drawEnd, _pollInput, _pollCursor, _batteryState, 0, 0, diff --git a/src/platform/psp2/threading.h b/src/platform/psp2/threading.h index 9babe0aae..54fdcb243 100644 --- a/src/platform/psp2/threading.h +++ b/src/platform/psp2/threading.h @@ -120,7 +120,7 @@ static inline int _sceThreadEntry(SceSize args, void* argp) { } static inline int ThreadCreate(Thread* thread, ThreadEntry entry, void* context) { - Thread id = sceKernelCreateThread("SceThread", _sceThreadEntry, 0x40, 0x10000, 0, 0x70000, 0); + Thread id = sceKernelCreateThread("SceThread", _sceThreadEntry, 0x10000100, 0x10000, 0, 0, 0); if (id < 0) { *thread = 0; return id;