|
|
|
|
|
by pypie
1886 days ago
|
|
Does anyone else remember putting the plastic tab into the tamagotchi and pulling it out repeatedly in the hope of glitching the device into giving you a powerful monster? I definitely succeeded more than once, I would love to know the explanation of why it worked! |
|
The battery is a standard button cell type and there is a little metal spring that touches the battery to complete the circuit. The plastic tab acts as an insulator between the battery surface, and the conductive spring.
Pulling the plastic tab out may cause the spring to bounce a couple of times on the battery surface, effectively closing and breaking the circuit a couple of times before it settles. 'Bounce' is a well-known phenomenon in electrical engineering, and designing 'debouncing' circuits and software is common practice.
The problem here is that due to capacitive charges the CPU in the Tamagotchi may not fully reset during the short power-loss times when the battery spring bounces. This is known as a 'brownout' event. A brownout may cause memory corruption, which makes behavior of the software unpredictable. It is also possible that the RAM resets, but the CPU doesn't, this causes the software to run on garbage data as the memory initialization doesn't happen.
Since the state of the software (so effectively the 'soul' of your virtual pet) is stored in RAM, corrupting the RAM influences the state of the virtual pet. It is typical for RAM to flip it's bits to the '1' state on brownout/reset, thus suddenly your pet now has all values set to its maximum (99 age, 99 health, etc).
Normally, a reset circuit is placed in the electronic design of a computer, that holds the CPU in reset for a short time during power-up. And brownout detection may be implemented to prevent the CPU from memory corruption. But since Tamagotchis were designed to be as cheap as possible to produce, I highly doubt there was any reset circuitry or brownout detection.