Skip to content
Closed
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
46 changes: 46 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,49 @@ jobs:
build/ps2xAnalyzer/Release/*.exe
build/ps2xRecomp/Release/*.exe
build/ps2xTest/Release/*.exe

linux-gcc-clang:
strategy:
fail-fast: false
matrix:
include:
- compiler: gcc
cc: gcc
cxx: g++
- compiler: clang
cc: clang
cxx: clang++

name: linux-${{ matrix.compiler }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
submodules: recursive

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
cmake \
ninja-build \
clang \
pkg-config \
libx11-dev \
libxrandr-dev \
libxinerama-dev \
libxcursor-dev \
libxi-dev \
libgl1-mesa-dev

- name: Configure
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
run: |
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release

- name: Build
run: |
cmake --build build --config Release
12 changes: 11 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
out
.vscode
build
build*/
cmake-build-*/

*.exe
*.ilk
Expand All @@ -12,8 +14,16 @@ build
*.tlog
*.ipch

# CMake/Ninja (in-source builds)
CMakeFiles/
CMakeCache.txt
cmake_install.cmake
compile_commands.json
*.ninja
.ninja_*

# Now we can place the dump code here and test while expand the Runtime
ps2xRuntime/include/ps2_recompiled_functions.h
ps2xRuntime/include/ps2_recompiled_stubs.h
ps2xRuntime/src/runner/ps2_recompiled_functions.cpp
ps2xRuntime/src/runner/register_functions.cpp
ps2xRuntime/src/runner/register_functions.cpp
3 changes: 2 additions & 1 deletion ps2xAnalyzer/include/ps2recomp/elf_analyzer.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <vector>
#include <unordered_set>
#include <unordered_map>
#include <cstdint>
#include <memory>
#include <map>
#include <set>
Expand Down Expand Up @@ -89,4 +90,4 @@ namespace ps2recomp
};
}

#endif // PS2RECOMP_ELF_ANALYZER_H
#endif // PS2RECOMP_ELF_ANALYZER_H
7 changes: 0 additions & 7 deletions ps2xRecomp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,6 @@ FetchContent_Declare(
GIT_SHALLOW TRUE
)

FetchContent_Declare(
libdwarf
GIT_REPOSITORY https://github.com/davea42/libdwarf-code.git
GIT_TAG v2.2.0
GIT_SHALLOW TRUE
)

set(BUILD_DWARFDUMP OFF CACHE BOOL "" FORCE)
set(BUILD_DWARFEXAMPLE OFF CACHE BOOL "" FORCE)
set(BUILD_DWARFGEN OFF CACHE BOOL "" FORCE)
Expand Down
1 change: 1 addition & 0 deletions ps2xRecomp/include/ps2recomp/code_generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <cstdint>

namespace ps2recomp
{
Expand Down
3 changes: 2 additions & 1 deletion ps2xRecomp/include/ps2recomp/elf_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define PS2RECOMP_ELF_PARSER_H

#include <elfio/elfio.hpp>
#include <cstdint>
#include <string>
#include <vector>
#include <memory>
Expand Down Expand Up @@ -55,4 +56,4 @@ namespace ps2recomp

} // namespace ps2recomp

#endif // PS2RECOMP_ELF_PARSER_H
#endif // PS2RECOMP_ELF_PARSER_H
1 change: 1 addition & 0 deletions ps2xRecomp/include/ps2recomp/ps2_recompiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include "code_generator.h"
#include "config_manager.h"
#include <cstdint>
#include <string>
#include <vector>
#include <unordered_map>
Expand Down
4 changes: 4 additions & 0 deletions ps2xRuntime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ target_include_directories(ps2_runtime PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include
)

if (CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU")
target_compile_options(ps2_runtime PUBLIC -msse4.1)
endif()

target_link_libraries(ps2_runtime PRIVATE raylib)
target_link_libraries(ps2EntryRunner
PRIVATE
Expand Down
4 changes: 1 addition & 3 deletions ps2xRuntime/include/ps2_syscalls.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@

#include "ps2_runtime.h"
#include "ps2_call_list.h"
#include <mutex>
#include <atomic>
#include <cstdint>

// Number of active host threads spawned for PS2 thread emulation
extern std::atomic<int> g_activeThreads;

static std::mutex g_sys_fd_mutex;

#define PS2_FIO_O_RDONLY 0x0001
#define PS2_FIO_O_WRONLY 0x0002
#define PS2_FIO_O_RDWR 0x0003
Expand Down
5 changes: 3 additions & 2 deletions ps2xRuntime/src/lib/ps2_syscalls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
#include "ps2_runtime.h"
#include "ps2_runtime_macros.h"
#include "ps2_stubs.h"
#include <cerrno>
#include <iostream>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <unordered_map>
#include <mutex>
#include <thread>
#include <condition_variable>
#include <atomic>
Expand All @@ -22,6 +24,7 @@

std::unordered_map<int, FILE *> g_fileDescriptors;
int g_nextFd = 3; // Start after stdin, stdout, stderr
static std::mutex g_sys_fd_mutex;

struct ThreadInfo
{
Expand Down Expand Up @@ -130,8 +133,6 @@ std::string translatePs2Path(const char *ps2Path)
return "";
}

#include "ps2_syscalls.h"

namespace ps2_syscalls
{

Expand Down
Loading