News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: pointers, fonts, translating an english ROM - need some help  (Read 9230 times)

aurion

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
pointers, fonts, translating an english ROM - need some help
« on: March 02, 2011, 11:44:10 am »
For the past few days I spent (partially frustrating) hours and hours in rom hacking research and now I'm at the point where I need help.
I want to translate an english game to german. The game in question is 9 hours, 9 persons, 9 doors. It's a pretty good game, so there is a chance that some of you already know what this game is all about.

Almost 100% of the text in the game can be directly edited by just opening the rom with a hex-editor. So I assume that the text is not compressed, which is awesome.



I easily figured the hex values of letters and made a table file: http://npshare.de/files/d397846d/999TABLE.txt


I use Crystal Tile 2 and my prefered hex-editor NEXT-Soft for rom hacking. My first problem is editing the font file to allow special characters (umlauts = ä, ü, ö). I managed to track down the font file and opened it with a hex-editor:



My first question is, how do I edit this file to allow the umlauts?


As I said I can translate almost the complete text with opening the rom file with a hex-editor. I can also translate the appropriate text files by extracting the rom archive with Crystal Tile 2. There the text is divided in two folders,

1) etc
2) scr

In the etc folder I have these files:



It contains all the text files of the menus and credits and the font file (strangely there are also some japanese files in there)

In the scr folder I have the in-game text of the novel, packed into many fsb files:



The problem here is the space. German is a horribly complicated language, that does need a lot more space than english in order to make a decent  translation. To allow more space I have to deal with annoying pointers. I do not exactly know where these pointers are located in this game and how I can figure them out.

In this picture you can see before and after text chunks something like START_CREATE_NEW and START_WRITE_1. What are these for? Do they happen to be the pointers? If yes, how can I correctly edit them?

Since I can translate the game with opening the rom with a hex-editor, are there perhaps any advantages in comparison with extracting the rom and editing single text files? What do you recommend me to do?


My next problem is locating some words on the menu screen of the game.



I haven't been able to locate and edit the words "Continue", "Start", "Erase Data", "prologue", "Yes" and "No". What could be the reason for this? Perhaps these words are actually burned into graphics and I have to edit them with a tile editor? Perhaps these words are compressed somewhere in a file of the rom?

Thanks to anyone in advance who is willing to help. If you need some more information, please ask.

Ryusui

  • Hero Member
  • *****
  • Posts: 4989
  • It's the greatest day.
    • View Profile
    • Tumblr
Re: pointers, fonts, translating an english ROM - need some help
« Reply #1 on: March 02, 2011, 02:56:13 pm »
Just FYI, you don't need a table for this game. I'm looking at the hex and that's just ordinary ASCII. WindHex should let you view the text by default.

Try inserting a standard ASCII or UTF-8 umlaut code into the script somewhere it'll show up early. You might be surprised.
In the event of a firestorm, the salad bar will remain open.

Auryn

  • Hero Member
  • *****
  • Posts: 649
    • View Profile
Re: pointers, fonts, translating an english ROM - need some help
« Reply #2 on: March 02, 2011, 03:01:30 pm »
Hi,
this topic would be better in the newbie forum because u clearly lack the basic knowledge on how to translate.
Anyway i will try to point u in the right way:
Yes, u are right and the text seems be stored in ASCII so u can see it from the hex editor and u are very lucky because it's not so common that this happen.
Your table look ok even if it's useless because u see the the text already in your hex editor.
About the font; u can't edit it binary (actually u could but it's madness). U have to decompress the rom into the single files and edit the font file with a tile editor. When u put the first letter of the font in the top left corner of CT2 (crystal tile 2) in tile view, check the bottom, it's tell u in what file u are in that part of the rom. Find 3 unused tiles and copy paste the a/e/u on it + add the points. Again with luck, if your 3 tiles are after the "/" (based on your table), the ä ö ü will have them with the value 80 81 82.

The decompress/compress process in the NDS rom with DSlazy (or similar) are a lossless process so why u want to carry all the rom around?? About the pointers: if the text is split in so many files, u have a good chance that each of those files has a structure like:

Pointer table
text

or

text
pointer table

In how to figure them out, please read one of the many guides in the net about this topic.
There is nothing strange about left over of pieces of games from another region or another version.

What those different "start" are used for, nobody can tell u like that. By reading the hex editor, it's clear what they are for but i don't know if they are used and/or need/can be translated. I would not touch them if they not appear on screeen.

U got the answer already about de-/compressing the rom.

There are actually 3 possibilities because u can't find them and u got 2 already. The last one is that those words are in the game with another table than the one u found out. Yes, it's possible that a game uses 2-3 different tables and different font in the same game.







aurion

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: pointers, fonts, translating an english ROM - need some help
« Reply #3 on: March 03, 2011, 08:59:15 pm »
@Ryusui: That did not work. I cant put a character in the script that is not present in a font file.

@Auryn: Thanks for your answer. Your absolutely right. I'm a beginner and lack a lot of rom hacking knowledge.

