Merge pull request #977 from JustEnoughLinuxOS/dev

PR for release
This commit is contained in:
fewtarius 2023-01-22 05:12:35 -05:00 committed by GitHub
commit b0219302ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
111 changed files with 859 additions and 535 deletions

View file

@ -52,96 +52,3 @@ jobs:
run: |
set -e
CUSTOM_VERSION="${{ steps.version.outputs.version }}" DOCKER_WORK_DIR="/work" DOCKER_EXTRA_OPTS="-v /buildroot:/buildroot" PYTHON_EGG_CACHE="${DOCKER_WORK_DIR}/.egg_cache" make docker-world
- name: Create dev release as draft at first to hide during uploads
if: github.event.action == 'release-dev'
uses: ncipollo/release-action@v1
with:
tag: "${{ steps.version.outputs.version }}"
body: |
&nbsp;&nbsp;<img src="https://raw.githubusercontent.com/JustEnoughLinuxOS/distribution/dev/distributions/JELOS/logos/jelos-logo.png" width=192>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[![Latest Version](https://img.shields.io/github/release/JustEnoughLinuxOS/distribution.svg?color=5998FF&label=latest%20version&style=flat-square)](https://github.com/JustEnoughLinuxOS/distribution/releases/latest) [![Activity](https://img.shields.io/github/commit-activity/m/JustEnoughLinuxOS/distribution?color=5998FF&style=flat-square)](https://github.com/JustEnoughLinuxOS/distribution/commits) [![Pull Requests](https://img.shields.io/github/issues-pr-closed/JustEnoughLinuxOS/distribution?color=5998FF&style=flat-square)](https://github.com/JustEnoughLinuxOS/distribution/pulls) [![Discord Server](https://img.shields.io/discord/948029830325235753?color=5998FF&label=chat&style=flat-square)](https://discord.gg/seTxckZjJy)
#
Just Enough Linux Operating System (JELOS) is a community developed Linux distribution for handheld gaming devices. Our goal is to produce an operating system that has the features and capabilities that we need, and to have fun as we develop it.
## Development Build Repository
This is a repository for JELOS development builds, these builds are unstable as they are intended for development use only. USE AT YOUR OWN RISK AND DO NOT REPORT ISSUES.
## Licenses
JELOS is a Linux distribution that is made up of many open-source components. Components are provided under their respective licenses. This distribution includes components licensed for non-commercial use only.
### JELOS Branding
JELOS branding and images are licensed under a [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-nc-sa/4.0/).
#### You are free to
* Share — copy and redistribute the material in any medium or format
* Adapt — remix, transform, and build upon the material
#### Under the following terms
* Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
* NonCommercial — You may not use the material for commercial purposes.
* ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.
### JELOS Software
Copyright 2021-present Fewtarius
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
## Installation
* Download the latest version of JELOS for your device.
* Decompress the image.
* Write the image to an SDCARD using an imaging tool. Common imaging tools include [Balena Etcher](https://www.balena.io/etcher/), [Raspberry Pi Imager](https://www.raspberrypi.com/software/), and [Win32 Disk Imager](https://sourceforge.net/projects/win32diskimager/). If you're skilled with the command line, dd works fine too.
Download: [[Ayaneo Handhelds, Atari VCS, and other x86_64 devices](https://github.com/JustEnoughLinuxOS/distribution-dev/releases/download/${{ steps.version.outputs.version }}/JELOS-handheld.x86_64-${{ steps.version.outputs.version }}.img.gz)]
## Upgrading
* Download and install the update online via the System Settings menu.
* If you are unable to update online
* Download the latest version of JELOS from Github
* Copy the update to your device over the network to your device's update share.
* Reboot the device, and the update will begin automatically.
Download: [[Ayaneo Handhelds, Atari VCS, and other x86_64 devices](https://github.com/JustEnoughLinuxOS/distribution-dev/releases/download/${{ steps.version.outputs.version }}/JELOS-handheld.x86_64-${{ steps.version.outputs.version }}.tar)]
## Documentation
* [Home](https://github.com/JustEnoughLinuxOS/distribution/wiki)
* [Donating to JELOS](https://github.com/JustEnoughLinuxOS/distribution/wiki/Donating-to-JELOS)
* [Frequently asked Questions](https://github.com/JustEnoughLinuxOS/distribution/wiki/Frequently-Asked-Questions)
* [HotKeys](https://github.com/JustEnoughLinuxOS/distribution/wiki/Hotkeys)
* [Emulators and Game Engines](https://github.com/JustEnoughLinuxOS/distribution/wiki/JELOS-emulators-and-game-engines)
* [Moonlight Game Streaming](https://github.com/JustEnoughLinuxOS/distribution/wiki/Moonlight-Game-Streaming)
* [Using Cloud Drives](https://github.com/JustEnoughLinuxOS/distribution/wiki/Using-Cloud-Drives)
* [Wireguard VPN](https://github.com/JustEnoughLinuxOS/distribution/wiki/WireGuard-VPN)
## Contributing
* [Developing and Building JELOS](https://github.com/JustEnoughLinuxOS/distribution/blob/dev/BUILDING.md)
artifacts: "release/*"
prerelease: false
draft: true
token: ${{ secrets.REPO_ACCESS }}
owner: JustEnoughLinuxOS
repo: distribution-dev
- name: Switch draft to start showing release
if: github.event.action == 'release-dev'
uses: ncipollo/release-action@v1
with:
tag: "${{ steps.version.outputs.version }}"
allowUpdates: true
draft: false
prerelease: false
token: ${{ secrets.REPO_ACCESS }}
owner: JustEnoughLinuxOS
repo: distribution-dev
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}

View file

@ -38,9 +38,7 @@ limitations under the License.
* Write the image to an SDCARD using an imaging tool. Common imaging tools include [Balena Etcher](https://www.balena.
io/etcher/), [Raspberry Pi Imager](https://www.raspberrypi.com/software/), and [Win32 Disk Imager](https://sourceforge.net/projects/win32diskimager/). If you're skilled with the command line, dd works fine too.
> This repository hosts stable versions of JELOS. If you would like to install the unstable development version, please visit the [development build repository](https://github.com/JustEnoughLinuxOS/distribution-dev).
## Installation
## Installation
* JELOS includes an installation tool. The installation tool can be found in the tools menu.
## Upgrading

View file

@ -39,6 +39,6 @@ post_makeinstall_target() {
}
post_install() {
enable_service bluealsa.service
#enable_service bluealsa.service
enable_service bluealsa-defaults.service
}

View file

@ -2,8 +2,8 @@
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="libarchive"
PKG_VERSION="3.5.1"
PKG_SHA256="0e17d3a8d0b206018693b27f08029b598f6ef03600c2b5d10c94ce58692e299b"
PKG_VERSION="3.6.2"
PKG_SHA256="9e2c1b80d5fbe59b61308fdfab6c79b5021d7ff4ff2489fb12daf0a96a83551d"
PKG_LICENSE="GPL"
PKG_SITE="https://www.libarchive.org"
PKG_URL="https://www.libarchive.org/downloads/${PKG_NAME}-${PKG_VERSION}.tar.xz"
@ -23,6 +23,6 @@ PKG_CMAKE_OPTS_TARGET="-DCMAKE_POSITION_INDEPENDENT_CODE=1 \
post_makeinstall_target() {
rm -rf ${INSTALL}
# delete the shared library as we only want static
rm ${SYSROOT_PREFIX}/usr/lib/libarchive.so*
mkdir -p ${INSTALL}/usr/lib
cp -rf ${PKG_BUILD}/.${TARGET_NAME}/libarchive/libarchive.so* ${INSTALL}/usr/lib
}

View file

@ -143,6 +143,7 @@ pre_configure_target() {
if [ ${ARCH} = "x86_64" ]; then
PKG_CONFIGURE_OPTS_TARGET+=" -reduce-relocations"
fi
export LDFLAGS="${LDFLAGS} -ljpeg"
}
configure_target() {

View file

@ -20,7 +20,7 @@ case ${DEVICE} in
PKG_URL="${PKG_SITE}.git"
;;
*)
PKG_VERSION="555a5d45f71cde6dfcb017168b7f68f93372a4f0"
PKG_VERSION="ece6edfe83db1cc45fce5f760db9104440465b8a"
PKG_SITE="https://github.com/hrydgard/ppsspp"
PKG_URL="${PKG_SITE}.git"
;;

View file

@ -1,120 +0,0 @@
diff --git a/Core/Config.cpp b/Core/Config.cpp
index 4b75a46c5..051dd20cf 100644
--- a/Core/Config.cpp
+++ b/Core/Config.cpp
@@ -898,6 +898,7 @@ static ConfigSetting graphicsSettings[] = {
#if defined(USING_WIN_UI)
ConfigSetting("RestartRequired", &g_Config.bRestartRequired, false, false),
#endif
+ ReportedConfigSetting("ForceMaxEmulatedFPS", &g_Config.iForceMaxEmulatedFPS, 0, true, true),
// Most low-performance (and many high performance) mobile GPUs do not support aniso anyway so defaulting to 4 is fine.
ConfigSetting("AnisotropyLevel", &g_Config.iAnisotropyLevel, 4, true, true),
diff --git a/Core/Config.h b/Core/Config.h
index af20f6289..1eea77626 100644
--- a/Core/Config.h
+++ b/Core/Config.h
@@ -218,6 +218,7 @@ struct Config {
bool bTexHardwareScaling;
int iFpsLimit1;
int iFpsLimit2;
+ int iForceMaxEmulatedFPS;
int iAnalogFpsLimit;
int iAnalogFpsMode; // 0 = auto, 1 = single direction, 2 = mapped to opposite
int iMaxRecent;
diff --git a/Core/HLE/sceDisplay.cpp b/Core/HLE/sceDisplay.cpp
index 342d52262..9cf1e7e5e 100644
--- a/Core/HLE/sceDisplay.cpp
+++ b/Core/HLE/sceDisplay.cpp
@@ -822,6 +822,12 @@ u32 sceDisplaySetFramebuf(u32 topaddr, int linesize, int pixelformat, int sync)
hleEatCycles(290);
s64 delayCycles = 0;
+
+ int MaxFPS = g_Config.iForceMaxEmulatedFPS;
+ if (topaddr != 0 && topaddr != framebuf.topaddr && framebuf.topaddr != 0 && MaxFPS > 0) {
+ MaxFPS = 60;
+ }
+
// Don't count transitions between display off and display on.
if (topaddr != 0 &&
(topaddr != framebuf.topaddr || PSP_CoreParameter().compat.flags().SplitFramebufferMargin) &&
@@ -850,7 +856,7 @@ u32 sceDisplaySetFramebuf(u32 topaddr, int linesize, int pixelformat, int sync)
}
// 1001 to account for NTSC timing (59.94 fps.)
- u64 expected = msToCycles(1001) / framerate - LEEWAY_CYCLES_PER_FLIP;
+ u64 expected = msToCycles(1001) / MaxFPS - LEEWAY_CYCLES_PER_FLIP;
lastFlipCycles = now;
nextFlipCycles = std::max(lastFlipCycles, nextFlipCycles) + expected;
}
diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp
index 080d19e68..dd5d93434 100644
--- a/UI/GameSettingsScreen.cpp
+++ b/UI/GameSettingsScreen.cpp
@@ -201,6 +201,8 @@ void GameSettingsScreen::CreateViews() {
g_Config.loadGameConfig(gameID_, info->GetTitle());
}
+ maxFpsChoice = (g_Config.iForceMaxEmulatedFPS / 10);
+
iAlternateSpeedPercent1_ = g_Config.iFpsLimit1 < 0 ? -1 : (g_Config.iFpsLimit1 * 100) / 60;
iAlternateSpeedPercent2_ = g_Config.iFpsLimit2 < 0 ? -1 : (g_Config.iFpsLimit2 * 100) / 60;
iAlternateSpeedPercentAnalog_ = (g_Config.iAnalogFpsLimit * 100) / 60;
@@ -310,7 +312,10 @@ void GameSettingsScreen::CreateViews() {
graphicsSettings->Add(new PopupMultiChoice(&g_Config.iFrameSkipType, gr->T("Frame Skipping Type"), frameSkipType, 0, ARRAY_SIZE(frameSkipType), gr->GetName(), screenManager()));
frameSkipAuto_ = graphicsSettings->Add(new CheckBox(&g_Config.bAutoFrameSkip, gr->T("Auto FrameSkip")));
frameSkipAuto_->OnClick.Handle(this, &GameSettingsScreen::OnAutoFrameskip);
-
+ static const char *maxFps[] = {"Auto", "10", "20", "30", "40", "50", "60", "70", "80"};
+ maxFps_ = graphicsSettings->Add(new PopupMultiChoice(&maxFpsChoice, gr->T("Force Max FPS (lower helps GoW)"), maxFps, 0, ARRAY_SIZE(maxFps), gr->GetName(), screenManager()));
+ maxFps_->OnChoice.Handle(this, &GameSettingsScreen::OnForceMaxEmulatedFPS);
+
PopupSliderChoice *altSpeed1 = graphicsSettings->Add(new PopupSliderChoice(&iAlternateSpeedPercent1_, 0, 1000, gr->T("Alternative Speed", "Alternative speed"), 5, screenManager(), gr->T("%, 0:unlimited")));
altSpeed1->SetFormat("%i%%");
altSpeed1->SetZeroLabel(gr->T("Unlimited"));
@@ -1337,6 +1342,16 @@ UI::EventReturn GameSettingsScreen::OnDisplayLayoutEditor(UI::EventParams &e) {
return UI::EVENT_DONE;
};
+UI::EventReturn GameSettingsScreen::OnForceMaxEmulatedFPS(UI::EventParams &e) {
+ if (maxFpsChoice > 0) {
+ g_Config.iForceMaxEmulatedFPS = (maxFpsChoice * 10);
+ } else {
+ g_Config.iForceMaxEmulatedFPS = 0;
+ }
+ Reporting::UpdateConfig();
+ return UI::EVENT_DONE;
+}
+
UI::EventReturn GameSettingsScreen::OnResolutionChange(UI::EventParams &e) {
if (g_Config.iAndroidHwScale == 1) {
RecreateActivity();
diff --git a/UI/GameSettingsScreen.h b/UI/GameSettingsScreen.h
index 2fd7d6e59..6e9f1db70 100644
--- a/UI/GameSettingsScreen.h
+++ b/UI/GameSettingsScreen.h
@@ -59,6 +59,7 @@ class GameSettingsScreen : public UIDialogScreenWithGameBackground {
UI::Choice *displayEditor_;
UI::Choice *backgroundChoice_ = nullptr;
UI::PopupMultiChoice *resolutionChoice_;
+ UI::PopupMultiChoice *maxFps_;
UI::CheckBox *frameSkipAuto_;
SettingInfoMessage *settingInfo_;
UI::Choice *clearSearchChoice_;
@@ -107,6 +108,7 @@ class GameSettingsScreen : public UIDialogScreenWithGameBackground {
UI::EventReturn OnFullscreenMultiChange(UI::EventParams &e);
UI::EventReturn OnDisplayLayoutEditor(UI::EventParams &e);
UI::EventReturn OnResolutionChange(UI::EventParams &e);
+ UI::EventReturn OnForceMaxEmulatedFPS(UI::EventParams &e);
UI::EventReturn OnHwScaleChange(UI::EventParams &e);
UI::EventReturn OnRestoreDefaultSettings(UI::EventParams &e);
UI::EventReturn OnRenderingMode(UI::EventParams &e);
@@ -135,6 +137,7 @@ class GameSettingsScreen : public UIDialogScreenWithGameBackground {
UI::EventReturn OnClearSearchFilter(UI::EventParams &e);
// Temporaries to convert setting types, cache enabled, etc.
+ int maxFpsChoice;
int iAlternateSpeedPercent1_;
int iAlternateSpeedPercent2_;
int iAlternateSpeedPercentAnalog_;

View file

@ -4,7 +4,7 @@
# Copyright (C) 2022-present Fewtarius
PKG_NAME="flycastsa"
PKG_VERSION="611946559c12a569af507019694cb369b3587af6"
PKG_VERSION="cca7ed6bf7a04fb79f13fb3881220f226f0b512f"
PKG_LICENSE="GPLv2"
PKG_SITE="https://github.com/flyinghead/flycast"
PKG_URL="${PKG_SITE}.git"

View file

@ -2,7 +2,7 @@
# Copyright (C) 2018-present 5schatten (https://github.com/5schatten)
PKG_NAME="hatarisa"
PKG_VERSION="388b1f32c885fcb497a914b351fa58354e86bf6a"
PKG_VERSION="87f279247e14b7a987859b8883dc4464742f6005"
PKG_LICENSE="GPL"
PKG_SITE="https://github.com/hatari/hatari"
PKG_URL="https://github.com/hatari/hatari/archive/${PKG_VERSION}.tar.gz"

View file

@ -0,0 +1,147 @@
Key_A=-1
Key_B=-1
Key_Select=-1
Key_Start=-1
Key_Right=-1
Key_Left=-1
Key_Up=-1
Key_Down=-1
Key_R=-1
Key_L=-1
Key_X=-1
Key_Y=-1
Joy_A=1
Joy_B=0
Joy_Select=6
Joy_Start=7
Joy_Right=65794
Joy_Left=1114376
Joy_Up=17891585
Joy_Down=16843012
Joy_R=86114303
Joy_L=35782655
Joy_X=3
Joy_Y=2
HKKey_Lid=-1
HKKey_Mic=-1
HKKey_Pause=-1
HKKey_Reset=-1
HKKey_FastForward=-1
HKKey_FastForwardToggle=-1
HKKey_FullscreenToggle=-1
HKKey_SwapScreens=-1
HKKey_SolarSensorDecrease=-1
HKKey_SolarSensorIncrease=-1
HKKey_FrameStep=-1
HKKey_SaveState=-1
HKKey_LoadState=-1
HKJoy_Lid=-1
HKJoy_Mic=10
HKJoy_Pause=-1
HKJoy_Reset=-1
HKJoy_FastForward=-1
HKJoy_FastForwardToggle=-1
HKJoy_FullscreenToggle=-1
HKJoy_SwapScreens=9
HKJoy_SolarSensorDecrease=-1
HKJoy_SolarSensorIncrease=-1
HKJoy_FrameStep=-1
HKJoy_SaveState=5
HKJoy_LoadState=4
JoystickID=0
WindowWidth=1920
WindowHeight=1080
WindowMax=0
ScreenRotation=0
ScreenGap=0
ScreenLayout=2
ScreenSwap=0
ScreenSizing=3
IntegerScaling=0
ScreenAspectTop=0
ScreenAspectBot=0
ScreenFilter=1
ScreenUseGL=0
ScreenVSync=0
ScreenVSyncInterval=1
3DRenderer=0
Threaded3D=1
GL_ScaleFactor=1
GL_BetterPolygons=0
LimitFPS=1
AudioSync=0
ShowOSD=1
ConsoleType=0
DirectBoot=1
JIT_Enable=0
JIT_MaxBlockSize=32
JIT_BranchOptimisations=1
JIT_LiteralOptimisations=1
JIT_FastMemory=1
ExternalBIOSEnable=0
BIOS9Path=
BIOS7Path=
FirmwarePath=
DSiBIOS9Path=
DSiBIOS7Path=
DSiFirmwarePath=
DSiNANDPath=
DLDIEnable=0
DLDISDPath=dldi.bin
DLDISize=0
DLDIReadOnly=0
DLDIFolderSync=0
DLDIFolderPath=
DSiSDEnable=0
DSiSDPath=dsisd.bin
DSiSDSize=0
DSiSDReadOnly=0
DSiSDFolderSync=0
DSiSDFolderPath=
FirmwareOverrideSettings=0
FirmwareUsername=melonDS
FirmwareLanguage=1
FirmwareBirthdayMonth=1
FirmwareBirthdayDay=1
FirmwareFavouriteColour=0
FirmwareMessage=
FirmwareMAC=
MPAudioMode=1
MPRecvTimeout=25
LANDevice=
DirectLAN=0
SavStaRelocSRAM=0
AudioInterp=0
AudioBitrate=0
AudioVolume=256
MicInputType=0
MicWavPath=
LastROMFolder=
RecentROM_0=
RecentROM_1=
RecentROM_2=
RecentROM_3=
RecentROM_4=
RecentROM_5=
RecentROM_6=
RecentROM_7=
RecentROM_8=
RecentROM_9=
SaveFilePath=/storage/roms/nds
SavestatePath=/storage/roms/savestates/nds
CheatFilePath=
EnableCheats=0
MouseHide=0
MouseHideSeconds=5
PauseLostFocus=0
DSBatteryLevelOkay=1
DSiBatteryLevel=15
DSiBatteryCharging=1
Camera0_InputType=0
Camera0_ImagePath=
Camera0_CamDeviceName=
Camera0_XFlip=0
Camera1_InputType=0
Camera1_ImagePath=
Camera1_CamDeviceName=
Camera1_XFlip=0

View file

@ -0,0 +1,44 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2023-present BrooksyTech (https://github.com/brooksytech)
PKG_NAME="melondssa"
PKG_VERSION="00edeb3c3c053bc2b3c9ac83e33688626498f2cc"
PKG_LICENSE="GPLv3"
PKG_SITE="https://github.com/melonDS-emu/melonDS"
PKG_URL="${PKG_SITE}.git"
PKG_DEPENDS_TARGET="SDL2 qt5 libslirp libepoxy libarchive ecm"
PKG_LONGDESC="DS emulator, sorta. The goal is to do things right and fast"
PKG_TOOLCHAIN="cmake"
if [ ! "${OPENGL}" = "no" ]; then
PKG_DEPENDS_TARGET+=" ${OPENGL} glu libglvnd"
fi
if [ "${OPENGLES_SUPPORT}" = yes ]; then
PKG_DEPENDS_TARGET+=" ${OPENGLES}"
fi
if [ "${DISPLAYSERVER}" = "wl" ]; then
PKG_DEPENDS_TARGET+=" wayland ${WINDOWMANAGER} xorg-server xrandr libXi"
fi
if [ "${VULKAN_SUPPORT}" = "yes" ]
then
PKG_DEPENDS_TARGET+=" vulkan-loader vulkan-headers"
fi
PKG_CMAKE_OPTS_TARGET+=" -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="/usr" \
-DBUILD_SHARED_LIBS=OFF"
makeinstall_target() {
mkdir -p ${INSTALL}/usr/bin
cp -rf ${PKG_BUILD}/.${TARGET_NAME}/melonDS ${INSTALL}/usr/bin
mkdir -p ${INSTALL}/usr/config/melonDS
cp -rf ${PKG_DIR}/config/${DEVICE}/* ${INSTALL}/usr/config/melonDS
cp -rf ${PKG_DIR}/scripts/* ${INSTALL}/usr/bin
chmod +x ${INSTALL}/usr/bin/start_melonds.sh
}

View file

@ -0,0 +1,118 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2023-present BrooksyTech (https://github.com/brooksytech)
diff -rupN melonDS.orig/src/frontend/qt_sdl/Config.cpp melonDS/src/frontend/qt_sdl/Config.cpp
--- melonDS.orig/src/frontend/qt_sdl/Config.cpp 2023-01-20 17:14:09.563747030 -0800
+++ melonDS/src/frontend/qt_sdl/Config.cpp 2023-01-21 17:24:03.796484493 -0800
@@ -185,6 +185,8 @@ ConfigEntry ConfigFile[] =
{"HKKey_SolarSensorDecrease", 0, &HKKeyMapping[HK_SolarSensorDecrease], -1, true},
{"HKKey_SolarSensorIncrease", 0, &HKKeyMapping[HK_SolarSensorIncrease], -1, true},
{"HKKey_FrameStep", 0, &HKKeyMapping[HK_FrameStep], -1, true},
+ {"HKKey_SaveState", 0, &HKKeyMapping[HK_SaveState], -1, true},
+ {"HKKey_LoadState", 0, &HKKeyMapping[HK_LoadState], -1, true},
{"HKJoy_Lid", 0, &HKJoyMapping[HK_Lid], -1, true},
{"HKJoy_Mic", 0, &HKJoyMapping[HK_Mic], -1, true},
@@ -197,6 +199,8 @@ ConfigEntry ConfigFile[] =
{"HKJoy_SolarSensorDecrease", 0, &HKJoyMapping[HK_SolarSensorDecrease], -1, true},
{"HKJoy_SolarSensorIncrease", 0, &HKJoyMapping[HK_SolarSensorIncrease], -1, true},
{"HKJoy_FrameStep", 0, &HKJoyMapping[HK_FrameStep], -1, true},
+ {"HKJoy_SaveState", 0, &HKJoyMapping[HK_SaveState], -1, true},
+ {"HKJoy_LoadState", 0, &HKJoyMapping[HK_LoadState], -1, true},
{"JoystickID", 0, &JoystickID, 0, true},
diff -rupN melonDS.orig/src/frontend/qt_sdl/Config.h melonDS/src/frontend/qt_sdl/Config.h
--- melonDS.orig/src/frontend/qt_sdl/Config.h 2023-01-20 17:14:09.563747030 -0800
+++ melonDS/src/frontend/qt_sdl/Config.h 2023-01-21 17:24:03.796484493 -0800
@@ -35,6 +35,8 @@ enum
HK_SolarSensorDecrease,
HK_SolarSensorIncrease,
HK_FrameStep,
+ HK_SaveState,
+ HK_LoadState,
HK_MAX
};
diff -rupN melonDS.orig/src/frontend/qt_sdl/InputConfig/InputConfigDialog.cpp melonDS/src/frontend/qt_sdl/InputConfig/InputConfigDialog.cpp
--- melonDS.orig/src/frontend/qt_sdl/InputConfig/InputConfigDialog.cpp 2023-01-20 17:14:09.563747030 -0800
+++ melonDS/src/frontend/qt_sdl/InputConfig/InputConfigDialog.cpp 2023-01-21 17:24:03.800484522 -0800
@@ -60,7 +60,9 @@ const int hk_general[] =
HK_FullscreenToggle,
HK_Lid,
HK_Mic,
- HK_SwapScreens
+ HK_SwapScreens,
+ HK_SaveState,
+ HK_LoadState
};
const char* hk_general_labels[] =
@@ -73,12 +75,14 @@ const char* hk_general_labels[] =
"Toggle fullscreen",
"Close/open lid",
"Microphone",
- "Swap screens"
+ "Swap screens",
+ "Save State",
+ "Load State"
};
const int keypad_num = 12;
const int hk_addons_num = 2;
-const int hk_general_num = 9;
+const int hk_general_num = 11;
InputConfigDialog::InputConfigDialog(QWidget* parent) : QDialog(parent), ui(new Ui::InputConfigDialog)
diff -rupN melonDS.orig/src/frontend/qt_sdl/InputConfig/InputConfigDialog.h melonDS/src/frontend/qt_sdl/InputConfig/InputConfigDialog.h
--- melonDS.orig/src/frontend/qt_sdl/InputConfig/InputConfigDialog.h 2023-01-20 17:14:09.563747030 -0800
+++ melonDS/src/frontend/qt_sdl/InputConfig/InputConfigDialog.h 2023-01-21 17:24:03.800484522 -0800
@@ -67,7 +67,7 @@ private:
int keypadKeyMap[12], keypadJoyMap[12];
int addonsKeyMap[2], addonsJoyMap[2];
- int hkGeneralKeyMap[9], hkGeneralJoyMap[9];
+ int hkGeneralKeyMap[11], hkGeneralJoyMap[11];
};
diff -rupN melonDS.orig/src/frontend/qt_sdl/main.cpp melonDS/src/frontend/qt_sdl/main.cpp
--- melonDS.orig/src/frontend/qt_sdl/main.cpp 2023-01-20 17:14:09.567747058 -0800
+++ melonDS/src/frontend/qt_sdl/main.cpp 2023-01-21 17:24:03.804484550 -0800
@@ -426,7 +426,9 @@ EmuThread::EmuThread(QObject* parent) :
connect(this, SIGNAL(screenLayoutChange()), mainWindow->panelWidget, SLOT(onScreenLayoutChanged()));
connect(this, SIGNAL(windowFullscreenToggle()), mainWindow, SLOT(onFullscreenToggled()));
connect(this, SIGNAL(swapScreensToggle()), mainWindow->actScreenSwap, SLOT(trigger()));
-
+ connect(this, SIGNAL(hkSaveState()), mainWindow->actSaveState[1], SLOT(trigger()));
+ connect(this, SIGNAL(hkLoadState()), mainWindow->actLoadState[1], SLOT(trigger()));
+
static_cast<ScreenPanelGL*>(mainWindow->panel)->transferLayout(this);
}
@@ -596,7 +598,10 @@ void EmuThread::run()
if (Input::HotkeyPressed(HK_FullscreenToggle)) emit windowFullscreenToggle();
if (Input::HotkeyPressed(HK_SwapScreens)) emit swapScreensToggle();
-
+
+ if (Input::HotkeyPressed(HK_SaveState)) emit hkSaveState();
+ if (Input::HotkeyPressed(HK_LoadState)) emit hkLoadState();
+
if (Input::HotkeyPressed(HK_SolarSensorDecrease))
{
int level = GBACart::SetInput(GBACart::Input_SolarSensorDown, true);
diff -rupN melonDS.orig/src/frontend/qt_sdl/main.h melonDS/src/frontend/qt_sdl/main.h
--- melonDS.orig/src/frontend/qt_sdl/main.h 2023-01-20 17:14:09.567747058 -0800
+++ melonDS/src/frontend/qt_sdl/main.h 2023-01-21 17:24:03.804484550 -0800
@@ -85,6 +85,9 @@ signals:
void windowFullscreenToggle();
void swapScreensToggle();
+
+ void hkSaveState();
+ void hkLoadState();
private:
void drawScreenGL();

View file

@ -0,0 +1,14 @@
diff --git a/src/frontend/qt_sdl/Config.cpp b/src/frontend/qt_sdl/Config.cpp
index 7a0ec698ba..0b06f8f120 100644
--- a/src/frontend/qt_sdl/Config.cpp
+++ b/src/frontend/qt_sdl/Config.cpp
@@ -143,8 +143,7 @@ bool DSiBatteryCharging;
CameraConfig Camera[2];
-const char* kConfigFile = "melonDS.ini";
-const char* kUniqueConfigFile = "melonDS.%d.ini";
+const char* kConfigFile = "/storage/.config/melonDS/melonDS.ini";
ConfigEntry ConfigFile[] =
{

View file

@ -0,0 +1,65 @@
diff --git a/src/frontend/qt_sdl/Config.cpp b/src/frontend/qt_sdl/Config.cpp
index c91d6ef911..549a41ddb2 100644
--- a/src/frontend/qt_sdl/Config.cpp
+++ b/src/frontend/qt_sdl/Config.cpp
@@ -335,14 +335,7 @@ ConfigEntry ConfigFile[] =
void LoadFile(int inst)
{
FILE* f;
- if (inst > 0)
- {
- char name[100] = {0};
- snprintf(name, 99, kUniqueConfigFile, inst+1);
- f = Platform::OpenLocalFile(name, "r");
- }
- else
- f = Platform::OpenLocalFile(kConfigFile, "r");
+ f = Platform::OpenLocalFile(kConfigFile, "r");
if (!f) return;
@@ -362,9 +355,6 @@ void LoadFile(int inst)
{
if (!strncmp(entry->Name, entryname, 32))
{
- if ((inst > 0) && (!entry->InstanceUnique))
- break;
-
switch (entry->Type)
{
case 0: *(int*)entry->Value = strtol(entryval, NULL, 10); break;
@@ -394,10 +384,6 @@ void Load()
}
LoadFile(0);
-
- int inst = Platform::InstanceID();
- if (inst > 0)
- LoadFile(inst);
}
void Save()
@@ -405,22 +391,12 @@ void Save()
int inst = Platform::InstanceID();
FILE* f;
- if (inst > 0)
- {
- char name[100] = {0};
- snprintf(name, 99, kUniqueConfigFile, inst+1);
- f = Platform::OpenLocalFile(name, "w");
- }
- else
- f = Platform::OpenLocalFile(kConfigFile, "w");
+ f = Platform::OpenLocalFile(kConfigFile, "w");
if (!f) return;
for (ConfigEntry* entry = &ConfigFile[0]; entry->Value; entry++)
{
- if ((inst > 0) && (!entry->InstanceUnique))
- continue;
-
switch (entry->Type)
{
case 0: fprintf(f, "%s=%d\r\n", entry->Name, *(int*)entry->Value); break;

View file

@ -0,0 +1,17 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2023-present BrooksyTech (https://github.com/brooksytech)
. /etc/profile
if [ ! -d "/storage/.config/melonDS" ]; then
mkdir -p "/storage/.config/melonDS"
cp -r "/usr/config/melonDS" "/storage/.config/"
fi
if [ ! -d "/storage/roms/savestates/nds" ]; then
mkdir -p "/storage/roms/savestates/nds"
fi
melonDS -f "${1}"

View file

@ -3,7 +3,6 @@
PKG_NAME="mupen64plussa-core"
PKG_VERSION="ba9a52483052248b67c324e3fd0e073b807bbea4"
PKG_SHA256=""
PKG_LICENSE="GPLv2"
PKG_SITE="https://github.com/mupen64plus/mupen64plus-core"
PKG_URL="https://github.com/mupen64plus/mupen64plus-core/archive/${PKG_VERSION}.tar.gz"

View file

@ -4,7 +4,6 @@
PKG_NAME="mupen64plussa"
PKG_VERSION="61bf24c41bc837e7a3c43cd53c1a2af9042543ff"
PKG_SHA256=""
PKG_LICENSE="GPL"
PKG_SITE="https://mupen64plus.org/"
PKG_URL=""

View file

@ -2,7 +2,7 @@
# Copyright (C) 2022-present Fewtarius
PKG_NAME="pcsx2sa"
PKG_VERSION="v1.7.3674"
PKG_VERSION="v1.7.3921"
PKG_ARCH="x86_64"
PKG_LICENSE="GPLv3"
PKG_SITE="https://github.com/pcsx2/pcsx2"

View file

@ -2,7 +2,7 @@
# Copyright (C) 2022-present Fewtarius
PKG_NAME="pico-8"
PKG_VERSION="4c282e6eb947eab2e3ab54f3fe47d1aa9f539c0c"
PKG_VERSION="8f40a51b9a2db69f2fd1238f1f81a2381d40551d"
PKG_ARCH="any"
PKG_LICENSE="GPLv2"
PKG_SITE=""

View file

@ -2,7 +2,7 @@
# Copyright (C) 2021-present 351ELEC (https://github.com/351ELEC)
PKG_NAME="retroarch"
PKG_VERSION="7213aada8d5fef72a93379a0d700bb1b678e4a70"
PKG_VERSION="d689a84581c02e7ec76a05eace0723f5ddd5b791"
PKG_SITE="https://github.com/libretro/RetroArch"
PKG_URL="${PKG_SITE}.git"
PKG_LICENSE="GPLv3"

View file

@ -1 +0,0 @@
X86_64

View file

@ -3,11 +3,11 @@
# Copyright (C) 2020-present Fewtarius
PKG_NAME="scummvmsa"
PKG_VERSION="7a3ce2ff5cf3052b0241dbc58514e08138cf7560"
PKG_VERSION="1fcd63bf1e0d7deeed0332c1b57d8514ef5ccb4a"
PKG_REV="1"
PKG_LICENSE="GPL2"
PKG_SITE="https://github.com/scummvm/scummvm"
PKG_URL="${PKG_SITE}/archive/${PKG_VERSION}.tar.gz"
PKG_URL="${PKG_SITE}.git"
PKG_DEPENDS_TARGET="toolchain SDL2 SDL2_net freetype fluidsynth"
PKG_SHORTDESC="Script Creation Utility for Maniac Mansion Virtual Machine"
PKG_LONGDESC="ScummVM is a program which allows you to run certain classic graphical point-and-click adventure games, provided you already have their data files."

View file

@ -20,7 +20,7 @@
################################################################################
PKG_NAME="TIC-80"
PKG_VERSION="6ef9fdabc8542c643c0434f80f72465e71ffc84d"
PKG_VERSION="ca3bb11f7d91b6f61c30b27e95958521e3432576"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPLv3"

View file

@ -20,7 +20,7 @@
################################################################################
PKG_NAME="beetle-lynx"
PKG_VERSION="d48ebb62affc93940f121bc5a16a67658bca26ae"
PKG_VERSION="74603da1ee8f934e5edd31dffad44a69a569e4d0"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPLv2"

View file

@ -20,7 +20,7 @@
################################################################################
PKG_NAME="beetle-pce-fast"
PKG_VERSION="994372c491569c84bd8d5178ca1822fc1200e7c0"
PKG_VERSION="411176fbae51ff9d052e1775adeff1375c0dd6e0"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPLv2"

View file

@ -20,7 +20,7 @@
################################################################################
PKG_NAME="beetle-pce"
PKG_VERSION="c61a633e4598edc46da3b6bed24b27175b353a8d"
PKG_VERSION="f2750b72b58cbc9be0d7d9345bbdeeb634be64a8"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPLv2"

View file

@ -20,7 +20,7 @@
################################################################################
PKG_NAME="beetle-pcfx"
PKG_VERSION="14294f9617da36f6a24f736b41f1fa0de24c9f83"
PKG_VERSION="45fa33f020e245f7681fc061b63064ec5bbf73c1"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPLv2"

View file

@ -2,7 +2,7 @@
# Copyright (C) 2022-present BrooksyTech (https://github.com/brooksytech)
PKG_NAME="beetle-saturn"
PKG_VERSION="054862a4ccb9b2f1bad9e5b075fc3d1116dc8055"
PKG_VERSION="19ce186783174b93b90845c3f0e1fa1694904912"
PKG_LICENSE="GPLv2"
PKG_SITE="https://github.com/libretro/beetle-saturn-libretro"
PKG_URL="$PKG_SITE.git"

View file

@ -20,7 +20,7 @@
################################################################################
PKG_NAME="beetle-supergrafx"
PKG_VERSION="7c435d6d83ce54eb2782df75c05acd9f4eac6f34"
PKG_VERSION="4e7272be6feeecd1c4d793181c42d1eae289f3f2"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPLv2"

View file

@ -20,7 +20,7 @@
################################################################################
PKG_NAME="beetle-wswan"
PKG_VERSION="75f65e384bf0319f75b535bd6910616a6786d20e"
PKG_VERSION="d9b4faf720c8f7a6795d8a12e4bd808fe8d3e602"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPLv2"

View file

@ -2,7 +2,7 @@
# Copyright (C) 2022-present BrooksyTech (https://github.com/brooksytech)
PKG_NAME="bsnes"
PKG_VERSION="b04ea7236fc05c2e2c5dc645bbdba8c90196bb5f"
PKG_VERSION="dabf6679024124b2f819c79f279dbb85a5263255"
PKG_LICENSE="GPLv2"
PKG_SITE="https://github.com/libretro/bsnes-libretro"
PKG_URL="$PKG_SITE/archive/$PKG_VERSION.tar.gz"

View file

@ -20,7 +20,7 @@
################################################################################
PKG_NAME="core-info"
PKG_VERSION="5fa19a5e944ecdb830011a66e9150e0b01b8bf30"
PKG_VERSION="a8e9ddd9d5cb50d35d9fa8655a0867d15c64e133"
PKG_LICENSE="GPL"
PKG_SITE="https://github.com/libretro/libretro-core-info"
PKG_URL="https://github.com/libretro/libretro-core-info/archive/${PKG_VERSION}.tar.gz"

View file

@ -3,7 +3,7 @@
# Maintenance 2020 351ELEC team (https://github.com/fewtarius/351ELEC)
PKG_NAME="fbneo"
PKG_VERSION="1a968de5d8c52ef4b606c1ab0878c7859449c355"
PKG_VERSION="0cb23c77be72f6827dd0fa866828e1a54fcfcc42"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="Non-commercial"

View file

@ -3,7 +3,7 @@
# Copyright (C) 2022-present Fewtarius
PKG_NAME="flycast"
PKG_VERSION="1e195b7237afceeef725e4f45afd9821e34bf53c"
PKG_VERSION="cca7ed6bf7a04fb79f13fb3881220f226f0b512f"
PKG_SITE="https://github.com/flyinghead/flycast"
PKG_URL="${PKG_SITE}.git"
PKG_DEPENDS_TARGET="toolchain libzip"

View file

@ -20,7 +20,7 @@
################################################################################
PKG_NAME="gambatte"
PKG_VERSION="d4bb33eea4c41760eb3cccfc4047eeff1313f8c7"
PKG_VERSION="ca0f7e14c55698a8eb81ea5af58701173e85bc7f"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPLv2"

View file

@ -20,7 +20,7 @@
################################################################################
PKG_NAME="genesis-plus-gx"
PKG_VERSION="d9ed3003b7d470ee19c9fe0019263f617fa458eb"
PKG_VERSION="f2a5adf3cfce42d1e195a239ff6647335bc2742e"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="Non-commercial"

View file

@ -2,7 +2,7 @@
# Copyright (C) 2019 Trond Haugland (trondah@gmail.com)
PKG_NAME="mame"
PKG_VERSION="b1bd6059a6b76061cbc1b397317b4c9cbb9b3b1c"
PKG_VERSION="f7761a9902d59030882c58d4482446196e748c50"
PKG_ARCH="any"
PKG_LICENSE="GPLv2"
PKG_SITE="https://github.com/libretro/mame"

View file

@ -20,7 +20,7 @@
################################################################################
PKG_NAME="mame2003-plus"
PKG_VERSION="3e666d814f6080d364570a7d9033e0dad233d4f6"
PKG_VERSION="926d85c9404cbfae765c5560ba24f4074f9ce5de"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="MAME"

View file

@ -2,7 +2,7 @@
# Copyright (C) 2020-present Fewtarius
PKG_NAME="mupen64plus-nx"
PKG_VERSION="bc241538b9ef85d8b22c392d7699dc73f460e283"
PKG_VERSION="4d270850bd09f8630110da701b73107e45a6e202"
PKG_LICENSE="GPLv2"
PKG_SITE="https://github.com/libretro/mupen64plus-libretro-nx"
PKG_URL="${PKG_SITE}/archive/${PKG_VERSION}.tar.gz"

View file

@ -1,5 +1,5 @@
PKG_NAME="picodrive"
PKG_VERSION="97fa8bcd1644aea1fbc841e41d76df3c1bffc949"
PKG_VERSION="80d31d727d45be13813920078259c6dce7973f42"
PKG_LICENSE="MAME"
PKG_SITE="https://github.com/libretro/picodrive"
PKG_URL="${PKG_SITE}.git"

View file

@ -19,7 +19,7 @@
################################################################################
PKG_NAME="ppsspp"
PKG_VERSION="5f10cabe5a0a4442e642d473f360e309288dd5f4"
PKG_VERSION="ece6edfe83db1cc45fce5f760db9104440465b8a"
PKG_LICENSE="GPLv2"
PKG_SITE="https://github.com/hrydgard/ppsspp"
PKG_URL="https://github.com/hrydgard/ppsspp.git"

View file

@ -20,7 +20,7 @@
################################################################################
PKG_NAME="puae"
PKG_VERSION="632f3ecd307875de31086a30e0e806eb03b3840b"
PKG_VERSION="a9d5795261d52df75ebb8c031c86a48d66ed5d8a"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"

View file

@ -19,7 +19,7 @@
################################################################################
PKG_NAME="px68k"
PKG_VERSION="82350669b834f89f62dfa353188598e42c3a8d83"
PKG_VERSION="4c7542e34df71e3ebab77b5867901747d58dbb38"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="Unknown"

View file

@ -20,7 +20,7 @@
################################################################################
PKG_NAME="scummvm"
PKG_VERSION="1429134"
PKG_VERSION="a2b8ea7d419bc38b96b5956fd8f635cbad9d29cb"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPLv2"

View file

@ -20,7 +20,7 @@
################################################################################
PKG_NAME="slang-shaders"
PKG_VERSION="379eeca"
PKG_VERSION="adbe2b98ff97a8f5939fbd8c6f063aee46a999d3"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"

View file

@ -20,7 +20,7 @@
################################################################################
PKG_NAME="stella"
PKG_VERSION="d05957510a33cdd96d667aa39b092345ae8e9843"
PKG_VERSION="9d46bb614f81c91513acc3b06c8d9865c24d8c3c"
PKG_REV="1"
PKG_LICENSE="GPL2"
PKG_SITE="https://github.com/stella-emu/stella"

View file

@ -3,7 +3,7 @@
# Maintenance 2020 351ELEC team (https://github.com/fewtarius/351ELEC)
PKG_NAME="swanstation"
PKG_VERSION="82390b89fe73b4abd2df6ac7b5dae319ff7785a4"
PKG_VERSION="9c2ed9e91774f1d96b5105e4c68e06143ec741a8"
PKG_ARCH=""
PKG_LICENSE="GPLv3"
PKG_SITE="https://github.com/libretro/swanstation"

View file

@ -18,7 +18,6 @@
PKG_NAME="SDL"
PKG_VERSION="92927a9b689c55c5879add79378e24f9443f56f4"
#PKG_SHA256=""
PKG_ARCH="any"
PKG_LICENSE="GPL"
PKG_SITE="https://www.libsdl.org/"

View file

@ -25,6 +25,7 @@ audio.bgmusic=1
audio.device=headphone
audio.display_titles=1
audio.persystem=0
audio.preamp=50
audio.volume=75
bluetooth.enabled=0
boot=Emulationstation
@ -87,7 +88,6 @@ global.retroachievements.verbose=0
global.retroarch.menu_driver=ozone
global.runahead=0
global.secondinstance=0
gpu.powersave=0
intellivision.integerscale=0
intellivision.ratio=4/3
ipv6.enabled=0
@ -182,6 +182,7 @@ system.hostname=@DEVICENAME@
system.language=en_US
system.overclock=off
system.cpugovernor=schedutil
system.powersave=0
system.timezone=America/New_York
system.automount=1
system.autohotkeys=1

View file

@ -24,7 +24,7 @@ fi
PKG_BASEOS="plymouth-lite grep wget libjpeg-turbo util-linux xmlstarlet bluetool gnupg gzip patchelf \
imagemagick terminus-font vim bash pyudev dialog six git dbus-python coreutils miniupnpc \
nss-mdns avahi alsa-ucm-conf MC fbgrab modules system-utils autostart powerstate"
nss-mdns avahi alsa-ucm-conf MC fbgrab modules system-utils autostart powerstate powertop"
PKG_UI="emulationstation es-themes"

View file

@ -63,3 +63,9 @@ get_es_setting() {
echo $(sed -n "s|\s*<${1} name=\"${2}\" value=\"\(.*\)\" />|\1|p" ${ES_CONF})
}
log() {
SOURCE=${1//\/*\//}
MESSAGE=${*#${1}}
MESSAGE=${MESSAGE# }
logger -t ${SOURCE} "${MESSAGE}"
}

View file

@ -0,0 +1,80 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2022-present Fewtarius (https://github.com/fewtarius)
gpu_power_profile() {
for card in /sys/class/drm/card*/device/pp_power_profile_mode
do
if [ -e "${card}" ]
then
echo ${1} >${card} 2>/dev/null
fi
done
}
gpu_performance_level() {
for card in /sys/class/drm/card*/device/power_dpm_force_performance_level
do
if [ -e "${card}" ]
then
echo ${1} >${card} 2>/dev/null
fi
done
}
pcie_aspm_policy() {
if [ -e "/sys/module/pcie_aspm/parameters/policy" ]
then
echo ${1} >/sys/module/pcie_aspm/parameters/policy 2>/dev/null
fi
}
cpu_perftune() {
CPU="$(awk '/vendor_id/ {print $3;exit}' /proc/cpuinfo)"
if [ "${CPU}" = "AuthenticAMD" ]
then
if [ "${1}" = "battery" ]
then
ryzenadj --power-saving >/dev/null 2>&1
else
ryzenadj --max-performance >/dev/null 2>&1
fi
elif [ "${CPU}" = "GenuineIntel" ]
then
for policy in $(find /sys/devices/system/cpu/cpufreq/policy*/ -name energy_performance_preference)
do
if [ "${1}" = "battery" ]
then
echo power >${policy} >/dev/null 2>&1
else
echo performance >${policy} >/dev/null 2>&1
fi
done
fi
}
audio_powersave() {
for MODULE in snd_hda_intel snd_ac97_codec
do
if [ -e "/sys/module/${MODULE}/parameters/power_save" ]
then
echo ${1} >/sys/module/${MODULE}/parameters/power_save 2>/dev/null
fi
done
}
device_powersave() {
case ${1} in
1)
PSMODE=auto
;;
*)
PSMODE=on
;;
esac
find /sys/devices -name control -print0 | \
while read -r -d '' DEVICE
do
echo ${PSMODE} >"${DEVICE}" 2>/dev/null
done
}

View file

@ -98,12 +98,12 @@ then
cp -f /usr/config/smb.conf /storage/.config
fi
# Set GPU power saving by default
GPUPOWER=$(get_setting gpu.powersave)
if [ -z "${GPUPOWER}" ]
# Set enhanced power saving off by default
ENHPOWER=$(get_setting system.powersave)
if [ -z "${ENHPOWER}" ]
then
echo "Set up GPU power saving..." >>${LOG}
set_setting gpu.powersave 0
echo "Set up enhanced power saving..." >>${LOG}
set_setting system.powersave 0
fi
# Set automatic hotkey management by default.
@ -140,9 +140,28 @@ CheckAtStartup = false
EOF
fi
# the controller profile has been renamed.
if [ -e "/storage/.config/profile.d/99-controller" ]
then
rm -f /storage/.config/profile.d/99-controller
mkcontroller
fi
# Set a default for the audio preamp
PREAMP=$(get_setting audio.preamp)
if [ -z "${PREAMP}" ]
then
echo "Set default preamp." >>${LOG}
set_setting audio.preamp 50
fi
# Disable IPv6 by default
IPV6=$(get_setting ipv6.enabled)
if [ -z "${IPV6}" ]
then
echo "Disable ipv6." >>${LOG}
set_setting ipv6.enabled 0
fi
### Force everyone to the stable repo
set_setting updates.branch stable

View file

@ -23,7 +23,7 @@ mount_games() {
[ -e "${1}" ] && \
[ ! -e "/storage/.please_resize_me" ]
then
echo "Mounting ${1} on /storage/roms"
log $0 "Mounting ${1} on /storage/roms"
mount ${1} /storage/roms >/dev/null 2>&1
/usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/jelos-dirs.conf >/dev/null 2>&1
fi
@ -42,13 +42,13 @@ find_games() {
SIZE=$(awk '/'${ROOTDEV}'$/ {print $3}' /proc/partitions)
if (( ${SIZE} <= 8388608 ))
then
echo "Device ${ROOTDEV} is too small, ignoring."
log $0 "Device ${ROOTDEV} is too small, ignoring."
# We don't want to mount partitions smaller than ~8GB.
continue
fi
if [ -L "/sys/class/block/${ROOTDEV}boot0" ]
then
echo "Device ${ROOTDEV} might be Android, ignoring."
log $0 "Device ${ROOTDEV} might be Android, ignoring."
# Assume this is an android boot device and ignore it.
continue
fi

View file

@ -57,7 +57,7 @@ source /tmp/${OUTFILE}
echo "${CONTROLLER}" >/storage/.controller
cat <<EOF >/storage/.config/profile.d/99-controller
cat <<EOF >/storage/.config/profile.d/98-controller
DEVICE_BTN_SOUTH="${b}"
DEVICE_BTN_EAST="${a}"
DEVICE_BTN_NORTH="${x}"
@ -76,6 +76,7 @@ DEVICE_BTN_DPAD_DOWN="${down}"
DEVICE_BTN_DPAD_LEFT="${left}"
DEVICE_BTN_DPAD_RIGHT="${right}"
EOF
ln -sf /etc/profile.d/98-jslisten 99-jslisten
rm /tmp/${OUTFILE}

View file

@ -176,12 +176,12 @@ USING APPENDCONFIG : ${RAAPPENDCONF}
EOF
else
log "Emulation Run Log - Started at $(date)"
log $0 "Emulation Run Log - Started at $(date)"
fi
}
function quit() {
$VERBOSE && log "Cleaning up and exiting"
$VERBOSE && log $0 "Cleaning up and exiting"
bluetooth enable
jslisten stop
clear_screen
@ -192,14 +192,14 @@ function quit() {
}
function clear_screen() {
$VERBOSE && log "Clearing screen"
$VERBOSE && log $0 "Clearing screen"
clear
}
function bluetooth() {
if [ "$1" == "disable" ]
then
$VERBOSE && log "Disabling BT"
$VERBOSE && log $0 "Disabling BT"
if [[ "$BTENABLED" == "1" ]]
then
NPID=$(pgrep -f batocera-bluetooth-agent)
@ -209,7 +209,7 @@ function bluetooth() {
fi
elif [ "$1" == "enable" ]
then
$VERBOSE && log "Enabling BT"
$VERBOSE && log $0 "Enabling BT"
if [[ "$BTENABLED" == "1" ]]
then
systemd-run batocera-bluetooth-agent
@ -227,14 +227,16 @@ jslisten stop
### Per emulator/core configurations
if [ -z ${RETROARCH} ]
then
$VERBOSE && log "Configuring for a non-libretro emulator"
$VERBOSE && log $0 "Configuring for a non-libretro emulator"
case ${PLATFORM} in
"setup")
RUNTHIS='${TBASH} "${ROMNAME}"'
;;
"nds")
jslisten set "drastic"
RUNTHIS='${TBASH} /usr/bin/start_drastic.sh "${ROMNAME}"'
jslisten set "-9 melonDS"
if [ "$EMU" = "melondssa" ]; then
RUNTHIS='${TBASH} /usr/bin/start_melonds.sh "${ROMNAME}"'
fi
;;
"solarus")
if [ "$EMU" = "solarus" ]
@ -268,7 +270,7 @@ then
fi
;;
"psx")
jslisten set "duckstation-nogui"
jslisten set "-9 duckstation-nogui"
if [ "$EMU" = "duckstationsa" ]; then
RUNTHIS='${TBASH} /usr/bin/start_duckstation.sh "${ROMNAME}"'
fi
@ -327,7 +329,7 @@ then
RUNTHIS='${TBASH} "start_${CORE}.sh" "${ROMNAME}"'
esac
else
$VERBOSE && log "Configuring for a libretro core"
$VERBOSE && log $0 "Configuring for a libretro core"
### Set jslisten to kill the appropriate retroarch
jslisten set "retroarch retroarch32"
@ -465,7 +467,7 @@ if [ -e "${SHADERTMP}" ]
then
SHADERSET=$(cat ${SHADERTMP})
rm -f ${SHADERTMP}
$VERBOSE && log "Shader set to ${SHADERSET}"
$VERBOSE && log $0 "Shader set to ${SHADERSET}"
fi
if [[ ${SHADERSET} != 0 ]]; then
@ -473,15 +475,15 @@ if [[ ${SHADERSET} != 0 ]]; then
fi
clear_screen
$VERBOSE && log "executing game: ${ROMNAME}"
$VERBOSE && log "script to execute: ${RUNTHIS}"
$VERBOSE && log $0 "executing game: ${ROMNAME}"
$VERBOSE && log $0 "script to execute: ${RUNTHIS}"
# If the rom is a shell script just execute it, useful for DOSBOX and ScummVM scan scripts
if [[ "${ROMNAME}" == *".sh" ]]; then
$VERBOSE && log "Executing shell script ${ROMNAME}"
$VERBOSE && log $0 "Executing shell script ${ROMNAME}"
"${ROMNAME}" &>>${OUTPUT_LOG}
ret_error=$?
else
$VERBOSE && log "Executing $(eval echo ${RUNTHIS})"
$VERBOSE && log $0 "Executing $(eval echo ${RUNTHIS})"
eval ${RUNTHIS} &>>${OUTPUT_LOG}
ret_error=$?
fi
@ -519,17 +521,17 @@ then
INETUP=$(/usr/bin/amionline >/dev/null 2>&1)
if [ $? == 0 ]
then
log "backup saves to the cloud."
log $0 "backup saves to the cloud."
run /usr/bin/cloud_backup
fi
fi
$VERBOSE && log "Checking errors: ${ret_error} "
$VERBOSE && log $0 "Checking errors: ${ret_error} "
if [ "${ret_error}" == "0" ]
then
quit 0
else
log "exiting with $ret_error"
log $0 "exiting with $ret_error"
quit 1
fi

View file

@ -63,7 +63,7 @@ echo -n > "${RAAPPENDCONF}"
### Move operations to /tmp so we're not writing to the microSD slowing us down.
### Also test the file to ensure it's not 0 bytes which can happen if someone presses reset.
if [ ! -s ${RACONF} ]; then
log "Fix broken RA conf"
log $0 "Fix broken RA conf"
cp -f "${SOURCERACONF}" "${RACONF}"
fi
@ -72,14 +72,14 @@ if [ ! -d "${SNAPSHOTS}/${PLATFORM}" ]; then
fi
function doexit() {
log "Exiting.."
log $0 "Exiting.."
sync
exit 0
}
## This needs to be killed with fire.
function get_game_setting() {
log "Get Settings function (${1})"
log $0 "Get Settings function (${1})"
#We look for the setting on the ROM first, if not found we search for platform and lastly we search globally
escaped_rom_name=$(echo "${ROM}" | sed -E 's|([][])|\\\1|g')
PAT="s|^${PLATFORM}\[\"${escaped_rom_name}\"\][\.-]${1}=\(.*\)|\1|p"
@ -113,10 +113,10 @@ function array_contains () {
}
## Logging
log "setsettings.sh"
log "Platform: ${PLATFORM}"
log "ROM: ${ROM}"
log "Core: ${CORE}"
log $0 "setsettings.sh"
log $0 "Platform: ${PLATFORM}"
log $0 "ROM: ${ROM}"
log $0 "Core: ${CORE}"
##
## Global Setting that have to stay in retroarch.cfg
@ -662,7 +662,7 @@ get_game_setting "parallel_n64_controller_pak"
## atari800 core needs other settings when emulation atari5200
if [ "${CORE}" == "atari800" ]; then
log "Atari 800 section"
log $0 "Atari 800 section"
ATARICONF="/storage/.config/system/configs/atari800.cfg"
ATARI800CONF="/storage/.config/retroarch/config/Atari800/Atari800.opt"
[[ ! -f "$ATARI800CONF" ]] && touch "$ATARI800CONF"
@ -690,7 +690,7 @@ fi
## Gambatte
if [ "${CORE}" == "gambatte" ]; then
log "Gambatte section"
log $0 "Gambatte section"
GAMBATTECONF="/storage/.config/retroarch/config/Gambatte/Gambatte.opt"
if [ ! -f "$GAMBATTECONF" ]; then
# set some defaults
@ -718,7 +718,7 @@ CONTROLLERS="$@"
CONTROLLERS="${CONTROLLERS#*--controllers=*}"
for i in 1 2 3 4 5; do
log "Controller section (${1})"
log $0 "Controller section (${1})"
if [[ "$CONTROLLERS" == *p${i}* ]]; then
PINDEX="${CONTROLLERS#*-p${i}index }"
PINDEX="${PINDEX%% -p${i}guid*}"

View file

@ -5,7 +5,10 @@
. /etc/profile
COMMAND="$1"
if [ ! -d "" ]
then
mkdir -p "/storage/.cache/connman"
fi
### ES won't save the configuration in time
### for it to be useable by the script, so
@ -43,9 +46,11 @@ set_powersave() {
ENABLED=$(get_setting wifi.powersave)
if [ "${ENABLED}" = "1" ]
then
iw wlan0 set power_save on
log $0 "Enabling WIFI power saving."
iw wlan0 set power_save on 2>/dev/null
else
iw wlan0 set power_save off
log $0 "Disabling WIFI power saving."
iw wlan0 set power_save off 2>/dev/null
fi
}
@ -66,13 +71,19 @@ check_wifi() {
fi
}
set_wifi() {
case "${1}" in
"enable")
check_wifi
set_setting wifi.enabled 1
# Create the WIFI config.
cat > "${WIFICFG}" <<EOF
connect_wifi() {
STATE=$(get_wifi_state)
if [ ! "${STATE}" = "online" ]
then
connmanctl enable wifi 2>/dev/null
fi
rfkill unblock wifi 2>/dev/null
connmanctl connect $(get_wifi_service "${SSID}")
set_powersave 2>/dev/null
}
set_profile() {
cat > "${WIFICFG}" <<EOF
[global]
Name=${OS_NAME}
@ -80,49 +91,45 @@ Name=${OS_NAME}
Type = wifi
Name = ${SSID}
Passphrase = ${PSK}
AutoConnect = true
EOF
STATE=$(get_wifi_state)
if [ ! "${STATE}" = "online" ]
then
connmanctl enable wifi 2>/dev/null
fi
set_powersave 2>/dev/null
nohup connmanctl connect $(get_wifi_service "${SSID}") 2>/dev/null &
;;
"disable")
connmanctl disable wifi 2>/dev/null
rm -f "${WIFICFG}" 2>/dev/null
set_setting wifi.enabled 0
;;
"reconnect")
/usr/bin/wifictl disable
/usr/bin/wifictl enable
;;
"list")
#connmanctl services | cut -b 5- | awk '/wifi/ {sub(/\s+wifi_.*$/,"",$0);print}' | sort | uniq
list_wifi | awk '{sub(/\S+=/,"",$0);print}'
;;
"scan")
connmanctl scan wifi 2>/dev/null
;;
"scanlist")
set_wifi scan 2>/dev/null
list_wifi | awk '{sub(/\S+=/,"",$0);print}'
;;
"service")
get_wifi_service "${SSID}"
;;
"setpowersave")
set_powersave 2>/dev/null
;;
esac
}
if [ ! -d "" ]
then
mkdir -p "/storage/.cache/connman"
fi
case "${1}" in
enable)
check_wifi
set_setting wifi.enabled 1
set_profile
connect_wifi
;;
disable)
rfkill block wifi
connmanctl disable wifi
rm -f "${WIFICFG}" 2>/dev/null
set_setting wifi.enabled 0
;;
reconnect)
/usr/bin/wifictl disable
/usr/bin/wifictl enable
;;
list)
#connmanctl services | cut -b 5- | awk '/wifi/ {sub(/\s+wifi_.*$/,"",$0);print}' | sort | uniq
list_wifi | awk '{sub(/\S+=/,"",$0);print}'
;;
scan)
connmanctl scan wifi 2>/dev/null
;;
scanlist)
set_wifi scan 2>/dev/null
list_wifi | awk '{sub(/\S+=/,"",$0);print}'
;;
service)
get_wifi_service "${SSID}"
;;
setpowersave)
set_powersave
;;
setprofile)
set_profile
;;
esac
set_wifi ${COMMAND}

View file

@ -1 +0,0 @@
X86_64

View file

@ -3,7 +3,6 @@
PKG_NAME="libdvbpsi"
PKG_VERSION="1.3.3"
#PKG_SHA256=""
PKG_REV="2"
PKG_ARCH="any"
PKG_LICENSE="GPL"

View file

@ -4,7 +4,6 @@
PKG_NAME="mpv"
PKG_VERSION="25b66256d7ff48254b2055a066e29f260414112f"
PKG_SHA256=""
PKG_LICENSE="GPLv2+"
PKG_SITE="https://github.com/mpv-player/mpv"
PKG_URL="${PKG_SITE}/archive/${PKG_VERSION}.tar.gz"

View file

@ -4,7 +4,6 @@
PKG_NAME="x264"
PKG_VERSION="bfc87b7a330f75f5c9a21e56081e4b20344f139e"
#PKG_SHA256=""
PKG_LICENSE="GPL"
PKG_SITE="http://www.videolan.org/developers/x264.html"
PKG_URL="https://code.videolan.org/videolan/x264/-/archive/${PKG_VERSION}.tar.gz"

View file

@ -98,5 +98,5 @@ post_install() {
add_group avahi 495
enable_service avahi-defaults.service
enable_service avahi-daemon.service
#enable_service avahi-daemon.service
}

View file

@ -77,6 +77,6 @@ post_makeinstall_target() {
post_install() {
enable_service bluetooth-defaults.service
enable_service bluetooth.service
#enable_service bluetooth.service
enable_service obex.service
}

View file

@ -88,7 +88,4 @@ post_install() {
add_group system 430
enable_service connman.service
if [ "$WIREGUARD_SUPPORT" = "yes" ]; then
enable_service connman-vpn.service
fi
}

View file

@ -0,0 +1,11 @@
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2021-present Frank Hartung (supervisedthinking (@) gmail.com)
PKG_NAME="libslirp"
PKG_VERSION="4.6.1"
PKG_SHA256="69ad4df0123742a29cc783b35de34771ed74d085482470df6313b6abeb799b11"
PKG_LICENSE="OSS"
PKG_SITE="https://gitlab.freedesktop.org/slirp/libslirp"
PKG_URL="https://gitlab.freedesktop.org/slirp/libslirp/-/archive/v${PKG_VERSION}/${PKG_NAME}-v${PKG_VERSION}.tar.gz"
PKG_DEPENDS_TARGET="toolchain glib"
PKG_LONGDESC="A general purpose TCP-IP emulator used by virtual machine hypervisors to provide virtual networking services."

View file

@ -3,7 +3,7 @@
# Copyright (C) 2022-present Fewtarius
PKG_NAME="rclone"
PKG_VERSION="1.60.0"
PKG_VERSION="1.61.1"
PKG_DEPENDS_TARGET="toolchain fuse rsync"
PKG_SECTION="tools"
PKG_SHORTDESC="rsync for cloud storage"

View file

@ -29,7 +29,8 @@ then
alsactl restore -f /storage/.config/asound.state
fi
amixer -M set Pre-Amp -- 60%
PREAMP=$(get_setting "audio.preamp" 2>/dev/null)
amixer -M set Pre-Amp -- ${PREAMP}%
VOL=$(get_setting "audio.volume" 2>/dev/null)
amixer -M set "${DEVICE_AUDIO_MIXER}" ${VOL}%

View file

@ -4,5 +4,8 @@
if [ "$(get_setting bluetooth.enabled)" == "1" ]
then
rfkill unblock bluetooth
nohup systemctl start bluetooth &
else
rfkill block bluetooth
fi

View file

@ -0,0 +1,3 @@
STATE=$(get_setting bluetooth.enabled)
SVC="bluealsa"
DAEMONS=("bluealsa")

View file

@ -3,7 +3,6 @@
PKG_NAME="powerstate"
PKG_VERSION=""
PKG_SHA256=""
PKG_ARCH="any"
PKG_LICENSE="OSS"
PKG_DEPENDS_TARGET="systemd"

View file

@ -10,90 +10,38 @@
. /etc/profile
DEBUG=false
performance_level() {
for card in /sys/class/drm/card*/device/power_dpm_force_performance_level
do
if [ -e "${card}" ]
then
echo ${1} >${card} 2>/dev/null
fi
done
}
power_dpm_state() {
for card in /sys/class/drm/card*/device/power_dpm_state
do
if [ -e "${card}" ]
then
echo ${1} >${card} 2>/dev/null
fi
done
}
pcie_aspm_policy() {
if [ -e "/sys/module/pcie_aspm/parameters/policy" ]
then
echo ${1} >/sys/module/pcie_aspm/parameters/policy 2>/dev/null
fi
}
perftune() {
CPU="$(awk '/vendor_id/ {print $3;exit}' /proc/cpuinfo)"
if [ "${CPU}" = "AuthenticAMD" ]
then
if [ "${1}" = "battery" ]
then
ryzenadj --power-saving >/dev/null 2>&1
else
ryzenadj --max-performance >/dev/null 2>&1
fi
elif [ "${CPU}" = "GenuineIntel" ]
then
for policy in $(find /sys/devices/system/cpu/cpufreq/policy*/ -name energy_performance_preference)
do
if [ "${1}" = "battery" ]
then
echo power >${policy} >/dev/null 2>&1
else
echo performance >${policy} >/dev/null 2>&1
fi
done
fi
}
while true
do
STATUS="$(cat /sys/class/power_supply/{BAT*,bat*}/status 2>/dev/null)"
${DEBUG} && echo "Status: ${STATUS}"
if [ ! "${STATUS}" = "${CURRENT_MODE}" ]
then
${DEBUG} && echo "Status changed."
case ${STATUS} in
Disch*)
/usr/bin/logger -t user.notice "Switching to battery mode."
if [ "$(get_setting gpu.powersave)" = 1 ]
log $0 "Switching to battery mode."
if [ "$(get_setting system.powersave)" = 1 ]
then
performance_level battery
power_dpm_state low
audio_powersave 1
cpu_perftune battery
gpu_performance_level auto
gpu_power_profile 1
pcie_aspm_policy powersave
perftune battery
device_powersave 1
fi
;;
*)
/usr/bin/logger -t user.notice "Switching to performance mode."
if [ "$(get_setting gpu.powersave)" = 1 ]
log $0 "Switching to performance mode."
if [ "$(get_setting system.powersave)" = 1 ]
then
performance_level auto
power_dpm_state performance
audio_powersave 0
cpu_perftune performance
gpu_performance_level profile_standard
gpu_power_profile 1
pcie_aspm_policy default
perftune performance
device_powersave 0
fi
;;
esac
fi
CURRENT_MODE="${STATUS}"
${DEBUG} && echo "Current Mode: ${CURRENT_MODE}"
sleep 2
done

View file

@ -0,0 +1,18 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2020-present Fewtarius
PKG_NAME="powertop"
PKG_VERSION="d51ad39"
PKG_ARCH="x86_64"
PKG_LICENSE="GPL"
PKG_SITE="https://github.com/fenrus75/powertop"
PKG_URL="${PKG_SITE}.git"
PKG_DEPENDS_TARGET="toolchain ncurses libnl pciutils systemd"
PKG_LONGDESC="Power consumption / management diagnostic utility."
PKG_BUILD_FLAGS="+pic"
PKG_TOOLCHAIN="autotools"
pre_configure_target() {
export LDFLAGS="${LDFLAGS} -ludev"
}

View file

@ -0,0 +1,13 @@
diff --git a/configure.ac b/configure.ac
index f057463..0acb110 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,7 +26,7 @@ GETTEXT_PACKAGE=powertop
AC_SUBST([GETTEXT_PACKAGE])
AM_SILENT_RULES([yes])
AM_GNU_GETTEXT([external])
-AM_GNU_GETTEXT_VERSION([0.18.2])
+AM_GNU_GETTEXT_VERSION([0.21.1])
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
AX_REQUIRE_DEFINED([AX_ADD_FORTIFY_SOURCE])

View file

@ -3,7 +3,6 @@
PKG_NAME="sleep"
PKG_VERSION=""
PKG_SHA256=""
PKG_ARCH="any"
PKG_LICENSE="OSS"
PKG_DEPENDS_TARGET="systemd"

View file

@ -1,2 +1,2 @@
dwc2
mt7921e
mt7921e mt7921_common mt76_connac_lib mt76

View file

@ -4,77 +4,118 @@
. /etc/profile
headphones() {
if [ "${DEVICE_FAKE_JACKSENSE}" == "true" ]
then
log $0 "Headphone sense: ${1}"
systemctl ${1} headphones >/dev/null 2>&1
fi
}
volumectl() {
if [ "${DEVICE_VOLUMECTL}" == "true" ]
then
log $0 "Volume control: ${1}"
systemctl ${1} volume >/dev/null 2>&1
fi
}
alsastate() {
alsactl ${1} -f /storage/.config/asound.state >/dev/null 2>&1
}
powerstate() {
if [ "$(get_setting system.powersave)" = 1 ]
then
systemctl ${1} powerstate >/dev/null 2>&1
fi
}
bluetooth() {
if [ "$(get_setting bluetooth.enabled)" == "1" ]
then
log $0 "Bluetooth: ${1}"
systemctl ${1} bluetooth >/dev/null 2>&1
fi
}
modules() {
log $0 "Modules: ${1}"
case ${1} in
stop)
if [ -e "/usr/config/modules.bad" ]
then
for module in $(cat /usr/config/modules.bad)
do
EXISTS=$(lsmod | grep ${module})
if [ $? = 0 ]
then
echo ${module} >>/tmp/modules.load
modprobe -r ${module}
fi
done
fi
;;
start)
if [ -e "/tmp/modules.load" ]
then
for module in $(cat /tmp/modules.load)
do
MODCNT=0
MODATTEMPTS=10
while true
do
if (( "${MODCNT}" < "${MODATTEMPTS}" ))
then
modprobe ${module%% *}
if [ $? = 0 ]
then
break
fi
else
break
fi
MODCNT=$((${MODCNT} + 1))
sleep .5
done
done
rm -f /tmp/modules.load
fi
;;
esac
}
case $1 in
pre)
if [ "${DEVICE_FAKE_JACKSENSE}" == "true" ]
then
nohup systemctl stop headphones & >/dev/null 2>&1
fi
if [ "${DEVICE_VOLUMECTL}" == "true" ]
then
nohup systemctl stop volume & >/dev/null 2>&1
fi
nohup alsactl store -f /storage/.config/asound.state >/dev/null 2>&1
if [ "$(get_setting bluetooth.enabled)" == "1" ]
then
nohup systemctl stop bluetooth >/dev/null 2>&1
fi
if [ -e "/usr/config/modules.bad" ]
then
for module in $(cat /usr/config/modules.bad)
do
echo ${module} >>/tmp/modules.load
modprobe -r ${module}
done
fi
wait
alsastate store
headphones stop
volumectl stop
bluetooth stop
powerstate stop
device_powersave stop
modules stop
touch /run/.last_sleep_time
;;
post)
alsactl restore -f /storage/.config/asound.state
if [ -e "/tmp/modules.load" ]
then
for module in $(cat /tmp/modules.load)
do
modprobe ${module}
done
rm -f /tmp/modules.load
fi
if [ "${DEVICE_FAKE_JACKSENSE}" == "true" ]
then
nohup systemctl start headphones & >/dev/null 2>&1
fi
if [ "${DEVICE_VOLUMECTL}" == "true" ]
then
nohup systemctl start volume & >/dev/null 2>&1
fi
alsastate restore
modules start
powerstate start
headphones start
volumectl start
bluetooth start
if [ "$(get_setting wifi.enabled)" == "1" ]
then
nohup wifictl reconnect & >/dev/null 2>&1
fi
if [ "$(get_setting bluetooth.enabled)" == "1" ]
then
nohup systemctl start bluetooth & >/dev/null 2>&1
log $0 "Connecting WIFI."
nohup wifictl enable >/dev/null 2>&1
fi
DEVICE_VOLUME=$(get_setting "audio.volume" 2>/dev/null)
nohup amixer -M set "${DEVICE_AUDIO_MIXER}" ${DEVICE_VOLUME}% & >/dev/null 2>&1
log $0 "Restoring volume to ${DEVICE_VOLUME}%."
amixer -M set "${DEVICE_AUDIO_MIXER}" ${DEVICE_VOLUME}%
BRIGHTNESS=$(get_setting system.brightness)
log $0 "Restoring brightness to ${BRIGHTNESS}."
echo ${BRIGHTNESS} >/sys/class/backlight/$(brightness device)/brightness
wait
;;
esac

View file

@ -2,7 +2,6 @@
PKG_NAME="system-utils"
PKG_VERSION=""
PKG_SHA256=""
PKG_ARCH="any"
PKG_LICENSE="mix"
PKG_DEPENDS_TARGET="toolchain sleep"

Some files were not shown because too many files have changed in this diff Show more