Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update lib #220

Open
wants to merge 11 commits into
base: vita
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## Unreleased

## 0.9.0
* Changelog:

## 0.8.0
* Add new option for swapping O/X buttons (#168)
* Add new option for drawing FPS value (#167)
Expand Down
202 changes: 115 additions & 87 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,27 +1,40 @@
cmake_minimum_required(VERSION 2.8)

set(CMAKE_SYSTEM_NAME "Generic")
set(CMAKE_C_COMPILER "arm-vita-eabi-gcc")
set(CMAKE_CXX_COMPILER "arm-vita-eabi-g++")
if(NOT DEFINED CMAKE_TOOLCHAIN_FILE)
if(DEFINED ENV{DOLCESDK})
set(CMAKE_TOOLCHAIN_FILE "$ENV{DOLCESDK}/share/dolce.toolchain.cmake" CACHE PATH "toolchain file")
else()
message(FATAL_ERROR "Please define DOLCESDK to point to your SDK path!")
endif()
endif()

project(moonlight)
set(TITLE_ID "XYZZ00002")
set(TITLE "Moonlight")
set(VERSION_MAJOR "0")
set(VERSION_MINOR "8")
set(VERSION_PATCH "0")

execute_process(COMMAND
python -c "print('%02d.%02d' % (${VERSION_MAJOR}, ${VERSION_MINOR}))"
OUTPUT_VARIABLE APP_VER
)
string(REPLACE "\n" "" APP_VER "${APP_VER}")

add_definitions(-DVERSION_MAJOR=${VERSION_MAJOR})
add_definitions(-DVERSION_MINOR=${VERSION_MINOR})
add_definitions(-DVERSION_PATCH=${VERSION_PATCH})

set(CMAKE_C_FLAGS "-Wl,-q -O3 -g -std=c99 -Dntohs=__builtin_bswap16 -Dhtons=__builtin_bswap16 -Dntohl=__builtin_bswap32 -Dhtonl=__builtin_bswap32 -DENET_DEBUG=1")
include("${DOLCESDK}/share/dolce.cmake" REQUIRED)

dolce_gen_libs(SceIniFileProcessor_stubs
SceIniFileProcessor.yml
LIB SceIniFileProcessor_stub_weak)

dolce_gen_libs(ScePsp2Compat_stubs
ScePsp2Compat.yml
LIB ScePsp2Compat_stub_weak)

dolce_gen_libs(SceLibc_stubs
SceLibc.yml
LIB SceLibc_stub_weak)

set(VITA_APP_NAME "Moonlight")
set(VITA_TITLEID "GRVA00010")
set(VITA_VERSION "01.00")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-q -O3 -std=c99")

link_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SOURCE_DIR}/third_party/mdns
${CMAKE_SOURCE_DIR}/third_party/h264bitstream
${CMAKE_SOURCE_DIR}/third_party/libuuid
${CMAKE_SOURCE_DIR}/third_party/expat
)

