Android: Add GBA settings

The following settings were excluded:

* Port 1-4 ROM: We're only supporting Game Boy Player for now
* Save in Same Directory as the ROM: Implementation nightmare due to SAF
This commit is contained in:
JosJuice 2026-03-30 22:05:01 +02:00 committed by Jordan Woyak
parent c542279595
commit 5167adc8df
7 changed files with 73 additions and 0 deletions

View File

@ -145,6 +145,7 @@ enum class BooleanSetting(
"EnablePlayTimeTracking",
true
),
MAIN_GBA_THREADS(Settings.FILE_DOLPHIN, Settings.SECTION_INI_GBA, "Threads", true),
MAIN_EXPAND_TO_CUTOUT_AREA(
Settings.FILE_DOLPHIN,
Settings.SECTION_INI_INTERFACE,

View File

@ -112,6 +112,7 @@ class Settings : Closeable {
const val SECTION_INI_CORE = "Core"
const val SECTION_INI_INTERFACE = "Interface"
const val SECTION_INI_DSP = "DSP"
const val SECTION_INI_GBA = "GBA"
const val SECTION_LOGGER_LOGS = "Logs"
const val SECTION_LOGGER_OPTIONS = "Options"
const val SECTION_GFX_HARDWARE = "Hardware"

View File

@ -69,6 +69,9 @@ enum class StringSetting(
""
),
MAIN_WFS_PATH(Settings.FILE_DOLPHIN, Settings.SECTION_INI_GENERAL, "WFSPath", ""),
MAIN_GBA_BIOS_PATH(Settings.FILE_DOLPHIN, Settings.SECTION_INI_GBA, "BIOS", ""),
MAIN_GB_PLAYER_ROM(Settings.FILE_DOLPHIN, Settings.SECTION_INI_GBA, "GBPlayerRom", ""),
MAIN_GBA_SAVES_PATH(Settings.FILE_DOLPHIN, Settings.SECTION_INI_GBA, "SavesPath", ""),
MAIN_TRIFORCE_IP_REDIRECTIONS(
Settings.FILE_DOLPHIN,
Settings.SECTION_INI_CORE,

View File

@ -34,6 +34,26 @@ class SettingsActivityResultLaunchers(
)
}
val requestGbaRomFile = fragment.registerForActivityResult(
ActivityResultContracts.StartActivityForResult()
) { result: ActivityResult ->
onFileResult(
result,
FileBrowserHelper.GBA_ROM_EXTENSIONS,
Intent.FLAG_GRANT_READ_URI_PERMISSION
)
}
val requestBinFile = fragment.registerForActivityResult(
ActivityResultContracts.StartActivityForResult()
) { result: ActivityResult ->
onFileResult(
result,
FileBrowserHelper.BIN_EXTENSION,
Intent.FLAG_GRANT_READ_URI_PERMISSION
)
}
val requestRawFile = fragment.registerForActivityResult(
ActivityResultContracts.StartActivityForResult()
) { result: ActivityResult ->

View File

@ -702,6 +702,46 @@ class SettingsFragmentPresenter(
MenuTag.CONFIG_SERIALPORT1
)
)
sl.add(HeaderSetting(context, R.string.gba_settings, 0))
sl.add(
SwitchSetting(
context,
BooleanSetting.MAIN_GBA_THREADS,
R.string.gba_threads,
0,
)
)
sl.add(
FilePicker(
context,
StringSetting.MAIN_GBA_BIOS_PATH,
R.string.gba_bios_path,
0,
fragmentView.activityResultLaunchers.requestBinFile,
"/GBA/gba_bios.bin"
)
)
sl.add(
FilePicker(
context,
StringSetting.MAIN_GB_PLAYER_ROM,
R.string.gb_player_rom,
0,
fragmentView.activityResultLaunchers.requestGbaRomFile,
null
)
)
sl.add(
DirectoryPicker(
context,
StringSetting.MAIN_GBA_SAVES_PATH,
R.string.gba_saves_path,
0,
fragmentView.activityResultLaunchers.requestDirectory,
"/GBA/Saves/"
)
)
}
private fun addWiiSettings(sl: ArrayList<SettingsItem>) {

View File

@ -39,6 +39,9 @@ public final class FileBrowserHelper
GAME_LIKE_EXTENSIONS.add("dff");
}
public static final HashSet<String> GBA_ROM_EXTENSIONS = new HashSet<>(Arrays.asList(
"gba", "gbc", "gb", "agb", "mb", "rom", "bin"));
public static final HashSet<String> BIN_EXTENSION = new HashSet<>(Collections.singletonList(
"bin"));

View File

@ -85,6 +85,11 @@
<string name="slot_a_device">GameCube Slot A Device</string>
<string name="slot_b_device">GameCube Slot B Device</string>
<string name="serial_port_1_device">GameCube Serial Port 1 Device</string>
<string name="gba_settings">GBA Settings</string>
<string name="gba_threads">Run GBA Cores in Dedicated Threads</string>
<string name="gba_bios_path">BIOS</string>
<string name="gb_player_rom">Game Boy Player ROM</string>
<string name="gba_saves_path">Saves</string>
<string name="wii_submenu">Wii</string>
<string name="wii_misc_settings">Misc Settings</string>
<string name="wii_sd_card_settings">SD Card Settings</string>