Editing setupnds.ext

AXYPB

Well-Known Member
OP
Member
Joined
Sep 16, 2007
Messages
593
Trophies
0
XP
140
Country
United States
I received a few PMs asking how I was able to edit the setupnds.ext and setupgba.ext files in the <a href="http://gbatemp.net/index.php?showtopic=89197" target="_blank">unofficial English M3 Sakura</a> firmware. Prior to my release of these edits, the firmware was translated into English with the exception of the cheat menus for NDS and GBA ROMs. Previous attempts to translate these files broke them and I had an idea as to why.

To edit the files, I used <a href="http://www.editpadpro.com/" target="_blank">EditPad Pro</a>. EditPad by itself is a great text editor targeted to programmers which I have used to completely replace Notepad in my system, but aside from its text editing capabilities, it has two features that were crucial for this undertaking:<ol type='1'><li>The ability to reinterpret character sets on the fly</li><li>Hexidecimal editing mode (Pro version only)</li></ol>setupnds.ext and setupgba.ext contain the programs that allow the user to access loading options, such as cheats, slow-motion, etc. Though the translation of the main firmware itself appears to have been straightforward (I didn't actually look into the details of that process), these programs are separate from the firmware and thus require hex-editing. Opening a binary file such as setupnds.ext in EditPad Pro automatically switches the program to hexidecimal mode, shown below.

<a href="http://img255.imageshack.us/my.php?image=93003817jb3.png" target="_blank"><img src="http://img255.imageshack.us/img255/567/93003817jb3.th.png" border="0" class="linked-image" /></a>
Don't let the numbers intimidate you.

The first thing to do here is to locate the text to be modified. Quoted from the M3 Sakura FAQ, the strings to edit and their translations are as follows:
<!--quoteo(post=1187741:date=Jun 3 2008, 07:31 PM:name=Densetsu3000)--><div class='quotetop'>QUOTE(Densetsu3000 @ Jun 3 2008, 07:31 PM) <a href="index.php?act=findpost&pid=1187741"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec--><b>Q: How do I access the cheat menu, soft reset function, etc?</b>
<b>A:</b> You can access the cheat menu by sliding a ROM to the left. Up until recently, these functions were all in Japanese because there was some difficulty in editing the "setupnds.ext" and "setupgba.ext" files. Fortunately <a href="http://gbatemp.net/index.php?showuser=101633" target="_blank">AXYPB</a> found a way to edit the files, and they can be downloaded <a href="http://www.sendspace.com/file/d0w3p4" target="_blank">here</a>.

With the edited files by AXYPB, the translations below are no longer necessary, but I'll leave them up for a little while longer until AXYPB's files are included in the most current English Sakura bundle.

<img src="http://img.photobucket.com/albums/v726/densetsu3000/fire_cheatfile.jpg" border="0" class="linked-image" /> チートファイル選択 = Select Cheat File
<img src="http://img.photobucket.com/albums/v726/densetsu3000/fire_cheatitem.jpg" border="0" class="linked-image" /> チート項目設定 = Cheat Settings
<img src="http://img.photobucket.com/albums/v726/densetsu3000/fire_cheatswitch.jpg" border="0" class="linked-image" /> チート開始キー = Cheat Switch
          ・オフ = OFF
          ・キー操作 = Key Toggle ON/OFF
               ・SELECT+左 (Left) => Cheats ON
               ・SELECT+右 (Right) => Cheats OFF
          ・常に有効 = Always Enabled)
<img src="http://img.photobucket.com/albums/v726/densetsu3000/fire_rt.jpg" border="0" class="linked-image" /> (GBA ROM config menu only) リアルタイムセーブ = Real-time save
<img src="http://img.photobucket.com/albums/v726/densetsu3000/fire_slowmoveswitch.jpg" border="0" class="linked-image" /> スローモーション開始キー = Slow motion switch
          ・オフ = OFF
          ・L+左 = L+Left
          ・L+右 = L+Right
