Roger Burrows schrieb:
> Quite possibly the documentation is just wrong. However, in TOS4, there are
> manipulations of 'mystery bits' that are not documented in the development
> notes or the Compendium. Specifically:
> . bit 3 of $ff8937 is toggled
> . bit 2 of $ff8938 is toggled
> . bit 3 of $ff8938 is cleared (only)
Hence bit 3 of $FF8937 should be "Global Sound Reset". And...
Thus, bit 3 of $FF8938 would be "Expand" (whatever that is) and bit 2
would be "mute".
Christian is spot on here, I just expand on his and Roger's contributions. As one can see in the disassembly output, there are two subroutines called: for muting and unmuting. And some magic code.
Mute very carefully stores the unused bits of "AUX B Control Field" ($ff893a). Then in a rather interesting way first keeps the attenuation for both channels at -1.5 dB, -3 dB, -6 dB and -12 dB. I have no clue why, I'd assume that the first AND instruction clears the other bits as well? At the end, it sets our "mystery mute" in "AUX A Control Field" ($ff8938).
Unmute yet again clears the attenuation level on both channels to 0 dB and clears all previously zeroed bits in the AUX B CTL. And now the mystery code again - it ANDs AUX A CTL with #$f3ff so basically keeps everything (L/R gain and apparently yet another undocumented bitfield - left sample 4 least significant bits) untouched _except_ the mute bit (#2 - cleared now!) and the expansion bit (#3 - seems unused). Few NOPs for the CODEC to reinitialise and we are done!
... or are we. Fascinatingly, in July'92 that was it but in the released TOS version (March'93) two tiny lines of code were added - setting the "Global sound reset" and clearing it again (perhaps due to the note "Not self clearing"). It clears all registers in the $ff8900 - $ff8934 range.
Interestingly, there seems to be yet another bit available in Soundcmd()'s ADDERIN mode: PSG source (bit #2) which switches between PSG (0) and (CODEC (1) which is then fed into the "real PSG input" (bit #0). One day I have to check whether PSG input as source really isn't implemented in Sparrow.
No idea why one would toggle "mute", though. Also, I
don't know if everything is actually implemented in hardware or some
bits were only planned for future revisions of the Falcon that never
came to be.
I'm curious for how long the spec has been public - as nobody had ever discovered those hidden bits when creating the famous memory maps for Falcon.