30
edits
(→Sound) |
(→Sound) |
||
Line 134: | Line 134: | ||
[03/07/0B/0F] - next 4 bytes is data for sound channel 0/1/2/3 (square1, square2, triangle, noise) | [03/07/0B/0F] - next 4 bytes is data for sound channel 0/1/2/3 (square1, square2, triangle, noise) | ||
[10] - next byte is a number of frames to wait before processing the next update | [10] - next byte is a number of frames to wait before processing the next update | ||
[FE] - loop back to beginning | |||
[FF] - terminate sound | [FF] - terminate sound | ||
Type 100 data: | Type 100 data: | ||
uint8 auxLen - specifies length | uint8 auxLen - specifies length of auxiliary data blocks | ||
uint8 | uint8 noteInstrs[auxLen] - Specifies the instrument of each predefined note | ||
uint8 | uint8 noteFreqs[auxLen] - Specifies the pitch of each predefined note | ||
uint8 music[]: | |||
00 thru (auxLen-1) - start playing a note using the specified instrument at the specified pitch | |||
auxLen thru (auxLen+15) - update the note playing in the specified instrument (?) | |||
(auxLen+16) thru 0xFF - delay N-auxLen-16 frames before parsing next byte | |||
[FE] - loop back to beginning | |||
[FF] - terminate sound | [FF] - terminate sound | ||
There are a total of 16 instruments, spread out over the 4 NES sound channels using the following mapping: | |||
A total of 28 commands exist within the sound engine, each tied to one or more instruments. | |||
Sound channels: (00 = square A, 01 = square B, 02 = triangle, 03 = noise) | |||
* 00 00 00 00 00 00 00 01 01 01 02 02 01 03 03 03 | |||
Start commands: | |||
* 05 03 06 08 0B 01 01 1A 16 06 04 17 02 10 0E 0D | |||
Update (?) commands: | |||
* 0F 00 00 09 00 14 15 00 00 00 1B 1B 0F 0F 0F 0F |
edits