Topic: Any reason for using both 3rd and 4th bits of #fe port?

As utz and I figured out, behaviour for MIC and EAR ports on the ZX Spectrum 128k +3 with Amstrad 40077 Gate Array produces completely different output in comparison to a classic Speccy.

For the Speccy, values: 00, 01, 10, 11 of bits 4 and 3 produces 0.39, 073, 3.66, and 3.79 volts respectively.
For the +3 however, values: 00, 01, 10, and 11 would produce ~0, ~5, ~0, and ~5 volts, so the result level is driven by (bit4 & bit3).

So the question is: what is the reason for using all 4 levels (both MIC and EAR bits)?

Re: Any reason for using both 3rd and 4th bits of #fe port?

I recall some years back there was a guy who was talking a lot about this possibility of getting four output levels on the classic 48K beeper, and proposed to use it somehow in a beeper engine. However, as they're pretty close to each other on the extreme ends, no one figured out any useful application for such a feature.

Actually, even if there was a true 2-bit DAC with proper evenly spread levels, I'm not too sure what advantage it could have over 1-bit - a two-channel engine with 'lazy' mixing perhaps, but that wouldn't give a major speed advantage, or extra opportunities for more unusual synthesis techniques. Maybe I'm wrong.

Curious little quirk, nevertheless.

website - 1bit music - other music - youtube - bandcamp - patreon (latest news there)

Re: Any reason for using both 3rd and 4th bits of #fe port?

Haha, no, I can't take any credit for that discovery, you figured that out by yourself!

I've done some experimenting with using bit 3 for reverb. However, volume levels for bit 3 vary considerably between 48K board revisions (not to mention different models), so it's not really useful. Generally speaking, the output from bit 3 is low enough that it can be ignored for practical purposes. (It does cause problems for engines with a high volume resolution, but that's another story.) Anyway, the main reason you'll see bit 3 being used is because it costs additional cycles to mask it out. Povver is a typical example of this: Use of bit 3 is by no means intentional, but there is at least one location where I couldn't find enough cycles to mask it. Aside from that, some PFM-based engines use bit 3 in sync with bit 4 for a little extra volume boost. Alone Coder's BeepTracker engines do this, for example.

Re: Any reason for using both 3rd and 4th bits of #fe port?

utz wrote:

Anyway, the main reason you'll see bit 3 being used is because it costs additional cycles to mask it out.

I see. I thought that the 3rd bit is set for reason because I failed to comprehend what's happening in the engine from the readPtn label and up to the playNote.

utz wrote:

Haha, no, I can't take any credit for that discovery, you figured that out by yourself!

Thankies! Tho I won't be able to make it without the test track you've made ^~^