Welcome!

This is a blog that we use to post news on our translation of "Ripened Tingle's Balloon Trip of Love". For those who don't know, it is a sequel to Freshly-Picked Tingle's Rosy Rupeeland. Rupeeland was released in English, but Balloon Trip of Love wasn't.

This is an unofficial fan project. We are in no way affiliated with Nintendo or Vanpool, and are doing this completely for free.
Showing posts with label Hacking/Programming Writeup. Show all posts
Showing posts with label Hacking/Programming Writeup. Show all posts

Thursday, July 14, 2016

Hacking/Programming Writeup Part 3 - Text/Script Editing

If it already hasn't become apparent, I'm writing these in whatever free time I have, so it's been a little inconsistent :)

Anyways, welcome to

The Tingle's Balloon Trip of Love
Hacking Writeup (Pt. 3)

So now we get into more specific stuff - text editing! This is arguably the most important part of any translation (most at least), since the majority of the text is usually displayed with a script engine. As I mentioned before, the script for the game is located in data/db/lang.bin. 
In a very broad sense, this file is divided into two parts - line lengths/pointers and the actual text. 
The actual text is very simple to edit. The game uses a 16 bit (2 byte) character encoding. That means that in a hex editor, two bytes equal a character rather than one. 
The more complex part of this comes with the other part of the file, the line lengths. Basically every line in the game has its length defined by a value in the beginning of lang.bin. Now this presents an interesting question that I don't fully have an answer to.
(Warning - technical stuff that only some may understand lies ahead ;) )
The game doesn't use any kind of pointer system for the text, it just has the values that specify the length of each line in the same order the lines appear in lang.bin. So how does it know where each line starts, in order to display it ingame? I don't know, at least not for sure. However, the most logical assumption would be that the game somehow knows the order of the lines and bases it off of that (this is most likely in the olz files). This is further supported by the fact that the game only displays the text correctly when it's in the exact order as it was before being edited.
(Technical stuff over)
So how do we edit the text? Sounds tedious right? Well, luckily we have a nice text extracter and inserter from DarthNemesis that exports the script to a .txt, and then imports the edited .txt back into lang.bin!
The final thing that I want to briefly touch on in this post is the font. Now, this is kind've getting into graphics territory, which is out of the scope of this post, but the game stores all of its font files in the resLibFnt archive. The game has 10 variable width fonts that includes Japanese hiragana and katakana, the Latin alphabet with accented and other special characters, punctuation, as well as many other symbols. Anyways I'll leave the rest of that stuff for the graphics post :)

As always, feel free to post any questions, comments, or concerns you may have!

(On another note, the next post will also contain an update on the status on the project, since actual progress hasn't been discussed since I've started this series of posts :D)

Monday, June 20, 2016

Hacking/Programming Writeup Part 2 - Basic structure of the ROM and what each file does

Update - added tools section


Well it's been a while. I was planning on doing this sooner, but one thing led to another and I had to take a break from the project for a while. Don't worry though, I'm back and working again :D.
I'm going to try to format these posts in a way that's easiest to understand for you guys, but I'm not the greatest at that stuff. Please comment and let me know if you like it or if you don't. Don't worry you won't hurt my feelings if you don't! It would be helpful though if you could suggest a way for me to improve it though.
Alright, without further ado...

The Tingle's Balloon Trip of Love
Hacking Writeup (Pt. 2)




Here's the 'root' of the ROM -


Basically that's what is located in the highest directory in the ROM, right when you unpack it. Most of those files are not relevant to the translation; many are included in every DS game, and simply provide the system with info needed to run the game. What is relevant is the banner.bin file and the 'data' folder. The banner.bin contains the icon for the game displayed on the DS menu, as well as the title displayed there. Obviously the title is in Japanese, so I have to edit that into English. 
Then there is a special check that the game performs to make sure the banner is valid called a CRC check. Luckily there are tools that automatically fix the CRC so I don't have to worry about that :) !


Now for the data folder -

I'm not going to show the contents of every folder here since I don't want to flood this post with screenshots. Plus the top 2 have a LOT of files, so it'd be a lot to put up. Anyways I'm just going to separate each folder into a section and describe its content(s). 

act
This isn't exactly relevant to the translation, but I'll briefly explain it here. This folder contains 364 ".olz" files. These files are simply LZ77 compressed archives (think zip files, but a little different) that contain a single ELF executable file. The reason there is so many is because there's one for each 'screen' in the game (pretty much every time the screen fades, it loads another olz file). These files call the graphics, text, music, and anything else needed for that specific scene. They're also a completely custom format. I really have no idea exactly how they work, only what they're purpose is. 
Well, 'briefly'. oops.

data
Skipping anm because I can. Just kidding :p. Once again, this folder isn't relevant to our work here. It contains 3 .sdat files, a common standard sound/music format for the NDS. Basically includes all the music and sounds in the game, and is easily extractable with a program. 
That's all there is to it.

anm
This is where we get into the important stuff (at least to us). This folder contains every graphic in the game. This includes 3D models/animations, 2D graphics, cutscenes, backgrounds, sprites, fonts, etc. It totals 119 files, with three different types. 
One is a huge archive that contains the actual graphic files, including the tiles, palettes, and tilemaps. I'll be getting into each of those files later on in this series of posts. 
Then there is .viw files. These each correspond to an archive, and contain a list of each file in the archive. (fun fact - the star/twinkle animation that plays at some point, maybe when Tingle uses the balloon, is title "star_wars" in the viw file :D) 
Finally, we have the .inf files. Like the viw files, every archive file has a corresponding inf file. These files list the sizes of each file in the archive. This can be useful sometimes when I can't figure out when a file ends or starts. 

db
The other relevant folder, and probably the most important in terms of translation. I bet you guessed it, this contains the file that contains the game's script, lang.bin. It has around 13,000 lines when the script is extracted. This file has a lot of debug/unused text. Sometimes it even gets in the way during the translation when there's alternate versions of a conversation :) . It also contains the lengths of each line in the game (it doesn't use a standard pointer system - more on that in a later post). The way this is formatted makes it very hard and tedious to edit by hand - luckily we have a program that inserts the script for us from DarthNemesis!

revision (?)
I honestly have no clue. It contains 4 bytes - 
B7 74 00 00



Well that's all I have to say for now. Please comment, and as always stay tuned for more updates!

Tools used/mentioned
*Note that I, nor anyone on this website, is responsible for any possible damage or unintended consequences that may result from the use of these programs. Additionally, none of us were/are involved in the production of these tools, and they belong to their respectful owners.
Also, the tools are for Windows (probably XP or newer). Mac and Linux users will need to find a way to run Windows applications (such as wine) or use a virtual machine.
dsbuff (extract/unpack ROM)
SDAT Extractor (extracts music or other sound files from Nintendo's .sdat file format)

Saturday, April 23, 2016

Hacking/Programming Writeup Part 1 - Introduction

Some people have been asking for something like this for a while, but after reading some recent comments on the blog, I decided it was about time for something like this.

The Tingle's Balloon Trip of Love
Hacking Writeup

For those of you who came in late, I'm the lead (read: only) hacker for the translation project. Within the next few weeks I plan to write a series of posts that describe my part of the project, what I have accomplished, and what I'm still working on. 
I'm going to try to make it as easy to read as possible, but basic knowledge of the hexadecimal (base 16) system will help (If what I just said sounds like another language, don't worry). 

These posts are basically going to cover a few general categories - 

File structure of the ROM
Text editing
Graphics editing

Each of these is probably going to be a few posts long, depending on how long it takes me to explain.

If you have anything specific you want me to address or have any questions, please ask in the comments!