Skip to content

Commit

Permalink
Merge branch 'features' of https://github.com/SysRay/psOff_public int…
Browse files Browse the repository at this point in the history
…o ime
  • Loading branch information
igor725 committed Jun 17, 2024
2 parents e6ed43b + f50bbee commit 08123cc
Show file tree
Hide file tree
Showing 569 changed files with 9,312 additions and 2,809 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ jobs:

- name: Configure
run: |
$env:PATH = ($env:PATH -split ';' | Where-Object { $_ -ne 'C:\Program Files\LLVM\bin' }) -join ';'
echo "::add-matcher::tools/matchers/cmake.json"
cmake.exe -S. -B_build/_Release -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=_build/_Install -DCMAKE_C_COMPILER=clang-cl.exe -DCMAKE_CXX_COMPILER=clang-cl.exe -DTEST_BENCH=ON -DISACTION=1
Expand All @@ -117,6 +118,5 @@ jobs:
name: psOff-emu
path: |
_build/_Install/*
!_build/_Install/debug/*
!_build/_Install/vulkan-1.dll
!_build/_Install/*_test.exe
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ _*/
!.vscode
!.github
.vscode/c_cpp_properties.json
core/private
20 changes: 18 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,31 @@
"request": "launch",
"program": "${workspaceRoot}/_build/_Install/psoff.exe",
"args": [
"--d",
// "--d",
// "--vkValidation",
"${config:psoff.add-arg}",
"--file=${config:psoff.game-path}/eboot.bin",
"--file=${config:psoff.game-path}/eboot.bin"
],
"stopAtEntry": false,
"cwd": "${workspaceRoot}/_build/_Install",
"environment": [],
"console": "integratedTerminal",
"symbolSearchPath": "${workspaceRoot}/_build/_Install/debug"
},
{
"name": "(Windows) Attach",
"type": "cppvsdbg",
"request": "attach",
"processId": "${command:pickProcess}"
}
],
"compounds": [
{
"name": "Launch + Attach",
"configurations": [
"(Windows) Launch",
"(Windows) Attach"
]
}
]
}
7 changes: 4 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,27 @@
"-fexceptions"
],
"ccls.index.threads": 0,

"cmake.parallelJobs": 0,
"cmake.generator": "Ninja",
"cmake.sourceDirectory": "${workspaceFolder}",
"cmake.buildDirectory": "${workspaceFolder}/_build/_Release",
"cmake.configureArgs": [
"-DISDEBUG=1"
],
"cmake.configureSettings": {
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_INSTALL_PREFIX": "${workspaceFolder}/_build/_Install",
"CMAKE_C_COMPILER": "clang-cl.exe",
"CMAKE_CXX_COMPILER": "clang-cl.exe"
},

"C_Cpp.formatting": "clangFormat",
"C_Cpp.clang_format_style": "file:${workspaceRoot}/.clang-format",
"C_Cpp.clang_format_fallbackStyle": "LLVM",
"C_Cpp.clang_format_path": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\Llvm\\x64\\bin\\clang-format.exe",
"C_Cpp.default.compilerPath": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\Llvm\\bin\\clang-cl.exe",
"C_Cpp.default.intelliSenseMode": "windows-clang-x64",
"C_Cpp.default.cppStandard": "c++20",
"C_Cpp.autoAddFileAssociations": false,

"editor.tabSize": 2,
"editor.insertSpaces": true,
}
1 change: 1 addition & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"-S${workspaceFolder}",
"-B_build/_Release",
"-GNinja",
//"-DBUILD_CORE=1",
"-DCMAKE_BUILD_TYPE=Release",
"-DCMAKE_INSTALL_PREFIX=_build/_Install",
"-DCMAKE_C_COMPILER=clang-cl.exe",
Expand Down
126 changes: 106 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,34 @@
cmake_minimum_required(VERSION 3.24)
include(ExternalProject)

set(PSOFF_LIB_VERSION v.0.1)
set(PSOFF_RENDER_VERSION v.0.5-nightly_29.04.24-fix)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS OFF)
set(CMAKE_WINDOWS_SYMBOL_VISIBILITY_IN_STATIC_LIBRARIES OFF)

set(CMAKE_C_VISIBILITY_PRESET hidden)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)

set(PSOFF_LIB_VERSION v.0.4)
set(PSOFF_RENDER_VERSION v.0.6-nightly_08.06.2024)

set(ProjectName psOff_${CMAKE_BUILD_TYPE})
set(ProjectName psOffChild_${CMAKE_BUILD_TYPE})
project(${ProjectName} VERSION 0.0.1)

