In the beginning there was darkness

This commit is contained in:
Daniel Ziltener 2024-10-21 23:54:17 +02:00
parent f59a1ae2bb
commit dda545aa1c
Signed by: zilti
GPG key ID: B38976E82C9DAE42
5 changed files with 62 additions and 18 deletions

View file

@ -5,6 +5,7 @@ BASEURL="https://github.com/Abdess/retroarch_system/raw/refs/heads/libretro"
TARGETDIR="${HOME}/.var/app/org.libretro.RetroArch/config/retroarch/system"
# Sega CD
echo "Downloading Sega CD BIOS"
SEGACDPREFIX="Sega%20-%20Mega%20CD%20-%20Sega%20CD"
SEGACDFILES="bios_CD_E.bin bios_CD_J.bin bios_CD_U.bin"
@ -14,6 +15,7 @@ do
done
# Sega Saturn
echo "Downloading Sega Saturn BIOS"
SEGASATURNPREFIX="Sega%20-%20Saturn"
SEGASATURNFILES="mpr-17933.bin saturn_bios.bin sega_101.bin"
@ -23,6 +25,7 @@ do
done
# Sega Dreamcast
echo "Downloading Sega Dreamcast BIOS"
DREAMCASTPREFIX="Sega%20-%20Dreamcast"
DREAMCASTFILES="dc_boot.bin dc_flash.bin naomi_boot.bin"
@ -31,3 +34,14 @@ do
mkdir -p "${TARGETDIR}/dc"
curl -L "${BASEURL}/${DREAMCASTPREFIX}/${FILE}" -o "${TARGETDIR}/dc/${FILE}"
done
# Naomi Arcade Board
echo "Downloading Sega Naomi BIOS"
NAOMIPREFIX="Arcade"
NAOMIFILES="airlbios.zip awbios.zip naomi.zip"
for FILE in $NAOMIFILES
do
mkdir -p "${TARGETDIR}/dc"
curl -L "${BASEURL}/${NAOMIPREFIX}/${FILE}" -o "${TARGETDIR}/dc/${FILE}"
done

View file

@ -66,7 +66,8 @@
(define button-bg-x 100)
(define button-bg-y 100)
(define button-mv-tickbuffer 0)
(define pixels-per-tick 1)
(define x-pixels-per-tick 2)
(define y-pixels-per-tick 1)
(define (button-coordinates index)
(values (+ 300 (* (modulo index 4) 350))
@ -77,17 +78,17 @@
(let ((ticks (- (sdl2:get-ticks) button-mv-tickbuffer)))
(set! button-mv-tickbuffer (sdl2:get-ticks))
(cond ((< button-bg-x target-x)
(set! button-bg-x (min (+ button-bg-x (* pixels-per-tick ticks))
(set! button-bg-x (min (+ button-bg-x (* x-pixels-per-tick ticks))
target-x)))
((> button-bg-x target-x)
(set! button-bg-x (max (- button-bg-x (* pixels-per-tick ticks))
(set! button-bg-x (max (- button-bg-x (* x-pixels-per-tick ticks))
target-x)))
(else #t))
(cond ((< button-bg-y target-y)
(set! button-bg-y (min (+ button-bg-y (* pixels-per-tick ticks))
(set! button-bg-y (min (+ button-bg-y (* y-pixels-per-tick ticks))
target-y)))
((> button-bg-y target-y)
(set! button-bg-y (max (- button-bg-y (* pixels-per-tick ticks))
(set! button-bg-y (max (- button-bg-y (* y-pixels-per-tick ticks))
target-y)))
(else #t)))))
@ -110,7 +111,7 @@
(define (render-launcher-buttons renderer)
(let loop ((index 0))
(render-launcher-button renderer index)
(when (< index (- (length launcher-entries) 1))
(when (< index (sub1 (length launcher-entries)))
(loop (+ index 1)))))
(define (render-button-bgs renderer active-x active-y)
@ -133,7 +134,7 @@
(sdl2:render-present! renderer)))
(define (change-active-button delta)
(cond ((and (> delta 0) (< active-button-id 3))
(cond ((and (> delta 0) (< active-button-id (sub1 (length launcher-entries))))
(set! active-button-id (+ active-button-id delta)))
((and (< delta 0) (> active-button-id 0))
(set! active-button-id (+ active-button-id delta)))))
@ -141,7 +142,12 @@
(define (trigger-action! window)
(set! active-controllers '())
(sdl2:quit-subsystem! '(events))
(process-wait (process-run (toml-string (list-ref launcher-entries active-button-id) "command")))
(let* ((entry (list-ref launcher-entries active-button-id))
(proc-pid (process-run (toml-string entry "command"))))
(when (toml-key-exists? entry "aux-command")
(thread-delay! 2000)
(process-run (toml-string entry "aux-command")))
(process-wait proc-pid))
(sdl2:init-subsystem! '(events))
(sdl2:pump-events!)
(sdl2:flush-events!)

View file

@ -4,7 +4,7 @@
(chicken base)
(chicken irregex)
(chicken process-context))
(include-relative "./menu-impl.scm")
(change-directory
(irregex-match-substring (irregex-search '(: bos (* any) #\/) (executable-pathname))))
(include-relative "./menu-impl.scm")
(main))

View file

@ -10,6 +10,12 @@ id = "retroarch"
image = "media/images/retroarch.png"
command = "flatpak run org.libretro.RetroArch"
# [[launcher.entry]]
# id = "steamlink"
# image = "media/images/steamlink.png"
# command = "moonlight-qt"
# aux-command = "wmctrl -r 'Moonlight' -b add,fullscreen"
[[launcher.entry]]
id = "steamlink"
image = "media/images/steamlink.png"
@ -18,7 +24,8 @@ command = "flatpak run com.valvesoftware.SteamLink"
[[launcher.entry]]
id = "stremio"
image = "media/images/stremio.png"
command = "/home/zilti/stremio-shell/build/stremio"
command = "/home/zilti/stremio/stremio-shell/build/stremio"
aux-command = "wmctrl -r 'Stremio - Freedom to Stream' -b add,fullscreen"
[[launcher.entry]]
id = "update"

View file

@ -4,7 +4,7 @@ sudo apt upgrade -y
sudo apt install -y chicken-bin libchicken-dev libchicken11 \
libsdl2-dev libsdl2-image-dev libsdl2-ttf-dev \
flatpak xdg-desktop-portal vim unclutter \
qemu-user-static
steam-devices wmctrl kde-plasma-desktop kdeconnect plasma-workspace-wayland plasma-settings
sudo systemctl enable bluetooth
blueman-tray &
@ -21,7 +21,7 @@ sudo mv kodi.dnssd /etc/systemd/dnssd/
sudo systemctl restart systemd-resolved.service
flatpak remote-add -u --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
for FPAK in tv.kodi.Kodi org.libretro.RetroArch
for FPAK in tv.kodi.Kodi org.libretro.RetroArch com.moonlight_stream.Moonlight
do
flatpak install -u -y $FPAK
done
@ -57,19 +57,36 @@ Exec=unclutter
X-GNOME-Autostart-enabled=true
EOF
cat <<EOF > "${HOME}/.config/autostart/overscan.desktop"
[Desktop Entry]
Type=Application
# Exec=/home/zilti/overscan-fix.sh
Exec=xrandr --output HDMI-1 --fb 1920x1080 --panning 1920x1080 --transform 1.042,0,-40,0,1.042,-20,0,0,1
X-GNOME-Autostart-enabled=true
NoDisplay=false
Hidden=false
Name[de_DE]=overscan
Comment[de_DE]=No description
X-GNOME-Autostart-Delay=1
EOF
### Steam Link
flatpak --arch=x86_64 -u install com.valvesoftware.SteamLink
#flatpak --arch=x86_64 -u install flathub com.valvesoftware.SteamLink
curl http://media.steampowered.com/steamlink/rpi/steamlink-rpi3-1.2.0.241.tar.gz | tar -xzf -
sudo apt install -y libraspberrypi-bin cec-utils
sudo apt install -y libdbus-1-3:armhf libraspberrypi0:armhf libstdc++6:armhf libjpeg62-turbo:armhf \
libglib2.0-0:armhf libgles2:armhf zlib1g:armhf libdbus-1-3:armhf libudev1:armhf libraspberrypi0:armhf libglib2.0-0:armhf libgles2-mesa:armhf libpng16-16:armhf qtbase5-dev:armhf qtchooser:armhf qt5-qmake:armhf qtbase5-dev-tools:armhf
### Stremio
# See https://github.com/Stremio/stremio-shell/blob/master/DEBIAN.md
sudo apt install qtcreator qt5-qmake g++ pkgconf libssl-dev librsvg2-bin \
libkf5webengineviewer-dev libqt5opengl5-dev \
libmpv-dev
#flatpak --arch=x86_64 -u install flathub com.stremio.Stremio
sudo apt install -y qtcreator qt5-qmake g++ pkgconf libssl-dev librsvg2-bin qml-module-qtwebchannel qml-module-qt-labs-platform qml-module-qtwebengine qml-module-qtquick-dialogs qml-module-qtquick-controls qtdeclarative5-dev qml-module-qt-labs-settings qml-module-qt-labs-folderlistmodel libmpv-dev libqt5webview5-dev libkf5webengineviewer-dev libqt5opengl5-dev nodejs
mkdir stremio; cd stremio
git clone --depth=1 --recurse-submodules -j8 https://github.com/Stremio/stremio-shell.git
cd stremio-shell
qmake
make -f release.makefile
cp ./server.js ./build/ && ln -s "$(which node)" ./build/node
cd ../..
### Menu