mattcurrie / mgbdis

Game Boy ROM disassembler with RGBDS compatible output
MIT License
248 stars 38 forks source link

Vertically align operands #2

Closed kemenaran closed 6 years ago

kemenaran commented 6 years ago

This PR make the opcodes and operands vertically aligned. IMO it makes large sections of code more readable.

Before

label_002_41a2::
        ld e, a
        ld d, $00
        ldh [$ffb0], a
        call label_27c3
        ld a, e
        cp $25
        ld hl, $4120

After

label_002_41a2::
        ld   e, a
        ld   d, $00
        ldh  [$ffb0], a
        call label_27c3
        ld   a, e
        cp   $25
        ld   hl, $4120
mattcurrie commented 6 years ago

I see the LADX disassembly is using this style, but pokered is using a single space between the operation and operands.

I think this would be nice to have as an option so people can choose which style they prefer?

kemenaran commented 6 years ago

Sure ; I just rewrote the commit to make it an option.

(That said, maybe that the (slight) additional complexity isn't worth it: this is also something that could be hacked locally by each project using this disassembler. But if this seems worthy of an option to you, there it is!)

mattcurrie commented 6 years ago

Thanks for implementing this as an option! I guess my philosophy for the project is that stylistic changes should be available as options instead of requiring users to dig into the source code :)