<img src="http://img.photobucket.com/albums/v726/densetsu3000/fire_resetswitch.jpg" border="0" class="linked-image" /> リセットスイッチ = Soft Reset Function (currently non-functional, will perhaps be fixed in a future update)
          ・オフ = OFF
<img src="http://img.photobucket.com/albums/v726/densetsu3000/fire_slowmovelevel.jpg" border="0" class="linked-image" /> スローモーションレベル = Slow Motion Level
          ・スロー1 = Slow1
          ・スロー2 = Slow2
          ・スロー3 = Slow3
          ・スロー4 = Slow4
          ・スロー5 = Slow5
<img src="http://img.photobucket.com/albums/v726/densetsu3000/fire_fire.jpg" border="0" class="linked-image" /> (NDS ROM config menu) ダウンロードプレイ = Download Play
          ・標準 = Standard
          ・有効 = Enabled
<img src="http://img.photobucket.com/albums/v726/densetsu3000/fire_fire.jpg" border="0" class="linked-image" /> (GBA ROM config menu) 読み込みモード = Loading Mode
          ・高速モード = High-Speed Mode
          ・低速モード = Low-Speed Mode
<img src="http://img.photobucket.com/albums/v726/densetsu3000/fire_confirm.jpg" border="0" class="linked-image" /> 保存 = Save Changes
<img src="http://img.photobucket.com/albums/v726/densetsu3000/fire_cancel.jpg" border="0" class="linked-image" /> キャンセル = Cancel Changes

When you save changes, you get the following message:
変更を保存しました。
Changes have been saved.
本体電源をお切りください。
Please shut down the console.

When you cancel (or press B), this message appears:
キャンセルしました。
Canceled settings.
本体電源をお切りください。
Please shut down the console.<!--QuoteEnd--></div><!--QuoteEEnd-->
If you have used the files yourself, you may have noticed that I took some liberties with the translation. This was to get the hacked-in strings to be as close to the length of the original string as possible, as too little would leave extra whitespace and too much will cause overruns and strings to appear in odd places.

To be able to find any of these Japanese strings, the first feature listed above comes into play. Switching out of hexidecimal mode to text mode, it still doesn't look very hospitable. The Japanese text is there, but the character set needed to show it is not selected. This being a binary file and not an ASCII file, it should come as no surprise. To force them to appear, we reinterpret the character set to Shift-JIS.

<a href="http://img264.imageshack.us/my.php?image=89147684ew2.png" target="_blank"><img src="http://img264.imageshack.us/img264/7775/89147684ew2.th.png" border="0" class="linked-image" /></a>
In the Convert menu we have the Text Encoding option.

The default encoding is code page 1252, and that won't do. Code page 932 will get us what we need. (Note the connection between the messages.932 file in the Sakura files and the code page number used to uncover our data.)

<a href="http://img525.imageshack.us/my.php?image=67617040hw7.png" target="_blank"><img src="http://img525.imageshack.us/img525/1664/67617040hw7.th.png" border="0" class="linked-image" /></a>
The correct code page is selected.

A couple of Japanese characters appear in the results preview, but none of them are of any importance. Now that we see them at all, we can start searching for the text to edit. Pressing Control+F opens the Search & Replace box, which is shown as a frame at the bottom of the window instead of a pop-up dialog.

<a href="http://img507.imageshack.us/my.php?image=14500026gn9.png" target="_blank"><img src="http://img507.imageshack.us/img507/6865/14500026gn9.th.png" border="0" class="linked-image" /></a>
The Search & Replace box is similar in spirit to Firefox's Findbar.

The process starts by searching for one of the Japanese strings listed above.

<a href="http://img256.imageshack.us/my.php?image=15920726my6.png" target="_blank"><img src="http://img256.imageshack.us/img256/589/15920726my6.th.png" border="0" class="linked-image" /></a>
Look what I found.

It appears that every string we need to edit is located in a single convenient spot. Lucky us. For convenience, I opt to work with this document in Word Wrap, activated with F11.

