TASEmulators / TASEmulators/BizHawk

Implement debugging functionality for all Nyma Cores

Open
#3,141 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Core: Faust Core: HyperNyma Core: NeoPop Core: Nymashock Core: Saturnus Core: T. S. T. Core: TurboNyma Core: Virtual Boyee Needs unmanaged changes (C++) re: Waterbox Request: Feature/Enhancement
Dominant language
C#
Stars
2.8k
Forks
468
PR merge metrics
No merged PRs in 30d

Description

Currently no Nyma core implements IDebuggable/ITraceable at all. No memory callbacks, no register handling, no total executed cycles, no tracelogging.

These should all be implemented, for every Nyma core if possible, especially Nyamshock and TurboNyma (as a step towards removing Octoshock/PCEHawk). On the core side, code can largely be shared here with NymaCore, Most of these things just need callbacks hooked up, the handling of which can be shared.

Memory callbacks should optimally have the same arguments for them, address (required), value (optional, 0 if not implemented), allowing for a generic handling of callbacks set ala Gambatte/SameBoy/Emu83/MelonDS handling. Externs for these should probably be in the common nyma header and setting them should be in NymaCore, similar to input callbacks / lag handling.

Register handling would be mostly emulator specific. mednafen does have some API for this, but that also means the entire debugger. Besides, getters/getters would likely only need code touching the interface files ala memory domains.

TotalExecutedCycles can already be implemented using CycleCount (implemented in WaterboxCore using Cycles field in frame info). This however will not produce the "correct" cycle count midframe (e.g. in a callback). I would propose a cycle offset function in the core. Perhaps can be in NymaCore if mednafen allows for it, else it'd just be a virtual function for cores with the default implementation returning 0.

Tracelogging is tricky here. This might be best to just resolve for cores to figure out. mednafen seems to have a ton of disassemblers for their cores, and even a generic interface for them, but would mean introducing their entire debugger which might not be great. And besides, we already have disassemblers elsewhere. Could even use the CallbackBasedTraceBuffer?

Perhaps for registers/tracelogging it might best to just bite the bullet and include mednafen's debugger. Not sure of any performance costs to that anyways, might not be so bad?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading NymaCore and WaterboxCore's CycleCount handling, then inspect the common Nyma header and core interface files. Review the existing input callbacks and lag handling, along with CallbackBasedTraceBuffer and Mednafen's debugger APIs. Done means Nyma cores provide memory callbacks, register handling, executed-cycle totals, and tracelogging, especially Nyamshock and TurboNyma.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.