scsi: unify A2091/A4091 into a [scsi] controller picker#152
Conversation
a5f70e5 to
af0b728
Compare
There was a problem hiding this comment.
Pull request overview
This PR consolidates the A2091 and A4091 SCSI adapters into a single [scsi] configuration section by introducing a controller selector, and updates the launcher and emulator wiring so only one SCSI controller is configured/instantiated at a time.
Changes:
- Add
ScsiControllerenum and[scsi].controllerparsing/validation; remove the legacy[a4091]section. - Update machine construction to instantiate either A2091 or A4091 based on
cfg.scsi.controller, reusing shared drive plumbing. - Update the launcher Hard Disk tab to include a “SCSI controller” cycle picker and to gray out SCSI ROM/unit fields when no controller is selected.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/video/launcher.rs | Adds a SCSI controller picker and emits [scsi] only when a controller is selected. |
| src/emulator.rs | Switches SCSI board instantiation to a single [scsi] path keyed by ScsiController. |
| src/config.rs | Introduces ScsiController, adds [scsi].controller parsing, and removes [a4091] support. |
| copperline.example.toml | Updates example documentation/comments for the new unified [scsi] configuration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
af0b728 to
d808f5a
Compare
|
@LinuxJedi let me know what you think of the current design of making A2091 and A4091 mutually exclusive. Claude initially tried to support both at the same time by duplicating the 7 SCSI units, but it resulted in UI clutter. Amiberry (and WinUAE, likely) takes a different approach: there's a top-level list of drives, and each one can be mapped to a controller and a target ID via drop-downs. To keep things simple, there's also an "auto" option. The Amiberry way becomes important to support complex configurations with multiple contropllers, physical devices, CD changers and all that. Probably not worth it if you're planning to keep the Copperline UX simple and usable. |
I agree. For now lets keep it simple. If someone comes up with a real use case for supporting both at the same time, we can revisit. |
LinuxJedi
left a comment
There was a problem hiding this comment.
Looks like you tmp/ and cap_%d. I don't think they should be here.
Fold the separate [a4091] section into [scsi] with a `controller` key
("a2091" default, or "a4091"). ScsiConfig gains the ScsiController enum and
emulator build switches on it, instead of two independent boards. The two
controllers were mutually exclusive in practice, and a single section lets
the launcher round-trip the config without dropping a board.
rom_odd is validated as an A2091 split-EPROM option. [a4091] is removed
outright (the feature is new enough to have no install base).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add a "SCSI controller" cycle (None / A2091 (Z2) / A4091 (Z3)) to the Hard Disk tab, driving the shared boot-ROM and unit rows. The ROM and drives grey out with no controller; rom_odd greys unless A2091. Keeps the tab compact instead of listing a second seven-drive controller. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
d808f5a to
d79bbfa
Compare
Ooopsie! I could blame Claude, but the truth is that I was sleeping on the helm: I approved a |
No problem. We have all done it at some point. I even saw Fable accidentally add |
Folds the two SCSI host adapters into a single
[scsi]section with acontrollerkey, and surfaces it in the launcher as a one-of picker instead ofa second seven-drive block.
Config
[a4091]is gone.[scsi]gainscontroller = "a2091" | "a4091"(default"a2091", so every existing[scsi]config keeps working untouched):ScsiConfiggains aScsiControllerenum;emulator.rsswitches on it tobuild one board, replacing the two independent
if cfg.scsi.enabled()/if cfg.a4091.enabled()blocks.rom_odd(the A2091 split even/odd EPROM half) is validated as A2091-only;the A4091 has a single ROM.
[a4091]is removed rather than kept as an alias. The feature onlyjust landed (A4091 Zorro III SCSI controller: 53C710 model, SCRIPTS phase engine, drives scan and mount #123), so its install base is ~nil and the migration is a
one-line rename.
Launcher
A "SCSI controller" cycle (None -> A2091 (Z2) -> A4091 (Z3)) on the Hard Disk
tab drives the shared boot-ROM + unit rows. With no controller the ROM and
drives grey out ("no controller");
rom_oddgreys unless A2091. The tab staysat its current length.
Design choice: mutually exclusive, not independent
The engine can genuinely run both boards at once -- they are separate Zorro
autoconfig cards (A2091 is Zorro II, A4091 is Zorro III), each in its own slot,
and before this change the config exposed both
[scsi]and[a4091]simultaneously. So "one controller" is a deliberate UI/config simplification,
not an engine limitation.
The alternative considered was keeping both boards independently
configurable and adding a full A4091 section to the launcher: its own boot-ROM
row plus seven more unit rows. That is the most faithful to the hardware (you
could physically plug both), but it nearly doubles the Hard Disk tab -- 11 rows
to ~19 -- for a configuration essentially nobody runs (two SCSI HBAs in one
machine). The clutter falls on every user to serve a rounding-error use case.
Why mutually exclusive won:
config could express two controllers but the UI could only show one, loading
a two-board config and saving it would silently drop a board. Collapsing to a
single
[scsi] controllergives the config and the UI identical expressivepower, so a save can never lose data -- the round-trip is correct by
construction rather than by a documented caveat.
controller costs zero extra rows. Progressive greying keeps even the populated
case legible.
people actually configure these boards (pick your HBA, attach drives).
The cost is that the rare "both at once" setup is no longer expressible. Given
it was brand-new, undocumented in the example config, and of no practical
demand, that is a good trade for a clean single-controller model end to end.
Testing
cargo build, fullcargo test(config + scsi suites), andcargo clippyall clean.
None -> A2091 (Z2) -> A4091 (Z3); the ROM/unit rows grey with no controller
and rom_odd greys unless A2091; the config round-trips (saving writes the
expected
[scsi]controller/rom/units and reloads correctly); and a machinebooted with a selected controller.
🤖 Generated with Claude Code