Skip to content

Intended Operation of the Evolution System

Zac Adam-MacEwen edited this page Jan 19, 2021 · 2 revisions

During each run of the update tick (so, massively more often than necessary), the program will interrogate the RTC for what is essentially an epoch time. If this epoch time is later than a timestamp calculated by comparing the date of last evolution to the stage length value in the current stage's data, a flag should be set indicating that an evolution is necessary.

The next time the program sees the following conditions are all true:

  • The pet is not currently sick;
  • The pet is awake, and;
  • The pet is not in a state where the death condition would trigger (this simply takes priority over this check), then;

A routine should calculate which of several evoltions should happen:

  • If the health byte is below a certain value and both the hunger and fun nibbles are above half-full, the high_evo form is triggered.
  • If the above criteria are met and the flag to allow secret evolutions is set at the time, the secret_evo form is triggered.
  • If the above criteria are not met at all, the low_evo stage is triggered, regardless of whether or not the secret evolutions flag is set.

In all cases, the device should register an alert, activate the screen (if deactivated), and play through an animation loop dynamically generated for the evolution in question.

Currently, the operation of the secret evolutions flag is to check the state (not an interrupt, but actually check the state) of a potential 0-ohm resister on an otherwise unused pin. This document should be updated when that pin is selected.

Clone this wiki locally