Skip to content

Commit

Permalink
Add native game: Rick Dangerous
Browse files Browse the repository at this point in the history
  • Loading branch information
anzz1 committed May 31, 2023
1 parent 564f743 commit 146b9bc
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
launch.sh
63 changes: 63 additions & 0 deletions extras/Roms/Native Games (SH)/Rick Dangerous/check-data.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#!/bin/sh

DATA_URL="https://github.com/libretro/xrick-libretro/raw/master/data.zip"

zipvalid() {
if [ "$(hexdump -n 4 -e '1/4 "%u"' "$1" 2> /dev/null)" = "67324752" ]; then
return 0
fi
return 1
}

cd "$(dirname "$0")"
if [ -f ./data.zip ]; then
exit 0
fi

if [ -z "$(curl --version 2> /dev/null)" ] || ! (ip route get 1.1.1.1); then
show okay.png
say "Rick Dangerous data missing !"$'\n\n'"Please connect to internet to download"$'\n'"the data or see readme.txt in the"$'\n'"Rick Dangerous folder for manual"$'\n'"installation instructions."$'\n'
confirm only
exit 1
fi
show confirm.png
say "Rick Dangerous data missing !"$'\n\n'"Do you want to download the"$'\n'"required data files now?"$'\n'
if ! confirm; then exit 1; fi

progressui &
PROG_PID=$!
sleep 0.5

progress 0 "Checking for free space ..."

sync
if ! [ "$(df -m /mnt/SDCARD/ | tail -1 | awk '{print $(NF-2);exit}')" -gt 50 ] 2>/dev/null; then
progress quit
wait $PROG_PID
show okay.png
say "Not enough free space !"$'\n\n'"50MB of free space is"$'\n'"required to proceed."$'\n'
confirm only
exit 0
fi


progress 50 "Downloading data ..."
curl --silent -f --connect-timeout 30 -m 600 -L -k -o data.zip "$DATA_URL" && \
zipvalid "data.zip"
if [ $? -ne 0 ] || [ ! -f ./data.zip ]; then
rm -rf data.zip
sync
progress quit
wait $PROG_PID
show okay.png
say "Data download failed !"$'\n\n'"Please see readme.txt in the"$'\n'"Rick Dangerous folder for manual"$'\n'"installation instructions."$'\n'
confirm only
exit 1
fi

sync
progress 100 "Launching game ..."
sleep 2
progress quit
wait $PROG_PID
exit 0
15 changes: 15 additions & 0 deletions extras/Roms/Native Games (SH)/Rick Dangerous/launch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

PERF_LEVEL=performance

###############################

DIR="$(dirname "$0")"
HOME="$USERDATA_PATH"

cd "$DIR"
echo "$PERF_LEVEL" > "$CPU_PATH"
if ./check-data.sh; then
cd "$HOME"
picoarch "$DIR/xrick_libretro.so" "$DIR/data.zip"
fi
12 changes: 12 additions & 0 deletions extras/Roms/Native Games (SH)/Rick Dangerous/readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Download the xrick data file from:

https://github.com/libretro/xrick-libretro/raw/master/data.zip

Place the zip file inside this Rick Dangerous folder.

Do not unzip data.zip.

---

CRC: 74B76447
MD5: a471e64e9f69afbe59c10cc94ed1b184
1 change: 1 addition & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ payload:
cp ./third-party/picoarch/output/prboom_libretro.so ./build/EXTRAS/Emus/DOOM.pak/
cp ./third-party/picoarch/cores/prboom/prboom.wad ./build/EXTRAS/Bios/DOOM/
cp ./third-party/picoarch/output/nxengine_libretro.so "./build/EXTRAS/Roms/Native Games (SH)/Cave Story/"
cp ./third-party/picoarch/output/xrick_libretro.so "./build/EXTRAS/Roms/Native Games (SH)/Rick Dangerous/"
cp ./third-party/st-sdl/st ./build/EXTRAS/Tools/Terminal.pak/
cp ./third-party/dropbear-embedded/dropbear ./build/EXTRAS/Tools/SSH.pak/
cp ./third-party/vvvvvv/vvvvvv "./build/EXTRAS/Roms/Native Games (SH)/VVVVVV/"
Expand Down

0 comments on commit 146b9bc

Please sign in to comment.