include_directories(
include/
Expand All @@ -31,11 +44,10 @@ include_directories(
third_party/libuuid/src/
third_party/h264bitstream/
third_party/enet/include/
third_party/inih/
third_party/mdns/
)

add_executable(${PROJECT_NAME}.elf
add_executable(${PROJECT_NAME}
src/config.c
src/input/mapping.c
src/connection.c
Expand All @@ -50,37 +62,23 @@ add_executable(${PROJECT_NAME}.elf
src/audio/vita.c
src/video/vita.c
src/input/vita.c
src/input/keyboard.c
src/power/vita.c
src/graphics.c
src/font.c
src/gui/guilib.c
src/gui/ime.c
src/gui/ui.c
src/gui/ui_settings.c
src/gui/ui_connect.c
src/gui/ui_device.c
src/ini.c

libgamestream/client.c
libgamestream/http.c
libgamestream/mkcert.c
libgamestream/sps.c
libgamestream/xml.c

third_party/libuuid/src/clear.c
third_party/libuuid/src/compare.c
third_party/libuuid/src/copy.c
third_party/libuuid/src/gen_uuid.c
third_party/libuuid/src/isnull.c
third_party/libuuid/src/pack.c
third_party/libuuid/src/parse.c
third_party/libuuid/src/unpack.c
third_party/libuuid/src/unparse.c
third_party/libuuid/src/uuid_time.c

third_party/h264bitstream/h264_nal.c
third_party/h264bitstream/h264_sei.c
third_party/h264bitstream/h264_stream.c

third_party/moonlight-common-c/src/AudioStream.c
third_party/moonlight-common-c/src/ByteBuffer.c
third_party/moonlight-common-c/src/Connection.c
Expand Down Expand Up @@ -109,62 +107,92 @@ add_executable(${PROJECT_NAME}.elf
third_party/enet/peer.c
third_party/enet/protocol.c
third_party/enet/unix.c

third_party/inih/ini.c
)

target_link_libraries(${PROJECT_NAME}.elf
-lcrypto
-lexpat
-lcurl
-lz
-lssl
-lcrypto
-lopus

-lSceDisplay_stub
-lSceCtrl_stub
-lSceTouch_stub
-lSceNet_stub
-lSceSysmodule_stub
-lSceNetCtl_stub
-lScePower_stub
-lSceVideodec_stub
-lSceCommonDialog_stub
-lSceAppMgr_stub
-lSceAudio_stub
-lSceIme_stub

-lvita2d
-lSceGxm_stub
-lScePgf_stub
-lSceCommonDialog_stub
-lfreetype
-lpng
-ljpeg
-lz
-lm
-lc
target_link_libraries(${PROJECT_NAME}
crypto
opus

SceDisplay_stub
SceDisplayUser_stub
SceCtrl_stub
SceTouch_stub
SceNet_stub
SceSysmodule_stub
SceNetCtl_stub
ScePower_stub
SceVideodecUser_stub
SceVideodecLowDelayUser_stub
SceVideodecAsyncUser_stub
SceSysmodule_stub
SceAppMgr_stub
SceAudio_stub
SceIme_stub

SceGxm_stub
ScePgf_stub
ScePvf_stub
SceCommonDialog_stub
SceLibm_stub
SceDbg_stub
SceGxmInternalForVsh_stub
SceSharedFb_stub
SceKernelDmacMgr_stub
SceCodecengine_stub
SceAppMgr_stub
SceIme_stub
SceSystemgesture_stub
SceVshBridge_stub
SceHid_stub
SceIniFileProcessor_stub_weak
ScePsp2Compat_stub_weak
SceLibc_stub_weak
taihen_stub
vita2d_sys_stub
mdns_stub
uuid_stub
h264bitstream_stub
libexpat_stub
)

add_custom_target(${PROJECT_NAME}.velf ALL
COMMAND vita-elf-create ${PROJECT_NAME}.elf ${PROJECT_NAME}.velf
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/boot_param.bin
COMMAND dolce-make-bootparam attribute 0x02 ${CMAKE_CURRENT_BINARY_DIR}/boot_param.bin
)

add_custom_target(param.sfo ALL
COMMAND vita-mksfoex -s TITLE_ID=${TITLE_ID} -s APP_VER=${APP_VER} "${TITLE}" param.sfo
set (DOLCE_ELF_CREATE_FLAGS "${DOLCE_ELF_CREATE_FLAGS} -h 33554432")

dolce_create_self(eboot.bin ${PROJECT_NAME} UNSAFE BOOT_PARAM ${CMAKE_CURRENT_BINARY_DIR}/boot_param.bin)

add_executable(exit_module
module/source/main.c
)

add_custom_target(${PROJECT_NAME}.vpk ALL
COMMAND vita-make-fself -s -c ${PROJECT_NAME}.velf eboot.bin
COMMAND vita-pack-vpk -s param.sfo -b eboot.bin
--add ../sce_sys/icon0.png=sce_sys/icon0.png
--add ../sce_sys/livearea/contents/bg.png=sce_sys/livearea/contents/bg.png
--add ../sce_sys/livearea/contents/startup.png=sce_sys/livearea/contents/startup.png
--add ../sce_sys/livearea/contents/template.xml=sce_sys/livearea/contents/template.xml
--add ../assets/nerdfont.ttf=assets/nerdfont.ttf
${PROJECT_NAME}.vpk
target_compile_options(exit_module PRIVATE -std=gnu99)

target_link_libraries(exit_module
taihenForKernel_stub
taihenModuleUtils_stub
"-nostdlib"
)

add_dependencies(${PROJECT_NAME}.velf ${PROJECT_NAME}.elf)
add_dependencies(${PROJECT_NAME}.vpk ${PROJECT_NAME}.velf param.sfo)
dolce_create_self(exit_module.skprx exit_module CONFIG module/exit_module.yml UNSAFE)

set(DOLCE_MKSFOEX_FLAGS "${DOLCE_MKSFOEX_FLAGS} -d ATTRIBUTE=561160 -d ATTRIBUTE2=1 -s CATEGORY=gdc")

dolce_create_vpk(${PROJECT_NAME}.vpk ${VITA_TITLEID} eboot.bin
VERSION ${VITA_VERSION}
NAME ${VITA_APP_NAME}
CONTENT_ID_LABEL "MOONLIGHTVITA000"
FILE sce_sys/icon0.png sce_sys/icon0.png
FILE sce_sys/livearea/contents/bg.png sce_sys/livearea/contents/bg.png
FILE sce_sys/livearea/contents/startup.png sce_sys/livearea/contents/startup.png
FILE sce_sys/livearea/contents/template.xml sce_sys/livearea/contents/template.xml
FILE assets/nerdfont.ttf assets/nerdfont.ttf
FILE ${CMAKE_CURRENT_BINARY_DIR}/exit_module.skprx module/kernel/exit_module.skprx
FILE third_party/mdns/mdns.suprx module/user/mdns.suprx
FILE third_party/libuuid/uuid.suprx module/user/uuid.suprx
FILE third_party/h264bitstream/h264bitstream.suprx module/user/h264bitstream.suprx
FILE third_party/vita2d_sys/vita2d_sys.suprx module/user/vita2d_sys.suprx
FILE third_party/expat/libexpat.suprx module/user/libexpat.suprx
)
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Vita Moonlight
# Vita Moonlight HD

This is a vita port of Moonlight Embedded with support for 1280x720 and 1920x1080 resolutions.

Original port here: https://github.com/xyzz/vita-moonlight

This is a vita port of Moonlight Embedded.
Moonlight is an open source implementation of NVIDIA GameStream.

## Documentation
Expand Down
26 changes: 26 additions & 0 deletions SceIniFileProcessor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: 0x2
firmware: 3.60
modules:
SceIniFileProcessor:
nid: 0x8C611E4E
libraries:
SceIniFileProcessor:
nid: 0x5EE28724
kernel: false
functions:
sceIniFileProcessorCreateInstance: 0x0975D396
sceIniFileProcessorInitializeParam: 0x14146AF5
sceIniFileProcessorDestroyInstance: 0x2BEF7391
sceIniFileProcessorDestroyInstanceForError: 0x48A6BDCB
sceIniFileProcessorOpenFile: 0x51B791E8
sceIniFileProcessorAddKey: 0x703E1BAE
sceIniFileProcessorFindValueByKey: 0x7F22CED1
sceIniFileProcessorCreateContext: 0xA0F71A2C
sceIniFileProcessorCleanup: 0xA51840C7
sceIniFileProcessorDestroyContext: 0xACEB88BD
sceIniFileProcessorDeleteKey: 0xC2B3A41C
sceIniFileProcessorParse: 0xD5C7B3EE
sceIniFileProcessorGetKeyNum: 0xD7648B61
sceIniFileProcessorSetValueForKey: 0xDBC5F9A8
sceIniFileProcessorCloseFile: 0xEDFAD6B4
sceIniFileProcessorCreateFile: 0xFD8DE2F8
52 changes: 52 additions & 0 deletions SceLibc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
version: 2
firmware: 3.60
modules:
SceLibc:
nid: 0x43FBA801
libraries:
SceLibc:
kernel: false
nid: 0xBE43BB07
functions:
sceLibcMallocStats: 0x57A729DB
sceLibcMalloc: 0x775A0CB2
sceLibcFree: 0x5B9BB802
sceLibcCalloc: 0xE7EC3D0B
sceLibcRealloc: 0x006B54BA
sceLibcReallocalign: 0x608AC135
sceLibcMemalign: 0xA9363E6B
sceLibcFclose: 0xEC97321C
sceLibcFdopen: 0xB2F318FE
sceLibcFeof: 0xBF96AD71
sceLibcFerror: 0xB724BFC1
sceLibcFflush: 0x5AAD2996
sceLibcFgetc: 0x672C58E0
sceLibcFgetpos: 0x3CDA3118
sceLibcFgets: 0xBA14322F
sceLibcFgetwc: 0x89541CA5
sceLibcFgetws: 0x982AFA4D
sceLibcFileno: 0xFEC1502E
sceLibcFopen: 0xFFFBE239
sceLibcFopen_s: 0x1483DF76
sceLibcFprintf: 0xE0C79764
sceLibcFprintf_s: 0xE91E72D0
sceLibcFputc: 0x7E6A6108
sceLibcFputs: 0xC8FF13E5
sceLibcFputwc: 0xA597CDC8
sceLibcFputws: 0xB755927C
sceLibcFread: 0xB31C73A9
sceLibcFreopen: 0x715C4395
sceLibcFreopen_s: 0x438765C6
sceLibcFscanf: 0x505601C6
sceLibcFscanf_s: 0xB2B03159
sceLibcFseek: 0xC3A7CDE1
sceLibcFsetpos: 0xDC1BDBD7
sceLibcFtell: 0x41C2AF95
sceLibcFwide: 0xA77327D2
sceLibcFwprintf: 0xE52278E8
sceLibcFwprintf_s: 0xD920CD41
sceLibcFwrite: 0x8BCDCC4E
sceLibcFwscanf: 0x7BFC75C6
sceLibcFwscanf_s: 0x1E5C4E3D
sceLibcFgetc: 0x672C58E0
sceLibcUngetc: 0x2BCB3F01
24 changes: 24 additions & 0 deletions ScePsp2Compat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version: 0x2
firmware: 3.60
modules:
ScePsp2Compat:
nid: 0x1839D11E
libraries:
ScePsp2Compat:
nid: 0x81405F79
kernel: false
functions:
curl_easy_init: 0xAFCFB0DA
curl_easy_setopt: 0x30E7FB1B
curl_easy_perform: 0xDA3F145E
curl_easy_cleanup: 0xE58ABD18
curl_easy_strerror: 0xE086D703
curl_share_setopt: 0x8A84050C
curl_share_init: 0x79197AA2
curl_global_init: 0x92A0768D
curl_global_init_mem: 0x79151BD4
curl_global_cleanup: 0x84E081DF
curl_share_cleanup: 0x26AA8E8B
curl_easy_recv: 0xE63B3A56
curl_easy_send: 0x41837495
curl_easy_reset: 0xDA1C173A
Loading