RetroDebugger icon indicating copy to clipboard operation
RetroDebugger copied to clipboard

VICE core is outdated

Open mrdudz opened this issue 1 year ago • 17 comments

Yeah, obviously you know this :) However, this is a big problem (IMHO) - and the question is, how we could make it easier to update it and keep it somewhat recent. I have not looked at the current code in detail yet - i did that back when the GUI was still SDL stuff, and back then it was kinda hard, because of all the hardcoded patches etc. Is that still the case? Wouldn't it be possible to change things so the debugger uses the new binary remote protocol, so it can use a recent "headless" VICE build instead of the embedded 3.1? What would be the main obstacles with that? (Obviously we can extend the remote protocol when we find things that are missing and can not be done yet)

mrdudz avatar Apr 23 '24 17:04 mrdudz

I've been looking on recent Vice and have a patch in progress, but was more excited about recent disk contents views I am adding and it is on pause for some time :) Yes, moving to debug protocol is an option, actually I thought to add this as a 'limited version'. Unfortunately, AFAIK Vice does not support a lot of features I require, and first I need debug protocol extended with them to move forward. Yes, debugger uses my custom Vice with a lot of code patched/hardcoded.

Actually I haven't looked at newest Vice, but a year ago or something it was still like this, for example I need:

  • storing whole VIC state per each cycle of whole frame
  • realtime memory and i/o read and peeks that do not alter emulation state, and quick whole RAM/IO read (64kB)
  • callback on each cycle, instruction, vsync
  • mode of rendering emulation screen bitmap till current frame cycle, not on vsync only (i.e. once per frame whole framebuffer)
  • render each SID channel separately to a waveform in realtime
  • mute SID channels (this maybe is already available?)
  • setting I/O, SID/VIC/CIA, etc. also CPU with my own data in realtime
  • storing snapshot to memory, not file, and restoring from memory stream
  • rewinding emulation to cycle - actually in debugger I implemented this in the way that I load snapshot from memory stream and then run emulation till it reaches required cycle
  • callback on disk write (setting dirty flag)
  • extended snapshot that contains rendered emulation screen
  • realtime decoding GCR to display disk contents
  • injecting keystrokes, joystick moves etc.
  • callback on keystroke, joystick events, etc.

etc. etc. Most of them you can find in ViceWrapper.cpp and scattered around Vice's code, I usually just run diff on official 3.1 and my copy. That's on my TODO list, but some items have higher priority.

slajerek avatar Apr 23 '24 19:04 slajerek

For some of those things i wonder how you are doing them - because VICE architecture doesn't really allow that at all (it is very much tied to instructions, not cycles, so running to a cycle that isn't at an instruction boundary can't really be done) :) Other stuff should be already doable no problem (setting memory or i/o). In any case, the debug interface is meant to be as dumb as possible, the debugger should implement further stuff on top of it.

Biggest question is how fast it would turn out to do all that via a web socket (although i don't see why it wouldn't be fast enough)

mrdudz avatar Apr 23 '24 19:04 mrdudz

Biggest question is how fast it would turn out to do all that via a web socket (although i don't see why it wouldn't be fast enough)

As we discussed with great Groepaz at last X (kudos!!), this is not a problem, we can have games over TCP realtime streaming, so that is not relevant.

slajerek avatar May 10 '24 22:05 slajerek

Would it be an idea to just import the Vice repo as dependency instead of copying the repo contents? I run a modified version of Vice for SID over USB support and would love using your debugger with it.

LouDnl avatar Jun 11 '24 11:06 LouDnl

That probably wont work due to all the patching here and there, the codebases diverge too quickly

mrdudz avatar Jun 11 '24 14:06 mrdudz

Okay, noted. Ill have a look myself for the purpose I could use it for then 😎

LouDnl avatar Jun 11 '24 17:06 LouDnl

Finally had some time and added usbsid support to the existing vice core. IMG_20240805_220948_108.png

LouDnl avatar Aug 05 '24 21:08 LouDnl

That is interesting, there's a HardSID (and SidBlaster) support already. I did not know about USBSID before and project looks really cool! If you wish I can merge your changes to the core, please send PR.

slajerek avatar Aug 06 '24 10:08 slajerek

That is interesting, there's a HardSID (and SidBlaster) support already. I did not know about USBSID before and project looks really cool! If you wish I can merge your changes to the core, please send PR.

Will do, code needs cleanup and more testing first. Only works on Linux atm, need to add Windows support.

Now that I have your attention, is there a way to always automatically continue on jumps? I have to preaa F11 every time 🤭

LouDnl avatar Aug 06 '24 16:08 LouDnl