Jump to content
  • 0
SerErris

Add monitor interface to x16emu

Question

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 🙂

Edited by SerErris
  • Like 1

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0

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.

Share this post


Link to post
Share on other sites
  • 0

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

Edited by SerErris

Share this post


Link to post
Share on other sites
  • 0

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.

Share this post


Link to post
Share on other sites
  • 0

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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Please review our Terms of Use