Skip to content

Add hotswappable CD-ROM mode with runtime disc switching#47

Open
GenSayer wants to merge 2 commits into
techomancer:mainfrom
GenSayer:cd-hotswapping
Open

Add hotswappable CD-ROM mode with runtime disc switching#47
GenSayer wants to merge 2 commits into
techomancer:mainfrom
GenSayer:cd-hotswapping

Conversation

@GenSayer

Copy link
Copy Markdown
Contributor

Introduces a hotswappable flag for CD-ROM devices that enables on-the-fly disc switching via keyboard shortcuts (RCtrl+F12 native, Ctrl+F12 GUI) without pre-configuring a changer queue or restarting the emulator.

New features:

  • hotswappable = true per-drive config (iris.toml + GUI checkbox)
  • Runtime disc loading via file picker (RCtrl+F12 / Ctrl+F12)
  • Empty tray on startup when path omitted (hotswappable only)
  • GUI config editor: browse button loads discs immediately
  • GUI: "Extra changer discs" hidden when hotswappable=true

Validation:

  • Errors when hotswappable=false + empty path (suggests enabling, cleaner error message than before)
  • Errors when hotswappable=true + discs list (mutually exclusive)
  • Ctrl+F12 disabled with helpful message when hotswappable=false

Console logging:

  • "CD-ROM hotswap: ejected '', tray empty" (hotswappable eject)
  • "CD-ROM changer: switched to ''" (legacy changer cycle)
  • "SCSI SGI_EJECT: tray emptied" (hotswappable SGI eject)

Config example:
[scsi.4] cdrom = true hotswappable = true # path optional — start with empty tray

Changes: 13 files, 699 lines

  • Core: config.rs, scsi.rs, wd33c93a.rs, machine.rs, main.rs, ui.rs
  • GUI: config_ui.rs, main.rs, handle.rs, scsi_menu.rs, dialogs/new_machine.rs
  • Docs: iris.toml
  • Build: Cargo.toml (added rfd for file picker)

GenSayer added 2 commits June 23, 2026 20:19
Introduces a `hotswappable` flag for CD-ROM devices that enables
on-the-fly disc switching via keyboard shortcuts (RCtrl+F12 native,
Ctrl+F12 GUI) without pre-configuring a changer queue or restarting
the emulator.

Fixes three bugs in legacy changer mode:
- load_disc() accumulated discs at index 0 instead of replacing
- eject through IRIX failed when hotswappable=true (len guard)

New features:
- hotswappable = true per-drive config (iris.toml + GUI checkbox)
- Runtime disc loading via file picker (RCtrl+F12 / Ctrl+F12)
- Empty tray on startup when path omitted (hotswappable only)
- GUI config editor: browse button loads discs immediately
- GUI: "Extra changer discs" hidden when hotswappable=true

Validation:
- Errors when hotswappable=false + empty path (suggests enabling, cleaner error message than before)
- Errors when hotswappable=true + discs list (mutually exclusive)
- Ctrl+F12 disabled with helpful message when hotswappable=false

Console logging:
- "CD-ROM hotswap: ejected '<path>', tray empty" (hotswappable eject)
- "CD-ROM changer: switched to '<path>'" (legacy changer cycle)
- "SCSI SGI_EJECT: tray emptied" (hotswappable SGI eject)

Config example:
  [scsi.4]
  cdrom = true
  hotswappable = true
  # path optional — start with empty tray

Changes: 13 files, 699 lines
- Core: config.rs, scsi.rs, wd33c93a.rs, machine.rs, main.rs, ui.rs
- GUI: config_ui.rs, main.rs, handle.rs, scsi_menu.rs, dialogs/new_machine.rs
- Docs: iris.toml
- Build: Cargo.toml (added rfd for file picker)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant