https://github.com/emu-russia/breaks/re ... s-debug-17
(If you're interested you can read the development history of previous versions there)
The Debugger consists of two parts - GUI in c# to display the internals of the processor and native code in c++ which contains the actual emulation of the processor. When you click on the "Step" button, the processor performs one half-cycle and the GUI shows you what's there. The debugger also includes a simple assembler that compiles a 64 Kbyte memory blob at once.
The data flow diagram for the lower part with slight modifications is taken from the dissection of 6502 by ttlworks. Thanks ttlworks!
It is possible to dump the internals as Markdown with pictures, for this you need to create a folder WikiMarkdown, where results will be stored.
An example of what results can be seen here: https://github.com/emu-russia/breaks/bl ... /ops/20.md
Source code of the 6502 emulator here: https://github.com/emu-russia/breaks/tr ... /M6502Core
UnitTest Mode
To run the debugger in unit test mode, you need to create a JSON like this:
Code: Select all
json
{
"CompileFromSource": true,
"MemDumpInput": "mem.bin",
"AsmSource": "Test.asm",
"RamStart": "0",
"RamSize": "0x800",
"RomStart": "0xc000",
"RomSize": "0x4000",
"RunUntilBrk": true,
"RunCycleAmount": true,
"CycleMax": 10000,
"DumpMem": true,
"JsonResult": "res.json",
"MemDumpOutput": "mem2.bin"
}
Code: Select all
BreaksDebugger Test.json
Simulator will run until it encounters instruction `BRK` (RunUntilBrk) or specified number of cycles (RunCycleAmount, CycleMax) (These are cycles, not half-cycles).
The output will be a memory dump after simulation (MemDumpOutput) and JSON with simulation results (JsonResult).