I've collected all information from the discussion between iota97, Abbannon and me at #12637 relevant to region detection of game roms.
Currently the emulator doesn't read the REGION property from PARAM.SFO:
|
// region = paramSFO.GetValueInt("REGION"); // Always seems to be 32768? |
Instead a workaround is used by checking the 3rd letter of DISC_ID as this:
U - USA
E - Europe
J - Japan
A - Asia
H - Hong Kong
K - Korea
If the letter doesn't match any of those the region will be "other" and no region will be written on game info screen (and no flag will be displayed)
There is also commented out code that checks all 4 letters of DISC_ID
|
if (regStr == "NPEZ" || regStr == "NPEG" || regStr == "ULES" || regStr == "UCES" || |
Abbannon found the following DISC_ID substrings for 5 regions.
US can have:
ULUS,
UCUS,
NPUZ,
NPUX,
NPUF,
NPUH,
NPUG
EU can have:
ULES,
UCES,
NPEZ,
NPEX,
NPEH,
NPEG
JP can have:
ULJS,
ULJM,
UCJS,
UCJM,
UCJB,
NPJJ,
NPJH,
NPJG
KO can have:
ULKS,
UCKS,
NPHH,
NPHG
AS can have:
ULAS,
UCAS,
NPHZ
(Not sure if that's all of them, but it's all that he could find.)
However, according to a database the disc ID of some releases do not follow the regional convention. In one case a region has a disc ID of a different region.

In another case disc ID's of the same region belong to different regions.

Based on this information, region can't be obviously determined from disc id.
I've suggested taking a look at UMDGen to see how it determines the REGION of property.
Abbannon had a look:
I didn't notice this before, but among the PARAM.SFO information it explicitly states the region.
NPHH shows up as N/A
Meanwhile,
ULUS shows Ntsc,
ULES shows Pal,
ULJS shows Japan, and
ULKS shows Korea
I have no idea how it determines this based on data, however.

I've collected all information from the discussion between iota97, Abbannon and me at #12637 relevant to region detection of game roms.
Currently the emulator doesn't read the REGION property from PARAM.SFO:
ppsspp/UI/GameInfoCache.cpp
Line 255 in 6610cd7
Instead a workaround is used by checking the 3rd letter of DISC_ID as this:
U - USA
E - Europe
J - Japan
A - Asia
H - Hong Kong
K - Korea
If the letter doesn't match any of those the region will be "other" and no region will be written on game info screen (and no flag will be displayed)
ppsspp/UI/GameInfoCache.cpp
Line 262 in 6610cd7
There is also commented out code that checks all 4 letters of DISC_ID
ppsspp/UI/GameInfoCache.cpp
Line 270 in 6610cd7
Abbannon found the following DISC_ID substrings for 5 regions.
US can have:
ULUS,UCUS,NPUZ,NPUX,NPUF,NPUH,NPUGEU can have:
ULES,UCES,NPEZ,NPEX,NPEH,NPEGJP can have:
ULJS,ULJM,UCJS,UCJM,UCJB,NPJJ,NPJH,NPJGKO can have:
ULKS,UCKS,NPHH,NPHGAS can have:
ULAS,UCAS,NPHZ(Not sure if that's all of them, but it's all that he could find.)
However, according to a database the disc ID of some releases do not follow the regional convention. In one case a region has a disc ID of a different region.
In another case disc ID's of the same region belong to different regions.
Based on this information, region can't be obviously determined from disc id.
I've suggested taking a look at UMDGen to see how it determines the REGION of property.
Abbannon had a look: