Part 6: Implement VRAM metadata. It is currently not functional.

Unrelated ASM changes:
* Have a single copy of each post_write_metadata macro, and jump to it. This reduces the instruction cache utilisation.
* Have a single copy of restore_registers and save_registers. This reduces the instruction cache utilisation.