The music engine used for Concentration Room, and Thwaite uses about 66 bytes of state, yet the replay engines in .sid files allocate only about 20 bytes according to hyarion. Here's how my music engine currently allocates its memory:
psg_sfx_state: 32 bytes of zero page (26 used)
Channel last frequency: 1 byte per channel
Sound effect/percussion data pointer: 2 bytes per channel
Sound effect/percussion data length: 1 byte per channel
Music phrase data pointer: 2 bytes per channel
Order table data pointer: 2 bytes
soundBSS: 64 bytes of main memory (40 used)
Sound effect/percussion data rate: 2 bytes per channel
Instrument number: 1 byte per channel
Envelope current volume: 1 byte per channel
Current note pitch: 1 byte per channel
Current note remaining duration: 1 byte per channel
Current phrase number: 1 byte per channel
Phrase transposition: 1 byte per channel
Tempo: 4 bytes
Order table loop position ("segno"): 2 bytes
Rows left in order table entry: 1 byte
Global music pause: 1 byte
Is there something I appear to be doing horribly inefficiently?
psg_sfx_state: 32 bytes of zero page (26 used)
Channel last frequency: 1 byte per channel
Sound effect/percussion data pointer: 2 bytes per channel
Sound effect/percussion data length: 1 byte per channel
Music phrase data pointer: 2 bytes per channel
Order table data pointer: 2 bytes
soundBSS: 64 bytes of main memory (40 used)
Sound effect/percussion data rate: 2 bytes per channel
Instrument number: 1 byte per channel
Envelope current volume: 1 byte per channel
Current note pitch: 1 byte per channel
Current note remaining duration: 1 byte per channel
Current phrase number: 1 byte per channel
Phrase transposition: 1 byte per channel
Tempo: 4 bytes
Order table loop position ("segno"): 2 bytes
Rows left in order table entry: 1 byte
Global music pause: 1 byte
Is there something I appear to be doing horribly inefficiently?