From 25abe265b8d86b9d352cb618383e8ab873c20036 Mon Sep 17 00:00:00 2001 From: Douglas Teles Date: Sat, 18 Apr 2026 13:20:10 -0300 Subject: [PATCH] Maximize melonDS performance on RK3326 Config: - ShowOSD=0: Disable on-screen display (saves rendering cycles) - MouseHide=1: Hide cursor immediately Launch script: - Force JIT, software 3D, ScreenUseGL=0 at every launch (prevent user/ES settings from accidentally enabling heavy GPU features) - Set CPU governor to performance before launch - QT_QPA_NO_SIGNAL_SPY=1: Disable Qt signal debugging - QSG_RENDER_LOOP=basic: Simpler Qt render loop (less overhead) - QT_ENABLE_HIGHDPI_SCALING=0: Skip HiDPI calculations - AudioInterp=0, AudioBitrate=0: No audio interpolation overhead Co-Authored-By: Claude Opus 4.6 (1M context) --- .../melonds-sa/config/RK3326/melonDS.ini | 6 +++--- .../melonds-sa/scripts/start_melonds.sh | 20 ++++++++++++++++++- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/projects/ArchR/packages/emulators/standalone/melonds-sa/config/RK3326/melonDS.ini b/projects/ArchR/packages/emulators/standalone/melonds-sa/config/RK3326/melonDS.ini index 64e3dfd0d9..94aef69e8a 100644 --- a/projects/ArchR/packages/emulators/standalone/melonds-sa/config/RK3326/melonDS.ini +++ b/projects/ArchR/packages/emulators/standalone/melonds-sa/config/RK3326/melonDS.ini @@ -81,7 +81,7 @@ GL_ScaleFactor=1 GL_BetterPolygons=0 LimitFPS=1 AudioSync=0 -ShowOSD=1 +ShowOSD=0 ConsoleType=0 DirectBoot=1 JIT_Enable=1 @@ -144,8 +144,8 @@ SaveFilePath=/storage/roms/nds SavestatePath=/storage/roms/savestates/nds CheatFilePath= EnableCheats=0 -MouseHide=0 -MouseHideSeconds=5 +MouseHide=1 +MouseHideSeconds=1 PauseLostFocus=0 DSBatteryLevelOkay=1 DSiBatteryLevel=15 diff --git a/projects/ArchR/packages/emulators/standalone/melonds-sa/scripts/start_melonds.sh b/projects/ArchR/packages/emulators/standalone/melonds-sa/scripts/start_melonds.sh index 67f77c2481..8800d09030 100644 --- a/projects/ArchR/packages/emulators/standalone/melonds-sa/scripts/start_melonds.sh +++ b/projects/ArchR/packages/emulators/standalone/melonds-sa/scripts/start_melonds.sh @@ -174,6 +174,11 @@ fi # Qt requires UTF-8 locale export LC_ALL=en_US.UTF-8 2>/dev/null || export LC_ALL=C.UTF-8 +# Performance: disable Qt animations, reduce rendering overhead +export QT_QPA_NO_SIGNAL_SPY=1 +export QSG_RENDER_LOOP=basic +export QT_ENABLE_HIGHDPI_SCALING=0 + @PANFROST@ @HOTKEY@ @LIBMALI@ @@ -181,10 +186,23 @@ export LC_ALL=en_US.UTF-8 2>/dev/null || export LC_ALL=C.UTF-8 #Generate a new MelonDS.toml each run (temporary hack) rm -rf "${CONF_DIR}/melonDS.toml" +# Force JIT and software renderer for max performance on weak SoCs +sed -i '/^JIT_Enable=/c\JIT_Enable=1' "${CONF_DIR}/${MELONDS_INI}" +sed -i '/^3DRenderer=/c\3DRenderer=0' "${CONF_DIR}/${MELONDS_INI}" +sed -i '/^Threaded3D=/c\Threaded3D=1' "${CONF_DIR}/${MELONDS_INI}" +sed -i '/^ScreenUseGL=/c\ScreenUseGL=0' "${CONF_DIR}/${MELONDS_INI}" +sed -i '/^ShowOSD=/c\ShowOSD=0' "${CONF_DIR}/${MELONDS_INI}" +sed -i '/^AudioInterp=/c\AudioInterp=0' "${CONF_DIR}/${MELONDS_INI}" +sed -i '/^AudioBitrate=/c\AudioBitrate=0' "${CONF_DIR}/${MELONDS_INI}" + #Retroachievements /usr/bin/cheevos_melonds.sh -#Run MelonDS emulator +#Run MelonDS emulator - set CPU to performance for max speed +if [ -w "/sys/devices/system/cpu/cpufreq/policy0/scaling_governor" ]; then + echo performance > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor 2>/dev/null +fi + $GPTOKEYB "melonDS" -c "${CONF_DIR}/melonDS.gptk" & ${EMUPERF} /usr/bin/melonDS -f "${ROM}" kill -9 "$(pidof gptokeyb)"