<a href="http://img131.imageshack.us/my.php?image=78797647lg6.png" target="_blank"><img src="http://img131.imageshack.us/img131/4791/78797647lg6.th.png" border="0" class="linked-image" /></a>
French?

You'll notice a lot of references to iTouchDS files immediately below the wall of Japanese. Densetsu3000 postulates that this is because the M3 Sakura firmware and the iTouchDS firmware use a template of some kind in their design, and that a lot of the iTouchDS components were recycled for Sakura. However, since this isn't the iTouchDS, we'll just leave it alone. After all, this is where the difficult part begins. The process really begins when we switch back to the hexidecimal mode with the character set still changed from its default and the cursor unmoved.

<a href="http://img214.imageshack.us/my.php?image=96582224rw7.png" target="_blank"><img src="http://img214.imageshack.us/img214/2167/96582224rw7.th.png" border="0" class="linked-image" /></a>
Note the currently highlighted text.

It is important that the cursor be unmoved, because this tells us exactly where and what to edit. At either side of the highlighted text are brackets and middle dots. The middle dots, which represent hexidecimal code 00, are absolute boundaries; they dictate where to start and stop defining text. It is between these dots where we actually change the text. Doing so is simple: replace the string where we can and keep the length of the file unchanged. The easiest way to do this is to change the cursor to OVR mode by pressing the Insert key. This mode causes text to be overwritten if it is in front of the cursor instead of move as the user types. Maybe you experienced this while using Internet Explorer. It's because you pressed the Insert key and Internet Explorer responded in kind by acting weird when you try to fix a typo.

<a href="http://img183.imageshack.us/my.php?image=79156740ct3.png" target="_blank"><img src="http://img183.imageshack.us/img183/9906/79156740ct3.th.png" border="0" class="linked-image" /></a>
The box cursor indicates that we are in OVR mode.

We simply type over the gibberish in English by clicking on the text area to the right of the hexcodes and using the translation as a reference.

<a href="http://img249.imageshack.us/my.php?image=96720985dz6.png" target="_blank"><img src="http://img249.imageshack.us/img249/6602/96720985dz6.th.png" border="0" class="linked-image" /></a>
That's it.

Notice that I added a space (hexcode 20) at the end of the string. This is strictly for padding. When that's done, we switch back to text mode and see what we have now.

<a href="http://img515.imageshack.us/my.php?image=10eu9.png" target="_blank"><img src="http://img515.imageshack.us/img515/4396/10eu9.th.png" border="0" class="linked-image" /></a>
One down.

If you look closely, you will see that some places have more spaces than normal. This is a result of the encoding; unlike Latin characters which use only one byte, higher Unicode characters like Japanese characters use two bytes. I can't fully explain it, but it presents a hurdle to finishing this project quickly.

<a href="http://img406.imageshack.us/my.php?image=11sf9.png" target="_blank"><img src="http://img406.imageshack.us/img406/6447/11sf9.th.png" border="0" class="linked-image" /></a>
Selecting the text results in odd, but predictable, behavior.

It will take some prodding around to find the exact boundaries of each string, but it will be easier to see exactly where they are in the hexidecimal mode. We need only highlight where we think the string is and confirm it when we switch modes.

<a href="http://img254.imageshack.us/my.php?image=12gm6.png" target="_blank"><img src="http://img254.imageshack.us/img254/8566/12gm6.th.png" border="0" class="linked-image" /></a>
Even if you can't be completely sure...

<a href="http://img525.imageshack.us/my.php?image=13rt7.png" target="_blank"><img src="http://img525.imageshack.us/img525/9974/13rt7.th.png" border="0" class="linked-image" /></a>
...we can always double-check before changing anything.

<a href="http://img56.imageshack.us/my.php?image=14of6.png" target="_blank"><img src="http://img56.imageshack.us/img56/2811/14of6.th.png" border="0" class="linked-image" /></a>
It just takes patience.

