Nikon's own publications regarding the metering systems state that a built-in sensor detects when the camera is held vertically, and adjusts the metering pattern appropriately.
DP20 finder have 2 mercury switches for sensing. old school . now any stupidsmartphone have silicon chips as magnetic compass, gyroscope, gravity sensor, .....