Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Batocera PortMaster, Update Recalbox to 9.2.1 #28

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .github/actions/build-buildroot-image/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ runs:
with:
path: rpi/drivers/bin
merge-multiple: true
name: drivers

# Install dependencies
- name: Install dependencies
Expand Down
4 changes: 4 additions & 0 deletions .github/actions/build-buildroot-image/build-batocera.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ sudo cp $GITHUB_WORKSPACE/rpi/configs/batocera/multimedia_keys.conf /tmp/target/
echo "Update S12populateshare to copy multimedia_keys.conf into system at boot"
sudo sed -i '/bios\/ps2/i\ system\/configs\/multimedia_keys.conf \\' /tmp/target/etc/init.d/S12populateshare

# Add PortMaster
echo "Add PortMaster"
sudo cp -r $GITHUB_WORKSPACE/rpi/configs/batocera/portmaster/* /tmp/target/usr/share/batocera/datainit/roms/ports/

# repack squashfs
echo "Repack squashfs"
sudo mksquashfs /tmp/target ./filesystem.squashfs -noappend -comp zstd
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/build-buildroot-image/checksums.sha1
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
deb540cd1f450c52c8b6b6a4420ef1e481041bad recalbox-rpizero2.img.xz
bb8e6e862cedc4b6b1c77bab3540c358dbf11e25 recalbox-rpi4_64.img.xz
1f6455cc4ce0a827d1add47636a2c7258ad72061 recalbox-rpizero2.img.xz
fa1bb7007d46de5ef2d8d11fd8af366179b5b1bc recalbox-rpi4_64.img.xz
7 changes: 7 additions & 0 deletions .github/actions/build-drivers/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ runs:
sudo apt-get install fdisk gdisk qemu-user-static libarchive-tools tar parted qemu-utils
shell: bash

# Install packer 1.10.3
- name: Install packer 1.10.3
run: |
wget https://releases.hashicorp.com/packer/1.10.3/packer_1.10.3_linux_amd64.zip
unzip -o -qq packer_1.10.3_linux_amd64.zip -d /usr/local/bin
shell: bash

# Install packer arm plugin
- name: Install packer-builder-arm
run: |
Expand Down
8 changes: 8 additions & 0 deletions .github/actions/build-packer-image/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ runs:
with:
path: rpi/drivers/bin
merge-multiple: true
name: drivers

# Install dependencies for packer
- name: Install dependencies
Expand All @@ -40,6 +41,13 @@ runs:
sudo apt-get install fdisk gdisk qemu-user-static libarchive-tools tar parted qemu-utils squashfs-tools -y
shell: bash

# Install packer 1.10.3
- name: Install packer 1.10.3
run: |
wget https://releases.hashicorp.com/packer/1.10.3/packer_1.10.3_linux_amd64.zip
unzip -o -qq packer_1.10.3_linux_amd64.zip -d /usr/local/bin
shell: bash

# Install packer arm plugin
- name: Install packer-builder-arm
run: |
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/RELEASE_FORMAT.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@ This image does not support customisations via Raspberry Pi Imager

Username: `root`
Password: `linux`

PortMaster:

This image comes with [PortMaster](https://portmaster.games/) preinstalled.

PortMaster does not (yet) officially support Batocera, though we can get some (not all) games working.

To get started:

- Connect your device to the internet and launch PortMaster from the "ports" console. This will update PortMaster to the latest version.
- Install whatever games you would like to try and follow any included instructions.
- Before launching a game, you need to open the game script in a text editor and change the "controlfolder" variable from `/roms/ports/PortMaster` to `/userdata/roms/ports/PortMaster` (See the included copy of Descent for an example)
</details>

<details>
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,18 +113,18 @@ jobs:
PSPI_IMAGE_NAME: "Lakka5.0-Zero2-PSPi6-v${{ github.event_name == 'workflow_dispatch' && github.event.inputs.version || needs.run-gitversion.outputs.version }}.img.gz"
VERSION: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.version || needs.run-gitversion.outputs.version }}
- os: recalbox
DOWNLOAD_URL: "https://upgrade.recalbox.com/latest/download-wizard/rpi4_64/recalbox-rpi4_64.img.xz"
DOWNLOAD_URL: "https://upgrade.recalbox.com/latest/download/rpi4_64/recalbox-rpi4_64.img.xz"
COMPRESSED_IMAGE_NAME: "recalbox-rpi4_64.img.xz"
IMAGE_NAME: "recalbox-rpi4_64.img"
CHECKSUM_TYPE: "sha1"
PSPI_IMAGE_NAME: "Recalbox9.1-CM4-PSPi6-v${{ github.event_name == 'workflow_dispatch' && github.event.inputs.version || needs.run-gitversion.outputs.version }}.img.gz"
PSPI_IMAGE_NAME: "Recalbox9.2.1-CM4-PSPi6-v${{ github.event_name == 'workflow_dispatch' && github.event.inputs.version || needs.run-gitversion.outputs.version }}.img.gz"
VERSION: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.version || needs.run-gitversion.outputs.version }}
- os: recalbox
DOWNLOAD_URL: "https://upgrade.recalbox.com/latest/download-wizard/rpizero2/recalbox-rpizero2.img.xz"
DOWNLOAD_URL: "https://upgrade.recalbox.com/latest/download/rpizero2/recalbox-rpizero2.img.xz"
COMPRESSED_IMAGE_NAME: "recalbox-rpizero2.img.xz"
IMAGE_NAME: "recalbox-rpizero2.img"
CHECKSUM_TYPE: "sha1"
PSPI_IMAGE_NAME: "Recalbox9.1-Zero2-PSPi6-v${{ github.event_name == 'workflow_dispatch' && github.event.inputs.version || needs.run-gitversion.outputs.version }}.img.gz"
PSPI_IMAGE_NAME: "Recalbox9.2.1-Zero2-PSPi6-v${{ github.event_name == 'workflow_dispatch' && github.event.inputs.version || needs.run-gitversion.outputs.version }}.img.gz"
VERSION: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.version || needs.run-gitversion.outputs.version }}
- os: batocera
DOWNLOAD_URL: "https://updates.batocera.org/bcm2711/stable/last/batocera-bcm2711-bcm2711-39-20240228.img.gz"
Expand Down
67 changes: 67 additions & 0 deletions rpi/configs/batocera/portmaster/Descent.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#!/bin/bash
# PORTMASTER: descent.zip, Descent.sh

XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share}

if [ -d "/opt/system/Tools/PortMaster/" ]; then
controlfolder="/opt/system/Tools/PortMaster"
elif [ -d "/opt/tools/PortMaster/" ]; then
controlfolder="/opt/tools/PortMaster"
elif [ -d "$XDG_DATA_HOME/PortMaster/" ]; then
controlfolder="$XDG_DATA_HOME/PortMaster"
else
controlfolder="/userdata/roms/ports/PortMaster"
fi

source $controlfolder/control.txt
source $controlfolder/device_info.txt
[ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt"
get_controls

GAMEDIR="/$directory/ports/descent"
DEVICE_ARCH="${DEVICE_ARCH:-aarch64}"
GAME="d1x-rebirth"
ASPECT_X=${ASPECT_X:-4}
ASPECT_Y=${ASPECT_Y:-3}

cd $GAMEDIR

$ESUDO rm -rf ~/.$GAME
ln -sfv $GAMEDIR/config ~/.$GAME

export LD_LIBRARY_PATH="$GAMEDIR/libs.$DEVICE_ARCH:$LD_LIBRARY_PATH"
export SDL_FORCE_SOUNDFONTS=1
export SDL_SOUNDFONTS="$GAMEDIR/soundfont.sf2"

# Add some cheats
if [ ! -f "./cheats.txt" ]; then
echo "Error: Cheats file not found. No cheats will be used." > /dev/tty0
else
CHEATS=$(sed -n -E '/^[^#]*=[[:space:]]*1([^0-9#]|$)/s/(=[[:space:]]*1[^0-9#]*)//p' ./cheats.txt | tr -d '\n')
fi

export TEXTINPUTPRESET=$CHEATS

# Edit .cfg file with updated resolution and aspect ratio
sed -i "s/^ResolutionX=640/ResolutionX=$DISPLAY_WIDTH/g" $GAMEDIR/config/descent.cfg
sed -i "s/^ResolutionY=480/ResolutionY=$DISPLAY_HEIGHT/g" $GAMEDIR/config/descent.cfg
sed -i "s/^AspectX=.*/AspectX=$ASPECT_Y/g" $GAMEDIR/config/descent.cfg
sed -i "s/^AspectY=.*/AspectY=$ASPECT_X/g" $GAMEDIR/config/descent.cfg

# Setup controls
$ESUDO chmod 666 /dev/tty1
$ESUDO chmod 666 /dev/uinput

if [ $CFW_NAME == "ArkOS" ]; then
$GPTOKEYB "$GAME.compat" -c "config/joy.gptk" &
SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig"
./$GAME.compat -hogdir data
else
$GPTOKEYB "$GAME.$DEVICE_ARCH" -c "config/joy.gptk" &
SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig"
./$GAME.$DEVICE_ARCH -hogdir data
fi

$ESUDO kill -9 $(pidof gptokeyb)
$ESUDO systemctl restart oga_events &
printf "\033c" >> /dev/tty1
Loading