Page 1 of 1
Language detection for region lock
Posted: Thu Feb 16, 2012 7:24 pm
by oofwill
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)
Posted: Thu Feb 16, 2012 9:08 pm
by Chilly Willy
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.
Posted: Thu Feb 16, 2012 9:42 pm
by oofwill
Thanks for this clear response.
I don't know how to check version register since i'm working with SGDK's basics commands. (I have just started programming on MD...)
I suppose i had to learn more about asm programming ^^
Posted: Fri Feb 17, 2012 1:23 am
by Chilly Willy
Just use standard C pointer memory access. You see examples all through the sgdk code.
Posted: Fri Feb 17, 2012 9:52 am
by oofwill
Many thanks for this!
I can now detct what region is the MD used
Thanks again!
Posted: Sat Feb 18, 2012 12:34 am
by sega16
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.
Posted: Sat Feb 18, 2012 3:17 am
by Chilly Willy
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.
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.
Posted: Sat Feb 18, 2012 8:36 am
by oofwill
hum, this is independant from the console language
I mean, whatever the console version, language menu is a good idea for a game as rpg, or more generaly a game with on-screen texts (dialogs).
Posted: Sat Feb 18, 2012 6:48 pm
by Chilly Willy
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.
Posted: Sat Feb 18, 2012 6:56 pm
by oofwill
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...
Posted: Sat Feb 18, 2012 7:24 pm
by Shiru
If you want to make your software region locked for some reason, I should say that it is not a good idea - there are rather easy ways (very simple HW mods, Mega Key) to overcome this. So it would only make some discomfort for users.
Posted: Sat Feb 18, 2012 7:31 pm
by oofwill
To tell the thruth, i'm coding some idiot program to training me at MD coding.
With this
non-region locked démo, i can see if the console is set to jap, us, eur or even asia region (it's useless, but this is just training for me at this time

)