mattcurrie / mgbdis

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

Documentation on .sym files #12

Open ijacquez opened 4 years ago

ijacquez commented 4 years ago

I can't seem to find more documentation on the .sym file format.

Does mgbdis implement a subset of it?

mattcurrie commented 4 years ago

Hi,

The symbol file support in mgbdis is based on a combination of the output of RGBDS, some custom magic/reserved labels, and Nocash's documentation here:

https://problemkaputt.de/gbahlp.htm#symbolicdebuginfo

ijacquez commented 4 years ago

Ah, I wouldn't have thought was from no$gba. It's rather limited, unfortunately...

I have a few "hacks" that I can help integrate better into mgbdis.

For example, in the .sym file, I have:

00:C501 C501_SomeConstant

I pass --include-file constants.asm to mgbdis and in game.asm, the constants.asm file is included. In constants.asm, I define C501_SomeConstant:

C501_SomeConstant EQU $C501

This is to avoid breaking compatibility with no$gba and BGB.

ISSOtm commented 3 years ago

See gbdev/rgbds#483.