3DS Resolution Switching - ZFEbHVUE/Batocera-CRT-Script GitHub Wiki

๐ŸŽฎ 3DS Resolution Switching

This guide demonstrates how to toggle between 400ร—240 and 320ร—240 resolutions during gameplay for 3DS titles using the Citra emulator on Batocera.

This is especially useful when:

  • You want to play 3DS games in native resolution (400ร—240), preserving the system's original pixel layout.
  • You want to switch to 320ร—240 for better fullscreen compatibility on 15kHz CRTs.

๐Ÿ“š Table of Contents (click to expand)

๐ŸŽฏ Goal

Enable in-game resolution switching for 3DS titles with a button combination, toggling between:

Resolution Use Case
400x240 Matches the top screen
320x240 Matches the bottom screen

๐Ÿงฉ Requirements

  • Citra emulator installed and working
  • Valid videomodes.conf entries for:
    • 400x240.60.00021
    • 320x240.60.00010
  • evmapy enabled in Batocera
  • SSH or file access to create/edit files
  • Hotkey + X button available on your controller

๐Ÿ—‚๏ธ Step 1 โ€“ Create evmapy Pad2Key Configuration

Create a file at:

/userdata/system/configs/evmapy/3ds.keys

Paste the following JSON content:

{
    "actions_player1": [
        {
            "trigger": [
                "hotkey",
                "x"
            ],
            "type": "exec",
            "target": "/userdata/system/citra-resolution"
        }
    ]
}

This will bind HOTKEY + X to a custom script.

๐Ÿ’ก The name 3ds.keys ensures the config applies to all 3DS games using Citra.


โš™๏ธ Step 2 โ€“ Create Resolution Toggle Script

Create the following file:

/userdata/system/citra-resolution

Make sure it is executable:

chmod +x /userdata/system/citra-resolution

Paste the following content into the script:

#!/bin/bash

RES=$(batocera-resolution currentResolution)
case "$RES" in
    400x240) batocera-resolution setMode 320x240.60.00010 ;;
    320x240) batocera-resolution setMode 400x240.60.00021 ;;
esac

This script checks the current resolution and switches to the other.

๐Ÿ“Œ This script idea and logic were contributed by Bloodred217.


๐Ÿงช Step 3 โ€“ Test It In-Game

  1. Launch a 3DS game from EmulationStation.
  2. Once the game is running, press:
    HOTKEY + X
    
  3. The resolution should switch instantly between 400x240 and 320x240.

๐Ÿ“ Use DISPLAY=:0 batocera-resolution currentResolution from SSH to verify resolution names if unsure.


โ“ How Does It Work?

This setup uses:

  • evmapy to bind a controller input to a shell command.
  • A Bash script that uses batocera-resolution to query and switch video modes.
  • The video mode names must match entries in your videomodes.conf file.

The behavior is fully integrated into Batoceraโ€™s resolution handling system and works without restarting EmulationStation or the emulator.


๐Ÿ› ๏ธ Troubleshooting

Resolution doesnโ€™t change?

  • Double-check file permissions:
    chmod +x /userdata/system/citra-resolution
  • Confirm the video modes exist using:
    DISPLAY=:0 batocera-resolution listModes
  • Validate the names in videomodes.conf:
    400x240.60.00021:400x240 1.0:0:0 15KHz 60Hz
    320x240.60.00010:320x240 1.0:0:0 15KHz 60Hz
    

โœ… Example Output

# Before toggle
batocera-resolution currentResolution
> 400x240

# After pressing HOTKEY+X
batocera-resolution currentResolution
> 320x240

๐Ÿ’ฌ Have another emulator that could benefit from this technique? The same principle applies โ€” just adjust the .keys file name and script logic.

โš ๏ธ **GitHub.com Fallback** โš ๏ธ