Region locking is controlled by a region byte stored in the DSI Extended Header of the rom. It's protected by a sha-1 hash stored inside RSA section of header so changing it causes the hash to not match anymore. (and you can't set a new one in RSA region since you need private key to reencrypt...