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:
update_channel_hw means what, DMA channels?
graceTime sounds like it might be used by mercy invincibility
attackPitch sounds like pointing the nose of an aircraft up or down
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:
- Public labels begin with
pently_
- C-callable aliases for public labels begin with
_pently_
- Configuration flags begin with
PENTLY_USE_
With new guidelines to follow:
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 asupdate_channel_hw,graceTime, andattackPitch, escape the context of the audio driver and may collide with labels used by the main program. Some contrived examples follow:update_channel_hwmeans what, DMA channels?graceTimesounds like it might be used by mercy invincibilityattackPitchsounds like pointing the nose of an aircraft up or downThe 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:pently__pently_PENTLY_USE_With new guidelines to follow:
PENTLY_pentlyi_to preserve separation of the defined API from the internalspentlybss.py, also begin withpentlyi_