This is a port of the Pently audio driver to ASM6. It is produced
automatically using ca65toasm6.py
, an automated translator from a
subset of ca65 syntax to ASM6, and should be as up-to-date as the
ca65 version.
Building an ASM6-compatible translation of Pently takes these steps.
REM Translate Pently source code to ASM6
REM Only needed when changing the driver; some release packages
REM may do this for you
py ca65toasm6.py ../src/pently.inc ../src/pentlyseq.inc > pently-asm6.inc
py ca65toasm6.py ../src/pentlysound.s ../src/pentlymusic.s > pently-asm6.asm
REM Make a RAM map
REM Do this when pentlyconfig.inc changes
py ../tools/pentlybss.py --asm6 pentlyconfig.inc pentlymusicbase -o pentlybss.inc
REM Translate score to ASM6
REM Do this after editing the score or converting it with ft2p
py ../tools/pentlyas.py --asm6 --periods 76 ../audio/musicseq.pently -o musicseq.asm
The application that uses Pently must include these files:
pentlyzp.inc
(static) within a zero pageenum
pentlybss.inc
(generated bypentlybss.py
) within a RAMenum
pently-asm6.asm
(generated byca65toasm6.py
) within ROMmusicseq.asm
(generated bypentlyas.py
) within ROM
pentlyzp.inc
in turn includes pently-asm6.inc
, which contains
macros and constants used by the score, and pentlyconfig.inc
,
whose PENTLY_USE_*
flags enable or disable driver features.
For example:
enum $0010 ; Start of zero page variables
include "pentlyzp.inc"
ende
enum $0300 ; Start of BSS variables
include "pentlybss.inc"
ende
base $C000
; Omitted: effectively the entire application.
; These include statements must appear below pentlyzp.inc.
; Otherwise, forward references may confuse ASM6.
include "pently-asm6.asm"
include "musicseq.asm"