Skip to content

Audit and fix UI bugs - #409

Open
vbmacher wants to merge 9 commits into
developfrom
feature-314
Open

Audit and fix UI bugs#409
vbmacher wants to merge 9 commits into
developfrom
feature-314

Conversation

@vbmacher

@vbmacher vbmacher commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

Closes #408

UI audit and bug-fix pass across the application and plugins, plus extraction of duplicated compiler helpers into emuLib.

UI fixes

  • Lifecycle & responsiveness: fixed dialog/panel lifecycle bugs and EDT-safety in CPU status panels (8080, Z80, SSEM), terminal display canvases, AY-3-8910 waveform panel and ZX Spectrum display window.
  • I/O off the EDT: memory dump/load image actions (byte-mem, ram-mem, rasp-mem, ssem-mem) and schema image saving no longer block the UI thread; terminal rendering optimized.
  • Debug table: setValueAt compared value class by identity, silently dropping subclass values; automation no longer leaks its CPU listener; removed useless zero-height gradient built in Element constructor.

Thread-safety & correctness

  • Memory plugins: array-write notification ranges were off by one (to is inclusive) in byte-mem/ssem; byte-mem ROM intersection check included one cell past the write range; ram-mem missed size-change detection on array writes and read labels without the read lock.
  • Terminal video memory: displays handed out live video memory arrays; getters now return snapshots taken under the write lock so renderers cannot observe torn frames.
  • Z80: currentRunState is now volatilerequestMaskableInterrupt reads it from a device thread and a stale read could drop interrupts (8080 was already volatile).
  • Tape player: close() skipped shutdownNow when interrupted.

Assembler fixes (as-8080, as-z80)

  • Expression evaluation used a HashSet<Node> which deduped equal-looking nodes at different addresses (Node subclasses override equals without hashCode); an identity set preserves per-instance multi-pass resolution.
  • Division/modulo by zero is now reported as a compile error with source position instead of crashing the compilation thread.

Refactoring

  • Shared compiler helpers moved to emuLib: CharArrayCharStream (6 identical copies) and ParsingUtils (4 copies) now live in emuLib plugins.compiler.antlr. Recorded in ADR-0008.
  • Deliberately not unified: per-plugin exceptions and ParserErrorListener (divergent types/formats), FlagsModel (different semantics), Breakpoint (trivial), terminal DisplayCanvas (too divergent).
  • Replaced 52-entry Ctrl keycode table and duplicated ZX palettes with loops.

Dependencies

⚠️ Requires emuLib 12.1.0-SNAPSHOT (emuLib commit bc00f7c).

vbmacher and others added 9 commits August 7, 2026 16:04
byte-mem/ssem array write notified one cell past end (to is inclusive);
byte-mem ROM intersects checked one cell past write range; ram-mem array
write missed size-change detection (checked base address only) and
getLabel read labels without read lock. Drop stream lookup in Loader,
stray super.mousePressed in MouseHandler.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
setValueAt compared value class by identity so subclass values were
silently dropped; automation never removed its CPU listener; Element
built a zero-height gradient in constructor that measure() always
replaces before first draw. Fix parameter typo.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Terminal displays handed out live video memory arrays; getters now
return snapshots taken under the write lock so renderers cannot see
torn frames. Tape close skipped shutdownNow when interrupted. Replace
52-entry Ctrl keycode table and duplicate ZX palettes with loops.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
HashSet on Node dedupes equal-looking nodes at different addresses
(Node subclasses override equals without hashCode); identity set
preserves per-instance multi-pass resolution. ArithmeticException
from / and %% now reported as compile error with position instead
of crashing compilation thread.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
requestMaskableInterrupt reads currentRunState from device thread;
stale read could drop interrupts. 8080 already volatile.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
CharArrayCharStream (6 identical copies) and ParsingUtils (4 copies)
move to new :plugins:compiler:compiler-shared module. Application
depends on it so the jar lands in dist lib/, where plugin manifests
resolve Class-Path. ADR-0008 records the boundary decision.

Not unified: per-plugin exceptions and ParserErrorListener (divergent
types/formats), FlagsModel (different semantics), Breakpoint (trivial),
terminal DisplayCanvas (too divergent).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replaces internal compiler-shared module. CharArrayCharStream and
ParsingUtils now live in emuLib plugins.compiler.antlr (compileOnly
antlr4-runtime there; plugins provide it). ADR-0008 updated.
Requires emuLib 12.1.0-SNAPSHOT (emuLib commit bc00f7c).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@vbmacher vbmacher changed the title Feature 314 Audit and fix UI bugs Aug 22, 2026
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.

Audit and fix UI bugs

1 participant