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, song data symbols and macros from pentlyseq.inc, such as N_C, D_8, and playPatTri, escape the context of the audio driver and may collide with labels used by the main program. The solution suggested in "Namespacing symbols used by an ASM6 library" on NESdev BBS is to prefix everything.
Thus pentlyas.py needs a command-line option to stop emitting this:
This would affect sfxdef, sfxframe, drumdef, instdef, songdef, patdef, playPat*, stopPat*, waitRows, fine, segno, dalSegno, setTempo, setBeatDuration, attackOn*, and noteOn* macros, as well as CON_*,N_*, D_*, and pattern effect command constants.
To keep things from becoming too inconvenient for ca65 users, have pentlyseq.inc continue to define the old macros and symbols in terms of the prefixed macros unless PENTLY_USE_PREFIXED_DATA is defined and enabled.
[x] Prefix constants and define unprefixed constants in terms of prefixed ones
[x] Prefix macros and define unprefixed macros in terms of prefixed ones
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, song data symbols and macros frompentlyseq.inc
, such asN_C
,D_8
, andplayPatTri
, escape the context of the audio driver and may collide with labels used by the main program. The solution suggested in "Namespacing symbols used by an ASM6 library" on NESdev BBS is to prefix everything.Thus
pentlyas.py
needs a command-line option to stop emitting this:And start emitting this:
This would affect
sfxdef
,sfxframe
,drumdef
,instdef
,songdef
,patdef
,playPat*
,stopPat*
,waitRows
,fine
,segno
,dalSegno
,setTempo
,setBeatDuration
,attackOn*
, andnoteOn*
macros, as well asCON_*
,N_*
,D_*
, and pattern effect command constants.To keep things from becoming too inconvenient for ca65 users, have
pentlyseq.inc
continue to define the old macros and symbols in terms of the prefixed macros unlessPENTLY_USE_PREFIXED_DATA
is defined and enabled.