But as I said, I did a lot of research in the past few days. I read docs how to make table files, I am familiar with the hex system since ages, and I know what pointers are. But unfortunalty a lot of docs here are clearly outdated, which is kind of troublesome for a beginner. The doc I read about pointers is from Mad Hacker and sadly it only deals with NES roms. Someone should definitely make a guide for DS games. Or can I use the same method for DS game?

Quote
For illustrative purposes, I'll use the Final Fantasy rom.  This is where thingy comes in helpful.
Let's say you wanted to change "Nothing here." to read "The Princess always worries about you."
So, we follow these simple, handy dandy steps.

1) Locate the string we want to replace (remember, take the HEX value)
2) Locate the new string (remember, take the HEX value)
3) Since we know that this rom uses the STANDARD HEADER system (defined below), we can
use that to calculate the header value.  Don't worry, I'm going to walk you through it right here
for your first time.
4) Take the location that you want to calculate your pointer for (The first text string: "Nothing
here.", for instance).

Because these are STANDARD HEADER pointers, we use the following steps:
First we'll do: "Nothing here."
It's position is at 28210

5) Subtract 10 from it. (hex)
Why 10?  NES cartridges do not have headers on them.  The headers are added by the people
who dump the rom to contain information that's needed for the emulators to run.  The NES,
therefore, doesn't recognize the existence of the header, and so we have to take it out.  (The
emulators do this automatically when they run the rom, but it doesn't change the values
embedded in the code itself)

Will I always need to do this?
Yes.  At least, I've never encountered or even heard of a rom where this wasn't true.

If not, do you have some links for me?

---------------

I did open the font file with the tile editor of Crystal Tile 2 and here is what I got:



I haven't been able to make the characters show up properly, even after many adjustments. Perhaps I can send you the file and you look into it?

Auryn

  • Hero Member
  • *****
  • Posts: 649
    • View Profile
Re: pointers, fonts, translating an english ROM - need some help
« Reply #4 on: March 04, 2011, 12:32:19 am »
The base is the same just the calculations are different.
NES is hacked to the end, NDS is relatively new as system so there are not new docs or specific values for it.
But like i said, the function is the same as in the NES.
Normal font dimentions are 8x8, 12x12, 16x16 or 8x12, 8x16 (sure even numbers and not odds).
And probably need some allignement


March 04, 2011, 03:15:04 am - (Auto Merged - Double Posts are not allowed before 7 days.)
I took a look at your game, first of all it's always dangerous to work with games that are so "new" but if u are sure there will not be a euro version, go on.

About the pointers: it took me about 5 min to figure this out but it's ok... u are learning:p
The black arrows are the important things, the pink are the next that u will need.
What u are looking for is just stored in "little endian" or mirrored (gespiegelt) if u like it more in this game:

I will not tell u because u need to figure it out by yourself for the future.
I didn't try it out but I am 99% sure I am right.

For the font, u have to find out wich one is the right one the game uses.
There are fonts in each kanji file

« Last Edit: March 04, 2011, 03:15:05 am by Auryn »

aurion

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: pointers, fonts, translating an english ROM - need some help
« Reply #5 on: March 04, 2011, 02:11:29 pm »
I decided I will deal with pointers later. First I have to finsih the font file/s.

I still cant get the characters show up properly in the tile viewer of Crystal Tile 2. This is what I know:

* The correct tile form is NDS 1bpp
* The correct font dimension if 16x16

That's it. All I have to do is to find the correct offset, right? But I tried and tried. Still the letters look like this:



Can you please take a look at the kanji_n.dat file and show me, how it's done correctly?

Romsstar

  • Full Member
  • ***
  • Posts: 129
    • View Profile
Re: pointers, fonts, translating an english ROM - need some help
« Reply #6 on: March 05, 2011, 09:13:17 am »
I suggest you try using Feidian.
Although it is kinda like last resort it is pretty easy to work with as soon as you find out how actually.xD
Would make it easier to extract and reinsert the edited font file since it can work with BMPs.

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 6846
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: pointers, fonts, translating an english ROM - need some help
« Reply #7 on: March 05, 2011, 10:16:03 am »
That font looks like a kind of RLE compression.
Unfortunately, I don't know anything about DS hacking, or even GBA, so I can't help any more.
"My watch says 30 chickens" Google, 2018

Juanfco

  • Jr. Member
  • **
  • Posts: 7
    • View Profile
Re: pointers, fonts, translating an english ROM - need some help
« Reply #8 on: March 05, 2011, 01:32:08 pm »
You can use Tile Molester.
Open the fonts with it and use mode 2 codec 1 bpp linear-reverse mode ;)

aurion

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: pointers, fonts, translating an english ROM - need some help
« Reply #9 on: March 06, 2011, 06:26:12 pm »
Tile Molester is not working for me. I have Java installed and any Java application works, except Tile Molester. After executing tm.jar nothing happens.

How do I use FEIDIAN? I installed PHP, but what now? How can I execute FEIDIAN and more importantly, what commands do I have to use? I have Windows XP installed.

Edit: Ok, there was an issue with Java. I re-installed it and Tile Molester did work. But unfortunately I still cant get the letters shop up properly. This is what I get with Mode: 2-Dimensional and Codec: 1bpp linear reverse-order:



