Split 684-line server.py into focused modules: - state.py: Shared global instances (manager, client) - tools/execution.py: launch, attach, continue, step, quit - tools/breakpoints.py: breakpoint_set, breakpoint_list, breakpoint_delete - tools/inspection.py: registers, memory_*, disassemble, stack, status - tools/peripheral.py: screenshot, serial_send server.py now 102 lines (just FastMCP setup and tool registration)
38 lines
993 B
Python
38 lines
993 B
Python
"""Peripheral tools: screenshot, serial communication."""
|
|
|
|
|
|
def screenshot(filename: str | None = None) -> dict:
|
|
"""Capture DOSBox-X display.
|
|
|
|
Args:
|
|
filename: Optional output filename
|
|
|
|
Returns:
|
|
Screenshot info or error
|
|
"""
|
|
# Placeholder - requires X11 or DOSBox-X specific integration
|
|
return {
|
|
"success": False,
|
|
"error": "Screenshot not yet implemented. Use DOSBox-X hotkey F12.",
|
|
}
|
|
|
|
|
|
def serial_send(data: str, port: int = 1) -> dict:
|
|
"""Send data to DOSBox-X serial port.
|
|
|
|
This is useful for RIPscrip testing - send graphics commands
|
|
to a program listening on COM1.
|
|
|
|
Args:
|
|
data: Data to send (text or hex with \\x prefix)
|
|
port: COM port number (1 or 2)
|
|
|
|
Returns:
|
|
Send result
|
|
"""
|
|
# Placeholder - requires serial port configuration
|
|
return {
|
|
"success": False,
|
|
"error": "Serial port communication not yet implemented.",
|
|
}
|