> For the complete documentation index, see [llms.txt](https://docs.kouch.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kouch.dev/docs/adr/0012-emulation-folder-layout.md).

# ADR 0012: EmuDeck-compatible, multi-disk Emulation folder; cloud-safe data per Steam user

## Status

Accepted on 2026-09-26. This supersedes where ADR 0007 stored data (`Settings.user_data_root` and `<data>/emulators`).

## Context

The owner's PC already has an EmuDeck-style `Emulation` folder:

* `bios`
* `roms/<system>`
* `saves/<emu>`
* `storage/<emu>`
* `storage/downloaded_media`
* `tools`

The owner wants:

* a first-run step that asks which disk to create the folder on, like EmuDeck
* support for multiple disks, with one main disk for the central data
* cloud-safe data kept in Steam's per-user cloud folder

## Decision

* **Main disk.** `<disk>\Emulation\` holds:
  * `bios`
  * `roms`
  * `saves`
  * `storage`
  * `storage\downloaded_media`
  * `tools\kouch`
  * `emulators` (Kouch addition)
  * `mods` (Kouch addition)
* **Extra disks.** They use the same `roms\<system-folder>` layout.
* **Folder names come from profiles** (schema v2 `folder` and `data_folder`). Kouch's code contains no system names.
* **`storage::ensure_layout()` is idempotent and only ever creates.** It never moves, renames or deletes existing files.
  * An existing tree is adopted in place.
  * Any change to an emulator's paths is shown as a preview and must be confirmed first.
* **Saves live per Steam user.** `saves\<emu>` is a directory junction into the active Steam user's cloud folder, `<Steam>\userdata\<account>\<app id>\remote\`.
  * If Steam turns out not to sync files placed there directly, the junction points at `%APPDATA%\kouch\cloud\<steam id>` instead, and `cloud.rs` syncs it.
  * Moving existing saves in is opt-in, backed up first, and restorable.
* **`bios` is never touched.** It is created empty, with a readme. Kouch never reads, syncs or sends it (ground rule 2).

## Consequences

* A migration moves today's `%LOCALAPPDATA%\kouch\emulators` and `userdata` into the new tree.
* Development and tests never modify the owner's real `R:\Emulation`. They use temp directories and a scratch copy.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.kouch.dev/docs/adr/0012-emulation-folder-layout.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
