Merge pull request #576 from fewtarius/dev

Fix brightness, fix flycast32.
This commit is contained in:
fewtarius 2022-09-29 16:46:38 -04:00 committed by GitHub
commit 4d522bfa01
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 33 additions and 39 deletions

View file

@ -23,7 +23,7 @@
PKG_NAME="common-shaders"
PKG_VERSION="86cfa146a8dfddf6377ddb5dbcff552feae2e5bf"
PKG_REV="1"
PKG_ARCH="any"
PKG_ARCH="aarch64"
PKG_LICENSE="GPL"
PKG_SITE="https://github.com/libretro/common-shaders"
PKG_URL="${PKG_SITE}.git"
@ -33,13 +33,6 @@ PKG_SECTION="libretro"
PKG_SHORTDESC="Libretro common shaders"
PKG_LONGDESC="Libretro common shaders"
if [ "${DISPLAYSERVER}" = "wl" ]
then
PKG_DEPENDS_TARGET+=" slang-shaders"
else
PKG_DEPENDS_TARGET+=" glsl-shaders"
fi
make_target() {
:
}

View file

@ -22,7 +22,7 @@
PKG_NAME="glsl-shaders"
PKG_VERSION="2aec58e7e75083b689d38e3c4eaf043589ffd36f"
PKG_REV="1"
PKG_ARCH="any"
PKG_ARCH="aarch64"
PKG_LICENSE="GPL"
PKG_SITE="https://github.com/libretro/glsl-shaders"
PKG_URL="${PKG_SITE}.git"

View file

@ -4,7 +4,7 @@
. /etc/profile
BRIGHTNESS_DEV="$(ls /sys/class/backlight | head -n 1)"
BRIGHTNESS_DEV="$(ls /sys/class/backlight)"
### Variables may need to be device specific here.
BRIGHTNESS=$(get_setting system.brightness)
@ -19,6 +19,10 @@ then
BRIGHTNESS=3
fi
BRIGHTNESS=$(printf "%.0f" $(echo "${BRIGHTNESS}"))
echo ${BRIGHTNESS} > /sys/class/backlight/${BRIGHTNESS_DEV}/brightness
set_setting system.brightness ${BRIGHTNESS}
BRIGHTNESS=$(printf "%.0f" ${BRIGHTNESS})
if [ "$(cat /sys/class/backlight/${BRIGHTNESS_DEV}/max_brightness)" = 255 ]
then
printf "%.0f" $(echo "${BRIGHTNESS} * 2.56" | bc) > /sys/class/backlight/${BRIGHTNESS_DEV}/brightness
else
printf "%.0f" $(echo "${BRIGHTNESS}") > /sys/class/backlight/${BRIGHTNESS_DEV}/brightness
fi

View file

