- SSH into your home directory (~).
- Create a file named hdmi.sh in your home directory and give it exec permissions, and open it.
touch hdmi.sh
chmod +x hdmi.sh
nano hdmi.sh
- Paste contents and save. Make sure you edit the original_resolution variable to the height of your normal resolution ex: 1080 for 1080p, 720 for 720p etc.
#!/bin/sh
# This file sets the hdmi output and frame buffer to the argument in pixel width.
# Allowed argument example ./hdmi.sh 720 <-- For width 720 pixels.
# set -x #echo on
original_resolution=720 # <--- Set to your original resolution on your device and emustation.
bpp=32
hz=60
i=$1
if [[ "$i" -eq "" ]]; then
i=$original_resolution
fi
case $i in
480)
w=720
di=$(($i*2))
w1=$(($w-1))
i1=$(($i-1))
fbset -fb /dev/fb0 -g $w $i $w $di $bpp
fbset -fb /dev/fb1 -g 32 32 32 32 32
mode=$(echo "${i}p${hz}hz")
echo $mode > /sys/class/display/mode
echo 0 > /sys/class/graphics/fb0/free_scale
echo 1 > /sys/class/graphics/fb0/freescale_mode
echo 0 0 $w1 $i1 > /sys/class/graphics/fb0/free_scale_axis
echo 0 0 $w1 $i1 > /sys/class/graphics/fb0/window_axis
echo 0 > /sys/class/graphics/fb1/free_scale
;;
esac
case $i in
576|720|1080|2160)
w=$(($i*16/9))
di=$(($i*2))
w1=$(($w-1))
i1=$(($i-1))
fbset -fb /dev/fb0 -g $w $i $w $di $bpp
fbset -fb /dev/fb1 -g 32 32 32 32 32
mode=$(echo "${i}p${hz}hz")
echo $mode > /sys/class/display/mode
echo 0 > /sys/class/graphics/fb0/free_scale
echo 1 > /sys/class/graphics/fb0/freescale_mode
echo 0 0 $w1 $i1 > /sys/class/graphics/fb0/free_scale_axis
echo 0 0 $w1 $i1 > /sys/class/graphics/fb0/window_axis
echo 0 > /sys/class/graphics/fb1/free_scale
;;
esac
# Enable framebuffer device
echo 0 > /sys/class/graphics/fb0/blank
# Blank fb1 to prevent static noise
echo 1 > /sys/class/graphics/fb1/blank
- Go too .config/emulationstation and modify es_systems.cfg
cd ~/.config/emulationstation
nano es_systems.cfg
- Modify the Nintendo gamecube block by replacing the xml for emulators with:
<emulators>
<emulator name="dolphin">
<cores>
<core default="true">dolphin</core>
<core>dolphin480p</core>
</cores>
</emulator>
</emulators>
- This requires modifying a file located in your SYSTEM image.
Copy the SYSTEM image file from your SD Card to linux.
Unsquash the SYSTEM image file in terminal with:
unsquashfs SYSTEM
cd squashfs-root/usr/bin
sudo nano emuelecRunEmu.sh
- Find the line: “wii”|“gamecube”)
replace its nested contents from:
"wii"|"gamecube")
if [ "$EMU" = "dolphin" ]; then
set_kill_keys "dolphin-emu-nogui"
RUNTHIS='${TBASH} /usr/bin/dolphin.sh "${ROMNAME}"'
fi
;;
too:
"wii"|"gamecube")
SWITCHED_RES="0"
if [ "$EMU" = "dolphin" ]; then
set_kill_keys "dolphin-emu-nogui"
RUNTHIS='${TBASH} /usr/bin/dolphin.sh "${ROMNAME}"'
fi
if [ "$EMU" = "dolphin480p" ]; then
set_kill_keys "dolphin-emu-nogui"
source ~/hdmi.sh 480
sleep 1
SWITCHED_RES="1"
RUNTHIS='${TBASH} /usr/bin/dolphin.sh "${ROMNAME}"'
fi
;;
- Find the text:
if [[ "$BTENABLED" == "1" ]]; then
# Restart the bluetooth agent
NPID=$(pgrep -f batocera-bluetooth-agent)
if [[ -z "$NPID" ]]; then
(systemd-run batocera-bluetooth-agent) || :
fi
fi
Below it add the following:
if [[ "$SWITCHED_RES" == "1" ]]; then
source ~/hdmi.sh
sleep 1
fi
- save file and re-squash your SYSTEM image file, and replace it on your SD card.
sudo mksquashfs squashfs-root SYSTEM
Now insert EmuElec SD Card to system and get into emulation station.
Select “Gamecube” and press select on controller and choose emulator at bottom and select dolphin 480p.
Now launch a game it should auto switch to 480p then back to your original resolution on exit.
All the best!!