This is pretty much what the ".mlb" format I added to Mesen does, e.g:rainwarrior wrote:I'd rather just have one big file that maps ROM addresses to memory addresses than this mess of separate files for every 16k hunk.
Code: Select all
R:700:MyLabel
P:38A00:AnotherLabel:And a multi-line\ncomment\nabove it
All labels are offsets starting from 0 for that specific memory type (so "P:$30000" corresponds to byte $30010 in the .nes rom).
It's not perfect when it comes to ram variables that are reused for different purposes at different points in the code, but for anything else, it works and is simple to parse. Mesen can import/export this format, and freem was kind enough to merge my modifications to ASM6 into his branch (ASM6f), so ASM6f can export a .mlb file to import into Mesen.
The .dbg support in Mesen is based off a bunch of regexes and only supports what I actually needed, but it shouldn't break from minor file format changes (though from what I can tell, CC65's code for this has not changed since 2014). I just didn't want to use CC65's code directly (8000 lines) when the relatively small subset of features I needed fits in ~300 lines of C# code.