This ASM hack allows you to safely use modified direct page registers outside the NMI and IRQ.

Crash course on how to use the direct page register:
- Preserve the direct page register
- Modify it to your needs
- Use direct page addressing to your likings
- Recover the direct page register

Example usage:

PHD		;Preserve
PEA $2100	;\Set direct page register to $2100
PLD		;/We use a stack trick to do this.
LDA #$08	;\
STA $00		;/Store #$08 to $2100 (the brightness SNES hardware register)
PLD		;Recover

Made by Ersanio. No credit needed.