Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions CHDStudio/MainWindow.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6847,12 +6847,21 @@ private async Task<bool> ConvertToChdAsync(
// not apply to it.
var pspHunk = _pspHunkSize && !isAvi;

var command =
isAvi ? "createld"
: !pspHunk && (forceCd || (!forceDvd && !isIso && !isImg && !isRaw)) ? "createcd"
: pspHunk || forceDvd || isIso ? "createdvd"
: isImg ? "createhd"
: "createraw";
string command;
if (isAvi)
command = "createld";
else if (pspHunk)
command = "createdvd";
else if (forceCd)
command = "createcd";
else if (!forceDvd && !isIso && !isImg && !isRaw)
command = "createcd";
else if (forceDvd || isIso)
command = "createdvd";
else if (isImg)
command = "createhd";
else
command = "createraw";

if (isAvi && _createDeltaChd)
{
Expand Down
12 changes: 7 additions & 5 deletions docs/05-conversion-pipeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,13 @@ The conversion writes to `<name>.<8hex>.chdtmp` next to the destination and move
### Command & argument selection

```csharp
command = isAvi ? "createld"
: !pspHunk && (forceCd || (!forceDvd && !isIso && !isImg && !isRaw)) ? "createcd"
: pspHunk || forceDvd || isIso ? "createdvd"
: isImg ? "createhd"
: "createraw";
if (isAvi) command = "createld";
else if (pspHunk) command = "createdvd";
else if (forceCd) command = "createcd";
else if (!forceDvd && !isIso && !isImg && !isRaw) command = "createcd";
else if (forceDvd || isIso) command = "createdvd";
else if (isImg) command = "createhd";
else command = "createraw";
```

- `pspHunk` — the **PSP 2048 hunk** option forces `createdvd` and adds `-hs 2048`, the hunk size PPSSPP recommends for PSP ISOs. The built-in CHDSharp encoder receives the same override. The option is not applied to laserdisc input and is rejected with a delta CHD, whose parent hunk size must match.
Expand Down
Loading