unset(CMAKE_IMPORT_LIBRARY_SUFFIX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_FLAGS_RELEASE "/MD /Zi /GS- /GF /Gy /GR /Oi -Ofast -fno-strict-aliasing")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DEBUG /OPT:REF,ICF")
set(CMAKE_INSTALL_MESSAGE LAZY)

set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
set(CMAKE_WINDOWS_SYMBOL_VISIBILITY_IN_STATIC_LIBRARIES OFF)
set(CMAKE_CXX_FLAGS_RELEASE "/MD /GS- /GF /Gy /GR /Oi -fno-strict-aliasing -Wno-unused-command-line-argument")

if(ISDEBUG)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi -O0")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DEBUG /OPT:REF,ICF")
else()
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Ofast")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /OPT:REF,ICF")
endif()

if(NOT PRJ_SRC_DIR)
set(PRJ_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR})
Expand All @@ -37,6 +49,7 @@ message("Vulkan Path: ${VulkanPath}")
# # - Gather Infos
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/lib) # Move all libs here post-build, except third_party
add_definitions(-DPSOFF_RENDER_VERSION="${PSOFF_RENDER_VERSION}")
add_compile_definitions(BOOST_ALL_NO_LIB)

#
include_directories(BEFORE
Expand All @@ -53,10 +66,10 @@ include_directories(BEFORE
link_directories(BEFORE
${CMAKE_INSTALL_PREFIX}/development/lib
${CMAKE_BINARY_DIR}/third_party/src/third_party/lib
${CMAKE_BINARY_DIR}/core
${CMAKE_BINARY_DIR}/lib
${CMAKE_BINARY_DIR}/bin
${CMAKE_BINARY_DIR}/psoff_render/src/psoff_render/lib
${CMAKE_BINARY_DIR}/core/export/lib
)

ExternalProject_Add(third_party
Expand Down Expand Up @@ -89,8 +102,10 @@ endif()
add_subdirectory(tools/logging)
add_subdirectory(tools/config_emu)
add_subdirectory(tools/dll2Nids)
add_subdirectory(asm)

add_subdirectory(mainprocess)

add_subdirectory(eventsystem)
add_dependencies(dll2Nids third_party)

# -
Expand All @@ -101,28 +116,97 @@ add_compile_definitions(IMAGE_BASE=${IMAGE_BASE})

# Internal Projects
add_subdirectory(modules)
add_subdirectory(core)
add_subdirectory(utility)
add_subdirectory(tools/gamereport)
add_subdirectory(core)

# #- Projects

# Executable
add_executable(psoff
# ## Core

# Build
add_library(core SHARED
$<TARGET_OBJECTS:kernel>
$<TARGET_OBJECTS:initParams>
$<TARGET_OBJECTS:timer>
$<TARGET_OBJECTS:systemContent>
$<TARGET_OBJECTS:networking>
$<TARGET_OBJECTS:hotkeys>
$<TARGET_OBJECTS:trophies>
$<TARGET_OBJECTS:oscctl>
$<TARGET_OBJECTS:videoout>
$<TARGET_OBJECTS:fileManager>
$<TARGET_OBJECTS:memory>
$<TARGET_OBJECTS:dmem>
$<TARGET_OBJECTS:unwinding>
$<TARGET_OBJECTS:runtime>
)

add_dependencies(core logging third_party config_emu psoff_render)
target_link_libraries(core PRIVATE
eventsystem
libboost_url
libboost_thread
libboost_chrono
libboost_program_options
libboost_filesystem
sdl2
psoff_render.lib
OptickCore
psOff_utility
config_emu.lib
onecore.lib
IPHLPAPI.lib
Dbghelp.lib
wepoll.lib
Ws2_32.lib
libcrypto.lib
libssl.lib
pugixml.lib
ntdll.dll
imgui
VulkanMemoryAllocator
${Vulkan_LIBRARIES}
)

install(FILES $<TARGET_PDB_FILE:core> DESTINATION debug OPTIONAL)
install(TARGETS core LIBRARY DESTINATION .)

# Manage symbols
if(NOT ISDEBUG)
add_custom_command(
TARGET core POST_BUILD
COMMAND $<$<CONFIG:release>:${CMAKE_STRIP}>
ARGS --strip-all $<TARGET_FILE:core>
)
endif()

set_target_properties(core
PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/core/export/lib"
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/core/export/bin"
PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/"
)

# ## Executable
add_executable(psOffChild
main.cpp
)

add_dependencies(psoff logging core psOff_utility)
add_dependencies(psOffChild logging core eventsystem psOff_utility gamereport)

target_link_libraries(psoff PRIVATE
target_link_libraries(psOffChild PRIVATE
eventsystem
core.lib
gamereport.lib
psOff_utility
libboost_filesystem
$<TARGET_OBJECTS:asmHelper>
)

target_link_options(psoff PUBLIC /DEBUG /DYNAMICBASE:NO --image-base=${IMAGE_BASE})
target_link_options(psOffChild PUBLIC /DYNAMICBASE:NO /DEBUG --image-base=${IMAGE_BASE})

set_property(TARGET psoff PROPERTY VS_DPI_AWARE "PerMonitor") # SDL2 High dpi window
set_property(TARGET psOffChild PROPERTY VS_DPI_AWARE "PerMonitor") # SDL2 High dpi window

# # Install
install(DIRECTORY "${CMAKE_BINARY_DIR}/third_party/src/third_party/bin/" DESTINATION ${CMAKE_INSTALL_PREFIX}
Expand All @@ -145,21 +229,23 @@ if(DEFINED ISACTION)
file(GENERATE OUTPUT ${CMAKE_BINARY_DIR}/bin/vulkan-1.dll CONTENT "") # cmake needs to find the file in order to ignore it
endif()

install(TARGETS psoff
COMPONENT psoff
install(TARGETS psOffChild
COMPONENT psOffChild
RUNTIME_DEPENDENCIES
PRE_EXCLUDE_REGEXES "api-ms-" "ext-ms-"
POST_EXCLUDE_REGEXES ".*system32/.*\\.dll" ".*vulkan-1\\.dll"

DIRECTORIES
$<TARGET_FILE_DIR:psoff>
$<TARGET_FILE_DIR:psOffChild>
${CMAKE_BINARY_DIR}/third_party/src/third_party/bin
${CMAKE_BINARY_DIR}/third_party/src/third_party/lib
${CMAKE_BINARY_DIR}/eventsystem/lib
${CMAKE_BINARY_DIR}/bin
${CMAKE_BINARY_DIR}/lib
${CMAKE_CURRENT_BINARY_DIR}/core
${CMAKE_BINARY_DIR}/psoff_render/src/psoff_render/lib
${CMAKE_BINARY_DIR}/core/export/lib
DESTINATION .
)

install(FILES $<TARGET_PDB_FILE:psoff> DESTINATION ${CMAKE_INSTALL_PREFIX}/debug OPTIONAL)
install(FILES $<TARGET_PDB_FILE:psOffChild> DESTINATION ${CMAKE_INSTALL_PREFIX}/debug OPTIONAL)
28 changes: 0 additions & 28 deletions asm/entry.asm

This file was deleted.

6 changes: 0 additions & 6 deletions asm/helper.h

This file was deleted.

51 changes: 0 additions & 51 deletions core/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,61 +1,10 @@
# Place before add_subdir -> define for all childs
add_compile_definitions(
BOOST_ALL_NO_LIB
)

# Add directories
add_subdirectory(kernel)
add_subdirectory(videoout)
add_subdirectory(initParams)
add_subdirectory(timer)
add_subdirectory(systemContent)
add_subdirectory(networking)
add_subdirectory(fileManager)
add_subdirectory(memory)
add_subdirectory(dmem)
add_subdirectory(unwinding)
add_subdirectory(runtime)

# Build
add_library(core SHARED
$<TARGET_OBJECTS:kernel>
$<TARGET_OBJECTS:initParams>
$<TARGET_OBJECTS:timer>
$<TARGET_OBJECTS:systemContent>
$<TARGET_OBJECTS:networking>
$<TARGET_OBJECTS:videoout>
$<TARGET_OBJECTS:fileManager>
$<TARGET_OBJECTS:memory>
$<TARGET_OBJECTS:dmem>
$<TARGET_OBJECTS:unwinding>
$<TARGET_OBJECTS:runtime>
)

add_dependencies(core logging third_party config_emu gamereport psoff_render)
target_link_libraries(core PRIVATE
libboost_url
libboost_thread
libboost_chrono
libboost_program_options
sdl2
psoff_render.lib
gamereport.lib
OptickCore
psOff_utility
config_emu.lib
onecore.lib
IPHLPAPI.lib
wepoll.lib
Ws2_32.lib
ntdll.dll
VulkanMemoryAllocator
${Vulkan_LIBRARIES}
)

ADD_CUSTOM_COMMAND(TARGET core POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_BINARY_DIR}/core.lib
${CMAKE_BINARY_DIR}/lib)

install(FILES $<TARGET_PDB_FILE:core> DESTINATION debug OPTIONAL)
install(TARGETS core LIBRARY DESTINATION .)
Loading

0 comments on commit 08123cc

Please sign in to comment.