dansanderson / picotool

Tools and Python libraries for manipulating Pico-8 game files. http://www.lexaloffle.com/pico-8.php
MIT License
367 stars 46 forks source link

Update sfx for custom instruments #28

Closed dansanderson closed 6 years ago

dansanderson commented 6 years ago

Pico-8 0.1.11 added custom instruments, the ability to use sfx 0-7 as waveforms in other sfx (practically speaking for music patterns). This is implemented in .p8 using the high bit of the waveform nibble (8-F == instruments 0-7) and in memory and .p8.png using the unused high bit of the second byte of a note.

sfx.py's comment needs updating, and this unused bit needs to be parsed, written, and given an accessor. Thankfully, this is backwards compatible with older carts, which always sets this bit to 0, so I don't think we need a format version number check.

dansanderson commented 6 years ago

Done. API uses waveform IDs 8-15 for the custom instruments.