# dolphin-tool - Wii/GameCube Disc Image Tool **RVZ Format Support** - Best compression for Wii/GameCube ISOs (60-70% savings!) ## Overview `dolphin-tool` is the command-line interface extracted from Dolphin Emulator. It provides disc image conversion, verification, and extraction capabilities for Nintendo Wii and GameCube games. **Key Feature**: RVZ format compression achieves 60-70% space savings while maintaining full compatibility with Dolphin emulator. ## Installation Pre-built binary available at: `tools/bin/dolphin-tool` (23 MB) No additional dependencies required for basic usage. ## Supported Formats ### Input Formats - **ISO**: Uncompressed disc image - **WBFS**: Wii Backup File System - **GCZ**: GameCube/Wii compressed format - **WIA**: Wii Image Archive - **RVZ**: Revolutionary compressed format (Dolphin's best!) ### Output Formats - **ISO**: Standard uncompressed format - **GCZ**: Legacy compressed format (30-40% savings) - **WIA**: Advanced compressed format (50-60% savings) - **RVZ**: Modern compressed format (60-70% savings) ← **RECOMMENDED!** ## Format Comparison | Format | Compression | Speed | Compatibility | Notes | |--------|-------------|-------|---------------|-------| | ISO | 0% | Fast | Universal | No compression, large files | | WBFS | 30-40% | Fast | Dolphin only | Use wit tool instead | | GCZ | 30-40% | Good | Dolphin only | Legacy format | | WIA | 50-60% | Good | Dolphin 5.0+ | Good balance | | RVZ | 60-70% | Good | Dolphin 5.0+ | **Best compression!** | **Space Savings Example** (50 Wii games): - Original ISOs: 235 GB - WBFS format: 160 GB (save 75 GB) - RVZ format: 75 GB (save 160 GB!) ← **Extra 85 GB saved!** ## Commands ### convert - Format Conversion Convert between disc image formats with optional compression. ```bash # ISO → RVZ (RECOMMENDED - best compression!) tools/bin/dolphin-tool convert \\ -f rvz \\ -b 131072 \\ -c zstd \\ -l 5 \\ -i input.iso \\ -o output.rvz # RVZ → ISO (decompress for other emulators) tools/bin/dolphin-tool convert \\ -f iso \\ -i input.rvz \\ -o output.iso # Scrub junk data during conversion (saves more space) tools/bin/dolphin-tool convert \\ -f rvz \\ -b 131072 \\ -c zstd \\ -l 5 \\ --scrub \\ -i input.iso \\ -o output.rvz ``` **Options:** - `-f, --format`: Output format [iso|gcz|wia|rvz] - `-i, --input`: Input file path - `-o, --output`: Output file path - `-b, --block_size`: Block size for compression (131072 recommended for RVZ) - `-c, --compression`: Method [none|zstd|bzip2|lzma|lzma2] (zstd recommended) - `-l, --compression_level`: Compression level 1-22 (5 recommended for zstd) - `-s, --scrub`: Remove junk data (extra space savings) - `-u, --user`: User folder for temporary files (auto-created if not set) ### verify - Verify Disc Image Check disc image integrity and display information. ```bash # Verify a disc image tools/bin/dolphin-tool verify -i game.rvz # Verify all RVZ files in directory for rvz in *.rvz; do tools/bin/dolphin-tool verify -i "$rvz" && echo "✓ $rvz OK" || echo "✗ $rvz FAILED" done ``` **Options:** - `-i, --input`: Input file path - `-u, --user`: User folder for temporary files ### header - Display Disc Header Show game metadata from disc image. ```bash # Display game info tools/bin/dolphin-tool header -i game.rvz # Output includes: # - Game Title # - Game ID # - Region # - Disc Number # - Revision ``` **Options:** - `-i, --input`: Input file path - `-b, --block_size`: Block size for compressed formats ### extract - Extract Files from Disc Extract filesystem contents from disc image. ```bash # Extract all files tools/bin/dolphin-tool extract -i game.iso -o output_directory/ # Extract specific partition (Wii multi-disc) tools/bin/dolphin-tool extract \\ -i game.iso \\ -o output_directory/ \\ -p 0 # Partition number # Extract with partition listing tools/bin/dolphin-tool extract \\ -i game.iso \\ -o output_directory/ \\ --list-partitions ``` **Options:** - `-i, --input`: Input file path - `-o, --output`: Output directory - `-p, --partition`: Partition number to extract - `-l, --list-partitions`: List available partitions - `-u, --user`: User folder for temporary files ## RVZ Format Recommendations ### Best Settings for RVZ Compression **Recommended (balanced):** ```bash -f rvz -b 131072 -c zstd -l 5 ``` - Compression: 60-70% - Speed: Good (5-10 minutes per 4.7GB ISO) - Compatibility: Dolphin 5.0+ **Maximum Compression:** ```bash -f rvz -b 131072 -c zstd -l 18 ``` - Compression: 65-75% - Speed: Slower (15-30 minutes per ISO) - Use for archival **Faster Compression:** ```bash -f rvz -b 131072 -c zstd -l 3 ``` - Compression: 55-65% - Speed: Fast (3-5 minutes per ISO) - Still better than WBFS! ### Compression Methods | Method | Speed | Ratio | Notes | |--------|-------|-------|-------| | **zstd** | Fast | Excellent | **Recommended!** Best balance | | lzma2 | Slow | Excellent | Slightly better compression, much slower | | bzip2 | Medium | Good | Legacy, use zstd instead | | lzma | Slow | Good | Use lzma2 instead | | none | Very Fast | 0% | Uncompressed WIA/RVZ | ## Batch Processing ### Convert All ISOs to RVZ ```bash #!/bin/bash # Convert all ISOs in current directory to RVZ format for iso in *.iso; do output="${iso%.iso}.rvz" echo "Converting $iso → $output..." tools/bin/dolphin-tool convert \\ -f rvz \\ -b 131072 \\ -c zstd \\ -l 5 \\ -i "$iso" \\ -o "$output" # Verify conversion if tools/bin/dolphin-tool verify -i "$output" >/dev/null 2>&1; then echo "✓ Verified: $output" # Optional: Remove original ISO to save space # rm "$iso" else echo "✗ Verification failed: $output" rm "$output" fi done ``` ### Parallel Compression (4 jobs) ```bash #!/bin/bash # Convert ISOs to RVZ in parallel (requires GNU parallel) find . -name "*.iso" | parallel -j 4 \\ 'tools/bin/dolphin-tool convert \\ -f rvz -b 131072 -c zstd -l 5 \\ -i {} -o {.}.rvz && \\ echo "✓ Converted: {}"' ``` ### Calculate Space Savings ```bash #!/bin/bash # Calculate total space saved after RVZ conversion iso_size=$(du -shc *.iso 2>/dev/null | tail -1 | cut -f1) rvz_size=$(du -shc *.rvz 2>/dev/null | tail -1 | cut -f1) echo "Original ISOs: $iso_size" echo "RVZ compressed: $rvz_size" ``` ## Integration with ROM Farmer ### Transformation Tracking RVZ conversions can be tracked in the transformation database: ```python # Example: Track ISO → RVZ transformation db.record_transformation( source_file="game.iso", destination_file="game.rvz", transformation_type="compress", tool="dolphin-tool", tool_version="2025-10-10", source_format="iso", dest_format="rvz", metadata={ "block_size": 131072, "compression": "zstd", "compression_level": 5, "scrubbed": False } ) # Query transformation chain chain = db.get_transformation_chain("game.rvz") # Returns: [{"format": "iso"}, {"format": "rvz"}] # Reverse transformation (RVZ → ISO) if user_needs_iso: original_format = chain[0]["format"] # "iso" dolphin_tool_convert(rvz_file, iso_file, format="iso") ``` ### ScreenScraper Hash Lookup RVZ files need to be temporarily converted to ISO for hash matching: ```python # Get hash for ScreenScraper lookup def get_iso_hash_from_rvz(rvz_file): # Convert RVZ → temporary ISO temp_iso = tempfile.mktemp(suffix=".iso") dolphin_tool_convert(rvz_file, temp_iso, format="iso") # Calculate hash hash_value = calculate_hash(temp_iso, algorithm="md5") # Cleanup os.remove(temp_iso) return hash_value # Query ScreenScraper with ISO hash game_info = screenscraper.lookup_by_hash(hash_value, platform="wii") ``` ## Compatibility ### Emulators - **Dolphin 5.0+**: Full RVZ/WIA/GCZ support - **Dolphin 4.x**: ISO/GCZ only (convert RVZ → ISO) - **Other Emulators**: ISO only (convert RVZ → ISO) ### Operating Systems - **Linux**: Native support (this build) - **Windows**: Build from source or use official Dolphin - **macOS**: Build from source or use official Dolphin ### Wii/GameCube Games - **All Wii games**: Fully supported - **All GameCube games**: Fully supported - **Multi-disc games**: Each disc separate - **Wii U VC**: Not supported (use wud-compress instead) ## Performance Notes ### Compression Speed (Typical 4.7GB Wii ISO) - **zstd level 3**: 3-5 minutes - **zstd level 5**: 5-10 minutes (recommended) - **zstd level 18**: 15-30 minutes (maximum compression) - **lzma2**: 30-60 minutes (slightly better compression) ### Memory Usage - **Compression**: ~500 MB RAM - **Decompression**: ~200 MB RAM - **Verification**: ~100 MB RAM ### CPU Usage - **Multi-threaded**: Uses all available CPU cores - **zstd**: Excellent multi-threading - **lzma2**: Limited multi-threading ## Troubleshooting ### "Failed to load disc image" - Verify source file integrity: `tools/bin/dolphin-tool verify -i file` - Check file permissions: `chmod 644 file` - Ensure enough disk space for conversion ### "Compression failed" - Check available RAM (need ~500 MB) - Try lower compression level: `-l 3` instead of `-l 5` - Verify source ISO is valid ### "Verification failed" - Source file may be corrupted - Try re-dumping from original disc - Check for incomplete downloads ### RVZ file won't load in Dolphin - Update Dolphin to 5.0 or newer - Verify RVZ: `tools/bin/dolphin-tool verify -i game.rvz` - Try converting to ISO: `-f iso` ## Building from Source See `build.sh` for build instructions. Dependencies: - g++ 11+ or clang 12+ - cmake 3.20+ - liblzma-dev - libzstd-dev - libfmt-dev - libevdev-dev Build time: ~3 minutes ## References - **Dolphin Emulator**: https://dolphin-emu.org/ - **RVZ Format Spec**: https://github.com/dolphin-emu/dolphin/wiki/RVZ-Format - **Dolphin GitHub**: https://github.com/dolphin-emu/dolphin - **ROM Farmer**: [Local documentation](../../README.md) ## License Dolphin is licensed under GPLv2+. See Dolphin repository for details. ## Version Built from commit: 8323c21 (2025-10-10) Build date: 2025-10-12 Binary size: 23 MB