Repository navigation
Add MCP automation tools for AI agents and a headless stdio server - #38
Merged
Merged
Conversation
Bubilator88Automation implements the tools once against AutomationHost: running frames, keys and typed text, the screen as PNG and text, disks, save states, registers, memory, disassembly and breakpoints. MCPHandler handles one JSON-RPC message at a time and knows no transport. - bubilator88-mcp serves it over stdio with a headless machine whose time moves only with the tools, so runs repeat exactly. - b88_mcp_handle / b88_mcp_reply expose it through the C ABI for the Windows shell. - PC88.peekMemory (SPI) reads memory without charging wait states, loading the ALU latches or firing read breakpoints. - PNGEncoder is pure Swift so it builds on Windows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
write_memory, set_registers, load_bin, memory_map, trace, dump_memory and tape, backed by new Debug SPI on PC88: pokeMemory, setRegisters, physical memory regions and the main CPU's current memory map. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
record_start saves a .b88s, key/type_text/run_frames are recorded, and record_stop adds them to the file as an AREC section. replay restores the state and runs the same input on the same frames. Tools a replay could not repeat are refused while recording. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The debugger now keeps, while asked, the instruction that last wrote each byte, by where the byte physically lives, and stops after an instruction that writes into a watched range. Both ride the debugger's existing write hook, so the plain execution path is unchanged. The MCP tools gain write_tracking, last_writer and watch_add/list/remove. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Profiler attached to the machine adds each instruction's T-states, waits and count to per-address tables from the debugger path's tick, keeping halts and interrupt acknowledges apart and timing begin/end regions. The tools load an assembler's symbol file, group the counts by label when they report, and accept symbol names wherever an address is asked for. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Clear the write history on a cold reset or state load even while the debugger is detached, and on resets made by scripts. - Drop open profile regions when the T-state count jumps, so a region open across a reset or load no longer wraps to a huge time. - Skip region timing on halted ticks, so a loop round a HALT is timed once per pass. - Count an interrupt acknowledge's waits with the acknowledge instead of the next instruction. - Work out a write's location outside the debugger lock, and only when it is tracked or may match a watch; read the watches through a copy kept out of observation. - Report watches like breakpoints: the last hit in an instruction wins, and a hit during a single step still reports. - Disassemble only the profile rows that are listed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The review fixes took the debugger lock up to three times per memory write and kept a weak reference in Machine so a detached debugger's history could still be cleared. Instead: - noteMemoryWrite takes the lock once; describe only reads the bus. - watches are unobserved (no view shows them), with no mirror copy. - Turning write tracking off forgets the writers, so the history only exists while a debugger is attached and Machine clears it through that debugger. last_writer refuses while tracking is off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
6 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bubilator88Automationライブラリとして追加(JSON-RPC ハンドラ、ツール定義、純 Swift の PNG エンコーダ)bubilator88-mcpを追加b88_mcp_handleを追加(追加のみ、public@_cdecl)App 側の利用は bubio/Bubilator88 の feat/mcp-automation。
Test plan
swift test(1102 件パス)scripts/regression_compare.py20/20 PASSscripts/format_all.sh --check/scripts/lint.sh🤖 Generated with Claude Code