Page 1 of 1

Relying on different IRAM initial values

Posted: Tue Jan 19, 2021 10:49 pm
by aquasnake
Some IRAMs can be used as pseudo registers to realize the secondary boot function.

After IRAM is initialized, a specific value is written. After reset again, the program detects the pseudo register. If it is not equal to the previous specific value, it reinitializes and enters the cold boot subroutine.
Otherwise, it is judged as warm boot, the reset vector can be transferred to other address branches to realize different start interfaces.

FDS games rely on this feature. Some flash carts will also detect and decide whether to reset to the current game or the system menu.

If the IRAM value at the time of power on is exactly equal to the specific value to be initialized (this possibility exists), it will cause an unexpected branch to enter by mistake. If only one byte is detected and the error probability is 1/256, we can increase the decision word length, for example, two bytes, and effectively reduce it to 1/65536. Sometimes there are other radiation disturbances, in order to increase the robustness of the program, it is more reliable to increase it to 4 bytes.