pinobatch / pently

Scalable music engine for NES games
zlib License
72 stars 4 forks source link

Prefix driver-internal constants and labels #43

Open pinobatch opened 5 years ago

pinobatch commented 5 years ago

As described in the ASM6 manual, ASM6's excuse for a linker is include, which behaves the same way as the C language preprocessor's #include. Because ASM6 lacks file-local symbols, functions and variables within the driver, such as update_channel_hw, graceTime, and attackPitch, escape the context of the audio driver and may collide with labels used by the main program. Some contrived examples follow:

The solution suggested in "Namespacing symbols used by an ASM6 library" on NESdev BBS is to prefix everything. The first half was #42, adding a PENTLY_ prefix to constants and macros in music data. This, the second half, is about RAM and ROM addresses and constants not related to music data.

Most symbols declared outside a scope should contain pently, case insensitive. Some categories are done:

With new guidelines to follow: