Commit Graph

4 Commits

Author SHA1 Message Date
vincente 45182c7759 Fixes + enhancements from test feedback
- Mini-assembler now supports many more common inherent ops (CLRA/CLRB, INCA/INCB, DECA/DECB, COMA/COMB, NEGA/NEGB, TSTA/TSTB, plus several branches: BEQ/BNE/BCC/BCS/BPL/BMI) so quick monitor patches like the classic loop test cases work without falling back to : or M.
- Critical: monitor no longer uppercases the entire input line. command_char() only uppercases the dispatch verb (first significant char). This preserves original case for:
  - Filenames in L and S commands
  - Shell commands after !
  - Any future string arguments
- Improved S dispatch heuristic (Step vs Save) so 'S filename ...' and 'S 5' are reliably distinguished even with mixed-case filenames.
- Added explicit exec-bp check at the top of the monitor G run loop (in addition to the one inside cpu_step). This guarantees that breakpoints set with B are honored during G even when running with debug_mode=false for speed.
- The exact scenarios from the previously killed background tasks (infinite BRA loop + bp, F + S + L + M roundtrip) now complete cleanly, quickly hit bps, restore the terminal, and leave the outer shell fully functional.

All prior robustness (always acia_end_run after G, isatty guards, etc.) remains.
2026-06-12 15:07:08 -05:00
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