diff --git a/.github/workflows/Flatpak.yml b/.github/workflows/Flatpak.yml index c1acec2..92cb486 100644 --- a/.github/workflows/Flatpak.yml +++ b/.github/workflows/Flatpak.yml @@ -67,6 +67,7 @@ jobs: run: | git clone --depth 1 https://github.com/M5Devs/OpenROM-bins.git bins git -C bins checkout 586f7cc54df0facf9df9d3066c70e6b434b93753 + cd bins && sha256sum -c checksums.sha256 && cd .. - name: Set up Flutter uses: subosito/flutter-action@v2 diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index ed79d16..83e0d13 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -20,9 +20,14 @@ jobs: - uses: actions/checkout@v5 - name: Fetch binaries from OpenROM-bins + shell: bash run: | git clone --depth 1 https://github.com/M5Devs/OpenROM-bins.git bins git -C bins checkout 586f7cc54df0facf9df9d3066c70e6b434b93753 + cd bins && sha256sum -c checksums.sha256 && cd .. + + - name: Copy Windows binaries + run: | New-Item -ItemType Directory -Force -Path assets\windows Copy-Item -Path "bins\windows\x86_64\*" -Destination "assets\windows\" -Recurse @@ -150,6 +155,7 @@ jobs: run: | git clone --depth 1 https://github.com/M5Devs/OpenROM-bins.git bins git -C bins checkout 586f7cc54df0facf9df9d3066c70e6b434b93753 + cd bins && sha256sum -c checksums.sha256 && cd .. mkdir -p assets/linux/x86_64 cp -r bins/linux/x86_64/. assets/linux/x86_64/ chmod +x assets/linux/x86_64/* @@ -274,6 +280,7 @@ jobs: run: | git clone --depth 1 https://github.com/M5Devs/OpenROM-bins.git bins git -C bins checkout 586f7cc54df0facf9df9d3066c70e6b434b93753 + cd bins && sha256sum -c checksums.sha256 && cd .. mkdir -p assets/linux/arm64 cp -r bins/linux/arm64/. assets/linux/arm64/ chmod +x assets/linux/arm64/* @@ -381,6 +388,7 @@ jobs: run: | git clone --depth 1 https://github.com/M5Devs/OpenROM-bins.git bins git -C bins checkout 586f7cc54df0facf9df9d3066c70e6b434b93753 + cd bins && (sha256sum -c checksums.sha256 || shasum -a 256 -c checksums.sha256) && cd .. mkdir -p assets/macos/arm64 assets/macos/x86_64 cp -r bins/macos/arm64/. assets/macos/arm64/ cp -r bins/macos/x86_64/. assets/macos/x86_64/ diff --git a/README.md b/README.md index 79958f0..fbd8205 100644 --- a/README.md +++ b/README.md @@ -138,8 +138,9 @@ Each release includes the **Flutter GUI** (`OpenROM`) and the **headless CLI** ( | WBFS | ISO | nodtool | Wii | | GCZ | ISO | nodtool | GameCube / Wii | | NKit | ISO | nkit | GameCube / Wii | -| WUD | ISO | nkit | Wii U | -| WUX | ISO | nkit | Wii U (compressed) | +| WUD | ISO, WUA | nkit | Wii U | +| WUX | ISO, WUA | nkit | Wii U (compressed) | +| WUA | ISO, WUD | nkit | Wii U (ZArchive) | | ISO | NKit | nkit | GameCube / Wii | --- diff --git a/build_linux.sh b/build_linux.sh index 7ce8dd7..d2055db 100755 --- a/build_linux.sh +++ b/build_linux.sh @@ -1,6 +1,11 @@ #!/usr/bin/env bash set -e +if [ -d "bins" ]; then + echo "=== Verifying OpenROM-bins checksums ===" + (cd bins && sha256sum -c checksums.sha256) +fi + echo "=== Building OpenROM Core (Dart CLI) ===" cd core dart pub get diff --git a/build_mac.sh b/build_mac.sh index 34193bf..bd40439 100755 --- a/build_mac.sh +++ b/build_mac.sh @@ -1,6 +1,11 @@ #!/usr/bin/env bash set -e +if [ -d "bins" ]; then + echo "=== Verifying OpenROM-bins checksums ===" + (cd bins && (sha256sum -c checksums.sha256 || shasum -a 256 -c checksums.sha256)) +fi + echo "=== Building OpenROM Core (Dart CLI) ===" cd core dart pub get diff --git a/build_windows.bat b/build_windows.bat index 90fc32e..5fe8cad 100644 --- a/build_windows.bat +++ b/build_windows.bat @@ -1,4 +1,11 @@ @echo off +if exist bins ( + echo === Verifying OpenROM-bins checksums === + cd bins + powershell -Command "Get-Content checksums.sha256 | ForEach-Object { $line = $_; $parts = $line -split ' '; if ($parts.Length -eq 2) { $hash = $parts[0].Trim(); $file = $parts[1].Trim(); if (Test-Path $file) { $actual = (Get-FileHash -Algorithm SHA256 $file).Hash.ToLower(); if ($actual -ne $hash) { Write-Error 'Checksum mismatch'; throw 'Checksum error' } } } }" + if errorlevel 1 goto fail + cd .. +) echo === Building OpenROM Core (Dart CLI) === cd core call dart pub get @@ -12,3 +19,8 @@ call flutter build windows --release cd .. echo === Build Complete === + +goto ok +:fail +call +:ok diff --git a/core/lib/src/converter.dart b/core/lib/src/converter.dart index dd0028b..6694c5d 100644 --- a/core/lib/src/converter.dart +++ b/core/lib/src/converter.dart @@ -196,7 +196,8 @@ class Converter { return _toXiso(job, src); } - if ((['WUD', 'WUX', 'NKIT'].contains(fmt) && tgt == 'ISO') || + if ((['WUD', 'WUX', 'NKIT', 'WUA'].contains(fmt) && + ['ISO', 'WUA', 'WUD'].contains(tgt)) || (fmt == 'ISO' && tgt == 'NKIT')) { return _nkitConvert(job, src, tgt); } @@ -245,7 +246,7 @@ class Converter { subCmd = 'createdvd'; } else { final err = - 'Error: Platform could not be detected. Please specify --media cd or --media dvd.'; + "Unsupported or ambiguous media type for platform '$platform'. Please specify --media cd or --media dvd."; _log('[ERROR] $err'); job.error = err; return false; diff --git a/core/lib/src/detector.dart b/core/lib/src/detector.dart index 695a5b1..11c00f3 100644 --- a/core/lib/src/detector.dart +++ b/core/lib/src/detector.dart @@ -24,6 +24,7 @@ const Map supportedInput = { '.wbfs': 'WBFS', '.wud': 'WUD', '.wux': 'WUX', + '.wua': 'WUA', '.nkit.iso': 'NKIT', '.gcz': 'GCZ', '.cci': 'CCI', @@ -50,6 +51,7 @@ const Map platformMap = { 'GCZ': 'GameCube / Wii', 'WUD': 'Wii U', 'WUX': 'Wii U', + 'WUA': 'Wii U (ZArchive)', 'NKIT': 'GameCube / Wii', 'Saturn': 'Sega Saturn', 'Sega CD': 'Sega CD / Mega-CD', @@ -77,6 +79,7 @@ const Map formatColors = { 'GCZ': '#9fa8da', 'WUD': '#e65100', 'WUX': '#ef6c00', + 'WUA': '#e65100', 'NKIT': '#1a237e', 'UNKNOWN': '#7a8a9a', 'Saturn': '#1565c0', @@ -101,9 +104,10 @@ const Map> conversionMap = { 'WIA': ['ISO'], 'WBFS': ['ISO'], 'GCZ': ['ISO'], - 'WUD': ['ISO'], - 'WUX': ['ISO'], + 'WUD': ['ISO', 'WUA'], + 'WUX': ['ISO', 'WUA'], 'NKIT': ['ISO'], + 'WUA': ['ISO', 'WUD'], 'CCI': ['ISO'], 'ZAR': ['ISO'], }; @@ -134,6 +138,10 @@ const Map commandTemplates = { 'GCZ->ISO': 'nodtool convert "{in}" "{out}"', 'WUD->ISO': 'nkit convert -i "{in}" -o "{out}"', 'WUX->ISO': 'nkit convert -i "{in}" -o "{out}"', + 'WUD->WUA': 'nkit convert -i "{in}" -o "{out}"', + 'WUX->WUA': 'nkit convert -i "{in}" -o "{out}"', + 'WUA->ISO': 'nkit convert -i "{in}" -o "{out}"', + 'WUA->WUD': 'nkit convert -i "{in}" -o "{out}"', 'NKIT->ISO': 'nkit convert -i "{in}" -o "{out}"', 'ISO->NKIT': 'nkit convert -i "{in}" -o "{out}"', 'CCI->ISO': 'xgdtool --xiso "{in}" "{outdir}"', diff --git a/core/test/detector_test.dart b/core/test/detector_test.dart index 78b0104..92921f5 100644 --- a/core/test/detector_test.dart +++ b/core/test/detector_test.dart @@ -5,6 +5,24 @@ import 'package:path/path.dart' as p; import 'package:test/test.dart'; void main() { + test('wua_file_detection_and_targets', () { + final tmpDir = Directory.systemTemp.createTempSync('wua_test_'); + try { + final wuaPath = p.join(tmpDir.path, 'game.wua'); + File(wuaPath).writeAsBytesSync(List.filled(100, 0)); + + final info = detectFile(wuaPath); + expect(info['format'], equals('WUA')); + expect(info['platform'], equals('Wii U (ZArchive)')); + expect(info['valid_targets'], equals(['ISO', 'WUD'])); + + final cmd = getCommandPreview('WUA', 'ISO', 'game.wua'); + expect(cmd, equals('nkit convert -i "game.wua" -o "game.iso"')); + } finally { + tmpDir.deleteSync(recursive: true); + } + }); + test('unknown_iso_platform_detection', () { final tmpDir = Directory.systemTemp.createTempSync('unknown_iso_test_'); try { @@ -205,7 +223,7 @@ void main() { expect( job.error, equals( - 'Error: Platform could not be detected. Please specify --media cd or --media dvd.', + "Unsupported or ambiguous media type for platform 'UNKNOWN'. Please specify --media cd or --media dvd.", ), ); } finally { @@ -270,7 +288,7 @@ void main() { expect( job.error, equals( - 'Error: Platform could not be detected. Please specify --media cd or --media dvd.', + "Unsupported or ambiguous media type for platform 'CustomConsoleX'. Please specify --media cd or --media dvd.", ), ); } finally { diff --git a/gui/lib/screens/settings_screen.dart b/gui/lib/screens/settings_screen.dart index 9d2a7ba..1ffc0eb 100644 --- a/gui/lib/screens/settings_screen.dart +++ b/gui/lib/screens/settings_screen.dart @@ -322,7 +322,7 @@ class _SettingsScreenState extends State { }, ), ChoiceChip( - label: const Text('Maximum Compression (Vorbis)'), + label: const Text('Max Compression (Vorbis)'), selected: _selectedAudioCodec == 'vorbis', selectedColor: theme.accent, backgroundColor: theme.surface,