@ -2,15 +2,15 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2020-present Fewtarius
BRIGHTNESS_DEV="$(ls /sys/class/backlight | head -n 1)"
BRIGHTNESS_DEV="$(ls /sys/class/backlight)"
MIN=5
MIN=1
MAX=$(cat /sys/class/backlight/${BRIGHTNESS_DEV}/max_brightness)
if [ "${MAX}" = 255 ]
then
STEP=15
STEP=17
else
STEP=5
STEP=6
fi
if [[ -n "$2" ]]; then
@ -29,14 +29,10 @@ then
exit 1
fi
round() {
awk -v val=$1 'BEGIN{print int((val+5/2)/5) * 5}'
}
stepUp() {
getBrightness
MYBRIGHTNESS=$?
NEWBRIGHTNESS=$((${MYBRIGHTNESS}+$(round ${STEP})))
NEWBRIGHTNESS=$((${MYBRIGHTNESS}+${STEP}))
if (( ${NEWBRIGHTNESS} > ${MAX} ))
then
NEWBRIGHTNESS=${MAX}
@ -48,7 +44,7 @@ stepUp() {
stepDown() {
getBrightness
MYBRIGHTNESS=$?
NEWBRIGHTNESS=$((${MYBRIGHTNESS}-$(round ${STEP})))
NEWBRIGHTNESS=$((${MYBRIGHTNESS}-${STEP}))
if (( ${NEWBRIGHTNESS} < ${MIN} ))
then
NEWBRIGHTNESS=${MIN}

View file

@ -328,6 +328,7 @@ else
[[ "${CORE}" =~ flycast32 ]]
then
export LIBGL_DRIVERS_PATH="/usr/lib32/dri"
export LD_LIBRARY_PATH="/usr/lib32"
export RABIN="retroarch32"
fi
fi

View file

@ -9,12 +9,12 @@ case $1 in
if [ "${DEVICE_FAKE_JACKSENSE}" == "true" ]
then
systemctl stop headphones
nohup systemctl stop headphones & >/dev/null 2>&1
fi
if [ "${DEVICE_VOLUMECTL}" == "true" ]
then
systemctl stop volume
nohup systemctl stop volume & >/dev/null 2>&1
fi
# RG351x devices are notorious for losing USB when they sleep.
@ -23,8 +23,9 @@ case $1 in
modprobe -r dwc2
fi
alsactl store -f /storage/.config/asound.state
nohup alsactl store -f /storage/.config/asound.state >/dev/null 2>&1
wait
touch /run/.last_sleep_time
;;
@ -38,24 +39,21 @@ case $1 in
if [ "${DEVICE_FAKE_JACKSENSE}" == "true" ]
then
systemctl start headphones
nohup systemctl start headphones & >/dev/null 2>&1
fi
if [ "${DEVICE_VOLUMECTL}" == "true" ]
then
systemctl start volume
fi
if [ "$(get_setting wifi.enabled)" == "1" ]
then
wifictl reconnect
nohup systemctl start volume & >/dev/null 2>&1
fi
DEVICE_VOLUME=$(get_setting "audio.volume" 2>/dev/null)
amixer -M set "${DEVICE_AUDIO_MIXER}" ${DEVICE_VOLUME}% 2>&1 >/dev/null
nohup amixer -M set "${DEVICE_AUDIO_MIXER}" ${DEVICE_VOLUME}% & >/dev/null 2>&1
BRIGHTNESS_DEV="$(ls /sys/class/backlight | head -n 1)"
BRIGHTNESS=$(get_setting system.brightness)
echo ${BRIGHTNESS} >/sys/class/backlight/${BRIGHTNESS_DEV}/brightness
wait
;;
esac

View file

@ -13,8 +13,7 @@ PKG_EMUS="hatarisa openbor hypseus-singe moonlight hypseus-singe pico-8 flycasts
mupen64plussa-core mupen64plussa-rsp-hle mupen64plussa-video-glide64mk2 mupen64plussa-video-gliden64 \
lzdoom gzdoom ecwolf amiberry raze drastic"
PKG_RETROARCH="retroarch retroarch-overlays retroarch-assets common-shaders glsl-shaders \
libretro-database core-info"
PKG_RETROARCH="retroarch retroarch-overlays retroarch-assets libretro-database core-info"
LIBRETRO_CORES="2048 81 a5200 atari800 beetle-gba beetle-lynx beetle-ngp beetle-pce beetle-pce-fast beetle-pcfx \
beetle-supafaust beetle-supergrafx beetle-vb beetle-wswan bluemsx cannonball cap32 \
@ -35,13 +34,16 @@ PKG_DEPENDS_TARGET="${PKG_EMUS} ${PKG_RETROARCH} ${LIBRETRO_CORES}"
### Emulators or cores for specific devices
case "${DEVICE}" in
RG351P|RG351V|RG351MP)
PKG_DEPENDS_TARGET+=" common-shaders glsl-shaders"
;;
RG552)
PKG_DEPENDS_TARGET+=" duckstationsa dolphinsa dolphin"
PKG_DEPENDS_TARGET+=" duckstationsa dolphinsa dolphin slang-shaders"
;;
RG503|RG353P)
PKG_DEPENDS_TARGET+=" duckstationsa dolphinsa"
PKG_DEPENDS_TARGET+=" duckstationsa dolphinsa common-shaders glsl-shaders"
;;
handheld)
PKG_DEPENDS_TARGET+=" duckstationsa dolphinsa dolphin pcsx2sa pcsx2 desmume bsnes citra"
PKG_DEPENDS_TARGET+=" duckstationsa dolphinsa dolphin pcsx2sa pcsx2 desmume bsnes citra slang-shaders"
;;
esac