And this is what I get with Mode: 1-Dimensional and Codec: 2bpp planar:



Can anyone actually show me how it's done? That way I would learn faster and dont need to unnecessarily waste valuable time  :)
« Last Edit: March 06, 2011, 07:20:24 pm by aurion »

Juanfco

  • Jr. Member
  • **
  • Posts: 7
    • View Profile
Re: pointers, fonts, translating an english ROM - need some help
« Reply #10 on: March 07, 2011, 11:14:22 am »
You can see four buttons with arrows and lines, right?
Well, you have to push the button which has an arrow pointing to the left until you see
the letters.

Ryusui

  • Hero Member
  • *****
  • Posts: 4989
  • It's the greatest day.
    • View Profile
    • Tumblr
Re: pointers, fonts, translating an english ROM - need some help
« Reply #11 on: March 07, 2011, 11:23:14 am »
Use 1bpp linear, without reverse-order. Reverse order should only come into play if you're editing 4bpp graphics - those are in the GBA's little-endian format. Use the plus and minus keys to align.

Tile Molestor is a poor choice for DS font editing, though - it only supports 8x8 tiles, and DS fonts tend to be in odd sizes.
In the event of a firestorm, the salad bar will remain open.

Juanfco

  • Jr. Member
  • **
  • Posts: 7
    • View Profile
Re: pointers, fonts, translating an english ROM - need some help
« Reply #12 on: March 07, 2011, 11:46:25 am »
He has to use 1 bpp linear reverse-order, because, using 1 bpp linear, the font looks reversed. It's like see it in a mirror.

aurion

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: pointers, fonts, translating an english ROM - need some help
« Reply #13 on: March 07, 2011, 02:48:09 pm »
@Juanfco: Of course I can see four buttons with arrows and lines, but it's no use, no letters show up properly. Can I send you the file and you show me how it's done?

@Ryusui: Tile Molester only supprts 8x8 tiles? Well the font uses 16x16 tiles. Does this mean Tile Molester is inappropriate for editing the font file?

Juanfco

  • Jr. Member
  • **
  • Posts: 7
    • View Profile
Re: pointers, fonts, translating an english ROM - need some help
« Reply #14 on: March 07, 2011, 03:06:26 pm »
Ok, try this: Go to "View", select "Block Size" and click on "Custom".  Columns=2 ; Rows=16

Ryusui

  • Hero Member
  • *****
  • Posts: 4989
  • It's the greatest day.
    • View Profile
    • Tumblr
Re: pointers, fonts, translating an english ROM - need some help
« Reply #15 on: March 07, 2011, 03:21:27 pm »
@Juanfco: Of course I can see four buttons with arrows and lines, but it's no use, no letters show up properly. Can I send you the file and you show me how it's done?

@Ryusui: Tile Molester only supprts 8x8 tiles? Well the font uses 16x16 tiles. Does this mean Tile Molester is inappropriate for editing the font file?

If the font really is 16x16, then not only will Tile Molester work, but you can even set the "Custom Block" function to display each character as a single piece rather than four unconnected tiles. But I think you'll find the game is using something very similar to the DS' standard 12x12 font - even if it is, for some maddening reason, stored in an unconventional format.
In the event of a firestorm, the salad bar will remain open.

Auryn

  • Hero Member
  • *****
  • Posts: 649
    • View Profile
Re: pointers, fonts, translating an english ROM - need some help
« Reply #16 on: March 08, 2011, 02:11:55 pm »
Sorry Auron, it's your project, u should find it out and not let the others do your work.
The first question u should ask yourself before u actually try to modify that font is "is it really the font used in the game??".
An easy way to check this is make a copy of that file and save it somewhere (it's your original u can put back in the game after u checked it). Now with tilemolester or any other tools that u can edit that font, just draw some lines across the font with each color of the palette and recompless your game and try it out.
If the font is all messed up, then u know it's the real font used in the game, reinsert the saved copy of the font and search further.

If u want to hack the font, that would be my first step. Second is to take a good look at the font on screen in the game.





zoom in and see this:
[/URL]

So, now u see that there is a shadow all around the letter and the font is at least 3 colors. A Palette can only have even numbers (2, 4, 8, ....) so this one is must be a 4 colors = 2bpp font.
1 white (the text imself)
2 gray (the shadow)
3 the filling of the arrow down
4 black (transparent)

Now take a look at the lowest characters g or ,  and the highest like " and '
by cobinating 2 of those characters u can get something like:



I made the chess board on top and on the right for easier count of pixel anyway now u know that your font should be a 8x14 font. Why i said it should?? If the fon't in kanji-n is really the one used on the game and it's not compressed in anyway, u see clearly the difference that there is no shadow in kanji-n.
This means there is another font in the game or it adds the shadow on screen. The only way to find this out is to trace back the code in the game by putting a breakpoint on read at the beginning of some text and go back from there.
Asm knowledge is needed there.

So the best option i see for u is that u translate the whole game with "ae oe ue" and come back to this later :p