Skip to content

Commit

Permalink
add experimental port for jailbroken PS5s
Browse files Browse the repository at this point in the history
  • Loading branch information
john-tornblom authored and AJenbo committed Sep 2, 2024
1 parent 1583490 commit 21627b9
Show file tree
Hide file tree
Showing 5 changed files with 185 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/PS5.yml
Original file line number Diff line number Diff line change
@@ -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
40 changes: 40 additions & 0 deletions Packaging/ps5/README.md
Original file line number Diff line number Diff line change
@@ -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
39 changes: 39 additions & 0 deletions Packaging/ps5/build.sh
Original file line number Diff line number Diff line change
@@ -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
44 changes: 44 additions & 0 deletions Packaging/ps5/homebrew.js
Original file line number Diff line number Diff line change
@@ -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'
};
}
}
]
};
}
Binary file added Packaging/ps5/sce_sys/icon0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 21627b9

Please sign in to comment.