https://wiki.nesdev.com/w/index.php/APU shows this (which originally comes from apu_ref.txt):
Code: Select all
mode 0: mode 1: function
--------- ----------- -----------------------------
- - - f - - - - - IRQ (if bit 6 is clear)
- l - l l - l - - Length counter and sweep
e e e e e e e e - Envelope and linear counter
When implemented in code, I discovered that I had my 5-step mode wrong, resulting in warped and cut off sounds in 5-step mode in my emulator. So, I changed it to be something more like this, which matches up with the APU Frame Counter wiki page:
Code: Select all
mode 0: mode 1: function
--------- ----------- -----------------------------
- - - f - - - - - IRQ (if bit 6 is clear)
- l - l - l - - l Length counter and sweep
e e e e e e e - e Envelope and linear counter