From cbe98d5fec669446197970f48769dd6444846ccd Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Thu, 5 Nov 2026 19:51:12 +0100 Subject: [PATCH] fix: keep the mister row among the platforms --- install.ps1 | 2 +- install.py | 10 ++++++++-- install.sh | 2 +- install/launchers/index.json | 16 ++++++++-------- tests/fixtures/tui/colour-120x40.txt | 2 +- tests/fixtures/tui/colour-40x15.txt | 2 +- tests/fixtures/tui/colour-80x24.txt | 2 +- tests/fixtures/tui/platforms-120x40.txt | 2 +- tests/fixtures/tui/platforms-40x15.txt | 2 +- tests/fixtures/tui/platforms-80x24.txt | 2 +- tests/fixtures/tui/route-evmapy.txt | 4 ++-- tests/fixtures/tui/route-gptokeyb.txt | 4 ++-- tests/fixtures/tui/route-gptokeyb_muxterm.txt | 4 ++-- tests/fixtures/tui/route-keys.txt | 4 ++-- tests/fixtures/tui/route-miyoo.txt | 4 ++-- tests/fixtures/tui/route-muxterm.txt | 4 ++-- tests/test_install_tui.py | 10 ++++++++-- 17 files changed, 44 insertions(+), 32 deletions(-) diff --git a/install.ps1 b/install.ps1 index 9de606cc6..f1c93ca4c 100644 --- a/install.ps1 +++ b/install.ps1 @@ -16,7 +16,7 @@ # and Invoke-WebRequest throws on a cut transfer before the hash is read: # the site's build rewrites this line there (scripts/sitebootstrap.py). $mismatchAdvice = "The download was most likely cut short: try again. Within minutes of an update of this project the two files can come from caches of different ages. Waiting five minutes settles that." - $defaultInstallSha256 = "a04d2cf262c3ee0a6bcc073b0105b39af05c810ca64c82e62ebf03334fa6e2da" + $defaultInstallSha256 = "d9b9e08c5a3ff983f8bb440512edd0c68e33493ff6c3c5b119dfe72582b3a3d1" $maximumInstallerBytes = 2MB $installerExit = 0 $installer = if ($PSScriptRoot) { Join-Path $PSScriptRoot "install.py" } else { $null } diff --git a/install.py b/install.py index b3c9ced2f..0f61a0b21 100644 --- a/install.py +++ b/install.py @@ -19384,13 +19384,14 @@ def setup_list(setups: list, mounted: set, needle: str = "", continue setup = card_setup(plat, plat) label = display_name(plat) - if setup and _found_device(setups, mounted, plat, setup.name) is None: + if (setup and plat not in _DESK_CARDS + and _found_device(setups, mounted, plat, setup.name) is None): label += ", SD card" # The systems and devices the filter named, else a card's devices. shown = named or (list(_setup_devices(plat, os_type)) if setup else []) row = TuiRow("platform", label, ", ".join(shown), plat, narrow=_device_forms(shown), cut=shown[0] if shown else "") - if setup: + if setup and plat not in _DESK_CARDS: handheld.append((label, row)) else: desktop.append(row) @@ -19422,6 +19423,11 @@ def setup_list(setups: list, mounted: set, needle: str = "", return [*desktop, *cards_rows] +# The systems that run from an SD card on a board kept on a desk, not in +# the hand: their row stays among the platforms, and the handhelds' block, +# which leads when nothing is found here, keeps Onion four presses away. +_DESK_CARDS = frozenset({"misterfpga"}) + # The setups a computer runs, by its system, first in the setup list when # nothing was found here. RetroBat runs on Windows alone (retrobat.org), and # under WSL its folder is the Windows side's (_os_default_dests). EmuDeck has diff --git a/install.sh b/install.sh index 83b870b2f..2cdd22977 100755 --- a/install.sh +++ b/install.sh @@ -23,7 +23,7 @@ DEFAULT_INSTALL_URL="https://raw.githubusercontent.com/Abdess/retrobios/main/ins # curl or wget stop on a cut transfer before the hash is read: the site's # build rewrites this line there (scripts/sitebootstrap.py). MISMATCH_ADVICE="The download was most likely cut short: try again. Within minutes of an update of this project the two files can come from caches of different ages. Waiting five minutes settles that." -DEFAULT_INSTALL_SHA256="a04d2cf262c3ee0a6bcc073b0105b39af05c810ca64c82e62ebf03334fa6e2da" +DEFAULT_INSTALL_SHA256="d9b9e08c5a3ff983f8bb440512edd0c68e33493ff6c3c5b119dfe72582b3a3d1" MAX_INSTALLER_BYTES=2097152 cleanup() { diff --git a/install/launchers/index.json b/install/launchers/index.json index 904161d8e..be5af75db 100644 --- a/install/launchers/index.json +++ b/install/launchers/index.json @@ -27,8 +27,8 @@ { "dest": "roms/ports/retrobios/install.py", "repo_path": "install.py", - "size": 1097921, - "sha256": "a04d2cf262c3ee0a6bcc073b0105b39af05c810ca64c82e62ebf03334fa6e2da", + "size": 1098257, + "sha256": "d9b9e08c5a3ff983f8bb440512edd0c68e33493ff6c3c5b119dfe72582b3a3d1", "executable": false }, { @@ -71,8 +71,8 @@ "muos": { "archive": { "dest": "ARCHIVE/RetroBIOS.muxapp", - "size": 1151548, - "sha256": "52812611b2593110809fb97339cfccd21ab2a1fdd3896db9220e66abdc94b384" + "size": 1151884, + "sha256": "54ff79a8c51879532db206bb24dd7b3a884a2c8de1d3bcc07f1a2d4f66084c71" }, "members": [ { @@ -92,8 +92,8 @@ { "name": "RetroBIOS/install.py", "repo_path": "install.py", - "size": 1097921, - "sha256": "a04d2cf262c3ee0a6bcc073b0105b39af05c810ca64c82e62ebf03334fa6e2da", + "size": 1098257, + "sha256": "d9b9e08c5a3ff983f8bb440512edd0c68e33493ff6c3c5b119dfe72582b3a3d1", "executable": false }, { @@ -166,8 +166,8 @@ { "dest": ".config/modules/retrobios/install.py", "repo_path": "install.py", - "size": 1097921, - "sha256": "a04d2cf262c3ee0a6bcc073b0105b39af05c810ca64c82e62ebf03334fa6e2da", + "size": 1098257, + "sha256": "d9b9e08c5a3ff983f8bb440512edd0c68e33493ff6c3c5b119dfe72582b3a3d1", "executable": false }, { diff --git a/tests/fixtures/tui/colour-120x40.txt b/tests/fixtures/tui/colour-120x40.txt index 81bbef3da..c4227fd0e 100644 --- a/tests/fixtures/tui/colour-120x40.txt +++ b/tests/fixtures/tui/colour-120x40.txt @@ -54,6 +54,7 @@ RetroDECK RomM BizHawk + MiSTer FPGA RetroPie Allium, SD card Miyoo Mini, Miyoo Mini Plus, +1 AmberELEC, SD card RG351, RG552 @@ -68,7 +69,6 @@ KOLOS, SD card RG353P, RG353M, RG353V, RG353VS, RG503, +3 Koriki, SD card Miyoo Mini MinUI, SD card RG28XX, RG34XX, RG34XX SP, RG35XX, +19 - MiSTer FPGA, SD card MiyooCFW, SD card BittBoy, Pocket Go, PowKiddy Q90, +4 muOS, SD card RG35XX H, RG35XX Plus, RG35XX SP, +8 MyMinUI, SD card RG35XX, Miyoo Mini, Miyoo Mini Flip, +18 diff --git a/tests/fixtures/tui/colour-40x15.txt b/tests/fixtures/tui/colour-40x15.txt index e883877d6..3d4f54e39 100644 --- a/tests/fixtures/tui/colour-40x15.txt +++ b/tests/fixtures/tui/colour-40x15.txt @@ -27,7 +27,7 @@ RetroDECK RomM BizHawk - RetroPie + MiSTer FPGA ^[[0;2m 1-10 of 34^[[0m ^[[0;1;35mA^[[0m Choose ^[[0;2mB^[[0m Back ^[[0;2m/^[[0m Filter ^[[0;2m?^[[0m Help === folder diff --git a/tests/fixtures/tui/colour-80x24.txt b/tests/fixtures/tui/colour-80x24.txt index f0562838e..121db8b0c 100644 --- a/tests/fixtures/tui/colour-80x24.txt +++ b/tests/fixtures/tui/colour-80x24.txt @@ -36,6 +36,7 @@ RetroDECK RomM BizHawk + MiSTer FPGA RetroPie Allium, SD card Miyoo Mini, Miyoo Mini Plus, +1 AmberELEC, SD card RG351, RG552 @@ -45,7 +46,6 @@ CrossMix-OS, SD card TrimUI Smart Pro dArkOS, SD card Odroid Go Advance, RGB10, RG351MP, G350 EmuELEC, SD card Odroid Go - JELOS, SD card RG351M, RG351V, RG353M, RG353P, +30 ^[[0;2m 1-19 of 34^[[0m ^[[0;1;35mA/Enter^[[0m Choose ^[[0;2mB/Esc^[[0m Back ^[[0;2m/^[[0m Filter ^[[0;2m?^[[0m Help === folder diff --git a/tests/fixtures/tui/platforms-120x40.txt b/tests/fixtures/tui/platforms-120x40.txt index 2f5817998..258c9ce65 100644 --- a/tests/fixtures/tui/platforms-120x40.txt +++ b/tests/fixtures/tui/platforms-120x40.txt @@ -12,6 +12,7 @@ RetroDECK RomM BizHawk + MiSTer FPGA RetroPie Allium, SD card Miyoo Mini, Miyoo Mini Plus, +1 AmberELEC, SD card RG351, RG552 @@ -26,7 +27,6 @@ KOLOS, SD card RG353P, RG353M, RG353V, RG353VS, RG503, +3 Koriki, SD card Miyoo Mini MinUI, SD card RG28XX, RG34XX, RG34XX SP, RG35XX, +19 - MiSTer FPGA, SD card MiyooCFW, SD card BittBoy, Pocket Go, PowKiddy Q90, +4 muOS, SD card RG35XX H, RG35XX Plus, RG35XX SP, +8 MyMinUI, SD card RG35XX, Miyoo Mini, Miyoo Mini Flip, +18 diff --git a/tests/fixtures/tui/platforms-40x15.txt b/tests/fixtures/tui/platforms-40x15.txt index 7327b4417..d0ebd799c 100644 --- a/tests/fixtures/tui/platforms-40x15.txt +++ b/tests/fixtures/tui/platforms-40x15.txt @@ -10,6 +10,6 @@ RetroDECK RomM BizHawk - RetroPie + MiSTer FPGA 1-10 of 34 A Choose B Back / Filter ? Help diff --git a/tests/fixtures/tui/platforms-80x24.txt b/tests/fixtures/tui/platforms-80x24.txt index 3d7f38047..7fb53a4c8 100644 --- a/tests/fixtures/tui/platforms-80x24.txt +++ b/tests/fixtures/tui/platforms-80x24.txt @@ -10,6 +10,7 @@ RetroDECK RomM BizHawk + MiSTer FPGA RetroPie Allium, SD card Miyoo Mini, Miyoo Mini Plus, +1 AmberELEC, SD card RG351, RG552 @@ -19,6 +20,5 @@ CrossMix-OS, SD card TrimUI Smart Pro dArkOS, SD card Odroid Go Advance, RGB10, RG351MP, G350 EmuELEC, SD card Odroid Go - JELOS, SD card RG351M, RG351V, RG353M, RG353P, +30 1-19 of 34 A/Enter Choose B/Esc Back / Filter ? Help diff --git a/tests/fixtures/tui/route-evmapy.txt b/tests/fixtures/tui/route-evmapy.txt index 0c693acb1..4ecf7723d 100644 --- a/tests/fixtures/tui/route-evmapy.txt +++ b/tests/fixtures/tui/route-evmapy.txt @@ -78,7 +78,7 @@ RetroDECK RomM BizHawk - RetroPie + MiSTer FPGA 1-10 of 34 A Choose B Back === platforms 80x24 @@ -94,6 +94,7 @@ RetroDECK RomM BizHawk + MiSTer FPGA RetroPie Allium, SD card Miyoo Mini, Miyoo Mini Plus, +1 AmberELEC, SD card RG351, RG552 @@ -103,7 +104,6 @@ CrossMix-OS, SD card TrimUI Smart Pro dArkOS, SD card Odroid Go Advance, RGB10, RG351MP, G350 EmuELEC, SD card Odroid Go - JELOS, SD card RG351M, RG351V, RG353M, RG353P, +30 1-19 of 34 A Choose B Back === folder 40x12 diff --git a/tests/fixtures/tui/route-gptokeyb.txt b/tests/fixtures/tui/route-gptokeyb.txt index 8d519b749..0c2ec38af 100644 --- a/tests/fixtures/tui/route-gptokeyb.txt +++ b/tests/fixtures/tui/route-gptokeyb.txt @@ -78,7 +78,7 @@ RetroDECK RomM BizHawk - RetroPie + MiSTer FPGA 1-10 of 34 A Choose B Back === platforms 80x24 @@ -94,6 +94,7 @@ RetroDECK RomM BizHawk + MiSTer FPGA RetroPie Allium, SD card Miyoo Mini, Miyoo Mini Plus, +1 AmberELEC, SD card RG351, RG552 @@ -103,7 +104,6 @@ CrossMix-OS, SD card TrimUI Smart Pro dArkOS, SD card Odroid Go Advance, RGB10, RG351MP, G350 EmuELEC, SD card Odroid Go - JELOS, SD card RG351M, RG351V, RG353M, RG353P, +30 1-19 of 34 A Choose B Back === folder 40x12 diff --git a/tests/fixtures/tui/route-gptokeyb_muxterm.txt b/tests/fixtures/tui/route-gptokeyb_muxterm.txt index 04a435413..5a52cc315 100644 --- a/tests/fixtures/tui/route-gptokeyb_muxterm.txt +++ b/tests/fixtures/tui/route-gptokeyb_muxterm.txt @@ -78,7 +78,7 @@ RetroDECK RomM BizHawk - RetroPie + MiSTer FPGA 1-10 of 34 A Choose B Back === platforms 80x24 @@ -94,6 +94,7 @@ RetroDECK RomM BizHawk + MiSTer FPGA RetroPie Allium, SD card Miyoo Mini, Miyoo Mini Plus, +1 AmberELEC, SD card RG351, RG552 @@ -103,7 +104,6 @@ CrossMix-OS, SD card TrimUI Smart Pro dArkOS, SD card Odroid Go Advance, RGB10, RG351MP, G350 EmuELEC, SD card Odroid Go - JELOS, SD card RG351M, RG351V, RG353M, RG353P, +30 1-19 of 34 A Choose B Back === folder 40x12 diff --git a/tests/fixtures/tui/route-keys.txt b/tests/fixtures/tui/route-keys.txt index e06f9847f..912da09d8 100644 --- a/tests/fixtures/tui/route-keys.txt +++ b/tests/fixtures/tui/route-keys.txt @@ -78,7 +78,7 @@ RetroDECK RomM BizHawk - RetroPie + MiSTer FPGA 1-10 of 34 Enter Choose Esc Back / Filter === platforms 80x24 @@ -94,6 +94,7 @@ RetroDECK RomM BizHawk + MiSTer FPGA RetroPie Allium, SD card Miyoo Mini, Miyoo Mini Plus, +1 AmberELEC, SD card RG351, RG552 @@ -103,7 +104,6 @@ CrossMix-OS, SD card TrimUI Smart Pro dArkOS, SD card Odroid Go Advance, RGB10, RG351MP, G350 EmuELEC, SD card Odroid Go - JELOS, SD card RG351M, RG351V, RG353M, RG353P, +30 1-19 of 34 Enter Choose Esc Back / Filter ? Help === folder 40x12 diff --git a/tests/fixtures/tui/route-miyoo.txt b/tests/fixtures/tui/route-miyoo.txt index f742e01a9..715bb7e85 100644 --- a/tests/fixtures/tui/route-miyoo.txt +++ b/tests/fixtures/tui/route-miyoo.txt @@ -78,7 +78,7 @@ RetroDECK RomM BizHawk - RetroPie + MiSTer FPGA 1-10 of 34 A Choose R2 Back === platforms 80x24 @@ -94,6 +94,7 @@ RetroDECK RomM BizHawk + MiSTer FPGA RetroPie Allium, SD card Miyoo Mini, Miyoo Mini Plus, +1 AmberELEC, SD card RG351, RG552 @@ -103,7 +104,6 @@ CrossMix-OS, SD card TrimUI Smart Pro dArkOS, SD card Odroid Go Advance, RGB10, RG351MP, G350 EmuELEC, SD card Odroid Go - JELOS, SD card RG351M, RG351V, RG353M, RG353P, +30 1-19 of 34 A Choose R2 Back === folder 40x12 diff --git a/tests/fixtures/tui/route-muxterm.txt b/tests/fixtures/tui/route-muxterm.txt index 4dfeda61b..0d132306f 100644 --- a/tests/fixtures/tui/route-muxterm.txt +++ b/tests/fixtures/tui/route-muxterm.txt @@ -78,7 +78,7 @@ RetroDECK RomM BizHawk - RetroPie + MiSTer FPGA 1-10 of 34 Start Choose B Back === platforms 80x24 @@ -94,6 +94,7 @@ RetroDECK RomM BizHawk + MiSTer FPGA RetroPie Allium, SD card Miyoo Mini, Miyoo Mini Plus, +1 AmberELEC, SD card RG351, RG552 @@ -103,7 +104,6 @@ CrossMix-OS, SD card TrimUI Smart Pro dArkOS, SD card Odroid Go Advance, RGB10, RG351MP, G350 EmuELEC, SD card Odroid Go - JELOS, SD card RG351M, RG351V, RG353M, RG353P, +30 1-19 of 34 Start Choose B Back === folder 40x12 diff --git a/tests/test_install_tui.py b/tests/test_install_tui.py index d805c1ab9..d10ea0d13 100644 --- a/tests/test_install_tui.py +++ b/tests/test_install_tui.py @@ -5901,6 +5901,12 @@ def _card_from_rules(root: Path, setup: install.CardSetup) -> Path: return root +def _card_row(setup: install.CardSetup) -> str: + """The setup list's row of a card system: MiSTer's board sits on a desk + and keeps its plain row among the platforms.""" + return setup.name if setup.plat in install._DESK_CARDS else f"{setup.name}, SD card" + + def _setup_folder(setup: install.CardSetup, card: Path) -> Path: return card / setup.below if setup.below else card @@ -5968,7 +5974,7 @@ class EveryCardSetupGoesToItsCard(unittest.TestCase): state = self.platforms() rows = install.tui_rows(state) index = next(i for i, row in enumerate(rows) - if row.label == f"{setup.name}, SD card") + if row.label == _card_row(setup)) state.focus["platforms"] = index with mock.patch.object(install, "_mounted_cards", return_value=[]): effects = press(state, "enter") @@ -5983,7 +5989,7 @@ class EveryCardSetupGoesToItsCard(unittest.TestCase): for setup in self.setups: with self.subTest(system=setup.name): rows = install.tui_rows(self.platforms(setup.name)) - self.assertIn(f"{setup.name}, SD card", [row.label for row in rows]) + self.assertIn(_card_row(setup), [row.label for row in rows]) def test_platform_named_on_a_computer_asks_for_the_card(self): for setup in self.setups: