Skip to content

Commit

Permalink
Merge branch 'master' into fastmem2
Browse files Browse the repository at this point in the history
  • Loading branch information
wheremyfoodat committed Dec 9, 2024
2 parents a59f98a + cbf1e41 commit 3fbcea0
Show file tree
Hide file tree
Showing 39 changed files with 4,555 additions and 230 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/Hydra_Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
vulkan-components: Vulkan-Headers, Vulkan-Loader, SPIRV-Tools, Glslang

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DENABLE_USER_BUILD=ON -DBUILD_HYDRA_CORE=ON
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DENABLE_USER_BUILD=ON -DBUILD_HYDRA_CORE=ON -DCMAKE_OSX_ARCHITECTURE=x86_64

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
Expand All @@ -84,7 +84,7 @@ jobs:
- name: Configure CMake (Again)
run: |
rm -rf ${{github.workspace}}/build
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DENABLE_USER_BUILD=ON -DBUILD_LIBRETRO_CORE=ON
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DENABLE_USER_BUILD=ON -DBUILD_LIBRETRO_CORE=ON -DCMAKE_OSX_ARCHITECTURE=x86_64
- name: Build (Again)
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} && ls -R ${{github.workspace}}/build
Expand Down
52 changes: 44 additions & 8 deletions .github/workflows/MacOS_Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ env:

jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
strategy:
matrix:
arch: [x86_64, arm64]

name: MacOS-${{ matrix.arch }}
runs-on: macos-13

steps:
Expand All @@ -33,7 +34,7 @@ jobs:
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DENABLE_USER_BUILD=ON
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DENABLE_USER_BUILD=ON -DCMAKE_OSX_ARCHITECTURES=${{ matrix.arch }}

- name: Build
# Build your program with the given configuration
Expand All @@ -49,10 +50,45 @@ jobs:
run: codesign --force -s - -vvvv Alber.app

- name: Zip it up
run: zip -r Alber Alber.app
run: zip -r Alber-${{ matrix.arch }} Alber.app

- name: Upload MacOS App
uses: actions/upload-artifact@v4
with:
name: MacOS Alber App Bundle
path: 'Alber.zip'
name: MacOS Alber App Bundle (${{ matrix.arch }})
path: Alber-${{ matrix.arch }}.zip

MacOS-Universal:
name: MacOS-Universal
needs: [build]
runs-on: macos-13

