mattcurrie / mgbdis

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

Stop outputting instructions as data bytes #10

Closed ISSOtm closed 5 years ago

ISSOtm commented 5 years ago
  • RGBDS optimises instructions like LD [$FF40],a to LDH [$FF00+40],a, so these are encoded as data bytes using a macro to ensure exact reproduction of the original ROM (thanks to ISSOtm).
  • RGBDS automatically adds NOP instructions after STOP and HALT, so the disassembler will output these as data bytes if the instruction is not followed by a NOP in the original ROM.

RGBDS has flags to prevent this (-L for the former since 0.3.7, -h for the latter before 0.3.5); it should be possible to pass flags to mgbdis (possibly the same ones?) to leverage this behavior, and avoid data bytes in the middle of code, which might throw people off.

mattcurrie commented 5 years ago

Ah yes, good suggestion.

I've now added a couple of options to support these: --disable-halt-nops and --disable-auto-ldh

ISSOtm commented 5 years ago

Great!