According to Blargg's APU test ROMs #01 and #02, the length counters are clocked immediately when writing $80 to APU register $4017. It doesn't specify whether writing $C0 will also clock them, but test ROM #02 fails if not, because it attempts to clock them by writing $C0.
However, there are a couple of games that have issues with this. The "Metroid" ROM that I have (I don't think it's a hack) constantly writes 0xc0 to $4017 (once per frame, I think). If I allow the length counters to be clocked on this write, then some of the sound effects are much too short. One example of this is the "farting" sound made by a bullet hitting an enemy, another is the jump sound effect.
The "Legend of Zelda" game also has problems in the intro song, because it writes $FF to $4017 several times per frame, and some of the square channel tones are short if clocking on this write.
More concise version:
- If I clock the length counters whenever bit 7 of $4017 is set, then some popular games don't sound right.
- If I clock the length counters only when writing *exactly* 0x80 to $4017, then the games sound okay, but test rom #02 fails (test ROM #01 still works).
However, there are a couple of games that have issues with this. The "Metroid" ROM that I have (I don't think it's a hack) constantly writes 0xc0 to $4017 (once per frame, I think). If I allow the length counters to be clocked on this write, then some of the sound effects are much too short. One example of this is the "farting" sound made by a bullet hitting an enemy, another is the jump sound effect.
The "Legend of Zelda" game also has problems in the intro song, because it writes $FF to $4017 several times per frame, and some of the square channel tones are short if clocking on this write.
More concise version:
- If I clock the length counters whenever bit 7 of $4017 is set, then some popular games don't sound right.
- If I clock the length counters only when writing *exactly* 0x80 to $4017, then the games sound okay, but test rom #02 fails (test ROM #01 still works).