Sega Master System / Mark III / Game Gear
The 3D glasses consist of two large, single-element LCD screens, one for each eye. These are alternately turned black, in sync with the image displayed on the screen, so that each eye sees only odd frames and the other only even. By changing the image between these frames, an animated stereogram may be produced.
The 3D glasses may be accessed from software by writing to memory address $fff8. (The hardware does not check the low 2 bits so the range $fff8-$fffb works, but $fff8 is the "correct" address".) The low bit of the byte written determines which lens is active - zero to have the right shutter open, left shutter closed; one to have the left shutter open, right shutter closed. Because this address is mirrored in RAM, it is effectively "readable", even though the value read is coming from RAM, not the glasses, and can thus be read whether or not they are connected.
There is no way to detect if 3D glasses are connected.
The 3D glasses connect via a 3.5mm "jack plug", as found on most headphones. The sleeve is common, the ring is the right shutter and the tip is the left shutter. The signal itself is AC.
The Japanese Master System is the only base system to feature the necessary socket. In all territories, the glasses therefore included an adaptor that is inserted into the card slot on an export Master System, Power Base Convertor or Japanese Mark III. This works because the slot address and data buses are still active, even though the slot itself is not, so the adaptor hardware can passively monitor the buses to determine when glasses control data is being written.