Menu

#164 UI should warn about conflicting peripheral options

future
open
nobody
5
2026-08-17
2013-02-10
No

The UI should warn about conflicting peripheral options, or otherwise make them impossible to select.

Discussion

  • Fredrick Meunier

    🤖 This is an automated response from Repo Assist.

    Thanks for reporting this, zubzero — this is a valid enhancement and it is still unimplemented. I looked at the current code and confirmed that Fuse has no conflict handling for peripheral options.

    Current behavior (no warnings): Peripheral options are plain independent checkboxes in ui/options.dat (Interface 1, Beta 128, +D, Didaktik 80, DISCiPLE, Opus, ZXATASP, ZXCF, DivIDE, …), rendered by ui/gtk3/options.pl and ui/widget/options.pl. Any combination can be enabled. In the core, periph_activate_type() in periph.c just registers the enabled peripheral's port table into a shared ports list; there is no conflict check.

    Why options genuinely conflict: writeport_internal() / readport_internal() in periph.c iterate over every registered port and dispatch to each peripheral whose port & mask == value. So if two peripherals answer the same I/O port, a single read/write hits both devices. Concrete overlaps in the port tables:

    • Beta 128 (peripherals/disk/beta.c): ports 0x1f, 0x3f, 0x5f, 0x7f, 0xff.
    • DISCiPLE (peripherals/disk/disciple.c): 0x1b, 0x5b, 0x9b, 0xdb, 0x1f, 0x3b, 0x7b, 0xbb, 0xfb — 0x1f collides with Beta, 0xfb with +D.
    • +D (peripherals/disk/plusd.c): 0xe3/0xeb/0xf3/0xfb/0xef/0xe7/0xf7 — 0xfb collides with DISCiPLE.
    • Didaktik 80 (peripherals/disk/didaktik.c): its 8255 responds to the whole 0x00–0x7f range (mask 0x80), overlapping Beta/DISCiPLE/Interface 1.
    • Interface 1 (peripherals/if1.c: mask 0x18) overlaps Beta/DISCiPLE/Didaktik in the 0x00–0x7f range.
      There is even an existing comment in peripherals/sound/uspeech.c ("Really?! This conflicts with the ULA!") showing the codebase already knows some port overlaps exist, but they are never surfaced in the UI.

    Suggested implementation: Introduce a small conflict model — e.g., mutually-exclusive groups in the options dialog (one disk interface at a time; Interface 1 vs. the port-0x7f disk interfaces; and the IDE interfaces) — and either disable the conflicting checkbox when one is already enabled, or show a warning before the change is applied. The port tables already encode the overlaps, so the conflict set could be derived automatically rather than hardcoded. Relevant files: ui/options.dat, ui/gtk3/options.pl, ui/widget/options.pl, periph.c/periph.h.

    Happy to help flesh this out; a good first step is agreeing the conflict groups with the maintainers before wiring the UI.

     
  • Fredrick Meunier

    Ticket moved from /p/fuse-emulator/bugs/287/

     

Log in to post a comment.