And from there the process is repeated until the all of the strings related to Sakura (and absolutely nothing else) are changed. When I finished editing the file, I noticed several strings that weren't listed in Densetsu3000's FAQ. As stated above, it is most likely that these are remnants of iTouchDS components and since I can't get them to appear in the menu, we can leave them untouched clear of conscious. The process is identical for setupgba.ext. The main things to remember when editing such files are:<ol type='1'><li>Always make sure the filesize is identical when the editing is finished. Use OVR mode and don't press Backspace to ensure this happens.</li><li>Edit the strings between the 00 codes. Condense the string if needed or other strings will begin showing up where you don't expect them.</li><li>Use a text editor with charset reinterpretation and hex-editing capabilities for a job like this. It will be very difficult, if not impossible, to do this with two programs, due to the multibyte characters that Japanese is made of.</li><li>For goodness sake, please make a backup of your files when you try something like this. EditPad's infinite undo is a big help, but it won't save you when you close the file.</li></ol><a href="http://img171.imageshack.us/my.php?image=15cc2.png" target="_blank"><img src="http://img171.imageshack.us/img171/8164/15cc2.th.png" border="0" class="linked-image" /></a>
I hope this guide has been of some informative value to you.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • SylverReZ @ SylverReZ:
    Had a ton of bugs and often crashed. It even didn't support DOS compatibility with older games. :feelsbadman:
  • SylverReZ @ SylverReZ:
    I only grew up with Windows XP because I was lucky.
  • RedColoredStars @ RedColoredStars:
    I downloaded XP on dialup when it came out. Overnights for like a week. cuz I couldn't tie up the phone line during the day. It was so awesome and worked so great going from ME to XP.
  • K3Nv2 @ K3Nv2:
    Vga pins were a dick
  • K3Nv2 @ K3Nv2:
    I kind of want down a large pizza at 10am then crash out
  • ZeroT21 @ ZeroT21:
    Having pizza all day? done it
  • K3Nv2 @ K3Nv2:
    Nah pizza hut open at 10:30
  • ZeroT21 @ ZeroT21:
    just buy a stack of pizza and keep the rest you don't need yet frozen
  • K3Nv2 @ K3Nv2:
    Or buy frozen pizza
  • ZeroT21 @ ZeroT21:
    I buy the regular kind, not the frozen stuff
  • ZeroT21 @ ZeroT21:
    supermarket pizza is ass
  • K3Nv2 @ K3Nv2:
    x65 would just yell at me
  • ZeroT21 @ ZeroT21:
    sounds ok, he didn't pull a gun out ,so...
  • K3Nv2 @ K3Nv2:
    $12 large any style pizza deal
  • K3Nv2 @ K3Nv2:
    Each bite is a $1 well spent
  • SylverReZ @ SylverReZ:
    @ZeroT21, Agreed. I hate oven pizza, only from pizza place.
    +1
  • K3Nv2 @ K3Nv2:
    Nah I can still go for totinos
  • RedColoredStars @ RedColoredStars:
    i like totinos party pizzas. lol.
  • RedColoredStars @ RedColoredStars:
    the cracker-like crust is great on those
  • RedColoredStars @ RedColoredStars:
    My neighbor and I are going to make this next month....
  • SylverReZ @ SylverReZ:
    Tiger crust is great.
  • K3Nv2 @ K3Nv2:
    I'm beefing with a neighbor currently each time I ask him for help with something he makes bs excuses then ignores my calls text but seems to randomly speak when I'm done with the project after doing things to help him
  • RedColoredStars @ RedColoredStars:
    DiGiorno Crispy Pan Pizza tasted pretty dang close to Pizza hut pan pizza, but Im not sure if theyve been discontinued or not. Havent seen them locally for a couple of months now.
  • RedColoredStars @ RedColoredStars:
    The croissant crust is still available though, but not quite as good imo.
    RedColoredStars @ RedColoredStars: The croissant crust is still available though, but not quite as good imo.