That would be a fun and interesting technical project. I'm using a message-based system for communications between the emulator and the debug adapter, which implements Microsoft's interface protocol for passing runtime events and information to the VS Code frontend. Adapting this for the Arduino should be easy. More in line with Microsoft's vision though would be developing a debug adapter to link directly to the Arduino. The technical details on that are beyond me right now but it doesn't seem much different than the process used by the
VS65 Debugger extension (
github), that does something similar for the VICE emulator.
As for validating the simulation, I'd rather just port my
Python unit tests to Typescript. There are some 65816-based tests packages you could use (
here and
here for example) but unless you're using the developer's system, getting them to run on your system could be a pain (so much so that I just expanded the
PY65 65c02 unit tests into the above, not a small task and it's only about 98% complete at this point).
My code isn't ready for sharing yet. It's hardcoded to my Forth operating system binary and listing file and still has limited functionality. I'll be posting it
here though at some point. Note that it uses a
custom ca65 listing file. It looks like bytearray is using an approach that fits much better with the VS Code source file paradigm. I imagine keeping things synched up is harder with that approach but is more technically satisfying as it doesn't need a consolidated listing file.