How does PCSXR deal with region requests?
I watched this video about the anti-piracy measures of the PS1 and Spyro 3.
The tldr is that PS1 disks have a special region of the disk that is not readable by any other disk reader on the planet. This part of the disk contains region information (NA, JAP, etc...) and if it's not there, then the disk was created using a run-of-the-mill disk burner, and is therefore not legitimate.
Some smart people found a way around this by creating a special chip that would intercept the region request and return the correct information. This fooled the PS1 into thinking the disk is legitmate.
Unfortunately, the PS1 is designed such that this region information is only available as the game is booted. If the game is running, then this information should not be accessible, but the special mod chip would return the information regardless.
Some developers used this to detect if their game was being run on a modded PS1, and would write special logic to sabotage their game if it was running on modded hardware.
How does an emulator, like pcsxr, deal with this? Does it just naively return the region information all the time?
Best Answer
For those aspects of 'regions' that do not actually affect the physical functioning of the hardware (I.e. those regions that are just labels arbitrarily assigned), there is no problem with emulators. Why?
Emulators simply don't use this region-locking "feature". They don't read the 'special section' of the disc. And since the game is unaware of its existence as a 'safety feature', this DRM is ironically its own undoing. There's no way for the game to query or know what its own region is, when all the regions behave the same.
Some emulators also have 'fast-boot' support that skips this phase of the boot process, also nullifying region checks further.
So as emulators don't need the region information, they just imitate the real thing: It's never available. Hence custom checks that fail if region information is available past boot will succeed on properly behaved, read; most popular, emulators.
There is one aspect that is different though: PAL versus NTSC. The latter is used in Japan, Canada, the USA, Mexico. The former is used in the rest of the world. These two standards have different framerates. That is something the game can access, and thus games that are created for PAL might crash or quit themselves if loaded on an NTSC BIOS and vice versa due to custom checks, as you noticed. But since the emulator controls the BIOS subsystem, it can simply be instructed by the user to load the correct one for the game. When using fastboot, the emulator might also infer the correct display standard from the game itself and set itself up accordingly.
Side note: It might behoove the user to locate PAL versions of any NTSC game they have originally developed in the US or Japan: NTSC conversions are typically of poor quality, game developers usually took the route of slowing the whole game down by ~17%, which tends to affect the experience negatively: Even though 60fps PAL is a thing, support for more TV sets and/or lack of knowledge overrode the decision to implement it properly.
You can read more about it here. Or check out the source code of an emulator to see how video mode switching works. (This is PCSX2, but it also supports PS1 games).
Pictures about "How does PCSXR deal with region requests?"
PCSX-Reloaded PS1 EMULATOR setup guide
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Sora Shimazaki, Sora Shimazaki, Sora Shimazaki, MART PRODUCTION