Yes, but how does it *work*? How does it do that?
Do Gameshark / Action Replay CDs launch some sort of wrapper for all executables launched afterwards? Do GS devices, by sitting in the serial port, get to arbitrarily poke bytes at regular intervals? Or do they insert memory-handling ASM as some kind of hook defined by the address in the 'master' code?
It'd have to be a wrapper. My understanding is this.
You have a GS CD that allows you to program the Game Shark with the codes you want. This is how it knows what addresses to replace at what times. At some point after selecting the codes you want, you will be prompted to change discs without resetting or powering off. Once you have the new disc in, the game starts.
That's the key. If the GS itself could be polled by the system and make appropriate changes you wouldn't have to boot with the CD. You could just slap the GS on and go. What seems to happen is the GS CD is an API wrapper. Providing normal functionality of the PSX while incrementally telling the GS to do its thing.
What are master codes for? Not sure. My guess would be that a particular address has to be set to something first before the PSX allows memory modification from an external source. Like a Debug Mode RAM-write hardware interrupt (sounds kind of slow though). This would have to be semi-unique for each game as a sort of anti-cheat measure. It's likely a software handled check though since emulators require master codes too. That might just be the emulator being TOO accurate at emulating, though.