Sanc and quit is dumb. It's a dumb thing with a dumb name, and it smells dumb. But why does it happen? And why is it so dumb?
There are a bunch of ways to load a room as an entrance. You can walk in from the overworld; you can spawn from file select; you can use this dumb thing called sanc and quit; you can die and choose to continue; or you could mirror while in a dungeon.
That last thing is the one we're interested in.
When you use the mirror, the screen gradually gets more pixelated using a hardware effect built into the SNES PPU called mosaic. There are 16 levels of mosaic, ranging from 0 (no mosaic) to 15 (very mosaic), and they can be applied only to, but any permutation of, the four background layers. This effect is controlled by a single register. The most significant 4 bits behave as a single value from
For example, a mosaic level of 6 can be applied to backgrounds 1 and 2 by writing
The strength of the mosaic effect is generally handled by itself in
So where does this come into play with sanc and quit? Well, it's actually
Did I forget to mention that mirroring uses the same module as file loading? Ya. They share a lot of code, and it makes mirroring do some redundant stuff, but it also overloads this routine with a lot of garbage that results in the garbage you're reading about.
So back on track: when you load a file, it checks
Even when you're given the choice of a spawn point, the value won't deviate from
In this way, the sanctuary is sort of a fixed point, but not really. There's nothing that says it has to always be that value, and post-Zelda save and quits work perfectly fine with any other value. It's just that this value is held to tightly, but if you found a way to change it outside of the spawn selection routine, you would spawn there instead of sanctuary when you sanc and quit.
Remember how I said the file loading routine is overloaded to include mirror functionality? Well, it's also overloaded to include death functionality.
There's a special case of sanc and dumb that occurs exactly when you save and quit with a mosaic strength of
If you then take your festering mosaic strength to a dungeon and use the mirror, you'll be prompted with the spawn selection. What gives?
This is what happens when you try to shove everything in a single function.
When you use the mirror, it doesn't bother to initialize
The check on
And here's where it gets dumber… You really are choosing a spawn point, but your choice is subsequently discarded, because yet another flag gets in your way! Grrrr!!!
The variable
Sanc and quit is dumb.
Qirn found and solved Quit and Sanc.