? JP/US/EU Region detection ● SmileBASIC Source

Sign In

Register
*Usernames are case-sensitive
Forgot my password

JP/US/EU Region detection

Submitted
Updated
Author
ChangeV
Public Key
VKSKVXGY
Min. Compat.
All
Rating
5 votes
Description Recently, SmileBasic is released in Europe. Now, there are 3 different SmileBASICs. JP, US, and EU versions. If we know the region of Smile BASIC, we can add region specific stuff such as language option or different easter eggs for each region. When SmileBASIC was released in US years ago, I made region check routine that detects JP or US system. I used the region check in many of my games such as Slime vs Ninja. When the game is running for the first time, SmileBASIC detects region and show Japanese title screen on JP 3DS, English title screen on US 3DS. (language setting can be changed and saved later) The most important aspect is the "first time" part. Sure, you can ask player for language or region and use that information. My routine eliminates that action. It just detects region at start up silently. no need for user input. simple. Now the upgraded routine can detect EU version of SmileBASIC too. You can add special greeting for European user at the start up of game... without asking player if he/she has EU SmileBASIC. Instructions How it detects the region: SmileBoom logo sprites are different in the JP/US/EU SmileBASIC. The region check routine simply checks the pixel of logo and determine if it is JP/US/EU SmileBASIC. how to use: I made region check routine as library file. the library contains 2 routines. REGION() - this routine returns region info as number (0 is JP, 1 is US, 2 is EU) REGION$() - this routine returns region as string ("JP", "US", or "EU") *WiiU version is treated as JP region. load library file into one of slots. activate the slot using USE command. call region check routine at the beginning of code and save the value into some variable for later use. LOAD "PRG1:REGION.LIB",0 USE 1 VAR A=REGION() IF A=0 THEN ?"This is JP SmileBASIC" IF A=1 THEN ?"This is US SmileBASIC" IF A=2 THEN ?"This is EU SmileBASIC" This routine is not just for game. It can be used in other project such as graphic editor (with multi language) Feel free to use in your project. If this routine is used for language option, then don't forget to add language select menu. the player may want to change language later. Library limits : When region check routine is called, it resets all graphics using ACLS. so call the region check only once at the beginning of code and store value into variable and use it. (if you use custom graphics, load custom graphics after checking the region)
Categories
Keywords
9 Comment(s) 12Me21 12Me21 Admin Syntax Highlighter Received for creating the code syntax highlighter on SBS You should probably remove the Wii U check just in case SB BIG is released outside Japan. HTV04 HTV04 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength April Fool's 2017 Contest Participant I participated in the SmileBASIC Source April Fool's 2017 Contest! Programming Contest Forum Contributor Hidden Achievements The SB logo is used as a check, and SB BIG has a different logo. We don't know what the SB BIG logo will look like outside of Japan yet, so I guess the Wii U check was added just to stay on the safe side. mia mia Night Person I like the quiet night and sleep late. Express Yourself Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Video Games I like to play video games! Hobbies Min compatibility Wii U Can detect US version yay wii u sb for us confirmed HTV04 HTV04 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength April Fool's 2017 Contest Participant I participated in the SmileBASIC Source April Fool's 2017 Contest! Programming Contest Forum Contributor Hidden Achievements Actually, if it detects the Wii U version, it automatically sets the region as 0 (Japan). mia mia Night Person I like the quiet night and sleep late. Express Yourself Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Video Games I like to play video games! Hobbies They had the program's minimum compatible system as Wii U, to which this was a joke about 12Me21 12Me21 Admin Syntax Highlighter Received for creating the code syntax highlighter on SBS You could load the file into an array, like LOAD "DAT:SYS/DEFSP.GRP",ARRAY It might be faster to check one of the built in programs, since the file size is smaller. I'm not sure if there are any differences in the EU version though. ChangeV ChangeV Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Staff Pick "Your program is one of our favorites!" - Staff Achievements Thanks for the array loading method. I tried loading GRP file into array when developing petit converter long ago, but forgot about it until you mentioned. now the code is smaller. DEF REGION_V2() DIM AR[0,0] LOAD "DAT:SYS/DEFSP.GRP",AR,0 RETURN !(AR[485,193]AND 1)+!(AR[485,193]>>1) END and about the file check method, I made old version with several file check routines about 2 years ago on miiverse. that was for only JP/US region detection. as for JP/US/EU system files, there are 5 system files that's different in each region. I made 5 routines using EX3KEYDRUM, EX8TECHDEMO, GAME1DOTRC, GAME4SHOOTER, and GAME5VS files. for example, In EX8TECHDEMO file... word "[UP]" is used in JP and US version word "Confirm" is used in US and EU version. I used that to determine the region. key : E8EEN1 TailsAndSonic TailsAndSonic Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Drawing I like to draw! Hobbies Seems really useful! +1 from me! ColeslawProductions ColeslawProductions Nice! I forgot the sprite pages changed regionally. I'm all for these kinds of extrapolated information solutions!