Illegal Opcode Theory

The illegal opcode theory hypothesizes that the Personalisation A.I. only shows up on actual cartridges (and not in emulated ROMs) due to the original ROM containing illegal opcodes: undocumented instructions in the MIPS R4200 CPU's assembly language. Any decompilation would not be able to make sense of the opcodes, and would regard them as junk data. Furthermore, an N64 emulator cannot emulate these instructions, because there are no public documents available describing them.

This has already happened with the x86 instruction set, which includes illegal backdoors and shortcuts for certain programs.

Low-level assembly programming
In the early years of game development, many games (such as Super Mario World) were prototyped in C, but could only be run on a specialized workstation - they were too slow for the console. In order to speed up the game for console release, it was compiled to assembly, which was then edited directly.

For example, the code:

Is faster when written in MIPS assembly:

Which stores the result "11" in register t1. This is much faster, and can help the game run smoothly on console.

Undocumented instructions
When selling a CPU, the manufacturer also releases a manual detailing all of the processor's features, including all of the operations that it can preform, such as "add", "subtract", "divide floating point number", etc. These are the documented instructions, or legal opcodes. However, there can also be undocumented instructions, or illegal opcodes, which have an effect, despite having no official description. Instead of having names like "mov" and "syscall", these are simply numbers like "[0xf7a10]".

Why the opcodes exist
Some of them are created by accident, due to the processor's design. Some of them crash all the programs or lock the CPU. Some of them do useful things, and combine multiple instructions together. Some allow secret data to be accessed, such as hidden registers. Some of these opcodes are created by the manufacturer or government agencies, and used as a backdoor in order to gain full control over any computer that uses the CPU.

Use of illegal opcodes in games
Many early video games took advantage of illegal operations and undocumented instructions in order to speed up their games. This is a well documented use of the unintended feature.

Undocumented features of the MIPS R4200 processor
This is a highly obscure and censored subject, and there is no information about this on the internet. However, it is very likely that programmers, when attempting to search for illegal opcodes to speed up SM64 on an assembly level, stumbled upon undocumented instructions of the processor, and attempted to use them to their advantage, taking shortcuts.

AI genesis
Whether it was in the CPU or GPU is unknown, but the most probable explanation of the Personalisation A.I. is that it was created by accident. In the attempt to speed up the game, various illegal opcodes were called in the assembly language, which caused the CPU's microcode to alter itself. These codes were forgotten about and regarded as junk data.

Why can't it be emulated?
Undocumented instructions are a physical, hardware thing. They are the result of billions of transistors communicating with each other a billion times a second, much like a human brain. All we know about the N64 processor is its publicly known instructions that were given to developers. It is possible to emulate the "add" instruction, because "add" simply adds two numbers, and we can emulate it perfectly without knowing how the processor works.

For example, "add" is opcode #1, and the numbers are the data given to it. This goes through millions of pipelines, before outputting the result.

However, what if we trigger opcode #32767? There isn't one, the processor only has a few hundred documented opcodes. But if we trigger opcode #32767 on the actual CPU, it will do something inside the processor. But without taking a microscope and watching the billions of tiny transistors and their billions of actions per second, it is impossible to truly know what the illegal opcode actually does - it's like a "black box", where only the input and output are known.