Skip to content

iris-gui: Save state keeps the machine running; IMPACT keeps its display after a restart - #316

Merged
techomancer merged 2 commits into
techomancer:mainfrom
atomchild411:gui-save-state
Oct 24, 2026
Merged

techomancer merged 2 commits into
techomancer:mainfrom
atomchild411:gui-save-state

Conversation

@atomchild411

Copy link
Copy Markdown
Collaborator

Fixes #307.

What was wrong

  • Save state restarted the machine. After saving, iris-gui resumed by calling start, which starts the whole machine again: a second monitor server on a port that is already in use (the warning in the issue), and every peripheral started on top of itself.
  • The name boxes closed the menu. The Machine menu used egui's default close behaviour, which closes a menu on any click, including the click that focuses the Save or Restore state name box. So the name could not be typed and the snapshot got the default name.
  • IMPACT machines lost their display engines on every restart (found on the way). Machine::stop stops the IMPACT display engines and the Ultra64 board, but restart_peripherals never started them again. Everything that resumes through it (machine-start, reset, snapshot loads and rollbacks, and now iris-gui's Save state) left an IMPACT machine without its HQ3, RSS and refresh threads.

The fix

Two commits:

  1. machine: restart the IMPACT display and the Ultra64 board with the rest: restart_peripherals now restarts everything stop stopped, except the CPU. Both starts are idempotent.
  2. iris-gui: Save state keeps the machine running: the GUI resumes through start_guest, the path the monitor's machine-start uses, and only if the machine was running when the save began. The Machine menu closes only on clicks outside it; its Save, Restore and CPU choices close it themselves.

HAL2 still reopens its audio output after a save, as it does after save + machine-start from the monitor: a save stops the peripherals so their state is consistent.

Testing

On this branch's commits (01eb442, rebased onto 64c7fbf):

  • cargo check --workspace --all-targets with default features, hostgl,jitv2,tcache,lightning,rex-jit,gr4-jit and jitv2,developer: no new warnings (the two it prints, in src/net/testnet.rs and the unused crossbeam-queue dependency, are on main already).
  • Lib tests: 1254 pass with default features, 1798 with the full set, none fail.
  • iris-gui (built with iris/hostgl,iris/jitv2,iris/tcache), an Indy: clicked into the Save state box and typed a name with the Machine menu staying open, saved (Snapshot saved to saves/saved_indy, no monitor-port warning, the machine kept running), then restored it. The side panel's Save state and Restore state buttons send the same commands.

On the same two commits before the rebase onto 64c7fbf (only the base below them changed):

  • IP28 Solid IMPACT at the PROM, machine-stop then machine-start, threads listed with sample: before the fix, MC-DMA, both WD33C93A and the SEEQ threads came back but MGRAS-HQ3, MGRAS-RSS and MGRAS-Refresh did not; with it, all of them come back.
  • Boot matrix (Indy Newport, Indigo2 IP22 XZ, IP28 Solid IMPACT): all pass.

🤖 Generated with Claude Code

atomchild411 and others added 2 commits October 24, 2026 13:36
`stop` stops the IMPACT display engines and the Ultra64 board, but
`restart_peripherals` did not start them again. Every path that resumes
through it (`machine-start`, `reset`, snapshot loads and rollbacks) left
an IMPACT machine without its HQ3, RSS and refresh threads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After saving, the GUI resumed with `start`, which starts the whole
machine again: a second monitor server on a port already in use, and the
peripherals restarted on top of themselves. It now resumes as the
monitor's `machine-start` does, through `start_guest`, and only if the
machine was running when the save began.

The Machine menu closed on any click, including the click that focuses
the Save or Restore state name box, so a name could not be typed. It now
closes on clicks outside it; its buttons and CPU choices close it
themselves.

Fixes techomancer#307.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@techomancer
techomancer merged commit 46ce038 into techomancer:main Oct 24, 2026
7 checks passed
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.

iris-gui: Save state restarts the machine, and its name box closes while typing

2 participants