> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/dolphin-emu/dolphin/llms.txt
> Use this file to discover all available pages before exploring further.

# Disc I/O

> Disc image loading and format support for GameCube and Wii games

Dolphin supports multiple disc image formats for GameCube and Wii games with varying compression and features.

## Supported Formats

**Location**: `Source/Core/DiscIO/`

<CardGroup cols={2}>
  <Card title="ISO" icon="disc">
    Uncompressed 1:1 disc image

    **Size**: 1.4 GB (GC) / 4.7 GB (Wii single-layer)
  </Card>

  <Card title="RVZ" icon="file-zipper">
    Modern compressed format (recommended)

    **Size**: 200 MB - 1 GB (Zstandard compression)
  </Card>

  <Card title="GCZ" icon="file-archive">
    Legacy GameCube compression

    **Size**: 300 MB - 800 MB (Deflate)
  </Card>

  <Card title="WIA" icon="compact-disc">
    Compressed Wii format

    **Size**: 400 MB - 1.5 GB (LZMA/Bzip2)
  </Card>

  <Card title="WBFS" icon="database">
    Wii Backup File System

    **Size**: Variable (scrubbed)
  </Card>

  <Card title="CISO" icon="layer-group">
    Compact ISO

    **Size**: Similar to GCZ
  </Card>
</CardGroup>

### Format Comparison

| Format   | Compression | Speed   | Size    | Recommend   |
| -------- | ----------- | ------- | ------- | ----------- |
| **RVZ**  | Zstandard   | Fast    | Best    | ✅ Yes       |
| **ISO**  | None        | Fastest | Largest | For backups |
| **WIA**  | LZMA/Bzip2  | Slow    | Good    | Legacy      |
| **GCZ**  | Deflate     | Medium  | OK      | Legacy GC   |
| **WBFS** | Scrubbing   | Fast    | Good    | Limited     |
| **CISO** | Deflate     | Medium  | OK      | Limited     |

<Note>
  **Recommended**: Use RVZ format for best compression and speed balance.
</Note>

## RVZ Format

Dolphin's modern compression format:

### Features

* Zstandard compression (very fast, excellent ratio)
* Block-based (supports partial reads)
* Wii partition decryption
* Hash removal (smaller size)
* Scrubbing support

### Compression Levels

```bash theme={null}
# dolphin-tool convert
dolphin-tool convert -i game.iso -o game.rvz \
  -f rvz \
  -c zstd \
  -l 5     # Compression level 1-22
```

| Level | Speed     | Ratio    | Recommended       |
| ----- | --------- | -------- | ----------------- |
| 1-3   | Very fast | OK       | Quick conversion  |
| **5** | **Fast**  | **Good** | **Default**       |
| 9-13  | Medium    | Better   | Archive           |
| 18-22 | Slow      | Best     | Long-term storage |

### Block Size

```bash theme={null}
# Larger blocks = better compression, slower seeks
dolphin-tool convert -i game.iso -o game.rvz \
  -f rvz -c zstd -l 5 \
  -b 131072  # 128 KB (recommended)
```

Recommended: **128 KB** (131072 bytes)

## Disc Volume

**Location**: `DiscIO/Volume.cpp`

Common interface for all formats:

```cpp theme={null}
// Open any supported format
std::unique_ptr<Volume> CreateVolume(const std::string& path);

// Read sectors
bool Read(u64 offset, u64 size, u8* buffer);

// Get disc info
Platform GetVolumeType();      // GameCube or Wii
Country GetCountry();           # Region
std::string GetGameID();        # 6-char game ID
```

## GameCube Disc Structure

```
GameCube Disc (1.4 GB)
├── 0x0000: Boot info (game ID, version, etc.)
├── 0x0420: Disc Header Info 2
├── 0x2440: Apploader (game-specific loader)
├── Variable: FST (File System Table)
├── Variable: DOL (main executable)
└── Variable: Game files
```

### Reading Game Files

**Location**: `DiscIO/Filesystem.cpp`

Extract files from disc:

```cpp theme={null}
// Get filesystem
std::unique_ptr<FileSystem> fs = CreateFileSystem(volume);

// List files
std::vector<std::string> files = fs->GetFileList();

// Extract file  
bool ExportFile(const std::string& path, const std::string& export_path);
```

## Wii Disc Structure

Wii discs use partitions:

