[INSTRUCTIONS][v4.2] How to run dolphin at 480p!

  1. SSH into your home directory (~).
  2. 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
  1. 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
  1. Go too .config/emulationstation and modify es_systems.cfg
cd ~/.config/emulationstation
nano es_systems.cfg
  1. 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>
  1. 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
  1. 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
		;;
  1. 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
  1. 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!!

1 Like

This is not needed (or it should not be needed) and highly NOT recommended as its a recipe for disaster. Instead just put emuelecRunEmu.sh in /emuelec/bin

cp /usr/bin/emuelecRunEmu.sh /emuelec/bin
nano /emuelec/bin/emuelecRunEmu.sh

/emuelec/bin and /emuelec/lib are priority on the PATH although I am not sure all binaries are working like this on v4.2 this might not be enabled yet (it is on 4.3-test)

@EmuELEC, no worries man, cool cool. I wasn’t aware of the call hierarchy and will update the instructions soon. You’re right messing with images may cause update conflicts.

Oh yeah forgot to add, having 480p on dolphin may work for some of the lower spec chips, like the 905 see if it works ok, cheers.

why should any1 do this?

Mostly because lower resolution would yield better performance. In theory…

the displayresolution/outputresolution has practically
no impact on performance.

Hence why I said “In theory”. I have not tested this personally.

Less resolution would mean less memory to copy over so in theory it would be faster. 720p to 480p there would be a significant difference,. The buffers are smaller and the gpu would need to do less work.

So far I havent noticed much gain in FPS, it could be my dolphin settings though. One game I test Baldurs Gate Dark Alliance the FPS drops down to 6-8 really bad, not sure why yet.

Instructions outdated. For new proper solution see: