Language detection for region lock
Moderator: BigEvilCorporation
Language detection for region lock
Hi,
Is there any way to detect my megadrive language setting ingame?
I've done a region lock by video mode (50 or 60Hz) but how can i detect the language so i can allow the game only boot on japanese system?
(i'm working with SGDK, not in asm)
Is there any way to detect my megadrive language setting ingame?
I've done a region lock by video mode (50 or 60Hz) but how can i detect the language so i can allow the game only boot on japanese system?
(i'm working with SGDK, not in asm)
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm
No such thing. The only thing the MD allows is:
Domestic NTSC (domestic as in Japan)
Domestic PAL
Foreign NTSC
Foreign PAL
That's it. Check bit 7 of the version register (byte at $A10001) to see if it's domestic (0) or foreign (1), and bit 6 to see if it's NTSC (0) or PAL (1).
SEGA required people to encode which "region" was allowed in the "country code" byte... instead of U or E or J or anything else, which had no chance of ever being validated, SEGA changed it to a hex digit from "0" to "F" where the bits of the hex digit stood for one of the qualifications I listed at the top.
b3 = Foreign PAL
b2 = Foreign NTSC
b1 = Domestic PAL
b0 = Domestic NTSC
So a "world" rom became "F", any PAL region became "A", and any NTSC region became "5". Of course, it's up to the game itself to check that the code matches the version register values - none of that is enforced via hardware.
If you want a better more secure way to verify a region, you have to build custom hardware into your cart.
Domestic NTSC (domestic as in Japan)
Domestic PAL
Foreign NTSC
Foreign PAL
That's it. Check bit 7 of the version register (byte at $A10001) to see if it's domestic (0) or foreign (1), and bit 6 to see if it's NTSC (0) or PAL (1).
SEGA required people to encode which "region" was allowed in the "country code" byte... instead of U or E or J or anything else, which had no chance of ever being validated, SEGA changed it to a hex digit from "0" to "F" where the bits of the hex digit stood for one of the qualifications I listed at the top.
b3 = Foreign PAL
b2 = Foreign NTSC
b1 = Domestic PAL
b0 = Domestic NTSC
So a "world" rom became "F", any PAL region became "A", and any NTSC region became "5". Of course, it's up to the game itself to check that the code matches the version register values - none of that is enforced via hardware.
If you want a better more secure way to verify a region, you have to build custom hardware into your cart.
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm
Just use standard C pointer memory access. You see examples all through the sgdk code.
Code: Select all
vers = *(u8 *)0xA10001;
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm
Yeah, you really want a screen with a few flags with the name of the language under the flag in the language associated with the flag; allow the user to change which one is high-lighted with the joystick to select the language the game uses. Just because the machine reports as Japanese doesn't mean the person using it is Japanese, or even in Japan. Lots of people from around the world buy Japanese consoles. Some do it so they can play Japanese games without needing to mod the console. Some do it just to say they have a Japanese console. Another reason to make it selectable is maybe the Japanese players will want to play it in another language than Japanese.sega16 wrote:Or you could program a menu to let the users select the language they want that way if someone is using a Japaneses mega drive but speaks English they could view the game in English if they wanted to.
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm
The console doesn't have a language. There's a region (foreign and domestic) and a video system (PAL or NTSC). There are no languages built into the console as there are no libraries... no OS. If you ASSUME that a Japanese console implies Japanese, it's just that - an assumption. ESPECIALLY today. Back when the console was brand new it would be okay to make that assumption, but not today.
I'm ok with this.
I mean, a console jap will be domestic and ntsc, i assimile that to "jap & ntsc" but i know there is no language bult in
It's a landmark (repère?) for me to tell
JAP = Japanese (domestic) + ntsc
USA = English (foreign) +ntsc
EUR = English (foreign) + pal
ASIA = Japanese (domestic) + pal
but it's wrong & i would tell Region + video system...
I mean, a console jap will be domestic and ntsc, i assimile that to "jap & ntsc" but i know there is no language bult in
It's a landmark (repère?) for me to tell
JAP = Japanese (domestic) + ntsc
USA = English (foreign) +ntsc
EUR = English (foreign) + pal
ASIA = Japanese (domestic) + pal
but it's wrong & i would tell Region + video system...