tmr4 wrote:
Thanks again for posting this. It took me about a day to convert the core part of my Python 65816 emulator to Typescript and kludge it into Microsoft's Mock-Debug extension. It only has basic debug functionality so far, but the 65816 is fully modelled. It's a much better debugging experience than debugging the Python emulator as this links directly to the source listing. Here's a sample shot:
That is awesome @tmr4. I started with the mock-debug extension as well. It is a really nice experience to work with my 65816 code this way. I have found several bugs that I would not have found debugging on my hardware. Because I can follow the code step by step and inspect the stacks and memory and so on.
My 65816 simulator is complete. And I added a 6522 VIA as well for my SPI communication. The 6522 is talking SPI with my simulated RA8875 display chip. I added a custom webview to my debug extension that my simulator updates when SPI bytes come in on the Memory Write register on the RA8875.
Thanks for your input above guys about validating on real hardware. I have the hardware running and it is working. I could not have made the simulator without verifying the results look like in real life.
But this debugging experience is just so nice. I have an interrupt driven scheduler (VIA timer) that switches between multiple tasks. Saves the registers, switches the Stack and Direct page to the active task, all that. And being able to just break at any point is amazing. Since I got this running in the simulator I have made a lot of progress. Progress that would have taken me weeks of evenings doing on the real device. Both because of the ROM burning but also because I can put a breakpoint and just step through my code. Verifying that it does what I imagined.
Here are some updated pics of the debug adapter. The numbers being written out is 5 different tasks running in "parallel" writing out their task id. Next up is the input bar below the screen will trigger my (working) PS/2 interrupt handler which reads the scan codes and puts it in the input stream given to the task running my shell app.
PS: The simulator is, by complete chance, running almost at the same speed as my breadboard implementation, which is running at I think 12MHz. The simulator is just running as fast as it can so it is by pure luck it is in the same ball park. It is nice because the task switching and printing to the display is almost 1-1 in terms of execution speed.
PPS: My wife zones out when I try to explain why it is fun to do this. I hope you guys will understand.