I was mapping out RAM use in Castlevania games (just as a very boring hobby of mine) and decided to tackle Castlevania 3's audio variables. I noticed 2 variables related to the Triangle channel in CV3 that had no correlation to anything in AkuDen that I could tell (which doesn't use the Triangle channel).
- Byte $194 holds a copy of the linear counter. It's very rarely read from, but always written to.
- Byte $193 is set to 1 whenever a new note plays and increments every frame. After 15 frames (i.e., when $193 equals #10), if the control value ($15D) is set, the program will take the linear counter in $194, subtract #40 from it, and make that the new linear counter value.
1) Why do the programmers do this? In the "Clockwork" track for example, this code toggles the linear counter from #50 to #10. This equates to a series of quarter notes in the track. If I freeze $193 in order to prevent the #10 write, I personally cannot hear the difference. What's the difference between #50 for 15 frames then #10 for 16 frames, as opposed to #60 for 31 frames?
2) If the control value is set, the linear counter is set to ($15D+1)*N, where N is some multiplier specified in the track's data. However, if the control value is not set, the default value of #90 is used for the linear counter. My question is thus: WHY? Why #90? Why not #81 or #FF? Is there even any difference between them? For that matter, what's the difference between #80 and #00?