diff --git a/.github/workflows/PS5.yml b/.github/workflows/PS5.yml new file mode 100644 index 00000000000..b9b6e0eefb1 --- /dev/null +++ b/.github/workflows/PS5.yml @@ -0,0 +1,62 @@ +name: PS5 (ps5-payload-dev) + +on: + push: + branches: + - master + paths-ignore: + - '*.md' + - 'docs/**' + pull_request: + types: [opened, synchronize] + paths-ignore: + - '*.md' + - 'docs/**' + release: + types: [published] + paths-ignore: + - '*.md' + - 'docs/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + + +jobs: + ps5: + runs-on: ubuntu-24.04 + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Create Build Environment + run: | + sudo apt update + sudo apt install cmake pkg-config clang-15 lld-15 + sudo apt install build-essential autoconf libtool yasm nasm + sudo apt install smpq gperf pkgconf libarchive-tools autopoint po4a git curl doxygen wget + wget https://github.com/ps5-payload-dev/pacbrew-repo/releases/download/v0.8/ps5-payload-dev.tar.gz + sudo tar -xf ps5-payload-dev.tar.gz -C / + + - name: Build + working-directory: ${{github.workspace}} + shell: bash + run: Packaging/ps5/build.sh + + - name: Upload-Package + if: ${{ !env.ACT }} + uses: actions/upload-artifact@v4 + with: + name: devilutionx-ps5.zip + path: build-ps5/devilutionx-ps5.zip + + - name: Update Release + if: ${{ github.event_name == 'release' && !env.ACT }} + uses: svenstaro/upload-release-action@v2 + with: + asset_name: devilutionx-ps5.zip + file: build-ps5/devilutionx-ps5.zip + overwrite: true diff --git a/Packaging/ps5/README.md b/Packaging/ps5/README.md new file mode 100644 index 00000000000..96ac02fd886 --- /dev/null +++ b/Packaging/ps5/README.md @@ -0,0 +1,40 @@ +# devilutionX PS5 port + +## Prerequisites +- A Playstation 5 capable of running the [ps5-payload-websrv][websrv] homebrew. +- Game assets from the Diablo game (diabdat.mpq), + or its [shareware][shareware] (spawn.mpq) + +## Installation +- Copy the game assets (e.g., via ftp) to /data/homebrew/devilutionX +- Launch the [ps5-payload-websrv][websrv] homebrew +- Launch the game from your browser at http://PS5-IP:8080, or using the + [companion launcher][launcher] from the PS5 menu system + +## Controls +- D-pad: move hero +- ○: attack nearby enemies, talk to townspeople and merchants, pickup/place + items in the inventory, OK while in main menu +- ×: select spell, back while in menus +- △: pickup items, open nearby chests and doors, use item in the inventory +- □: cast spell, delete character while in main menu +- L1: use health item from belt +- R1: use mana potion from belt +- L2: toggle character sheet +- R2: toggle inventory +- Left stick: move hero +- Right stick: move cursor +- L3: toggle auto map +- R3: click with cursor + +## Building from Source +Install the [PacBrew PS5 SDK][pacbrew], then run the following + bash script: +```console +devilutionX$ ./Packaging/ps5/build.sh +``` + +[shareware]: http://ftp.blizzard.com/pub/demos/diablosw.exe +[pacbrew]: https://github.com/ps5-payload-dev/pacbrew-repo +[websrv]: https://github.com/ps5-payload-dev/websrv +[launcher]: https://github.com/ps5-payload-dev/websrv/blob/master/homebrew/IV9999-FAKE00001_00-HOMEBREWLOADER01.pkg?raw=true diff --git a/Packaging/ps5/build.sh b/Packaging/ps5/build.sh new file mode 100755 index 00000000000..696a9ffd2e9 --- /dev/null +++ b/Packaging/ps5/build.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash + +set -e +SCRIPTDIR="${BASH_SOURCE[0]}" +SCRIPTDIR="$(dirname "${SCRIPTDIR}")" + +if [ -z "${PS5_PAYLOAD_SDK}" ]; then + export PS5_PAYLOAD_SDK=/opt/ps5-payload-sdk +fi + +source "${PS5_PAYLOAD_SDK}/toolchain/prospero.sh" + +${CMAKE} -DCMAKE_BUILD_TYPE=Release \ + -DDISCORD_INTEGRATION=OFF \ + -DBUILD_TESTING=OFF \ + -DASAN=OFF \ + -DUBSAN=OFF \ + -DDISABLE_LTO=ON \ + -DNOEXIT=ON \ + -DNONET=OFF \ + -DBUILD_ASSETS_MPQ=ON \ + -DDEVILUTIONX_SYSTEM_SDL_IMAGE=OFF \ + -B build-ps5 \ + -S "${SCRIPTDIR}/../../" +${MAKE} -C build-ps5 -j $(getconf _NPROCESSORS_ONLN) + +rm -rf build-ps5/DevilutionX +mkdir build-ps5/DevilutionX + +cp -r "${SCRIPTDIR}/sce_sys" build-ps5/DevilutionX/ +cp "${SCRIPTDIR}/homebrew.js" build-ps5/DevilutionX/ +cp "${SCRIPTDIR}/README.md" build-ps5/DevilutionX/ +cp build-ps5/devilutionx.mpq build-ps5/DevilutionX/ +cp build-ps5/devilutionx build-ps5/DevilutionX/devilutionx.elf + +# Let github actions do this? +cd build-ps5 +rm -f devilutionx-ps5.zip +zip -r devilutionx-ps5.zip DevilutionX diff --git a/Packaging/ps5/homebrew.js b/Packaging/ps5/homebrew.js new file mode 100755 index 00000000000..6309e054700 --- /dev/null +++ b/Packaging/ps5/homebrew.js @@ -0,0 +1,44 @@ + +async function main() { + const PAYLOAD = window.workingDir + '/devilutionx.elf'; + + return { + mainText: "DevilutionX", + secondaryText: 'Diablo build for modern OSes', + onclick: async () => { + return { + path: PAYLOAD, + args: '' + }; + }, + options: [ + { + text: "Force Shareware mode", + onclick: async () => { + return { + path: PAYLOAD, + args: '--spawn' + }; + } + }, + { + text: "Force Diablo mode", + onclick: async () => { + return { + path: PAYLOAD, + args: '--diablo' + }; + } + }, + { + text: "Force Hellfire mode", + onclick: async () => { + return { + path: PAYLOAD, + args: '--hellfire' + }; + } + } + ] + }; +} diff --git a/Packaging/ps5/sce_sys/icon0.png b/Packaging/ps5/sce_sys/icon0.png new file mode 100644 index 00000000000..14566fc13b9 Binary files /dev/null and b/Packaging/ps5/sce_sys/icon0.png differ