The Game Boy has very simple function support through the call
and ret
opcodes. These allow you to create blocks of code that can be run from any
location in rom, allowing you to re-use code from many different places.
Additionally, RGBDS has support for macros, blocks of code which are expanded at compile-time to real code or data rather then calling to another location in rom.
Understanding how and when to use these features is crucial in keeping your game