Add monitor interface to x16emu

If you have feature requests, this is the place to post them. Please note your idea may already be something we have already discussed and decided against, or something we are working on privately, and we cannot be held responsible for any similarities in such instance. Whilst we cannot respond to every suggestion, your idea will be read and responded to where possible. Thank you for your input!
Post Reply
SerErris
Posts: 172
Joined: Sat Aug 08, 2020 9:18 am

Add monitor interface to x16emu

Post by SerErris »


I thought about getting a better workflow for programming X16 in assembler. 

There are several ways of writing code for X16 and to compile it. That is no issue.

/EDIT: Already there in R38


Quote




 



However for a full integration a automatic load option would be great. 

1. x16emu -load myprog.prg

This will then load the myprog.prg into x16emu and runs it. We can do mimic that via the -bas extension, but a simple option would make that easier.



 



2. Debugging within the emulator from outside with any IDE is currently not possible (not that I understand how it would be). Can we integrate a standard interface (like VICE does) that enables IDEs to control the build in monitors with breakpoints and stuff? That would be very possible with a monitor running within the emulator instead of running inside the virtual machine with a rom. The monitor we have is build into the x16 roms. But as Vice does it, the monitor is actually part of the emulator and can be controlled by the IDE from outside.

What I am looking for is something CBMStudio or C64Studio does. 



If that interface is available, I will work together with the guy who wrote the C64Studio to integrate the X16emu ... then we have a full development IDE with Sprite Editor, Tilemap Editor, Color Editor and stuff including full assembler and debugger support .. I have a dream ?

Perifractic
Posts: 511
Joined: Sat Apr 25, 2020 4:53 pm

Add monitor interface to x16emu

Post by Perifractic »

User avatar
StephenHorn
Posts: 565
Joined: Tue Apr 28, 2020 12:00 am
Contact:

Add monitor interface to x16emu

Post by StephenHorn »


A fully automatic load and should should already be possible by combining the -prg and -run command line options:

x16emu.exe -prg "filename.prg" -run

This will load the program "filename.prg" and automatically execute "run" in the console.

What kind of interface does a debugger like C64Studio need? Honestly, what I'd like would be a debugging plug-in for Visual Studio Code, but I've never looked deeply into it. I more or less assumed it would require opening a pipe or something and then communicating with a tool-specific binary protocol.

Developer for Box16, the other X16 emulator. (Box16 on GitHub)
I also accept pull requests for x16emu, the official X16 emulator. (x16-emulator on GitHub)
SerErris
Posts: 172
Joined: Sat Aug 08, 2020 9:18 am

Add monitor interface to x16emu

Post by SerErris »


Yes, thanks for pointing that out. I should really check for updates between releases ? That has been introduced in R38. 

C64 Studio normally interfaces directly with VICE. VICE has a remote interface to the build in monitor. So it is not a monitor running in the virtual machine (so esp. not like a monitor on a cartridge or ROM) but it runs within the emulator itself. Therefore you can set breakpoints and stuff without the need to change the code in any way. If you hit a certain address the emulator stops execution and shows all values (like a monitor would do). Obviously that is much  better in an emulator to do than within a machine.

I believe even the -debug option is pretty close already. ... I have not tested it myself. The main issue would be remote control and output of the debugger to inject breakpoints and see the flow inside the IDE together with the source code, the registers and memory segments.

Here is the VICE docu on the debugger ...  very powerful but not needed for the integration. 

https://vice-emu.sourceforge.io/vice_12.html#SEC269

Ender
Posts: 220
Joined: Sat May 09, 2020 9:32 pm

Add monitor interface to x16emu

Post by Ender »


The one that you get with -debug and typing F12 is pretty close.  You can see memory (including VRAM), the registers, flags, disassembly, all that stuff.  The only thing it's missing is the ability to inject your own code in.

SerErris
Posts: 172
Joined: Sat Aug 08, 2020 9:18 am

Add monitor interface to x16emu

Post by SerErris »


Actually the workflow is already working as you can put nearly any tool into C64 Studio. So from code to run is already there. Debug obviously is not working that way (with the debug keys in C64Studio for step etc. pp.)

You need to configure in the Tools section of the preferences a new entry for an emulator and define it as in this screenshot. Works great

 And if you put -debug in the line as well you can use the debugger inside. However the debugger with step integration and such stuff does not work right now.

Also the assembler does not create 65c02 code, but 6502 code. That means the new instructions available in 65c02 cannot get used.

1136206771_Anmerkung2020-09-11174513.thumb.jpg.5142c7504fa61a8e336ad6792ba36845.jpg

Post Reply