```
Wii Disc (4.7 GB single-layer, 8.5 GB dual-layer)
├── 0x0000: Disc Header
├── 0x40000: Region settings
├── 0x50000: Partition table
├── Partition 0: Update partition (system update)
├── Partition 1: Game partition (main content)
│   ├── Partition header (ticket, TMD, certs)
│   ├── Encrypted content
│   │   ├── 0x0000: Partition info
│   │   ├── 0x0420: Boot info
│   │   ├── Variable: Apploader
│   │   ├── Variable: FST
│   │   ├── Variable: DOL
│   │   └── Variable: Game files
│   └── H3 hash table
└── Partition N: Optional channel/DLC partitions
```

### Partition Encryption

Wii partitions are AES-encrypted:

**Location**: `DiscIO/VolumeWii.cpp`

```cpp theme={null}
// Decrypt partition data
DecryptPartition(partition_key, encrypted_data, decrypted_data);
```

* Each 0x8000-byte block is encrypted separately
* 0x400-byte hashes at start of each block (removed in RVZ)
* Title key from ticket + Common key

### Scrubbing

Remove unused data:

```bash theme={null}
dolphin-tool convert -i game.iso -o game.rvz \
  -f rvz -s  # --scrub flag
```

Scrubbing removes:

* Unused partition space
* Garbage data
* Debug information

Reduces size by 10-30%.

## WIA Format

**Specification**: See [WIA/RVZ Format Spec](/specs/wia-rvz-format)

Legacy Wii compression:

### Compression Methods

* **None**: Uncompressed (testing)
* **Purge**: Remove unused data only
* **Bzip2**: Good compression, slow
* **LZMA**: Best compression, very slow
* **LZMA2**: Improved LZMA

### Chunk Size

Data divided into chunks (default 2 MB):

```bash theme={null}
dolphin-tool convert -i game.iso -o game.wia \
  -f wia -c lzma -l 5 -b 2097152  # 2 MB chunks
```

## GCZ Format

Legacy GameCube compression:

### Structure

* Deflate compression per block
* Block size: typically 16 KB
* Header with block offsets

<Warning>
  GCZ is outdated. Use RVZ for new conversions.
</Warning>

## WBFS Format

Wii Backup File System:

### Features

* Automatic scrubbing
* Multiple games per volume
* Direct Wii console compatibility (with homebrew)

### Limitations

* No compression (but scrubbed)
* No dual-layer support
* Less efficient than RVZ

## Disc Conversion

Use `dolphin-tool convert` for format conversion:

### ISO to RVZ (Recommended)

```bash theme={null}
dolphin-tool convert \
  -i game.iso \
  -o game.rvz \
  -f rvz \
  -c zstd \
  -l 5 \
  -b 131072 \
  -s  # Optional scrubbing
```

### Any Format to ISO

```bash theme={null}
# Extract to uncompressed ISO
dolphin-tool convert -i game.rvz -o game.iso -f iso
```

### Batch Conversion

```bash theme={null}
#!/bin/bash
for iso in *.iso; do
  dolphin-tool convert -i "$iso" -o "${iso%.iso}.rvz" \
    -f rvz -c zstd -l 5 -b 131072 -s
done
```

See [DolphinTool Convert](/cli/dolphin-tool/convert) for details.

## Disc Verification

Verify disc integrity:

```bash theme={null}
# Compute hash
dolphin-tool verify -i game.rvz -a md5

# Full verification report
dolphin-tool verify -i game.wia
```

See [DolphinTool Verify](/cli/dolphin-tool/verify) for details.

## Performance Considerations

<Accordion title="Read Speed">
  Format affects loading speed:

  * **ISO**: Fastest (no decompression)
  * **RVZ** (Zstandard): Very fast (hardware decompression)
  * **GCZ/CISO**: Medium (Deflate overhead)
  * **WIA** (LZMA): Slow (CPU-intensive decompression)

  **Recommendation**: RVZ for best balance.
</Accordion>

<Accordion title="Disc Cache">
  Dolphin caches decompressed blocks:

  ```ini theme={null}
  [Core]
  DiskCache = True     # Cache disc reads (recommended)
  DiskCacheSize = 32   # MB of cache
  ```

  Reduces stuttering with compressed formats.
</Accordion>

<Accordion title="Storage">
  Typical sizes:

  | Game               | ISO    | RVZ (Zstd-5) | Savings |
  | ------------------ | ------ | ------------ | ------- |
  | Super Mario Galaxy | 4.7 GB | 850 MB       | 82%     |
  | Mario Kart Wii     | 4.7 GB | 720 MB       | 85%     |
  | Luigi's Mansion    | 1.4 GB | 380 MB       | 73%     |
</Accordion>

## See Also

* [DolphinTool Convert](/cli/dolphin-tool/convert)
* [DolphinTool Verify](/cli/dolphin-tool/verify)
* [WIA/RVZ Format Specification](/specs/wia-rvz-format)
