Interactive disassembler in wxWidgets for 6502

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Post Reply
beneficii
Earned some good credits
Earned some good credits
Posts: 111
Joined: Fri Nov 27, 2009 2:49 am

Interactive disassembler in wxWidgets for 6502

Post by beneficii »

I've been wanting to create an interactive disassembler. It would gather data from code-data-logging the video game you wish to disassemble.

It would then provide options like this for disability;

Code: Select all

rts
lda #$46

Code: Select all

rts

lda #$46
This inserts a space

It would also allow you to add comments to what will be the eventual disassembly.

Most importantly, you would be able to define labels, equates (including groups of equates that function as flags), and then inside the code, you can make adjustments like:

Code: Select all

.byte $56
.byte $87
.byte $9A
.byte $BB
by making it into a single line, for the disassembler to produce, so you don't have to do it yourself:

Code: Select all

.byte $56, $87, $9A, $BB
You would be able to make use equates and labels by looking up matching labels/equates (or for immediate addressing or single-byte data equates flags as well), like so:

Code: Select all

lda $8765
.byte $A8
For $8765, the system will find all the labels and equates with that value. For $A8, it would look up the equates flags as well, so you can pick the correct label/equate/equate flag group to substitute in code. It could change to this for example:

Code: Select all

lda DoStuff
.byte flg3 | $flg4
Pretty neat, huh?

Now, what are some of the best ways to implement this? Should I make use of a toolbar? Should I use a list item to store every line (including the empty spaces, comments, equates, and label names), or perhaps a more generic label that calculates where you're at now in the code?

I'm working on the best design to allow you to do that, to decide exactly how the disassembly, and I wonder if there is any advice anyone could give?

I should design the interface before coding, right?
beneficii
Earned some good credits
Earned some good credits
Posts: 111
Joined: Fri Nov 27, 2009 2:49 am

Re: Interactive disassembler in wxWidgets for 6502

Post by beneficii »

I was thinking of inheriting a wxListCtrl with virtual set, using each line as a row, loading from something like a std::vector which contains the starting address. With that, when selections are made, I make sure they are all contiguous and the control actually keeps track of the items selected so I can pull that information easily.
Post Reply