steps:
- name: Download x86_64
uses: actions/download-artifact@v4
with:
name: MacOS Alber App Bundle (x86_64)
path: x86_64
- name: Download ARM64
uses: actions/download-artifact@v4
with:
name: MacOS Alber App Bundle (arm64)
path: arm64
- name: Combine app bundles
shell: bash
run: |
set -x
unzip x86_64/*.zip -d x86_64
unzip arm64/*.zip -d arm64
lipo {x86_64,arm64}/Alber.app/Contents/MacOS/Alber -create -output Alber
cp -v -a arm64/Alber.app Alber.app
cp -v Alber Alber.app/Contents/MacOS/Alber
# Mix in x86_64 files that do not appear in the ARM64 build (e.g. libvulkan)
cp -v -R -n x86_64/Alber.app/* Alber.app/ || true
codesign --force -s - -vvvv Alber.app
zip -r -y Alber-universal.zip Alber.app
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: MacOS Alber App Bundle (universal)
path: Alber-universal.zip
60 changes: 53 additions & 7 deletions .github/workflows/Qt_Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ jobs:
path: upload

MacOS:
strategy:
matrix:
arch: [x86_64, arm64]

name: MacOS-${{ matrix.arch }}
runs-on: macos-13

steps:
Expand All @@ -69,11 +74,17 @@ jobs:
run: |
brew install dylibbundler imagemagick
- name: Install qt
run: brew install qt && which macdeployqt
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
aqtversion: '==3.1.*'
version: '6.8.1'
host: 'mac'
target: 'desktop'
arch: 'clang_64'

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DENABLE_USER_BUILD=ON -DENABLE_QT_GUI=ON
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DENABLE_USER_BUILD=ON -DENABLE_QT_GUI=ON -DCMAKE_OSX_ARCHITECTURES=${{ matrix.arch }}

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
Expand All @@ -87,13 +98,48 @@ jobs:
run: codesign --force -s - -vvvv Alber.app

- name: Zip it up
run: zip -r Alber Alber.app
run: zip -r Alber-${{ matrix.arch }} Alber.app

- name: Upload MacOS App
uses: actions/upload-artifact@v4
with:
name: MacOS Alber App Bundle
path: 'Alber.zip'
name: MacOS Alber App Bundle (${{ matrix.arch }})
path: Alber-${{ matrix.arch }}.zip

MacOS-Universal:
name: MacOS-Universal
needs: [MacOS]
runs-on: macos-13

steps:
- name: Download x86_64
uses: actions/download-artifact@v4
with:
name: MacOS Alber App Bundle (x86_64)
path: x86_64
- name: Download ARM64
uses: actions/download-artifact@v4
with:
name: MacOS Alber App Bundle (arm64)
path: arm64
- name: Combine app bundles
shell: bash
run: |
set -x
unzip x86_64/*.zip -d x86_64
unzip arm64/*.zip -d arm64
lipo {x86_64,arm64}/Alber.app/Contents/MacOS/Alber -create -output Alber
cp -v -a arm64/Alber.app Alber.app
cp -v Alber Alber.app/Contents/MacOS/Alber
# Mix in x86_64 files that do not appear in the ARM64 build (e.g. libvulkan)
cp -v -R -n x86_64/Alber.app/* Alber.app/ || true
codesign --force -s - -vvvv Alber.app
zip -r -y Alber-universal.zip Alber.app
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: MacOS Alber App Bundle (universal)
path: Alber-universal.zip

Linux:
runs-on: ubuntu-24.04
Expand All @@ -107,7 +153,7 @@ jobs:
run: |
sudo apt-get update && sudo apt install libx11-dev libgl1 libglx-mesa0 mesa-common-dev libfuse2 libwayland-dev libgl1-mesa-dev
sudo apt update
sudo apt install qt6-base-dev qt6-base-private-dev
sudo apt install qt6-base-dev qt6-base-private-dev qt6-tools-dev
- name: Install newer Clang
run: |
Expand Down
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@
[submodule "third_party/zep"]
path = third_party/zep
url = https://github.com/Panda3DS-emu/zep
[submodule "third_party/oaknut"]
path = third_party/oaknut
url = https://github.com/merryhime/oaknut
[submodule "third_party/luv"]
path = third_party/luv
url = https://github.com/luvit/luv
Expand Down Expand Up @@ -85,3 +82,6 @@
[submodule "third_party/cryptoppwin"]
path = third_party/cryptoppwin
url = https://github.com/shadps4-emu/ext-cryptoppwin
[submodule "third_party/oaknut"]
path = third_party/oaknut
url = https://github.com/panda3ds-emu/oaknut
69 changes: 56 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -219,26 +219,51 @@ if(ENABLE_LUAJIT)
target_link_libraries(AlberCore PRIVATE libluajit)
endif()

# Check for x64
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "AMD64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "x86-64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
# Detect target architecture
if (NOT APPLE OR "${CMAKE_OSX_ARCHITECTURES}" STREQUAL "")
# Normal target detection
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "AMD64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "x86-64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
set(HOST_X64 TRUE)
else()
set(HOST_X64 FALSE)
endif()

if (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64")
set(HOST_ARM64 TRUE)
else()
set(HOST_ARM64 FALSE)
endif()
else()
# Apple target detection
if("x86_64" IN_LIST CMAKE_OSX_ARCHITECTURES)
set(HOST_X64 TRUE)
else()
set(HOST_X64 FALSE)
endif()

if("arm64" IN_LIST CMAKE_OSX_ARCHITECTURES)
set(HOST_ARM64 TRUE)
else()
set(HOST_ARM64 FALSE)
endif()

if (HOST_ARM64 AND HOST_X64)
message(FATAL_ERROR "Universal builds not supported like this! Please compile separately and stitch together")
endif()
endif()

if (HOST_X64)
add_subdirectory(third_party/xbyak) # Add xbyak submodule for x86 JITs
include_directories(third_party/xbyak)
add_compile_definitions(PANDA3DS_DYNAPICA_SUPPORTED)
add_compile_definitions(PANDA3DS_X64_HOST)
else()
set(HOST_X64 FALSE)
endif()

# Check for arm64
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64")
set(HOST_ARM64 TRUE)
if (HOST_ARM64)
add_subdirectory(third_party/oaknut) # Add Oaknut submodule for arm64 JITs
include_directories(third_party/oaknut/include)
add_compile_definitions(PANDA3DS_DYNAPICA_SUPPORTED)
add_compile_definitions(PANDA3DS_ARM64_HOST)
else()
set(HOST_ARM64 FALSE)
endif()

# Enable SSE4.1 if it's not explicitly disabled
Expand Down Expand Up @@ -315,6 +340,7 @@ set(LOADER_SOURCE_FILES src/core/loader/elf.cpp src/core/loader/ncsd.cpp src/cor
set(FS_SOURCE_FILES src/core/fs/archive_self_ncch.cpp src/core/fs/archive_save_data.cpp src/core/fs/archive_sdmc.cpp
src/core/fs/archive_ext_save_data.cpp src/core/fs/archive_ncch.cpp src/core/fs/romfs.cpp
src/core/fs/ivfc.cpp src/core/fs/archive_user_save_data.cpp src/core/fs/archive_system_save_data.cpp
src/core/fs/archive_twl_photo.cpp src/core/fs/archive_twl_sound.cpp src/core/fs/archive_card_spi.cpp
)

set(APPLET_SOURCE_FILES src/core/applets/applet.cpp src/core/applets/mii_selector.cpp src/core/applets/software_keyboard.cpp src/core/applets/applet_manager.cpp
Expand Down Expand Up @@ -364,8 +390,8 @@ set(HEADER_FILES include/emulator.hpp include/helpers.hpp include/termcolor.hpp
include/PICA/pica_vert_config.hpp include/sdl_sensors.hpp include/PICA/draw_acceleration.hpp include/renderdoc.hpp
include/align.hpp include/audio/aac_decoder.hpp include/PICA/pica_simd.hpp include/services/fonts.hpp
include/audio/audio_interpolation.hpp include/audio/hle_mixer.hpp include/audio/dsp_simd.hpp
include/enum_flag_ops.hpp include/services/dsp_firmware_db.hpp include/frontend_settings.hpp
include/dynamic_library.hpp
include/services/dsp_firmware_db.hpp include/frontend_settings.hpp include/fs/archive_twl_photo.hpp
include/fs/archive_twl_sound.hpp include/fs/archive_card_spi.hpp include/enum_flag_ops.hpp include/dynamic_library.hpp
)

cmrc_add_resource_library(
Expand Down Expand Up @@ -647,7 +673,7 @@ if(NOT BUILD_HYDRA_CORE AND NOT BUILD_LIBRETRO_CORE)
add_executable(Alber)

if(ENABLE_QT_GUI)
find_package(Qt6 REQUIRED COMPONENTS Widgets)
find_package(Qt6 REQUIRED COMPONENTS Widgets LinguistTools)
if(NOT ENABLE_OPENGL)
message(FATAL_ERROR "Qt frontend requires OpenGL")
endif()
Expand All @@ -657,7 +683,7 @@ if(NOT BUILD_HYDRA_CORE AND NOT BUILD_LIBRETRO_CORE)

set(FRONTEND_SOURCE_FILES src/panda_qt/main.cpp src/panda_qt/screen.cpp src/panda_qt/main_window.cpp src/panda_qt/about_window.cpp
src/panda_qt/config_window.cpp src/panda_qt/zep.cpp src/panda_qt/text_editor.cpp src/panda_qt/cheats_window.cpp src/panda_qt/mappings.cpp
src/panda_qt/patch_window.cpp src/panda_qt/elided_label.cpp src/panda_qt/shader_editor.cpp
src/panda_qt/patch_window.cpp src/panda_qt/elided_label.cpp src/panda_qt/shader_editor.cpp src/panda_qt/translations.cpp
)
set(FRONTEND_HEADER_FILES include/panda_qt/screen.hpp include/panda_qt/main_window.hpp include/panda_qt/about_window.hpp
include/panda_qt/config_window.hpp include/panda_qt/text_editor.hpp include/panda_qt/cheats_window.hpp
Expand Down Expand Up @@ -710,6 +736,23 @@ if(NOT BUILD_HYDRA_CORE AND NOT BUILD_LIBRETRO_CORE)
docs/img/sparkling_icon.png docs/img/battery_icon.png docs/img/sdcard_icon.png
docs/img/rnap_icon.png docs/img/rcow_icon.png docs/img/skyemu_icon.png
)

# Translation files in Qt's .ts format. Will be converted into binary files and embedded into the executable
set(TRANSLATIONS_TS docs/translations/en.ts docs/translations/el.ts docs/translations/es.ts docs/translations/pt_br.ts docs/translations/nl.ts)
set_source_files_properties(${TRANSLATIONS_TS} PROPERTIES OUTPUT_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/translations")
qt_add_translation(TRANSLATIONS_QM ${TRANSLATIONS_TS})

set(TRANSLATIONS_QRC ${CMAKE_CURRENT_BINARY_DIR}/translations/translations.qrc)
file(WRITE ${TRANSLATIONS_QRC} "<RCC><qresource prefix=\"translations\">\n")
foreach (QM ${TRANSLATIONS_QM})
message("${QM}")
get_filename_component(QM_FILE ${QM} NAME)
file(APPEND ${TRANSLATIONS_QRC} "<file>${QM_FILE}</file>\n")
endforeach (QM)
file(APPEND ${TRANSLATIONS_QRC} "</qresource></RCC>")

qt_add_resources(TRANSLATIONS ${TRANSLATIONS_QRC})
set(APP_RESOURCES ${APP_RESOURCES} ${TRANSLATIONS})
else()
set(FRONTEND_SOURCE_FILES src/panda_sdl/main.cpp src/panda_sdl/frontend_sdl.cpp src/panda_sdl/mappings.cpp)
set(FRONTEND_HEADER_FILES "include/panda_sdl/frontend_sdl.hpp")
Expand Down
Loading

0 comments on commit 3fbcea0

Please sign in to comment.