Commit Graph

3 Commits

Author SHA1 Message Date
vincente b63a331744 Robustness: always restore terminal after G (ACIA raw mode)
- acia.h now exports acia_poll_input() and acia_end_run()
- set_raw/restore_term are now safe no-ops on non-ttys (heredoc, pipes, the test harness)
- debug.c cmd_go and main direct -g path now unconditionally call acia_end_run() on every exit from a run (bp, SIGINT/break_flag, stop_requested, halt). This prevents the monitor (or outer shell) from being left in raw/cbreak mode.
- acia_poll_input() is called during G loops so programs using the emulated 6850 for input work.
- Added clear stop messages (** Breakpoint at xxxx **, ** Break (SIGINT) **, etc.).
- The exact A + S + B + G heredoc scenario that previously left a background process / raw term now cleanly returns to the m9> prompt and the calling shell has echo restored.

This makes scripted / non-interactive use of the monitor (including the cc09 workflow) far more reliable.
2026-06-12 15:02:16 -05:00
vincente 78b8838cc7 Initial mimic09: fast 6809/6309 emulator + C64-style monitor + SREC/IHEX loader + ACIA/PIA
- Complete project skeleton per AGENTS.md (src/, bin/, samples/, attic/ with 1994 code, docs/)
- High-performance C core (cpu.c) with most 6809 instructions + selected 6309
- Table-driven disassembler (D) and minimal built-in assembler (A)
- Full C64-monitor inspired debugger (R ; M : D A G S B BC F L S ! X ?)
  - Single step, breakpoints (exec), register/memory view+edit
- Robust S-Record, Intel HEX, raw binary load/save (tolerant of CRLF)
- 6850 ACIA and 6821 PIA emulation (memory-mapped, registered devices)
- CLI: -l load, -g go, -i interactive, --cpu 6309, --acia/--pia bases
- Designed for tight integration with cc09 (WINTEK re-creation)
- Optimized Makefile for macOS/Linux (clang/gcc, -O3 -flto -march=native)
- AGENTS.md with mission, structure, coding rules, monitor reference

Verified: builds release+debug, loads provided samples (140A.HEX 2299.HEX 2299.MIK), monitor commands, A/D/S/B, roundtrip save/load.

Remote: http://gitea.binary-systems.com/vincente/mimic
2026-06-12 14:59:59 -05:00
vincente 1710066010 first commit 2026-06-12 14:04:34 -05:00