This is the "box that holds a number" from the video "Why Do Game Numbers Stop at 255 or 99?". The box is 8 lamps (8 bits) and holds a number from 0 to 255. Add and subtract with the buttons, and switch the rule (overflow / stop at 255 / stop at 99) and the number of display digits. You can also press a lamp directly to turn it on or off. The box and the display are our own model, not the code of any particular game.
How it works: the rightmost lamp is 1, and each lamp to the left is worth twice as much (1, 2, 4, 8, 16, 32, 64, 128). Add up the numbers under the lit lamps and you get the number in the box. To add 1, start from the right: "if it is on, turn it off and carry to the next one / if it is off, turn it on and stop". Add 1 to 255, where all 8 lamps are on, and the carry spills out of the left end of the box, leaving 0.
With "Stop at 255" and "Stop at 99", if the sum goes over the limit it is set to the limit, and if a subtraction would go below 0 it is not done (not enough). The 2-digit display picks pictures from a table where the digits 0–9 are followed by the letters A–Z: the tens place uses picture number (number ÷ 10), and the ones place uses the remainder. At 100 or more, the tens place becomes 10 or more, and a picture that is not a digit appears.
Pac-Man's level 256, The Legend of Zelda's 255 rupees and the original Dragon Quest's 65535 experience points mentioned in the video come from written sources. In the sources we checked this time, we did not find an explanation of why those limits were chosen.